M,C and K into state space model
51 views (last 30 days)
Show older comments
After perform an FEM on a blisk I have extracted the M,C and K matrices respectively. I have tried expressing the matrices in a state space using
mechss
but it makes the system unstable. I want to write down the expression for A,B, C and D propelrly. There is how I want to express the matrice i extracted in state space.
I want to create an expression in which I can put the matrices E,A,B, C and D that represents the system.
>> load('K.mat') %1659x1659 sparse double
>> load('D.mat') %1659x1659 sparse double
>> load('M.mat') %1659x1659 sparse double
0 Comments
Answers (2)
Pavl M.
on 27 Nov 2024 at 13:34
Edited: Pavl M.
on 30 Nov 2024 at 12:02
Why sssMor ?
For what?
What are the rationale and motivations in doing so? What is the value in it?
E is an optional descriptor matrix. It is already incorporated in A-,B-,C-,D- comb matrices I provided before.
Not to undermine, not to insult You and me. I can amend, correct, re-adjust as per needed iff necessarily hire me.
Which is [eye(sz2) zeros(sz2);zeros(sz2) M] in the tailored code running scripts I provided so far.
I did model reduction before in Python with balanced. Please let me know what for the codes I can sell.
I do it Ethically correct.
Let's stabilize understanding. If you assume as you wrote E is an identity matrix than with full accord with your expressions my codes are correct. Of if E is not identity matrix then specify it explicitly in ss(....E) if mechss doesn't provide you stable system. I can attempt to damp your system and move poles to unit circle (LHP of real parts in continueous time) to make your system more stable with E matrix if you hire me (novelistic stabilization methode).
Where is your displacement and velocity F and G matrices?
Relevant documentation parts: sys = mechss(M,C,K,B,F,G,D,ts) uses the sample time ts to create a mechss object representing this discrete-time second-order mass-spring-damper model:
M q[k+2]+C q[k+1]+K q[k] = B u[k]y[k] = F q[k]+G q[k+1]+D u[k]
sys = mechss(M,C,K) creates a mechss model object with the following assumptions:
Identity matrices for B and F with the same size as mass matrix M
Matrices of zeros for G and D
If you want just A BCD model, then sparss built-in function is more relevant thatn mechss.
We can construct, validate, tune, adjust, analyze and implement literally any natural system if you contact me in private and hire. To further deep analyze the stability, you need close to critical damping, by hiring only the valued work will commence and continue. For instance the approach we develop can be used in real industry in magnetorheological vehicles suspension validations, design and contructions. From here just to hire is okay.
MorSSS is for simplification of dynamic modeling. The SOTA algorithms in it are SPARK, CIRKA. To futherAs I ruled before lawfully to continue ethically correct with rewards is needed.
What for the specific study of sssMOR toolbox?
You can take
clc
clear all
close all
%Load your M,K,D,B,C matrices
%load('discrmechssmodelmats.mat','M','C','K','B','F','G','D','ts');
%If this doesn't function:sys = mechss(M,C,K,B,F,G,D,ts)
%This may function
%Structural Dynamics 2nd order mass-spring-damper modeling:
ts = 0.001; %sampling time, for further realization/implementation
%of the system on real hardware good directive is right from the start
%to manage all systems and signals in discrete time equivalent.
sz1 = size(K)
sz2 = size(M)
sz3 = size(B)
E1 = eye(sz2,sz2) % or any other not unity if explicitly provided
Ec = [eye(sz2) zeros(sz2);zeros(sz2) M];
Ecinv = inv(Ec)
A = [zeros(sz1) eye(sz1);-K -D];
%or, depending on built-in matrix inversion algorithm accuracy
%Acomb = [zeros(sz1) eye(sz1);-K -D]/inv(Ec);
B = [zeros(sz3);B];
C = [C;0]
D = 0;
syssd = sys(A*inv(Ec),B/Ec,C/Ec,D/Ec,ts,'InputName','z','OutputName','y')
sys1 = sys(A,B,C,D,Ec,ts,'InputName','z','OutputName','y')
sys = sparss(A*Ecinv,B*Ecinv,C*Ecinv,D*Ecinv,E1,ts)
%if sssMOR toolbox is installed and in path, dsss is the function from it:
sys2 = dsss(A,B,C,D,Ec,ts)
sys3 = sss(sys1)
sys4 = dsss(syssd)
showStateInfo(sys4)
%ToDo: (idea for continuation)
%If you employ me to learn a goldmine and to prepare very narrow, specific fruitful study for a patent, course work, these, dissertation, Ph.D. or M.Sc. or postDoc research manuscript.
%sysNom = tf(sys);
%unc = ultidyn('unc',[1 1],'SampleStateDim',3); % samples of uncertain dynamics have three states
%usys = sysNom*(1 + 1*unc);
%usys2 = usys(sys)
% Set properties of usys
%usys.InputName = 'u';
%usys.OutputName = 'fs';
%C = diag(C)
%%CI = [1 2;0.1 0.4] %damping matrix
%for i=3:6
% sys = interface(sys,"Plate1",dofs{1,i},"Pillar"+i,dofs{i,1},'primal');
% sys = interface(sys,"Plate2",dofs{2,i},"Pillar"+i,dofs{i,2},'primal');
%end
%sysCon = interface(sys,C,IC,'dual')
%a = realp('a',10)
%gs =genss(sys)
%tss = tunableSS(sys)
%G = tf(sys)
%C0 = tunablePID('C','pi'); % tunable PI
%a = realp('a',1); % filter coefficient
%F0 = tf(a,[1 a]); % filter parameterized by a
%AP = AnalysisPoint('u');
%T0 = feedback(G*AP*C0,F0); % closed-loop transfer from r to y
%T0.InputName = 'r';
%T0.OutputName = 'y';
%Req1 = TuningGoal.Tracking('r','y',0.0005); % 0.5 msec rise time
%Req2 = TuningGoal.Margins('u',6,60); % 60 degree phase and 6dB gain margin
%rng('default')
%Options = systuneOptions('RandomStart',3);
%[T,fSoft] = systune(T0,[Req1,Req2],Options);
Accept my answer...
2 Comments
Pavl M.
on 30 Nov 2024 at 7:08
Edited: Pavl M.
on 30 Nov 2024 at 8:20
Why sssMor ?
For what?
What are the rationale and motivations in doing so? What is the value in it?
E is an optional descriptor matrix. It is already incorporated in A-,B-,C-,D- comb matrices I provided before.
Not to undermine, not to insult You and me. I can amend, correct, re-adjust as per needed iff necessarily hire me.
Which is [eye(sz2) zeros(sz2);zeros(sz2) M] in the tailored code running scripts I provided so far.
I did model reduction before in Python with balanced. Please let me know what for the codes I can sell.
I do it Ethically correct.
Let's stabilize understanding. If you assume as you wrote E is an identity matrix than with full accord with your expressions my codes are correct. Of if E is not identity matrix then specify it explicitly in ss(....E) if mechss doesn't provide you stable system. I can attempt to damp your system and move poles to unit circle (LHP of real parts in continueous time) to make your system more stable with E matrix if you hire me (novelistic stabilization methode).
Where is your displacement and velocity F and G matrices?
Relevant documentation parts: sys = mechss(M,C,K,B,F,G,D,ts) uses the sample time ts to create a mechss object representing this discrete-time second-order mass-spring-damper model:
M q[k+2]+C q[k+1]+K q[k] = B u[k]y[k] = F q[k]+G q[k+1]+D u[k]
If you want just A BCD model, then sparss built-in function is more relevant thatn mechss.
We can construct, validate, tune, adjust, analyze and implement literally any natural system if you contact me in private and hire. To further deep analyze the stability, you need close to critical damping, by hiring only the valued work will commence and continue. For instance the approach we develop can be used in real industry in magnetorheological vehicles suspension validations, design and contructions. From here just to hire is okay.
MorSSS is for simplification of dynamic modeling. The SOTA algorithms in it are SPARK, CIRKA. To futherAs I ruled before lawfully to continue ethically correct with rewards is needed.
What for the specific study of sssMOR toolbox?
You can take
clc
clear all
close all
%Load your M,K,D,B,C matrices
%load('discrmechssmodelmats.mat','M','C','K','B','F','G','D','ts');
%If this doesn't function:sys = mechss(M,C,K,B,F,G,D,ts)
%This may function
%Structural Dynamics 2nd order mass-spring-damper modeling:
ts = 0.001; %sampling time, for further realization/implementation
%of the system on real hardware good directive is right from the start
%to manage all systems and signals in discrete time equivalent.
sz1 = size(K)
sz2 = size(M)
sz3 = size(B)
E1 = eye(sz2,sz2) % or any other not unity if explicitly provided
Ec = [eye(sz2) zeros(sz2);zeros(sz2) M];
Ecinv = inv(Ec)
A = [zeros(sz1) eye(sz1);-K -D];
%or, depending on built-in matrix inversion algorithm accuracy
%Acomb = [zeros(sz1) eye(sz1);-K -D]/inv(Ec);
B = [zeros(sz3);B];
C = [C;0]
D = 0;
syssd = sys(A*inv(Ec),B/Ec,C/Ec,D/Ec,ts,'InputName','z','OutputName','y')
sys1 = sys(A,B,C,D,Ec,ts,'InputName','z','OutputName','y')
sys = sparss(A*Ecinv,B*Ecinv,C*Ecinv,D*Ecinv,E1,ts)
%if sssMOR toolbox is installed and in path, dsss is the function from it:
sys2 = dsss(A,B,C,D,Ec,ts)
sys3 = sss(sys1)
sys4 = dsss(syssd)
Please accept my answer at least.
Paul
on 27 Nov 2024 at 22:58
mechss doesn't work?
sys = mechss(M,D,K,B,F,[],[])
2 Comments
Paul
on 28 Nov 2024 at 16:01
Hard to say anything more without seeing the M,D,K that you're using. If you're willing, save those variables to a .mat file and upload it to your question or to a comment using the paperclip icon on the Insert portion of the ribbon.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!