Académique Documents
Professionnel Documents
Culture Documents
//
//
//
a = 1; // vitesse de transport
Nb_pt = 150; // Nombre de noeuds
CFL = 0.5; // condition de Courant–Friedrichs–Lewy
h = axe_x(2) - axe_x(1); // = dx
k = CFL*h/a; // = dt
lambda = k/h;
select Schema,
case "Avant" then
//============== Avant ===============
sol_app(1:Nb_pt) = (1 + a*lambda)*sol_app(1:Nb_pt) - a*lambda*[sol_app(2:Nb_pt),
sol_app(1)];
if(modulo(iter,2)==0) then
sol_exact(1:Nb_pt) = [sol_exact(Nb_pt), sol_exact(1:Nb_pt-1)];
clf()
//plot2d(axe_x', [cond_int' sol_app'],[5 4],leg="Condition initial @ Solution
approch?�" ,rect=[-%pi,-1.5,%pi,1.5])
plot2d(axe_x', [cond_int', sol_exact', sol_app'],[-3 -5 -4],...
leg="Condition initial @ Solution exacte @ Solution approch?�"
,rect=[-%pi,-1.5,%pi,1.5])
xpause(5*10^5)
//pause
end
end