Function Global: X Which Maximizes The
Function Global: X Which Maximizes The
Function Global: X Which Maximizes The
Using MATLAB ode45 command, the differential equation is solved to determine the
constant temperature
function ds_dt=conv(val,s)
global T_op
ds_dt(1,1)=-1.335e10*s(1)*exp(-75000/(8.31*T_op));
ds_dt(2,1)=1.335e10*s(1)*exp(-75000/(8.31*T_op)) -
1.149e17*s(2)*exp(-125000/(8.31*T_op));
Consider the following MATLAB function for the value of x2 which maximizes the
amount of B.
function s2=final(T)
global T_op
T_op=T;
s_0=[0.7,0];
[val, s] = ode45('conv', [0 8], s_0 );
s2=-(s(length(s),2));
[T,negative_s2max]=fminsearch('final', T0)
T0 =
357.8385
Type final(357.8).
ans =
-0.3627
function ds_dt=conv2(val,s)
global a0 a1 a2 a3
T_op=a0+ a1*time_row + a2*time_row^2 + a3*time_row^3;
ds_dt(1,1)=-1.335e10*s(1)*exp(-75000/(8.31*T_op));
ds_dt(2,1)=1.335e10*s(1)*exp(-75000/(8.31*T_op)) -
1.149e17*s(2)*exp(-125000/(8.31*T_op));
Consider the MATLAB function for the value of x2 which maximizes the amount of B.
function s2b=final2(a)
global a0 a1 a2 a3
a0=a(1);a1=a(2);a2=a(3);a3=a(4);s_0=[0.7,0];
[val, s] = ode45('conv2',[0 8],s_0 );
s2b=-s(length(s),2);
T,negative_s2max]=fminsearch('final2', ao)
a0 =
372.78
a1 =
-10.44
a2
=2.0217
a3
=-0.1316
Type final2(372.78).
ans =
-0.3699
a0 372.78
a1 10.44
Thus, the values maximize the amount of B at x2 0.3699 .
a2 2.0217
a3 0.1316