/ concept-collection / windowedFourierProjection
Sign in
concept-collection / windowedFourierProjection
windowedFourierProjection / wfp_1Dspringscattering / get_uIncident.m
24 lines · 493 BBlameHistoryRaw
1function uin = get_uIncident(x,t,mu,t0)
2% GET_UINCIDENT returns an incident wave
3%
4% Inputs:
5% x,t: space and time variables
6% mu,t0: for the Gaussian as seen in formula below
8if nargin == 0, test_get_uIncident; return; end
10uin = exp(-mu.*(x - t - t0).^2);
12end
14function test_get_uIncident
15ax = -pi; bx = pi; Nx = 100;
16x = linspace(ax,bx,Nx);
17t = 3;
18mu = 30;
19t0 = -3;
20uin = get_uIncident(x,t,mu,t0);
21plot(x,uin,'LineWidth',2);
22xlabel x; ylabel u;
23title 'plot of u_in';
24end
moveopenescclose