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.

real and imaginary computations in comsol

Please login with a confirmed email address before reporting spam

Hello

I have been trying to run piezoelectric resonator and filter simulations in COMSOL for a while now. I am able to plot the Admittance curve. However when I use this for further calculations in the 'global expression section' COMSOL only takes the real value ignoring the complex part of the solution.

In case of confusion let me define my problem differently:

I have 4 solutions from the simulation which have both real and imaginary parts. The solution that I want is some arithmetic function of these 4. How can I do this by writing a Global expression? Is there any other way in COMSOL?

Currently, I am able to export both the real and imaginary part of the data by specifically plotting each (using either real or imag options) into a .txt
Using spreadsheet software I can do the complex number calcualtions that I need. But the process is painstakingly slow.

Anyone has an idea, about how to tackle this problem within comsol itself. In the worst case, can I write a matlab function which will automatically take the data every time I run the simulation and update the plot accordingly?


Thanks

Vikram Thakar






2 Replies Last Post 22 nov 2009, 14:12 GMT-5
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 21 nov 2009, 05:13 GMT-5
Hi
there are a few discussion about complex values out here i.e. see:

Error: 6199 Attempt to evaluate real square root of negative number for the most recent

but you will find many other by typing "complex" or "imaginary" in the search tab, this might well give sou some clues and interesting info.

Good luck
Ivar

Hi there are a few discussion about complex values out here i.e. see: Error: 6199 Attempt to evaluate real square root of negative number for the most recent but you will find many other by typing "complex" or "imaginary" in the search tab, this might well give sou some clues and interesting info. Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22 nov 2009, 14:12 GMT-5
Hello Ivar,

Thanks a lot for your help. I got the model to work.

Regards,

Vikram
Hello Ivar, Thanks a lot for your help. I got the model to work. Regards, Vikram

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.