How to plot a circle with polar coordinates in which the colour of the circle changes by data?
Mostrar comentarios más antiguos
Hi! I want to make something like this, which I found in an article.

In my work I model the drying of granulates, and the moisture content of the particles are changing in the function of time and the radius of the particle. I want to take some timesnaps and plot the moisture content of the particle which is changing with the radius, and next to them the colour bar explains what moisture content belongs to the colour.
So far modelled what I want in a 2D figure, in which I took five different timesnaps, but don't know how to plot like in the upper image.
I attached my code so you have my data. Thank you in advance!
x = linspace(0,0.0008,10);
t = linspace(0,200,50);
m = 0;
eqn = @(x,t,u,dudx) fluidPDE(x,t,u,dudx);
ic = @(x) fluidIC(x);
bc = @(xl,ul,xr,ur,t) fluidBC(xl,ul,xr,ur,t)
sol = pdepe(m,eqn,ic,bc,x,t);
u = sol(:,:,1);
surf(x,t,u)
title('Moisture content')
xlabel('Radius [m]')
ylabel('Time [s]')
zlabel('Moisture content [-]')
figure
hold on
plot(x,u(5,:),'Linewidth',2)
plot(x,u(20,:),'Linewidth',2)
plot(x,u(30,:),'Linewidth',2)
plot(x,u(40,:),'Linewidth',2)
plot(x,u(end,:),'Linewidth',2)
legend('t=5 s','t=20 s','t=30 s','t=40 s','t=50 s')
xlabel('Radius [m]')
ylabel('Moisture content [-]')
title('Moisture content')
function [c,f,s] = fluidPDE(x,t,u,dudx) % Equation to solve
D=3e-9
c = 1/D;
f = dudx;
s = 2/x;
end
% ----------------------------------------------------
function u0 = fluidIC(x) % Initial condition
X0=0.2
u0 = X0;
end
% ----------------------------------------------------
function [pl,ql,pr,qr] = fluidBC(xl,ul,xr,ur,t) % Boundary conditions
D=3e-9
rop=2500
k=1.8e-4
uf=0.05
pl = 0;
ql = 1;
pr = k*(ur-uf);
qr = D;
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


