Plot approach to steady state solution

9 次查看(过去 30 天)
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 :)

采纳的回答

Asvin Kumar
Asvin Kumar 2020-5-20
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by