Hello Im am trying to solve 3 coupled ODE's, with the plot related to the reduction of NO by with ammoniasulphate.
The issiue is that the differential equation i wrote do not seems to be coupled. First the initial condition for NH3 is zero, but that makes the rate of change 0. If i change the NH3 to a very small value then the system still not respond well (deacreasing NO over time) as chaning the stouchemtic coiffcient x1 does not change the NO concentration...... see attched. Thanks.

댓글 수: 2

Could you please post your diff equations in order to read your code correctly?
Yes sorry, just posted the 3 ODE's as ZIP file.

댓글을 달려면 로그인하십시오.

 채택된 답변

darova
darova 2019년 10월 5일

1 개 추천

yprime and y are always connected
function [ yprime ] = calibration( t,y,par,par_cali,T,x1,O2)
Your input y were in wrong order. Try this
AS=y(1);
NH3=y(2);
NO=y(3);
Result
img1.png

댓글 수: 6

OR (maybe) because of this parameter
L=c+(h/4)+s+(n/2)-(o/2); % Unnamed factor, haha
The calling of the initial conditions in the function file are in the right order as the vector in script is y_cali=[y_NO_in*x y_in_AS*x y_in_NH3*x]?
L has nothing to do with the ODE calculations.
L has nothing to do with the ODE calculations.
It was a joke :)
I forgot about initial conditions. They need to be changed too
y_cali=[y_in_AS*x y_in_NH3*x y_NO_in*x]; % initial conditions
ode45 function finds a solution using iterations
(You don't see these operations)
y1(i+1) = y1(i) + yprime1(i)*dt; % simplified operations you don't see
y2(i+1) = y2(i) + yprime2(i)*dt;
%% - - -
Niels Normann Sørensen
Niels Normann Sørensen 2019년 10월 5일
편집: Niels Normann Sørensen 2019년 10월 5일
YOU ARE THE BEST!!!!
Thanks!!!
Niels Normann Sørensen
Niels Normann Sørensen 2019년 10월 5일
편집: Niels Normann Sørensen 2019년 10월 5일
I did not know that the order off the diff setup and intial conditions have to be the same.
Now the L comment is funny hahah!!
darova
darova 2019년 10월 5일
You are welcome =)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

릴리스

R2019b

태그

질문:

2019년 10월 4일

댓글:

2019년 10월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by