Plot approach to steady state solution

10 visualizaciones (últimos 30 días)
Jonathan Melia
Jonathan Melia el 17 de Mayo de 2020
Comentada: Jonathan Melia el 20 de Mayo de 2020
figure(1)
title('Exact Steady State Temperature Profile')
hold on
plot(r_profile,Up_exact,'r-');
xlabel('r')
ylabel('T')
for i = 1:ceil(tau/dt)
Mplot(:,i) = U;
U = Atinv*(D*U+dt*B);
[Uedge, redge] = GetBHboundary(theMesh,3,U);
figure(2)
plot(redge, Uedge,'k')
axis([1 10 0 0.4])
title('FE Temperature Profile')
drawnow
pause(0.05)
end
I have the following code which plots my steady state temperature profile in figure 1 and an animated transient temperature profile in figure 2. Is there a way i can have them both in one plot showing how the transient solution approaches the steady state?
Thanks :)

Respuesta aceptada

Asvin Kumar
Asvin Kumar el 20 de Mayo de 2020
Can you give this a try?
figure
title('Exact Steady State Temperature Profile')
hold on
plot(r_profile,Up_exact,'r-');
xlabel('r')
ylabel('T')
ax = gca;
for i = 1:ceil(tau/dt)
Mplot(:,i) = U;
U = Atinv*(D*U+dt*B);
[Uedge, redge] = GetBHboundary(theMesh,3,U);
% figure(2)
plot(ax, redge, Uedge,'k')
axis([1 10 0 0.4])
title('FE Temperature Profile')
drawnow
pause(0.05)
end

Más respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by