Day 5 - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Day 5

Description:

Day 5 Section 9 - Continuous Simulation Exercise 9 Section 10 - Animation Demonstration of SIMANIMATION Exercise 10 F Exercise 9 Missile Flight C:\Program Files ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 15
Provided by: JeffryGe3
Category:
Tags: day | real | simulation | time

less

Transcript and Presenter's Notes

Title: Day 5


1
Day 5
  • Section 9 - Continuous Simulation
  • Exercise 9
  • Section 10 - Animation
  • Demonstration of SIMANIMATION
  • Exercise 10

F
2
Exercise 9
  • Missile Flight
  • C\Program Files\Simscript3\models\MISSILE

3
Missile Flight Problem
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

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

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 gt 5 ''seconds
  • Return with 1
  • Endif ''time.v gt 5
  • Return with 0
  • End ''QUIT

7
  • 1 Preamble
  • 2
  • 3 '' Sample continuous simulation program
  • 4 '' CACI Products Company, 703-875-2919
  • 5
  • 6 Normally mode is undefined
  • 7
  • 8 Processes include
  • 9 REPORT
  • 10
  • 11 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
  • 17
  • 18 Define MSL.PITCH.RATE as a real
    variable
  • 19

8
  • 1 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 ''.0001
  • 10 rel.err.v ''.01
  • 11
  • 12 Close unit 10
  • 13
  • 14 Activate a MISSILE now
  • 15 Activate a REPORT now
  • 16
  • 17 Start simulation
  • 18
  • 19 End ''Main

9
  • 1 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))
  • 11
  • 12 End ''FLIGHT
  • 1 Function PITCH.OVER
  • 2 Given
  • 3 .MSL ''Pointer
    to missile process notice
  • 4

10
  • 1 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) lt -pi.c / 4
  • 9 Return with 1 ''Pitch over is
    complete
  • 10 Endif ''MSL.ANGLE(.MSL) lt -pi.c / 4
  • 11
  • 12 Return with 0 ''Continue
    simulation
  • 13
  • 14 End ''FLIGHT.TIME

11
  • 1 Process REPORT
  • 2
  • 3 Define .TERMINAL.MSL.ANGLE as a real
    variable
  • 4
  • 5 Let .TERMINAL.MSL.ANGLE - pi.c / 4
  • 6
  • 7 Print 3 lines thus
  • Time MSL.X MSL.Y
    Angle
  • ---- ----- -----
    -----
  • 11 Use unit 6 for output
  • 12 Until MSL.ANGLE(MISSILE) lt
    .TERMINAL.MSL.ANGLE do
  • 13
  • 14 Print 1 line with time.v,
  • 15 MSL.X(MISSILE),
  • 16 MSL.Y(MISSILE),
  • 17
    MSL.ANGLE(MISSILE) radian.c thus

  • .
  • 19

12
  • Values of Runge-Kutta parameters .1,
    .1, .1, .1
  • Time MSL.X MSL.Y
    Angle
  • ---- ----- -----
    -----
  • 0 0 0
    0.
  • 1 315 315
    45.0
  • 2 633 633
    45.0
  • 3 952 952
    45.0
  • 4 1270 1270
    45.0
  • 5 1588 1588
    45.0
  • 6 1938 1909
    39.9
  • 7 2295 2182
    34.7
  • 8 2676 2422
    29.6
  • 9 3077 2626
    24.4
  • 10 3495 2793
    19.3
  • 11 3925 2922
    14.1
  • 12 4366 3012
    9.0
  • 13 4813 3062
    3.8

13
  • Values of Runge-Kutta parameters .1,
    .01, .0001, .01
  • Time MSL.X MSL.Y
    Angle
  • ---- ----- -----
    -----
  • 0 0 0
    0.
  • 1 353 353
    45.0
  • 2 707 707
    45.0
  • 3 1060 1060
    45.0
  • 4 1414 1414
    45.0
  • 5 1767 1767
    45.0
  • 6 2138 2103
    39.3
  • 7 2540 2400
    33.6
  • 8 2969 2656
    27.9
  • 9 3422 2867
    22.2
  • 10 3894 3033
    16.4
  • 11 4379 3150
    10.7
  • 12 4875 3218
    5.0
  • 13 5374 3236
    -.8

14
This page is intentionally blank
Write a Comment
User Comments (0)
About PowerShow.com