1 / 40

Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft

Physical Modelling. Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft. Goal : To clearly define the concepts of: Causal/ Acausal modelling Symbolic/Numeric formulation Highlight the differences between these modelling and formulation approaches

holli
Download Presentation

Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Physical Modelling Chad Schmitke, Ph.D. Director of Maplesim Development, Maplesoft

  2. Goal: • To clearly define the concepts of: • Causal/Acausalmodelling • Symbolic/Numeric formulation • Highlight the differences between these modelling and formulation approaches • Clearly communicate why these differences matter

  3. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

  4. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

  5. Getting Context: Plant modelling • Problem it is trying to solve: • Create a mathematical description of a system given: • Mathematical models of the components included in the system – for example: • Resistor: v = i*R • Mass: F = m*a • How the components are interconnected

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

  7. Getting Context: Causal vs. Acausal • Casaulmodelling: • Based on the flow of a signal through a diagram • Well suited to Controller Modelling • Acasaulmodelling: • Based on interconnection of components • Well suited to Plant Modelling R L v(t) J

  8. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

  9. Causal Modelling: How it’s done... • Basic steps for building a causal model: • 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) R L ~ V

  10. Causal Modelling: How it’s done... • Basic steps for building a causal model: • Transform equations into signal flow diagrams block by block using atomic operators (gains, adders, etc)

  11. 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. Causal Modelling: Challenges... • 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 Example: 3D pendulum with increasing number of links: * Cost of dynamic equations, joint coordinate formulation, basic symbolic simplify()

  13. Causal Modelling: Challenges... • 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 ? R L ~ V ?

  14. Causal Modelling: Challenges... • 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 Inputs Angle ? Chassis/Tire Torque Outputs

  15. Causal Modelling: Why MapleSim... MapleSim/Maple is an excellent causal modelling tool • MapleSim/Maple has tools for deriving, checking, and manipulating equations • Saves time and reduces errors during the 1st stage of causal model creation (equation generation stage) • MapleSim/Maple can automatically convert equations to a component block (causal or acausal) • Automates the 2nd stage of causal model creation (saves time, reduces error) • 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

  16. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

  17. Acausal Modelling: How it’s done... • Basic steps for building an acausal model: • Use blocks or components to define the topology of your system R L R L ~ v(t) V J

  18. 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 • VisualClarity: Diagrams are easier to understand via visual inspection

  19. 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. Acausal Modelling: Why MapleSim... MapleSim/Maple is an excellent acausal modelling tool • MapleSim/Maple can automatically generate the governing equations for any model and provides powerful tools for inspecting/manipulating those equations • 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 MapleSimblockset without being a programmer • As of MapleSim V2, 3D systems can be automatically visualized, providing additional insight into the behaviour/motion of a system

  21. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

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

  23. Different formulation approaches Standard Numeric Formulation MapleSim Symbolic Formulation Model Definition Model Definition Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation with Limited Optimization Simulation Procedure Generation Simulation Simulation

  24. Standard Numeric Formulation • 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 Model Definition Simulation Procedure Generation with Limited Optimization Simulation

  25. MapleSim Symbolic Formulation • A model’s chosen state variables directly impact the number and complexity of the resulting equations Model Definition Coordinate Selection Example: Stewart Platform Equation Generation Symbolic Simplification Code Optimization • 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 Simulation Procedure Generation Simulation

  26. 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 Model Definition Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation

  27. 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: Model Definition Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation

  28. MapleSim Symbolic Formulation • Expressions that are repeated within the equations are identified and isolated so they are only computed once Model Definition Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation

  29. 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) Model Definition Coordinate Selection Equation Generation Symbolic Simplification Code Optimization Simulation Procedure Generation Simulation

  30. 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 Real-time code to test controller Code Generated Plant Physical Controller

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

  32. Simulation: Why does this matter... • 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”. Real-time Platform External Hardware Simulation Procedure • Controller • User Feedback Plant Model Integrator

  33. Simulation: Why does this matter... • 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 Real-time Platform External Hardware Simulation Procedure • Controller • User Feedback Plant Model Integrator

  34. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” Symbolics: A key difference Summary

  35. 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. • If you’re deriving equations (plant or controller)… • Manage/manipulate/formulate equations • View/analyse equations • Automatically convert equations into component models • If you’re doing plant modelling… • Automatically generate equations for analysis • Tools to work with the equations (see 1.) • If you’re generating real-time code… • Enabling technology – fast, efficient code

  36. Getting Context: Plants, Controllers, Causal, Acausal Causal Modelling: How, Why, Why MapleSim AcausalModelling: How, Why, Why MapleSim Simulation: What happens when you press “Simulate” How Symbolics fit in Summary

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

  38. Questions?

  39. The Evolution of Multi-Domain Modeling General purposelanguages e.g. FORTRAN Specialized numerical mathematics e.g. NAG, MATLAB State-based simulation e.g. Simulink Acausal modelingenvironments e.g. MapleSim Problem Analysis Problem Analysis Problem Analysis Problem Analysis Human effort Intuition & physics Intuition & physics Intuition & physics Intuition & physics Model equations Model equations Model equations Model equations Simulation model Simulation model Simulation model Simulation model Computer effort Numerical algorithms Numerical algorithms Numerical algorithms Numerical algorithms Execute numericalalgorithms Execute numericalalgorithms Execute numericalalgorithms Execute numericalalgorithms Numerical experts Math experts Modeling experts Engineers User User Math experts Modeling experts Engineers User User Modeling experts Engineers User User Engineers

  40. What about symbolics… Current Requirements Desired/Perceived Requirements Non-symbolic tools MapleSim Additional potential largely because of symbolic approach

More Related