Docsity

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

Toggle sidebar
bg1
AMATH 301
Homework 4 and 5: Autumn 2008
DUE: Thursday, December 4 at 3 a.m.
I Consider the b oundary value problem:
d2ψn
dx2+ [100n(x)−βn]ψn= 0 .(1)
The function n(x) is given by
n(x) = (1− |x|20≤ |x| ≤ 1
0|x|>1(2)
with boundary conditions: ψ(±L) = 0. Use L= 2 and solve for x=−L: 0.1 : L.
(a) Calculate the absolute value of the first five normalized eigenfunctions (ψn) and eigen-
values (βn) using a shooting scheme and ode45. (NOTE: normalization RL
−L|ψn|2dx = 1)
ANSWER: Eigenvectors should be written out in a matrix with five columns A1.dat
ANSWER: Eigenvalues should be in a row vector with five components A2.dat
(b) Calculate the absolute value of the first five normalized eigenfunctions (ψn) and
eigenvalues (βn) using the direct solve scheme outlined in class. (NOTE: normalization
RL
−L|ψn|2dx = 1). You will need the EIGS command to solve this.
ANSWER: Eigenvectors should be written out in a matrix with five columns A3.dat
ANSWER: Eigenvalues should be in a row vector with five components A4.dat

Partial preview of the text

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

AMATH 301

Homework 4 and 5: Autumn 2008

DUE: Thursday, December 4 at 3 a.m.

I Consider the boundary value problem:

d^2 ψn dx^2

  • [100n(x) − βn] ψn = 0. (1)

The function n(x) is given by

n(x) =

{ 1 − |x|^2 0 ≤ |x| ≤ 1 0 |x| > 1 (2)

with boundary conditions: ψ(±L) = 0. Use L = 2 and solve for x = −L : 0.1 : L. (a) Calculate the absolute value of the first five normalized eigenfunctions (ψn) and eigen- values (βn) using a shooting scheme and ode45. (NOTE: normalization

∫ (^) L −L |ψn|

(^2) dx = 1)

ANSWER: Eigenvectors should be written out in a matrix with five columns A1.dat ANSWER: Eigenvalues should be in a row vector with five components A2.dat

(b) Calculate the absolute value of the first five normalized eigenfunctions (ψn) and eigenvalues (∫ βn) using the direct solve scheme outlined in class. (NOTE: normalization L −L |ψn|

(^2) dx = 1). You will need the EIGS command to solve this.

ANSWER: Eigenvectors should be written out in a matrix with five columns A3.dat ANSWER: Eigenvalues should be in a row vector with five components A4.dat