Help with differential equations in matlab ?
古いコメントを表示
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 件)
Sulaymon Eshkabilov
2021 年 6 月 7 日
0 投票
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 件のコメント
Helena Vesteg
2021 年 6 月 7 日
Sulaymon Eshkabilov
2021 年 6 月 7 日
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
2021 年 6 月 7 日
Helena Vesteg
2021 年 6 月 7 日
編集済み: Helena Vesteg
2021 年 6 月 8 日
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!