Why do I get an "odezero: an event disappeared (internal error)" error when using an ODE events function in MATLAB 7.4 (R2007a)?

16 vues (au cours des 30 derniers jours)
I am trying to use an events function to in my ODE function. However, when I run the attached file 'ode_events_error.m' I am getting the following error message:
??? Error using ==> funfun\private\odezero at 50
odezero: an event disappeared (internal error)
Error in ==> ode45 at 419
[te,ye,ie,valt,stop] = ...
Error in ==> mycode at 10
[r,state,re,statee,ie] = ode45(@(r,state)prbode(r,state,tauc),rspan,stateinit,options);

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 2009
This is a zero-crossing events error. The events locator is incapable of capturing a zero crossing for complex signals.
You can see this by adding the following code to the 'events' subfunction in 'ODE_events_error.m'function:
if ~isreal(state(2))
error('Imaginary Events signal (%g +i%g) at r=%.16f.',real(state(2)),imag(state(2)),r)
end
You will see that during the simulation the value state(2) becomes complex, and the following error message is returned:
??? Error using ==> mycode>events at 37
Imaginary Events signal (4.02767e-009 +i7.46735e-027) at r=2.7392559940601449.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2007a

Community Treasure Hunt

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

Start Hunting!

Translated by