Lec8 - 7. The Discrete vs The Continuous (Cont'd) Screen...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
7. The Discrete vs The Continuous (Cont’d) Screen Granularity Finite Arithmetic More practice with iteration and conditionals.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The 1991 Patriot Missile Disaster Elementary misperceptions about the finiteness of computer arithmetic. 30+ died.
Background image of page 2
The Setting External clock counts time in tenths of seconds. Targeting software needs time to compute trajectories. The method: Time = (# external clock ticks) x (1/10) The problem is here
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
One-Tenth in Binary Exact: .00011001100110011001100110011… Patriot System used: .00011001100110011001100110011… Error = .000000095sec every clock tick
Background image of page 4
Error Time = (# external clock ticks) x (1/10) Error = (# external clock ticks) x (.000000095)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
After 100 hours… Error = (100x60x60*10)*.000000095 = .34 secs Missed target by 500 meters.
Background image of page 6
8. Plotting Continuous Functions Linspace Array Operations
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Table Æ Plot -1 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 sin(x) x sin(x) 0.00 0.0 1.57 1.0 3.14 0.0 4.71 -1.0 6.28 0.0 Plot based on 5 points
Background image of page 8
Table Æ Plot -1 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 sin(x) x sin(x) 0.000 0.000 0.784 0.707 1.571 1.000 2.357 0.707 3.142 0.000 3.927 -0.707 4.712 -1.000 5.498 -0.707 6.283 0.000 Plot based on 9 points
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Table Æ Plot -1 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 sin(x) Plot based on 200 points—looks smooth
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 47

Lec8 - 7. The Discrete vs The Continuous (Cont'd) Screen...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online