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.
Postprocessing Plotting Along an Arc?
Posted Feb 9, 2011, 1:20 a.m. EST Low-Frequency Electromagnetics Version 4.1 16 Replies
Please login with a confirmed email address before reporting spam
Is there a way to plot a postprocessing variable along an arc (for instance the circumference of a circle) instead of a straight line? When I go to cross section plot parameters, it asks me to specify cross-line data x0,x1,y0,y1. I don't see how to specify a non-straight line there.
Is there some way I can define "r" as being equal to sqrt(x^2+y^2) and "phi" as being equal to atan(y/x), and then plot as a function of phi at a specified value of r?
I am aware that I could add a circle to the geometry and then plot along the 4 boundaries of that circle, but I would prefer to plot using that method because it is a major pain (and I have a bunch of designs I need to do these plots for).
Thank you,
Kevin
Please login with a confirmed email address before reporting spam
I mostly draw the lines/circles ... that I want to use as "probe" lines and have them appearant as "interiour boundaris". But you can always define a new coordinate system and write out an equation using these, or the full equations too.
Try it out on a simple case
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
How would I "define a new coordinate system and write out an equation using these"? That is what I'm unsure how to do.
Thank you,
Kevin
Please login with a confirmed email address before reporting spam
Can you explain how would I "define a new coordinate system and write out an equation using these"? That is what I'm unsure how to do.
I know in the past I have added scalar expressions:
r = sqrt(x^2+y^2)
phi = atan2(y,x)
in order to define cylindrical coordinates.
Is there a way I can use these scalar expressions for plotting postprocessing data?
Thank you,
Kevin
Please login with a confirmed email address before reporting spam
You can certainly write them out like that, but you can also define in v4 a cylindrical coordinate system i.e. "sys2" or whatever name you choose and then you have access to sys2.r and sys2.phi, including in the post processing.
Unfortunately, today you can still not use any other than the Cartesian system fr the post processing, and not all physics accept directly the another reference system
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
i have had the same problem and therefore contacted comcol support, so I guess my example is helpful.
1st you need to define a so called 'parameterized curve 2d' (model->results->Data Sets->right mouse click).
You can define the length of your arc by typing corresponding minimum and maximum values for parameter (par) .
If the curve should be an arc following expression I suggest:
*Parameter*
Name: par
Minimum: 0
Maximum: pi
*Expression*
x: Radius*sin(par)+x_offset
y: Radius*cos(par)+y_offset
Result should be half of a circle around Point (x_offset/y_offset) related to origin of coord. system.
2nd you need to define a 1D plot group and a line graph in it.
In the line graph you need to define xpression for x and y data. Therefor you also use physical expression you want to plot and sin and cos functions in combination with parameter (par).
If this was to cryptic you can have a look at the attched file. It is axisymmetric model of an circular array af permanent magnets. The aim was to plot the radial flux density along the magnets in a certain distance from the constructive center (origin of coord. system).
Best regards
Oliver
Attachments:
Please login with a confirmed email address before reporting spam
What version of COMSOL is the attached file? I'm getting an error upon opening it. I suspect this may be because I only have version 3.5a, and you are using a more recent version.
Thanks,
Kevin
Please login with a confirmed email address before reporting spam
unfortunatelly for you I am only working with the latest version 4.1.
One year ago I began working with 3.5a, but several weeks later I already had 4.0 and so on...
I don't think there is a way to save the model in a combatible way, sorry.
Best regards
Oliver
Please login with a confirmed email address before reporting spam
I have also heard that v4 is not backward compatible.
We "users" are always in a difficult situation when such major releases are introduced, very few of the recent softwares I know about are backward "save" compatible, only forward compatibility is proposed.
Questions such as: when to switch? can we fully trust the new results ? what to do (whom can translate, we do not all have cheap students ;) with all scripts, methods and procedures of the older version? often we have quality documents that need to be updated or corrected, New training ? etc.
All these represent important real, but "hidden" costs for us that the software producers does not always know (or will know) about.
Anyhow, I can just say that with the current patched V4.1 I have no hesitation to stop fully to use V3.5a, even if I do not trust any direct translations, and I always reconstruct fully from scratch all models in the latest version (I do not even trust v4.0 to 4.1 translations). And the new features and environment is so powerfull, that it's hardly any time lost. My only negative point, I need to relearn the new matlab interface, but I must also admit that I have been using v4 for 1 year now, without any need for matlab ! That was not the case in 3.5
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
first I need to ask something: are a comsol employee or why are you moderator of this forum and answer almost any of the asked questions?
Concerning the introduction of version 4.0:
I was also concerned about the huge changes in GUI and everthing, but also looked forward for parameterized geometry, becaus I didnt wanted to use matlab at first. I also experienced a bug in V4.0 that caused wrong force calculation in AC/DC mode, with V4.a it was fixed and now I am almost happy with it. Aside the Fact i got issues with the matlab livelink evaluating expressen of a cutpoint. I also opened a threadabout that topic. But unfortunatelly you also have no experience with that livelink but with matlab scrip and V3.5a.
Do you know if it change dramastic with V4.0?
Sincerely
Oliver
Please login with a confirmed email address before reporting spam
No I'm NOT a Comsol employee, I'm a user as most of you others here, paying (actually my boos is) the software and the maintenance license each year as everyone else ;)
I spend some of my private time on the FORUM, initially to learn how to better use COMSOL by analysing the models and helping others, among other because when I started to use COMSOL, almost 4 years ago, I had nobody to exchange with, tough times for me ;)
Also, because as a physicist, I like to understand how others are approaching physics, and I'm training in this way my main activity: system engineer and project manager for complex projects, as well as a sort of internal consultant. I have (and am still) learning a lot by analysing the questions and trying to reply the best I can, but I might be wrong with my suggestions, you are warned.
I have also regularly send my suggestions to "support" so I have got a good relationship with our local COMSOL office and several of the developers, that is also my professional interest because often I need their help, and working on projects for many different companies I need ideally that my partners also use COMSOL rather than A or N ... to allow us to exchange efficiently.
COMSOL wants the forum to be driven by us the users, they have their own web site for them, so we are a few "users" here, like me, called moderators by COMSOL, so far my only Moderator task has been to report back to COMSOL about a few attempts to introduce advertisements or pointer to doubtful sites far from COMSOL occupations, so that the web master can clean things up
Furthermore, COMSOL is so great to visualize Physics that really I have become a "fan", if only I had had such a tool during my studies.
Finally I'm sorting some questions, as I do not have the acoustic, electro chemistry, earth sciences nor the plasma modules (even if I'm a Plasma physicist originally from my training)
Now, I do not want to take the place of others, pls do not hesitate to reply, or to show me that I'm wrong, or better that you have found a better/cleaner and faster way to solve something, as we are all interested to learn here.
Anyhow I have a few large projects coming, that will take over much of my time, it's true that I have a tendency to run for the 18h/day
Back to your comments, indeed there are a few typos in the equations in 4.0, among other a factor 2 in the external currents in MEF, a sign issue between Br and M etc, (all corrected in 4.1) this v4.0 was an early version.
For me, the first 2-3 revision of a major release are always considered as "beta" and I never use them for my professional tasks, but they are great (if not too frustrating) to learn a new approach.
At the COMSOL conference in Milano a couple of years ago, with the first presentation of v4, I got clearly the message that v4.0 was a "beta", and that the serious versions would be 4.1 and 4.2 with new features, and I'm eager to see the next release will bring.
But I'm sorry to hear some frustrated users that were using 4.0 for "serious work" and were not happy. COMSOL is one of the few software tool developers/sellers, that I have experienced, that clearly told how things are in a public way. That is also a good reason to go to their courses and to the Conference, to meet other users and the developers, it's absolutely worth the time and the costs
One thing, with V4 I have never needed to use Matlab, in contrary to 3.5 so far I have always found an easy way within the GUI's. I have one task now, that will require Matlab: the extraction of state space matrices, to give a reduced model to my control engineer colleague, some fun for the coming weeks. But I'm prepared, LiveLink v4 is quite different from the earlier versions, at least in the naming, probably not to much in the methodology
So, if anybody has some good examples of STATE SPACE model extractions, as well as eigenmode reduction, in v4 I'm interested to hear about it :)
--
Have fun COMSOLING
Ivar
Please login with a confirmed email address before reporting spam
Thanks for the tutorial about plotting along a circle. It works well. There is just a small error in your message :
*Expression*
x: Radius*sin(par)+x_offset
y: Radius*COS(par)+y_offset
Regards,
Jag
Please login with a confirmed email address before reporting spam
thanks for your hint. Of course you are right, must be a sin in x-direction and a cos in y-direction.
Post has been edited and corrected!
I am glad, that I could help with this tutorial.
Best regards
Oliver
Please login with a confirmed email address before reporting spam
nice example!
You evaluate for one exact radius...did you find a possibility to evaluate (let´s say an average) for a line for each radius?
I want to find out the average flux density for each radius and plot it as a 1D-diagram...
Ralf
Please login with a confirmed email address before reporting spam
calculating an average value for an arc with specific radius r is not that difficult.
After defining several arcs wiht different radius, right click on Data Sets and add following feature: Data Sets\ Evaluation\ Average.
In the Average Feature you have to select a Data Set. Choose one of the defined arcs (Parameterized Curve 2D x) and you are almoste done. You can evaluate the average values direct via 1D Plot or add a Point Evaluation (Derived Values) and plot values to a table.
Unfortunatelly there is no predefined plot for it. I wasn´t able to set the radius r as x-axis of the plot. So there is still something left for you to do, i guess ;). If you hav have MATLAB, I recommend postprocessing average values with it or alternatively with EXCEL...
Good luck and best regards
Oliver
Please login with a confirmed email address before reporting spam
I found the same solution.
One more trick: definition of only one parameterized curve with a global parameter as radius.
After evaluateing with one radius, you can change the parameter and click F5 (update solution). Then you can evaluate the next radius :-)
Not very elegant; maybe in V4.2 we can do something with polar coordinates.
Ralf
Please login with a confirmed email address before reporting spam
How did you solve the problem? I have the same problem now. I'm using 3.5. Thanks.
Kang
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.