Why do I get an "odezero: an event disappeared (internal error)" error when using an ODE events function in MATLAB 7.4 (R2007a)?
19 次查看(过去 30 天)
显示 更早的评论
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);
采纳的回答
MathWorks Support Team
2009-6-27
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.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Generation and Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!