How to plot quiver with an input of Temperature data?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alexandr Lozak
le 16 Août 2019
Modifié(e) : Alexandr Lozak
le 16 Août 2019
I have temperature data of a sample (V=(28,30,4997)). Each V(:,:,i) is a matrix with temperature values. I want to plot a quiver of temperature dissipation/accumulation and temperature image at the same time but i am a bit confused with inputs for u and v vectors. What u and v should be if i have only matrices of temperature?
My code:
[x,y]=meshgrid(1:1:30,1:1:28);
k=4997;
cnt=0;
for i=1:k
u(:,:,i)=V(:,:,i);
v(:,:,i)=V(:,:,i);
%figure
imagesc(V(:,:,i));
hold on
axis tight
q=quiver(x,y,u(:,:,i),v(:,:,i))
q.AutoScale='on';
q.AutoScaleFactor=0.8;
colormap jet
cnt=i;
title(cnt);
pause (0.1)
end
0 commentaires
Réponse acceptée
Bjorn Gustavsson
le 16 Août 2019
Presumably your heat-flux is just proportional to the temperature gradient (assuming constant and isotropic heat conductivity), for that I would start with:
[dTdx,tTdy] = gradient(V(:,:,i));
u(:,:,i) = -heat_conductivity*dTdx;
v(:,:,i) = -heat_conductivity*dTdy;
If you want total change in thermal energy per pixel you'll have to add local heating and subtract local cooling, for this the contribution of heat condution will be proportional to the divergence of the heat-flux. If you image a fluid that moves you'll also have to take the effect of convection into account. If the above suggestion doesn't work you have to clarify your question.
HTH
3 commentaires
Bjorn Gustavsson
le 16 Août 2019
Typically the temperature in a volume is determined by an energy-equation, right? That would look something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234231/image.png)
Where n, T, v, Q and L are functions of both time and position (there are a couple of numerical factors left out in the equation above). Term on left-hand side is the time-variation of temperature, the right-hand side describes the various contributions to temperature variations - convection, compression (i.e. change due to divergence of particle flow), divergence of heat-flux, local heating and local cooling. Now, since you have a sequence of images of the temperature-variation, you shouldn't need to bother too much with the above equation (losely valid for gas-temperature distribution with arbitrary wind field and local heating and cooling sources.)
You should get the local change in temperature simply from the difference between consecutive temperature-images:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234232/image.png)
where dT is positive the temperature has increased and also the thermal energy. If you look at the difference images and compare with the quiver-plot of the tempeature gradient you should be able (in the best case) to see if you have regions with net influx (or outflux) of thermal energy.
HTH
Alexandr Lozak
le 16 Août 2019
Modifié(e) : Alexandr Lozak
le 16 Août 2019
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!