Solving Multiple First Order Differential Equations for Constants
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시

Hi,
I hope someone can help me.
I am looking to solve these 6 first order differential equations for the unknowns k1, k2, k3, k4, k5 and k6, with known concentrations in the square brackets (any number for them will do just now to get a working script!). Could someone help me obtain a script to do this?
Many thanks in advance.
채택된 답변
Torsten
2019년 2월 15일
Replace the time derivatives by difference quotients.
Then you get a linear system of equations
A*[k1;k2;k3;k4;k5;k6] = b
where the number of rows in A is equal to (6*number of measurement times).
This can subsequently be solved using
k = A\b.
Best wishes
Torsten.
댓글 수: 8
Thank you very much!
I am still slightly confused though. Is there any chance you could type out some of the script? I think that would help me understand a lot better.
Thanks again
Which data from measurements do you have ?
I know all the values in moles or mass for the quantities in the square brackets, eg. [MeOH] = 1.412 moles.
Thanks again so much
Ok. Then for [TG], e.g., you can use the equations
[TG]_(i+1) - [TG]_(i) = dt * (-k1*[TG]_(i+1)*[MeOH]_(i+1) + k2*[DG]_(i+1)*[ME]_(i+1))
for i=1,2,...,N.
Same for the other components.
You see that you get a linear system of equations in the unknowns k1,k2,...,k6, as stated above.
This can be solved using the mldivide - operator.
Slowly but surely I think I am getting somewhere! (Sorry I am inexperienced with Matlab and trying to improve).
Can you identify the errors that I still have? Am I solving for k in the command window correctly? All of the equations for 'TG(i+1) - TG(i)' etc are in correctly but there are errors around the equals signs saying 'Parse error at '=': usage might be invalid MATLAB syntax'.

To get approximate values for k1,...,k6, you need measurement data for the concentrations [TG], [DG],,...,[MeOH] at different times t1,...,tn, not only at t=0. Do you have such data ?
Yes, I have concentration data at the end of the reaction (t=60 mins/3600s) and also at two intermediate times (t = 2 mins/120s and t = 12 mins/720s). Should I state all of these values at the top of the script like I did for the values at t=0? Should the script then run or do additional changes need to be made in its layout?
Thanks again!
Since your data are taken at times with such a great temporal distance, you should try the method described here:
Best wishes
Torsten.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
