Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Numerical and Statistical Methods for Bioengineering: Applications in Matlab Ple

ID: 3595692 • Letter: N

Question

Numerical and Statistical Methods for Bioengineering: Applications in Matlab

Please show Matlab Code

Biomechanics of jumping The effort exerted by aperson while jumping is dependent on several factors that include the weight of the body and the time spent pushing the body off the ground. The following equation describes the force F (measured in pound-force, lbf) exerted by a person weighing 160 lb and performing a jump from a stationary position. The time spent launching the body upwards, or the “duration of lift-off,” is denoted by (in milliseconds):

F(t) = 480sin(pi(t)/) + 160(1- (t/))

For =180 ms, use the regula-falsi method of nonlinear root nding to determine the time at which the force is equal to 480 lbf. Use 1< t <75 as your initial interval.

For each iteration of the regula-falsi method, show the upper and lower bounds of the bracketing interval, the estimated root, the value of the function at these three time values, and the absolute and relative error of the estimated root.

Explanation / Answer

For tau=180, the function F(t)= 480 sin (pi(t)/tau) + 160 (1-(t/tau)) becomes as below

F(t)= 480 sin (pi(t)/180) + 160 (1-(t/180))

We want determine t such aht F(t)=480. Let us define another function G(t) = F(t) - 480

New function G(t) would be zero for F(t)=480. If we could fing t such that G(t) is zero then at that point F(t) would be 480.

When G(t)=0 than that point would be root of G(t). Given interval to search for the root is 1 to 75. Therefore, regula-falsi method would initially takes x0=1 and x1=75.

Required Python code is as below

==============================

import math

#F(t)= 480 sin (pi(t)/180) + 160 (1-(t/180))
def G(t):    
    F = 480 * math.sin((math.pi*t)/180) + 160*(1-(t/180))
    return F-480

i=1
x0=1
x1=75
xMid = x0 - ((x1-x0)/(G(x1)-G(x0)))*G(x0)
while (math.fabs(G(xMid))>0.0000001): # change here to get more precision
      print(str(i)+'. x0='+str(x0)+', x1='+str(x1)+' mid='+str(xMid)+' error='+str(G(xMid)))
      if( G(xMid)<0 ):
           x0=xMid
      else:
           x1=xMid
      xMid = x0 - ((x1-x0)/(G(x1)-G(x0)))*G(x0)
      i=i+1