1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
%-----------------------------------------
% Animation
% d'aprés 'Apprendre et maitriser Matlab'
%-----------------------------------------
echo on;
%------------------------
% Animation
%------------------------
echo off;
clear all;
close all;
Q=490.916900919889;
K=1.63;
w=0.0982543280127309;
tp=600;
R=0;
Y0=[20];
t=1:10:600;
x=1:10:600;
[T,X]=meshgrid(t,x);
A=(K*sqrt(pi)*Y0+2*Q*sqrt(w*t))/(K*sqrt(pi)*Y0+2*Q*sqrt(w*t)*sqrt(pi));
B=log((K*sqrt(pi)*Y0+2*Q*sqrt(w*t)/((K*sqrt(pi)*Y0+2*Q*sqrt(w*t)*sqrt(pi))/(-w*t))));
z= A'*[(Y0+(2*Q'*sqrt(w*t')./K))*cos(x./B) - (2*Q)./K*B'*1/A'*sin(x./B)];
plot(x,z(1,:),'tag','xzPlot')
xlim([min(min(x))-1 max(max(x))+1])
ylim([min(min(z))-1 max(max(z))+1])
gui_data=guihandles(gcf);
guidata(gcf,gui_data);
for i=1:length(t)
%set(gui_data.xzPlot,'xdata',x);
set(gui_data.xzPlot,'ydata',z(i,:));
guidata(gcf,gui_data);
pause(0.05)
end |