% Solve the wave equation with boundary feedback control % u_tt=c^2 u_xx % u(0,t)=0, c^2u_x(L,t)=-k u_t(L,t) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all; close all; fc=1; % index for movie frames L=1; % the length of an interval c = 1; % wave speed % Solve the controlled wave equation % at the same time for three different % control gains to compare: gain= 1; % control gain gain1= 0.5; % control gain gain2 =5; % control gain stepNo = 100000; % total time steps to run movieStep =500; % time interval to take movie frames K=100; % grid number for interval [0, L] dx = L/K; % grid step x=0:dx:L; % grid dt = 0.00005; % time step