You are on page 1of 9

Problem Set 4

Jeremy Kao

PHYS 416

April 4, 2017

1 Exercise 13

Figure 1: Coupled mass-spring system. Spring constants are k1 and k2 ,


rest length for all the springs is L. The coordinates x2 , x3 , and x4 are the
positions of the masses.

For the coupled mass-spring system shown in Figure 1, we can write the forces Fi on each block
i as

F2 = −k1 (x2 − L) + k1 (x3 − x2 − L) + k2 (x4 − x2 − L)

F3 = −k1 (x3 − x2 − L) + k1 (x4 − x3 − L) − k2 (x3 − L)

F4 = −k1 (x4 − x3 − L) − k2 (x4 − x2 − L)

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

which can be rewritten in the matrix equation

      
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

For equilibrium conditions, F~ = 0, so this equation becomes

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

Total Length (m)


2.4

2.2

1.8

1.6
10-2 100 102
k 1/k 2

Figure 2: Coupled mass-spring system. Spring constants are k1 and k2 ,


rest length for all the springs is L. The coordinates x2 , x3 , and x4 are the
positions of the masses.

2 Exercise 19
The equation to be optimized is

8πhc 1
u(λ) = 5
λ exp(hc/λkT ) − 1

Using the change of variables λ0 = hc/kT and A = 8πhc, this becomes:

A 1
u(λ) = 5
λ exp(λ0 /λ) − 1

Using a further change of variables x = λ0 /λ and B = A/λ50 , this becomes:

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:

∂u (ex − 1)5Bx4 − Bx5 ex


=
∂x (ex − 1)2

Bx4 (5(ex − 1) − xex )


=
(ex − 1)2

Setting this equal to 0 to optimize the value of x, 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 α:

f (α) = exp(1/α)(5 − 1/α) = 0 (2.1)

The derivative of f (α), needed for Newton’s Method, is given by:

1
f 0 (α) = exp(1/α)(1 − 4α) (2.2)
α3
Equations 2.1 and 2.2 are graphed in Figure 3.

Figure 3: Graph of the function whose roots must be found and


its derivative.

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

Figure 4: Convergence of Newton’s Method to the correct


root.

3 Exercise A

Figure 5: System for Exercise A. The six independent variables are θ1 , θ2 ,


θ3 , T1 , T2 , and T3 . The weights w1 and w2 and lengths L, L1 , L2 , and L3
are constant.

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

f2 = L1 sin θ1 + L2 sin θ2 − L3 sin θ3 = 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

Computing terms, we have:

∂f1 ∂f1 ∂f1 ∂f1 ∂f1 ∂f1


= −L1 sin θ1 = −L2 sin θ2 = −L3 sin θ3 =0 =0 =0
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

∂f2 ∂f2 ∂f2 ∂f2 ∂f2 ∂f2


= L1 cos θ1 = L2 cos θ2 = −L3 cos θ3 =0 =0 =0
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

∂f3 ∂f3 ∂f3 ∂f3 ∂f3 ∂f3


= T1 cos θ1 = −T2 cos θ2 =0 = sin θ1 = − sin θ2 =0
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

∂f4 ∂f4 ∂f4 ∂f4 ∂f4 ∂f4


= T1 sin θ1 = −T2 sin θ2 =0 = − cos θ1 = cos θ2 =0
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

∂f5 ∂f5 ∂f5 ∂f5 ∂f5 ∂f5


=0 = T2 cos θ2 = T3 cos θ3 =0 = sin θ2 = sin θ3
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

∂f6 ∂f6 ∂f6 ∂f6 ∂f6 ∂f6


=0 = T2 sin θ2 = −T3 sin θ3 =0 = − cos θ2 = cos θ3
∂x1 ∂x2 ∂x3 ∂x4 ∂x5 ∂x6

Then the Jacobian matrix D is given by:

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 =

0.5000 0.5000 0.5000 20.0000 20.0000 20.0000


0.8800 0.4412 1.1360 11.2921 6.4978 14.0886
0.9365 0.2311 0.9820 16.7097 10.5852 19.4366
0.8635 0.2688 0.9925 17.0625 11.4912 20.2815
0.8649 0.2682 0.9894 17.1602 11.5453 20.2714
0.8649 0.2682 0.9894 17.1602 11.5453 20.2715

x =

0.8649 0.2682 0.9894 17.1602 11.5453 20.2715

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 =

0.5000 0.5000 0.5000 20.0000 20.0000 20.0000


1.1322 0.2546 1.4331 11.4217 1.8332 14.7092
1.1993 -0.0135 0.9651 23.8872 9.6375 19.1751
1.0453 -0.0012 1.0574 22.8547 11.7237 23.1498
1.0472 0.0000 1.0472 23.0946 11.5472 23.0924
1.0472 -0.0000 1.0472 23.0940 11.5470 23.0940
1.0472 0.0000 1.0472 23.0940 11.5470 23.0940

x =

1.0472 0.0000 1.0472 23.0940 11.5470 23.0940

Both these equilibrium solutions are visualized in Figure 6.

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)

Figure 6: Two equilibrium solutions for the problem, one asym-


metrical and one symmetrical.

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 =

-0.5000 - 0.8660i 1.0000 - 0.0000i -0.5000 + 0.8660i 0.0000 + 0.0000i

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.

(a) Number of iterations (b) Solution found

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.

For n = 4, the following output was obtained:

8
uniqueRoots =

0.0000 + 0.0000i -0.0000 + 1.0000i -0.0000 - 1.0000i 1.0000 + 0.0000i -1.0000 +


0.0000i

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.

(a) Number of iterations (b) Solution found

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.

You might also like