Discussion ClosedThis 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.

Complex data

Please login with a confirmed email address before reporting spam

Hi,

For my analysis i am using matlab to postproces data from Comsol. However when collecting this data from Comsol by posteval, it only export real data. The imaginary part is discarded. What can i do to collect the imaginary part too?

thanks in advance,

AM

4 Replies Last Post 2009年10月9日 GMT+2 09:17
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 2009年10月5日 GMT+2 17:21
Hi

have you read through and understood the chapter on posteval in the command.pdf documentation file ?

there are a few comments about complex data, I suspect (havnt tried recently) that you must make two reads one for the phase=0 (real part) and one for phase=90° (complex part).

there is also the Complexfun variable, that I understand more for the resolution with complex functions, to ell the solver to consider complete complex values, not just the real part.

Goog luck
Ivar
Hi have you read through and understood the chapter on posteval in the command.pdf documentation file ? there are a few comments about complex data, I suspect (havnt tried recently) that you must make two reads one for the phase=0 (real part) and one for phase=90° (complex part). there is also the Complexfun variable, that I understand more for the resolution with complex functions, to ell the solver to consider complete complex values, not just the real part. Goog luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年10月6日 GMT+2 11:34
I dont think adding a phase of 90deg is the answer. I simply cant figure out what can export complex values.

Another problem in Matlab/Comsol is the following error i get:
>> fem.sol.u
??? Undefined function or method 'flgetarray' for input arguments of type 'int32'.

Error in ==> flexchprop>l_flgetmatrix at 53
vao = flgetarray(exch.getDim,exch.getAdr,exch.isReal);

Error in ==> flexchprop at 21
[varargout{1:nout}] = l_flgetmatrix(outprop, outstr);

Error in ==> femsol.subsref at 30
out(:,i)=flexchprop('flgetmatrix',prop,STR);

What can i do about that?

Thanks
I dont think adding a phase of 90deg is the answer. I simply cant figure out what can export complex values. Another problem in Matlab/Comsol is the following error i get: >> fem.sol.u ??? Undefined function or method 'flgetarray' for input arguments of type 'int32'. Error in ==> flexchprop>l_flgetmatrix at 53 vao = flgetarray(exch.getDim,exch.getAdr,exch.isReal); Error in ==> flexchprop at 21 [varargout{1:nout}] = l_flgetmatrix(outprop, outstr); Error in ==> femsol.subsref at 30 out(:,i)=flexchprop('flgetmatrix',prop,STR); What can i do about that? Thanks

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 2009年10月6日 GMT+2 13:38
Hi

I can do little with the cryptic error messages of COMSOL, the best is to get their help there.
The only I have noticed is that the "fl" introduction to function names stands for original "Femlab" code, and what is written below you had an "get-array" 'int32' cast error when attempting to access parts of "fem.sol.u".

Now concerning the phase, I might not fully understand what you are searching, but you can find how the "phase" is linked in here in COMSOL , i.e. in the smeug.pdf file (an excerb is attached below), or in the knowledgbase:

www.comsol.com/support/knowledgebase/878/
www.comsol.com/support/knowledgebase/1009/

these are more related to AC/DC but they also apply by similiriaty to structural

Good luck
Ivar
Hi I can do little with the cryptic error messages of COMSOL, the best is to get their help there. The only I have noticed is that the "fl" introduction to function names stands for original "Femlab" code, and what is written below you had an "get-array" 'int32' cast error when attempting to access parts of "fem.sol.u". Now concerning the phase, I might not fully understand what you are searching, but you can find how the "phase" is linked in here in COMSOL , i.e. in the smeug.pdf file (an excerb is attached below), or in the knowledgbase: http://www.comsol.com/support/knowledgebase/878/ http://www.comsol.com/support/knowledgebase/1009/ these are more related to AC/DC but they also apply by similiriaty to structural Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年10月9日 GMT+2 09:17
Apperently you were right about splitting the results in imaginary and real parts. This is my solution:
data= posteval(fem,'p','Solnum','all')
data2=posteval(fem,'imag(p)','Solnum', 'all')
Apperently you were right about splitting the results in imaginary and real parts. This is my solution: data= posteval(fem,'p','Solnum','all') data2=posteval(fem,'imag(p)','Solnum', 'all')

Note that while COMSOL employees may participate in the discussion forum, COMSOL®software users who are on-subscription should submit their questions via theSupport Centerfor a more comprehensive response from the Technical Support team.

Baidu
map