Having a problem with the ODE solver working what should I change?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
In this program I have three state variables that I am trying to graph using ODE's. The code seems fine, but for some reason the ODE solver is not working. How should I change it?
function Sonichedgehog_driver
[t,y] = ode45(@Sonichedgehog, [0 24], [3.1 21.2 .44]);
dx_1 = y(:,1);
dx_2 = y(:,2);
dx_3 = y(:,3);
plot(t, dx_1, 'g', t, dx_2, 'b', t, dx_3, 'r');
legend({'Ptc1', 'Gli1', 'Gli2'});
function dy = Sonichedgehog(t, y)
alpha1=1.78;
alpha2=.14;
alpha3=19.77;
alpha4=24.8;
alpha5=13.25;
beta1=.2;
beta2=.03;
beta3=6.88;
beta4=1.33;
beta5=24.92
%X1 = 3.1;
%X2 = 21.2;
%X3 = 0.44;
X4 = 0.17;
X5 = 1.1;
X6=0;
X1 = y(1);
X2 = y(2);
X3 = y(3);
dx_1= (alpha1(X2+1)^(.1))*((X3+1)^(.92))*((X4+1)^(.7))*((X5+1)^(-.35))- beta1*((X1+1)^(.64))*(X6+1);
dx_2= (alpha2(X2+1)^(.83))*((X3+1)^(7.4))*((X4+1)^(5.6))*((X5+1)^(-2.8))- beta2*((X2+1)^(1.86));
dx_3= alpha3-beta3*((X1+1)^(.07))*((X3+1)^(2.6));
dy = [dx_1; dx_2; dx_3];
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!