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

Esubalewe Lakie Yedeg

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


2 Replies Last Post Sep 7, 2015, 9:47 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Sep 7, 2015, 9:46 a.m. EDT
Usually, I divide the weak form into two mph files.
Then Still export "stiff matrix" even if the weak form seems like

u*test(u) !

You can try this. I think mass matrix maybe only work well with "ut*test(u)"

--
Math Phd_ing
Usually, I divide the weak form into two mph files. Then Still export "stiff matrix" even if the weak form seems like u*test(u) ! You can try this. I think mass matrix maybe only work well with "ut*test(u)" -- Math Phd_ing

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Sep 7, 2015, 9:47 a.m. EDT
Usually, I divide the weak form into two mph files.
Then Still export "stiff matrix" even if the weak form seems like

u*test(u) !

You can try this. I think mass matrix maybe only work well with "ut*test(u)"

--
Math Phd_ing
Usually, I divide the weak form into two mph files. Then Still export "stiff matrix" even if the weak form seems like u*test(u) ! You can try this. I think mass matrix maybe only work well with "ut*test(u)" -- Math Phd_ing

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.