MATLAB: Ode solver results not as expected

ode solver wrong results

Hello,
I am trying to solve differential equations numerically, but the results I obtain are not as expected. I should be able to plot an increasing exponential as a solution, but instead I get only a zero vector.
This is my differential equation:
dY/dt=(ßY^n)/(K^n+Y)^n)-αY
This is the script I am using:
%Plot of Simple Gene Regulation and NAR
clear all;
tspan = [0 100]; Y0 = 0; X0 = 0; beta = 8; alfa = 0.101; n = 4; k = 9; N = 1;
Yss = beta/alfa; %Xss = k*((beta/alfa)*k)^(1/(n+1)); Xss = k;
[t1,Y] = ode23(@(t,Y) (beta/(1+(k/Y)^N)-alfa*Y), tspan, Y0); %Simple Reg [t2,X] = ode45(@(t,X) (beta/(1+(X/k)^n)-alfa*X), tspan, X0); %NAR
%plot(t1,Y./Yss,t2,X./Xss); plot(t1,Y); grid on; title('Comparison between Simple Gene Regulation and NAR'); xlabel('Time t'); ylabel('Normalized Steady States'); %legend('Simple Regulation','NAR'); hold on;
The answers I get are good if I use simulink to calculate the solutions only:
I should be able to obtain the same plots by using the command line ode solvers, but there is something wrong I might be missing. Any help would be greatly appreciatted. Thank you very much.
Best regards,
Alejandro

Best Answer

It looks like expected:
dY/dt = (ß * Y^n) / (K^n + Y^n) - α * Y
If the initial value of Y is 0, the derivative is 0 also:
dY/dt = (ß * 0^n) / (K^n + 0^n) - α * 0
In consequence the trajectory remains at the 0 level.
The Y^n in the numerator is useful to avoid a division by 0.
Related Question