Ploting temperature evolution in a multi-layer tyre

Hello,
I'm looking for a graphical representation of temperature changes in a tyre. My simulink gives me the real time temperatures of my 300 layers in a spreadsheet called "temperatureData" but I'm now trying to represent the 300 layers of the tyre according to their temperature using a colour scale as shown in the image above. I've tried several methods but I can't get anywhere. If anyone has an idea or a code proposal that might be suitable I'd be happy to discuss it and see what they come up with !
I'm also copying an excel of the temperature as an example (a shorter version).
Thank you in advance for your help.

 Réponse acceptée

maybe this ?
I assumed your data has columns = layers and the rows spans the angular position between 0 and 2pi
as a result , a nice donut but does it represents really a tire?
A =readmatrix('temperatureData.xlsx');
[m,layers] = size(A); % rows = angular position (0 to 2pi), columns = layers
da = 2*pi/m;
angl = (0:da:2*pi-da)'*ones(1,layers);
% tire defined by inner radius ri and outer radius ro (units ??)
ri = 100;
ro = 200;
r = ones(m,1)*linspace(ri,ro,layers);
% create X,Y meshes
X = r.*cos(angl);
Y = r.*sin(angl);
% plot
surf(X,Y,A);
shading interp
view(2)
axis square

4 commentaires

Hello Mathieu,
First of all, thanks a lot for your answer, this donut looks just awesome !! :D
I'm sorry if I didn't explain the data properly. The columns in Excel represent the 12 layers of the tyre, you'r right. However, the rows are the temperature values over time. This means that line 235, for example, gives the temperatures of the 12 tyre layers after 235 seconds.
I imagine that this would change a large part of the programme but the result that I imagined is at least in this form.
Would it be possible to have a programme that shows the temperatures of each layer as the simulation progresses (as time goes by)?
Thanks again
Mathieu NOE
Mathieu NOE le 30 Oct 2023
Modifié(e) : Mathieu NOE le 8 Fév 2024
hello Jan
try this, it will generate a MP4 video file (demo.mp4)
as your time axis is very long the video file generation can take a while, be patient !
A =readmatrix('temperatureData.xlsx');
[time,layers] = size(A); % rows = time stamps (seconds) , columns = layers
% tire defined by inner radius ri and outer radius ro (units ??)
ri = 100;
ro = 200;
nb = 100; % number or radii to plot
r = ones(nb,1)*linspace(ri,ro,layers);
da = 2*pi/(nb-1);
angl = (0:da:2*pi)'*ones(1,layers);
% create X,Y mesh
X = r.*cos(angl);
Y = r.*sin(angl);
% fix colorbar min/max values
minA = min(A,[],'all');
maxA = max(A,[],'all');
%==============================================================================================
% Prepare the video file.
vidObj = VideoWriter('demo.mp4','MPEG-4');
open(vidObj);
numberOfFrames = time; % maybe consider decimation / resampling to speed up the video process
for ci = 1:numberOfFramesa
cla reset;
s = surf(X,Y,ones(nb,1)*A(ci,:));
s.EdgeColor = 'none'; % hide the edges
title(['Time index = ' num2str(ci), ' seconds '] , 'FontSize', 15);
colorbar('vert');
caxis([minA-5, maxA+5]);
shading interp
view(2)
axis square
drawnow;
% Write each frame to the file.
currFrame = getframe(gcf);
writeVideo(vidObj,currFrame);
end
% Close the video file.
close(vidObj);
Jan Soller
Jan Soller le 30 Oct 2023
Modifié(e) : Jan Soller le 6 Fév 2024
Hello Mathieu,
Thanks a lot for your help, it is exactly what I was searching for and the result looks really impressive!
Adding the video recording is also just perfect, as I can accelerate it in post-processing.
Thanks again and I wish you all the best,
my pleasure !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Foundation and Custom Domains dans Centre d'aide et File Exchange

Produits

Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by