1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
clear all
Ue=3.020E4
Ve=5.635E2
Se=1.433E1
Wsce=-1.25E1
Wscd=-6.511E0
Wso=-1.598E1
Ud=4.874E4
Vd=2.020E3
Sd=2.745E1
Sealcpx=3.094E1
Sealopx=3.074E1
Sdalcpx=-5.935E0
Sdalopx=-1.082E1
cacpx(1)=0.9
caopx(1)=0.03
alcpx(1)=0.03
alopx(1)=0.03
R=8.3146
tol=1e-6
P=1.5
T=1175
for i=2:10
F1=Ue+P*Ve-Se*T+R*T*log((1-cacpx(i-1))/(1-caopx(i-1)))-(cacpx(i-1))^2*T*Wsce-2*(cacpx(i-1))^2*(1-cacpx(i-1))*T*(Wscd-Wsce)-(caopx(i-1))^2*(-Wso*T);
F2=Ud+Vd*P-Sd*T+R*T*log(caopx(i-1)/cacpx(i-1))+(1-cacpx(i-1))^2*T*Wscd+2*(1-cacpx(i-1))^2*cacpx(i-1)*T*(Wsce-Wscd)+(1-caopx(i-1))^2*(-Wso*T);
F3= alcpx(i-1)*(-Sealcpx*T)-alopx(i-1)*(-Sealopx*T);
F4= -alcpx(i-1)*(-Sdalcpx*T)+alopx(i-1)*(-Sdalopx*T);
dF1_cacpx=(-R*T)/(1-cacpx(i-1))-2*cacpx(i-1)*T*Wsce-4*cacpx(i-1)*(1-cacpx(i-1))*T*(Wscd-Wsce)+2*(cacpx(i-1))^2*T*(Wscd-Wsce);
dF1_caopx=(R*T)/(1-caopx(i-1))-2*caopx(i-1)*(-Wso*T);
dF1_alcpx=0
dF1_alopx=0
dF3_alcpx=(-Sealcpx)*T;
dF3_alopx=Sealopx*T;
dF3_cacpx=0
dF3_caopx=0
dF2_cacpx=(-R*T)/cacpx(i-1)-2*(1-cacpx(i-1))*T*Wscd+4*(1-cacpx(i-1))*cacpx(i-1)*T*(Wsce-Wscd)-2*(1-cacpx(i-1))^2*T*(Wsce-Wscd);
dF2_caopx=(R*T)/caopx(i-1)-2*(1-caopx(i-1))*(-Wso*T);
dF2_alcpx=0
dF2_alopx=0
dF4_alcpx=Sdalcpx*T;
dF4_alopx=(-Sdalopx)*T;
dF4_cacpx=0
dF4_caopx=0
f=[F1,F2,F3,F4]
df=[dF1_cacpx,dF1_caopx,dF1_alcpx,dF1_alopx;dF2_cacpx,dF2_caopx,dF2_alcpx,dF2_alopx;dF3_cacpx,dF3_caopx,dF3_alcpx,dF3_alopx;dF4_cacpx,dF4_caopx,dF4_alcpx,dF4_alopx]
%dff=[dF1_cacpx,dF1_caopx,dF1_alcpx,dF1_alopx;dF2_cacpx,dF2_caopx,dF2_alcpx,dF2_alopx;dF3_cacpx,dF3_caopx,dF3_alcpx,dF3_alopx;dF4_cacpx,dF4_caopx,dF4_alcpx,dF4_alopx]
%J=inv([dF1_cacpx,dF1_caopx;dF1_alcpx,dF1_alopx;dF2_cacpx,dF2_caopx;dF2_alcpx,dF2_alopx]);
J=inv([dF1_cacpx,dF1_caopx,dF1_alcpx,dF1_alopx;dF2_cacpx,dF2_caopx,dF2_alcpx,dF2_alopx;dF3_cacpx,dF3_caopx,dF3_alcpx,dF3_alopx;dF4_cacpx,dF4_caopx,dF4_alcpx,dF4_alopx]);
% %les solutions
xy=[cacpx(i-1) caopx(i-1) alcpx(i-1) alopx(i-1)]'-J*[F1,F2,F3,F4]';
cacpx(i)=xy(1)
caopx(i)=xy(2)
alcpx(i)=xy(3)
alopx(i)=xy(4)
donnees=[cacpx;caopx;alcpx;alopx]'
end |
Partager