Question

In: Physics

Given ? = ???+??? + ??? and ? = ???-3?? + ????. Use MATLAB to find...

Given ? = ???+??? + ??? and ? = ???-3?? + ????. Use MATLAB to find the following: a) ? + ? b) ?  ? c) ? × ? d) A unit vector in the direction of ? − 2? e) ??? f) The component of ? along ?

2. Use MATLAB to convert points ?(11,4,15), ?(10,−14,33) and ?(−33,−14,15) from Cartesian to Cylindrical and Spherical coordinates.

Solutions

Expert Solution

(1)

Code:

A = [5, 7, 2];
B = [2, -3, 22];

C = A + B;
D = A-B;
E = cross(A, B);
F = A-2*B;
F = F/norm(F);
theta = acos(dot(A, B)/norm(A)/norm(B));
component = dot(A,B)/norm(B)^2 *B;
sprintf('A+B = %f ax + %f ay + %f az',C(1), C(2), C(3))
sprintf('A-B = %f ax + %f ay + %f az',D(1), D(2), D(3))
sprintf('AxB = %f ax + %f ay + %f az',E(1), E(2), E(3))
sprintf('unit vector in direction of A-2B = %f ax + %f ay + %f az',F(1), F(2), F(3))
sprintf('theta = %f rad',theta)
sprintf('component of A along B = %f ax + %f ay + %f az',component(1), component(2), component(3))

Output:

>> d
ans = A+B = 7.000000 ax + 4.000000 ay + 24.000000 az
ans = A-B = 3.000000 ax + 10.000000 ay + -20.000000 az
ans = AxB = 160.000000 ax + -106.000000 ay + -29.000000 az
ans = unit vector in direction of A-2B = 0.022739 ax + 0.295607 ay + -0.955039 az
ans = theta = 1.402396 rad
ans = component of A along B = 0.132797 ax + -0.199195 ay + 1.460765 az

(2)

Write two functions spherical and cylindrical to convert:

Spherical:

function f = spherical(x, y, z)
r = norm([x, y, z]);
theta = acos(z/r);
phi = atan(y/x);
f=[r, theta, phi];
end

Cylindrical:

function f = cylindrical(x, y, z)
r = norm([x, y]);
phi = atan(y/x);
f=[r, phi, z];
end

Now call these two functions to convert the three points:

Output:

>> spherical(11,4,15)
ans =

   19.02630    0.66262    0.34877

>> cylindrical(11,4,15)
ans =

   11.70470    0.34877   15.00000

>> spherical(10,-14,33)
ans =

   37.21559    0.48058   -0.95055

>> cylindrical(10,-14,33)
ans =

   17.20465   -0.95055   33.00000

>> spherical(-33,-14,15)
ans =

   38.85872    1.17449    0.40123

>> cylindrical(-33,-14,15)
ans =

   35.84690    0.40123   15.00000

>>


Related Solutions

3. Use matlab to plot the output voltage of an inverting operational amplifier given the following...
3. Use matlab to plot the output voltage of an inverting operational amplifier given the following conditions: K = Gain of the amplifier = 12.5. Vi = input voltage -2.5 < Vi < 2.5 V], (use 0.25 increments). V+ = positive power supply voltage, V+ = +20 V. V- = negative power supply voltage V- = -20V. Vo = output voltage Vo = -KVi Recall that if the output voltage Vo is greater than V+, or less than V-, the...
The volume of a sphere is given by V = 4πr3/3, where r is the radius. Use MATLAB
The volume of a sphere is given by V = 4πr3/3, where r is the radius. Use MATLAB to compute the radius of a sphere having a volume 40 percent greater than that of a sphere of radius 4 ft.
Use Matlab to find a subset of the set of vectors that forms a basis for...
Use Matlab to find a subset of the set of vectors that forms a basis for the span of the vectors. (a) {(1, 2, −1, 0), (−3, −6, 3, 0), (1, 0, 0, 1), (−2, −2, 1, −1)}
Use MATLAB to find the 8 point DFT of x(n) = cos(2πmn/8) (m=3) for 0 ≤...
Use MATLAB to find the 8 point DFT of x(n) = cos(2πmn/8) (m=3) for 0 ≤ n ≤ 7. Plot both x(n) and its DFT and explain your results. The "dct" and "fft" functions in MATLAB may be useful. Please post MATLAB code.
For the arrays x and y given below, use MATLAB to find all the elements in x that are greater than the corresponding elements in y.
For the arrays x and y given below, use MATLAB to find all the elements in x that are greater than the corresponding elements in y.x = [-3, 0, 0, 2, 6, 8] y = [-5, -2, 0, 3, 4, 10]
Matlab code please 6. Find the velocity, acceleration, and speed of a particle with the given...
Matlab code please 6. Find the velocity, acceleration, and speed of a particle with the given position function. (a) r(t) = e t cos(t)i+e t sin(t)j+ tetk t = 0 (b) r(t) = 〈t 5 ,sin(t)+ t 2 cos(t),cos(t)+ t 2 sin(t)〉, t = 1
The question is to use Matlab to find the clamped cubic spline v(x) that interpolates a...
The question is to use Matlab to find the clamped cubic spline v(x) that interpolates a function f(x) that satisfies: f(0)=0, f(1)=0.5, f(2)=2, f(3)=1.5, f'(0)=0.2, f'(3)=-1 and then plot v(x). This is my code so far: x = [0 1 2 3]; y = [0 0.5 2 1.5]; cs = spline(x,[0 y 0]); xx = linspace(0,3,101); figure() plot(x,y,'o',xx,ppval(cs,xx),'-'); IS THIS RIGHT? HOW CAN I GET MATLAB TO GIVE ME THE EQUATION OF v(x)?
Use the given values of n=2112 and p=3/4 to find the maximum value that is significantly​...
Use the given values of n=2112 and p=3/4 to find the maximum value that is significantly​ low, muμminus−2sigmaσ​, and the minimum value that is significantly​ high, muμplus+2sigmaσ. Round your answer to the nearest hundredth unless otherwise noted.
On Matlab use BFGS Method to find the minimum of the following function: f(x) = x13...
On Matlab use BFGS Method to find the minimum of the following function: f(x) = x13 - 2x2x12 + x12 - x1using initial point (x0, y0) = (1, 2)T to start, and stop when f changes less than 0.0001
Use MATLAB to create a program that answers the given problems: One of your friends has...
Use MATLAB to create a program that answers the given problems: One of your friends has an awful writing style: he almost never starts a message with a capital letter, but adds uppercase letters in random places throughout the message. It makes chatting with him very difficult for you, so you decided to write a plugin that will change each message received from your friend into a more readable form. Implement a function that will change the very first symbol...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT