Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the timestep value ? And how do I go about altering from downstream to upstream? The following code solves the advection equation 1
What is the timestep value ? And how do I go about altering from downstream to upstream?
The following code solves the advection equation 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 - %set up the domain N = 200; x = linspace(-10,10,N); dx = x (2)-x(1); %advection velocity c C = 0.7; %temporal parameters t = 0; dt = 0.2; timestep= 0; initial condition f = @(x) exp(-5*x.^2); y = f(x)'; figure(1), plot (x, y) title(['Current time = ', num2str(t)]) drawnow +c = 0) with c= 0.7 on -10
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started