Plot approach to steady state solution

9 Ansichten (letzte 30 Tage)
Jonathan Melia
Jonathan Melia am 17 Mai 2020
Kommentiert: Jonathan Melia am 20 Mai 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 :)

Akzeptierte Antwort

Asvin Kumar
Asvin Kumar am 20 Mai 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

Weitere Antworten (0)

Kategorien

Mehr zu Animation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by