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.
Exporting matrices using Comsol Livelink to matlab
Posted 3 set 2015, 04:03 GMT-4 Interfacing, Geometry, Mesh, Results & Visualization, Structural Mechanics Version 5.0 2 Replies
Please login with a confirmed email address before reporting spam
Hi,
I am working with a wave propagation problem in weak form( as given in the attached file). I have implemented the weak form in COMSOL and I solved the problem. That is perfectly fine.
I want to export the associated matrices to MATLAB for further use.
I read the section "Working with Matrices" in the LiveLink for MATLAB User's guide and I am using the "mphmatrix" function to extract matrices.
I thought, according to the documentation, the command
MA = mphmatrix(model,'sol1','out',{'K','E'}); gives me stiffness matrix MA.K and mass matrix MA.E ( cooresponding to the first and second integral, respectively, in equation (2) of the attached file).
BUT I AM NOT SURE IF THAT IS TRUE. Because mass matrix MA.E is a zero matrix of size(MA.K) and the stiffness matrix is not symmetric.
Moreover, I am looking to export boundary matrices corresponding to the integral over inlet-outlet boundary $\Gamma_{\textrm{io}} $ and interface boundary $\Gamma_{I} $.
I am looking for an idea how to export matrices cooresponding to each integral.
Thank you in advance,
Esu
I am working with a wave propagation problem in weak form( as given in the attached file). I have implemented the weak form in COMSOL and I solved the problem. That is perfectly fine.
I want to export the associated matrices to MATLAB for further use.
I read the section "Working with Matrices" in the LiveLink for MATLAB User's guide and I am using the "mphmatrix" function to extract matrices.
I thought, according to the documentation, the command
MA = mphmatrix(model,'sol1','out',{'K','E'}); gives me stiffness matrix MA.K and mass matrix MA.E ( cooresponding to the first and second integral, respectively, in equation (2) of the attached file).
BUT I AM NOT SURE IF THAT IS TRUE. Because mass matrix MA.E is a zero matrix of size(MA.K) and the stiffness matrix is not symmetric.
Moreover, I am looking to export boundary matrices corresponding to the integral over inlet-outlet boundary $\Gamma_{\textrm{io}} $ and interface boundary $\Gamma_{I} $.
I am looking for an idea how to export matrices cooresponding to each integral.
Thank you in advance,
Esu
Attachments:
2 Replies Last Post 7 set 2015, 09:47 GMT-4