enaynad
Chemical
- May 19, 2004
- 6
Hi
I am new with Matlab and trying to solve this problem.
The problem is a mutli-reaction system of the form
dc1/dt=kc1+kc2
dc2/dt=kc2-kc3
... etc.
where k=reaction constant
Here is a code I wrote in Matlab:
function dc=bio(t,c)
T=298
E=13145 %constant
R=1.98 % constant
A=1.4e5 %constant
k=A*e^(-E/RT) %(note K is a function of T)
dc=[dc1;dc2]
Then I made another m.file
t=0
tf=20
initial=[1 0]
[t,c]=ode45(@bio,[t0 tf],initial);
So far everything is fine and the model works.
Now I like to change the T (over a wide range)and
run the model again. I tried a few things but none worked. Can someone please tell me how I can do that?
I am new with Matlab and trying to solve this problem.
The problem is a mutli-reaction system of the form
dc1/dt=kc1+kc2
dc2/dt=kc2-kc3
... etc.
where k=reaction constant
Here is a code I wrote in Matlab:
function dc=bio(t,c)
T=298
E=13145 %constant
R=1.98 % constant
A=1.4e5 %constant
k=A*e^(-E/RT) %(note K is a function of T)
dc=[dc1;dc2]
Then I made another m.file
t=0
tf=20
initial=[1 0]
[t,c]=ode45(@bio,[t0 tf],initial);
So far everything is fine and the model works.
Now I like to change the T (over a wide range)and
run the model again. I tried a few things but none worked. Can someone please tell me how I can do that?