Question: Please use python to solve this question!Change the function solve _ DE provided so that it uses the function eulers _ method _ n _

Please use python to solve this question!Change the function solve_DE provided so that it uses the function eulers_method_n_steps_t_final to solve the
differential equation
dy(d)t=3yt2-y5
with the initial conditions y(1)=4 using 35 steps to final t=8. As in the code provided, the function should return numpy
arrays of the t and y values giving the Euler's method solution.
For this question you can assume that the function eulers_method_n_steps_t_final(dydt, t ,y0,tf,n-steps ) is
available. This function returns the Euler's method solution to the DEdy(d)t=dydt with initial conditions y(t0)=yusing
n-steps steps to a final t=tf and returns numpy arrays of the t and y values giving the Euler's method solution.
Only a few lines of the given code need to be altered to answer this question!
Your code will be tested by running your function and checking various values in the returned arrays.
Answer: (penalty regime: 0,10,dots%)
import numpy as np
def solve_DE():
"" Perform several iterations of Euler's method
and return the Euler's Method solution.
"".
# DE Function
dydt=t,y:np*exp(-t)-4**y
# Initial conditions
to =0
ye =5
# number of steps and final t
n_steps =50
t_final =2
# Eulers method
t_values, y_values = eulers_method_n_steps_t_final ,
to,
yo,
t_final,
n_steps)
return t_values, y_valuesD
 Please use python to solve this question!Change the function solve_DE provided

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 Databases Questions!