Professional Documents
Culture Documents
Jeremy Kao
PHYS 416
April 4, 2017
1 Exercise 13
For the coupled mass-spring system shown in Figure 1, we can write the forces Fi on each block
i as
1
Note that we have defined the positions x2 , x3 , and x4 to be relative to x1 such that x1 = 0.
Hence the force F1 does not need to be calculated, since the absolute position of x1 does not
matter. This set of equations can be expanded to yield
F2 = −k1 x2 + k1 L + k1 x3 − k1 x2 − k1 L + k2 x4 − k2 x2 − k2 L
F3 = −k1 x3 + k1 x2 + k1 L + k1 x4 − k1 x3 − k1 L − k2 x3 + k2 L
F4 = −k1 x4 + k1 x3 + k1 L − k2 x4 + k2 x2 + k2 L
F2 −2k1 − k2 k1 k2 x2 k2 L
F3 =
k 1 −2k1 − k2 k 1
x3 − −k2 L
F4 k2 k1 −k1 − k2 x4 −k1 L − k2 L
which is equivalent to
F~ = K~x − ~b
K~x = ~b
or, explicitly:
−2k1 − k2 k1 k2 x2 k2 L
k1 −2k1 − k2 k1 x3 = −k2 L
(1.1)
k2 k1 −k1 − k2 x4 −k1 L − k2 L
Equation 1.1 is thus the matrix equation for the equilibrium positions for the blocks and can
be solved by using the operation x = K\b in Matlab. The total length of the system (i.e. the
value of x4 ) as a function of the ratio k1 /k2 is shown graphically in Figure 2.
2
3
2.8
2.6
2.2
1.8
1.6
10-2 100 102
k 1/k 2
2 Exercise 19
The equation to be optimized is
8πhc 1
u(λ) = 5
λ exp(hc/λkT ) − 1
A 1
u(λ) = 5
λ exp(λ0 /λ) − 1
Bx5
u(x) =
ex − 1
Our goal now is to maximize the function u(x), i.e. find x∗ such that ∂u
∂x x∗
= 0. Computing
the derivative, we have:
3
Bx4 (5(ex − 1) − xex )
=0
(ex − 1)2
5(ex − 1) − xex = 0
ex (5 − x) − 5 = 0
Hence the optimal value of x will be given by the roots of the equation:
f (x) = exp(x)(5 − x) − 5
Substituting back in x = λ0 /λ and then λ = αhc/kT gives our equation for the optimal value
of α:
1
f 0 (α) = exp(1/α)(1 − 4α) (2.2)
α3
Equations 2.1 and 2.2 are graphed in Figure 3.
Running the program ex19.m, using an initial guess of α = 0.01, we get the output:
The optimal value of alpha is 0.201405.
The maximum wavelength is given by 0.00289918 m*K.
This is in close agreement with the actual value of λmax = 0.0028977729 m·K1 .The trajectory of
convergence is shown in Figure 4. For an initial guess that is too large (i.e. α = 0.3 or greater),
Newton’s Method diverges. This is because at these larger values, f 0 (α) ≈ 0, as shown by
Figure 3.
1
http://physics.nist.gov/cgi-bin/cuu/Value?bwien
4
0.25
0.2
0.15
0.1
0.05
0
0 200 400 600 800 1000
Iteration
3 Exercise A
The 6 constraint equations that describe the system depicted in Figure 5 are given by:
5
f1 = L1 cos θ1 + L2 cos θ2 + L3 cos θ3 − L = 0
f3 = T1 sin θ1 − T2 sin θ2 − w1 = 0
f4 = T2 cos θ2 − T1 cos θ1 = 0
f5 = T3 sin θ3 + T2 sin θ2 − w2 = 0
f6 = T3 cos θ3 − T2 cos θ2 = 0
The top two equations are the length constraints for the strings, and the bottom four equations
are the force constraints for the two masses. Now we have a system of equations of the form
f~(~x) = ~0, where f~ = (f1 , f2 , f3 , f4 , f5 , f6 ) and ~x = (θ1 , θ2 , θ3 , T1 , T2 , T3 ). To use the multivariable
Newton’s Method, we have to first write the Jacobian matrix D, which is given by:
∂fj (~x)
Dij (~x) =
∂xi
6
−L1 sin θ1 L1 cos θ1 T1 cos θ1 T1 sin θ1 0 0
−L sin θ L2 cos θ2 −T2 cos θ2 −T2 sin θ2 T2 cos θ2 T2 sin θ2
2 2
−L3 sin θ3 −L3 cos θ3 0 0 T3 cos θ 3 −T 3 sin θ3
D=
0 0 − sin θ2 cos θ2 sin θ2 − cos θ2
0 0 − sin θ2 cos θ2 sin θ2 − cos θ2
0 0 0 0 sin θ3 cos θ3
Using an initial guess of x0 = [0.5 0.5 0.5 20 20 20], we find the solution for the parame-
ters given in the problem statement (w1 = 10, w2 = 20, L1 = 3, L2 = 4, L3 = 4, L = 8), giving
the output:
xplot =
x =
The vector xplot shows the convergence to the solution, and the vector x gives the final state
vector x = [theta_1 theta_2 theta_3 T_1 T_2 T_3]. We also check a symmetrical case to
confirm that our program gives the expected output by setting w1 = w2 and L1 = L2 = L3 .
This gives the output:
xplot =
x =
7
0 0
-0.5 -0.5
-1 -1
-1.5 -1.5
y (m)
y (m)
-2 -2
-2.5 -2.5
-3 -3
-3.5 -3.5
0 2 4 6 8 0 2 4 6 8
x (m) x (m)
4 Exercise B
The program was run with an error tolerance = 10−5 and a maximum number of iterations
of 50. For n = 3, the following output was obtained:
uniqueRoots =
This shows that for n = 3, the four distinct solutions are −0.5 − 0.866i, 1, −0.5 + 0.866i, and
0 (for when Newton’s method failed to converge). The two images (number of iterations and
solution found as a function of the starting position) are shown in Figure 7.
Figure 7: Number of iterations needed for convergence and the root found as a function
of the starting position, for n = 3. If Newton’s method failed to converge, both the
root and the number of iterations were set to 0.
8
uniqueRoots =
This shows that for n = 4, the five distinct solutions are i, −i, 1, −1, and 0 (for when Newton’s
method failed to converge). The two images (number of iterations and solution found as a
function of the starting position) are shown in Figure 8.
Figure 8: Number of iterations needed for convergence and the root found as a function
of the starting position, for n = 4. If Newton’s method failed to converge, both the
root and the number of iterations were set to 0.