Problem 42891. Differential equation and events

You have to solve the non-linear time variant differential equation:


with initial condition as input of the function


and return the time 'te' when 'y' crosses zero from the negatives values to the positive values.


tip: use the 'Events' option in odeset to detect the crossing, stop integration and get the time 'te'. See how to use it here :

Additional info:

  • in the test case, the solver ode45 is used, with options 'RelTol'=1e-8 and 'AbsTol'=1e-10.
  • because you don't know in advance the final time of the crossing, you can solve again further in time if no crossing is detected, starting from the point of the final time of previous integration.

Solution Stats

39.29% Correct | 60.71% Incorrect
Last Solution submitted on Jun 09, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers17

Suggested Problems

Community Treasure Hunt

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

Start Hunting!