How to display temperature at location x,y in command window for 2D heat transfer
Below is code that produces the steady state temperature field in a square with consatnt temperature bounday conditions. I want to add code that would define the temperature at any location x,y of interest and display it in the command window. For example, what is the temperature at x= -10, y= 0?
thermalmodel = createpde("thermal","steadystate");
R2= [3,4,-15,15,15,-15,-15,-15,15,15]’;
geom=[R2]
g=decsg(geom)
model= createpde
geometryFromEdges(thermalmodel,g);
pdegplot(thermalmodel,"EdgeLabels","on")
xlim([-20 20])
axis equal
thermalProperties(thermalmodel,"ThermalConductivity",1);
thermalBC(thermalmodel,"Edge",1,"Temperature",100);
thermalBC(thermalmodel,"Edge",2,"Temperature",100);
thermalBC(thermalmodel,"Edge",3,"Temperature",100);
thermalBC(thermalmodel,"Edge",4,"Temperature",400);
generateMesh(thermalmodel);
figure
pdemesh(thermalmodel)
title("Mesh with Quadratic Triangular Elements")
thermalresults = solve(thermalmodel)
pdeplot(thermalresults.Mesh,XYData=thermalresults.Temperature,ColorMap="jet")
title("Temperature In The Plate, Steady State Solution")
xlabel("X-coordinate, meters")
ylabel("Y-coordinate, meters")
axis equalBelow is code that produces the steady state temperature field in a square with consatnt temperature bounday conditions. I want to add code that would define the temperature at any location x,y of interest and display it in the command window. For example, what is the temperature at x= -10, y= 0?
thermalmodel = createpde("thermal","steadystate");
R2= [3,4,-15,15,15,-15,-15,-15,15,15]’;
geom=[R2]
g=decsg(geom)
model= createpde
geometryFromEdges(thermalmodel,g);
pdegplot(thermalmodel,"EdgeLabels","on")
xlim([-20 20])
axis equal
thermalProperties(thermalmodel,"ThermalConductivity",1);
thermalBC(thermalmodel,"Edge",1,"Temperature",100);
thermalBC(thermalmodel,"Edge",2,"Temperature",100);
thermalBC(thermalmodel,"Edge",3,"Temperature",100);
thermalBC(thermalmodel,"Edge",4,"Temperature",400);
generateMesh(thermalmodel);
figure
pdemesh(thermalmodel)
title("Mesh with Quadratic Triangular Elements")
thermalresults = solve(thermalmodel)
pdeplot(thermalresults.Mesh,XYData=thermalresults.Temperature,ColorMap="jet")
title("Temperature In The Plate, Steady State Solution")
xlabel("X-coordinate, meters")
ylabel("Y-coordinate, meters")
axis equal Below is code that produces the steady state temperature field in a square with consatnt temperature bounday conditions. I want to add code that would define the temperature at any location x,y of interest and display it in the command window. For example, what is the temperature at x= -10, y= 0?
thermalmodel = createpde("thermal","steadystate");
R2= [3,4,-15,15,15,-15,-15,-15,15,15]’;
geom=[R2]
g=decsg(geom)
model= createpde
geometryFromEdges(thermalmodel,g);
pdegplot(thermalmodel,"EdgeLabels","on")
xlim([-20 20])
axis equal
thermalProperties(thermalmodel,"ThermalConductivity",1);
thermalBC(thermalmodel,"Edge",1,"Temperature",100);
thermalBC(thermalmodel,"Edge",2,"Temperature",100);
thermalBC(thermalmodel,"Edge",3,"Temperature",100);
thermalBC(thermalmodel,"Edge",4,"Temperature",400);
generateMesh(thermalmodel);
figure
pdemesh(thermalmodel)
title("Mesh with Quadratic Triangular Elements")
thermalresults = solve(thermalmodel)
pdeplot(thermalresults.Mesh,XYData=thermalresults.Temperature,ColorMap="jet")
title("Temperature In The Plate, Steady State Solution")
xlabel("X-coordinate, meters")
ylabel("Y-coordinate, meters")
axis equal temperature, location x y MATLAB Answers — New Questions