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

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

7. The Discrete vs The Continuous (Cont’d) Screen Granularity Finite Arithmetic More practice with iteration and conditionals.

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

View Full Document
The 1991 Patriot Missile Disaster Elementary misperceptions about the finiteness of computer arithmetic. 30+ died.
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

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

View Full Document
One-Tenth in Binary Exact: .00011001100110011001100110011… Patriot System used: .00011001100110011001100110011… Error = .000000095sec every clock tick
Error Time = (# external clock ticks) x (1/10) Error = (# external clock ticks) x (.000000095)

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

View Full Document
After 100 hours… Error = (100x60x60*10)*.000000095 = .34 secs Missed target by 500 meters.
8. Plotting Continuous Functions Linspace Array Operations

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

View Full Document
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
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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

## 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
Ask a homework question - tutors are online