Physics 229& 100 Homework #5
Name: Nasser Abbasi
1. Suppose that the profit your company makes is given by P=s m (3m+s)E^(-(2s +m)/40) , where s and m are the number of sales and manufacturing people, respectively. If the total number of people is equal to 50, how do you distribute the human resources to maximize your profit. By how much would profit increase if you hire an additional person? Do the problem two ways:
a) using Lagrange multipliers and FindRoot
The problem formulation is the following
Maximize the objective function P (which represents profit) subject to contraint g(x,m)=50, where in this problem g(x,m) is defined as x+m
If we consider a 3D space, where the z axis represents the profit, the x axis is s, and y axis is m, then we want to locate the point above the line s=50-m (marked as RED in the diagram, which is the constraint) where this point has the largest distance from the x-y plane, as shown in this diagram
So we have 3 equations to solve for 3 unknowns,(s,m,λ).Since this is not a polynomials,we can't use Solve or NSolve,we need to find FindRoot[],but for that we need a guess.So lets make a plot of the profit to get a guess for s and m
We see from the above that guess for s=15and m=35 looks promissing.Lets use that (what about λ?,I tried many different values,and it did not make a difference)
Hence, since the solution must be an integer, we round the numbers
b) Using NMaximize
We see that the answer agrees with the method of the lagrange multiplier
2. Find the triangle of perimeter L with maximum area. A triangle is specified by three points in a plane. Put the first point at the origin, the second point along the x axis at {x1,0} , and the third point at {x2,y2}.
a) Write an expression for the area of the triangle in terms of x1,x2,y2 , neglecting the perimeter constraint.
b) What is the maximal area in terms of L?
Hence maximum area in terms of L is the last case, which is
3. Find the minimum distance between points in the intersection of
3x-4y+5z==8 and x+y-z==11
and points on the unit sphere. Do it 2 ways, and show that you get the same answer both ways:
a) using PseudoInverse and geometry ( utilizing the fact that the PseudoInverse solution to the simultaneous equations will have minimum length)
The constraint is the line of the interection. The objective function is the distance between this line and points on the unit sphere.
Now use PsudoInverse to find the point on the line of the intersection of the 2 planes where the point is closes to the origin
The above is the distance to the origin. Hence the distance to the surface of the sphere is
b) using Lagrange multipliers.
Let xc,yc,zc represent coordinates of a point on the sphere. Let xp,yp,zp represent coordinates of a point on the surafces. Now setup the object function and the constrains and the auxilary function.
We see that the solution agrees with part(a).
4 a) The Wronskian of a set of functions {[x], [x]..., [x] } is defined as
det(
). Write a function wronski[funcs_List, var_] that will compute the Wronskian of any set of functions. Use it to compute the Wronskian of {,, Sin[x]} and of {,, Sinh[x]}
....
......
...
b) One of the uses of the Wronskian is to determine if a set of functions is linearly independent. Recall that two vectors v1 and v2 are independent if A v1+B v2=0 implies that A and B are zero. Similarly, if the only solution to A y1[x]+B y2[x]=0 ( for all x) is the trivial one {A->0,B->0}, y1 and y2 are independent functions. Note that if A y1[x]+B y2[x]=0, then by taking a derivative, we conclude that A y1' [x]+B y2' [x] must also vanish. Show that the condition for independence is that the Wronskian of y1 and y2 does not vanish for all x.
sketch of proof:
Assume that and are L.d. and show that this implies that W=0
Then assume that W=0 and show that this implies that and are L.d.
Hence if W /= 0, then this must imply that and are L.I.
Start of proof:
Assume and are L.d then we can write
=
where is some constant
Then
=
Now W=(
)
=(
)
Hence the determinant of W is
'-' = 0
Now for the second part. Assume that det(W)=0, then this means
'-' = 0 -----------------(1)
But differentiation itself is a linear operation, hence we can write
= ------(2)
and
= -----(3)
Where and are some arbitrary constanst which are unrelated.
Substitute the above 2 equations into equation (1) we obtain
- = 0
Divide by we obtain
=
which means = (else we have =0 everywhere)
Since =, then if we divide equation (2) by (3) we obtain
=
Which implies that is L.d. to . This complete the second part of the proof.
Hence if det(W)/=0, then must be L.I. to
This completes the proof.
c) Consider a second order DE with coefficients that are not necessarily constant:
y''[x]+p1[x] y'[x]+p0[x] y[x]=0. Let y1[x] and y2[x] be two solutions to this equation. Let W be the Wronskian of the two solutions. Show that =-p1[x] W[x]. If p1[x] is constant, show that if W is non zero for any x, it will be non zero for all x.
I will just write everything without [x] next to it for ease of reading.
W=det (
)=y1 y2'-y2 y1'
y1
y2
y1'
y2'
Hence =y1' y2' + y1 y2''- y2' y1'- y2 y1'' ------(1)
Since y1[x] is a solution, then
y1''=-p1 y1' -p0 y1
Similarly, since y2[x] is a solution then
y2''=-p1 y2' -p0 y2
Substitute the above 2 equations into (1) we obtain
=y1' y2' + y1 (-p1 y2' -p0 y2)- y2' y1'- y2 (-p1 y1' -p0 y1)
=y1' y2' - y1 p1 y2' -y1 p0 y2- y2' y1'+ y2 p1 y1' + y2 p0 y1
=y1' y2' - y1 p1 y2' - y2' y1'+ y2 p1 y1'
=- p1 (y1 y2' - y2 y1' )
But the last term above is W, hence
=- p1[x] W[x]
Which is what we are asked to show.
Last part. If p1[x] is constant, say m then the above is =mW[x] which has the solution of W(x)=n where n is some other constant.
Hence we see that if we can find one x where W(x) is not zero, then this implies that the constant n is not zero (since the exponential term is not zero unless x=-∞). So, if n≠0 and since the exponential term is not zero then W(x) can not be zero for any other x.
5. Write a function waveEq[f_] which computes the wave operator f- in spherical coordinates f[r,θ,φ,t] ( use the VectorAnalysis Add-on package). The wave operator is identically zero if f satisfies the wave equation. Use it to show that is a solution for certain values of the scalar k.
We see that the solution is zero form specific values of k, which are +- frequency/speed of light
6. A plane wave polarized in the x direction and propagating in the z direction has an electric field E1={ex, 0, 0}, where ex is the magnitude of the field and k is a constant vector k={0, 0, km}. According to Maxwell's equations, this wave has a magnetic field associated with it which obeys the equation ∇×E=-.
a) Assume B={bx, by, bz} , and determine bx, by, and bz.
b) Compute the Poynting vector S= .Verify that it is proportional to the magnitude of E1 squared.
7. The divergence theorem says that F·dS = ∇·F dV . Verify the theorem by computing both sides of the identity for the cartesian vector field F= {z x , y, y x } , where V is the interior of a cylinder centered at the origin of radius 1 and extending from z=-1 to z=1. Calculate ∇·F in Cartesian coordinates, and then perform a change of variables and do the integral in cylindrical coordinates. Express dS in cartesian coordinates, and then compute the dot product.
Working on the lhs. We need to integrate F over the suraface area of the cylinders. There are 3 integrals. One for the top surface, one for the bottom surface, and one integral for the surroundaing surface.
To help me understand how to use Mathematica to perform coordinates transformation, I made the following diagram
For each integral we write ∫.da where is a unit vector perpendiculare to the surface.
For to the top surafce, using unit vectors expressed in cylinderical coordinates, =={0,0,1}, while for the bottom surface = -={0,0,-1} and for the surrounding surface =={cosθ,sinθ,0}
Now before doing the dot product . we need to convert to cylindrical coordinates, which we can do using the transformation x=rcosθ,y=rsinθ,z=z
Now we need to find the scalar quantity da. For the top and botton surfaces, da=r dr dθ, and for the surrounding surface, da=dθ dz
Start by converting vector F coordinates from cartesian to cylinderical
Now get the cylinderical coordinates of the unit normal vector to the top surface
Now do the bottom surface
Now do the surrounding surface
Now do the rhs
8. Verify the theorem from vector calculus that ∇·(A×B)=B·(∇×A)-A·(∇×B) for vector functions A and B by computing both sides and showing that they are equal. Use the VectorAnalysis package.
a) Do the calculation using Cartesian coordinates, i.e. A &B are functions of x,y,z.
Make 2 general vector functions of coordinates x,y,z to work with.
This is not a general case
b) Do the calculation using cylindrical coordinates, i.e. A&B are functions of r, θ,z.
Suggestion: try to use somtthing like Ax[x,y,z] or Ar[r,φ,z]
Created by Mathematica (January 30, 2007) |