Efficient Software Tools in the Renewable Energy Domain: Maple and Maplesim
Total Page:16
File Type:pdf, Size:1020Kb
EnviroInfo 2013: Environmental Informatics and Renewable Energies Copyright 2013 Shaker Verlag, Aachen, ISBN: 978-3-8440-1676-5 Efficient software tools in the renewable energy domain: Maple and MapleSim Ji ří H řebí ček 1, Jaroslav Urbánek 1,2 Abstract There are presented efficient software tools Maple and MapleSim for solving technical problems in the renewable energy domain using mathematics-based modelling. MapleSim represents the simulation environment, which has a graphical interface for interconnecting system components. The system models are then processed by the Maple (symbolic computation system) mathematics engine, and finally the differential-algebraic equations describing the solved systems are simulated numerically to produce and 2-D, 3-D visualise output results. Maple allows users to quickly focus and reliably solve problems with easy access to over 5000 algorithms and functions developed over 30 years of cutting-edge research and development. In the paper there are presented two solved problems in the renewa- ble energy domain, which are freely downloadable from the web of the Canadian company Maplesoft developing above software tools. 1. Introduction The Canadian company Maplesoft 3 has developed simple and friendly used software tools Maple® 4 and MapleSim® 5 which reduce the cost and effort of developing high-fidelity models of power generation and energy storage systems, including gas and steam turbine generator sets; wind, wave, and solar energy sys- tems and batteries. Maple information technology has been trusted as a cutting edge mathematical and technical tool for over 30 years. In that time, millions of users from around the world have used and relied on the power of Maple for their research, testing, analysis, design, teaching, and schoolwork (Gander/Hřebí ček 2004), (Lynch 2009), (Borwein/Skerritt 2011), (Fox 2011), (Hřebí ček et al 2011), (Hřebí ček 2012). MapleSim is a modelling environment for creating and simulating complex multidomain physical sys- tems. It allows users to build component diagrams that represent physical systems in a graphical form. Us- ing both symbolic and numeric approaches, MapleSim automatically generates model equations from a component diagram and runs high-fidelity simulations (Hřebí ček 2008), (H řebí ček/ Řezá č 2008), (MapleS- im 2013), (Cao/Wu 2013). These software tools reduce model development and analysis time for scientists and researchers; rapidly create system-level models to simulate the behaviour of the entire system in a single environment for en- gineers and academicians; take advantage of advanced analysis, visualization, and programming tools to perform customized analysis and model investigations not possible with other software tools. Users of these software tools get the fastest auto-generated code for optimization and real-time simulation, includ- 1 Masaryk University, Institute Biostatistics and Analyses, Kamenice 126/3, 62500 Brno, Czech Republic {hrebicek, ur- banek}@iba.muni.cz 2 Masaryk University, Research Centre for Toxic Compounds in the Environment, Kamenice 753/5, 62500 Brno, Czech Republic, [email protected] 3 http://www.maplesoft.com/ 4 http://www.maplesoft.com/products/Maple/ 5 http://www.maplesoft.com/products/maplesim/ ing hardware-in-the-loop (HIL) and pass their work down the tool-chain through smooth integration with other tools, including software tools MATLAB® 6, Simulink 7 and Modelica 8. 1.1 MapleSim We shall discuss solving renewable energy domain problems using MapleSim (release 6.1) as the simula- tion environment (MapleSim 2013). The MapleSim software allows engineers to use both causal and acausal modelling paradigms (H řebí ček 2008), (H řebí ček/ Řezá č 2008), (Cao/Wu 2013). Many simulation software tools are restricted to causal (or signal-flow) modelling. In these software tools, a unidirectional signal, which is essentially a time-varying number, flows into a block. The block then performs a well-defined mathematical operation on the signal and the result flows out of the other side. This approach is useful for modelling systems that are defined purely by signals that flow in a single direction, such as control systems and digital filters. MapleSim enables modelling and simulation of real engineered assemblies, such as motors and power- trains, turbines etc. consisting of a network of inter-acting physical components. They are commonly modelled in MapleSim by block diagrams. The lines connecting two blocks indicate that they are coupled by physical laws (MapleSim 2013). The Fig. 1 and Fig. 2 represent two versions of modelling behaviour of the same Double Mass Spring Damper with two masses M1 and M2 connected to springs k1, k2 and dampers d1, d2 with input strength F(t) and output mass movements x1(t) and x2(t). A causal approach of modelling the Double Mass Spring Damper in MapleSim is shown in the Fig. 1. Figure 1 Causal Modelling Double Mass Spring Damper in MapleSim Source: Maplesoft MapleSim provides a broad range of acausal physical components across several physical domains; the equations that define their behaviour do not have to be derived or entered manually. Users can also create their own components; these are generated from the differential equations, algebraic expressions, or trans- fer functions that define the dynamics of the component (Cao/Wu 2013). The MapleSim component li- brary contains over 500 components that its user can use to build different models. All of these compo- 6 http://www.mathworks.com/products/matlab/ 7 http://www.mathworks.com/products/simulink/ 8 https://www.modelica.org/ Copyright 2013 Shaker Verlag, Aachen, ISBN: 978-3-8440-1676-5 nents are organized in palettes of the Libraries menu of MapleSim windows, see Fig. 4, according to their respective domains: electrical, magnetic; hydraulic; 1-D mechanical; multibody; signal blocks and ther- mal, (MapleSim 2013). Most of these components are based on the Modelica Standard Library 3.1 (Fritzson 2011) and Modelica Standard Library 3.2. An acausal approach to the same Double Mass Spring Damper model in MapleSim is shown in the Fig. 2. Figure 2 Acausal Modelling Double Mass Spring Damper Source: Maplesoft Figure 3 MapleSim components used in modelling the Double Mass Spring Damper in the Fig. 2 Source: Maplesoft In the Fig. 3, we can see MapleSim components used for the acausal approach modelling the Double Mass Spring Damper in the Fig. 2 (MapleSim 2013): • Fig. 3a) describes a Step component which generates a constant real output, y (in our case F(t)), after a time offset, t = T0, during a simulation. • Fig 3b) describes the Translational Force component generates a force proportional to an input signal f (in our case F(t)). The component equation is fflange = f. • Fig 3c) describes the Mass component which models sliding mass m (in our case masses M1 and M2) with inertia and two rigidly connected flanges, without friction. The sliding mass has the length, L, and the position coordinate, s, is in the middle. A positive force at flange a moves the sliding mass m in the positive direction. A negative force at flange a moves the sliding mass to the negative direction. The component equations are: m · a = fa + fb v = ds / d t a = dv / d t. Copyright 2013 Shaker Verlag, Aachen, ISBN: 978-3-8440-1676-5 sa = s – L/2 sb = s + L/2 s(0) = s0. • Fig 3d) describes Translational Spring Damper component which consists of the linear 1-D transla- tional spring and damper components connected in parallel. Its equations are: f = c · ( srel - srel0 ) + d · vrel srel = sb - sa vrel = srel f = fb fa + fb = 0 • Fig 3e) describes the Translational Fixed component which models a flange of a 1-D translational mechanical system fixed at position, s0, in the housing. MapleSim user can use this component to con- nect a compliant element (for example, a spring or damper) between a sliding mass and the housing, or to fix a rigid element (for example, a mass) at a specific position. MapleSim allows users to use both causal and acausal approaches. Its user can simulate a physical sys- tem (with acausal modelling) together with the associated logic or control loop (with causal modelling) in a manner that suits either task best (MapleSim 2013). In the Fig. 4, there are two versions of the same model in Examples menu of MapleSim library (Users´ Guide Example, Chapter 1, Double Mass Spring Damper). The left diagram uses causal blocks and we can find it in the Signal Blocks palette of the MapleSim library. The right diagram uses 1-D translational blocks and we can find it in the 1-D Mechani- cal palette of the MapleSim library in menu on the left hand of the Fig. 4. These diagrams are compatible with Modelica blocks (Fritzson 2011). Simulation parameters are set up on the right hand of the Fig. 4. Figure 4 Comparison Models of Double Mass Spring Damper in MapleSim Source: Maplesoft MapleSim enables simulation process, where the results are generated and displayed using graphs showing the quantities of interest and, optionally for multibody mechanical systems, a 3-D animation. To view the behaviour or response of physical properties (for example displacements, velocity etc.), user can Copyright 2013 Shaker Verlag, Aachen, ISBN: 978-3-8440-1676-5 add named probes (see Output displacement velocity in the Fig. 2 and Causal Mass1 x, Causal Mass2 x, Acausal Mass1 x and Acausal Mass2 x in the Fig. 4), to connection lines, ports, or components in solved 2-D or 3-D model. These probes allow identifying the variables of interest that are associated with connec- tion ports. In the Fig. 5 plots, the positions x2(t) (displacements) of the upper mass M2 (Mass2) in probes Causal Mass2 x, Acausal Mass2 x and the positions x1(t) (displacement) of the lower mass M1 (Mass1) in probes Causal Mass1 x, Acausal Mass1 x are shown.