Is it posible to optimize kinetic parameter in following ordinary differential equation?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have temperature along reactor length in dependence of tubular reactor volume (experimental data).
I need to optimize kinetic parameters (k1, k2, k3, k4, k5, k6 and k7) in (-rA1), (-rA2) and (-rA3).
rA1 = ((k1*k2 * Ca * (Cb ^ k3)) / (1 +k2 * Ca)). In reaction kinetic (-rA2) and (-rA3) i need to optimize and k4, k5, k6 and k7.
I know U, a, Ta, Fa, Fc, Fb, Fe, Fd, Fe, -deltaHr1, -deltaHr2, -deltaHr3, cpA, cpB, cpC, cpD and cpE.
d(T)/d(V) = (((((U * a * (Ta - T) ))) + ((-rA1) * (-deltaHr1) + (-rA2) * (-deltaHr2) + (-rC3) * (-deltaHr3)))) / (FA * cpA + FB * cpB + FC * cpC + FD * cpD + FE * cpE)
First
I load data T=f(V)
Then I wrote function: function [dTdV] = dTdV(C) where C are kinetic parameters k1= C(1), k2=C(2) etc. in which I defined all known variables and wrote the equation dT / dV = ...
then i made script C=fminsearch(@dTdV,[0.1 0.1 0.1 0.001 0.12 0.20 0.01]);
and then I stucked.
Is it possible to solve this and in what way? Do I have to use Euler's method and how?
I tried to use Euler's method in the script, did I write well?
h=0.0001;
V=0:h:0.001177;
f=zeros(size(V));
T0=431.15;
f(1)=431.15;
n=numel(f);
for i=1:n-1
f=((U*a.......);
f(i+1)=f*h+f(i);
en
I got this error:
Index exceeds matrix dimensions.
Error in Script (line 64)
f(i+1)=f*h+f(i);
Thank You in advance.
댓글 수: 0
채택된 답변
Alan Weiss
2019년 4월 16일
I think that you would do better to use ode45 to solve your ODE, and use lsqcurvefit to optimize your parameters, as in this example.
But if you really want to do it your way, then I think the error is that you specify f instead of f(i) in this line:
f=((U*a.......);
% Should be
f(i) = ((U*a.......);
Alan Weiss
MATLAB mathematical toolbox documentation
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!