Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2009 Maplesoft, a division of Waterloo Maple Inc. Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft Physical Modelling.

Similar presentations


Presentation on theme: "© 2009 Maplesoft, a division of Waterloo Maple Inc. Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft Physical Modelling."— Presentation transcript:

1 © 2009 Maplesoft, a division of Waterloo Maple Inc. Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft Physical Modelling

2 © 2009 Maplesoft, a division of Waterloo Maple Inc. Goal: To clearly define the concepts of: Causal/Acausal modelling Symbolic/Numeric formulation Highlight the differences between these modelling and formulation approaches Clearly communicate why these differences matter

3 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

4 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

5 © 2009 Maplesoft, a division of Waterloo Maple Inc. Getting Context: Plant modelling Problem it is trying to solve: Create a mathematical description of a system given: 1.Mathematical models of the components included in the system – for example: Resistor: v = i*R Mass: F = m*a 2.How the components are interconnected

6 © 2009 Maplesoft, a division of Waterloo Maple Inc. Getting Context: Controller modelling Problem it is trying to solve: Create a procedure to control how a target plant model will behave given: 1.Desired behaviour of the system 2.Plant model inputs that can be controlled (voltages, motions, pressures, temperatures, etc.) 3.Outputs that can be measured (voltages, motions, pressures, temperatures, etc.) Control laws are more algorithmic than physical in nature Controller Plant model inputs measured outputs desired behaviour

7 © 2009 Maplesoft, a division of Waterloo Maple Inc. Getting Context: Causal vs. Acausal Casaul modelling: Based on the flow of a signal through a diagram Well suited to Controller Modelling Acasaul modelling: Based on interconnection of components Well suited to Plant Modelling RL v(t) J

8 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

9 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: How it’s done... Basic steps for building a causal model: 1.Formulate the differential equations and manipulate them to solve for the desired form (different depending on if you’re modelling a plant or a controller) ~ RL V

10 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: How it’s done... Basic steps for building a causal model: 2.Transform equations into signal flow diagrams block by block using atomic operators (gains, adders, etc)

11 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: Why it’s used... This modelling approach is often used for the following reasons: Controller Modelling: Intuitive way to model controllers Forced Insight: Process of formulating the equations can yield insight into how the system works Familiarity: Design tools of this nature have been around for decades Legacy Models: All of the previous models they have were built this way – they want to extend them or connect to them

12 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: Challenges... 1.Complexity of equations does not scale linearly with the size of the system As complexity/size increases, so does the chance of errors Prevents high fidelity modelling of larger systems, particularly when applied to plant models # of Links# of Additions# of Multiplications# of Acausal Blocks 1275 221829 313566013 46693,97417 52,72619,22421 * Cost of dynamic equations, joint coordinate formulation, basic symbolic simplify() Example: 3D pendulum with increasing number of links:

13 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: Challenges... 2.Generated model looks nothing like the formulated equations or model diagram Assumptions made during equation formulation lost Hard to track errors Hard to visually understand the purpose of the system ~ RL V ? ?

14 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: Challenges... 3.Since these models have predefined inputs/outputs, it is difficult to (properly) connect two causal models This becomes more important as the scope of models increases (i.e. connect powertrain model to chassis/tire model) In some cases this can require an equation re-formulation (to be done properly) ? Engine/ Powertrain AngleInputs Chassis/Tire Torque Outputs

15 © 2009 Maplesoft, a division of Waterloo Maple Inc. Causal Modelling: Why MapleSim... 1.MapleSim/Maple has tools for deriving, checking, and manipulating equations Saves time and reduces errors during the 1 st stage of causal model creation (equation generation stage) 2.MapleSim/Maple can automatically convert equations to a component block (causal or acausal) Automates the 2 nd stage of causal model creation (saves time, reduces error) 3.MapleSim/Maple provides a live document detailing the assumptions and equations that created the model Saves time and reduces errors when modifying the model equations in the future Simplifies (and makes possible) the ability to properly link two causal models together MapleSim/Maple is an excellent causal modelling tool

16 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

17 © 2009 Maplesoft, a division of Waterloo Maple Inc. Acausal Modelling: How it’s done... Basic steps for building an acausal model: 1.Use blocks or components to define the topology of your system RL v(t) J ~ RL V

18 © 2009 Maplesoft, a division of Waterloo Maple Inc. Acausal Modelling: Why it’s used... This modelling approach is often used for the following reasons: Plant Modelling: Intuitive way to model plants – this approach is not used for controller modelling since controller models assume causal relationships Ease of Modifying Models: Changing the model only requires changing the way you’ve connected components Ease of Combining Systems: Combining separately created systems is trivial – details of connecting them automatically handled by the modelling tool Visual Clarity: Diagrams are easier to understand via visual inspection

19 © 2009 Maplesoft, a division of Waterloo Maple Inc. Acausal Modelling: Challenges... Too Powerful, Too Easy: Some feel there is a loss of system insight because you don’t have to manually derive the equations Cannot Convert Legacy Models: There is no mapping between a legacy causal model and an acausal model…you can’t automatically convert/update your causal models

20 © 2009 Maplesoft, a division of Waterloo Maple Inc. Acausal Modelling: Why MapleSim... 1.MapleSim/Maple can automatically generate the governing equations for any model and provides powerful tools for inspecting/manipulating those equations 2.MapleSim/Maple can automatically convert equations to a component block (causal or acausal) Useful to researches who want to introduce a particular physical phenomena Ability to extend the MapleSim blockset without being a programmer 3.As of MapleSim V2, 3D systems can be automatically visualized, providing additional insight into the behaviour/motion of a system MapleSim/Maple is an excellent acausal modelling tool

21 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

22 © 2009 Maplesoft, a division of Waterloo Maple Inc. Simulation: Two approaches... User presses “Simulate” Program generates the simulation procedure and integrates the system forward in time Program displays results Symbolic Formulation Numeric Formulation User creates model (Causal, Acausal, or Both) User creates model (Causal, Acausal, or Both) OR

23 © 2009 Maplesoft, a division of Waterloo Maple Inc. Different formulation approaches Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation MapleSim Symbolic Formulation Standard Numeric Formulation Model Definition Simulation Procedure Generation with Limited Optimization Simulation

24 © 2009 Maplesoft, a division of Waterloo Maple Inc. Standard Numeric Formulation Model Definition Simulation Procedure Generation with Limited Optimization Simulation Generated procedure is a set of routines that multiply/add numerical matrices to reformulate the equations at each time step -6 multiplications, 4 additions per step Certain optimizations can be built into these routines but these are limited, and must be defined ahead of time

25 © 2009 Maplesoft, a division of Waterloo Maple Inc. MapleSim Symbolic Formulation A model’s chosen state variables directly impact the number and complexity of the resulting equations Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation Absolute coordinates (e.g. ADAMS): 78 coords (12 per leg, 6 for the platform), 78 dynamic equations, +72 constraint equations = 150 equations Hybrid coordinates (MapleSim): 24 coords( 3 per leg, 6 for the platform) 24 dynamic equations + 18 constraints = 42 equations Example: Stewart Platform

26 © 2009 Maplesoft, a division of Waterloo Maple Inc. MapleSim Symbolic Formulation Generated equations are true for all time, using the previous example: -2 multiplications, 1 addition per step (versus original 6 and 4, respectively) Equations can be viewed, analyzed and manipulated in the Maple environment Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation

27 © 2009 Maplesoft, a division of Waterloo Maple Inc. MapleSim Symbolic Formulation Multiplications by 1’s, 0’s automatically removed (previous slide) Simple equations directly solved, reducing the number of variables to integrate Trigonometric simplifications: Coordinate Selection Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation Equation Generation

28 © 2009 Maplesoft, a division of Waterloo Maple Inc. MapleSim Symbolic Formulation Expressions that are repeated within the equations are identified and isolated so they are only computed once Coordinate Selection Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation Equation Generation

29 © 2009 Maplesoft, a division of Waterloo Maple Inc. MapleSim Symbolic Formulation Using MapleSim’s Addons, optimized procedures can be exported to a variety of targets: LabVIEW RT Toolchain Simulink RTW Toolchain Alternatively, these procedures can be generated in Standalone C-code (no Connectivity Toolboxes required) Coordinate Selection Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation Procedure Generation Model Definition Simulation Equation Generation

30 © 2009 Maplesoft, a division of Waterloo Maple Inc. Simulation: Why does this matter... MapleSim uses a symbolic formulation strategy. Key Challenge when using a symbolic formulation: Individuals who are used to numeric formulations will notice a “slow-down” between when the press “simulate” and when they see their results Key Advantage of using a symbolic formulation: This is an enabling technology – it allows the generation of real-time code for systems that numeric formulations cannot Physical Controller Physical Controller Code Generated Plant Code Generated Plant Real-time code to test controller

31 © 2009 Maplesoft, a division of Waterloo Maple Inc. Integrator Desktop When simulating an entire system on an engineer’s desktop, a faster simulation procedure means quicker iterations through design modifications. Plant Model Controller Model Simulation Procedure Result Visualization Simulation: Why does this matter...

32 © 2009 Maplesoft, a division of Waterloo Maple Inc. When trying to simulate the plant model in real-time with external hardware, a faster simulation procedure is the difference between “possible” and “not possible”. Integrator Plant Model - Controller -User Feedback - Controller -User Feedback Simulation Procedure Real-time Platform External Hardware Simulation: Why does this matter...

33 © 2009 Maplesoft, a division of Waterloo Maple Inc. Therefore, a better way to formulate the simulation procedure means that larger, higher-fidelity models can be tested in a real-time environment MapleSim uses the power of symbolics to generate extremely efficient simulation procedures Integrator Plant Model - Controller -User Feedback - Controller -User Feedback Simulation Procedure Real-time Platform External Hardware Simulation: Why does this matter...

34 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.Symbolics: A key difference 6.Summary

35 © 2009 Maplesoft, a division of Waterloo Maple Inc. What about symbolics… The connection between MapleSim and it’s connection to the Maple environtment is the key difference between MapleSim and other modelling tools. 1.If you’re deriving equations (plant or controller)… Manage/manipulate/formulate equations View/analyse equations Automatically convert equations into component models 2.If you’re doing plant modelling… Automatically generate equations for analysis Tools to work with the equations (see 1.) 3.If you’re generating real-time code… Enabling technology – fast, efficient code

36 © 2009 Maplesoft, a division of Waterloo Maple Inc. 1.Getting Context: Plants, Controllers, Causal, Acausal 2.Causal Modelling: How, Why, Why MapleSim 3.Acausal Modelling: How, Why, Why MapleSim 4.Simulation: What happens when you press “Simulate” 5.How Symbolics fit in 6.Summary

37 © 2009 Maplesoft, a division of Waterloo Maple Inc. Summary 1.MapleSim is an excellent tool for causal modelling 1.Tools to naturally view/manipulate equations 2.Equations can be automatically turned into components 3.Knowledge capture 2.MapleSim is an exceptional tool for acausal modelling 1.Equations can be viewed for added insight and analysis 2.3D visualization 3.Knowledge capture 3.MapleSim can model both Acausal and Causal system in the same environment 4.The symbolic formulation strategies used by MapleSim allow the creation of real-time code for more complicated systems

38 © 2009 Maplesoft, a division of Waterloo Maple Inc. Questions?

39 © 2009 Maplesoft, a division of Waterloo Maple Inc. User Human effort Computer effort Problem Analysis Intuition & physics Model equations Execute numerical algorithms Numerical algorithms General purpose languages e.g. FORTRAN Specialized numerical mathematics e.g. NAG, MATLAB State-based simulation e.g. Simulink Acausal modeling environments e.g. MapleSim Simulation model Problem Analysis Intuition & physics Model equations Execute numerical algorithms Numerical algorithms Problem Analysis Intuition & physics Model equations Numerical algorithms Execute numerical algorithms Simulation model Numerical experts Math experts Modeling experts Engineers User Math experts Modeling experts Engineers User Modeling experts Engineers The Evolution of Multi-Domain Modeling

40 © 2009 Maplesoft, a division of Waterloo Maple Inc. What about symbolics… Non-symbolic tools ModellingFormulation Insight and Analysis Equation Derivation Tools Equations -> Components more to come… Enabling Technology Flexibility more to come… Current Requirements Desired/Perceived Requirements MapleSim Additional potential largely because of symbolic approach


Download ppt "© 2009 Maplesoft, a division of Waterloo Maple Inc. Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft Physical Modelling."

Similar presentations


Ads by Google