Discretization basics
Objective: clear all close all clc x=pi/3; dx=linspace(pi/4,pi/4000,30); for i=1:length(dx) first_order_error(i)=first_order_approximation(x,dx(i)); second_order_error(i)=second_order_approximation(x,dx(i)); fourth_order_error(i)=fourth_order_approximation(x,dx(i)); end figure(1) loglog(dx,first_order_error) hold on loglog(dx,second_order_error,\'r\')…