2D Temperature distribution from 1D temperature distribution T(x)
Show older comments
Hello all,
Hope everyone is doing good.
I have got 1D temperature distribution T(x) along axial distance. Based on a convention below, I need to extract 2D temperature distribution based on 1D. The convention is based on the figure attached here.


In my hand, I have data related to x-position and 1D temperature distribution + convention data to extract 2D temperature distribution.
% Position along x-direction
x_position = [0.05; 0.0625; 0.075; 0.0875; 0.10; 0.1125; 0.125; 0.1375; 0.15; 0.1625; 0.175; 0.1875; 0.2; 0.2125; 0.225; 0.2375; 0.25; 0.2625; 0.2750; 0.2875; 0.3];
% 1D temperature
desired_temperatures = [100; 100; 55.39; 30.383; 23.047; 20.894; 20.26; 20.077; 20.023; 20.007; 20.002; 20; 20; 20; 20; 20; 20; 20; 20; 20; 20];
% Introduced y-distance for 2D
y = [0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0]; % j //26 points
% 2D temperature distribution
if 0 < y < 0.25 - x
Theta(x, y) = T(0.25 – y);
else if 5 > y > 4.75 +x
Theta(x, y) = T(y - 4.75);
else
Theta(x, y) = T(x);
end
end
Lets say, when T(0.25 - y) returns T(0.25), MATLAB couldn't understand/return the variable from T(0.25) because I believe the temperature variable are stored in indices as, T(1) T(2) T(3) T(4) .... so so on.
So how to make Matlab understand the above (if) - (else if) loops works ?
Can someone share your ideas on above context ?
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!