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.

Problems plotting a difference temperature between two points on model surface

Please login with a confirmed email address before reporting spam

Hello Community,

I have a problem plotting a difference temperature over the time. I created and successfully solved a 2D model with the Heat Transfer module and want to have the difference temperature between two points (located on the models surface) over the time. I'm only able to plot both temperatures for themselves in one chart, export the ASCII data and create the difference in excel. I hope there is a way to do this directly in COMSOL.

It would be great if anyone could give me a hint to solve my problem.

Thank you in advance

8 Replies Last Post 19 giu 2017, 21:03 GMT-4
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 29 gen 2010, 02:42 GMT-5
Hi

Well if your points are fixed (geometrical points), then why not define an "Integration Coupling Variable - Point Variable" of T1 on the first one and a T2 defined for the second point.

Perform an "Update Model" to get the "fem" structure updated with exisiting results and

Then try a "Postprocessing - Global plot" or a "Postprocessing - Point Evaluation" anywhere of T2-T1.

You can alo make an average AT1 = integration of T over an edge/boundary and divide by the integration of "1" for the length/area, you can get the stadard deviation (integrate T^2 and average over area) etc

Many things can be done with the integration tab, its worth to study them in detail

Good luck
Ivar
Hi Well if your points are fixed (geometrical points), then why not define an "Integration Coupling Variable - Point Variable" of T1 on the first one and a T2 defined for the second point. Perform an "Update Model" to get the "fem" structure updated with exisiting results and Then try a "Postprocessing - Global plot" or a "Postprocessing - Point Evaluation" anywhere of T2-T1. You can alo make an average AT1 = integration of T over an edge/boundary and divide by the integration of "1" for the length/area, you can get the stadard deviation (integrate T^2 and average over area) etc Many things can be done with the integration tab, its worth to study them in detail Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 gen 2010, 03:43 GMT-5
Hello,

thank you Ivar!

your idea of defining integration coupling variables works fine. Now I'm able to plot the T1-T2 process.

Is there a possibility to add another y-axis to the chart? One y-axis for the T1-T2 process, another one for T1 and T2?
Hello, thank you Ivar! your idea of defining integration coupling variables works fine. Now I'm able to plot the T1-T2 process. Is there a possibility to add another y-axis to the chart? One y-axis for the T1-T2 process, another one for T1 and T2?

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 29 gen 2010, 05:17 GMT-5
Hi

I believe not but you can "keep" a plot and overlay several ones, as you can change the "expression" for the "X-axis". You have to play a little (and start over each time in <=V3.5a, better to come in V4) with the different tab's, basically you can do (almost) everything.

Still sometimes matlab is easier for complex plots, specially to rerun them

Good Luck
Ivar
Hi I believe not but you can "keep" a plot and overlay several ones, as you can change the "expression" for the "X-axis". You have to play a little (and start over each time in

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 feb 2010, 09:06 GMT-5
Hello,

I successfully created a figure plot of the temperature time process in Matlab. I'm now able to generate a M-File and to edit it (for example to insert a second y-axis).

The originally M-File of the difference temperature plot is as followed:

-------------------------------------------------------------------------------------------------------------------------
function createfigure(XData1, YData1)
%CREATEFIGURE(XDATA1,YDATA1)
% XDATA1: line xdata
% YDATA1: line ydata

% Auto-generated by MATLAB on 02-Feb-2010 14:57:19

% Create figure
figure1 = figure('Renderer','zbuffer','PaperSize',[20.98 29.68]);

% Create axes
axes1 = axes('Parent',figure1);
grid('on');

% Create line
line(XData1,YData1,'Parent',axes1,'Color',[0 0 1]);

% Create xlabel
xlabel('Zeit','Interpreter','none');

% Create ylabel
ylabel('Tw-Tk','Interpreter','none');

% Create title
title('Tw-Tk','Interpreter','none');

---------------------------------------------------------------------------------------------------------------------------

After editing, saving and reopening the M-File Matlab replies:

??? Input argument "XData1" is undefined.

The same problem also appears without editing the M-File. After generating the M-File, saving and reopening Matlab isn't able to find the X and Y Data (XData1,YData1).

Anyone who could give me a hint how to edit the M-File properly or where to find these X and Y data?
Hello, I successfully created a figure plot of the temperature time process in Matlab. I'm now able to generate a M-File and to edit it (for example to insert a second y-axis). The originally M-File of the difference temperature plot is as followed: ------------------------------------------------------------------------------------------------------------------------- function createfigure(XData1, YData1) %CREATEFIGURE(XDATA1,YDATA1) % XDATA1: line xdata % YDATA1: line ydata % Auto-generated by MATLAB on 02-Feb-2010 14:57:19 % Create figure figure1 = figure('Renderer','zbuffer','PaperSize',[20.98 29.68]); % Create axes axes1 = axes('Parent',figure1); grid('on'); % Create line line(XData1,YData1,'Parent',axes1,'Color',[0 0 1]); % Create xlabel xlabel('Zeit','Interpreter','none'); % Create ylabel ylabel('Tw-Tk','Interpreter','none'); % Create title title('Tw-Tk','Interpreter','none'); --------------------------------------------------------------------------------------------------------------------------- After editing, saving and reopening the M-File Matlab replies: ??? Input argument "XData1" is undefined. The same problem also appears without editing the M-File. After generating the M-File, saving and reopening Matlab isn't able to find the X and Y Data (XData1,YData1). Anyone who could give me a hint how to edit the M-File properly or where to find these X and Y data?

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 3 feb 2010, 02:14 GMT-5
Hi

If I understand you well your matlab code was generated by the COMSOL GUI ?

and I read therein the content of a graph generation based on the data XData1 and YData1.

Then these arrays must be first loaded/populated from the plot data saved at a matlab or txt file, or regenerated by some other way by you, no ?

good luck
Ivar
Hi If I understand you well your matlab code was generated by the COMSOL GUI ? and I read therein the content of a graph generation based on the data XData1 and YData1. Then these arrays must be first loaded/populated from the plot data saved at a matlab or txt file, or regenerated by some other way by you, no ? good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 25 gen 2016, 18:01 GMT-5
Hi Ivar,
How can we plot delta T (temperature) for a time dependent model?

Thanks
Hi Ivar, How can we plot delta T (temperature) for a time dependent model? Thanks

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 26 gen 2016, 05:23 GMT-5
Hi,

In general, you can use the "at" operator to access a solution at another time than the one you have selected for the evaluation or plotting. For example, using an expression like

T-at(20,T)

you get the difference between the temperature at the currently selected time and the temperature at t = 20 s in a time-dependent thermal simulation. You can use any time within the simulation's time span; if that time is not one of the times in the solution data (the selected output times), the "at" operator uses interpolation to provide the data.

You can also use a Join data set to form a difference between two solutions at difference times, which you can then evaluate and plot like any other solution data.

To plot the temperature between two points in a 2D model, use a Cut Line 2D data set. You can then use the "at" operator or a Join data set with the Cut Line 2D data as the input.

Best regards,
Magnus Ringh, COMSOL
Hi, In general, you can use the "at" operator to access a solution at another time than the one you have selected for the evaluation or plotting. For example, using an expression like T-at(20,T) you get the difference between the temperature at the currently selected time and the temperature at t = 20 s in a time-dependent thermal simulation. You can use any time within the simulation's time span; if that time is not one of the times in the solution data (the selected output times), the "at" operator uses interpolation to provide the data. You can also use a Join data set to form a difference between two solutions at difference times, which you can then evaluate and plot like any other solution data. To plot the temperature between two points in a 2D model, use a Cut Line 2D data set. You can then use the "at" operator or a Join data set with the Cut Line 2D data as the input. Best regards, Magnus Ringh, COMSOL

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 19 giu 2017, 21:03 GMT-4
Hello Community,

I have a problem plotting a difference temperature over the time. I created and successfully solved a 2D model with the PDE Interface and want to have the difference temperature (∆T=T_(mean max)-T_(mean min))(located on the models surface) over the time. . I hope there is a way to do this in COMSOL.
Thank you in advance
Hello Community, I have a problem plotting a difference temperature over the time. I created and successfully solved a 2D model with the PDE Interface and want to have the difference temperature (∆T=T_(mean max)-T_(mean min))(located on the models surface) over the time. . I hope there is a way to do this in COMSOL. Thank you in advance

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.