Question: I need help with this MATLAB code to achive this picture: xmin = 0 ; xmax = 1 ; N = 1 0 0 ;
I need help with this MATLAB code to achive this picture:
xmin ;
xmax ;
N ;
dt ;
t ;
tmax ;
v ;
dx xmax xminN;
x xmin dx : dx : xmax dx;
if x ;
u expx;
else
u;
u u;
unp u;
nsteps tmaxdt;
for n : nsteps
u u;
uN uN;
for i : N
unpi ui vdtdxui ui;
end
t t dt;
u unp;
exact expxvt;
plotxexact, r;
hold on
plotxubo 'markerfacecolor' b;
hold off
axis xmin xmax
xlabelx'fontsize',
ylabelUtx'fontsize',
titlesprintftime ft'fontsize',
shg
pausedt;
end
c Modify your initial code forward upwind forward in time backward in space so
that the domain is Take Plot your solution at time
and Save your plots as PNG files.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
