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.

Where variables must be defined for later differentiation in postprocessing?

Please login with a confirmed email address before reporting spam

Hello.
I defined a PROJECTION COUPLING VARIABLE named magflux (magnetic flux) and I exported the values of this variable vs a range of z coordinate values successfully but, when I try to export the data of the derivative of magflux (my PROJECTION COUPLING VARIABLE) with respect to z, all the values I get are equal to zero.

I have tried doing
1. magfluxz
2. magflux,z
3.diff(magflux, z)
4.d(magflux, z)
5.pd (magflux, z)

and any of these worked out. I also tried to do, just to test, pd(normB_emqa,z) and all the values are zero.

Can somebody tell me what am I doing wrong?

By the way, is there a way to fix a polynomial to a set of data (x,f(x)) in COMSOL?

THANK YOU FOR YOUR HELP.

P.S. I am attaching 2 pictures of what I have done to make clearer my problem.


3 Replies Last Post 27 dic 2010, 06:02 GMT-5
Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 26 dic 2010, 08:22 GMT-5
Did you perform a solution step, or in particular, an ´update solution´ prior to examining the data ?
Did you perform a solution step, or in particular, an ´update solution´ prior to examining the data ?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 dic 2010, 05:46 GMT-5
Thank you for your answer:

I want to model the variation in time of the magnetic flux through a single loop, which is around a cylindrical permanent magnet.

I am working in ACDC 2D-Axisymmetric-Azimuthal Induction Currents Vector Potential.

1. Right now I am working in static analysis, so no time variables are being taking into account.


2. I needed the magnetic flux through the area perpendicular to the cylindrical permanent magnet, up to the outer border of the single coil loop, so I defined a PROJECTION COUPLING VARIABLE called magflux (magnetic flux) which is defined as

magflux: (Bz_emqa*2*pi*r)*((r>=0)&&(r<=7.25E-3)&&(z>=-21E-3)&&(z<=21E-3))

I did the integrations over r direction, and I made these results available in ALL DOMAINS. Then I exported these results and made a plot in excel of magflux vs z.


3.Now, I am trying to make a plot of d(magfux)/dz vs z (the first derivative of my variable magflux with respect to z) vs z. But I have tried everything and always, when I export the data, I get only zeros as the value of the first derivative.

I have tried writing
1. magfluxz
2. magflux,z
3.diff(magflux, z)
4.d(magflux, z)
5.pd (magflux, z)

I also tried defining a extrusion coupling variable name dmagflux, defined by d(magflux,z) and made it available in all the domains, but when in the EXPORT POSTPROCESSING DATA>SUBDOMAIN> EXPRESSION FIELD I write dmagflux when I export the data only zeros appear in the column of the derivative data, the same if I write there d(magflux,z), and also if I try to do it manually in the POSTPROCESSING>DATA DISPLAY>SUBDOMAIN field.


In the export postprocessing data I am selecting the solution corresponding to 0 seconds, because I am doing nothing with time at this moment so I think time has no effect on my problem, and if I don't do it in the exported data document appear lots of times and I only need the value vs z!



Can you please help me and tell me what am doing wrong?

Thank you, in advance, thank you very much!

P.D. By the way, is there a way in COMSOL for fitting curves? I mean, to get a polynomial which best represent the data I get from this?
Thank you for your answer: I want to model the variation in time of the magnetic flux through a single loop, which is around a cylindrical permanent magnet. I am working in ACDC 2D-Axisymmetric-Azimuthal Induction Currents Vector Potential. 1. Right now I am working in static analysis, so no time variables are being taking into account. 2. I needed the magnetic flux through the area perpendicular to the cylindrical permanent magnet, up to the outer border of the single coil loop, so I defined a PROJECTION COUPLING VARIABLE called magflux (magnetic flux) which is defined as magflux: (Bz_emqa*2*pi*r)*((r>=0)&&(r=-21E-3)&&(zSUBDOMAIN> EXPRESSION FIELD I write dmagflux when I export the data only zeros appear in the column of the derivative data, the same if I write there d(magflux,z), and also if I try to do it manually in the POSTPROCESSING>DATA DISPLAY>SUBDOMAIN field. In the export postprocessing data I am selecting the solution corresponding to 0 seconds, because I am doing nothing with time at this moment so I think time has no effect on my problem, and if I don't do it in the exported data document appear lots of times and I only need the value vs z! Can you please help me and tell me what am doing wrong? Thank you, in advance, thank you very much! P.D. By the way, is there a way in COMSOL for fitting curves? I mean, to get a polynomial which best represent the data I get from this?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27 dic 2010, 06:02 GMT-5
I forgot to tell you, I don't know if it is the same, but also clicked on SOLVE> UPDATE MODEL before exporting the data.
I forgot to tell you, I don't know if it is the same, but also clicked on SOLVE> UPDATE MODEL before exporting the data.

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.