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.

Draw point graph for difference between two points

Please login with a confirmed email address before reporting spam

I have 2D time dependent simulation of cooling. I have created two "Cut Point 2D" in the Results/Data Sets. I can draw line graph for boths points using "1D Plot Group" and two "Point Graph" inside. The result graph is the change of temperature with time in boths points.

But I need to draw the difference of temperature in these two points as function of time. Any hints?


3 Replies Last Post 4 août 2020, 14:46 UTC−4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 4 août 2020, 13:15 UTC−4
Updated: 4 years ago 4 août 2020, 13:33 UTC−4

Hello Michal,

You could define nonlocal coupling operators of the integration type at the two points. By defult, they'll be called intop1 and intop2, and, assuming that your temperature field is called T then you can plot intop1(T)-intop2(T).

Note that you can get the operators to be evaluated without rerunning your simulation by using "Update solution" instead of Compute.

The attached file illustrates how to do this. It is saved in 5.5 - I don't have 5.3a on my machine anymore.

Best,

Jeff

-------------------
Jeff Hiller
Hello Michal, You could define nonlocal coupling operators of the integration type at the two points. By defult, they'll be called intop1 and intop2, and, assuming that your temperature field is called T then you can plot intop1(T)-intop2(T). Note that you can get the operators to be evaluated without rerunning your simulation by using "Update solution" instead of Compute. The attached file illustrates how to do this. It is saved in 5.5 - I don't have 5.3a on my machine anymore. Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 4 years ago 4 août 2020, 14:21 UTC−4
Updated: 4 years ago 4 août 2020, 14:23 UTC−4

Thank you for the fast hint, it works well. I took me while to test it because the "Update solution" was not enabled probably because I use Cluster Sweep.

I used Average instead of Integration. In the Point Graph I used expression "averop1(T)-averop2(T)". I do not know why, but I had to select some point in the Selection. It did not work without selection of some point. Any point can be selected; the result is always same.

Thank you for the fast hint, it works well. *I took me while to test it because the "Update solution" was not enabled probably because I use Cluster Sweep.* I used Average instead of Integration. In the Point Graph I used expression "averop1(T)-averop2(T)". I do not know why, but I had to select some point in the Selection. It did not work without selection of some point. Any point can be selected; the result is always same.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 4 août 2020, 14:46 UTC−4

Hi Michal,

Integrating or averaging on a single point is equivalent, it returns the value of the argument at that point, so indeed you can use either here.

I used a Global plot in my 1D Plot Group, whereas you used a Point Graph plot. That's why you had to pick a Selection and I didn't. Since your average operators make their outputs available everywhere, it does not matter which point you pick for your Selection, as you noticed. BTW, this makes me realize that you can get away with using a single operator if you use the Point Graph; in that case you'd plot T-intop1(T) by defining your operator at one point and your point graph at the other.

Best,

Jeff

-------------------
Jeff Hiller
Hi Michal, Integrating or averaging on a single point is equivalent, it returns the value of the argument at that point, so indeed you can use either here. I used a Global plot in my 1D Plot Group, whereas you used a Point Graph plot. That's why you had to pick a Selection and I didn't. Since your average operators make their outputs available everywhere, it does not matter which point you pick for your Selection, as you noticed. BTW, this makes me realize that you can get away with using a single operator if you use the Point Graph; in that case you'd plot T-intop1(T) by defining your operator at one point and your point graph at the other. Best, Jeff

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.