Help with differential equations in matlab ?
Mostrar comentarios más antiguos
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 comentario
Helena Vesteg
el 6 de Jun. de 2021
Respuestas (1)
Sulaymon Eshkabilov
el 7 de Jun. de 2021
0 votos
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 comentarios
Helena Vesteg
el 7 de Jun. de 2021
Sulaymon Eshkabilov
el 7 de Jun. de 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
el 7 de Jun. de 2021
Helena Vesteg
el 7 de Jun. de 2021
Editada: Helena Vesteg
el 8 de Jun. de 2021
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!