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.

State Space Export

Please login with a confirmed email address before reporting spam

Hi ,
i have build a simple cantilever beam model using time depented model.
after defining the points of forces and parameters, i want to export the model to matlb (State Space Matrices) so i could "play" with the paramters and their location.
for example applying force at the tip = 100sin(theta(t)) and applying more forces to restrain the system.
i have searched the forum and found the mphstate function but i wasn't able to use it.

would like to get some help and tipps :)
(sorry for my poor english)

Regards, Eyal

7 Replies Last Post 13.09.2013, 08:45 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28.04.2013, 06:25 GMT-4
Hi , anyone might know ?
Hi , anyone might know ?

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.04.2013, 02:12 GMT-4
Hi

this is a delicate but very important subject, I'm very often needing this capability, but in reduced modal representation, so far I havent managed to get it working efficiently for "true models", a simple canteliever might work.

Check carefully the doc, do a search on "state space", you need to define a probe plot for the output, and define the state space export as a sub node to the solver case, with excitation in and probe out (I wounder now if it isnt rather in frequency domain you should try, rather than true transient)

--
Good luck
Ivar
Hi this is a delicate but very important subject, I'm very often needing this capability, but in reduced modal representation, so far I havent managed to get it working efficiently for "true models", a simple canteliever might work. Check carefully the doc, do a search on "state space", you need to define a probe plot for the output, and define the state space export as a sub node to the solver case, with excitation in and probe out (I wounder now if it isnt rather in frequency domain you should try, rather than true transient) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 01.05.2013, 04:23 GMT-4
Hi , thank you for your reply.

in my project i need to define several points to measure the deflection.
it means that i need to define several probs ?

i saw the help file on this problem and tried to work with it but i had several erros on matlab.

is it possible that you will help me with pasting the commands to import the model , adding the probs until i will get reduced matrices ?

thank you in advance for your help.
Hi , thank you for your reply. in my project i need to define several points to measure the deflection. it means that i need to define several probs ? i saw the help file on this problem and tried to work with it but i had several erros on matlab. is it possible that you will help me with pasting the commands to import the model , adding the probs until i will get reduced matrices ? thank you in advance for your help.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 01.05.2013, 06:43 GMT-4
Hi

have you repeated the example oh the help "state space export" for the heat_transient_axi example ?

--
Good luck
Ivar
Hi have you repeated the example oh the help "state space export" for the heat_transient_axi example ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.07.2013, 10:11 GMT-4
Dear Ivar,

I did repeat the example , but I've got the following problem:
The returned matrix MB is full of zeros so the solution obtained with ode23s is the zero solution. Hence the final y is the constant solution iqual to T0. Completely different from what it was expected.


I'm enclosing the example.

What do you think that might be wrong?

Dear Ivar, I did repeat the example , but I've got the following problem: The returned matrix MB is full of zeros so the solution obtained with ode23s is the zero solution. Hence the final y is the constant solution iqual to T0. Completely different from what it was expected. I'm enclosing the example. What do you think that might be wrong?


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 12.09.2013, 13:43 GMT-4
Dear all,
I finally came back to this question. I think that the comsol 4.3 tutorial doc example is not correct. Where there is:

M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D'},...
'input','T0', 'output', 'mod1.ppb1');

There should be:

M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D'},...
'input','Tinput', 'output', 'mod1.ppb1');

In fact the input parameter's name is Tinput and not T0.
Dear all, I finally came back to this question. I think that the comsol 4.3 tutorial doc example is not correct. Where there is: M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D'},... 'input','T0', 'output', 'mod1.ppb1'); There should be: M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D'},... 'input','Tinput', 'output', 'mod1.ppb1'); In fact the input parameter's name is Tinput and not T0.

Remi Magnard COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13.09.2013, 08:45 GMT-4
Dear Jorge,

There is indeed a typo in the LiveLink for MATLAB 4.3b documentation, one should read:

M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D' 'x0'},...
'input','Tinput', 'output', 'mod1.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:10:190], M.x0, opt);
y = M.C*x'+M.D*u+T0;

where T0 is the Temprature value around the linearization point.
Thank you for pointing this out!

Rémi Magnard
Dear Jorge, There is indeed a typo in the LiveLink for MATLAB 4.3b documentation, one should read: M = mphstate(model,'sol1','out',{'Mc' 'MA' 'MB' 'C' 'D' 'x0'},... 'input','Tinput', 'output', 'mod1.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:10:190], M.x0, opt); y = M.C*x'+M.D*u+T0; where T0 is the Temprature value around the linearization point. Thank you for pointing this out! Rémi Magnard

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.