Question

In: Math

Create a Matlab program that can evaluate Green Theorem

Create a Matlab program that can evaluate Green Theorem

Solutions

Expert Solution

The vector field is F = ( -y*(1-x-y)+x/4, 2-x^2+y/4 ), the region R consists of the points (x,y) with x^2+y^2<=1. Let C be the boundary curve (counterclockwise). We will find a parametrization of C. We plot the vector field together with C.

Consider a 2D vector field in a circle:

syms x y z t real
Pi = sym('pi');
F = [ -y*(1-x-y)+x/4, 2-x^2+y/4 ];       % vector field F
vectorfield(F,-1:.2:1,-1:.2:1); hold on  % plot vector field
X = cos(t); Y = sin(t);                  % parametrization r=[X,Y] of curve
P = ezplot(X,Y,[0,2*pi]);                % plot curve
set(P,'Color','black','LineWidth',2)     % make curve black, thicker
hold off

Find the work integral W by using Green's theorem:

G = curl([F,0],[x y z])                 % need vector field of 3 components for curl
g = G(3)                                % 3rd component of curl

syms r theta real
X = r*cos(theta); Y = r*sin(theta);     % polar coordinates
gr = subs(g,{x,y},{X,Y})                % substitute polar coordinates for x,y in g
W2 = int(int(gr*r,r,0,1),theta,0,2*Pi)  % integrate gr*r*dr*dtheta
                                        % gives same result as (2a)!

vectorfield(F,-1:.2:1,-1:.2:1); hold on % plot vector field
P = ezplot(cos(t),sin(t),[0,2*pi]);     % plot curve
set(P,'Color','black','LineWidth',2)
ezpcolor(g,[-1.2 1.2 -1.2 1.2]); hold off % plot 3rd curl component
colorbar; colorposneg
title('colors show curl: blue is clockwise, red is counterclockwise')


Related Solutions

This is a Matlab Question Create MATLAB PROGRAM that can solve First Order Linear Differential Equation...
This is a Matlab Question Create MATLAB PROGRAM that can solve First Order Linear Differential Equation ( 1 example contains condition and the other does not have condition). 1. ty′ + 2y = t^2 − t + 1, y(1)=12 The correct answer is y(t) = 1/4 t^2 − 1/3 t + 1/2 + 1/12t^2 2. (x-1) dy/dx + 2y = (x+1)^2 The correct answer is y = (x(x+1) / x-1 ) + C(x+1) / x-1 The correct answer is
Could you create me a secant code in Matlab program? That's I can keep it and...
Could you create me a secant code in Matlab program? That's I can keep it and use it for any time?
Create a program using Matlab that can solve Three Dimensional Space; Vectors, Partial Derivatives or any...
Create a program using Matlab that can solve Three Dimensional Space; Vectors, Partial Derivatives or any of the topic in calculus 3; show 5 examples please thankyou!! just use matlab for the solution like the codes thankyou
** USING MATLAB TO PROGRAM The main objective of this lab is to create a game...
** USING MATLAB TO PROGRAM The main objective of this lab is to create a game that involves betting on the sum of two dice. The player will start out with some initial total amount of money. During each round, the player can bet some money that the sum of the two dice will be equal to a certain number. If the player wins the bet, that player adds the amount of the bet to his or her current total....
MATLAB is program Respond fast please a quiz Create a MATLAB script. Using nested for loops,...
MATLAB is program Respond fast please a quiz Create a MATLAB script. Using nested for loops, evaluate the multivariable function: z = sin ⁡ ( x ) cos ⁡ ( y ) for x between -4 and 4 in steps of 1 y between -2 and 2 in steps of 1 Display the matrix z Cut and paste the following into a word doc and submit to this question. Your script code Your input Your output
Language: matlab It is desired to create a mortgage estimator by writing a program containing a...
Language: matlab It is desired to create a mortgage estimator by writing a program containing a function. The user inputs the amount of loan (L), the loan term in number of months (N), and the annual interest rate (I) in the script. The script then makes use of a function that accepts these values as inputs through its argument and calculates and returns the monthly payment and the total payments over the life of the loan. The monthly payment and...
I have this matlab program, and need to turn it into a C++ program. Can anyone...
I have this matlab program, and need to turn it into a C++ program. Can anyone help me with this? % Prompt the user for the values x and y x = input ('Enter the x coefficient: '); y = input ('Enter the y coefficient: '); % Calculate the function f(x,y) based upon % the signs of x and y. if x >= 0    if y >= 0        fun = x + y;    else        fun = x + y^2;    end...
Create a matlab program that calculates equivalent cpacitance and charge by asking the user whether the...
Create a matlab program that calculates equivalent cpacitance and charge by asking the user whether the circuit is in paraller , series or combination and then asks for the values of capacitances and voltage. After that it calculates the equivalent capacitance.
Create a Matlab program to load in the attached file File_Q5_Use.csv. You will first need to...
Create a Matlab program to load in the attached file File_Q5_Use.csv. You will first need to click on the link to open it, then save it as a .csv file in the directory you are using in your Matlab programs before you can load it in to Matlab. It has 2 columns, the first column is the x values, the second column is the y values. Set Figure (1). Plot the points using red stars and a blue line with...
Create a Matlab program to load in the attached file File_Q5_Use.csv. You will first need to...
Create a Matlab program to load in the attached file File_Q5_Use.csv. You will first need to click on the link to open it, then save it as a .csv file in the directory you are using in your Matlab programs before you can load it in to Matlab. It has 2 columns, the first column is the x values, the second column is the y values. Set Figure (1). Plot the points using red stars and a blue line with...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT