y(1)' = y(2);
y(2)' = [-y(1)-y(2)^2]/(y(1)+C0);
y(3)' = y(3)/y(4)*y(2)*C1;
y(4)' = y(2)*FF;
C0
, C1
, C2
and C3
are Const., FF
is C2*y(3)^0.5
if y(3) > 100
; FF
is C3*y(3)^0.5
if y(3)<=100
.
How to set y(4)'
in this situation?
I tried y(4)' = y(2)*((y(3) > 100)*C2*y(3)^0.5 + (y(3)<=100)*C3*y(3)^0.5);
It didn't work. Any suggestions?
Thank you in advance.
The equations above were simplified.
Well, after several tests with ode15s and other solvers, I realized that the matrix was close to singular. So the physical condition is the problem.