1 D convection challenge 1
Objective: MAIN CODE function xdot= linear_convection(n) % Inputs for the linear convection problem L=1; c=1; dt=0.01; t_end=0.4; nt= (0.01:dt:t_end); x= linspace(0,L,n); dx=x(2)-x(1); % define start and end position of the square wave x_start= 0.1; x_end=0.3; % Function to calculate n_start and n_stop n_start= func_start(x,x_start);…