1-D linear convection
Objective: Code: clear all close all clc %inputs for the linear convection problem L = 1; n = 81; c = 1; dt = 1e-2; %calculations % mesh length = total length / no of grid points x = linspace(0,L,n); dx = x(2) - x(1); %or dx = L/(n-1) %defining start and end of square %n_start = 3; %n_end = 7; x_start = 0.1; x_end = 0.3; [n_start,n_end]…