Can you solve this question? It is Euler method

11 ビュー (過去 30 日間)
Busra Tabak
Busra Tabak 2018 年 12 月 16 日
編集済み: madhan ravi 2018 年 12 月 16 日
The model of a nonisothermal batch reactor is given by
dC/dt= -exp(-10./(T+273)).* C;
dT/dt=1000*exp(-10./(T+273)).* C-10*(T-20);
T(0)=16 'C
C(0)=1 kmol/m^3
Find the concentration, C, and temperature, T, as a function of time. Plot the results.

採用された回答

madhan ravi
madhan ravi 2018 年 12 月 16 日
編集済み: madhan ravi 2018 年 12 月 16 日
Since it cannot be solved symbolically we convert it to numerical method:
syms T(t) C(t)
con1=T(0)==16 ;
con2=C(0)==1 ;
ode1=diff(C) == -exp(-10./(T+273)).* C;
ode2=diff(T) == 1000*exp(-10./(T+273)).* C-10*(T-20);
vars = [T(t) ; C(t)]
V = odeToVectorField([ode1,ode2])
M = matlabFunction(V,'vars', {'t','Y'})
interval = [0 5]; %time interval
y0 = [16 1]; %initial conditions
ySol = ode45(M,interval,y0);
tValues = linspace(interval(1),interval(2),1000);
yValues = deval(ySol,tValues,1); %number 1 denotes first solution likewise you can mention 2 solution
plot(tValues,yValues,'-o')
figure
yValues = deval(ySol,tValues,2);
plot(tValues,yValues,'-or')
Screen Shot 2018-12-16 at 3.47.37 PM.png
Screen Shot 2018-12-16 at 3.47.45 PM.png
  2 件のコメント
Busra Tabak
Busra Tabak 2018 年 12 月 16 日
perfect!!! thank you very much :))
madhan ravi
madhan ravi 2018 年 12 月 16 日
編集済み: madhan ravi 2018 年 12 月 16 日
Anytime :) , if it helped you make sure to accept the answer .

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by