Simulation Modelling Lecture2 Simulation Types Tools and Simulators

  • Slides: 16
Download presentation
Simulation & Modelling Lecture-2: Simulation Types, Tools and Simulators Systems Engineering Training Programme for

Simulation & Modelling Lecture-2: Simulation Types, Tools and Simulators Systems Engineering Training Programme for DRDO Scientists at IAT, Pune 2 nd July 2003

Lecture Outline • Software Simulation & Languages • Concept of a Simulator. • Engineering

Lecture Outline • Software Simulation & Languages • Concept of a Simulator. • Engineering Simulators. • Basic Philosophy of Simulator Building • Examples of Software Simulators. • Examples of Hardware Based Simulators.

Why Software Simulation? – Software simulation is usually a low cost, quick turnaround time

Why Software Simulation? – Software simulation is usually a low cost, quick turnaround time option for most of the design cycles. – Ability to solve complex mathematical equations (e. g. CFD) enhances the utility of software simulation to the design & development process. – Availability of fast and powerful digital computers have rendered software simulation quite popular. – Pure software simulations can come fairly close to real system, as an aid in crucial decision making.

What is Software Simulation? – Software simulation pertains to solution of a purely mathematical

What is Software Simulation? – Software simulation pertains to solution of a purely mathematical model. – Software simulation generates system response to inputs, without actual product realization. – In involves writing a program that is executed on a computer, to create the ‘real’ situation. – Software simulations can be both “Offline” as well as “real-time” simulation.

Software Simulation Tools – Software simulation is carried out by programming a digital computer

Software Simulation Tools – Software simulation is carried out by programming a digital computer suitably. – Programming is usually carried out in a higher level language, either general purpose or special purpose. – Extensive graphic support is needed to set up a software simulation. – Operating System also plays an important role in setting up a software simulation.

Software Simulation Languages – General purpose simulation languages are usually not designed for specific

Software Simulation Languages – General purpose simulation languages are usually not designed for specific needs of simulation. – FORTRAN, C, C++ etc. are examples of such general purpose languages which can be used for setting up a software simulation. – These are designed for many different applications and programming effort, to create a specific simulation, can be quite large. – However, these are highly portable across different computer hardware, Operating System & Compiler, resulting in cost-effective simulations.

Software Simulation Languages – Special purpose simulation languages are designed keeping in mind, specific

Software Simulation Languages – Special purpose simulation languages are designed keeping in mind, specific needs of simulation. – These contain a library of pre-defined macros (or “tools”) which minimize overall programming effort. – CSMP is a popular language for continuous system simulation. – For discrete system models, GPSS, SIMLIB, ALGOL, SIMSCRIPT II, SIMULA, etc. are used. – Non-portability is usually the main drawback for these special purpose language, making them costly.

Software Simulation Languages – Another class of languages, called symbolic language, also find use

Software Simulation Languages – Another class of languages, called symbolic language, also find use in setting up simulations. – These provide a library of mathematical functions which can be put together to create a simulation. – MATLAB is one such symbolic language that has acquired significant popularity as a simulation language, mainly because of programming simplicity. – Provision of a variety of tool boxes in MATLAB has made it applicable to a large set of Engg. problems.

Software Simulation in CSMP provides for following macros. Y = INTGRL(IC, x), Y(0) =

Software Simulation in CSMP provides for following macros. Y = INTGRL(IC, x), Y(0) = IC Y = LIMIT(P 1, P 2, x) Y=STEP(P) Y = EXP(x) Y = ABS(x) Y = ALOG(x) Y = SIN(x) Y = COS(x) Y = SQRT(x) Y = AMAX 1(x 1, x 2, …, xn) Y = AMIN 1(x 1, x 2, …, xn) INCON – Initial Conditions CONST – Constant PARAM – Parameter TIMER – Time Interval PRINT – Printing Variables PRTPLT – Plotting Data TITLE – Output Heading LABEL – Intermediate Headings END – End of Program ENDJOB – Task Completion

Example of CSMP Code • Suspension System - (Step Response) M K X D

Example of CSMP Code • Suspension System - (Step Response) M K X D F TITLE SUSPENSION SYSTEM PARAM D = (5. 56, 16. 9, 39. 5, 56. 5) X 2 DOT = (1. 0/M)*(K*F – K*X – D*XDOT) XDOT = INTGRL(0. 0, X 2 DOT) X = INTGRL(0. 0, XDOT) CONST M = 2. 0, F = 1. 0, K = 400. 0 TIMER DELT=0. 005, FINTIM=1. 5, PRDEL=0. 05, OUTDEL=0. 05 PRINT X, XDOT, X 2 DOT PRTPLT X LABEL DISPLACE. VS. TIME END STOP

Software Simulation in SIMULINK provides following functional groups. Discrete: Unit Delay, Integrator, 0 Order

Software Simulation in SIMULINK provides following functional groups. Discrete: Unit Delay, Integrator, 0 Order Hold, 1 st Order Hold, DTF, DSS, Dfilter, Dzero-Pole Linear: Gain, Sum, Integrator, TFunction, State-Space, Zero. Pole, Derivative, Dot Product Sources: Constant, Signal Generator, Step, Sine, Chirp, Clock, File, Random No. Tool Boxes: Communication, DSP, Control, Fuzzy, System ID, NNET, State. Flow, NCD Connections: In, Out, Mux, Demux, From, Goto, Data Store/Read, Memory, Enable, Trigger, Ground, Terminator, IC, Subsystem, Selector, Width Nonlinear: Abs, Math, Trig. , Floor, Min. Max, Product, Logic, Relation, Sign, Rate Limit, Saturation, Function, …. Etc. Sinks: Scope, X-Y Graph, Display, File, Stop

Example of SIMULINK Model • Suspension System - (Step Response) M K X D

Example of SIMULINK Model • Suspension System - (Step Response) M K X D F

Simulation in FORTRAN or C • Suspension System - (Step Response) M K X

Simulation in FORTRAN or C • Suspension System - (Step Response) M K X D F Main Program Data Structures Data Communication Strategy Integration Subroutine Plotting Subroutine

Flight Simulation – Flight simulation pertains to solution and visualization of controlled aircraft motion.

Flight Simulation – Flight simulation pertains to solution and visualization of controlled aircraft motion. – There are many levels at which flight simulation is performed, depending on the need. – At the lowest end, we have “Design Simulation”, which is a purely mathematical exercise. It contains highly idealized sub-system models. – Next, is the Engineering Simulator, in which more accurate and detailed models of many sub-systems are available. However, no hardware is included.

Flight Simulation – “Iron Bird” simulation is the next level of flight simulation wherein

Flight Simulation – “Iron Bird” simulation is the next level of flight simulation wherein a majority of sub-system hardware, excepting aircraft, are integrated with software models. – “Pilot-in-Loop” simulation caters for man-machine interface development and is usually carried out at number of stages. – In-Flight simulation is a technique used to check out new sub-system designs (especially Control Laws) on an existing proven aircraft. – Ground based Real Time Simulation, on a motion platform, is closest to “Flight Simulation”.

Summary of Software Simulation – Software simulation is a design tool that needs to

Summary of Software Simulation – Software simulation is a design tool that needs to be configured based on specific needs. – Computer, Operating System and Languages play an important role in software based simulations. – Simulator is the system that is capable of performing simulations as per the need. – Next part of lecture deals with simulator related issues.