Question: def euler ( t 1 , x 0 , k , h ) : t = np . arange ( 0 , t 1 +

def euler(t1, x0, k, h):
t = np.arange(0, t1+ h, h)
n = np.shape(t)[0]
x = np.zeros(n)
x[0]= x0
for i in range(1,n):
x[i]= x[i-1]+ h*k*x[i-1]
return(t, x)
change the above code to simultaneously solve two first order differential equations, givens:
dx/dt = v
dv/dt =(-k/m)x
t0=0
x(0)=7
k =0.7
m =0.5
make sure code solves from x(0) to x(100)
write equivalent pseudocode for above code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!