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!