Question: Using Matlab, You have had 2 summer interns working with you this past summer and you are trying to decide which student to hire full

Using Matlab,

You have had 2 summer interns working with you this past summer and you are trying to decide which student to hire full time. You decide to devise a contest between your interns, Twiddle Dee and Twiddle Dum. You have invented a potential function by taking three consecutive, non-zero digits from your phone number or address (not zip code) as the numbers a, b, and c in the potential function .

You then ask your two interns to use this function and then to have MATLAB compute the corresponding vector field, showing the partial differentiation etc. in MATLAB.

Twiddle Dee does this and computes the vector field correctly, but Twiddle Dum inadvertently changed the sign of the y-component of the vector field and used the incorrect vector field when he used MATLAB to graph it and throughout the rest of his work.

Please now show Twiddle Dees work and Twiddle Dums work. Make it clear which is which, and discuss them separately in your report.

PART I

Graph Twiddle Dees vector field in a window [-10, 10] by [-10, 10] using 11 arrows in each direction. Hint: use the sample code below. Do the same for Twiddle Dum.

Twiddle Dee and Twiddle Dum are to compute the work done as a particle moves through their vector fields along three different paths from (-4,-2) to (2,4)

One path straight

One path parallel to axes (two pieces)

One path parabolic, with vertex at (-4, -2)

Graph each path separately on the corresponding vector fields (3 graphs for each intern)

Compare and contrast the results of their path integrals.

PART II

Start at (7,0) and use MATLAB to perform the path integral (counterclockwise) over a closed path (circle, radius 7, centered at origin).

Graph this path on top of each vector field.

Start at (8,-2) and perform the same integration over a rectangular path (up 6, left 8, down 6, right 8).

Graph this path on top of each vector field.

What value would you expect for these integrals? Discuss briefly.

Compare the two vector fields. Can you describe why one is conservative and the other is not?

Write a report of your findings separate from your m file.

List your potential function

Graphs of vector field for each intern

Graphs of 3 open paths for each intern

Discussion of work done on open paths

Contrast work done Twiddle Dees and Twiddle Dums fields

How can any difference be expressed by the vector fields themselves?

If you are deciding which intern to hire based on the work they have performed, which one would have a job this next summer and why?

List at least five new commands you used in this project, listing the input parameters and what they do.

Upload your report and one m file to Canvas.

% Program MATH240_Project3

% 2-D vector fields

% Here is a radial vector field F = r / r^3

% Replace this with your non-radial conservative field

u = inline('x./(x.^2+y.^2).^(3/2)','x','y') ;

v = inline('y./(x.^2+y.^2).^(3/2)','x','y') ;

x = linspace(-5,5,11) ;

y = linspace(-5,5,11) ;

[X,Y] = meshgrid(x,y) ;

U = u(X,Y) ;

V = v(X,Y) ;

quiver(X,Y,U,V,'color','red')

figure

% Here is a circulation vector field F = <-y,x>/r

% Replace this with your non-circulation NONconservative field

u = inline('-y./(x.^2+y.^2).^(1/2)','x','y') ;

v = inline('x./(x.^2+y.^2).^(1/2)','x','y') ;

x = linspace(-5,5,11) ;

y = linspace(-5,5,11) ;

[X,Y] = meshgrid(x,y) ;

U = u(X,Y) ;

V = v(X,Y) ;

quiver(X,Y,U,V,'color','blue')

A few more helps: do NOT have your vector field and the path in the same color; : Note b= blue, r= red, g= green, k= black etc.

hold on is a command that says graph the next thing on the same graph

hold off is a command that says start a new graph

It is helpful to define your vector field F, your contour ( r = ), find r(t) = dr and then set integrand = dot(F, dr) and then do the integration. Make sure you have the correct bounds for your integration, they change during the project and depend on how you have defined the contour.

To graph the path parallel to each axis you may use: Note b= blue, r= red, g= green, k= black etc.

fplot('-2',[-4,2],'b')

x=linspace(2,2,601);

yb=[-2:.01:4];

plot(x,yb,'b')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!