File mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_sm.m artifact 7b078c7c09 part of check-in a45d53f113


function [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar);
% [mtta,mttb,mttc,mttd] = ReactorTQ_sm(mttpar);
%System ReactorTQ, representation sm, language m;
%File ReactorTQ_sm.m;
%Generated by MTT on Thu Aug 24 14:47:46 BST 2000;
%
%====== Set up the global variables ======%
global ...
a ...
b ...
c ...
c_0 ...
c_a ...
c_b ...
c_p ...
e_1 ...
e_2 ...
e_3 ...
f_s ...
h ...
h_1 ...
h_2 ...
h_3 ...
k ...
k_1 ...
k_2 ...
k_3 ...
n ...
q ...
q_1 ...
q_2 ...
q_3 ...
q_s ...
rho ...
t_0 ...
t_s ...
v_r ...
x1 ...
x2 ...
x3 ;
a 	= mttpar(1);
b 	= mttpar(2);
c 	= mttpar(3);
c_0 	= mttpar(4);
c_a 	= mttpar(5);
c_b 	= mttpar(6);
c_p 	= mttpar(7);
e_1 	= mttpar(8);
e_2 	= mttpar(9);
e_3 	= mttpar(10);
f_s 	= mttpar(11);
h 	= mttpar(12);
h_1 	= mttpar(13);
h_2 	= mttpar(14);
h_3 	= mttpar(15);
k 	= mttpar(16);
k_1 	= mttpar(17);
k_2 	= mttpar(18);
k_3 	= mttpar(19);
n 	= mttpar(20);
q 	= mttpar(21);
q_1 	= mttpar(22);
q_2 	= mttpar(23);
q_3 	= mttpar(24);
q_s 	= mttpar(25);
rho 	= mttpar(26);
t_0 	= mttpar(27);
t_s 	= mttpar(28);
v_r 	= mttpar(29);
x1 	= mttpar(30);
x2 	= mttpar(31);
x3 	= mttpar(32);
%a matrix%
mtta = zeros(2,2);
mtt_t1 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3;
mtt_t1 = -sqrt((mtt_t1+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s));
mtta(1,1) = mtt_t1/abs(exp(q_1/t_s));
mtta(2,1) = k_1/exp(q_1/t_s);
mtta(2,2) = (-(exp(q_2/t_s)*f_s)-k_2)/exp(q_2/t_s);
%b matrix%
mttb = zeros(2,1);
mtt_t1 = exp((q_1+q_3)/t_s)*abs(exp(q_1/t_s))*f_s+2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*c_0*k_3;
mtt_t1 = mtt_t1+exp(q_3/t_s)*abs(exp(q_1/t_s))*k_1;
mtt_t3 = exp((q_1+q_3)/t_s);
mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3;
mtt_t1 = mtt_t1-(mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s)));
mttb(1) = mtt_t1/(2.0*exp(q_1/t_s)*abs(exp(q_1/t_s))*k_3);
mtt_t1 = exp((q_1+q_2+q_3)/t_s)*abs(exp(q_1/t_s))*f_s*k_1;
mtt_t3 = exp((q_1+q_2+q_3)/t_s);
mtt_t2 = exp((2.0*q_1+q_3)/t_s)*f_s^2+4.0*exp((2.0*q_1)/t_s)*c_0*f_s*k_3;
mtt_t3 = mtt_t3*sqrt((mtt_t2+2.0*exp((q_1+q_3)/t_s)*f_s*k_1+exp(q_3/t_s)*k_1^2)/exp(q_3/t_s));
mtt_t1 = mtt_t1+exp((q_2+q_3)/t_s)*abs(exp(q_1/t_s))*k_1^2-(mtt_t3*k_1);
mtt_t2 = 2.0*exp((2.0*q_1+q_2)/t_s)*abs(exp(q_1/t_s))*f_s*k_3;
mttb(2) = mtt_t1/(mtt_t2+2.0*exp((2.0*q_1)/t_s)*abs(exp(q_1/t_s))*k_2*k_3);
%c matrix%
mttc = zeros(1,2);
mttc(1,2) = 1.0;
%d matrix%
mttd = zeros(1,1);


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]