Project

Effect of time step size on solution of 1-D Wave equation or 1-D Linear Convection equation solved using Windward Scheme

Objective: function [ufinal]=effectoftimestep(dt) L=1; c=1; n=81; t=0.4/dt; dx= L/(n-1); %discretizing work space x=linspace(0,L,n); u=ones(1,n); [H]=squarelift(x,n); u(H(1):H(2))=2; uold=u; uinitial=u; %time loop for j=1:t; %space loop for i=2:n; u(i)=uold(i)-((c*dt/dx)*(uold(i)-uold(i-1))); end uold=u; pause(0.000001); plot(x,u)…

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.