Differential equations I - MATLAB Cody - MATLAB Central

Problem 231. Differential equations I

Difficulty:Rate

Given a function handle f an initial condition y0 and a final time tf, solve numerically the differential equation

dy/dt = f(y)

for the function y(t) between t=0 and t=tf. Give as a result res=y(tf).

Example:

   f = @(x) -x;
   tf= 1;
   y0= 1;
 => y(tf) = 1/e = 0.367879441171442

Remarks: aim at a relative precision of around 1e-6. The function is analytic in the interval [0,1].

Solution Stats

20.8% Correct | 79.2% Incorrect
Last Solution submitted on May 11, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
7
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers147

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page