Home / Expert Answers / Computer Science / problem-1-solve-a-simple-ode-with-function-based-code-this-exercise-aims-to-solve-the-ode-problem-u-pa130

(Solved): Problem 1: Solve a simple ODE with function-based code This exercise aims to solve the ODE problem u ...



student submitted image, transcription available belowProblem 1: Solve a simple ODE with function-based code This exercise aims to solve the ODE problem u(t)-5u^(')(t)=0 with the initial condition u(0)=0.1 and for t in[0,20]. 2 a) Identify the mathematical function f(t,u) in the generic ODE form u^(')=f(t,u), and implement it as a Python function. b) Use the forward_euler function from Section 1.1 of the document Solving Ordinary Differential Equations in Python to compute a numerical solution of the ODE problem. Use a time step of Delta t=5. c) Plot together the numerical solution and the exact solution u(t)=0.1e^(0.2 t). d) Try successively smaller Delta t values and demonstrate visually that the numerical solution approaches the exact solution. Filename: simple_ODE_func.py Problem 2: Solve a simple ODE with.

I just need the solution for problem 2.

Problem 1: Solve a simple ODE with function-based code This exercise aims to solve the ODE problem with the initial condition and for . 2 a) Identify the mathematical function in the generic ODE form , and implement it as a Python function. b) Use the forward_euler function from Section 1.1 of the document Solving Ordinary Differential Equations in Python to compute a numerical solution of the ODE problem. Use a time step of . c) Plot together the numerical solution and the exact solution . d) Try successively smaller values and demonstrate visually that the numerical solution approaches the exact solution. Filename: simple_ODE_func.py Problem 2: Solve a simple ODE with class-based code Solve the same ODE problem as in Problem 1, but this time use the class ForwardEuler described in Section 1.4 of the document Solving Ordinary Differential Equations in Python, and implement the right-hand side function as a class. Filename: simple_ODE_class.py


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe