Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Eample of Extracting State-Space Matrices in User manual

Please login with a confirmed email address before reporting spam

Dear All,

There is an example of Extracting State-Space Matrices in LiveLink™ for MATLAB® User’s Guide (on Page 185). The input is one, i.e., u=1. Why?

Xiang

The code:
model = mphopen('heat_transient_axi');
model.param.set('Tinput','1000[degC]');
model.physics('ht').feature('temp1').set('T0', 1, 'Tinput');
pdom1 = model.probe.create('pdom1', 'DomainPoint');
pdom1.model('comp1');
pdom1.setIndex('coords2','0.2',0,0);
pdom1.setIndex('coords2','0.3',0,1);
time = model.study('std1').feature('time');
time.set('tlist','range(0,50,2e3)');
M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D' 'x0'},...
'input','Tinput', 'output', 'comp1.ppb1');
u = 1;
T0= 1273.15;
opt = odeset('mass', M.Mc);
func = @(t,x) M.MA*x + M.MB*u;
[t,x] = ode23s(func, [0:50:2e3], M.x0, opt);
y = M.C*x'+M.D*u+T0;
plot(t,y)
hold on
Tnum = mphinterp(model,'T','coord',[0.2;0.3],'t',t);
plot(t,Tnum,'r+')

0 Replies Last Post 23.05.2016, 23:26 GMT-4
COMSOL Moderator

Hello H.J. Xiang

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.