w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Solving Non-linear System of 3 differentail equations(Lorenz equations) using ode solve: ode23s in Matlab

Your function is incorrect as far as I can see. This line:

xprime=[ alpha*I*(1-c) + c*(- k_f - k_d - k_n * s - k_p*(1-q));
lambda_b * c* P_C - lambda_r *(1-q)*s;   k_p * c *(P_C / P_Q)- gamma * q];

should be:

xprime=[ alpha*I*(1-x(1)) + x(1)*(- k_f - k_d - k_n * x(2) -
k_p*(1-x(3))); lambda_b * x(1)* P_C - lambda_r *(1-x(3))*x(2);   k_p * x(1)
*(P_C / P_Q)- gamma * x(3)];

You can then get rid of these lines in the function (initial conditions are passed via the call to ode15s):

%initial vectors

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.