It's me again. The code is not working, I keep getting 0 as the answer for A, B, C, D, E, and F.
I need help with a material balance problem.
11 次查看(过去 30 天)
显示 更早的评论
FUNCTION:
function [A, B, C, D, E, F] = material_balance (Ao, Bo, Co, Do, Eo, Fo)
[A, B, C, D, E, F] = Ao+Bo+Co+Do+Eo+Fo
k21 =0.2;
k31 =0.1;
k32 =0.1;
k34 =0.1 ;
k54 =0.05;
k64 =0.2 ;
k12 =0.1 ;
k13 =0.05 ;
k23 =0.05;
k43 =0.2 ;
k45 =0.1;
k46 =0.2;
k65 =0.1;
k56 =0.1;
x = [ -(k21+k31) k12 k13 0 0 0
k31 k32 -(k13+k23+k43) k34 0 0
0 0 0 k54 -(k45-k65) k56
k21 -(k12+k32) k23 0 0 0
0 0 k43 -(k34+k54+k64) 0 k45
0 0 0 k64 k65 -(k46+k56)];
b = [0
0
0
0
0
0];
[A B C D E F]= inv(x)*b
SCRIPT:
clear, clc, close all
Ao =1.0;
Bo =0;
Co =0 ;
Do =0 ;
Eo =1.0;
Fo= 0;
[A, B, C, D, E, F] = material_balance (Ao, Bo, Co, Do, Eo, Fo)
Please Help!
5 个评论
Torsten
2019-2-21
You set the time derivatives to zero and solved
x*[A;B;C;D;E;F] = 0
But you are told to solve
x*[A;B;C;D;E;F] =[dA/dt;dB/dt;dC/dt;dD/dt;dE/dt;dF/dt].
Try an ODE integrator to do so, e.g. ODE15S.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!