—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-1 Day 5 Section 9 - Continuous Simulation –Exercise 9 Section.

Slides:



Advertisements
Similar presentations
4.6 Related Rates Any equation involving two or more variables that are differentiable functions of time t can be used to find an equation that relates.
Advertisements

MATLAB Tutorial ECE 002 Professor S. Ahmadi.
5-8 solving radical equations and inequalities
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 3-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.
A Level Computing#BristolMet Session Objectives#U2 S8 MUST identify the difference between a procedure and a function SHOULD explain the need for parameters.
Evaluating Sine & Cosine and and Tangent (Section 7.4)
Review
F Day 3 Section 5 - Event Approach to Simulation Events
—————————— CACI Products Company ——————————————————————————————— SimScript II.5 —————————————— 5-1 Day 3 Section 5 - Event Approach to Simulation –Events.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 10-1 Day 5 Section 9 - Contiuous Simulation –Exercise 9 Section.
True BASIC Ch. 6 Practice Questions. What is the output? PRINT X LET X = -1 PRINT X FOR X = 4 TO 5 STEP 2 PRINT X NEXT X PRINT X END.
Do Loop The syntax of DO loop: DO variable = initial_value, final_value[, increment] [statements] END DO Example: PROGRAM LINES ! Illustration of DO-loops.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
11.3 Function Prototypes A Function Prototype contains the function’s return type, name and parameter list Writing the function prototype is “declaring”
—————————— CACI Products Company ———————————————————————————— SimScript II.5 —————————————— 8-1 Day 4 Section 7 - Simulation Control –User Interface Forms.
—————————— CACI Products Company ———————————————————————————— SimScript II.5 —————————————— Day 1, Section 1 Problem Solution C:\Program Files\Simscript3\models\READFILE2.
—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 2-1 Day 1 Section 1 - The General Purpose Language –Overview.
Simscript II.5 Building simulation model with SIMSCRIPT II.5.
Revision – A simple program How to start a program? How to end a program? How to declare variables? What are the mathematical operators? How to start a.
—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 1-1 Day 1 Section 1 - The General Purpose Language –Introduction.
—————————— CACI Products Company ————————————————————————————— SimScript II.5 —————————————— 4-1 Day 2 Section 3 - Introduction to Process Simulation –Modeling.
SIMSCRIPT1 Modeling and Simulation in SIMSCRIPT II.5 A complete, modern, general purpose programming language –English like syntax is self documenting.
Chapter 7 Section 1. Copyright © 2012, 2008, 2004 Pearson Education, Inc. Objectives 1 The Fundamental Property of Rational Expressions Find the numerical.
1. 2, 4, 6, 8, 10, … 2. 15, 11, 7, 3, -1, … , -7, -2, 3, 8, …
Trigonometric Functions Of Real Numbers
TI89 and Voyage 200 Student Support Services Presented by Andy Williamson and Amanda Griffin.
Design of an ODE Solver Environment. System of ODEs Consider the system of ODEs: Typically solved by forward Euler or 4th order Runge-Kutta.
Algorithmic Recursion. Recursion Alongside the algorithm, recursion is one of the most important and fundamental concepts in computer science as well.
Chapter 3: Functions and Graphs 3.1: Functions Essential Question: How are functions different from relations that are not functions?
Section 1.3 Functions. What you should learn How to determine whether relations between two variables are functions How to use function notation and evaluate.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Section 7.5 Unit Circle Approach; Properties of the Trigonometric Functions.
1.4 Parametric Equations. Relations Circles Ellipses Lines and Other Curves What you’ll learn about… …and why Parametric equations can be used to obtain.
Sullivan Algebra and Trigonometry: Section 11.7 Objectives of this Section Graph Parametric Equations Find a Rectangular Equation for a Curve Defined Parametrically.
1 E0001 Computers in Engineering Built in Functions.
Functions Section 1.4. Relation The value of one variable is related to the value of a second variable A correspondence between two sets If x and y are.
Homework Assignment #4 J. H. Wang Dec. 3, 2007.
Section 6.1 Notes Special Angles of the Unit Circle in degrees and radians.
Computing the Values of Trigonometric Functions of Acute Angles Section 3.3.
Section 13.1.b Solving Triangles. 7.) Find the angle Ɵ if cos Ɵ = (Read as “the angle whose cos is:___”) Be sure you know the mode your calculator.
Why Repetition? Read 8 real numbers and compute their average REAL X1, X2, X3, X4, X5, X6, X7, X8 REAL SUM, AVG READ *, X1, X2, X3, X4, X5, X6, X7, X8.
2.2 Properties of Exponents Objectives: –Evaluate expressions involving exponents. –Simplify expressions involving exponents. Standard: – A. Use.
Function Notation and Making Predictions Section 2.3.
Chapter 1 – Expressions, Equations, and Functions Algebra I A - Meeting 4 Section 1.6 – Represent Functions as Rules and Tables Function – is a pairing.
The Unit Circle with Radian Measures. 4.2 Trigonometric Function: The Unit circle.
Parametric Equations Until now, we’ve been using x and y as variables. With parametric equations, they now become FUNCTIONS of a variable t.
Trigonometric Functions: The Unit Circle
Circular Motion How do we work out the velocity of something which is moving at constant speed in a circle ? Answer: We use the simple formula: But in.
Think What will be the output?
ALGORITHMS & FLOWCHARTING II
Linear Systems.
Evaluating Piecewise and Step Functions
Evaluating Piecewise Functions
Objective evaluate powers that have negative and zero exponents.
Rational Exponents and Nth Roots Objectives:
Warm Up 30°±
Modeling and Simulation in SIMSCRIPT II.5
EXERCISE SET 7 – Differential Equations
Section 9.4 – Solving Differential Equations Symbolically
Section 1.1 Functions.
6.4 - Trig Ratios in the Coordinate Plane
Prerequisites for Calculus
UNIT 12 SERIAL INTERFACE.
UNIT 12 COMMUNICATIONS.
Integration and the Logarithmic Function
REPETITION Why Repetition?
Finding Statistics from Data
SIMSCRIPT SIMSCRIPT is a general-purpose simulation language
Presentation transcript:

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-1 Day 5 Section 9 - Continuous Simulation –Exercise 9 Section 10 - Animation –Demonstration of SIMANIMATION –Exercise 10 

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-2 Exercise 9 Missile Flight C:\Program Files\Simscript3\models\MISSILE

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-3 Missile Flight Problem X Y Angle

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-4 Continuous Simulation Given an equation for the rate of change of a variable, calculate the value of the variable continuously d(angle) = -.1 (radians/sec) dt dx = speed * cos(angle) dt dy = speed * sin(angle) dt

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-5 Continuous Simulation (continued) Preamble Processes include Every MISSILE has an X, a Y, a SPEED, an ANGLE Define X,Y,ANGLE as continuous real variables Define QUIT as an integer function End ''Preamble Process MISSILE Work continuously evaluating'EQUATIONS' testing'QUIT' End ''MISSILE

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-6 Continuous Simulation (continued) Routine EQUATIONS Given.MSL Let D.ANGLE(.MSL) = -.1 ''radians/second Let D.X(.MSL) = SPEED(.MSL) * cos.f(ANGLE(.MSL)) Let D.Y(.MSL) = SPEED(.MSL) * sin.f(ANGLE(.MSL)) End ''EQUATIONS Function QUIT If time.v > 5 ''seconds Return with 1 Endif ''time.v > 5 Return with 0 End ''QUIT

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— Preamble 2 3 '' Sample continuous simulation program 4 '' CACI Products Company, Normally mode is undefined 7 8 Processes include 9 REPORT Every MISSILE has 12 an MSL.X, 13 a MSL.Y, 14 a MSL.SPEED, 15 an MSL.ANGLE and 16 a MSL.PITCH.RATE Define MSL.PITCH.RATE as a real variable Define MSL.X, 21 MSL.Y, 22 MSL.SPEED and 23 MSL.ANGLE 24 as continuous real variables Define PITCH.OVER and 27 FLIGHT.TIME 28 as integer functions Define seconds to mean units 31 Define second to mean units End ''Preamble

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— Main 2 3 Open unit 10 for input, name = "MISSILE.DAT" 4 Use unit 10 for input 5 6 ''Defaults 7 Read max.step.v, ''.1 8 min.step.v, ''.01 9 abs.err.v and '' rel.err.v '' Close unit Activate a MISSILE now 15 Activate a REPORT now Start simulation End ''Main 1 Process MISSILE 2 3 Let MSL.SPEED(MISSILE) = 500 ''feet per second 4 Let MSL.ANGLE(MISSILE) = pi.c / 4 ''radians 5 6 Work continuously evaluating 'FLIGHT' testing 'PITCH.OVER' 7 8 Let MSL.PITCH.RATE(MISSILE) = ''radians per second 9 Work continuously evaluating 'FLIGHT' testing 'FLIGHT.TIME' Suspend End ''MISSILE

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— Routine FLIGHT 2 3 Given 4.MSL ''Pointer to missile process notice 5 6 Define.MSL as a pointer variable 7 8 Let D.MSL.ANGLE(.MSL) = MSL.PITCH.RATE(.MSL) 9 Let D.MSL.X(.MSL) = MSL.SPEED(.MSL) * cos.f(MSL.ANGLE(.MSL)) 10 Let D.MSL.Y(.MSL) = MSL.SPEED(.MSL) * sin.f(MSL.ANGLE(.MSL)) End ''FLIGHT 1 Function PITCH.OVER 2 Given 3.MSL ''Pointer to missile process notice 4 5 Define.MSL as a pointer variable 6 7 Let.MSL =.MSL 8 9 If time.v > 5 ''seconds 10 Return with 1 ''End integration 11 Endif ''time.v > 5 seconds Return with 0 ''Continue integration End ''PITCH.OVER

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— Function FLIGHT.TIME 2 3 Given 4.MSL ''Pointer to missile process notice 5 6 Define.MSL as a pointer variable 7 8 If MSL.ANGLE(.MSL) < -pi.c / 4 9 Return with 1 ''Pitch over is complete 10 Endif ''MSL.ANGLE(.MSL) < -pi.c / Return with 0 ''Continue simulation End ''FLIGHT.TIME

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— Process REPORT 2 3 Define.TERMINAL.MSL.ANGLE as a real variable 4 5 Let.TERMINAL.MSL.ANGLE = - pi.c / Print 3 lines thus Time MSL.X MSL.Y Angle Use unit 6 for output 12 Until MSL.ANGLE(MISSILE) <=.TERMINAL.MSL.ANGLE do Print 1 line with time.v, 15 MSL.X(MISSILE), 16 MSL.Y(MISSILE), 17 MSL.ANGLE(MISSILE) * radian.c thus ** **** **** **.* Wait 1 second Loop ''MSL.ANGLE(MISSILE) > =.TERMINAL.MSL.ANGLE do Read as / using unit Stop End ''REPORT

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-12 Values of Runge-Kutta parameters:.1,.1,.1,.1 Time MSL.X MSL.Y Angle

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-13 Values of Runge-Kutta parameters:.1,.01,.0001,.01 Time MSL.X MSL.Y Angle

—————————— CACI Products Company —————————————————————————————— SimScript II.5 —————————————— 9-14 This page is intentionally blank