Help with differential equations in matlab ?
Show older comments
Hi , I need help with this excercise : I need to find k(speed constant ) if I know that
dx/dt=k*((a-x)^2) and I have this data :
t <min>=<0,2.5,5.6,9.6,14.6, 21.5,32.5,52.2> and
<a-x><mol/l>=<0.0050,0.0045, 0.0040, 0.0035, 0.0025,0.0020,0.0015>
I have a problem with solving an example in matlab.
<`**matlab-differential equations**`>
I´ve tried next steps:
Command W. :
t=[0 2.5 5.6 9.6 14.6 21.5 32.5 52.2];
x=[0:0.0005:0.0035];
a=0.0050;
c=a-x;
Editor ( my skript):
function dx=f(t,x)
dx=k*.((a-x).^2)
end + Run
Command W. :
tspan=0:0.0005:0.0035;
>> [x,t]=ode45(f,[0:0.0005:0.0035],0)
I don´t know how to find k
1 Comment
Helena Vesteg
on 6 Jun 2021
Answers (1)
Sulaymon Eshkabilov
on 7 Jun 2021
0 votes
You have confused your problem statement and its parameters. Also, there are a few errs.
(1) t=[0 2.5 5.6 9.6 14.6 21.5 32.5 52.2]; x=[0:0.0005:0.0035];
t can be set as a vector, e.g. t = linspace(0, 5, 200) or time range, e.g. t = [0, 5]
(2) Check the initial conditions, x(0) = ???. Because x(0) = 0 does not give any simulation results.
(3) check for k.
4 Comments
Helena Vesteg
on 7 Jun 2021
Sulaymon Eshkabilov
on 7 Jun 2021
No, don't think that way. We all make mistakes and learn. Learning is all about making mistakes and learn from them. Thus, try to solve it again. If you can't get it to run correctly, then you will be helped. Good luck.
Helena Vesteg
on 7 Jun 2021
Helena Vesteg
on 7 Jun 2021
Edited: Helena Vesteg
on 8 Jun 2021
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!