Docsity

Solved Homework 5 - Beginning Scientific Computing | AMATH 301, Assignments of Mathematics

Toggle sidebar
bg1
AMath 301
Due Date: Early Friday morning, June 1st
Homework 5
1. Consider the nonlinear partial differential equation known as the Nonlinear SchrĀØodinger
Equation (NLS):
iāˆ‚u
āˆ‚T +āˆ‚2u
āˆ‚x2+ 2|u|2u= 0
where i=āˆšāˆ’1 and u=u(x, T ) is a function of both xand T. Assume periodic
boundary conditions with L= 20 (x∈(āˆ’10,10)) and use N= 128 for the number of
discrete points. For your time-stepping routine, use ode45 with Tspan = [0 : 1 : 20].
(a) Using the initial condition U(x) = sech(x), solve the PDE using a finite difference
method. Using a waterfall plot, view the absolute value of the solution:
>> waterfall(x,T,abs(u))
This is what is called a soliton solution to NLS. As this solution propagates in T,
it holds it’s form!
ANSWERS: ode45 solution output should be saved as A1.dat
(b) Using the initial condition U(x) = 2sech(x), solve the PDE using a finite differ-
ence method. Using a waterfall plot, view the absolute value of the solution: The
solution here is doing what is called a ā€soliton danceā€, where it returns to it’s
initial state after T=Ļ€/2 units.
ANSWERS: ode45 solution output should be saved as A2.dat
(c) Using the initial condition U(x) = sech(x), solve the PDE spectrally using FFTs.
Using a waterfall plot, view the absolute value of the solution u. Compare
with (a).
ANSWERS: ode45 solution output should be saved as A3.dat.
(d) Using the initial condition U(x) = 2sech(x), solve the PDE spectrally using FFTs.
Using a waterfall plot, view the absolute value of the solution u. Compare
with (b).
ANSWERS: ode45 solution output should be saved as A4.dat.
Note: Each data file is worth 5 points.
1

Partial preview of the text

Download Solved Homework 5 - Beginning Scientific Computing | AMATH 301 and more Assignments Mathematics in PDF only on Docsity!

AMath 301 Due Date: Early Friday morning, June 1st

Homework 5

  1. Consider the nonlinear partial differential equation known as the Nonlinear SchrĀØodinger Equation (NLS): i

āˆ‚u āˆ‚T

āˆ‚^2 u āˆ‚x^2

  • 2|u|^2 u = 0

where i =

āˆ’1 and u = u(x, T ) is a function of both x and T. Assume periodic boundary conditions with L = 20 (x ∈ (āˆ’ 10 , 10)) and use N = 128 for the number of discrete points. For your time-stepping routine, use ode45 with Tspan = [0 : 1 : 20].

(a) Using the initial condition U (x) = sech(x), solve the PDE using a finite difference method. Using a waterfall plot, view the absolute value of the solution:

waterfall(x,T,abs(u)) This is what is called a soliton solution to NLS. As this solution propagates in T , it holds it’s form!

ANSWERS: ode45 solution output should be saved as A1.dat (b) Using the initial condition U (x) = 2sech(x), solve the PDE using a finite differ- ence method. Using a waterfall plot, view the absolute value of the solution: The solution here is doing what is called a ā€soliton danceā€, where it returns to it’s initial state after T = Ļ€/2 units.

ANSWERS: ode45 solution output should be saved as A2.dat (c) Using the initial condition U (x) = sech(x), solve the PDE spectrally using FFTs. Using a waterfall plot, view the absolute value of the solution u. Compare with (a).

ANSWERS: ode45 solution output should be saved as A3.dat. (d) Using the initial condition U (x) = 2sech(x), solve the PDE spectrally using FFTs. Using a waterfall plot, view the absolute value of the solution u. Compare with (b).

ANSWERS: ode45 solution output should be saved as A4.dat.

Note: Each data file is worth 5 points.