%23%20%2F%2F%2F%20script%0A%23%20requires-python%20%3D%20%22%3E%3D3.11%22%0A%23%20dependencies%20%3D%20%5B%22marimo%3E%3D0.23.9%22%5D%0A%23%20%2F%2F%2F%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Python%20for%20scientific%20computing%0A%0A%20%20%20%20%3E%20Marcos%20Duarte%2C%20Renato%20Naville%20Watanabe%3Cbr%3E%0A%20%20%20%20%3E%20%5BLaboratory%20of%20Biomechanics%20and%20Motor%20Control%5D(https%3A%2F%2Fbmclab.pesquisa.ufabc.edu.br%2F)%3Cbr%3E%0A%20%20%20%20%3E%20Federal%20University%20of%20ABC%2C%20Brazil%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20How%20to%20use%20this%20guide%0A%0A%20%20%20%20A%20scientific%20notebook%20is%20an%20argument%20that%20the%20reader%20can%20run.%20It%20connects%20a%20question%2C%20a%20model%2C%20numerical%20inputs%2C%20and%20an%20interpretation.%20This%20short%20orientation%20explains%20where%20Python%20and%20Marimo%20fit%3B%20%5BPython%20tutorial%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fpython_tutorial.py)%20supplies%20the%20basic%20language%20practice.%0A%0A%20%20%20%20Read%20the%20examples%20in%20order%2C%20predict%20each%20result%2C%20and%20then%20run%20the%20cell.%20Try%20the%20distributed%20Exercises%20before%20opening%20their%20worked%20solutions.%20Finish%20with%20the%20checkpoint%20questions%20and%20independent%20Problems%3B%20their%20panels%20contain%20final%20answers%20only.%0A%0A%20%20%20%20**Challenge%200.**%20A%20graph%20looks%20convincing%2C%20but%20its%20axes%20have%20no%20units%20and%20its%20input%20file%20is%20unavailable.%20What%20would%20you%20need%20before%20trusting%20or%20reproducing%20it%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Python%20setup%0A%0A%20%20%20%20This%20overview%20uses%20only%20Marimo%20and%20ordinary%20Python.%20For%20local%20setup%20use%20%5BPython%20installation%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fpython_installation.py)%3B%20hosted%20notebooks%20still%20need%20their%20declared%20packages%20and%20any%20required%20data.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Experiment%2C%20theory%2C%20and%20computation%0A%0A%20%20%20%20An%20experiment%20observes%20movement%3B%20a%20model%20states%20what%20you%20think%20governs%20it%3B%20computation%20makes%20the%20model%E2%80%99s%20consequences%20explicit.%20None%20of%20the%20three%20replaces%20the%20others.%20A%20simulation%20can%20reproduce%20an%20equation%20exactly%20and%20still%20describe%20the%20wrong%20physical%20system.%0A%0A%20%20%20%20!%5BTheory%2C%20experiment%2C%20and%20computation%5D(https%3A%2F%2Fraw.githubusercontent.com%2Fjrjohansson%2Fscientific-python-lectures%2Fmaster%2Fimages%2Ftheory-experiment-computation.png)%0A%0A%20%20%20%20The%20original%20illustration%20is%20from%20J.%20R.%20Johansson%E2%80%99s%20scientific%20Python%20lectures.%20Consider%20a%20walking%20experiment%3A%20distance%20and%20time%20are%20measurements%2C%20constant%20average%20speed%20is%20a%20summary%20model%2C%20and%20division%20computes%20its%20prediction.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%201.**%20A%20notebook%20calculates%206%20m%20%2F%204%20s%20%3D%201.5%20m%2Fs.%20Which%20part%20is%20measurement%2C%20which%20part%20is%20computation%2C%20and%20what%20does%20the%20result%20leave%20out%3F%0A%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%201%0A%20%20%20%20Distance%20and%20time%20are%20measurements.%20Division%20is%20the%20computation.%20The%20result%20is%20an%20average%20speed%3B%20it%20does%20not%20describe%20accelerations%20or%20changes%20of%20speed%20within%20the%20trial.%20A%20correct%20calculation%20can%20be%20an%20incomplete%20answer%20to%20a%20movement%20question.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Python%20and%20its%20scientific%20tools%0A%0A%20%20%20%20Python%20is%20a%20language%3B%20CPython%20is%20its%20most%20widely%20used%20implementation.%20Names%20refer%20to%20objects%20such%20as%20numbers%2C%20lists%2C%20and%20functions.%20Modules%20group%20reusable%20definitions%2C%20and%20%60import%60%20makes%20them%20available.%20You%20can%20learn%20these%20ideas%20gradually%20while%20running%20real%20examples.%0A%0A%20%20%20%20NumPy%20works%20with%20arrays%2C%20SciPy%20supplies%20numerical%20methods%2C%20Matplotlib%20draws%20figures%2C%20SymPy%20handles%20symbolic%20expressions%2C%20and%20pandas%20organizes%20tables.%20You%20do%20not%20need%20all%20of%20them%20for%20a%20first%20calculation.%20The%20later%20notebooks%20introduce%20the%20relevant%20library%20where%20a%20scientific%20task%20requires%20it.%0A%0A%20%20%20%20Python%20often%20coordinates%20efficient%20compiled%20numerical%20routines.%20That%20does%20not%20make%20every%20Python%20loop%20fast%2C%20and%20no%20single%20language%20is%20best%20for%20every%20problem.%20Choose%20tools%20that%20let%20you%20check%20both%20the%20calculation%20and%20its%20assumptions.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%202.**%20You%20want%20to%20integrate%20a%20mechanical%20model%20and%20draw%20its%20trajectory.%20Which%20two%20tools%20from%20the%20list%20fit%20those%20tasks%3F%20What%20do%20they%20not%20decide%20for%20you%3F%0A%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%202%0A%20%20%20%20SciPy%20provides%20numerical%20integration%20and%20Matplotlib%20draws%20the%20trajectory.%20They%20do%20not%20choose%20valid%20physical%20assumptions%2C%20initial%20conditions%2C%20or%20units.%20Those%20decisions%20remain%20part%20of%20the%20scientific%20explanation.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Reading%20a%20Marimo%20notebook%0A%0A%20%20%20%20This%20collection%20uses%20Marimo%3A%20prose%20cells%20explain%20the%20reasoning%20and%20code%20cells%20expose%20the%20calculation.%20Edit%20an%20input%2C%20run%20its%20cell%2C%20and%20dependent%20cells%20update.%20Keep%20one%20public%20definition%20of%20each%20variable%2C%20and%20place%20a%20control%E2%80%99s%20%60.value%60%20in%20a%20downstream%20cell.%20Use%20meaningful%20names%20and%20record%20units.%0A%0A%20%20%20%20Jupyter%20and%20IPython%20are%20related%20interactive%20tools%20you%20may%20encounter%20in%20older%20material.%20Their%20shell%20escapes%20and%20magic%20commands%20are%20not%20ordinary%20Python%20and%20are%20not%20required%20here.%20Keep%20terminal%20setup%20commands%20in%20a%20terminal%3B%20keep%20this%20lesson%20focused%20on%20computations%20you%20can%20inspect.%0A%0A%20%20%20%20A%20reproducible%20result%20needs%20the%20notebook%2C%20the%20input%20data%2C%20the%20package%20environment%2C%20and%20enough%20explanation%20to%20interpret%20them.%20Version%20control%20records%20source%20changes%2C%20while%20a%20suitable%20data%20archive%20preserves%20observations.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%203.**%20You%20changed%20an%20input%20but%20copied%20its%20old%20value%20as%20a%20literal%20into%20a%20later%20cell.%20Why%20can%20the%20downstream%20result%20stay%20unchanged%3F%0A%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%203%0A%20%20%20%20The%20later%20expression%20depends%20on%20the%20literal%2C%20not%20on%20the%20input%20variable.%20Reference%20the%20variable%20itself%20so%20the%20notebook%20can%20follow%20the%20dependency.%20A%20notebook%20is%20reproducible%20when%20the%20source%20of%20each%20result%20is%20explicit.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Checkpoint%20questions%0A%0A%20%20%20%201.%20Is%20Python%20a%20synonym%20for%20NumPy%3F%0A%20%20%20%202.%20What%20does%20reactive%20execution%20track%3F%0A%20%20%20%203.%20Can%20a%20reproducible%20calculation%20still%20be%20scientifically%20wrong%3F%0A%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Checkpoint%20answers%0A%20%20%20%201.%20No%3B%20NumPy%20is%20a%20library%20used%20from%20Python.%0A%20%20%20%202.%20Dependencies%20among%20named%20values%20and%20cells.%0A%20%20%20%203.%20Yes%3B%20assumptions%2C%20measurements%2C%20or%20interpretation%20can%20be%20wrong.%0A%20%20%20%20%2F%2F%2F%0A%0A%20%20%20%20%23%23%20Problems%0A%0A%20%20%20%201.%20List%20four%20things%20needed%20to%20reproduce%20a%20notebook%20result.%0A%20%20%20%202.%20Name%20the%20tool%20in%20this%20collection%20that%20joins%20prose%2C%20code%2C%20and%20reactive%20outputs.%0A%20%20%20%203.%20A%20model%20ignores%20air%20resistance.%20Does%20changing%20the%20plot%20style%20improve%20that%20assumption%3F%0A%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Final%20answers%0A%20%20%20%201.%20Source%2C%20data%2C%20environment%20specification%2C%20and%20explanatory%20context.%0A%20%20%20%202.%20Marimo.%0A%20%20%20%203.%20No.%0A%20%20%20%20%2F%2F%2F%0A%0A%20%20%20%20%23%23%20Go%20deeper%0A%0A%20%20%20%20%5BPython%20tutorial%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fpython_tutorial.py)%20%E2%80%94%20begin%20with%20arithmetic%20and%20variables.%20%5BVersion%20control%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fversion_control_git_github.py)%20%E2%80%94%20keep%20a%20reviewable%20history.%20%5BScientific%20Python%20lectures%5D(https%3A%2F%2Flectures.scientific-python.org%2F)%20%E2%80%94%20optional%20later%20material.%0A%0A%20%20%20%20%23%23%23%20Video%20lectures%20on%20the%20Internet%0A%0A%20%20%20%20%5BMIT%20introductory%20Python%20lectures%5D(https%3A%2F%2Focw.mit.edu%2Fcourses%2F6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016%2Fvideo_galleries%2Flecture-videos%2F)%20%E2%80%94%20use%20the%20first%20lectures%20for%20expressions%2C%20variables%2C%20branching%2C%20and%20loops.%0A%0A%20%20%20%20%23%23%20References%0A%0A%20%20%20%20-%20%5BPython%20documentation%5D(https%3A%2F%2Fdocs.python.org%2F3%2F)%3B%20%5BMarimo%20key%20concepts%5D(https%3A%2F%2Fdocs.marimo.io%2Fgetting_started%2Fkey_concepts%2F)%3B%20%5BJ.%20R.%20Johansson%E2%80%99s%20scientific%20Python%20lectures%5D(https%3A%2F%2Fgithub.com%2Fjrjohansson%2Fscientific-python-lectures).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
c634dbc4e0bf01a6a125f932f725e561