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.
stiffness matrix
Posted 13 set 2011, 04:49 GMT-4 LiveLink for MATLAB Version 5.2 8 Replies
Please login with a confirmed email address before reporting spam
maybe thats a stupid question. How can I see the stiffness matrix my solver is working with.
I know the matrix has a high dimension so I can't really look at it. But is it possible to see some "statistics", like symmetry, entries unequel 0 etc.?
I'm using Comsol 4.2
Thanks
Please login with a confirmed email address before reporting spam
You can get your stiffness Matrix as well as your Mass, Damping matrixes and also Load Vector from the livelink Matlab. Do not afraid to go and try the Livelink. It is really easy:
1) Run Your model in Comsol Gui.
2) Save it in Matlab File. It will save it as a .m file.(Under the file on your Comsol toolbar)
3) Open the Comsol with livelink in Matlab under Comsol in your Start Menu.
4) open the .m file you had saved before.
5) It is in function format. Remove the function in the first row of your Matlab Code.
6) Run the Matlab Code.
7) After the running was finished, go the command window and type:
MA=mphmatrix(model,'sol1','out',{'K','D','E','L'})
and run it. (K=Stiffness Matrix, D=Damping, E=Mass, L=Load)
8)Now you can get the information you want by typing:
MA.K or MA.E or ME.D or MA.L in the command window.
It is easy. Do not afraid to try it.
Hopefully it will be helpful,
Regards,
Masoud
Please login with a confirmed email address before reporting spam
thanks for your fast answer, but I don't have the livelink licence for matlab. Isn't there anyway to look at my sitffness matrix with default packages of Comsol?
Please login with a confirmed email address before reporting spam
I do not think you can have access to those information from COMSOL without having the Livelink. At least I dont know it. Sorry.
Masoud
Please login with a confirmed email address before reporting spam
I followed your suggesting untill the step 'RUN MATLAB CODE'. But when I typed 'MA=mphmatrix(model,'sol1','out',{'K','D','E','L'})' and ran it, there was an error as follows:
??? Error using ==> proputil at 9
A property/value list must contain an even number of elements.
Error in ==> D:\Program Files\MATLAB\R2009a\COMSOL40a\mli\mphmatrix.p>mphmatrix at 64
In addition, I have another question. There was not any error occured when I ran the M file before running the last code "MA=.....". Dose this mean my livelink Matlab work ?
Regards,
KAIPENG
Please login with a confirmed email address before reporting spam
Hi Gustav,
You can get your stiffness Matrix as well as your Mass, Damping matrixes and also Load Vector from the livelink Matlab. Do not afraid to go and try the Livelink. It is really easy:
1) Run Your model in Comsol Gui.
2) Save it in Matlab File. It will save it as a .m file.(Under the file on your Comsol toolbar)
3) Open the Comsol with livelink in Matlab under Comsol in your Start Menu.
4) open the .m file you had saved before.
5) It is in function format. Remove the function in the first row of your Matlab Code.
6) Run the Matlab Code.
7) After the running was finished, go the command window and type:
MA=mphmatrix(model,'sol1','out',{'K','D','E','L'})
and run it. (K=Stiffness Matrix, D=Damping, E=Mass, L=Load)
8)Now you can get the information you want by typing:
MA.K or MA.E or ME.D or MA.L in the command window.
It is easy. Do not afraid to try it.
Hopefully it will be helpful,
Regards,
Masoud
I have testify mphmatrix and mphstate. However, i find K D E is not the matrix i want to extract for the future computation. for example, Null*K*Null' doesn't equal to Kc. Which Kc is the eliminated Stiffness Matrix. There is a special vector named "uscale" could you express in details for me? Thanks very much.
Please login with a confirmed email address before reporting spam
Could anybody tell me if it is possible to modify the stiffness matrix (I need to add some terms) by using MatLab? I'm using LiveLink for MatLab, Comsol Multiphysics 5.2.
Thanks
Giulia
Please login with a confirmed email address before reporting spam
Hello,
Could anybody tell me if it is possible to modify the stiffness matrix (I need to add some terms) by using MatLab? I'm using LiveLink for MatLab, Comsol Multiphysics 5.2.
Thanks
Giulia
I am also interested in modifying the stiffness matrix and then re-running the model. How is this done?
Please login with a confirmed email address before reporting spam
First of all, Kc = Nullf'*K*Null (not Kc = Null*K*Null) even though it is often true that Nullf = Null.
I have found that if you construct the matrices NULLf and NULL using the following Matlab code this identity holds. Be sure you get 'Dc' if you are using damping. Here's a helpful link. www.comsol.com/blogs/implementing-the-weak-form-with-a-comsol-app/
MA = mphmatrix(model, 'sol1', 'out', {'K','Kc','Dc','Null','Nullf','uscale'})
NULL = [];
NULLf = [];
for ii = 1:length(MA.uscale)
NULL = [NULL; MA.uscale(ii)*MA.Null(ii,:)];
NULLf = [NULLf; MA.uscale(ii)*MA.Nullf(ii,:)];
end
Kc_comp5 = NULLf'*MA.K*NULL;
(NULLf'*MA.K*NULL - Kc)
max(max(NULLf'*MA.K*NULL - Kc))
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.
Suggested Content
- KNOWLEDGE BASE Matrix Has Zero on Diagonal
- FORUM mass and stiffness matrix
- BLOG Computing Stiffness of Linear Elastic Structures: Part 2
- KNOWLEDGE BASE Singular Matrix
- FORUM Updating the Stiffness Matrix