Plot approach to steady state solution

4 views (last 30 days)
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 :)

Accepted Answer

Asvin Kumar
Asvin Kumar on 20 May 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

More Answers (0)

Categories

Find more on Animation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!