Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Eigenfrequency / Lambda with Matlab LiveLink

Please login with a confirmed email address before reporting spam

Hey there,

I've got a question about the new LiveLink to Matlab. I made an eigenfrequency analysis and want to use the solution (either the eigenfrequencies or the lambdas) in Matlab. With Comsol 3.5 and the Matlab interface you could easily acces the lambdas bei typing

"fem.sol.lambda"

and you got your list.
Now it seems not to be as easy anymore. I managed to find a list of the eigenfrequencies in a java.lang.String[] format bei typing the following :

"model.result.dataset('dset1').getSolEigenfreqTransform(1)"

I have to say, that it doesn't matter what number you type in as argument, you can type whatever you want and will get the same output.

Does anyone know how to acces a normal list of eigenfrequencies with this new version?

Kind regards,

Stephan

3 Replies Last Post 29.04.2011, 08:07 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.02.2011, 09:33 GMT-5
And is it possible, that mphinterp() from Comsol 4.1 is at least a factor 100 slower than postinterp() from Comsol 3.5x? Or is there another function to interpolate the data properly?

Kind regards
And is it possible, that mphinterp() from Comsol 4.1 is at least a factor 100 slower than postinterp() from Comsol 3.5x? Or is there another function to interpolate the data properly? Kind regards

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.04.2011, 08:00 GMT-4
Hi Stephan,
I have done it that way:
I have used the mphglobal function to extract the eigenvalue. However, for some unknown reasons, this functions seems to only return the real part of the solution. Therefore, I had to make it in 2 steps.

I first extract the imaginary part of the eigenvalue (it actually corresponds to the undamped eigenfrequencies) and then the real part.

lambda_Imag = mphglobal(model,'imag(lambda)','dataset','dset3','outersolnum',1);
lambda_Real = mphglobal(model,'real(lambda)','dataset',dset3,'outersolnum',1);

You can then reconstruct the eigenvalues. Instead of lambda, you can also use the variable solid.freq which already transformed the eigenvalue in the frequency domain (solid.freq= -lambda/2/pi/i). Here again the results might be complex and the function mphglobal will only return its real parts... grrrrr.

I have also noticed that several functions of the new live link seem to be much slower than in the version 3.5a.

P.S. In my model, I also used a parametric solver, which explains the parameter 'outersolnum'. If you're not, I guess you can drop it.

Regards
Hi Stephan, I have done it that way: I have used the mphglobal function to extract the eigenvalue. However, for some unknown reasons, this functions seems to only return the real part of the solution. Therefore, I had to make it in 2 steps. I first extract the imaginary part of the eigenvalue (it actually corresponds to the undamped eigenfrequencies) and then the real part. lambda_Imag = mphglobal(model,'imag(lambda)','dataset','dset3','outersolnum',1); lambda_Real = mphglobal(model,'real(lambda)','dataset',dset3,'outersolnum',1); You can then reconstruct the eigenvalues. Instead of lambda, you can also use the variable solid.freq which already transformed the eigenvalue in the frequency domain (solid.freq= -lambda/2/pi/i). Here again the results might be complex and the function mphglobal will only return its real parts... grrrrr. I have also noticed that several functions of the new live link seem to be much slower than in the version 3.5a. P.S. In my model, I also used a parametric solver, which explains the parameter 'outersolnum'. If you're not, I guess you can drop it. Regards

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.2011, 08:07 GMT-4
Hi

I believe it's feature, at least in 3.5 we had always to extract to matlab the real and imaginary parts separately.
This has probably remained so in V4 too

--
Good luck
Ivar
Hi I believe it's feature, at least in 3.5 we had always to extract to matlab the real and imaginary parts separately. This has probably remained so in V4 too -- Good luck Ivar

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.