CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.
-
Upload
prudence-miles -
Category
Documents
-
view
224 -
download
0
Transcript of CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.
![Page 1: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/1.jpg)
CSC 107 -Programming for Science
Lecture 3:
Simulations & Program Lifecycle
![Page 2: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/2.jpg)
Problem of the Day
Why are manhole covers round?
It is the only shape that guarantees that the cover can not fall in.
![Page 3: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/3.jpg)
Solving Problems
Problem solving key to science & engineeringPhysics -- How does an atom work?Engineering -- Will the bridge collapse?Biology -- What is crawling up my leg?
Computer science investigates how computers can be used to solve problems
![Page 4: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/4.jpg)
Etter’s Problem Solving Method
1. State the problem clearly Will splitting an atom cause unstoppable
explosion?
2. Describe input and output information Input: E = mc2; U235 Output:
3. Work problem by hand or with calculator for simple set of data
Physicists at Manhattan Project did this!
![Page 5: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/5.jpg)
Etter’s Problem Solving Method
4. Develop solution and convert to computer program
Classified by Dept. of Energy
5. Test solution with variety of data Currently happening in Iran & North Korea
![Page 6: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/6.jpg)
Programming For Science
This course considers all 5 stepsAll needed for success with computers
What kind of problems are good for computers?
![Page 7: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/7.jpg)
Bad Jobs
Nuclear Weapon Tester Hurricane Spotter New Medicine Tester Economist
Volunteers?
![Page 8: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/8.jpg)
Problem
Jobs may be dangerous or illegal, or require psychic abilities
Experiments may be costly or unethicalCannot vaccinate people without knowing
side-effects Decisions may be irrevocable
Cannot undo an atomic explosion!
![Page 9: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/9.jpg)
What is a Simulator?
Emulate system in a way that enables observing the changes/outcomesSystem could be:
single subatomic particle E. coli bacteria Earth’s weather Elevators in Old Main Galaxies
![Page 10: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/10.jpg)
Simulation Example
![Page 11: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/11.jpg)
Simulation Example
![Page 12: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/12.jpg)
Simulator Accuracy
Off by almost 100 miles only 24 hours in advance
![Page 13: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/13.jpg)
What went wrong?
Real-world systems are very complexEquations have too many variables than we
can write in a programMust simplify world to generate results in
timely mannerMay overlook important variables
![Page 14: CSC 107 - Programming for Science Lecture 3: Simulations & Program Lifecycle.](https://reader036.fdocuments.in/reader036/viewer/2022062301/5697bfce1a28abf838ca9904/html5/thumbnails/14.jpg)
Your Turn
Get back into groups of 3 and complete the following (off-line) simulation