%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%22scipy%3E%3D1.14%22%2C%20%22sympy%3E%3D1.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%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%20Muscle%20modeling%0A%0A%20%20%20%20%3E%20Marcos%20Duarte%2C%20Renato%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%20marimo%20version%0A%0A%20%20%20%20This%20notebook%20is%20a%20guided%20study%20session%20about%20Hill-type%20muscle%20modeling.%20Read%20a%20short%20explanation%2C%20predict%20the%20shape%20of%20the%20response%2C%20run%20the%20code%2C%20and%20then%20use%20the%20result%20to%20answer%20the%20challenge%20questions.%0A%0A%20%20%20%20The%20executable%20sections%20retain%20the%20original%20computational%20models%2C%20parameter%20values%2C%20and%20plots.%20They%20use%20the%20Thelen%20(2003)%20and%20McLean%2C%20Su%2C%20and%20van%20den%20Bogert%20(2003)%20formulations.%0A%0A%20%20%20%20Chapter%202%20of%20Yamaguchi's%20*Dynamic%20Modeling%20of%20Musculoskeletal%20Motion%3A%20A%20Vectorized%20Approach*%20is%20used%20only%20for%20prompts%20and%20problems.%20Those%20Yamaguchi-inspired%20tasks%20ask%20you%20to%20implement%20activation%2C%20force-length%2C%20force-velocity%2C%20passive%20muscle%2C%20and%20tendon%20functions%20later%3B%20this%20notebook%20does%20not%20solve%20those%20tasks%20or%20use%20those%20equations%20to%20generate%20the%20plots%20below.%0A%0A%20%20%20%20The%20goal%20is%20not%20to%20memorize%20one%20%22correct%22%20muscle%20model.%20The%20goal%20is%20to%20connect%20the%20pieces%3A%0A%0A%20%20%20%201.%20a%20neural%20control%20signal%20becomes%20muscle%20activation%3B%0A%20%20%20%202.%20activation%20scales%20active%20muscle%20force%3B%0A%20%20%20%203.%20active%20force%20changes%20with%20muscle%20fiber%20length%20and%20velocity%3B%0A%20%20%20%204.%20passive%20muscle%20and%20tendon%20elasticity%20change%20the%20force%20transmitted%20to%20the%20skeleton.%0A%0A%20%20%20%20**Challenge%200.**%20Before%20running%20the%20notebook%2C%20sketch%20what%20you%20expect%20from%20a%20muscle%20that%20receives%20a%20step%20command%3A%20does%20activation%20jump%20instantly%2C%20rise%20smoothly%2C%20overshoot%2C%20or%20decay%20slowly%3F%0A%0A%20%20%20%20The%20existing%20interactive%20curves%20let%20you%20separate%20the%20active%2C%20passive%2C%20tendon%2C%20velocity%20and%20activation%20ingredients%20before%20combining%20them.%20Use%20normalized%20variables%20carefully%3A%20unit%20force%20means%20maximum%20isometric%20force%20at%20optimal%20length%2C%20not%20one%20newton.%20Make%20one%20parameter%20change%20at%20a%20time%20and%20compare%20with%20the%20equations.%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.**%20If%20activation%20stays%20constant%2C%20must%20muscle%20force%20stay%20constant%20while%20the%20muscle%20shortens%3F%20Predict%20how%20length%2C%20velocity%20and%20tendon%20stretch%20affect%20the%20answer.%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%20There%20are%20two%20major%20classes%20of%20muscle%20models%20that%20have%20been%20used%20in%20biomechanics%20and%20motor%20control%3A%20the%20Hill-type%20and%20Huxley-type%20models.%20They%20differ%20mainly%20on%20how%20the%20contractile%20element%20is%20modeled.%20In%20Hill-type%20models%2C%20the%20modeling%20of%20the%20contractile%20element%20is%20phenomenological%3B%20arbitrary%20mathematical%20functions%20are%20used%20to%20reproduce%20experimental%20observations%20relating%20muscle%20characteristics%20(such%20as%20excitation%2Factivation%2C%20muscle%20length%20and%20velocity)%20with%20the%20muscle%20force.%20In%20Huxley-type%20models%2C%20the%20modeling%20of%20the%20contractile%20element%20is%20mechanistic%3B%20the%20mathematical%20functions%20used%20represent%20the%20hypothesized%20mechanisms%20for%20the%20cross-bridge%20dynamics%20(Tsianos%20and%20Loeb%2C%202013).%20Huxley-type%20models%20tend%20to%20produce%20more%20realistic%20results%20than%20Hill-type%20models%20for%20certain%20conditions%20but%20they%20have%20a%20higher%20computational%20demand.%20For%20this%20reason%2C%20Hill-type%20models%20are%20more%20often%20employed%20in%20musculoskeletal%20modeling%20and%20simulation.%0A%0A%20%20%20%20Hill-type%20muscle%20models%20are%20presented%20in%20several%20texts%20(e.g.%2C%20Erdermir%20et%20al.%202007%3B%20He%20et%20al.%2C%201991%3B%20McMahon%2C%201984%3B%20Nigg%20and%20Herzog%2C%202007%3B%20Robertson%20et%20al.%2C%202013%2C%20Thelen%2C%202003%3B%20Tsianos%20and%20Loeb%2C%202013%2C%20Winters%2C%201990%3B%20Zajac%2C%201989%3B%20Zatsiorsky%20and%20Prilutsky%2C%202012)%20and%20implemented%20in%20many%20software%20for%20modeling%20and%20simulation%20of%20the%20musculoskeletal%20dynamics%20of%20human%20movement%20(e.g.%2C%20the%20free%20and%20open%20source%20software%20%5BOpenSim%5D(https%3A%2F%2Fsimtk.org%2Fhome%2Fopensim)).%0A%0A%20%20%20%20Next%2C%20let's%20see%20a%20brief%20overview%20of%20a%20Hill-type%20muscle%20model%20and%20a%20basic%20implementation%20in%20Python.%0A%0A%20%20%20%20**The%20modeling%20story.**%20A%20Hill-type%20model%20is%20a%20compact%20way%20to%20represent%20the%20macroscopic%20behavior%20of%20a%20muscle-tendon%20actuator.%20It%20does%20not%20model%20every%20cross-bridge%20directly.%20Instead%2C%20it%20uses%20empirical%20functions%20that%20reproduce%20important%20observations%3A%0A%0A%20%20%20%20-%20muscle%20can%20pull%20but%20not%20push%3B%0A%20%20%20%20-%20active%20force%20is%20largest%20near%20an%20optimal%20fiber%20length%3B%0A%20%20%20%20-%20passive%20force%20grows%20when%20muscle%20or%20tendon%20is%20stretched%3B%0A%20%20%20%20-%20shortening%20muscle%20produces%20less%20force%20than%20an%20isometric%20muscle%3B%0A%20%20%20%20-%20lengthening%20muscle%20can%20produce%20more%20force%20than%20an%20isometric%20muscle%3B%0A%20%20%20%20-%20activation%20cannot%20change%20instantaneously.%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%20Hill-type%20muscle%20model%0A%0A%20%20%20%20Hill-type%20models%20are%20developed%20to%20reproduce%20the%20dependence%20of%20force%20with%20the%20length%20and%20velocity%20of%20the%20muscle-tendon%20unit%20and%20parameters%20are%20lumped%20and%20made%20dimensionless%20in%20order%20to%20represent%20different%20muscles%20with%20few%20changes%20in%20these%20parameters.%20A%20Hill-type%20model%20is%20complemented%20with%20the%20modeling%20of%20the%20activation%20dynamics%20(i.e.%2C%20the%20temporal%20pattern%20of%20muscle%20activation%20and%20deactivation%20as%20a%20function%20of%20the%20neural%20excitation)%20to%20produce%20more%20realistic%20results.%20As%20a%20result%2C%20the%20force%20generated%20will%20be%20a%20function%20of%20three%20factors%3A%20the%20length%20and%20velocity%20of%20the%20muscle-tendon%20unit%20and%20its%20activation%20level%20%24a%24.%0A%0A%20%20%20%20A%20Hill-type%20muscle%20model%20has%20three%20components%20(see%20figure%20below)%3A%20two%20for%20the%20muscle%2C%20an%20active%20contractile%20element%20(CE)%20and%20a%20passive%20elastic%20element%20(PE)%20in%20parallel%20with%20the%20CE%2C%20and%20one%20component%20for%20the%20tendon%2C%20an%20elastic%20element%20(SE)%20in%20series%20with%20the%20muscle.%20In%20some%20variations%2C%20a%20damping%20component%20is%20added%20parallel%20to%20the%20CE%20as%20a%20fourth%20element.%20A%20%5Bpennation%20angle%5D(https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMuscle_architecture)%20(angle%20of%20the%20pennate%20fibers%20with%20respect%20to%20the%20force-generating%20axis)%20is%20also%20included%20in%20the%20model.%20In%20a%20simpler%20approach%2C%20the%20muscle%20and%20tendon%20are%20assumed%20massless.%0A%0A%20%20%20%20%3Cfigure%20aria-describedby%3D%22figure-caption-1%22%3E%0A%20%20%20%20%20%20%20%20%3Ccenter%3E%3Cimg%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2FBMClab%2FBMC%2Fmaster%2Fimages%2Fmuscle_hill.png%22%20width%3D400%20alt%3D%22Hill-type%20muscle%20model.%22%2F%3E%3C%2Fcenter%3E%0A%20%20%20%20%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.%20A%20Hill-type%20muscle%20model%20with%20three%20components%3A%20two%20for%20the%20muscle%2C%20an%20active%20contractile%20element%2C%20%24%5Cmathsf%7BCE%7D%24%2C%20and%20a%20passive%20elastic%20element%20in%20parallel%2C%20%24%5Cmathsf%7BPE%7D%24%2C%20with%20the%20%24%5Cmathsf%7BCE%7D%24%2C%20and%20one%20component%20for%20the%20tendon%2C%20an%20elastic%20element%20in%20series%2C%20%24%5Cmathsf%7BSE%7D%24%2C%20with%20the%20muscle.%20%24%5Cmathsf%7BL_%7BMT%7D%7D%24%3A%20muscle%E2%80%93tendon%20length%2C%20%24%5Cmathsf%7BL_T%7D%24%3A%20tendon%20length%2C%20%24%5Cmathsf%7BL_M%7D%24%3A%20muscle%20fiber%20length%2C%20%24%5Cmathsf%7BF_T%7D%24%3A%20tendon%20force%2C%20%24%5Cmathsf%7BF_M%7D%24%3A%20muscle%20force%2C%20and%20%24%CE%B1%24%3A%20pennation%20angle.%3C%2Fspan%3E%0A%0A%20%20%20%20Let's%20now%20revise%20the%20models%20of%20a%20Hill-type%20muscle%20with%20three%20components%20and%20activation%20dynamics%20by%20two%20references%3A%0A%20%20%20%201.%20%5BThelen%20(2003)%5D(http%3A%2F%2Fsimtk-confluence.stanford.edu%3A8080%2Fdisplay%2FOpenSim%2FThelen%2B2003%2BMuscle%2BModel)%20with%20some%20of%20the%20adjustments%20described%20in%20Millard%20et%20al.%20(2013).%20Hereafter%2C%20Thelen2003Muscle%20or%20T03.%0A%20%20%20%202.%20%5BMcLean%2C%20Su%2C%20van%20den%20Bogert%20(2003)%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F14986412).%20Hereafter%2C%20McLean2003Muscle%20or%20M03.%0A%0A%20%20%20%20**Guiding%20questions%201.**%0A%0A%20%20%20%201.%20Which%20element%20produces%20active%20tensile%20force%3F%0A%20%20%20%202.%20Which%20element%20accounts%20for%20passive%20force%20when%20the%20muscle%20is%20stretched%3F%0A%20%20%20%203.%20Why%20does%20a%20tendon%20belong%20in%20series%20with%20the%20muscle%3F%0A%20%20%20%204.%20If%20tendon%20is%20elastic%2C%20why%20might%20muscle%20fiber%20length%20change%20even%20when%20the%20whole%20muscle-tendon%20length%20is%20fixed%3F%0A%0A%20%20%20%20First%2C%20let's%20import%20the%20necessary%20Python%20libraries%20and%20customize%20the%20environment%3A%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%0A%20%20%20%20%23%20'%25matplotlib%20notebook'%20command%20supported%20automatically%20in%20marimo%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20matplotlib%0A%0A%20%20%20%20matplotlib.rcParams%5B%22lines.linewidth%22%5D%20%3D%202%0A%20%20%20%20matplotlib.rcParams%5B%22font.size%22%5D%20%3D%2012%0A%20%20%20%20matplotlib.rcParams%5B%22lines.markersize%22%5D%20%3D%204%0A%20%20%20%20matplotlib.rc(%22axes%22%2C%20grid%3DTrue%2C%20labelsize%3D12%2C%20titlesize%3D13%2C%20ymargin%3D0.01)%0A%20%20%20%20matplotlib.rc(%22legend%22%2C%20numpoints%3D1%2C%20fontsize%3D10)%0A%20%20%20%20return%20np%2C%20plt%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%20Force-length%20relationship%0A%0A%20%20%20%20In%20a%20Hill-type%20model%2C%20the%20force%20a%20muscle%20can%20generate%20depends%20on%20its%20length%20due%20to%20two%20factors%3A%0A%0A%20%20%20%201.%20The%20active%20force%20of%20the%20contractile%20element%20(CE)%2C%20which%20in%20turn%20depends%20on%20the%20spatial%20superposition%20of%20the%20actin%20and%20myosin%20molecules%20to%20form%20cross-bridges%20at%20the%20sarcomere.%20A%20maximum%20number%20of%20cross-bridges%20will%20be%20formed%20at%20an%20optimal%20fiber%20length%2C%20generating%20a%20maximum%20force.%20When%20a%20fiber%20is%20too%20stretched%20or%20too%20shortened%2C%20fewer%20cross-bridges%20will%20be%20formed%2C%20decreasing%20the%20force%20generated.%0A%20%20%20%202.%20The%20passive%20and%20parallel%20elastic%20element%20(PE)%2C%20which%20behaves%20as%20a%20nonlinear%20spring%20where%20no%20force%20is%20generated%20below%20a%20certain%20length%20(the%20slack%20length)%20and%20force%20increases%20with%20the%20muscle%20elongation.%0A%0A%20%20%20%20**Before%20running%20the%20force-length%20plots**%2C%20predict%20where%20total%20force%20can%20exceed%20the%20maximum%20active%20isometric%20force.%20Is%20that%20because%20the%20active%20curve%20is%20larger%2C%20because%20the%20passive%20curve%20has%20turned%20on%2C%20or%20both%3F%0A%0A%20%20%20%20**Chapter%202%20bridge%20problem.**%20In%20a%20separate%20scratch%20cell%20or%20notebook%2C%20design%20a%20normalized%20active%20force-length%20function%20inspired%20by%20Yamaguchi's%20qualitative%20description%3A%20near%20zero%20at%20very%20short%20and%20very%20long%20fiber%20lengths%2C%20maximal%20near%20optimal%20fiber%20length%2C%20and%20scaled%20by%20activation.%20Do%20not%20replace%20the%20Thelen%20or%20McLean%20curves%20here%3B%20use%20them%20as%20comparison%20targets.%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%20Force-length%20relationship%20of%20the%20contractile%20element%0A%0A%20%20%20%20Thelen2003Muscle%20represented%20the%20normalized%20force-length%20relationship%20of%20the%20contractile%20element%20by%20a%20Gaussian%20function%3A%0A%0A%20%20%20%20%24%24%20%5Cbar%7Bf%7D_%7Bl%2CCE%7D%20%3D%20exp%5Cleft%5B-(%5Cbar%7BL%7D_M-1)%5E2%2F%5Cgamma%5Cright%5D%20%24%24%0A%0A%20%20%20%20where%20%24%5Cgamma%24%20is%20a%20shape%20factor%20and%20%24%5Cbar%7BL%7D_M%24%20is%20the%20muscle%20fiber%20length%20normalized%20by%20the%20optimal%20muscle%20fiber%20length%20at%20which%20maximal%20force%20can%20be%20produced%2C%20%24L_%7BMopt%7D%24%3A%0A%0A%20%20%20%20%24%24%5Cbar%7BL%7D_M%3D%5Cfrac%7BL_M%7D%7BL_%7BMopt%7D%7D%24%24%0A%0A%20%20%20%20Thelen2003Muscle%20adopted%20%24%5Cgamma%3D0.45%24.%20The%20actual%20force%20produced%20is%20obtained%20multiplying%20%24%5Cbar%7Bf%7D_%7Bl%2CCE%7D%24%20by%20the%20maximum%20isometric%20muscle%20force%2C%20%24F_%7BM0%7D%24.%20Thelen2003Muscle%20assumed%20that%20the%20maximum%20isometric%20muscle%20forces%20for%20old%20adults%20were%2030%25%20lower%20than%20those%20used%20for%20young%20adults.%0A%0A%20%20%20%20McLean2003Muscle%20represented%20the%20force-length%20relationship%20of%20the%20contractile%20element%20(not%20normalized)%20as%20a%20function%20of%20muscle%20length%20(not%20normalized)%20by%20a%20quadratic%20function%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20f_%7Bl%2CCE%7D%20%3D%20max%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%20F_%7BMmin%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20F_%7BM0%7D%5Cleft%5B1%20-%20%5Cleft(%5Cfrac%7BL_M-L_%7BMopt%7D%7D%7BWL_%7BMopt%7D%7D%5Cright)%5E2%5Cright%5D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24W%24%20is%20a%20dimensionless%20parameter%20describing%20the%20width%20of%20the%20force-length%20relationship.%20A%20minimum%20force%20level%20%24F_%7BMmin%7D%24%20is%20employed%20for%20numerical%20stability.%0A%20%20%20%20McLean2003Muscle%20adopted%20%24W%3D1%24%20and%20%24F_%7BMmin%7D%3D10%20N%24.%0A%0A%20%20%20%20The%20corresponding%20Python%20functions%20are%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20flce_T03(lm%3D1%2C%20gammal%3D0.45)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Thelen%20(2003)%20force%20of%20the%20contractile%20element%20as%20function%20of%20muscle%20length.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20lm%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20muscle%20fiber%20length%0A%20%20%20%20%20%20%20%20gammal%20%20%3A%20float%2C%20optional%20(default%3D0.45)%0A%20%20%20%20%20%20%20%20%20%20%20%20shape%20factor%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fl%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20force%20of%20the%20muscle%20contractile%20element%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20fl%20%3D%20np.exp(-((lm%20-%201)%20**%202)%20%2F%20gammal)%0A%0A%20%20%20%20%20%20%20%20return%20fl%0A%0A%20%20%20%20return%20(flce_T03%2C)%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20flce_M03(lm%3D1%2C%20lmopt%3D1%2C%20fm0%3D1%2C%20fmmin%3D0.001%2C%20wl%3D1)%3A%0A%20%20%20%20%20%20%20%20%22%22%22McLean%20(2003)%20force%20of%20the%20contractile%20element%20as%20function%20of%20muscle%20length.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20lm%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20muscle%20(fiber)%20length%0A%20%20%20%20%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20optimal%20muscle%20fiber%20length%0A%20%20%20%20%20%20%20%20fm0%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20maximum%20isometric%20muscle%20force%0A%20%20%20%20%20%20%20%20fmmin%20%20%3A%20float%2C%20optional%20(default%3D0.001)%0A%20%20%20%20%20%20%20%20%20%20%20%20minimum%20muscle%20force%0A%20%20%20%20%20%20%20%20wl%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20shape%20factor%20of%20the%20contractile%20element%20force-length%20curve%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fl%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20force%20of%20the%20muscle%20contractile%20element%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20fl%20%3D%20np.max(%5Bfmmin%2C%20fm0%20*%20(1%20-%20((lm%20-%20lmopt)%20%2F%20(wl%20*%20lmopt))%20**%202)%5D)%0A%0A%20%20%20%20%20%20%20%20return%20fl%0A%0A%20%20%20%20return%20(flce_M03%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%20And%20plots%20of%20these%20functions%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(flce_M03%2C%20flce_T03%2C%20np)%3A%0A%20%20%20%20lm%20%3D%20np.arange(0%2C%202.02%2C%200.02)%0A%20%20%20%20fce_T03%20%3D%20np.zeros(lm.size)%0A%20%20%20%20fce_M03%20%3D%20np.zeros(lm.size)%0A%20%20%20%20for%20_i%20in%20range(len(lm))%3A%0A%20%20%20%20%20%20%20%20fce_T03%5B_i%5D%20%3D%20flce_T03(lm%5B_i%5D)%0A%20%20%20%20%20%20%20%20fce_M03%5B_i%5D%20%3D%20flce_M03(lm%5B_i%5D)%0A%20%20%20%20return%20fce_M03%2C%20fce_T03%2C%20lm%0A%0A%0A%40app.cell%0Adef%20_(fce_M03%2C%20fce_T03%2C%20lm%2C%20plt)%3A%0A%20%20%20%20plt.figure(figsize%3D(7%2C%204))%0A%20%20%20%20plt.plot(lm%2C%20fce_T03%2C%20%22b%22%2C%20label%3D%22T03%22)%0A%20%20%20%20plt.plot(lm%2C%20fce_M03%2C%20%22g%22%2C%20label%3D%22M03%22)%0A%20%20%20%20plt.xlabel(%22Normalized%20length%22)%0A%20%20%20%20plt.ylabel(%22Normalized%20force%22)%0A%20%20%20%20plt.legend(loc%3D%22best%22)%0A%20%20%20%20plt.suptitle(%22Force-length%20relationship%20of%20the%20contractile%20element%22)%0A%20%20%20%20plt.tight_layout()%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%20Similar%20results%20when%20the%20same%20parameters%20are%20used.%0A%0A%20%20%20%20**Checkpoint.**%20The%20two%20models%20have%20similar%20peaks%20but%20not%20identical%20shapes.%20Which%20part%20of%20the%20curve%20would%20matter%20most%20for%20a%20simulation%20with%20large%20joint%20excursions%3A%20the%20width%20around%20the%20optimum%2C%20the%20force%20at%20very%20short%20lengths%2C%20or%20the%20force%20at%20stretched%20lengths%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**Exercise%201%20%E2%80%94%20Normalize%20active%20force.**%20A%20muscle%20has%20%24F_0%3D1000%24%20N%2C%20activation%200.4%2C%20active%20length%20multiplier%200.8%20and%20velocity%20multiplier%201.%20What%20is%20active%20force%20before%20pennation%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%201%0A%0A%20%20%20%20%24F_%7Bactive%7D%3DaF_0f_lf_v%3D0.4(1000)(0.8)(1)%3D320%24%20N.%20Activation%20scales%20the%20active%20branch.%20Passive%20force%2C%20if%20present%2C%20is%20added%20separately%20rather%20than%20multiplied%20by%20activation.%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%20Force-length%20relationship%20of%20the%20parallel%20element%0A%0A%20%20%20%20Thelen2003Muscle%20represents%20the%20normalized%20force%20of%20the%20parallel%20(passive)%20element%20of%20the%20muscle%20as%20a%20function%20of%20muscle%20length%20(normalized%20by%20the%20optimal%20muscle%20fiber%20length)%20by%20an%20exponential%20function%3A%0A%0A%20%20%20%20%24%24%20%5Cbar%7BF%7D_%7BPE%7D(%5Cbar%7BL%7D_M)%20%3D%20%5Cfrac%7Bexp%5Cleft%5Bk_%7BPE%7D(%5Cbar%7BL%7D_M-1)%2F%5Cepsilon_%7BM0%7D%5Cright%5D-1%7D%7Bexp(k_%7BPE%7D)-1%7D%20%24%24%0A%0A%20%20%20%20where%20%24k_%7BPE%7D%24%20is%20an%20exponential%20shape%20factor%20and%20%24%5Cepsilon_%7BM0%7D%24%20is%20the%20passive%20muscle%20strain%20due%20to%20maximum%20isometric%20force%3A%0A%0A%20%20%20%20%24%24%5Cepsilon_%7BM0%7D%3D%5Cfrac%7BL_M(F_%7BM0%7D)-L_%7BMslack%7D%7D%7BL_%7BMslack%7D%7D%24%24%0A%0A%20%20%20%20where%20%24L_%7BMslack%7D%24%20is%20the%20muscle%20slack%20length.%20Thelen2003Muscle%20adopted%20%24L_%7BMslack%7D%20%3D%20L_%7BMopt%7D%24.%0A%20%20%20%20Thelen2003Muscle%20adopted%20%24k_%7BPE%7D%3D5%24%20and%20%24%5Cepsilon_%7BM0%7D%3D0.6%24%20for%20young%20adults%20(%24%5Cepsilon_%7BM0%7D%3D0.5%24%20for%20old%20adults).%20The%20actual%20force%20produced%20is%20obtained%20multiplying%20%24%5Cbar%7BF%7D_%7BPE%7D%24%20by%20the%20maximum%20isometric%20muscle%20force%2C%20%24F_%7BM0%7D%24.%0A%0A%20%20%20%20McLean2003Muscle%20represents%20the%20force%20of%20the%20parallel%20(passive)%20element%20of%20the%20muscle%20(not%20normalized)%20as%20a%20function%20of%20muscle%20length%20(not%20normalized)%20by%20a%20quadratic%20function%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20F_%7BPE%7D(L_M)%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%200%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20L_M%20%5Cleq%20L_%7BMslack%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20k_%7BPE%7D(L_M%20-%20L_%7BMslack%7D)%5E2%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20L_M%20%3E%20L_%7BMslack%7D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24k_%7BPE%7D%24%20is%20a%20stiffness%20parameter%20of%20the%20parallel%20element%20such%20that%20the%20passive%20muscle%20force%20is%20equal%20to%20the%20normalized%20maximum%20isometric%20force%20of%20the%20muscle%20when%20the%20CE%20is%20stretched%20to%20its%20maximal%20length%20for%20active%20force%20production%3A%0A%0A%20%20%20%20%24%24%20k_%7BPE%7D%20%3D%20%5Cfrac%7BF_%7BM0%7D%7D%7B(WL_%7BMopt%7D)%5E2%7D%20%24%24%0A%0A%20%20%20%20McLean2003Muscle%20adopted%20%24L_%7BMslack%7D%20%3D%20L_%7BMopt%7D%24.%0A%0A%20%20%20%20**Passive-force%20prompt.**%20Passive%20muscle%20force%20is%20independent%20of%20activation.%20If%20activation%20were%20zero%2C%20which%20plotted%20force%20components%20would%20still%20be%20able%20to%20transmit%20tension%3F%0A%0A%20%20%20%20The%20corresponding%20Python%20functions%20are%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20fpelm_T03(lm%3D1%2C%20kpe%3D5%2C%20epsm0%3D0.6)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Thelen%20(2003)%20force%20of%20the%20muscle%20parallel%20element%20as%20function%20of%20muscle%20length.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20lm%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20muscle%20fiber%20length%0A%20%20%20%20%20%20%20%20kpe%20%20%3A%20float%2C%20optional%20(default%3D5)%0A%20%20%20%20%20%20%20%20%20%20%20%20exponential%20shape%20factor%0A%20%20%20%20%20%20%20%20epsm0%20%20%3A%20float%2C%20optional%20(default%3D0.6)%0A%20%20%20%20%20%20%20%20%20%20%20%20passive%20muscle%20strain%20due%20to%20maximum%20isometric%20force%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fpe%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20force%20of%20the%20muscle%20parallel%20(passive)%20element%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20if%20lm%20%3C%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fpe%20%3D%200%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fpe%20%3D%20(np.exp(kpe%20*%20(lm%20-%201)%20%2F%20epsm0)%20-%201)%20%2F%20(np.exp(kpe)%20-%201)%0A%0A%20%20%20%20%20%20%20%20return%20fpe%0A%0A%20%20%20%20return%20(fpelm_T03%2C)%0A%0A%0A%40app.function%0Adef%20fpelm_M03(lm%3D1%2C%20lmopt%3D1%2C%20fm0%3D1%2C%20lmslack%3D1%2C%20wp%3D0.6)%3A%0A%20%20%20%20%22%22%22McLean%20(2003)%20force%20of%20the%20muscle%20parallel%20element%20as%20function%20of%20muscle%20length.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20lm%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20muscle%20fiber%20length%0A%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20optimal%20muscle%20(fiber)%20length%0A%20%20%20%20fm0%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20isometric%20muscle%20force%0A%20%20%20%20lmslack%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20muscle%20slack%20length%0A%20%20%20%20wp%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20shape%20factor%20of%20the%20parallel%20element%20force-length%20curve%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20fpe%20%20%3A%20float%0A%20%20%20%20%20%20%20%20force%20of%20the%20muscle%20parallel%20(passive)%20element%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20kpe%20%3D%20fm0%20%2F%20(wp%20*%20lmopt)%20**%202%0A%20%20%20%20if%20lm%20%3C%3D%20lmslack%3A%0A%20%20%20%20%20%20%20%20fpe%20%3D%200%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20fpe%20%3D%20kpe%20*%20(lm%20-%20lmslack)%20**%202%0A%0A%20%20%20%20return%20fpe%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%20And%20plots%20of%20these%20functions%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(fpelm_T03%2C%20np)%3A%0A%20%20%20%20lm_1%20%3D%20np.arange(0%2C%202.02%2C%200.02)%0A%20%20%20%20fpe_T03%20%3D%20np.zeros(lm_1.size)%0A%20%20%20%20fpe_M03%20%3D%20np.zeros(lm_1.size)%0A%20%20%20%20for%20_i%20in%20range(len(lm_1))%3A%0A%20%20%20%20%20%20%20%20fpe_T03%5B_i%5D%20%3D%20fpelm_T03(lm_1%5B_i%5D)%0A%20%20%20%20%20%20%20%20fpe_M03%5B_i%5D%20%3D%20fpelm_M03(lm_1%5B_i%5D)%0A%20%20%20%20return%20fpe_M03%2C%20fpe_T03%2C%20lm_1%0A%0A%0A%40app.cell%0Adef%20_(fce_M03%2C%20fce_T03%2C%20fpe_M03%2C%20fpe_T03%2C%20lm_1%2C%20plt)%3A%0A%20%20%20%20_fig%2C%20(_ax1%2C%20_ax2)%20%3D%20plt.subplots(%0A%20%20%20%20%20%20%20%20nrows%3D1%2C%20ncols%3D2%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20figsize%3D(8%2C%204)%0A%20%20%20%20)%0A%20%20%20%20_ax1.plot(lm_1%5B%3A86%5D%2C%20fce_T03%5B%3A86%5D%2C%20%22b%22%2C%20label%3D%22Active%22)%0A%20%20%20%20_ax1.plot(lm_1%5B%3A86%5D%2C%20fpe_T03%5B%3A86%5D%2C%20%22r%22%2C%20label%3D%22Passive%22)%0A%20%20%20%20_ax1.plot(lm_1%5B%3A86%5D%2C%20fce_T03%5B%3A86%5D%20%2B%20fpe_T03%5B%3A86%5D%2C%20%22g%22%2C%20label%3D%22Total%22)%0A%20%20%20%20_ax1.text(0.1%2C%200.8%2C%20%22T03%22%2C%20transform%3D_ax1.transAxes)%0A%20%20%20%20_ax1.set_xlim(%5B0%2C%201.7%5D)%0A%20%20%20%20_ax1.set_xlabel(%22Normalized%20length%22)%0A%20%20%20%20_ax1.set_ylabel(%22Normalized%20force%22)%0A%20%20%20%20_ax2.plot(lm_1%5B%3A86%5D%2C%20fce_M03%5B%3A86%5D%2C%20%22b%22%2C%20label%3D%22Active%22)%0A%20%20%20%20_ax2.plot(lm_1%5B%3A86%5D%2C%20fpe_M03%5B%3A86%5D%2C%20%22r%22%2C%20label%3D%22Passive%22)%0A%20%20%20%20_ax2.plot(lm_1%5B%3A86%5D%2C%20fce_M03%5B%3A86%5D%20%2B%20fpe_M03%5B%3A86%5D%2C%20%22g%22%2C%20label%3D%22Total%22)%0A%20%20%20%20_ax2.text(0.1%2C%200.8%2C%20%22M03%22%2C%20transform%3D_ax2.transAxes)%0A%20%20%20%20_ax2.set_xlim(%5B0%2C%201.7%5D)%0A%20%20%20%20_ax2.set_xlabel(%22Normalized%20length%22)%0A%20%20%20%20_ax2.legend(loc%3D%22best%22)%0A%20%20%20%20plt.suptitle(%22Muscle%20force-length%20relationship%22)%0A%20%20%20%20plt.tight_layout()%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%20The%20results%20are%20different%20at%20the%20maximum%20stretching%20because%20Thelen2003Muscle%20and%20McLean2003Muscle%20model%20differently%20the%20passive%20component.%0A%20%20%20%20These%20results%20were%20simulated%20for%20a%20maximum%20muscle%20activation%20(an%20activation%20level%2C%20%24a%24%2C%20of%201%2C%20where%200%20is%20no%20activation).%20The%20effect%20of%20different%20activation%20levels%20on%20the%20total%20muscle%20force%20(but%20only%20the%20active%20force%20is%20affected)%20is%20shown%20in%20the%20next%20figure%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(flce_T03%2C%20np)%3A%0A%20%20%20%20lm_2%20%3D%20np.arange(0%2C%202.02%2C%200.02)%0A%20%20%20%20fce_T03_als%20%3D%20np.zeros((lm_2.size%2C%205))%0A%20%20%20%20als%20%3D%20%5B0%2C%200.25%2C%200.5%2C%200.75%2C%201.0%5D%0A%20%20%20%20for%20_j%2C%20_al%20in%20enumerate(als)%3A%0A%20%20%20%20%20%20%20%20for%20_i%20in%20range(len(lm_2))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fce_T03_als%5B_i%2C%20_j%5D%20%3D%20flce_T03(lm_2%5B_i%5D)%20*%20_al%0A%20%20%20%20return%20als%2C%20fce_T03_als%2C%20lm_2%0A%0A%0A%40app.cell%0Adef%20_(als%2C%20fce_T03_als%2C%20fpe_T03%2C%20lm_2%2C%20plt)%3A%0A%20%20%20%20_fig%2C%20ax%20%3D%20plt.subplots(nrows%3D1%2C%20ncols%3D1%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20figsize%3D(7%2C%204))%0A%20%20%20%20for%20_j%2C%20_al%20in%20enumerate(als)%3A%0A%20%20%20%20%20%20%20%20ax.plot(lm_2%5B%3A86%5D%2C%20fce_T03_als%5B%3A86%2C%20_j%5D%20%2B%20fpe_T03%5B%3A86%5D%2C%20label%3D%22%25.2f%22%20%25%20_al)%0A%20%20%20%20ax.text(0.1%2C%200.8%2C%20%22T03%22%2C%20transform%3Dax.transAxes)%0A%20%20%20%20ax.set_xlim(%5B0%2C%201.7%5D)%0A%20%20%20%20ax.set_xlabel(%22Normalized%20length%22)%0A%20%20%20%20ax.set_ylabel(%22Normalized%20force%22)%0A%20%20%20%20ax.legend(loc%3D%22upper%20center%22%2C%20title%3D%22Activation%20level%22)%0A%20%20%20%20ax.set_title(%22Muscle%20force-length%20relationship%22)%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%23%23%23%23%20Force-length%20relationship%20of%20the%20series%20element%20(tendon)%0A%0A%20%20%20%20Thelen2003Muscle%20represented%20the%20tendon%20force%20of%20the%20series%20element%20as%20a%20function%20of%20the%20normalized%20tendon%20length%20(in%20fact%2C%20tendon%20strain)%20by%20an%20exponential%20function%20during%20an%20initial%20nonlinear%20toe%20region%20and%20by%20a%20linear%20function%20thereafter%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cbar%7BF%7D_%7BSE%7D(%5Cbar%7BL%7D_T)%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%20%5Cfrac%7B%5Cbar%7BF%7D_%7BTtoe%7D%7D%7Bexp(k_%7BTtoe%7D)-1%7D%5Cleft%5Bexp(k_%7BTtoe%7D%5Cepsilon_T%2F%5Cepsilon_%7BTtoe%7D)-1%5Cright%5D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20%5Cepsilon_T%20%5Cleq%20%5Cepsilon_%7BTtoe%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20k_%7BTlin%7D(%5Cepsilon_T%20-%20%5Cepsilon_%7BTtoe%7D)%20%2B%20%5Cbar%7BF%7D_%7BTtoe%7D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20%5Cepsilon_T%20%3E%20%5Cepsilon_%7BTtoe%7D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24%5Cepsilon_%7BT%7D%24%20is%20the%20tendon%20strain%3A%0A%0A%20%20%20%20%24%24%5Cepsilon_%7BT%7D%20%3D%20%5Cfrac%7BL_T-L_%7BTslack%7D%7D%7BL_%7BTslack%7D%7D%24%24%0A%0A%20%20%20%20%24L_%7BTslack%7D%24%20is%20the%20tendon%20slack%20length%2C%20%24%5Cepsilon_%7BTtoe%7D%24%20is%20the%20tendon%20strain%20above%20which%20the%20tendon%20exhibits%20linear%20behavior%2C%20%24k_%7BTtoe%7D%24%20is%20an%20exponential%20shape%20factor%2C%20and%20%24k_%7BTlin%7D%24%20is%20a%20linear%20scale%20factor.%20The%20parameters%20are%20chosen%20such%20that%20the%20tendon%20elongation%20at%20the%20normalized%20maximal%20isometric%20force%20of%20the%20muscle%20is%204%25%20of%20the%20tendon%20length%20(%24%5Cepsilon_%7BT0%7D%3D0.04%24).%0A%20%20%20%20Thelen2003Muscle%20adopted%20%24k_%7BTtoe%7D%3D3%24%20and%20the%20transition%20from%20nonlinear%20to%20linear%20behavior%20occurs%20for%20normalized%20tendon%20forces%20greater%20than%20%24%5Cbar%7BF%7D_%7BTtoe%7D%3D0.33%24.%20For%20continuity%20of%20slopes%20at%20the%20transition%2C%20%24%5Cepsilon_%7BTtoe%7D%3D0.609%5Cepsilon_%7BT0%7D%24%20and%20%24k_%7BTlin%7D%3D1.712%2F%5Cepsilon_%7BT0%7D%24.%20The%20actual%20force%20produced%20is%20obtained%20multiplying%20%24%5Cbar%7BF%7D_%7BSE%7D%24%20by%20the%20maximum%20isometric%20muscle%20force%2C%20%24F_%7BM0%7D%24.%0A%0A%20%20%20%20McLean2003Muscle%20represented%20the%20tendon%20force%20(not%20normalized)%20of%20the%20series%20element%20as%20a%20function%20of%20the%20tendon%20length%20(not%20normalized)%20by%20the%20same%20quadratic%20function%20used%20for%20the%20force%20of%20the%20muscle%20passive%20element%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20F_%7BSE%7D(L_T)%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%200%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20L_T%20%5Cleq%20L_%7BTslack%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20k_T(L_T%20-%20L_%7BTslack%7D)%5E2%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20L_T%20%3E%20L_%7BTslack%7D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24k_T%24%20is%20the%20tendon%20stiffness.%20The%20stiffness%20parameter%20%24k_T%24%20is%20chosen%20such%20that%20the%20tendon%20elongation%20is%204%25%20at%20the%20maximum%20isometric%20force%2C%20%24k_T%3D(1%2F%5Cepsilon_%7BT0%7D)%5E2%3D625%24%20for%20%24F_%7BM0%7D%3D1%24.%0A%0A%20%20%20%20**Tendon%20prompt.**%20Chapter%202%20emphasizes%20that%20tendon%20elasticity%20can%20change%20the%20relationship%20between%20muscle%20fiber%20length%20and%20whole%20muscle-tendon%20length.%20Before%20plotting%20the%20tendon%20curves%2C%20predict%20which%20model%20is%20initially%20more%20compliant%20and%20which%20becomes%20stiffer%20at%20larger%20stretch.%0A%0A%20%20%20%20**Chapter%202%20bridge%20problem.**%20Implement%20a%20tendon%20force-strain%20curve%20with%20a%20toe%20region%20followed%20by%20a%20linear%20region%20in%20a%20separate%20scratch%20cell%20or%20notebook.%20Then%20formulate%2C%20but%20do%20not%20solve%20here%2C%20the%20fixed-length%20muscle-tendon%20equilibrium%20problem%20where%20tendon%20force%20must%20equal%20muscle%20force.%0A%0A%20%20%20%20The%20corresponding%20Python%20functions%20are%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20fselt_T03(lt%3D1%2C%20ltslack%3D1%2C%20epst0%3D0.04%2C%20kttoe%3D3)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Thelen%20(2003)%20force-length%20relationship%20of%20tendon%20as%20function%20of%20tendon%20length.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20lt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20tendon%20length%0A%20%20%20%20%20%20%20%20ltslack%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20tendon%20slack%20length%0A%20%20%20%20%20%20%20%20epst0%20%20%3A%20float%2C%20optional%20(default%3D0.04)%0A%20%20%20%20%20%20%20%20%20%20%20%20tendon%20strain%20at%20the%20maximal%20isometric%20muscle%20force%0A%20%20%20%20%20%20%20%20kttoe%20%20%3A%20float%2C%20optional%20(default%3D3)%0A%20%20%20%20%20%20%20%20%20%20%20%20linear%20scale%20factor%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fse%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20force%20of%20the%20tendon%20series%20element%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20epst%20%3D%20(lt%20-%20ltslack)%20%2F%20ltslack%0A%20%20%20%20%20%20%20%20fttoe%20%3D%200.33%0A%20%20%20%20%20%20%20%20%23%20values%20from%20OpenSim%20Thelen2003Muscle%0A%20%20%20%20%20%20%20%20epsttoe%20%3D%200.99%20*%20epst0%20*%20np.e**3%20%2F%20(1.66%20*%20np.e**3%20-%200.67)%0A%20%20%20%20%20%20%20%20ktlin%20%3D%200.67%20%2F%20(epst0%20-%20epsttoe)%0A%20%20%20%20%20%20%20%20%23%0A%20%20%20%20%20%20%20%20if%20epst%20%3C%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fse%20%3D%200%0A%20%20%20%20%20%20%20%20elif%20epst%20%3C%3D%20epsttoe%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fse%20%3D%20fttoe%20%2F%20(np.exp(kttoe)%20-%201)%20*%20(np.exp(kttoe%20*%20epst%20%2F%20epsttoe)%20-%201)%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fse%20%3D%20ktlin%20*%20(epst%20-%20epsttoe)%20%2B%20fttoe%0A%0A%20%20%20%20%20%20%20%20return%20fse%0A%0A%20%20%20%20return%20(fselt_T03%2C)%0A%0A%0A%40app.function%0Adef%20fselt_M03(lt%2C%20ltslack%3D1%2C%20fm0%3D1%2C%20epst0%3D0.04)%3A%0A%20%20%20%20%22%22%22McLean%20(2003)%20force-length%20relationship%20of%20tendon%20as%20function%20of%20tendon%20length.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20lt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20tendon%20length%0A%20%20%20%20ltslack%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20tendon%20slack%20length%0A%20%20%20%20fm0%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20isometric%20muscle%20force%0A%20%20%20%20epst0%20%20%3A%20float%2C%20optional%20(default%3D0.04)%0A%20%20%20%20%20%20%20%20tendon%20strain%20at%20the%20maximal%20isometric%20muscle%20force%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20fse%20%20%3A%20float%0A%20%20%20%20%20%20%20%20force%20of%20the%20tendon%20series%20element%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20kt%20%3D%20fm0%20%2F%20epst0**2%0A%20%20%20%20if%20lt%20%3C%3D%20ltslack%3A%0A%20%20%20%20%20%20%20%20fse%20%3D%200%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20fse%20%3D%20kt%20*%20(lt%20-%20ltslack)%20**%202%0A%0A%20%20%20%20return%20fse%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%20And%20plots%20of%20these%20functions%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(fselt_T03%2C%20np)%3A%0A%20%20%20%20lt%20%3D%20np.arange(1%2C%201.051%2C%200.001)%0A%20%20%20%20fse_T03%20%3D%20np.zeros(lt.size)%0A%20%20%20%20fse_M03%20%3D%20np.zeros(lt.size)%0A%20%20%20%20for%20_i%20in%20range(len(lt))%3A%0A%20%20%20%20%20%20%20%20fse_T03%5B_i%5D%20%3D%20fselt_T03(lt%5B_i%5D)%0A%20%20%20%20%20%20%20%20fse_M03%5B_i%5D%20%3D%20fselt_M03(lt%5B_i%5D)%0A%20%20%20%20return%20fse_M03%2C%20fse_T03%2C%20lt%0A%0A%0A%40app.cell%0Adef%20_(fse_M03%2C%20fse_T03%2C%20lt%2C%20plt)%3A%0A%20%20%20%20plt.figure(figsize%3D(7%2C%204))%0A%20%20%20%20plt.plot(lt%20-%201%2C%20fse_T03%2C%20%22b%22%2C%20label%3D%22T03%22)%0A%20%20%20%20plt.plot(lt%20-%201%2C%20fse_M03%2C%20%22g%22%2C%20label%3D%22M03%22)%0A%20%20%20%20plt.plot(0.04%2C%201%2C%20%22ro%22%2C%20markersize%3D8)%0A%20%20%20%20plt.text(0.04%2C%200.7%2C%20r%22%24%5Cepsilon_%7BT0%7D%24%22%2C%20fontsize%3D22)%0A%20%20%20%20plt.xlabel(%22Tendon%20strain%22)%0A%20%20%20%20plt.ylabel(%22Normalized%20force%22)%0A%20%20%20%20plt.legend(loc%3D%22upper%20left%22)%0A%20%20%20%20plt.suptitle(%22Tendon%20force-length%20relationship%20(series%20element)%22)%0A%20%20%20%20plt.tight_layout()%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%20Similar%20results%20when%20the%20same%20parameters%20are%20used.%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%20%E2%80%94%20Balance%20a%20pennated%20fiber.**%20A%20fiber%20produces%20600%20N%20at%20a%20pennation%20angle%20of%2030%C2%B0.%20What%20tendon%20force%20follows%20from%20static%20force%20balance%2C%20ignoring%20tendon%20inertia%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%202%0A%0A%20%20%20%20%24F_T%3DF_M%5Ccos%5Calpha%3D600%5Ccos30%5E%5Ccirc%5Capprox519.6%24%20N.%20Fiber%20force%20and%20tendon%20force%20are%20equal%20only%20at%20zero%20pennation%20in%20this%20simple%20model.%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%20Force-velocity%20relationship%20of%20the%20contractile%20element%0A%0A%20%20%20%20The%20force-velocity%20relation%20of%20the%20contractile%20element%20for%20shortening%20(concentric%20activation)%20is%20based%20on%20the%20well%20known%20Hill's%20equation%20of%20a%20hyperbola%20describing%20that%20the%20product%20between%20force%20%24F%24%20and%20velocity%20%24V%24%20of%20the%20contractile%20element%20is%20constant%20(Winters%2C%201990%3B%20Winters%2C%201995)%3A%0A%0A%20%20%20%20%24%24%20(F%2Ba')(V%2Bb')%20%3D%20(F_%7B0%7D%2Ba')b'%20%24%24%0A%0A%20%20%20%20where%20%24a'%24%2C%20%24b'%24%2C%20and%20%24F_%7B0%7D%24%20are%20constants.%0A%0A%20%20%20%20We%20can%20rewrite%20the%20equation%20above%20with%20constants%20more%20meaningful%20to%20our%20modeling%3A%0A%0A%20%20%20%20%24%24%20(F_%7BM%7D%2BA_f%20F_%7BMlen%7D)(V_M%2BA_f%20V_%7BMmax%7D)%20%3D%20A_f%20F_%7BMlen%7DV_%7BMmax%7D(1%2BA_f)%20%24%24%0A%0A%20%20%20%20where%20%24F_%7BM%7D%24%20and%20%24V_M%24%20are%20the%20contractile%20element%20force%20and%20velocity%2C%20respectively%2C%20and%20the%20three%20constants%20are%3A%20%24V_%7BMmax%7D%24%2C%20the%20maximum%20unloaded%20velocity%20(when%20%24F_%7BM%7D%3D0%24)%2C%20%24F_%7BMlen%7D%24%2C%20the%20maximum%20isometric%20force%20(when%20%24V_M%3D0%24)%2C%20and%20%24A_f%24%2C%20a%20shape%20factor%20which%20specifies%20the%20concavity%20of%20the%20hyperbola.%0A%0A%20%20%20%20Based%20on%20the%20equation%20above%20for%20the%20shortening%20phase%20and%20in%20Winters%20(1990%2C%201995)%20for%20the%20lengthening%20phase%2C%20Thelen2003Muscle%20employed%20the%20following%20force-velocity%20equation%3A%0A%0A%20%20%20%20%24%24%20V_M%20%3D%20(0.25%2B0.75a)%5C%2CV_%7BMmax%7D%5Cfrac%7B%5Cbar%7BF%7D_M-a%5Cbar%7Bf%7D_%7Bl%2CCE%7D%7D%7Bb%7D%20%20%24%24%0A%0A%20%20%20%20where%0A%0A%20%20%20%20%24%24%0A%20%20%20%20b%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%20l%7D%0A%20%20%20%20%20%20%20%20a%5Cbar%7Bf%7D_%7Bl%2CCE%7D%20%2B%20%5Cbar%7BF%7D_M%2FA_f%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20%5Cbar%7BF%7D_M%20%5Cleq%20a%5Cbar%7Bf%7D_%7Bl%2CCE%7D%20%26%20%5Ctext%7B(shortening)%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20%5Cfrac%7B(2%2B2%2FA_f)(a%5Cbar%7Bf%7D_%7Bl%2CCE%7D%5Cbar%7Bf%7D_%7BMlen%7D%20-%20%5Cbar%7BF%7D_M)%7D%7B%5Cbar%7Bf%7D_%7BMlen%7D-1%7D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20%5Cbar%7BF%7D_M%20%3E%20a%5Cbar%7Bf%7D_%7Bl%2CCE%7D%20%26%20%5Ctext%7B(lengthening)%7D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24a%24%20is%20the%20activation%20level%20and%20%24%5Cbar%7Bf%7D_%7BMlen%7D%24%20is%20a%20constant%20for%20the%20maximum%20force%20generated%20at%20the%20lengthening%20phase%20(normalized%20by%20the%20maximum%20isometric%20force).%0A%20%20%20%20Thelen2003Muscle%20adopted%20%24A_f%3D0.25%24%2C%20%24V_%7BMmax%7D%3D10L_%7BMopt%7D%2Fs%24%2C%20%24%5Cbar%7Bf%7D_%7BMlen%7D%3D1.4%24%20for%20young%20adults%20(%24V_%7BMmax%7D%3D8L_%7BMopt%7D%2Fs%24%20and%20%24%5Cbar%7Bf%7D_%7BMlen%7D%3D1.8%24%20for%20old%20adults).%20Note%20that%20the%20dependences%20of%20the%20force%20with%20the%20activation%20level%20and%20with%20the%20muscle%20length%20are%20already%20incorporated%20in%20the%20expression%20above.%0A%0A%20%20%20%20McLean2013Muscle%20employed%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cbar%7Bf%7D_%7Bv%2CCE%7D%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%20l%7D%0A%20%20%20%20%20%20%20%20%5Cfrac%7B%5Clambda(a)V_%7BMmax%7D%20%2B%20V_M%7D%7B%5Clambda(a)V_%7BMmax%7D%20-%20V_M%2FA_f%7D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20V_M%20%5Cleq%200%20%26%20%5Ctext%7B(shortening)%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20%5Cfrac%7B%5Cbar%7Bf%7D_%7BMlen%7DV_M%20%2B%20d_1%7D%7BV_M%20%2B%20d_1%7D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%200%20%3C%20V_M%20%5Cleq%20%5Cgamma%20d_1%20%26%20%5Ctext%7B(slow%20lengthening)%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20d_3%20%2B%20d_2V_M%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20V_M%20%3E%20%5Cgamma%20d_1%20%26%20%5Ctext%7B(fast%20lengthening)%7D%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%0A%0A%20%20%20%20%24%24%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%20%5Clambda(a)%20%3D%201-e%5E%7B-3.82a%7D%20%2B%20a%5C%3Ae%5E%7B-3.82%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20d_1%20%3D%20%5Cfrac%7BV_%7BMmax%7DA_f(%5Cbar%7Bf%7D_%7BMlen%7D-1)%7D%7BS(A_f%2B1)%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20d_2%20%3D%20%5Cfrac%7BS(A_f%2B1)%7D%7BV_%7BMmax%7DA_f(%5Cgamma%2B1)%5E2%7D%20%5C%5C%0A%20%20%20%20%20%20%20%20%5C%5C%0A%20%20%20%20%20%20%20%20d_3%20%3D%20%5Cfrac%7B(%5Cbar%7Bf%7D_%7BMlen%7D-1)%5Cgamma%5E2%7D%7B(%5Cgamma%2B1)%5E2%7D%20%2B%201%0A%20%20%20%20%5Cend%7Barray%7D%20%24%24%0A%0A%20%20%20%20where%20%24%5Clambda(a)%24%20is%20a%20scaling%20factor%20to%20account%20for%20the%20influence%20of%20the%20activation%20level%20%24a%24%20on%20the%20force-velocity%20relationship%2C%20%24%5Cbar%7Bf%7D_%7BMlen%7D%24%20is%20the%20asymptotic%20(maximum)%20value%20of%20%24%5Cbar%7BF%7D_M%24%2C%20%24S%24%20is%20a%20parameter%20to%20double%20the%20slope%20of%20the%20force-velocity%20curve%20at%20zero%20velocity%2C%20and%20%24%5Cgamma%24%20is%20a%20dimensionless%20parameter%20to%20ensure%20the%20transition%20between%20the%20hyperbolic%20and%20linear%20parts%20of%20the%20lengthening%20phase.%0A%20%20%20%20McLean2013Muscle%20adopted%20%24A_f%3D0.25%24%2C%20%24V_%7BMmax%7D%3D10L_%7BMopt%7D%2Fs%24%2C%20%24%5Cbar%7Bf%7D_%7BMlen%7D%3D1.5%24%2C%20%24S%3D2.0%24%2C%20and%20%24%5Cgamma%3D5.67%24.%0A%0A%20%20%20%20**Before%20running%20the%20force-velocity%20plot**%2C%20predict%20the%20asymmetry.%20Should%20a%20muscle%20that%20is%20shortening%20quickly%2C%20held%20isometric%2C%20or%20lengthening%20slowly%20produce%20the%20largest%20active%20force%3F%0A%0A%20%20%20%20**Chapter%202%20bridge%20problem.**%20Implement%20Hill's%20shortening%20force-velocity%20equation%20in%20a%20separate%20scratch%20cell%20or%20notebook.%20Then%20compute%20the%20shortening%20velocity%20at%20which%20positive%20muscle%20power%20is%20maximal.%20Treat%20the%20eccentric%20branch%20as%20a%20design%20problem%3A%20what%20finite%20force%20limit%20would%20you%20choose%2C%20and%20why%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%20Let's%20write%20these%20expressions%20as%20Python%20code%20and%20visualize%20them%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20vmfce_T03(fm%2C%20flce%3D1%2C%20lmopt%3D1%2C%20a%3D1%2C%20vmmax%3D1%2C%20fmlen%3D1.4%2C%20af%3D0.25)%3A%0A%20%20%20%20%22%22%22Thelen%20(2003)%20velocity%20of%20the%20force-velocity%20relationship%20as%20function%20of%20CE%20force.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20fm%20%20%3A%20float%0A%20%20%20%20%20%20%20%20normalized%20muscle%20force%0A%20%20%20%20flce%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20normalized%20muscle%20force%20due%20to%20the%20force-length%20relationship%0A%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20optimal%20muscle%20fiber%20length%0A%20%20%20%20a%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20muscle%20activation%20level%0A%20%20%20%20vmmax%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20muscle%20velocity%20for%20concentric%20activation%0A%20%20%20%20fmlen%20%20%3A%20float%2C%20optional%20(default%3D1.4)%0A%20%20%20%20%20%20%20%20normalized%20maximum%20force%20generated%20at%20the%20lengthening%20phase%0A%20%20%20%20af%20%20%3A%20float%2C%20optional%20(default%3D0.25)%0A%20%20%20%20%20%20%20%20shape%20factor%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20vm%20%20%3A%20float%0A%20%20%20%20%20%20%20%20velocity%20of%20the%20muscle%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20vmmax%20%3D%20vmmax%20*%20lmopt%0A%20%20%20%20if%20fm%20%3C%3D%20a%20*%20flce%3A%20%20%23%20isometric%20and%20concentric%20activation%0A%20%20%20%20%20%20%20%20b%20%3D%20a%20*%20flce%20%2B%20fm%20%2F%20af%0A%20%20%20%20else%3A%20%20%23%20eccentric%20activation%0A%20%20%20%20%20%20%20%20b%20%3D%20(2%20%2B%202%20%2F%20af)%20*%20(a%20*%20flce%20*%20fmlen%20-%20fm)%20%2F%20(fmlen%20-%201)%0A%20%20%20%20vm%20%3D%20(0.25%20%2B%200.75%20*%20a)%20*%20vmmax%20*%20(fm%20-%20a%20*%20flce)%20%2F%20b%0A%0A%20%20%20%20return%20vm%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%20Let's%20find%20an%20expression%20for%20contractile%20element%20force%20as%20function%20of%20muscle%20velocity%20given%20the%20equation%20above%2C%20i.e.%20we%20want%20to%20invert%20the%20equation.%20For%20that%2C%20let's%20use%20%5BSympy%5D(http%3A%2F%2Fwww.sympy.org%2F)%3A%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%20def%20fvce_T03_symb()%3A%0A%20%20%20%20%20%20%20%20%23%20Thelen%20(2003)%20velocity%20of%20the%20force-velocity%20relationship%20as%20function%20of%20CE%20force%0A%0A%20%20%20%20%20%20%20%20from%20sympy%20import%20symbols%2C%20solve%2C%20collect%2C%20Eq%0A%0A%20%20%20%20%20%20%20%20a%2C%20flce%2C%20fm%2C%20af%2C%20fmlen%2C%20vmmax%20%3D%20symbols(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22a%2C%20flce%2C%20fm%2C%20af%2C%20fmlen%2C%20vmmax%22%2C%20positive%3DTrue%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20vm%20%3D%20symbols(%22vm%22%2C%20real%3DTrue)%0A%0A%20%20%20%20%20%20%20%20b%20%3D%20a%20*%20flce%20%2B%20fm%20%2F%20af%0A%20%20%20%20%20%20%20%20vm_eq%20%3D%20Eq(vm%20-%20(0.25%20%2B%200.75%20*%20a)%20*%20vmmax%20*%20(fm%20-%20a%20*%20flce)%20%2F%20b%2C%200)%0A%20%20%20%20%20%20%20%20sol%20%3D%20solve(vm_eq%2C%20fm)%0A%20%20%20%20%20%20%20%20print(%22fm%20%3C%3D%20a*flce%3A%5Cn%22%2C%20collect(sol%5B0%5D%2C%20vmmax)%2C%20%22%5Cn%22)%0A%0A%20%20%20%20%20%20%20%20b%20%3D%20(2%20%2B%202%20%2F%20af)%20*%20(a%20*%20flce%20*%20fmlen%20-%20fm)%20%2F%20(fmlen%20-%201)%0A%20%20%20%20%20%20%20%20vm_eq%20%3D%20Eq(vm%20-%20(0.25%20%2B%200.75%20*%20a)%20*%20vmmax%20*%20(fm%20-%20a%20*%20flce)%20%2F%20b%2C%200)%0A%20%20%20%20%20%20%20%20sol%20%3D%20solve(vm_eq%2C%20fm)%0A%20%20%20%20%20%20%20%20print(%22fm%20%3E%20a*flce%3A%5Cn%22%2C%20collect(sol%5B0%5D%2C%20(vmmax%20*%20af%2C%20fmlen%2C%20vm)))%0A%0A%20%20%20%20fvce_T03_symb()%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%20And%20here%20is%20the%20function%20we%20need%20to%20compute%20contractile%20element%20force%20as%20function%20of%20muscle%20velocity%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20fvce_T03(vm%3D0%2C%20flce%3D1%2C%20lmopt%3D1%2C%20a%3D1%2C%20vmmax%3D1%2C%20fmlen%3D1.4%2C%20af%3D0.25)%3A%0A%20%20%20%20%22%22%22Thelen%20(2003)%20force%20of%20the%20contractile%20element%20as%20function%20of%20muscle%20velocity.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20vm%20%20%3A%20float%2C%20optional%20(default%3D0)%0A%20%20%20%20%20%20%20%20muscle%20velocity%0A%20%20%20%20flce%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20normalized%20muscle%20force%20due%20to%20the%20force-length%20relationship%0A%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20optimal%20muscle%20fiber%20length%0A%20%20%20%20a%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20muscle%20activation%20level%0A%20%20%20%20vmmax%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20muscle%20velocity%20for%20concentric%20activation%0A%20%20%20%20fmlen%20%20%3A%20float%2C%20optional%20(default%3D1.4)%0A%20%20%20%20%20%20%20%20normalized%20maximum%20force%20generated%20at%20the%20lengthening%20phase%0A%20%20%20%20af%20%20%3A%20float%2C%20optional%20(default%3D0.25)%0A%20%20%20%20%20%20%20%20shape%20factor%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20fvce%20%20%3A%20float%0A%20%20%20%20%20%20%20%20normalized%20force%20of%20the%20muscle%20contractile%20element%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20vmmax%20%3D%20vmmax%20*%20lmopt%0A%20%20%20%20if%20vm%20%3C%3D%200%3A%20%20%23%20isometric%20and%20concentric%20activation%0A%20%20%20%20%20%20%20%20fvce%20%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20af%0A%20%20%20%20%20%20%20%20%20%20%20%20*%20a%0A%20%20%20%20%20%20%20%20%20%20%20%20*%20flce%0A%20%20%20%20%20%20%20%20%20%20%20%20*%20(4%20*%20vm%20%2B%20vmmax%20*%20(3%20*%20a%20%2B%201))%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%20(-4%20*%20vm%20%2B%20vmmax%20*%20af%20*%20(3%20*%20a%20%2B%201))%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20else%3A%20%20%23%20eccentric%20activation%0A%20%20%20%20%20%20%20%20fvce%20%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20a%0A%20%20%20%20%20%20%20%20%20%20%20%20*%20flce%0A%20%20%20%20%20%20%20%20%20%20%20%20*%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20af%20*%20vmmax%20*%20(3%20*%20a%20*%20fmlen%20-%203%20*%20a%20%2B%20fmlen%20-%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2B%208%20*%20vm%20*%20fmlen%20*%20(af%20%2B%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%20(af%20*%20vmmax%20*%20(3%20*%20a%20*%20fmlen%20-%203%20*%20a%20%2B%20fmlen%20-%201)%20%2B%208%20*%20vm%20*%20(af%20%2B%201))%0A%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20return%20fvce%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%20Here%20is%20the%20Python%20function%20for%20the%20McLean%20(2003)%20model%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20fvce_M03(vm%3D0%2C%20lmopt%3D1%2C%20a%3D1%2C%20vmmax%3D1%2C%20fmlen%3D1.5%2C%20af%3D0.25%2C%20s%3D2%2C%20gammav%3D5.67)%3A%0A%20%20%20%20%20%20%20%20%22%22%22McLean%20(2003)%20contractile%20element%20force%20as%20function%20of%20muscle%20velocity.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20vm%20%20%3A%20float%2C%20optional%20(default%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20muscle%20velocity%0A%20%20%20%20%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20optimal%20muscle%20fiber%20length%0A%20%20%20%20%20%20%20%20a%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20muscle%20activation%20level%0A%20%20%20%20%20%20%20%20vmmax%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20maximum%20muscle%20velocity%20for%20concentric%20activation%0A%20%20%20%20%20%20%20%20fmlen%20%20%3A%20float%2C%20optional%20(default%3D1.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20maximum%20force%20generated%20at%20the%20lengthening%20phase%0A%20%20%20%20%20%20%20%20af%20%20%3A%20float%2C%20optional%20(default%3D0.25)%0A%20%20%20%20%20%20%20%20%20%20%20%20shape%20factor%0A%20%20%20%20%20%20%20%20s%20%20%3A%20float%2C%20optional%20(default%3D2)%0A%20%20%20%20%20%20%20%20%20%20%20%20to%20double%20the%20slope%20of%20the%20force-velocity%20curve%20at%20zero%20velocity%0A%20%20%20%20%20%20%20%20gammav%20%20%3A%20float%2C%20optional%20(default%3D5.67)%0A%20%20%20%20%20%20%20%20%20%20%20%20to%20ensure%20the%20smooth%20transition%20of%20the%20lengthening%20phase%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fvce%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20force%20of%20the%20muscle%20contractile%20element%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20vmmax%20%3D%20vmmax%20*%20lmopt%0A%20%20%20%20%20%20%20%20d1%20%3D%20vmmax%20*%20af%20*%20(fmlen%20-%201)%20%2F%20(s%20*%20(af%20%2B%201))%0A%20%20%20%20%20%20%20%20d2%20%3D%20s%20*%20(af%20%2B%201)%20%2F%20(vmmax%20*%20af%20*%20(gammav%20%2B%201)%20**%202)%0A%20%20%20%20%20%20%20%20d3%20%3D%20(fmlen%20-%201)%20*%20gammav**2%20%2F%20(gammav%20%2B%201)%20**%202%20%2B%201%0A%20%20%20%20%20%20%20%20lbd%20%3D%201%20-%20np.exp(-3.82%20*%20a)%20%2B%20a%20*%20np.exp(-3.82)%0A%20%20%20%20%20%20%20%20if%20vm%20%3C%3D%200%3A%20%20%23%20isometric%20and%20concentric%20activation%0A%20%20%20%20%20%20%20%20%20%20%20%20fvce%20%3D%20(lbd%20*%20vmmax%20%2B%20vm)%20%2F%20(lbd%20*%20vmmax%20-%20vm%20%2F%20af)%0A%20%20%20%20%20%20%20%20elif%200%20%3C%20vm%20%3C%3D%20gammav%20*%20d1%3A%20%20%23%20slow%20lengthening%0A%20%20%20%20%20%20%20%20%20%20%20%20fvce%20%3D%20(fmlen%20*%20vm%20%2B%20d1)%20%2F%20(vm%20%2B%20d1)%0A%20%20%20%20%20%20%20%20elif%20vm%20%3E%20gammav%20*%20d1%3A%20%20%23%20fast%20lengthening%0A%20%20%20%20%20%20%20%20%20%20%20%20fvce%20%3D%20d3%20%2B%20d2%20*%20vm%0A%0A%20%20%20%20%20%20%20%20return%20fvce%0A%0A%20%20%20%20return%20(fvce_M03%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%20We%20can%20invert%20this%20equation%20to%20get%20an%20expression%20for%20muscle%20velocity%20as%20function%20of%20the%20contractile%20element%20force%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20vmfce_M03(fvce%3D1%2C%20lmopt%3D1%2C%20a%3D1%2C%20vmmax%3D1%2C%20fmlen%3D1.5%2C%20af%3D0.25%2C%20s%3D2%2C%20gammav%3D5.67)%3A%0A%20%20%20%20%20%20%20%20%22%22%22McLean%20(2003)%20contractile%20element%20velocity%20as%20function%20of%20CE%20force.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20fvce%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20muscle%20force%0A%20%20%20%20%20%20%20%20lmopt%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20optimal%20muscle%20fiber%20length%0A%20%20%20%20%20%20%20%20a%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20muscle%20activation%20level%0A%20%20%20%20%20%20%20%20vmmax%20%20%3A%20float%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20maximum%20muscle%20velocity%20for%20concentric%20activation%0A%20%20%20%20%20%20%20%20fmlen%20%20%3A%20float%2C%20optional%20(default%3D1.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20normalized%20maximum%20force%20generated%20at%20the%20lengthening%20phase%0A%20%20%20%20%20%20%20%20af%20%20%3A%20float%2C%20optional%20(default%3D0.25)%0A%20%20%20%20%20%20%20%20%20%20%20%20shape%20factor%0A%20%20%20%20%20%20%20%20s%20%20%3A%20float%2C%20optional%20(default%3D2)%0A%20%20%20%20%20%20%20%20%20%20%20%20to%20double%20the%20slope%20of%20the%20force-velocity%20curve%20at%20zero%20velocity%0A%20%20%20%20%20%20%20%20gammav%20%20%3A%20float%2C%20optional%20(default%3D5.67)%0A%20%20%20%20%20%20%20%20%20%20%20%20to%20ensure%20the%20smooth%20transition%20of%20the%20lengthening%20phase%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20fvce%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20muscle%20velocity%0A%20%20%20%20%20%20%20%20%22%22%22%0A%0A%20%20%20%20%20%20%20%20vmmax%20%3D%20vmmax%20*%20lmopt%0A%20%20%20%20%20%20%20%20d1%20%3D%20vmmax%20*%20af%20*%20(fmlen%20-%201)%20%2F%20(s%20*%20(af%20%2B%201))%0A%20%20%20%20%20%20%20%20d2%20%3D%20s%20*%20(af%20%2B%201)%20%2F%20(vmmax%20*%20af%20*%20(gammav%20%2B%201)%20**%202)%0A%20%20%20%20%20%20%20%20d3%20%3D%20(fmlen%20-%201)%20*%20gammav**2%20%2F%20(gammav%20%2B%201)%20**%202%20%2B%201%0A%20%20%20%20%20%20%20%20lbd%20%3D%201%20-%20np.exp(-3.82%20*%20a)%20%2B%20a%20*%20np.exp(-3.82)%0A%20%20%20%20%20%20%20%20if%200%20%3C%3D%20fvce%20%3C%3D%201%3A%20%20%23%20isometric%20and%20concentric%20activation%0A%20%20%20%20%20%20%20%20%20%20%20%20vm%20%3D%20(lbd%20*%20vmmax%20*%20(1%20-%20fvce))%20%2F%20(1%20%2B%20fvce%20%2F%20af)%0A%20%20%20%20%20%20%20%20elif%201%20%3C%20fvce%20%3C%3D%20gammav%20*%20d1%20*%20d2%20%2B%20d3%3A%20%20%23%20slow%20lengthening%0A%20%20%20%20%20%20%20%20%20%20%20%20vm%20%3D%20d1%20*%20(fvce%20-%201)%20%2F%20(fmlen%20-%20fvce)%0A%20%20%20%20%20%20%20%20elif%20fvce%20%3E%20gammav%20*%20d1%20*%20d2%20%2B%20d3%3A%20%20%23%20fast%20lengthening%0A%20%20%20%20%20%20%20%20%20%20%20%20vm%20%3D%20(fvce%20-%20d3)%20%2F%20d2%0A%0A%20%20%20%20%20%20%20%20return%20vm%0A%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%20Let's%20use%20these%20functions%20to%20compute%20muscle%20force%20as%20a%20function%20of%20the%20muscle%20velocity%20considering%20two%20levels%20of%20activation%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20vm1_T03%20%3D%20np.linspace(-1%2C%201%2C%20201)%0A%20%20%20%20fce1_T03%20%3D%20np.zeros(vm1_T03.size)%0A%20%20%20%20vm2_T03%20%3D%20np.linspace(-0.63%2C%200.63%2C%20201)%0A%20%20%20%20fce2_T03%20%3D%20np.zeros(vm2_T03.size)%0A%20%20%20%20for%20_i%20in%20range(len(vm1_T03))%3A%0A%20%20%20%20%20%20%20%20fce1_T03%5B_i%5D%20%3D%20fvce_T03(vm%3Dvm1_T03%5B_i%5D)%0A%20%20%20%20%20%20%20%20fce2_T03%5B_i%5D%20%3D%20fvce_T03(vm%3Dvm2_T03%5B_i%5D%2C%20a%3D0.5)%0A%20%20%20%20return%20fce1_T03%2C%20fce2_T03%2C%20vm1_T03%2C%20vm2_T03%0A%0A%0A%40app.cell%0Adef%20_(fvce_M03%2C%20np)%3A%0A%20%20%20%20vm1_M03%20%3D%20np.linspace(-1%2C%201%2C%20201)%0A%20%20%20%20fce1_M03%20%3D%20np.zeros(vm1_M03.size)%0A%20%20%20%20vm2_M03%20%3D%20np.linspace(-0.63%2C%200.63%2C%20201)%0A%20%20%20%20fce2_M03%20%3D%20np.zeros(vm2_M03.size)%0A%20%20%20%20for%20_i%20in%20range(len(vm1_M03))%3A%0A%20%20%20%20%20%20%20%20fce1_M03%5B_i%5D%20%3D%20fvce_M03(vm%3Dvm1_M03%5B_i%5D)%0A%20%20%20%20%20%20%20%20fce2_M03%5B_i%5D%20%3D%20fvce_M03(vm%3Dvm2_M03%5B_i%5D%2C%20a%3D0.5)%0A%20%20%20%20fce2_M03%20%3D%20fce2_M03%20*%200.5%0A%20%20%20%20return%20fce1_M03%2C%20fce2_M03%2C%20vm1_M03%2C%20vm2_M03%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20fce1_M03%2C%0A%20%20%20%20fce1_T03%2C%0A%20%20%20%20fce2_M03%2C%0A%20%20%20%20fce2_T03%2C%0A%20%20%20%20plt%2C%0A%20%20%20%20vm1_M03%2C%0A%20%20%20%20vm1_T03%2C%0A%20%20%20%20vm2_M03%2C%0A%20%20%20%20vm2_T03%2C%0A)%3A%0A%20%20%20%20_fig%2C%20(_ax1%2C%20_ax2)%20%3D%20plt.subplots(%0A%20%20%20%20%20%20%20%20nrows%3D1%2C%20ncols%3D2%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20figsize%3D(8%2C%204)%0A%20%20%20%20)%0A%20%20%20%20_ax1.plot(vm1_T03%2C%20fce1_T03%2C%20%22b%22%2C%20label%3D%22T03)%22)%0A%20%20%20%20_ax1.plot(vm1_M03%2C%20fce1_M03%2C%20%22g%22%2C%20label%3D%22M03)%22)%0A%20%20%20%20_ax1.set_ylabel(%22Normalized%20force%22)%0A%20%20%20%20_ax1.set_xlabel(%22Normalized%20velocity%22)%0A%20%20%20%20_ax1.text(0.1%2C%200.9%2C%20%22Activation%20%3D%201.0%22%2C%20transform%3D_ax1.transAxes)%0A%20%20%20%20_ax2.plot(vm2_T03%2C%20fce2_T03%2C%20%22b%22%2C%20label%3D%22T03%22)%0A%20%20%20%20_ax2.plot(vm2_M03%2C%20fce2_M03%2C%20%22g%22%2C%20label%3D%22M03%22)%0A%20%20%20%20_ax2.text(0.1%2C%200.9%2C%20%22Activation%20%3D%200.5%22%2C%20transform%3D_ax2.transAxes)%0A%20%20%20%20_ax2.set_xlabel(%22Normalized%20velocity%22)%0A%20%20%20%20_ax2.legend(loc%3D%22best%22)%0A%20%20%20%20plt.suptitle(%22Force-velocity%20relationship%20of%20the%20contractile%20element%22)%0A%20%20%20%20plt.tight_layout()%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%20Identical%20results%20for%20the%20shortening%20phase%20when%20%24a%3D1%24%20and%20similar%20results%20for%20the%20lengthening%20phase%20when%20the%20same%20parameters%20are%20used.%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%20%E2%80%94%20Read%20the%20Hill%20curve.**%20For%20%24(F%2Ba)(v%2Bb)%3D(F_0%2Ba)b%24%20with%20positive%20shortening%20speed%2C%20take%20%24F_0%3D1000%24%20N%2C%20%24a%3D250%24%20N%20and%20%24b%3D0.25%24%20m%2Fs.%20Find%20isometric%20force%20and%20unloaded%20shortening%20speed.%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%20At%20%24v%3D0%24%2C%20%24F%3DF_0%3D1000%24%20N.%20At%20%24F%3D0%24%2C%20%24v%3DF_0b%2Fa%3D1%24%20m%2Fs.%20A%20codebase%20using%20negative%20fiber%20velocity%20for%20shortening%20needs%20a%20sign%20conversion%20before%20this%20formula%20is%20used.%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%20Muscle%20power%0A%0A%20%20%20%20The%20muscle%20power%20is%20the%20product%20between%20force%20and%20velocity%3A%0A%0A%20%20%20%20**Power%20prompt.**%20The%20force%20curve%20alone%20does%20not%20reveal%20where%20the%20muscle%20does%20the%20most%20mechanical%20work%20per%20unit%20time.%20Before%20running%20the%20next%20plot%2C%20mark%20the%20shortening%20velocity%20where%20you%20expect%20power%20to%20peak.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(fce1_T03%2C%20np%2C%20vm1_T03)%3A%0A%20%20%20%20P_T03%20%3D%20np.abs(fce1_T03%20*%20vm1_T03)%0A%20%20%20%20return%20(P_T03%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%20Let's%20visualize%20the%20muscle%20power%20only%20for%20the%20concentric%20phase%20(muscle%20shortening)%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(P_T03%2C%20fce1_T03%2C%20plt%2C%20vm1_T03)%3A%0A%20%20%20%20plt.figure(figsize%3D(7%2C%204))%0A%20%20%20%20plt.plot(vm1_T03%5B%3A101%5D%2C%20fce1_T03%5B%3A101%5D%2C%20%22b%22%2C%20label%3D%22Force%22)%0A%20%20%20%20plt.xlabel(%22Normalized%20velocity%22)%0A%20%20%20%20plt.ylabel(%22Normalized%20force%22%2C%20color%3D%22b%22)%0A%20%20%20%20%23%20plt.legend(loc%3D'upper%20left')%0A%20%20%20%20plt.gca().invert_xaxis()%0A%20%20%20%20plt.gca().tick_params(axis%3D%22y%22%2C%20labelcolor%3D%22b%22)%0A%20%20%20%20plt.gca().grid(axis%3D%22y%22%2C%20color%3D%22b%22%2C%20ls%3D%22--%22)%0A%20%20%20%20plt.gca().twinx()%0A%20%20%20%20plt.plot(vm1_T03%5B%3A101%5D%2C%20P_T03%5B%3A101%5D%2C%20%22g%22%2C%20label%3D%22Power%22)%0A%20%20%20%20plt.ylabel(%22Normalized%20power%22%2C%20color%3D%22g%22)%0A%20%20%20%20plt.gca().tick_params(axis%3D%22y%22%2C%20labelcolor%3D%22g%22)%0A%20%20%20%20plt.gca().grid(axis%3D%22y%22%2C%20color%3D%22g%22%2C%20ls%3D%22--%22)%0A%20%20%20%20%23%20plt.legend(loc%3D'upper%20right')%0A%20%20%20%20plt.suptitle(%22Muscle%20power%22)%0A%20%20%20%20plt.tight_layout()%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%23%23%23%23%20Force-length-velocity%20relationship%0A%0A%20%20%20%20Let's%20visualize%20the%20effects%20of%20the%20length%20and%20velocity%20on%20the%20total%20(active%20plus%20passive)%20muscle%20force%3A%0A%0A%20%20%20%20**Before%20running%20the%20surface%20plot**%2C%20predict%20the%20ridge%20of%20high%20force.%20Should%20it%20occur%20at%20short%20fibers%2C%20optimal%20fibers%2C%20stretched%20fibers%2C%20fast%20shortening%2C%20or%20lengthening%3F%0A%0A%20%20%20%20**Model-building%20prompt.**%20A%20compact%20force%20calculation%20often%20has%20the%20form%20active%20activation%20scaling%20times%20active%20length%20and%20velocity%20factors%2C%20plus%20passive%20force.%20In%20this%20notebook%2C%20keep%20the%20Thelen%20and%20McLean%20implementation%20as%20the%20reference.%20For%20your%20own%20Yamaguchi-based%20version%2C%20write%20the%20inputs%20and%20outputs%20first%3A%20activation%2C%20normalized%20fiber%20length%2C%20normalized%20fiber%20velocity%2C%20passive%20force%2C%20tendon%20strain%2C%20and%20total%20tensile%20force.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(flce_T03%2C%20fpelm_T03%2C%20np)%3A%0A%20%20%20%20lms%20%3D%20np.linspace(0%2C%201.65%2C%20101)%0A%20%20%20%20vms%20%3D%20np.linspace(-1%2C%200.76%2C%20101)%0A%20%20%20%20fce_T03_1%20%3D%20np.zeros(lms.size)%0A%20%20%20%20fpe_T03_1%20%3D%20np.zeros(lms.size)%0A%20%20%20%20fm_T03%20%3D%20np.zeros((lms.size%2C%20vms.size))%0A%20%20%20%20for%20_i%20in%20range(len(lms))%3A%0A%20%20%20%20%20%20%20%20fce_T03_1%5B_i%5D%20%3D%20flce_T03(lm%3Dlms%5B_i%5D)%0A%20%20%20%20%20%20%20%20fpe_T03_1%5B_i%5D%20%3D%20fpelm_T03(lm%3Dlms%5B_i%5D)%0A%20%20%20%20%20%20%20%20for%20_j%20in%20range(len(vms))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fm_T03%5B_j%2C%20_i%5D%20%3D%20fvce_T03(vm%3Dvms%5B_j%5D%2C%20flce%3Dfce_T03_1%5B_i%5D)%20%2B%20fpe_T03_1%5B_i%5D%0A%20%20%20%20return%20(fm_T03%2C)%0A%0A%0A%40app.cell%0Adef%20_(flce_M03%2C%20fvce_M03%2C%20np)%3A%0A%20%20%20%20lms_1%20%3D%20np.linspace(0%2C%201.65%2C%20101)%0A%20%20%20%20vms_1%20%3D%20np.linspace(-1%2C%200.76%2C%20101)%0A%20%20%20%20fce_M03_1%20%3D%20np.zeros(lms_1.size)%0A%20%20%20%20fpe_M03_1%20%3D%20np.zeros(lms_1.size)%0A%20%20%20%20fm_M03%20%3D%20np.zeros((lms_1.size%2C%20vms_1.size))%0A%20%20%20%20for%20_i%20in%20range(len(lms_1))%3A%0A%20%20%20%20%20%20%20%20fce_M03_1%5B_i%5D%20%3D%20flce_M03(lm%3Dlms_1%5B_i%5D)%0A%20%20%20%20%20%20%20%20fpe_M03_1%5B_i%5D%20%3D%20fpelm_M03(lm%3Dlms_1%5B_i%5D)%0A%20%20%20%20%20%20%20%20for%20_j%20in%20range(len(vms_1))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20fm_M03%5B_j%2C%20_i%5D%20%3D%20fvce_M03(vm%3Dvms_1%5B_j%5D)%20*%20fce_M03_1%5B_i%5D%20%2B%20fpe_M03_1%5B_i%5D%0A%20%20%20%20return%20fm_M03%2C%20lms_1%2C%20vms_1%0A%0A%0A%40app.cell%0Adef%20_(fm_M03%2C%20fm_T03%2C%20lms_1%2C%20np%2C%20plt%2C%20vms_1)%3A%0A%20%20%20%20def%20flv3dplot(ax%2C%20lm%2C%20vm%2C%20fm%2C%20model)%3A%0A%20%20%20%20%20%20%20%20lm2%2C%20vm2%20%3D%20np.meshgrid(lm%2C%20vm)%0A%20%20%20%20%20%20%20%20ax.plot_surface(%0A%20%20%20%20%20%20%20%20%20%20%20%20lm2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20vm2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20fm%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20rstride%3D2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20cstride%3D2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20cmap%3Dplt.cm.coolwarm%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20linewidth%3D0.5%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20antialiased%3DTrue%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20ax.plot(np.ones(vms_1.size)%2C%20vms_1%2C%20fm%5B%3A%2C%20np.argmax(lm%20%3E%3D%201)%5D%2C%20%22w%22%2C%20linewidth%3D4)%0A%20%20%20%20%20%20%20%20ax.plot(lm%2C%20np.zeros(lm.size)%2C%20fm%5Bnp.argmax(vm%20%3E%3D%200)%2C%20%3A%5D%2C%20%22w%22%2C%20linewidth%3D4)%0A%20%20%20%20%20%20%20%20ax.set_xlim3d(lm%5B0%5D%2C%20lm%5B-1%5D)%0A%20%20%20%20%20%20%20%20ax.set_ylim3d(vm%5B0%5D%2C%20vm%5B-1%5D)%0A%20%20%20%20%20%20%20%20ax.set_zlim3d(0%2C%202)%0A%20%20%20%20%20%20%20%20ax.set_xlabel(%22Normalized%20length%22)%0A%20%20%20%20%20%20%20%20ax.set_ylabel(%22Normalized%20velocity%22)%0A%20%20%20%20%20%20%20%20ax.set_zlabel(%22Normalized%20force%22)%0A%20%20%20%20%20%20%20%20ax.view_init(20%2C%20225)%0A%20%20%20%20%20%20%20%20ax.locator_params(nbins%3D6)%0A%20%20%20%20%20%20%20%20ax.text(-0.4%2C%200.7%2C%202.5%2C%20model%2C%20fontsize%3D14)%0A%0A%20%20%20%20_fig%20%3D%20plt.figure(figsize%3D(9.5%2C%205))%0A%20%20%20%20_ax1%20%3D%20_fig.add_subplot(1%2C%202%2C%201%2C%20projection%3D%223d%22)%0A%20%20%20%20flv3dplot(_ax1%2C%20lms_1%2C%20vms_1%2C%20fm_T03%2C%20%22T03%22)%0A%20%20%20%20_ax2%20%3D%20_fig.add_subplot(1%2C%202%2C%202%2C%20projection%3D%223d%22)%0A%20%20%20%20flv3dplot(_ax2%2C%20lms_1%2C%20vms_1%2C%20fm_M03%2C%20%22M03%22)%0A%20%20%20%20plt.suptitle(%22Force-length-velocity%20relationship%22)%0A%20%20%20%20plt.tight_layout()%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%20Locate%20maximum%20power.**%20With%20the%20same%20Hill%20parameters%2C%20maximize%20positive%20shortening%20power%20%24P%3DFv%24.%20Is%20its%20maximum%20at%20zero%20force%20or%20at%20zero%20speed%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%20Both%20endpoints%20have%20zero%20power.%20Differentiating%20gives%20%24v_*%3Db(%5Csqrt%7B1%2BF_0%2Fa%7D-1)%3D0.3090%24%20m%2Fs%20and%20%24F_*%3Da(%5Csqrt%7B1%2BF_0%2Fa%7D-1)%3D309.0%24%20N.%20The%20maximum%20is%20about%2095.49%20W%2C%20between%20the%20endpoints.%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%20Activation%20dynamics%0A%0A%20%20%20%20Activation%20dynamics%20represents%20the%20fact%20that%20a%20muscle%20cannot%20instantly%20activate%20or%20deactivate%20because%20of%20the%20electrical%20and%20chemical%20processes%20involved%20and%20it%20is%20usually%20integrated%20with%20a%20Hill-type%20model.%20In%20its%20simplest%20form%2C%20the%20activation%20dynamics%20is%20generally%20represented%20as%20a%20first-order%20ODE.%0A%0A%20%20%20%20Activation%20is%20a%20state%20variable%2C%20not%20an%20algebraic%20copy%20of%20excitation.%20In%20Yamaguchi's%20Chapter%202%20framing%2C%20the%20control%20input%20is%20a%20mathematical%20signal%20between%200%20and%201%2C%20while%20activation%20describes%20the%20delayed%20muscle%20state%20that%20results%20from%20that%20signal.%0A%0A%20%20%20%20**Before%20running%20the%20activation%20plots**%2C%20predict%20how%20activation%20should%20differ%20from%20excitation%20when%20the%20excitation%20pulse%20turns%20on%20and%20when%20it%20turns%20off.%0A%0A%20%20%20%20**Chapter%202%20bridge%20problem.**%20Implement%20the%20He-Zajac-Levine%20bilinear%20activation%20model%20in%20a%20separate%20scratch%20cell%20or%20notebook.%20Test%20three%20cases%3A%20a%20rise%20from%20rest%2C%20a%20decay%20from%20an%20active%20state%2C%20and%20an%20intermediate%20control%20value%20such%20as%20%5C(c(t)%3D0.6%5C).%20Compare%20the%20result%20with%20the%20Thelen%20and%20McLean%20activation%20curves%20below%20without%20replacing%20them.%0A%0A%20%20%20%20Thelen2003Muscle%20employed%20the%20following%20first-order%20%5Bordinary%20differential%20equation%20(ODE)%5D(https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FOrdinary_differential_equation)%3A%0A%0A%20%20%20%20%24%24%20%5Cfrac%7B%5Cmathrm%7Bd%7Da%7D%7B%5Cmathrm%7Bd%7Dt%7D%20%3D%20%5Cfrac%7Bu-a%7D%7B%5Ctau(a%2C%20u)%7D%20%24%24%0A%0A%20%20%20%20with%20a%20lower%20activation%20bound%20to%20both%20activation%20and%20excitation.%0A%0A%20%20%20%20where%20%24u%24%20and%20%24a%24%20are%20the%20muscle%20excitation%20and%20activation%2C%20respectively%20(both%20are%20function%20of%20time)%2C%20and%20%24%5Ctau%24%20is%20a%20variable%20time%20constant%20to%20represent%20the%20activation%20and%20deactivation%20times%2C%20given%20by%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Ctau(a%2C%20u)%20%3D%20%5Cleft%5C%7B%0A%20%20%20%20%20%20%5Cbegin%7Barray%7D%7Bl%20l%7D%0A%20%20%20%20%20%20%20%20t_%7Bact%7D(0.5%2B1.5a)%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20u%20%3E%20a%5C%5C%0A%20%20%20%20%20%20%20%20%5Cfrac%7Bt_%7Bdeact%7D%7D%7B(0.5%2B1.5a)%7D%20%5Cquad%20%26%20%5Ctext%7Bif%7D%20%5Cquad%20u%20%5Cleq%20a%0A%20%20%20%20%5Cend%7Barray%7D%20%5Cright.%0A%20%20%20%20%24%24%0A%0A%20%20%20%20Thelen2003Muscle%20adopted%20activation%2C%20%24t_%7Bact%7D%24%2C%20and%20deactivation%2C%20%24t_%7Bdeact%7D%24%2C%20time%20constants%20for%20young%20adults%20equal%20to%2015%20and%2050%20ms%2C%20respectively%20(for%20old%20adults%2C%20Thelen2003Muscle%20adopted%2015%20and%2060%20ms%2C%20respectively).%0A%0A%20%20%20%20McLean2003Muscle%20expressed%20the%20activation%20dynamics%20as%20the%20following%20first-order%20ODE%3A%0A%0A%20%20%20%20%24%24%20%5Cfrac%7B%5Cmathrm%7Bd%7Da%7D%7B%5Cmathrm%7Bd%7Dt%7D%20%3D%20(u%20-%20a)(c_1u%20%2B%20c_2)%20%24%24%0A%0A%20%20%20%20with%20a%20lower%20activation%20bound%20to%20both%20activation%20and%20excitation.%0A%0A%20%20%20%20where%20%24c_1%20%2B%20c_2%24%20is%20the%20activation%20rate%20constant%20(when%20%24u%20%3D%201%24)%2C%20the%20inverse%20of%20%24t_%7Bact%7D%24%2C%20and%20%24c_2%24%20is%20the%20deactivation%20rate%20constant%20(when%20%24u%20%3D%200%24)%2C%20the%20inverse%20of%20%24t_%7Bdeact%7D%24.%0A%20%20%20%20McLean2003Muscle%20adopted%20%24c_1%3D3.3%20s%5E%7B-1%7D%24%20and%20%24c_2%3D16.7%20s%5E%7B-1%7D%24%2C%20resulting%20in%20time%20constants%20of%2050%20ms%20and%2060%20ms%20for%20activation%20and%20deactivation%2C%20respectively.%0A%0A%20%20%20%20In%20Python%2C%20the%20numeric%20first-order%20ODE%20for%20the%20activation%20dynamics%20presented%20in%20Thelen2003Muscle%20can%20be%20expressed%20as%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20actdyn_T03(t%2C%20a%2C%20t_act%2C%20t_deact%2C%20u_max%2C%20u_min%2C%20t0%3D0.1%2C%20t1%3D0.4)%3A%0A%20%20%20%20%22%22%22Thelen%20(2003)%20activation%20dynamics%2C%20the%20derivative%20of%20%60a%60%20at%20%60t%60.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20t%20%20%3A%20float%0A%20%20%20%20%20%20%20%20time%20instant%20%5Bs%5D%0A%20%20%20%20a%20%20%3A%20float%20(0%20%3C%3D%20a%20%3C%3D%201)%0A%20%20%20%20%20%20%20%20muscle%20activation%0A%20%20%20%20t_act%20%20%3A%20float%0A%20%20%20%20%20%20%20%20activation%20time%20constant%20%5Bs%5D%0A%20%20%20%20t_deact%20%20%3A%20float%0A%20%20%20%20%20%20%20%20deactivation%20time%20constant%20%5Bs%5D%0A%20%20%20%20u_max%20%20%3A%20float%20(0%20%3C%20u_max%20%3C%3D%201)%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20value%20for%20muscle%20excitation%0A%20%20%20%20u_min%20%20%3A%20float%20(0%20%3C%20u_min%20%3C%201)%2C%20optional%20(default%3D0.01)%0A%20%20%20%20%20%20%20%20minimum%20value%20for%20muscle%20excitation%0A%20%20%20%20t0%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0)%0A%20%20%20%20%20%20%20%20initial%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%20%20%20%20t1%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20final%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20adot%20%20%3A%20float%0A%20%20%20%20%20%20%20%20derivative%20of%20%60a%60%20at%20%60t%60%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20a%20%3D%20float(np.asarray(a).reshape(-1)%5B0%5D)%0A%20%20%20%20u%20%3D%20excitation(t%2C%20u_max%2C%20u_min%2C%20t0%2C%20t1)%0A%20%20%20%20if%20u%20%3E%20a%3A%0A%20%20%20%20%20%20%20%20adot%20%3D%20(u%20-%20a)%20%2F%20(t_act%20*%20(0.5%20%2B%201.5%20*%20a))%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20adot%20%3D%20(u%20-%20a)%20%2F%20(t_deact%20%2F%20(0.5%20%2B%201.5%20*%20a))%0A%0A%20%20%20%20return%20adot%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%20In%20Python%2C%20the%20numeric%20first-order%20ODE%20for%20the%20activation%20dynamics%20presented%20in%20McLean2003Muscle%20can%20be%20expressed%20as%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20actdyn_M03(t%2C%20a%2C%20t_act%2C%20t_deact%2C%20u_max%3D1%2C%20u_min%3D0.01%2C%20t0%3D0.1%2C%20t1%3D0.4)%3A%0A%20%20%20%20%22%22%22McLean%20(2003)%20activation%20dynamics%2C%20the%20derivative%20of%20%60a%60%20at%20%60t%60.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20t%20%20%3A%20float%0A%20%20%20%20%20%20%20%20time%20instant%20%5Bs%5D%0A%20%20%20%20a%20%20%3A%20float%20(0%20%3C%3D%20a%20%3C%3D%201)%0A%20%20%20%20%20%20%20%20muscle%20activation%0A%20%20%20%20t_act%20%20%3A%20float%0A%20%20%20%20%20%20%20%20activation%20time%20constant%20%5Bs%5D%0A%20%20%20%20t_deact%20%20%3A%20float%0A%20%20%20%20%20%20%20%20deactivation%20time%20constant%20%5Bs%5D%0A%20%20%20%20u_max%20%20%3A%20float%20(0%20%3C%20u_max%20%3C%3D%201)%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20value%20for%20muscle%20excitation%0A%20%20%20%20u_min%20%20%3A%20float%20(0%20%3C%20u_min%20%3C%201)%2C%20optional%20(default%3D0.01)%0A%20%20%20%20%20%20%20%20minimum%20value%20for%20muscle%20excitation%0A%20%20%20%20t0%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0)%0A%20%20%20%20%20%20%20%20initial%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%20%20%20%20t1%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20final%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20adot%20%20%3A%20float%0A%20%20%20%20%20%20%20%20derivative%20of%20%60a%60%20at%20%60t%60%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20a%20%3D%20float(np.asarray(a).reshape(-1)%5B0%5D)%0A%20%20%20%20c2%20%3D%201%20%2F%20t_deact%0A%20%20%20%20c1%20%3D%201%20%2F%20t_act%20-%20c2%0A%20%20%20%20u%20%3D%20excitation(t%2C%20u_max%2C%20u_min%2C%20t0%2C%20t1)%0A%20%20%20%20adot%20%3D%20(u%20-%20a)%20*%20(c1%20*%20u%20%2B%20c2)%0A%0A%20%20%20%20return%20adot%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%20Let's%20simulate%20the%20activation%20signal%20for%20a%20rectangular%20function%20as%20excitation%20signal%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.function%0Adef%20excitation(t%2C%20u_max%3D1%2C%20u_min%3D0.01%2C%20t0%3D0.1%2C%20t1%3D0.4)%3A%0A%20%20%20%20%22%22%22Excitation%20signal%2C%20a%20square%20wave.%0A%0A%20%20%20%20Parameters%0A%20%20%20%20----------%0A%20%20%20%20t%20%20%3A%20float%0A%20%20%20%20%20%20%20%20time%20instant%20%5Bs%5D%0A%20%20%20%20u_max%20%20%3A%20float%20(0%20%3C%20u_max%20%3C%3D%201)%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20maximum%20value%20for%20muscle%20excitation%0A%20%20%20%20u_min%20%20%3A%20float%20(0%20%3C%20u_min%20%3C%201)%2C%20optional%20(default%3D0.01)%0A%20%20%20%20%20%20%20%20minimum%20value%20for%20muscle%20excitation%0A%20%20%20%20t0%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0.1)%0A%20%20%20%20%20%20%20%20initial%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%20%20%20%20t1%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0.4)%0A%20%20%20%20%20%20%20%20final%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%0A%20%20%20%20Returns%0A%20%20%20%20-------%0A%20%20%20%20u%20%20%3A%20float%20(0%20%3C%20u%20%3C%3D%201)%0A%20%20%20%20%20%20%20%20excitation%20signal%0A%20%20%20%20%22%22%22%0A%0A%20%20%20%20u%20%3D%20u_min%0A%20%20%20%20if%20t%20%3E%3D%20t0%20and%20t%20%3C%3D%20t1%3A%0A%20%20%20%20%20%20%20%20u%20%3D%20u_max%0A%0A%20%20%20%20return%20u%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%20We%20will%20solve%20the%20equation%20for%20%24a%24%20by%20numerical%20integration%20using%20an%20explicit%20Runge-Kutta%20method%20of%20order%20(4)5%20due%20to%20Dormand%20and%20Prince%20(a.k.a.%20%60ode45%60%20in%20Matlab)%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20actdyn_ode45(%0A%20%20%20%20%20%20%20%20fun%2C%20t0%3D0%2C%20t1%3D1%2C%20a0%3D0%2C%20t_act%3D0.015%2C%20t_deact%3D0.050%2C%20u_max%3D1%2C%20u_min%3D0.01%0A%20%20%20%20)%3A%0A%20%20%20%20%20%20%20%20from%20scipy.integrate%20import%20solve_ivp%0A%0A%20%20%20%20%20%20%20%20%23%20Runge-Kutta%20(4)5%20due%20to%20Dormand%20%26%20Prince%20with%20variable%20stepsize%20ODE%20solver%0A%20%20%20%20%20%20%20%20def%20_rhs(time%2C%20state)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fun(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20time%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20float(state%5B0%5D)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t_act%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t_deact%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20u_max%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20u_min%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%0A%20%20%20%20%20%20%20%20_t_eval%20%3D%20np.arange(t0%2C%20t1%20%2B%200.005%2C%200.01)%0A%20%20%20%20%20%20%20%20_solution%20%3D%20solve_ivp(%0A%20%20%20%20%20%20%20%20%20%20%20%20_rhs%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(t0%2C%20t1)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Ba0%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20method%3D%22RK45%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20max_step%3D0.01%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20atol%3D1e-8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20rtol%3D1e-8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20t_eval%3D_t_eval%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20if%20not%20_solution.success%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20raise%20RuntimeError(_solution.message)%0A%0A%20%20%20%20%20%20%20%20_excitation%20%3D%20np.array(%5Bexcitation(_t%2C%20u_max%2C%20u_min)%20for%20_t%20in%20_solution.t%5D)%0A%20%20%20%20%20%20%20%20_activation%20%3D%20np.maximum(_solution.y%5B0%5D%2C%20u_min)%0A%20%20%20%20%20%20%20%20return%20np.column_stack((_solution.t%2C%20_excitation%2C%20_activation))%0A%0A%20%20%20%20return%20(actdyn_ode45%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%20Solving%20the%20problem%20for%20two%20different%20maximum%20excitation%20levels%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(actdyn_ode45)%3A%0A%20%20%20%20%23%20using%20the%20values%20for%20t_act%20and%20t_deact%20from%20Thelen2003Muscle%20for%20both%20models%0A%20%20%20%20act1_T03%20%3D%20actdyn_ode45(fun%3Dactdyn_T03%2C%20u_max%3D1.0)%0A%20%20%20%20act2_T03%20%3D%20actdyn_ode45(fun%3Dactdyn_T03%2C%20u_max%3D0.5)%0A%20%20%20%20act1_M03%20%3D%20actdyn_ode45(fun%3Dactdyn_M03%2C%20u_max%3D1.0)%0A%20%20%20%20act2_M03%20%3D%20actdyn_ode45(fun%3Dactdyn_M03%2C%20u_max%3D0.5)%0A%20%20%20%20%23%20using%20the%20values%20for%20t_act%20and%20t_deact%20from%20McLean2003Muscle%0A%20%20%20%20act3_M03%20%3D%20actdyn_ode45(fun%3Dactdyn_M03%2C%20u_max%3D1.0%2C%20t_act%3D0.050%2C%20t_deact%3D0.060)%0A%20%20%20%20act4_M03%20%3D%20actdyn_ode45(fun%3Dactdyn_M03%2C%20u_max%3D0.5%2C%20t_act%3D0.050%2C%20t_deact%3D0.060)%0A%20%20%20%20return%20act1_M03%2C%20act1_T03%2C%20act2_M03%2C%20act2_T03%2C%20act3_M03%2C%20act4_M03%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%20And%20the%20results%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(act1_M03%2C%20act1_T03%2C%20act2_M03%2C%20act2_T03%2C%20act3_M03%2C%20act4_M03%2C%20plt)%3A%0A%20%20%20%20_fig%2C%20_axs%20%3D%20plt.subplots(%0A%20%20%20%20%20%20%20%20nrows%3D2%2C%20ncols%3D2%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20figsize%3D(8%2C%205)%0A%20%20%20%20)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act1_T03%5B%3A%2C%200%5D%2C%20act1_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act1_T03%5B%3A%2C%200%5D%2C%20act1_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act1_M03%5B%3A%2C%200%5D%2C%20act1_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.set_ylabel(%22Level%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act2_T03%5B%3A%2C%200%5D%2C%20act2_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act2_T03%5B%3A%2C%200%5D%2C%20act2_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act2_M03%5B%3A%2C%200%5D%2C%20act2_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.legend()%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act1_T03%5B%3A%2C%200%5D%2C%20act1_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act1_T03%5B%3A%2C%200%5D%2C%20act1_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act3_M03%5B%3A%2C%200%5D%2C%20act3_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B50%2C%2060%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.set_ylabel(%22Level%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act2_T03%5B%3A%2C%200%5D%2C%20act2_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act2_T03%5B%3A%2C%200%5D%2C%20act2_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act4_M03%5B%3A%2C%200%5D%2C%20act4_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B50%2C%2060%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.legend()%0A%20%20%20%20plt.suptitle(%22Activation%20dynamics%20(Runge-Kutta%20Method)%22)%0A%20%20%20%20plt.tight_layout()%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%20Similar%20results%20when%20the%20same%20parameters%20are%20used%20(first%20row)%2C%20but%20different%20bahavior%20when%20the%20typical%20values%20of%20each%20study%20are%20compared%20(second%20row).%0A%0A%20%20%20%20**Integrator%20checkpoint.**%20The%20biological%20model%20and%20the%20numerical%20method%20are%20separate%20choices.%20What%20changed%20here%20because%20of%20the%20activation%20model%20parameters%2C%20and%20what%20would%20change%20if%20the%20integration%20tolerances%20or%20time%20step%20were%20too%20coarse%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%20Now%2C%20we%20will%20solve%20the%20equation%20for%20%24a%24%20by%20numerical%20integration%20using%20the%20Euler%20Method%20%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np)%3A%0A%20%20%20%20def%20actdyn_euler(%0A%20%20%20%20%20%20%20%20fun%2C%0A%20%20%20%20%20%20%20%20tmax%3D1%2C%0A%20%20%20%20%20%20%20%20dt%3D0.0001%2C%0A%20%20%20%20%20%20%20%20u_max%3D0.8%2C%0A%20%20%20%20%20%20%20%20u_min%3D0.0001%2C%0A%20%20%20%20%20%20%20%20t0%3D0.1%2C%0A%20%20%20%20%20%20%20%20t1%3D0.4%2C%0A%20%20%20%20%20%20%20%20t_act%3D0.015%2C%0A%20%20%20%20%20%20%20%20t_deact%3D0.05%2C%0A%20%20%20%20)%3A%0A%20%20%20%20%20%20%20%20%22%22%22Activation%20resulting%20from%20a%20square%20wave%20%20Excitation.%0A%0A%20%20%20%20%20%20%20%20Parameters%0A%20%20%20%20%20%20%20%20----------%0A%20%20%20%20%20%20%20%20t%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20time%20instant%20%5Bs%5D%0A%20%20%20%20%20%20%20%20dt%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20integration%20step%20%5Bs%5D%0A%20%20%20%20%20%20%20%20tmax%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20final%20time%20instant%20for%20the%20euler%20integration%0A%20%20%20%20%20%20%20%20u_max1%20%20%3A%20float%20(0%20%3C%20u_max%20%3C%3D%201)%2C%20optional%20(default%3D1)%0A%20%20%20%20%20%20%20%20%20%20%20%20maximum%20value%20for%20muscle%20excitation%0A%20%20%20%20%20%20%20%20u_min1%20%20%3A%20float%20(0%20%3C%20u_min%20%3C%201)%2C%20optional%20(default%3D0.01)%0A%20%20%20%20%20%20%20%20%20%20%20%20minimum%20value%20for%20muscle%20excitation%0A%20%20%20%20%20%20%20%20t0%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0.1)%0A%20%20%20%20%20%20%20%20%20%20%20%20initial%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%20%20%20%20%20%20%20%20t1%20%20%3A%20float%20%5Bs%5D%2C%20optional%20(default%3D0.4)%0A%20%20%20%20%20%20%20%20%20%20%20%20final%20time%20instant%20for%20muscle%20excitation%20equals%20to%20u_max%0A%20%20%20%20%20%20%20%20t_act%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20activation%20time%20constant%20%5Bs%5D%0A%20%20%20%20%20%20%20%20t_deact%20%20%3A%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20deactivation%20time%20constant%20%5Bs%5D%0A%0A%20%20%20%20%20%20%20%20Returns%0A%20%20%20%20%20%20%20%20-------%0A%20%20%20%20%20%20%20%20data%20%3A%20%20float%0A%20%20%20%20%20%20%20%20%20%20%20%20matrix%20containing%3A%20time%20%5Bs%5D%3B%20excitation%20signal%20(0%20%3C%20u%20%3C%3D%201)%3B%20activation%20signal%20(0%3C%20act%20%3C%3D%201)%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20t%20%3D%20np.arange(0%2C%20tmax%2C%20dt)%0A%20%20%20%20%20%20%20%20act%20%3D%20np.zeros_like(t)%0A%20%20%20%20%20%20%20%20u%20%3D%20np.zeros_like(t)%0A%20%20%20%20%20%20%20%20for%20_i%20in%20range(1%2C%20len(t))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20aux%20%3D%20_i%20*%20dt%0A%20%20%20%20%20%20%20%20%20%20%20%20u%5B_i%5D%20%3D%20excitation(aux%2C%20u_max%2C%20u_min%2C%20t0%2C%20t1)%0A%20%20%20%20%20%20%20%20%20%20%20%20adot%20%3D%20fun(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t%3Daux%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20a%3Dact%5B_i%20-%201%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t_act%3Dt_act%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t_deact%3Dt_deact%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20u_max%3Du_max%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20u_min%3Du_min%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t0%3Dt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20t1%3Dt1%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20act%5B_i%5D%20%3D%20act%5B_i%20-%201%5D%20%2B%20adot%20*%20dt%0A%20%20%20%20%20%20%20%20data%20%3D%20np.stack((t%2C%20u%2C%20act)%2C%20axis%3D-1)%0A%20%20%20%20%20%20%20%20return%20data%0A%0A%20%20%20%20return%20(actdyn_euler%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%20Solving%20the%20problem%20for%20two%20different%20maximum%20excitation%20levels%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(actdyn_euler)%3A%0A%20%20%20%20%23%20using%20the%20values%20for%20t_act%20and%20t_deact%20from%20Thelen2003Muscle%20for%20both%20models%0A%20%20%20%20act5_T03%20%3D%20actdyn_euler(fun%3Dactdyn_T03%2C%20u_max%3D1.0)%0A%20%20%20%20act6_T03%20%3D%20actdyn_euler(fun%3Dactdyn_T03%2C%20u_max%3D0.5)%0A%20%20%20%20act5_M03%20%3D%20actdyn_euler(fun%3Dactdyn_M03%2C%20u_max%3D1.0)%0A%20%20%20%20act6_M03%20%3D%20actdyn_euler(fun%3Dactdyn_M03%2C%20u_max%3D0.5)%0A%20%20%20%20%23%20using%20the%20values%20for%20t_act%20and%20t_deact%20from%20McLean2003Muscle%0A%20%20%20%20act7_M03%20%3D%20actdyn_euler(fun%3Dactdyn_M03%2C%20u_max%3D1.0%2C%20t_act%3D0.050%2C%20t_deact%3D0.060)%0A%20%20%20%20act8_M03%20%3D%20actdyn_euler(fun%3Dactdyn_M03%2C%20u_max%3D0.5%2C%20t_act%3D0.050%2C%20t_deact%3D0.060)%0A%20%20%20%20return%20act5_M03%2C%20act5_T03%2C%20act6_M03%2C%20act6_T03%2C%20act7_M03%2C%20act8_M03%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%20And%20the%20results%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(act5_M03%2C%20act5_T03%2C%20act6_M03%2C%20act6_T03%2C%20act7_M03%2C%20act8_M03%2C%20plt)%3A%0A%20%20%20%20_fig%2C%20_axs%20%3D%20plt.subplots(%0A%20%20%20%20%20%20%20%20nrows%3D2%2C%20ncols%3D2%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20figsize%3D(8%2C%205)%0A%20%20%20%20)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act5_M03%5B%3A%2C%200%5D%2C%20act5_M03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act5_T03%5B%3A%2C%200%5D%2C%20act5_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.plot(act5_M03%5B%3A%2C%200%5D%2C%20act5_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%200%5D.set_ylabel(%22Level%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act6_T03%5B%3A%2C%200%5D%2C%20act6_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act6_T03%5B%3A%2C%200%5D%2C%20act6_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.plot(act6_M03%5B%3A%2C%200%5D%2C%20act6_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B0%2C%201%5D.legend()%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act5_T03%5B%3A%2C%200%5D%2C%20act5_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act5_T03%5B%3A%2C%200%5D%2C%20act5_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.plot(act7_M03%5B%3A%2C%200%5D%2C%20act7_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B50%2C%2060%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B1%2C%200%5D.set_ylabel(%22Level%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act6_T03%5B%3A%2C%200%5D%2C%20act6_T03%5B%3A%2C%201%5D%2C%20%22r%3A%22%2C%20label%3D%22Excitation%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act6_T03%5B%3A%2C%200%5D%2C%20act6_T03%5B%3A%2C%202%5D%2C%20%22b%22%2C%20label%3D%22T03%20%5B15%2C%2050%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.plot(act8_M03%5B%3A%2C%200%5D%2C%20act8_M03%5B%3A%2C%202%5D%2C%20%22g%22%2C%20label%3D%22M03%20%5B50%2C%2060%5D%20ms%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.set_xlabel(%22Time%20(s)%22)%0A%20%20%20%20_axs%5B1%2C%201%5D.legend()%0A%20%20%20%20plt.suptitle(%22Activation%20dynamics%20(Euler%20Method)%22)%0A%20%20%20%20plt.tight_layout()%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%20Similar%20results%20when%20the%20same%20parameters%20are%20used%20(first%20row)%2C%20but%20different%20bahavior%20when%20the%20typical%20values%20of%20each%20study%20are%20compared%20(second%20row).%20For%20this%20example%2C%20the%20results%20are%20similar%20for%20Runge-Kutta%20Method%20and%20Euler%20Method%20considering%20the%20integration%20parameters%20used.%0A%0A%20%20%20%20**Numerical-method%20problem.**%20Repeat%20the%20Euler%20simulation%20with%20larger%20time%20steps.%20Find%20a%20time%20step%20where%20the%20plot%20still%20looks%20acceptable%20and%20a%20time%20step%20where%20the%20activation%20curve%20is%20visibly%20distorted.%20Explain%20why%20a%20stable-looking%20curve%20is%20not%20automatically%20an%20accurate%20curve.%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%205%20%E2%80%94%20Read%20an%20activation%20time%20constant.**%20For%20%24%5Cdot%20a%3D(u-a)%2F%5Ctau%24%20with%20%24u%3D1%24%2C%20%24a(0)%3D0%24%20and%20%24%5Ctau%3D0.02%24%20s%2C%20find%20activation%20after%20one%20time%20constant.%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%205%0A%0A%20%20%20%20%24a(t)%3D1-e%5E%7B-t%2F%5Ctau%7D%24%2C%20so%20%24a(0.02)%3D1-e%5E%7B-1%7D%5Capprox0.632%24.%20Activation%20does%20not%20jump%20instantly%20to%20excitation.%20Different%20rise%20and%20decay%20constants%20model%20asymmetry%20in%20activation%20and%20deactivation.%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%20Muscle%20modeling%20parameters%0A%0A%20%20%20%20We%20have%20seen%20two%20types%20of%20parameters%20in%20the%20muscle%20modeling%3A%20parameters%20related%20to%20the%20mathematical%20functions%20used%20to%20model%20the%20muscle%20and%20tendon%20behavior%20and%20parameters%20related%20to%20the%20properties%20of%20specific%20muscles%20and%20tendons%20(e.g.%2C%20maximum%20isometric%20force%2C%20optimal%20fiber%20length%2C%20pennation%20angle%2C%20and%20tendon%20slack).%20In%20general%20the%20first%20type%20of%20parameters%20are%20independent%20of%20the%20muscle-tendon%20unit%20being%20modeled%20(but%20dependent%20of%20the%20model!)%20while%20the%20second%20type%20of%20parameters%20is%20changed%20for%20each%20muscle-tendon%20unit%20(for%20instance%2C%20see%20http%3A%2F%2Fisbweb.org%2Fdata%2Fdelp%2F%20for%20some%20of%20these%20parameters).%0A%0A%20%20%20%20**Parameter%20prompt.**%20Separate%20the%20parameters%20into%20two%20lists%20before%20changing%20the%20code%3A%20model-shape%20parameters%20and%20muscle-specific%20anatomical%20parameters.%20Which%20list%20should%20change%20when%20you%20switch%20from%20one%20muscle%20to%20another%2C%20and%20which%20list%20should%20change%20when%20you%20switch%20from%20one%20published%20model%20to%20another%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%23%20Limitations%20of%20Hill-type%20muscle%20models%0A%0A%20%20%20%20As%20with%20any%20modeling%2C%20Hill-type%20muscle%20models%20are%20a%20simplification%20of%20the%20reality.%20For%20instance%2C%20a%20typical%20Hill-type%20muscle%20model%20(as%20implemented%20here)%20does%20not%20capture%20time-dependent%20muscle%20behavior%2C%20such%20as%20force%20depression%20after%20quick%20muscle%20shortening%2C%20force%20enhancement%20after%20quick%20muscle%20lengthening%2C%20viscoelastic%20%20properties%20(creep%20and%20relaxation)%2C%20and%20muscle%20fatigue%20(Zatsiorsky%20and%20Prilutsky%2C%202012).%20There%20are%20enhanced%20models%20that%20capture%20these%20properties%20but%20it%20seems%20their%20complexity%20are%20not%20worthy%20for%20the%20most%20common%20applications%20of%20human%20movement%20simulation.%0A%0A%20%20%20%20**Checkpoint%20questions.**%0A%0A%20%20%20%201.%20Why%20is%20activation%20a%20state%20variable%20rather%20than%20an%20algebraic%20copy%20of%20excitation%3F%0A%20%20%20%202.%20Which%20part%20of%20the%20model%20explains%20force%20at%20zero%20activation%3F%0A%20%20%20%203.%20Why%20does%20shortening%20velocity%20reduce%20active%20force%3F%0A%20%20%20%204.%20Why%20can%20lengthening%20velocity%20increase%20active%20force%3F%0A%20%20%20%205.%20In%20a%20fixed-length%20muscle-tendon%20unit%2C%20why%20can%20muscle%20fiber%20length%20still%20change%20after%20activation%20changes%3F%0A%20%20%20%206.%20Which%20assumptions%20in%20this%20notebook%20would%20you%20remove%20first%20for%20a%20more%20realistic%20simulation%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%20Answers%20to%20the%20earlier%20muscle-model%20checkpoints%0A%0A%20%20%20%201.%20Activation%20evolves%20over%20time%20rather%20than%20copying%20excitation%20instantly.%202.%20Passive%20elastic%20force.%203.%20Shortening%20reduces%20force%20through%20the%20active%20force%E2%80%93velocity%20relation.%204.%20The%20modeled%20eccentric%20branch%20permits%20larger%20active%20force%20up%20to%20its%20limit.%205.%20Fiber%20and%20tendon%20lengths%20exchange%2C%20with%20pennation%20coupling%20their%20projections.%206.%20The%20first%20assumption%20to%20relax%20depends%20on%20the%20task%3A%20fatigue%20for%20repeated%20work%2C%20history%20dependence%20for%20stretch%E2%80%93shorten%20behavior%2C%20or%20geometry%2Fcompliance%20for%20architectural%20effects.%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.%20Which%20force%20branches%20remain%20when%20activation%20is%20zero%3F%0A%20%20%20%202.%20How%20is%20power%20affected%20by%20your%20shortening-velocity%20sign%20convention%3F%0A%20%20%20%203.%20Why%20can%20tendon%20force%20change%20while%20total%20musculotendon%20length%20stays%20fixed%3F%0A%20%20%20%204.%20Which%20conclusions%20depend%20on%20the%20chosen%20Hill-model%20parameterization%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.%20Passive%20muscle%20and%20tendon%20forces%20can%20remain%20if%20stretched.%0A%20%20%20%202.%20Fiber%20power%20uses%20force%20times%20signed%20lengthening%20velocity%3B%20positive%20delivered%20shortening%20power%20uses%20the%20opposite%20sign.%0A%20%20%20%203.%20Fiber%20and%20tendon%20lengths%20can%20exchange%20while%20their%20total%20projected%20length%20remains%20fixed.%0A%20%20%20%204.%20Exact%20curve%20shapes%2C%20eccentric%20limits%2C%20time%20constants%2C%20and%20quantitative%20force%20predictions.%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.%20The%20results%20presented%20in%20this%20text%20depend%20on%20the%20parameters%20used%20in%20the%20model.%20These%20parameters%20may%20vary%20because%20of%20different%20properties%20of%20the%20muscle%20and%20tendon%20but%20also%20because%20different%20mathematical%20functions%20may%20be%20used.%0A%20%20%20%20%20%20%20a.%20Change%20some%20of%20the%20parameters%20and%20reproduce%20the%20plots%20shown%20here%20and%20discuss%20these%20results%20(e.g.%2C%20use%20the%20parameters%20for%20different%20muscles%20from%20OpenSim%20or%20the%20data%20from%20%5Bhttp%3A%2F%2Fisbweb.org%2Fdata%2Fdelp%2F%5D(http%3A%2F%2Fisbweb.org%2Fdata%2Fdelp%2F)).%0A%20%20%20%20%20%20%20b.%20Select%20another%20reference%20(e.g.%2C%20Anderson%2C%202007)%20about%20muscle%20modeling%20that%20uses%20different%20mathematical%20functions%20and%20repeat%20the%20previous%20item.%0A%0A%20%20%20%202.%20Activation%20rise%20and%20decay.%20Implement%20the%20He-Zajac-Levine%20bilinear%20activation%20model%20from%20Chapter%202%20as%20a%20new%20function%20in%20a%20separate%20scratch%20cell%20or%20notebook.%20Simulate%20%5C(c(t)%3D1%5C)%2C%20%5C(c(t)%3D0.6%5C)%2C%20and%20%5C(c(t)%3D0%5C).%20Explain%20why%20activation%20and%20deactivation%20do%20not%20use%20the%20same%20time%20constant.%20Do%20not%20replace%20the%20Thelen%20or%20McLean%20activation%20plots%20above.%0A%0A%20%20%20%203.%20Activation%20function%20tests.%20Write%20unit-style%20checks%20for%20your%20activation%20function%3A%20%5C(a(t)%5C)%20should%20stay%20between%200%20and%201%2C%20%5C(c%3D1%5C)%20should%20rise%20quickly%20from%20rest%2C%20and%20%5C(c%3D0%5C)%20should%20decay%20from%20an%20active%20state.%0A%0A%20%20%20%204.%20Active%20force-length%20implementation.%20Implement%20a%20normalized%20active%20force-length%20function%20that%20is%20zero%20or%20near%20zero%20near%20%5C(0.5l_0%5EM%5C)%20and%20%5C(1.5l_0%5EM%5C)%2C%20maximal%20at%20%5C(l_0%5EM%5C)%2C%20and%20scaled%20by%20activation.%20Compare%20a%20parabolic%2C%20cosine%2C%20or%20piecewise-linear%20version%20with%20the%20Thelen%20and%20McLean%20curves%20shown%20above.%0A%0A%20%20%20%205.%20Passive%20force-length%20implementation.%20Implement%20an%20exponential%20passive%20force-length%20function.%20Choose%20parameters%20so%20passive%20force%20at%20a%20stretched%20fiber%20length%20is%2025%25%2C%2050%25%2C%20and%20100%25%20of%20%5C(F_0%5EM%5C).%20How%20does%20this%20change%20total%20force%3F%0A%0A%20%20%20%206.%20Hill%20force-velocity%20implementation.%20Implement%20the%20shortening%20branch%20of%20Hill's%20equation%20and%20plot%20force%20versus%20normalized%20shortening%20velocity.%20Then%20compute%20the%20velocity%20at%20which%20positive%20shortening%20power%20is%20maximal.%0A%0A%20%20%20%207.%20Lengthening%20branch%20design.%20Add%20an%20eccentric%20branch%20that%20approaches%20a%20finite%20force%20limit.%20Explain%20why%20a%20force%20limit%20is%20more%20realistic%20than%20a%20line%20that%20grows%20forever.%0A%0A%20%20%20%208.%20Full%20muscle%20force.%20Combine%20activation%2C%20active%20length%20dependence%2C%20passive%20length%20dependence%2C%20and%20velocity%20dependence%20into%20one%20force%20function.%20Plot%20force%20as%20a%20surface%20over%20length%20and%20velocity%20for%20%5C(a%3D0.25%5C)%2C%20%5C(0.5%5C)%2C%20and%20%5C(1.0%5C).%0A%0A%20%20%20%209.%20Tendon%20equilibrium.%20For%20a%20fixed%20musculotendon%20length%2C%20solve%20for%20the%20fiber%20length%20where%20muscle%20force%20and%20tendon%20force%20are%20equal.%20Compare%20a%20stiff%20tendon%20with%20a%20compliant%20tendon.%0A%0A%20%20%20%2010.%20Energy%20storage.%20Use%20tendon%20force%20and%20tendon%20velocity%20to%20estimate%20tendon%20power.%20When%20is%20tendon%20storing%20energy%2C%20and%20when%20is%20it%20returning%20energy%3F%0A%0A%20%20%20%2011.%20Model%20critique.%20List%20three%20behaviors%20that%20this%20simple%20Hill-type%20model%20does%20not%20capture%2C%20such%20as%20fatigue%2C%20history-dependent%20force%20enhancement%2Fdepression%2C%20or%20detailed%20recruitment%20and%20fiber-type%20effects.%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.%20There%20is%20no%20unique%20parameter-sweep%20curve.%20Larger%20maximum%20isometric%20force%20scales%20dimensional%20active%20force%3B%20changed%20optimal%20length%20or%20tendon%20slack%20length%20shifts%20the%20operating%20point.%20An%20alternate%20curve%20must%20be%20compared%20in%20the%20same%20normalization%20and%20velocity-sign%20convention.%0A%0A%20%20%20%202.%20A%20normalized%20bilinear%20form%20is%20%24%5Cdot%20a%3D(u-a)%5Bu%2F%5Ctau_a%2B(1-u)%2F%5Ctau_d%5D%24%20with%20%240%5Cle%20u%2Ca%5Cle1%24%20and%20%24%5Ctau_a%3C%5Ctau_d%24.%20Steady%20activations%20for%20constant%20inputs%201%2C%200.6%20and%200%20are%201%2C%200.6%20and%200.%20Rise%20and%20decay%20have%20different%20rates.%0A%0A%20%20%20%203.%20Checks%3A%20%240%5Cle%20a%5Cle1%24%2C%20%24a%5Cto1%24%20for%20%24u%3D1%24%2C%20%24a%5Cto0%24%20for%20%24u%3D0%24%2C%20and%20faster%20activation%20than%20deactivation%20for%20the%20chosen%20constants.%20Numerical%20violations%20require%20a%20smaller%20step%20or%20a%20suitable%20bounded%20integration%20method.%0A%0A%20%20%20%204.%20One%20admissible%20normalized%20curve%20is%20%24f_l(%5Clambda)%3D%5Cmax(0%2C1-4(%5Clambda-1)%5E2)%24%2C%20with%20active%20force%20%24aF_0f_l%24.%0A%0A%20%20%20%205.%20For%20%24f_%7BPE%7D%3DA%5B%5Cexp(B(%5Clambda-1))-1%5D%24%20when%20%24%5Clambda%3E1%24%20(zero%20otherwise)%2C%20choose%20%24A%3Dp%2F%5B%5Cexp(B(%5Clambda_*-1))-1%5D%24%20for%20passive%20fraction%20%24p%5Cin%5C%7B0.25%2C0.5%2C1%5C%7D%24%20at%20the%20specified%20stretched%20length%20%24%5Clambda_*%3E1%24.%0A%0A%20%20%20%206.%20%24F(v)%3D(F_0%2Ba)b%2F(v%2Bb)-a%24%20for%20positive%20shortening%20speed%3B%20%24v_*%3Db(%5Csqrt%7B1%2BF_0%2Fa%7D-1)%24%20and%20%24F_*%3Da(%5Csqrt%7B1%2BF_0%2Fa%7D-1)%24.%0A%0A%20%20%20%207.%20A%20possible%20normalized%20eccentric%20branch%20is%20%24f_v(s)%3D1%2B(f_%7Bmax%7D-1)(1-e%5E%7B-s%2Fs_0%7D)%24%20for%20lengthening%20speed%20%24s%5Cge0%24.%20It%20approaches%20%24f_%7Bmax%7D%24.%0A%0A%20%20%20%208.%20%24F_M%3DF_0%5Ba%20f_l(%5Clambda)f_v(v)%2Bf_%7BPE%7D(%5Clambda)%5D%24%3B%20only%20the%20active%20contribution%20scales%20directly%20with%20activation.%0A%0A%20%20%20%209.%20Equilibrium%20is%20%24F_T(L_%7BMT%7D-L_M%5Ccos%5Calpha)%3DF_M(L_M%2Ca%2Cv)%5Ccos%5Calpha%24.%20A%20compliant%20tendon%20allows%20greater%20length%20exchange%3B%20the%20numerical%20root%20requires%20the%20chosen%20geometry%2C%20activation%20and%20curves.%0A%0A%20%20%20%2010.%20With%20tendon%20lengthening%20positive%2C%20%24%5Cdot%20E_T%3DF_T%5Cdot%20L_T%24%3A%20positive%20while%20storing%20elastic%20energy%2C%20negative%20while%20returning%20it.%0A%0A%20%20%20%2011.%20Examples%3A%20fatigue%2C%20history-dependent%20force%20enhancement%2Fdepression%2C%20detailed%20motor-unit%20recruitment%2C%20and%20fiber-type%20heterogeneity.%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%20Use%20%5BMultibodyDynamics%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2FBMClab%2FBMC%2Fblob%2Fmaster%2Fnotebooks%2Fmultibody_dynamics.py)%20to%20connect%20this%20guide%20with%20the%20surrounding%20mechanics%20and%20modeling%20material.%20Return%20to%20the%20assumptions%20behind%20each%20equation%20when%20applying%20it%20to%20a%20new%20experiment.%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%5BMIT%20OpenCourseWare%5D(https%3A%2F%2Focw.mit.edu%2Fcourses%2F2-003sc-engineering-dynamics-fall-2011%2F)%20%E2%80%94%20Mechanical%20vibration%20lectures%3A%20review%20spring%2C%20damping%20and%20coupled-system%20responses%20before%20interpreting%20passive%20muscle-model%20elements.%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-%20Anderson%20C%20(2007)%20%5BEquations%20for%20Modeling%20the%20Forces%20Generated%20by%20Muscles%20and%20Tendons%5D(https%3A%2F%2Fdocs.google.com%2Fviewer%3Furl%3Dhttps%253A%252F%252Fsimtk.org%252Fdocman%252Fview.php%252F124%252F604%252FMuscleAndTendonForcesClayAnderson20070521.doc)%20(%5BPDF%5D(https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D0BxbW72zV7WmUVUh0MldGOGZ6aHc%26authuser%3D0)).%20BioE215%20Physics-based%20Simulation%20of%20Biological%20Structures.%0A%0A%20%20%20%20-%20Erdemir%20A%2C%20McLean%20S%2C%20Herzog%20W%2C%20van%20den%20Bogert%20AJ%20(2007)%20%5BModel-based%20estimation%20of%20muscle%20forces%20exerted%20during%20movements%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F17070969).%20Clinical%20Biomechanics%2C%2022%2C%20131%E2%80%93154.%0A%0A%20%20%20%20-%20He%20J%2C%20Levine%20WS%2C%20Loeb%20GE%20(1991)%20%5BFeedback%20gains%20for%20correcting%20small%20perturbations%20to%20standing%20posture%5D(https%3A%2F%2Fdrive.google.com%2Fopen%3Fid%3D0BxbW72zV7WmUekRXY09GSEhUVlE%26authuser%3D0).%20IEEE%20Transactions%20on%20Automatic%20Control%2C%2036%2C%20322%E2%80%93332.%0A%0A%20%20%20%20-%20McLean%20SG%2C%20Su%20A%2C%20van%20den%20Bogert%20AJ%20(2003)%20%5BDevelopment%20and%20validation%20of%20a%203-D%20model%20to%20predict%20knee%20joint%20loading%20during%20dynamic%20movement%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F14986412).%20Journal%20of%20Biomechanical%20Engineering%2C%20125%2C%20864-74.%0A%0A%20%20%20%20-%20McMahon%20TA%20(1984)%20%5BMuscles%2C%20Reflexes%2C%20and%20Locomotion%5D(https%3A%2F%2Farchive.org%2Fdetails%2FMcMahonTAMusclesReflexesAndLocomotionPrincetonUniversityPress1984).%20Princeton%20University%20Press%2C%20Princeton%2C%20New%20Jersey.%0A%0A%20%20%20%20-%20Millard%20M%2C%20Uchida%20T%2C%20Seth%20A%2C%20Delp%20SL%20(2013)%20%5BFlexing%20computational%20muscle%3A%20modeling%20and%20simulation%20of%20musculotendon%20dynamics%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F23445050).%20Journal%20of%20Biomechanical%20Engineering%2C%20135%2C%20021005.%0A%0A%20%20%20%20-%20Nigg%20BM%20and%20Herzog%20W%20(2006)%20%5BBiomechanics%20of%20the%20Musculo-skeletal%20System%5D(https%3A%2F%2Fbooks.google.com.br%2Fbooks%3Fid%3DhOIeAQAAIAAJ%26dq%3Deditions%3AISBN0470017678).%203rd%20Edition.%20Wiley.%0A%0A%20%20%20%20-%20Robertson%20G%2C%20Caldwell%20G%2C%20Hamill%20J%2C%20Kamen%20G%20(2013)%20%5BResearch%20Methods%20in%20Biomechanics%5D(https%3A%2F%2Fbooks.google.com.br%2Fbooks%3Fid%3DgRn8AAAAQBAJ).%202nd%20Edition.%20Human%20Kinetics.%0A%0A%20%20%20%20-%20Thelen%20DG%20(2003)%20%5BAdjustment%20of%20muscle%20mechanics%20model%20parameters%20to%20simulate%20dynamic%20contractions%20in%20older%20adults%5D(http%3A%2F%2Fhomepages.cae.wisc.edu%2F~thelen%2Fpubs%2Fjbme03.pdf).%20Journal%20of%20Biomechanical%20Engineering%2C%20125(1)%3A70%E2%80%9377.%0A%0A%20%20%20%20-%20Tsianos%20GA%20and%20Loeb%20GE%20(2013)%20%5BMuscle%20Physiology%20and%20Modeling%5D(http%3A%2F%2Fwww.scholarpedia.org%2Farticle%2FMuscle_Physiology_and_Modeling).%20Scholarpedia%2C%208(10)%3A12388.%0A%0A%20%20%20%20-%20Winters%20JM%20(1990)%20%5BHill-based%20muscle%20models%3A%20a%20systems%20engineering%20perspective%5D(http%3A%2F%2Flink.springer.com%2Fchapter%2F10.1007%252F978-1-4613-9030-5_5).%20In%20%5BMultiple%20Muscle%20Systems%3A%20Biomechanics%20and%20Movement%20Organization%5D(http%3A%2F%2Flink.springer.com%2Fbook%2F10.1007%2F978-1-4613-9030-5)%2C%20edited%20by%20JM%20Winters%20and%20SL%20Woo%2C%20Springer-Verlag%2C%20New%20York.%0A%0A%20%20%20%20-%20Winters%20JM%20(1995)%20%5BAn%20Improved%20Muscle-Reflex%20Actuator%20for%20Use%20in%20Large-Scale%20Neuromusculoskeletal%20Models%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F7486344).%20Annals%20of%20Biomedical%20Engineering%2C%2023%2C%20359%E2%80%93374.%0A%0A%20%20%20%20-%20Yamaguchi%20GT%20(2001)%20*Dynamic%20Modeling%20of%20Musculoskeletal%20Motion%3A%20A%20Vectorized%20Approach*.%20Chapter%202%3A%20An%20Introduction%20to%20Modeling%20Muscle%20and%20Tendon.%20See%20local%20file%20%60courses%2Frefs%2FYamaguchi_ch2.pdf%60.%0A%0A%20%20%20%20-%20Zajac%20FE%20(1989)%20%5BMuscle%20and%20tendon%3A%20properties%2C%20models%2C%20scaling%20and%20application%20to%20biomechanics%20and%20motor%20control%5D(https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F2676342).%20Critical%20Reviews%20in%20Biomedical%20Engineering%2017%3A359-411.%0A%0A%20%20%20%20-%20Zatsiorsky%20V%20and%20Prilutsky%20B%20(2012)%20%5BBiomechanics%20of%20Skeletal%20Muscles%5D(https%3A%2F%2Fbooks.google.com.br%2Fbooks%3Fid%3DTHXfHT8L5MEC).%20Human%20Kinetics.%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
aba26495111c99feaa5ff87d1e0e94ef