%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%2C%20%22numpy%3E%3D2.0%22%2C%20%22matplotlib%3E%3D3.9%22%2C%20%22seaborn%3E%3D0.13%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()%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%20Motion%20of%20a%20particle%20-%20Newtonian%20approach%0A%0A%20%20%20%20%3E%20Renato%20Naville%20Watanabe%2C%20Marcos%20Duarte%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%20Use%20a%20signed%20force%20equation%20before%20solving%20any%20trajectory.%20We%20will%20compare%20no%20drag%2C%20linear%20drag%20and%20quadratic%20drag%2C%20first%20analytically%20where%20possible%20and%20then%20numerically.%20Compare%20solutions%20at%20the%20same%20parameters%20and%20refine%20the%20time%20step%20before%20interpreting%20a%20numerical%20discrepancy.%0A%0A%20%20%20%20Try%20the%20distributed%20**Exercises**%20before%20opening%20their%20collapsed%20worked%20solutions.%20Then%20use%20the%20**Checkpoint%20questions**%20and%20attempt%20the%20**Problems**%20independently%3B%20their%20panels%20contain%20final%20answers%20only.%20Predict%20the%20effect%20of%20a%20parameter%20change%20before%20running%20it%2C%20and%20check%20units%20and%20limiting%20cases.%0A%0A%20%20%20%20**Opening%20challenge.**%20Throw%20a%20ball%20straight%20upward.%20At%20the%20highest%20point%20its%20velocity%20is%20zero.%20Is%20its%20acceleration%20also%20zero%2C%20and%20does%20air%20drag%20change%20that%20answer%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%20The%20dependency%20declaration%20at%20the%20top%20of%20this%20file%20lists%20the%20packages%20used%20by%20this%20guide.%20Marimo%20runs%20cells%20in%20dependency%20order.%20Run%20the%20notebook%20in%20an%20editor%20to%20use%20its%20displays%20and%20controls%3B%20the%20computational%20examples%20below%20explain%20their%20inputs%20before%20using%20them.%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%20Study%20of%20motion%0A%0A%20%20%20%20In%20Mechanics%20we%20are%20interested%20in%20the%20study%20of%20motion%20(including%20deformation)%20and%20forces%20(and%20the%20relation%20between%20them)%20of%20anything%20in%20nature.%0A%0A%20%20%20%20As%20a%20good%20rule%20of%20thumb%2C%20we%20model%20the%20phenomenon%20of%20interest%20as%20simple%20as%20possible%2C%20with%20just%20enough%20complexity%20to%20understand%20the%20phenomenon.%0A%0A%20%20%20%20For%20example%2C%20we%20could%20model%20a%20person%20jumping%20as%20a%20particle%20(the%20center%20of%20gravity%2C%20with%20no%20size)%20moving%20in%20one%20direction%20(the%20vertical)%20if%20all%20we%20want%20is%20to%20estimate%20the%20jump%20height%20and%20relate%20that%20to%20the%20external%20forces%20to%20the%20human%20body.%20So%2C%20mechanics%20of%20a%20particle%20might%20be%20all%20we%20need.%0A%20%20%20%20However%2C%20if%20the%20person%20jumps%20and%20performs%20a%20somersault%2C%20to%20understand%20this%20last%20part%20of%20the%20motion%20we%20have%20to%20model%20the%20human%20body%20as%20one%20of%20more%20objects%20which%20displaces%20and%20rotates%20in%20two%20or%20three%20dimensions.%20In%20this%20case%2C%20we%20would%20need%20what%20is%20called%20mechanics%20of%20rigid%20bodies.%0A%0A%20%20%20%20If%2C%20besides%20the%20gross%20motions%20of%20the%20segments%20of%20the%20body%2C%20we%20are%20interested%20in%20understanding%20the%20deformation%20in%20the%20the%20human%20body%20segments%20and%20tissues%2C%20now%20we%20would%20have%20to%20describe%20the%20mechanical%20behavior%20of%20the%20body%20(e.g.%2C%20how%20it%20deforms)%20under%20the%20action%20of%20forces.%20In%20this%20case%20we%20would%20have%20to%20include%20some%20constitutive%20laws%20describing%20the%20mechanical%20properties%20of%20the%20body.%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%20The%20development%20of%20the%20laws%20of%20motion%20of%20bodies%0A%0A%20%20%20%20%22The%20theoretical%20development%20of%20the%20laws%20of%20motion%20of%20bodies%20is%20a%20problem%20of%20such%20interest%20and%20importance%20that%20it%20has%20engaged%20the%20attention%20of%20all%20the%20most%20eminent%20mathematicians%20since%20the%20invention%20of%20dynamics%20as%20a%20mathematical%20science%20by%20Galileo%2C%20and%20especially%20since%20the%20wonderful%20extension%20which%20was%20given%20to%20that%20science%20by%20Newton.%22%0A%0A%20%20%20%20%26%238212%3B%20Hamilton%2C%201834%20(apud%20Taylor%2C%202005).%0A%0A%20%20%20%20**Let's%20start%20with%20the%20study%20of%20the%20forces%20and%20motion%20in%20Mechanics%20looking%20at%20the%20motion%20of%20a%20particle%20using%20the%20Newtonian%20approach.**%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%20Newton's%20laws%20of%20motion%0A%0A%20%20%20%20The%20Newton's%20laws%20of%20motion%20describe%20the%20relationship%20between%20the%20forces%20acting%20on%20a%20body%20and%20the%20resultant%20linear%20motion%20due%20to%20those%20forces%3A%0A%0A%20%20%20%20-%20**First%20law**%3A%20An%20object%20will%20remain%20at%20rest%20or%20in%20uniform%20motion%20in%20a%20straight%20line%20unless%20an%20external%20force%20acts%20on%20the%20body.%0A%20%20%20%20-%20**Second%20law**%3A%20The%20acceleration%20of%20an%20object%20is%20directly%20proportional%20to%20the%20net%20force%20acting%20on%20the%20object%20and%20inversely%20proportional%20to%20the%20mass%20of%20the%20object%3A%20%24%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20m%20%5Cvec%7B%5Cbf%7Ba%7D%7D%24.%0A%20%20%20%20-%20**Third%20law**%3A%20Whenever%20an%20object%20exerts%20a%20force%20%24%5Cvec%7B%5Cbf%7BF%7D%7D_1%24%20(action)%20on%20a%20second%20object%2C%20this%20second%20object%20simultaneously%20exerts%20a%20force%20%24%5Cvec%7B%5Cbf%7BF%7D%7D_2%24%20on%20the%20first%20object%20with%20the%20same%20magnitude%20but%20opposite%20direction%20(reaction)%3A%20%24%5Cvec%7B%5Cbf%7BF%7D%7D_2%20%3D%20%E2%88%92%5Cvec%7B%5Cbf%7BF%7D%7D_1.%24%0A%0A%20%20%20%20These%20three%20statements%20are%20astonishing%20in%20their%20simplicity%20and%20how%20much%20of%20knowledge%20they%20empower.%3Cbr%3E%0A%20%20%20%20Isaac%20Newton%20was%20born%20in%201943%20and%20his%20works%20that%20resulted%20in%20these%20equations%20and%20other%20discoveries%20were%20mostly%20done%20in%20the%20years%20of%201666%20and%201667%2C%20when%20he%20was%20only%2024%20years%20old!%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%20Steps%20to%20find%20the%20motion%20of%20a%20particle%0A%0A%20%20%20%201.%20Draw%20a%20free%20body%20diagram%20of%20the%20particle.%20Draw%20all%20the%20forces%20being%20applied%20to%20the%20particle.%3Cbr%3E%0A%20%20%20%202.%20Write%20the%20expression%20of%20each%20force%20applied%20to%20the%20particle.%20For%20external%20forces%20(for%20example%20gravity%20and%20air%20friction)%20write%20the%20constitutive%20laws%20of%20the%20phenomena.%3Cbr%3E%0A%20%20%20%203.%20Write%20the%20Newton's%20second%20Law%20%24%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20m%20%5Cvec%7B%5Cbf%7Ba%7D%7D%24%2C%20where%20%24%5Cvec%7B%5Cbf%7BF%7D%7D%24%20is%20the%20sum%20of%20all%20forces%20applied%20to%20the%20particle%20and%20%24%5Cvec%7B%5Cbf%7Ba%7D%7D%24%20is%20the%20particle%20acceleration.%3Cbr%3E%0A%20%20%20%204.%20Separate%20the%20equation%20into%20the%203%20cartesian%20components%20(or%202%20components%20if%20the%20movement%20is%20bidimensional).%3Cbr%3E%0A%20%20%20%205.%20Solve%20the%20differential%20equations%0A%20%20%20%20%201.%20If%20possible%2C%20solve%20the%20differential%20equations%20analytically.%3Cbr%3E%0A%20%20%20%20%202.%20If%20not%20possible%20to%20solve%20the%20differential%20equations%20analytically%2C%20separate%20each%20equation%20into%202%20first%20order%20differential%20equations%20and%20use%20some%20numerical%20method%20(e.g.%20Euler%2C%20Runge-Kutta)%20to%20solve%20the%20first%20order%20differential%20equations%20with%20the%20aid%20of%20a%20computer.%3Cbr%3E%0A%20%20%20%206.%20Use%20the%20solution%20to%20interpret%20the%20situation%2C%20or%20to%20find%20some%20error%20on%20your%20approach.%0A%0A%20%20%20%20**Later%2C%20we%20will%20study%20in%20details%20how%20to%20draw%20a%20free-body%20diagram.**%3Cbr%3E%0A%20%20%20%20Let's%20see%20now%20some%20examples%20on%20how%20to%20find%20the%20motion%20of%20a%20particle%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%23%20Example%201%3A%20Ball%20kicked%20into%20the%20air%0A%0A%20%20%20%20%23%23%23%23%20Analytical%20solution%0A%0A%20%20%20%20A%20football%20ball%20is%20kicked%20with%20an%20angle%20of%2030%20degrees%20with%20the%20ground%20(horizontal).%3Cbr%3E%0A%20%20%20%20The%20mass%20of%20the%20ball%20is%200.43%20kg.%20The%20initial%20speed%20of%20the%20ball%20is%2020%20m%2Fs%20and%20the%20initial%20height%20is%200%20m.%20Consider%20the%20gravitational%20acceleration%20as%209.81%20%24m%2Fs%5E2%24.%3Cbr%3E%0A%20%20%20%20Find%20the%20motion%20of%20the%20ball.%0A%0A%20%20%20%20Solution%3A%3Cbr%3E%0A%20%20%20%20We%20know%20that%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20x_0%20%3D%200%20m%20%5C%5C%20y_0%20%3D%200%20m%0A%20%20%20%20%24%24%0A%0A%20%20%20%20As%20the%20angle%20of%20the%20initial%20velocity%20of%20the%20ball%20with%20the%20ground%20is%2030%20degrees%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20v_%7Bx0%7D%20%3D%2020%20%5Ccos(30%5E%5Ccirc)%20%3D%2020%5Cfrac%7B%5Csqrt%7B3%7D%7D%7B2%7D%20%3D%2010%5Csqrt%7B3%7D%20m%2Fs%20%5C%5C%0A%20%20%20%20v_%7By0%7D%20%3D%2020%20%5Csin(30%5E%5Ccirc)%20%3D%2020%20%5Cfrac%7B1%7D%7B2%7D%20%3D%2010%20m%2Fs%0A%20%20%20%20%24%24%0A%0A%20%20%20%20The%20free-body%20diagram%20of%20the%20ball%20is%20depicted%20below%3A%0A%0A%20%20%20%20%3Cfigure%20aria-describedby%3D%22figure-caption-1%22%3E%3Ccenter%3E%3Cimg%20src%3D%22https%3A%2F%2Fgithub.com%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fimages%2FballGrav.png%3Fraw%3D1%22%20alt%3D%22free-body%20diagram%20of%20a%20ball%22%20width%3D%22500%22%2F%3E%3C%2Fcenter%3E%3C%2Ffigure%3E%0A%0A%20%20%20%20%3Cspan%20id%3D%22figure-caption-1%22%20class%3D%22figure-caption%22%20style%3D%22display%3Ablock%3Btext-align%3Acenter%3Bfont-style%3Aitalic%22%3EFigure.%20Free-body%20diagram%20of%20a%20ball%20under%20the%20influence%20of%20gravity.%3C%2Fspan%3E%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%20The%20only%20force%20acting%20on%20the%20ball%20is%20the%20gravitational%20force%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cvec%7B%5Cbf%7BF%7D%7D_g%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%24%3C%2Fspan%3E%0A%20%20%20%20So%2C%20we%20apply%20the%20Newton's%20second%20law%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cvec%7B%5Cbf%7BF%7D%7D_g%20%3D%20m%20%5Cfrac%7Bd%5E2%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20-%20mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20%3D%20m%20%5Cfrac%7Bd%5E2%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20-%20g%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20%3D%20%5Cfrac%7Bd%5E2%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%5E2%7D%24%3C%2Fspan%3E%0A%20%20%20%20Now%2C%20we%20can%20separate%20the%20equation%20in%20two%20components%20(x%20and%20y)%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%240%20%3D%20%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%24%3C%2Fspan%3E%0A%20%20%20%20and%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24-g%20%3D%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%24%3C%2Fspan%3E%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%20numpy%20as%20np%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20seaborn%20as%20sns%0A%0A%20%20%20%20%23%20'%25matplotlib%20inline'%20command%20supported%20automatically%20in%20marimo%0A%20%20%20%20sns.set_context(%22notebook%22%2C%20font_scale%3D1.2)%0A%20%20%20%20return%20np%2C%20plt%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20m%20%3D%200.43%20%20%23%20%5Bkg%5D%0A%20%20%20%20x0%20%3D%200%20%20%23%20%5Bm%5D%0A%20%20%20%20y0%20%3D%200%20%20%23%20%5Bm%5D%0A%20%20%20%20vx0%20%3D%2010%20*%20np.sqrt(3)%20%20%23%20%5Bm%2Fs%5D%0A%20%20%20%20vy0%20%3D%2010%20%20%23%20%5Bm%2Fs%5D%0A%20%20%20%20g%20%3D%209.81%20%20%23%20%5Bm%2Fs%5E2%5D%0A%20%20%20%20return%20g%2C%20m%2C%20vx0%2C%20vy0%2C%20x0%2C%20y0%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%20These%20equations%20can%20be%20easily%20solved%20%20by%20integrating%20both%20sides%20of%20each%20equation%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%240%20%3D%20%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20v_%7Bx0%7D%20%3D%20%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20v_%7Bx0%7Dt%20%2B%20x_%7B0%7D%20%3D%20x(t)%24%3C%2Fspan%3E%0A%20%20%20%20and%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24-g%20%3D%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20-%20gt%20%2B%20v_%7By0%7D%20%3D%20%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20-%5Cfrac%7Bg%7D%7B2%7Dt%5E2%20%2Bv_%7By0%7Dt%20%2B%20y_%7B0%7D%20%3D%20y(t)%24%3C%2Fspan%3E%0A%20%20%20%20So%20the%20trajectory%20of%20the%20ball%20along%20time%20is%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24x(t)%20%3D%20v_%7Bx0%7Dt%24%3C%2Fspan%3E%0A%20%20%20%20and%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24y(t)%20%3D%20%20-%5Cfrac%7Bg%7D%7B2%7D%20t%5E2%20%2B%20v_%7By0%7Dt%24%3C%2Fspan%3E%0A%20%20%20%20or%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cvec%7B%5Cbf%7Br%7D%7D(t)%20%3D%20%20v_%7Bx0%7Dt%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%20%2B%20%5Cleft(-%5Cfrac%7Bg%7D%7B2%7D%20t%5E2%20%2B%20v_%7By0%7Dt%20%5Cright)%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%24%3C%2Fspan%3E%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(g%2C%20np%2C%20plt%2C%20vx0%2C%20vy0)%3A%0A%20%20%20%20dt%20%3D%200.001%0A%20%20%20%20_t%20%3D%20np.arange(0%2C%202.05%2C%20dt)%0A%20%20%20%20x1a%20%3D%20vx0%20*%20_t%0A%20%20%20%20y1a%20%3D%20-g%20%2F%202%20*%20_t**2%20%2B%20vy0%20*%20_t%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20plt.plot(x1a%2C%20y1a%2C%20lw%3D4)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20(dt%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%23%23%20Numerical%20solution%0A%0A%20%20%20%20We%20can%20solve%20this%20problem%20numerically%20and%20compare%20both%20solutions.%0A%0A%20%20%20%20We%20start%20from%20the%20differential%20equations%20of%20each%20coordinate%2C%20and%20then%20break%20them%20into%20two%20first-order%20differential%20equations%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%200%20%3D%20%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20and%0A%0A%20%20%20%20%24%24%0A%20%20%20%20-g%20%3D%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20The%20first%20equation%20can%20be%20broken%20as%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdv_x%7D%7Bdt%7D%20%3D%200%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20v_x(t)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20And%20the%20second%20equation%20can%20be%20broken%20as%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdv_y%7D%7Bdt%7D%20%3D%20-g%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20v_y(t)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20You%20can%20use%20any%20numerical%20integration%20method%20you%20want%20(Euler%2C%20Runge-Kutta%2C%20etc)%2C%20but%20here%20we%20will%20use%20the%20Euler%20method.%20Let's%20see%20the%20solution%20for%20the%20%24x(t)%24%20variable.%0A%0A%20%20%20%20The%20derivative%20of%20%24x(t)%24%20is%20given%20by%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20%5Clim%5Climits_%7B%5CDelta%20t%20%5Crightarrow%200%7D%20%5Cfrac%7Bx(t%2B%5CDelta%20t)%20-%20x(t)%7D%7B%5CDelta%20t%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20Whcih%20can%20be%20approximated%20by%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Capprox%20%5Cfrac%7Bx(t%2B%5CDelta%20t)%20-%20x(t)%7D%7B%5CDelta%20t%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20x(t%2B%5CDelta%20t)%20%5Capprox%20x(t)%20%2B%20%5CDelta%20t%20%5Cfrac%7Bdx%7D%7Bdt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20So%2C%20with%20the%20initial%20conditions%20of%20all%20the%20variables%2C%20we%20can%20apply%20the%20equation%20above%20to%20find%20the%20values%20of%20the%20variables%20along%20time%20(for%20a%20revision%20of%20Ordinary%20Differential%20Equations%2C%20see%20the%20notebook%20%5BOrdinary%20Differential%20Equation%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fordinary_differential_equation.py)).%3Cbr%3E%0A%20%20%20%20In%20the%20cell%20below%2C%20we%20apply%20the%20Euler%20method%20for%20the%20four%20first-order%20differential%20equations.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(dt%2C%20g%2C%20np%2C%20vx0%2C%20vy0%2C%20x0%2C%20y0)%3A%0A%20%20%20%20_x%20%3D%20x0%0A%20%20%20%20_y%20%3D%20y0%0A%20%20%20%20_vx%20%3D%20vx0%0A%20%20%20%20_vy%20%3D%20vy0%0A%20%20%20%20r%20%3D%20np.array(%5B_x%2C%20_y%5D)%0A%20%20%20%20while%20_y%20%3E%3D%200%3A%0A%20%20%20%20%20%20%20%20_dxdt%20%3D%20_vx%0A%20%20%20%20%20%20%20%20_x%20%3D%20_x%20%2B%20dt%20*%20_dxdt%0A%20%20%20%20%20%20%20%20_dydt%20%3D%20_vy%0A%20%20%20%20%20%20%20%20_y%20%3D%20_y%20%2B%20dt%20*%20_dydt%0A%20%20%20%20%20%20%20%20_dvxdt%20%3D%200%0A%20%20%20%20%20%20%20%20_vx%20%3D%20_vx%20%2B%20dt%20*%20_dvxdt%0A%20%20%20%20%20%20%20%20_dvydt%20%3D%20-g%0A%20%20%20%20%20%20%20%20_vy%20%3D%20_vy%20%2B%20dt%20*%20_dvydt%0A%20%20%20%20%20%20%20%20r%20%3D%20np.vstack((r%2C%20np.array(%5B_x%2C%20_y%5D)))%0A%20%20%20%20return%20(r%2C)%0A%0A%0A%40app.cell%0Adef%20_(plt%2C%20r)%3A%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20x1n%20%3D%20r%5B%3A%2C%200%5D%0A%20%20%20%20y1n%20%3D%20r%5B%3A%2C%201%5D%0A%20%20%20%20plt.plot(x1n%2C%20y1n%2C%20lw%3D4)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20x1n%2C%20y1n%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%20%E2%80%94%20Separate%20velocity%20and%20acceleration.**%20A%20ball%20has%20upward%20velocity%2020%20m%2Fs%20at%20release%2C%20with%20no%20drag%20and%20%24g%3D10%24%20m%2Fs%C2%B2.%20Find%20the%20time%20to%20its%20highest%20point%20and%20its%20acceleration%20there.%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%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%201%0A%0A%20%20%20%20%24v%3D20-10t%24%2C%20so%20the%20top%20occurs%20at%202%20s.%20Gravity%20still%20acts%20there%20and%20%24a%3D-10%24%20m%2Fs%C2%B2.%20A%20zero%20instantaneous%20velocity%20does%20not%20imply%20a%20zero%20derivative%20of%20velocity.%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%23%20Example%202%3A%20Ball%20kicked%20into%20the%20air%20considering%20the%20air%20drag%0A%0A%20%20%20%20Now%2C%20besides%20the%20gravity%2C%20we%20consider%20the%20drag%20due%20to%20the%20air%20resistance%20(%24b%24%3D%200.006%20Ns%2Fm).%20First%20we%20will%20consider%20the%20drag%20force%20%20proportional%20to%20the%20speed%20and%20opposite%20direction%20to%20the%20velocity%20vector.%0A%0A%20%20%20%20%3Cfigure%20aria-describedby%3D%22figure-caption-2%22%3E%3Ccenter%3E%3Cimg%20src%3D%22https%3A%2F%2Fgithub.com%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fimages%2FballGravLinearRes.png%3Fraw%3D1%22%20alt%3D%22free-body%20diagram%20of%20the%20ball%22%20width%3D%22600%22%2F%3E%3C%2Fcenter%3E%3C%2Ffigure%3E%0A%0A%20%20%20%20%3Cspan%20id%3D%22figure-caption-2%22%20class%3D%22figure-caption%22%20style%3D%22display%3Ablock%3Btext-align%3Acenter%3Bfont-style%3Aitalic%22%3EFigure.%20Free-body%20diagram%20of%20a%20ball%20under%20the%20influence%20of%20gravity%20and%20drag.%3C%2Fspan%3E%0A%0A%20%20%20%20So%20the%20forces%20being%20applied%20on%20the%20ball%20are%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%5Cvec%7B%5Cbf%7Bv%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%5Cfrac%7Bd%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%7D%20%3D%20-mg%20%5C%3B%20%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%2B%5Cfrac%7Bdy%7D%7Bdt%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%5Cright)%20%3D%20-%20b%5Cfrac%7Bdx%7D%7Bdt%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%20-%20%5Cleft(mg%20%2B%20b%5Cfrac%7Bdy%7D%7Bdt%7D%5Cright)%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%24%3C%2Fspan%3E%0A%20%20%20%20Writing%20down%20the%20Newton's%20second%20law%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20m%20%5Cfrac%7Bd%5E2%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20-%20b%5Cfrac%7Bdx%7D%7Bdt%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%20-%20%5Cleft(mg%20%2B%20b%5Cfrac%7Bdy%7D%7Bdt%7D%5Cright)%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20%3D%20m%5Cleft(%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%2B%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%5Cright)%24%3C%2Fspan%3E%0A%20%20%20%20Now%2C%20we%20can%20separate%20into%20one%20equation%20for%20each%20coordinate%3A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24-%20b%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20m%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%20%5Cfrac%7Bdx%7D%7Bdt%7D%24%3C%2Fspan%3E%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24-mg%20-%20b%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20m%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%5Cfrac%7Bdy%7D%7Bdt%7D%20-%20g%24%3C%2Fspan%3E%0A%20%20%20%20We%20can%20solve%20these%20equations%20analytically%2C%20for%20example%2C%20by%20using%20Laplace%20Transform%20or%20classical%20methods%20to%20solve%20linear%20differential%20equations.%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%23%23%20Analytical%20solution%0A%0A%20%20%20%20The%20solution%20of%20a%20linear%20differential%20equation%20can%20be%20found%20by%20finding%20the%20natural%20(or%20homogeneous)%20solution%20and%20the%20forced%20(or%20non-homogeneous)%20solution%20and%20then%20adding%20both%20solutions.%0A%0A%20%20%20%20First%2C%20we%20solve%20the%20first%20differential%20equation%20(%24x%24%20coordinate).%20The%20characteristic%20polynomial%20of%20the%20equation%20is%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Clambda%5E2%20%2B%20%5Cfrac%7Bb%7D%7Bm%7D%5Clambda%20%3D%200%0A%20%20%20%20%24%24%0A%0A%20%20%20%20The%20roots%20of%20this%20equation%20are%20%24%5Clambda%20%3D%200%24%20and%20%24%5Clambda%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%24%2C%20and%20consequently%2C%20its%20natural%20modes%20are%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20x_%7Bn_1%7D(t)%20%3D%20Ae%5E%7B0t%7D%20%3D%20A%20%5C%5C%0A%20%20%20%20x_%7Bn_2%7D(t)%20%3D%20B%20e%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20As%20there%20is%20no%20external%20forces%20in%20the%20%24x%24%20direction%2C%20there%20is%20no%20forced%20solution.%20So%2C%20the%20motion%20of%20the%20ball%20in%20the%20%24x%24%20coordinate%20is%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20x(t)%20%3D%20A%20%2B%20Be%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20To%20find%20the%20values%20of%20the%20%24A%24%20and%20%24B%24%20constants%2C%20we%20must%20use%20the%20initial%20conditions%20%24x(0)%24%20and%20%24v_x(0)%24.%0A%0A%20%20%20%20%24%24%0A%20%20%20%20x(0)%20%3D%200%20%3D%20A%20%2B%20B%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20v_x(0)%20%3D%20v_%7Bx0%7D%20%3D%20%5Cfrac%7Bdx(0)%7D%7Bdt%7D%20%3D%20-%5Cfrac%7BBb%7D%7Bm%7De%5E%7B-%5Cfrac%7Bb%7D%7Bm%7D0%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20B%20%3D%20-%5Cfrac%7Bv_%7Bx0%7Dm%7D%7Bb%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20A%20%3D%20%5Cfrac%7Bv_%7Bx0%7Dm%7D%7Bb%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20So%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20x(t)%20%3D%20%5Cfrac%7Bv_%7Bx0%7Dm%7D%7Bb%7D%20-%20%5Cfrac%7Bv_%7Bx0%7Dm%7D%7Bb%7De%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%20%3D%20%5Cfrac%7Bv_%7Bx0%7Dm%7D%7Bb%7D%5Cleft(1-e%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%20%5Cright)%0A%20%20%20%20%24%24%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%20Now%2C%20we%20solve%20the%20differential%20equation%20for%20the%20%24y%24%20coordinate.%3Cbr%3E%0A%20%20%20%20First%2C%20we%20find%20the%20natural%20solution%2C%20which%20comprises%20the%20solution%20from%20the%20equation%20without%20the%20gravitational%20force%20(the%20force%20indepedent%20of%20y(t)%20and%20its%20derivatives)%2C%20in%20this%20case%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%5Cfrac%7Bdy%7D%7Bdt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20The%20solution%20of%20this%20equation%20is%20the%20same%20from%20the%20%24x%24%20coordinate%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20y_n(t)%20%3D%20A%20%2B%20Be%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20The%20forced%20solution%20(including%20the%20gravitational%20force%2C%20which%20is%20constant)%20happens%20when%20every%20derivative%2C%20with%20the%20exception%20of%20the%20derivative%20with%20the%20lowest%20order%20(in%20this%20case%20order%201%20but%20it%20could%20be%20order%200%2C%20i.e.%20no%20derivative)%20goes%20to%20zero.%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%5Cquad%20%3D%20%5Cquad%200%20%5Cquad%20%3D%20%5Cquad%20-%5Cfrac%7Bb%7D%7Bm%7D%5Cfrac%7Bdy_f%7D%7Bdt%7D%20-%20g%20%5Cquad%20%5Crightarrow%20%5Cquad%20%5Cfrac%7Bdy_f%7D%7Bdt%7D%20%3D%20-%5Cfrac%7Bmg%7D%7Bb%7D%20%5Cquad%20%5Crightarrow%20%5Cquad%20y_f(t)%20%3D%20-%5Cfrac%7Bmg%7D%7Bb%7Dt%0A%20%20%20%20%24%24%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%20The%20complete%20solution%20of%20the%20motion%20of%20the%20ball%20in%20the%20%24y%24%20coordinate%20is%20the%20sum%20of%20the%20natural%20and%20forced%20solutions%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20y(t)%20%3D%20A%20%2B%20Be%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%20-%20%5Cfrac%7Bmg%7D%7Bb%7Dt%0A%20%20%20%20%24%24%0A%0A%20%20%20%20To%20find%20the%20values%20of%20the%20constants%20A%20and%20B%2C%20we%20must%20use%20the%20initial%20conditions%20%24y(0)%24%20and%20%24v_y(0)%24.%0A%0A%20%20%20%20%24%24%0A%20%20%20%20y(0)%20%3D%200%20%3D%20A%20%2B%20B%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20v_y(0)%20%3D%20v_%7By0%7D%20%3D%20%5Cfrac%7Bdy(0)%7D%7Bdt%7D%20%3D%20-%20%5Cfrac%7BBb%7D%7Bm%7D%20-%20%5Cfrac%7Bmg%7D%7Bb%7D%20%5C%5C%0A%20%20%20%20B%20%3D%20-%5Cfrac%7Bm%5E2g%7D%7Bb%5E2%7D%20-%5Cfrac%7Bv_%7By0%7Dm%7D%7Bb%7D%20%5C%5C%0A%20%20%20%20A%20%3D%20%2B%5Cfrac%7Bm%5E2g%7D%7Bb%5E2%7D%20%2B%20%5Cfrac%7Bv_%7By0%7Dm%7D%7Bb%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20So%2C%20the%20motion%20of%20the%20ball%20in%20the%20y%20coordinate%20is%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20y(t)%20%3D%20%5Cleft(%5Cfrac%7Bm%5E2g%7D%7Bb%5E2%7D%20%2B%20%5Cfrac%7Bv_%7By0%7Dm%7D%7Bb%7D%5Cright)%20-%20%5Cleft(%5Cfrac%7Bm%5E2g%7D%7Bb%5E2%7D%20%2B%20%5Cfrac%7Bv_%7By0%7Dm%7D%7Bb%7D%5Cright)e%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%20-%5Cfrac%7Bmg%7D%7Bb%7Dt%20%5C%5C%0A%20%20%20%20y(t)%20%3D%20%5Cleft(%5Cfrac%7Bm%5E2g%7D%7Bb%5E2%7D%20%2B%20%5Cfrac%7Bv_%7By0%7Dm%7D%7Bb%7D%5Cright)%5Cleft(1%20-%20e%5E%7B-%5Cfrac%7Bb%7D%7Bm%7Dt%7D%5Cright)%20-%20%5Cfrac%7Bmg%7D%7Bb%7Dt%0A%20%20%20%20%24%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(g%2C%20m%2C%20np%2C%20plt%2C%20vx0%2C%20vy0)%3A%0A%20%20%20%20b%20%3D%200.006%0A%20%20%20%20_t%20%3D%20np.arange(0%2C%202.05%2C%200.01)%0A%20%20%20%20x2a%20%3D%20vx0%20*%20m%20%2F%20b%20*%20(1%20-%20np.exp(-b%20%2F%20m%20*%20_t))%0A%20%20%20%20y2a%20%3D%20(vy0%20*%20m%20%2F%20b%20%2B%20g%20*%20m**2%20%2F%20b**2)%20*%20(1%20-%20np.exp(-b%20%2F%20m%20*%20_t))%20-%20g%20*%20m%20%2F%20b%20*%20_t%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20plt.plot(x2a%2C%20y2a%2C%20lw%3D4)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20(b%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%23%23%20Numerical%20solution%0A%0A%20%20%20%20Now%2C%20we%20will%20solve%20the%20same%20situation%20using%20a%20numerical%20method%20(Euler%20method).%0A%20%20%20%20We%20start%20from%20the%20equations%20previously%20found%20for%20each%20coordinate%3A%0A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%20%5Cfrac%7Bdx%7D%7Bdt%7D%24%3C%2Fspan%3E%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%5Cfrac%7Bdy%7D%7Bdt%7D%20-%20g%24%3C%2Fspan%3E%0A%0A%20%20%20%20We%20can%20separate%20each%20equation%20into%20two%20first%20order%20equations%20and%20apply%20the%20Euler%20method%3A%0A%20%20%20%20%3Cbr%3E%0A%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bdv_x%7D%7Bdt%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7D%20v_x%24%3C%2Fspan%3E%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20v_x%24%3C%2Fspan%3E%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bdv_y%7D%7Bdt%7D%20%3D%20-%5Cfrac%7Bb%7D%7Bm%7Dv_y%20-%20g%24%3C%2Fspan%3E%0A%20%20%20%20%3Cspan%20class%3D%22notranslate%22%3E%24%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20v_y%24%3C%2Fspan%3E%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(b%2C%20dt%2C%20g%2C%20m%2C%20np%2C%20vx0%2C%20vy0%2C%20x0%2C%20y0)%3A%0A%20%20%20%20_x%20%3D%20x0%0A%20%20%20%20_y%20%3D%20y0%0A%20%20%20%20_vx%20%3D%20vx0%0A%20%20%20%20_vy%20%3D%20vy0%0A%20%20%20%20r_1%20%3D%20np.array(%5B_x%2C%20_y%5D)%0A%20%20%20%20while%20_y%20%3E%3D%200%3A%0A%20%20%20%20%20%20%20%20_dxdt%20%3D%20_vx%0A%20%20%20%20%20%20%20%20_x%20%3D%20_x%20%2B%20dt%20*%20_dxdt%0A%20%20%20%20%20%20%20%20_dydt%20%3D%20_vy%0A%20%20%20%20%20%20%20%20_y%20%3D%20_y%20%2B%20dt%20*%20_dydt%0A%20%20%20%20%20%20%20%20_dvxdt%20%3D%20-b%20%2F%20m%20*%20_vx%0A%20%20%20%20%20%20%20%20_vx%20%3D%20_vx%20%2B%20dt%20*%20_dvxdt%0A%20%20%20%20%20%20%20%20_dvydt%20%3D%20-g%20-%20b%20%2F%20m%20*%20_vy%0A%20%20%20%20%20%20%20%20_vy%20%3D%20_vy%20%2B%20dt%20*%20_dvydt%0A%20%20%20%20%20%20%20%20r_1%20%3D%20np.vstack((r_1%2C%20np.array(%5B_x%2C%20_y%5D)))%0A%20%20%20%20return%20(r_1%2C)%0A%0A%0A%40app.cell%0Adef%20_(plt%2C%20r_1)%3A%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20x2n%20%3D%20r_1%5B%3A%2C%200%5D%0A%20%20%20%20y2n%20%3D%20r_1%5B%3A%2C%201%5D%0A%20%20%20%20plt.plot(x2n%2C%20y2n%2C%20lw%3D4)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20x2n%2C%20y2n%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%20%E2%80%94%20Find%20a%20linear-drag%20terminal%20speed.**%20A%202%20kg%20body%20falls%20in%20still%20air%20with%20linear%20coefficient%20%24b%3D4%24%20N%20s%2Fm.%20Take%20upward%20positive%20and%20%24g%3D10%24%20m%2Fs%C2%B2.%20Find%20terminal%20velocity.%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%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%202%0A%0A%20%20%20%20At%20terminal%20velocity%20%240%3D-mg-bv%24%2C%20so%20%24v_T%3D-mg%2Fb%3D-5%24%20m%2Fs.%20The%20negative%20sign%20indicates%20descent.%20The%20approach%20time%20scale%20is%20%24m%2Fb%3D0.5%24%20s.%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%23%20Example%203%3A%20Ball%20kicked%20into%20the%20air%20considering%20the%20air%20drag%20proportional%20to%20square%20of%20speed%0A%0A%20%20%20%20Now%2C%20we%20will%20consider%20the%20drag%20force%20due%20to%20the%20air%20resistance%20proportional%20to%20the%20square%20of%20speed%20and%20still%20in%20the%20opposite%20direction%20of%20the%20velocity%20vector.%0A%0A%20%20%20%20%3Cfigure%20aria-describedby%3D%22figure-caption-3%22%3E%3Ccenter%3E%3Cimg%20src%3D%22https%3A%2F%2Fgithub.com%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fimages%2FballGravSquareRes.png%3Fraw%3D1%22%20alt%3D%22free-body%20diagram%20of%20the%20ball%22%20width%3D%22600%22%2F%3E%3C%2Fcenter%3E%3C%2Ffigure%3E%0A%0A%20%20%20%20%3Cspan%20id%3D%22figure-caption-3%22%20class%3D%22figure-caption%22%20style%3D%22display%3Ablock%3Btext-align%3Acenter%3Bfont-style%3Aitalic%22%3EFigure.%20Free-body%20diagram%20of%20a%20ball%20under%20the%20influence%20of%20gravity%20and%20drag%20proportional%20to%20the%20square%20of%20speed.%3C%2Fspan%3E%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%20So%20the%20forces%20being%20applied%20on%20the%20ball%20are%20(for%20a%20revision%20of%20Time-varying%20frames%20and%20the%20meaning%20of%20the%20%24%5Chat%7B%5Cbf%7Be_t%7D%7D%24%2C%20see%20%5BTime-varying%20frames%20notebook%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fpath_frame.py))%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20bv%5E2%5Chat%7B%5Cbf%7Be_t%7D%7D%20%5C%5C%0A%20%20%20%20%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%20(v_x%5E2%2Bv_y%5E2)%20%5Cfrac%7Bv_x%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%20%2B%20v_y%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%7D%7B%5Csqrt%7Bv_x%5E2%2Bv_y%5E2%7D%7D%20%5C%5C%0A%20%20%20%20%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%20%5Csqrt%7Bv_x%5E2%2Bv_y%5E2%7D%20%5C%2C(v_x%20%5C%3B%20%5Chat%7B%5Cbf%7Bi%7D%7D%2Bv_y%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D)%20%5C%5C%0A%20%20%20%20%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%2B%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Chat%7B%5Cbf%7Bi%7D%7D%20%2B%20%5Cfrac%7Bdy%7D%7Bdt%7D%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%5Cright)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20Writing%20down%20the%20Newton's%20second%20law%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cvec%7B%5Cbf%7BF%7D%7D%20%3D%20m%20%5Cfrac%7Bd%5E2%5Cvec%7B%5Cbf%7Br%7D%7D%7D%7Bdt%5E2%7D%20%5C%5C%0A%20%20%20%20-mg%20%5C%3B%20%5Chat%7B%5Cbf%7Bj%7D%7D%20-%20b%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%2B%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Chat%7B%5Cbf%7Bi%7D%7D%2B%5Cfrac%7Bdy%7D%7Bdt%7D%5Chat%7B%5Cbf%7Bj%7D%7D%5Cright)%20%3D%20m%5Cleft(%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%5Chat%7B%5Cbf%7Bi%7D%7D%2B%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%5Chat%7B%5Cbf%7Bj%7D%7D%5Cright)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20Now%2C%20we%20can%20separate%20into%20one%20equation%20for%20each%20coordinate%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20-b%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%2B%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20m%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5C%5C%0A%20%20%20%20%5Cfrac%7Bd%5E2x%7D%7Bdt%5E2%7D%20%3D%20-%20%5Cfrac%7Bb%7D%7Bm%7D%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%2B%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cfrac%7Bdx%7D%7Bdt%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20-mg%20-%20b%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%2B%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20m%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%5Cquad%20%5Crightarrow%20%5C%5C%0A%20%20%20%20%5Cfrac%7Bd%5E2y%7D%7Bdt%5E2%7D%20%3D%20-%20%5Cfrac%7Bb%7D%7Bm%7D%20%5Csqrt%7B%5Cleft(%5Cfrac%7Bdx%7D%7Bdt%7D%20%5Cright)%5E2%20%2B%20%5Cleft(%5Cfrac%7Bdy%7D%7Bdt%7D%20%5Cright)%5E2%7D%20%5C%2C%5Cfrac%7Bdy%7D%7Bdt%7D%20-g%0A%20%20%20%20%24%24%0A%0A%20%20%20%20These%20equations%20are%20very%20difficult%20to%20solve%20analytically%2C%20but%20they%20can%20be%20easily%20%20solved%20by%20using%20numerical%20methods.%20Below%20we%20%20will%20use%20the%20same%20numerical%20method%20(Euler%20method)%20to%20solve%20these%20equations.%3Cbr%3E%0A%20%20%20%20For%20that%2C%20again%20we%20must%20break%20each%20equation%20into%20two%20first-order%20differential%20equations%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdv_x%7D%7Bdt%7D%20%3D%20-%20%5Cfrac%7Bb%7D%7Bm%7D%20%5Csqrt%7Bv_x%5E2%2Bv_y%5E2%7D%20%5C%2Cv_x%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdx%7D%7Bdt%7D%20%3D%20v_x%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdv_y%7D%7Bdt%7D%20%3D%20-%20%5Cfrac%7Bb%7D%7Bm%7D%20%5Csqrt%7Bv_x%5E2%2Bv_y%5E2%7D%20%5C%2Cv_y%20-g%0A%20%20%20%20%24%24%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cfrac%7Bdy%7D%7Bdt%7D%20%3D%20v_y%0A%20%20%20%20%24%24%0A%0A%20%20%20%20Now%2C%20we%20can%20apply%20the%20Euler%20method%20to%20find%20a%20solution.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(b%2C%20dt%2C%20g%2C%20m%2C%20np%2C%20vx0%2C%20vy0%2C%20x0%2C%20y0)%3A%0A%20%20%20%20_x%20%3D%20x0%0A%20%20%20%20_y%20%3D%20y0%0A%20%20%20%20_vx%20%3D%20vx0%0A%20%20%20%20_vy%20%3D%20vy0%0A%20%20%20%20r_2%20%3D%20np.array(%5B_x%2C%20_y%5D)%0A%20%20%20%20while%20_y%20%3E%3D%200%3A%0A%20%20%20%20%20%20%20%20_dxdt%20%3D%20_vx%0A%20%20%20%20%20%20%20%20_x%20%3D%20_x%20%2B%20dt%20*%20_dxdt%0A%20%20%20%20%20%20%20%20_dydt%20%3D%20_vy%0A%20%20%20%20%20%20%20%20_y%20%3D%20_y%20%2B%20dt%20*%20_dydt%0A%20%20%20%20%20%20%20%20_dvxdt%20%3D%20-b%20%2F%20m%20*%20np.sqrt(_vx**2%20%2B%20_vy**2)%20*%20_vx%0A%20%20%20%20%20%20%20%20_vx%20%3D%20_vx%20%2B%20dt%20*%20_dvxdt%0A%20%20%20%20%20%20%20%20_dvydt%20%3D%20-b%20%2F%20m%20*%20np.sqrt(_vx**2%20%2B%20_vy**2)%20*%20_vy%20-%20g%0A%20%20%20%20%20%20%20%20_vy%20%3D%20_vy%20%2B%20dt%20*%20_dvydt%0A%20%20%20%20%20%20%20%20r_2%20%3D%20np.vstack((r_2%2C%20np.array(%5B_x%2C%20_y%5D)))%0A%20%20%20%20return%20(r_2%2C)%0A%0A%0A%40app.cell%0Adef%20_(plt%2C%20r_2)%3A%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20x3n%20%3D%20r_2%5B%3A%2C%200%5D%0A%20%20%20%20y3n%20%3D%20r_2%5B%3A%2C%201%5D%0A%20%20%20%20plt.plot(x3n%2C%20y3n%2C%20lw%3D4)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20x3n%2C%20y3n%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%20%E2%80%94%20Keep%20quadratic%20drag%20opposing%20motion.**%20Write%20the%20signed%20equation%20for%20a%202%20kg%20particle%20under%20gravity%20and%20quadratic%20drag%20with%20%24c%3D0.5%24%20kg%2Fm.%20Find%20the%20downward%20terminal%20speed%20for%20%24g%3D10%24%20m%2Fs%C2%B2.%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%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%203%0A%0A%20%20%20%20With%20upward%20positive%2C%20%242%5Cdot%20v%3D-20-0.5%7Cv%7Cv%24.%20At%20terminal%20descent%20%24v_T%3D-%5Csqrt%7Bmg%2Fc%7D%3D-%5Csqrt%7B40%7D%5Capprox-6.325%24%20m%2Fs.%20The%20absolute%20value%20gives%20the%20correct%20drag%20direction%20during%20both%20ascent%20and%20descent.%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%23%23%20All%20numerical%20solutions%20plotted%20together%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plt%2C%20x1n%2C%20x2n%2C%20x3n%2C%20y1n%2C%20y2n%2C%20y3n)%3A%0A%20%20%20%20plt.figure(figsize%3D(8%2C%204))%0A%20%20%20%20plt.plot(x1n%2C%20y1n%2C%20lw%3D4%2C%20c%3D%22g%22%2C%20label%3D%22%24g%24%22)%0A%20%20%20%20plt.plot(x2n%2C%20y2n%2C%20lw%3D4%2C%20c%3D%22b%22%2C%20label%3D%22%24g%2Bbv%24%22)%0A%20%20%20%20plt.plot(x3n%2C%20y3n%2C%20lw%3D4%2C%20c%3D%22r%22%2C%20label%3D%22%24g%2Bbv%5E2%24%22)%0A%20%20%20%20plt.xlim(0%2C%2036)%0A%20%20%20%20plt.ylim(0%2C%206)%0A%20%20%20%20plt.title(%22Ball%20trajectory%22)%0A%20%20%20%20plt.xlabel(%22x%22)%0A%20%20%20%20plt.ylabel(%22y%22)%0A%20%20%20%20plt.legend(loc%3D%22best%22%2C%20frameon%3DFalse)%0A%20%20%20%20plt.show()%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%204%20%E2%80%94%20Check%20numerical%20convergence.**%20An%20explicit%20Euler%20simulation%20of%20the%20no-drag%20ball%20uses%20%24v_%7Bn%2B1%7D%3Dv_n-g%5CDelta%20t%24%20and%20%24y_%7Bn%2B1%7D%3Dy_n%2Bv_n%5CDelta%20t%24.%20Is%20its%20height%20exact%20even%20though%20its%20sampled%20velocity%20is%20exact%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%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%204%0A%0A%20%20%20%20No.%20The%20position%20update%20omits%20the%20within-step%20acceleration%20contribution.%20For%20a%20total%20time%20%24t%3DN%5CDelta%20t%24%2C%20the%20height%20error%20is%20%24g%20t%5CDelta%20t%2F2%24%20upward%20relative%20to%20the%20exact%20parabola.%20Halving%20the%20time%20step%20halves%20this%20first-order%20error.%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%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%20Checkpoint%20questions%0A%0A%20%20%20%201.%20What%20determines%20the%20direction%20of%20drag%3F%0A%20%20%20%202.%20Does%20terminal%20velocity%20mean%20no%20forces%20act%3F%0A%20%20%20%203.%20Which%20initial%20conditions%20are%20needed%20for%20a%20second-order%20position%20equation%3F%0A%20%20%20%204.%20When%20does%20the%20flight-time%20formula%20require%20equal%20launch%20and%20landing%20heights%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%2F%2F%2F%20details%20%7C%20Checkpoint%20answers%0A%0A%20%20%20%201.%20Velocity%20relative%20to%20the%20surrounding%20fluid.%0A%20%20%20%202.%20No%3B%20the%20forces%20balance.%0A%20%20%20%203.%20Initial%20position%20and%20velocity.%0A%20%20%20%204.%20When%20using%20symmetry%20to%20set%20ascent%20and%20descent%20times%20equal.%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%20Problems%0A%0A%20%20%20%201.%20(Example%2013.1%2C%20Hibbeler's%20book)%20A%20%2450%20kg%24%20crate%20rests%20on%20a%20horizontal%20surface%20for%20which%20the%20coefficient%20of%20kinetic%20friction%20is%20%24%5Cmu_k%20%3D%200.3%24.%20If%20the%20crate%20is%20subjected%20to%20a%20%24400%20N%24%20towing%20force%20applied%20upward%20with%20a%20%2430%5Eo%24%20angle%20w.r.t.%20the%20horizontal%2C%20determine%20the%20velocity%20of%20the%20crate%20after%20%243%20s%24%20starting%20from%20rest.%0A%0A%20%20%20%202.%20(Example%2013.2%2C%20Hibbeler's%20book)%20A%2010%20kg%20projectile%20is%20fired%20vertically%20upward%20from%20the%20ground%2C%20with%20an%20initial%20velocity%20of%2050%20%24m%2Fs%24.%20Determine%20the%20maximum%20height%20to%20which%20it%20will%20travel%20if%20(a)%20atmospheric%20resistance%20is%20neglected%3B%20and%20(b)%20atmospheric%20resistance%20is%20measured%20as%20%24F_D%3D0.01v%5E2%24%20%24N%24%2C%20where%20%24v%24%20is%20the%20speed%20of%20the%20projectile%20at%20any%20instant%2C%20measured%20in%20%24m%2Fs%24.%0A%0A%20%20%20%203.%20(Exercise%2013.6%2C%20Hibbeler's%20book)%20A%20person%20pushes%20on%20a%20%2460%20kg%24%20crate%20with%20a%20force%20%24F%24.%20The%20force%20is%20always%20directed%20down%20at%20%2430%5Eo%24%20from%20the%20horizontal%20as%20shown%2C%20and%20its%20magnitude%20is%20increased%20until%20the%20crate%20begins%20to%20slide.%20Determine%20the%20crate%E2%80%99s%20initial%20acceleration%20if%20the%20coefficient%20of%20static%20friction%20is%20%24%5Cmu_s%3D0.6%24%20and%20the%20coefficient%20of%20kinetic%20friction%20is%20%24%5Cmu_k%3D0.3%24.%0A%0A%20%20%20%204.%20(Exercise%2013.46%2C%20Hibbeler's%20book)%20The%20parachutist%20of%20mass%20%24m%24%20is%20falling%20with%20a%20velocity%20of%20%24v_0%24%20at%20the%20instant%20she%20opens%20the%20parachute.%20If%20air%20resistance%20is%20%24F_D%20%3D%20Cv%5E2%24%2C%20show%20that%20her%20limiting%20downward%20speed%20(terminal%20speed)%20during%20the%20descent%20is%20%24v_%7Bmax%7D%3D%5Csqrt%7B%7Bmg%7D%2F%7BC%7D%7D%24.%20Solve%20the%20problem%20numerically%20considering%20%24m%3D100%20kg%24%2C%20%24g%3D10%20m%2Fs%5E2%24%2C%20and%20%24C%3D10%20kg%2Fm%24.%20Plot%20a%20simulation%20of%20this%20numerical%20solution%20and%20show%20that%20indeed%20the%20parachutist%20approaches%20the%20terminal%20velocity.%0A%0A%20%20%20%205.%20Consider%20a%20block%20with%20mass%20of%20%241%20kg%24%20attached%20to%20a%20spring%20hanging%20from%20a%20ceiling%20(the%20spring%20constant%20%24k%20%3D%20100%20N%2Fm%24).%20At%20%24t%20%3D%200%20s%24%2C%20the%20spring%20is%20stretched%20by%20%240.1%20m%24%20from%20the%20equilibrium%20position%20of%20the%20block%20%2B%20spring%20system%20and%20then%20it's%20released%20(the%20initial%20velocity%20is%20not%20specified).%20Find%20the%20motion%20of%20the%20block.%0A%0A%20%20%20%207.%20(https%3A%2F%2Fyoutu.be%2FN6IhkTjWrd4)%20A%20%2415%20kg%24%20box%20rests%20on%20a%20frictionless%20horizontal%20surface%20attached%20to%20a%20%245%20kg%24%20box%20as%20shown%20below.%3Cbr%3E%0A%20%20%20%20%20%20a.%20What%20is%20the%20acceleration%20of%20the%20system%3F%3Cbr%3E%0A%20%20%20%20%20%20b.%20What%20is%20the%20tension%20in%20the%20rope%3F%3Cbr%3E%0A%20%20%20%20%20%20c.%20Now%20consider%20a%20coefficient%20of%20kinetic%20friction%20of%20%240.25%24%20between%20the%20horizontal%20surface%20and%20the%20box.%20What%20are%20the%20acceleration%20of%20the%20system%20and%20the%20tension%20in%20the%20rope%3F%0A%0A%20%20%20%20%3Cfigure%3E%3Ccenter%3E%3Cimg%20src%3D%22https%3A%2F%2Fgithub.com%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fimages%2Fboxes_pulley_rope.png%3Fraw%3D1%22%20alt%3D%22free-body%20diagram%20of%20the%20ball%22%20width%3D%22300%22%2F%3E%3C%2Fcenter%3E%3C%2Ffigure%3E%0A%0A%20%20%20%208.%20Consider%20a%20moving%20particle%20in%20a%20fluid%20with%20viscosity%20proportional%20to%20the%20cube%20of%20the%20velocity.%20This%20particle%20moves%20only%20vertically%20and%20never%20reaches%20the%20ground.%20Consider%20the%20magnitude%20of%20the%20acceleration%20due%20to%20gravity%20as%20%2410%20m%2Fs%5E2%24.%3Cbr%3E%0A%20%20%20%20%20%20%20a.%20Draw%20the%20free%20body%20diagram.%3Cbr%3E%0A%20%20%20%20%20%20%20b.%20What%20is%20the%20differential%20equation%20that%20describes%20the%20particle's%20motion%3F%3Cbr%3E%0A%20%20%20%20%20%20%20c.%20If%20the%20viscosity%20coefficient%20is%20%245%20Ns%5E3%2Fm%5E3%24%2C%20what%20is%20the%20terminal%20speed%20of%20the%20particle%20as%20a%20function%20of%20its%20mass%20m%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%2F%2F%2F%20details%20%7C%20Final%20answers%20to%20original%20Problems%0A%0A%20%20%20%201.%20With%20%24g%3D9.81%24%20m%2Fs%C2%B2%3A%2015.5556%20m%2Fs%20horizontally%20after%203%20s.%0A%0A%20%20%20%202.%20(a)%20127.421%20m.%20(b)%20113.505%20m%2C%20with%20the%20stated%20quadratic%20coefficient%20and%20%24g%3D9.81%24%20m%2Fs%C2%B2.%0A%0A%20%20%20%203.%20Initial%20sliding%20acceleration%3A%204.50282%20m%2Fs%C2%B2%20(%24g%3D9.81%24%20m%2Fs%C2%B2)%3B%20the%20threshold%20push%20is%20623.930%20N.%0A%0A%20%20%20%204.%20Terminal%20downward%20speed%20is%20%24%5Csqrt%7Bmg%2FC%7D%3D10%24%20m%2Fs.%20For%20downward%20initial%20speed%20%24v_0%3C10%24%20m%2Fs%2C%20%24v(t)%3D10%5Ctanh%5Bt%2B%5Coperatorname%7Bartanh%7D(v_0%2F10)%5D%24%20m%2Fs%20for%20these%20parameters.%20If%20%24v_0%3E10%24%2C%20the%20speed%20decreases%20toward%2010%3B%20terminal%20speed%20is%20then%20not%20the%20maximum%20speed%20during%20descent.%0A%0A%20%20%20%205.%20With%20displacement%20measured%20downward%20from%20static%20equilibrium%2C%20%24x(t)%3D0.1%5Ccos(10t)%2B(v_0%2F10)%5Csin(10t)%24%20m.%20%E2%80%9CReleased%20from%20rest%E2%80%9D%20would%20specify%20%24v_0%3D0%24%3B%20otherwise%20the%20initial%20velocity%20remains%20a%20free%20parameter.%0A%0A%20%20%20%207.%20Without%20friction%3A%20%24a%3D2.4525%24%20m%2Fs%C2%B2%2C%20%24T%3D36.7875%24%20N.%20With%20kinetic%20coefficient%200.25%3A%20%24a%3D0.613125%24%20m%2Fs%C2%B2%2C%20%24T%3D45.9844%24%20N.%20The%205%20kg%20mass%20accelerates%20downward%20(%24g%3D9.81%24%20m%2Fs%C2%B2).%0A%0A%20%20%20%208.%20With%20upward%20positive%3A%20gravity%20downward%2C%20drag%20opposite%20velocity%3B%20%24m%5Cdot%20v%3D-mg-cv%5E3%24.%20Terminal%20downward%20speed%20is%20%24(mg%2Fc)%5E%7B1%2F3%7D%3D(2m)%5E%7B1%2F3%7D%24%20m%2Fs%20for%20the%20stated%20%24g%24%20and%20%24c%24%20and%20mass%20m%20in%20kg.%20The%20prompt%20gives%20no%20mass%2C%20so%20no%20unique%20numerical%20speed%20is%20determined.%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%20Go%20deeper%0A%0A%20%20%20%20-%20Read%20the%20chapter%200%20of%20the%20%5BRuina%20and%20Rudra's%20book%5D(https%3A%2F%2Fruina.tam.cornell.edu%2FBook%2Findex.html)%20about%20mechanics%0A%20%20%20%20-%20Read%20pages%20478-494%20of%20the%20chapter%2010%20of%20the%20%5BRuina%20and%20Rudra's%20book%5D(https%3A%2F%2Fruina.tam.cornell.edu%2FBook%2Findex.html)%20about%201D%20dynamics%0A%20%20%20%20-%20Read%20the%20chapter%2013%20of%20the%20%5BHibbeler's%20book%5D(https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1sDLluWCiBCog2C11_Iu1fjv-BtfVUxBU%2Fview)%20(available%20in%20the%20Classroom)%0A%20%20%20%20-%20See%20%5BWhat%20is%20the%20fastest%20possible%20volleyball%20serve%3F%5D(https%3A%2F%2Fuio-ccse.github.io%2Fcomputational-essay-showroom%2Fessays%2Fexampleessays%2Fvolleyball%2FVolleyball.html)%20for%20a%20nice%20investigation%20about%20the%20ball%20movement%20during%20a%20volleyball%20serve%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%23%20Optional%20textbook%20investigations%0A%0A%20%20%20%20These%20original%20external%20assignments%20require%20the%20stated%20edition%20and%20its%20figures.%20They%20are%20retained%20as%20optional%20reading%3B%20the%20self-contained%20Problems%20above%20have%20answer%20panels.%0A%0A%20%20%20%206.%20Solve%20exercises%2012.1.16%2C%2012.1.19%2C%2012.1.24%2C%2012.1.29%2C%2012.1.30%2C%2012.1.31(a%2C%20b%2C%20d)%20and%2012.1.32%20from%20Ruina%20and%20Pratap's%20book%20(2019).%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%23%20Video%20lectures%20on%20the%20Internet%0A%0A%20%20%20%20-%20Khan%20Academy%3A%20%5BForces%20and%20Newton's%20laws%20of%20motion%5D(https%3A%2F%2Fwww.khanacademy.org%2Fscience%2Fap-physics-1%2Fap-forces-newtons-laws)%20(Em%20portugu%C3%AAs%3A%20%5BFor%C3%A7as%20e%20as%20Leis%20do%20Movimento%20de%20Newton%5D(https%3A%2F%2Fpt.khanacademy.org%2Fscience%2Fphysics%2Fforces-newtons-laws)).%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%23%20Additional%20verified%20lecture%0A%0A%20%20%20%20%5BMIT%20OpenCourseWare%5D(https%3A%2F%2Focw.mit.edu%2Fcourses%2F2-003sc-engineering-dynamics-fall-2011%2Fpages%2Ffree-body-diagrams-and-fictitious-forces%2F)%20%E2%80%94%20Free-body%20diagrams%3A%20practice%20selecting%20a%20body%20and%20frame%20before%20writing%20force%20and%20moment%20equations.%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%20References%0A%0A%20%20%20%20-%20Hibbeler%20RC%20(2010)%20%5BEngineering%20Mechanics%20Dynamics%5D(https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1sDLluWCiBCog2C11_Iu1fjv-BtfVUxBU%2Fview).%2012th%20Edition.%20Pearson%20Prentice%20Hall.%0A%0A%20%20%20%20-%20Ruina%20A%2C%20Rudra%20P%20(2019)%20%5BIntroduction%20to%20Statics%20and%20Dynamics%5D(https%3A%2F%2Fruina.tam.cornell.edu%2FBook%2Findex.html).%20Oxford%20University%20Press.%0A%0A%20%20%20%20-%20Taylor%20JR%20(2005)%20%5BClassical%20Mechanics%5D(https%3A%2F%2Fbooks.google.com.br%2Fbooks%3Fid%3DP1kCtNr-pJsC).%20University%20Science%20Books.%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
88fe75834b2e8413a4d3148c00219599