313 views

Uploaded by Mohamed Mounir Fekri

MATLAB can evaluate and plot most of the common vector calculus operations
that we have previously discussed.

- Calculus Concepts and Applications Paul A Foerster
- Introduction to Numerical Ordinary and Partial Differential Equations Using MATLAB
- Finite Element Ref.book (1)
- Calculus Honors Workbook
- Vector Calculus
- AP Calculus BC Study Guide
- Integration
- Calculus Complete Notes
- Vector Calculus Solution Manual
- Calculus Tutorial 1 --Differential Calculus
- Calculus Cheat Sheet Integrals
- Calculus II
- Calculus - Complete Book on Calculus 1,2 and 3 - Paul Dawkins
- Calculus I Complete
- Calculus III
- Calculus Multivariable 2nd Edition Blank & Krantz - Vector Calculus PDF
- Calculus Cheat Sheet Limits Definitions Limit at Infinity :
- Fundamentals of Calculus
- Vector Calculus
- Vector Calculus, Useful Stuff

You are on page 1of 5

MATLAB can evaluate and plot most of the common vector calculus operations that we have previously discussed. Consider the following example problems: Determine and Plot Contours of a Scalar Field and Plot a Vector Distribution of the Associated Gradient Field Choosing the field z xe ( x y ) , over the domain 2 ( x, y) 2 the MATLAB code is

2 2

listed in the text box. Note the use of the meshgrid command to establish a grid of points in the domain of interest. The command gradient calculates z , and quiver is a neat way to automatically plot the distribution of a vector field. The plot is shown below.

% Gradient Example % Draws z-Contours and Then Plots Gradient Vector Field v = -2:0.1:2; [x,y] = meshgrid(v); z = x .* exp(-x.^2 - y.^2); [px,py] = gradient(z,.2,.2); figure(1) contour(v,v,z,'linewidth',2) hold on quiver(v,v,px,py,'linewidth',1) hold off title('Gradient Plot'); axis equal

-2

-1.5

-1

-0.5

0.5

1.5

2.5

Calculate and Plot the Divergence of a Vector Field Choosing the vector field u x 2 i 2 y 2 j , we first plot the vector distribution using the quiver command. Next MATLAB computes the divergence of u using the divergence command and then plots contours on the same page. The code is listed in the text box. The plot is shown below.

% Divergence Example v = -2:0.1:2; [x,y] = meshgrid(v); u1=-x.^2;u2=2*y.^2; figure(2) quiver(x,y,u1,u2);hold on; div=divergence(u1,u2); contour(x,y,div,'linewidth',2) hold off title('Divergence Plot')

1.5

0.5

-0.5

-1

-1.5

-2 -2.5

-2

-1.5

-1

-0.5

0.5

1.5

Determine the Curl of a Velocity Vector wind and Make Plots We now wish to explore the behavior of a given set of velocity data from a file called wind. This file represents air currents over North America and is built into the MATLAB package (see help for more details). The code starts by loading the wind file, makes particular choices for the spatial viewing and then % Curl Example determines the velocity % Views the Curl Angular Velocity in One Plane components u and v. % Plots the Velocity Vectors in Same Plane load wind The curl is evaluated using % Choose Slice Plane and x,y Range k = 3; the curl command and x = x(:,:,k); y = y(:,:,k); then plotted using the u = u(:,:,k); v = v(:,:,k); cav = curl(x,y,u,v); pcolor command. The figure(3) pcolor(x,y,cav); shading interp code is given in the text hold on; quiver(x,y,u,v,'r','linewidth',1.5) box, and the plot of the hold off curl and velocity field title('Curl-Velocity Example Plot') colormap gray distribution is shown below.

Calculate and Plot Function and its Laplacian Next we wish to calculate the Laplacian of a given scalar field function , and make appropriate three-dimensional plots of each distribution over the domain of interest. The scalar function is specified by x 2 y 2 over the domain

4 ( x, y) 4 . The MATLAB code is given in the box. The Laplacian is calculated

using the del2 command, but notice that 2 4 * del2 and that the command requires input of the spacing distance of the meshgrid. Also notice the use of the surf command to do the 3-D plotting. Results are shown below. Note the analytical value 2 4 for this case.

% Laplacian Example % Calculate & Plot Function and Laplacian [x,y] = meshgrid(-4:0.5:4,-4:0.5:4); U = x.*x+y.*y; V = 4*del2(U); figure (4) surf(x,y,U) xlabel('x');ylabel('y'); title('Function Plot z = x^2 + y^2') figure(5) surf(x,y,V) xlabel('x');ylabel('y'); title('Laplacian Plot')

Function Plot z = x 2 + y 2

40

30

20

10

0 4 2 0 -2 y -4 -4 -2 x 2 0 4

Laplacian Plot

4.5

3.5

3 4 2 0 -2 y -4 -4 -2 x 2 0 4

- Calculus Concepts and Applications Paul A FoersterUploaded byBerto
- Introduction to Numerical Ordinary and Partial Differential Equations Using MATLABUploaded byÖzlem Yılmaz
- Finite Element Ref.book (1)Uploaded bymahzadkh
- Calculus Honors WorkbookUploaded bygbengel
- Vector CalculusUploaded byDavid
- AP Calculus BC Study GuideUploaded byarachide8
- IntegrationUploaded byKomal Shujaat
- Calculus Complete NotesUploaded byakhileshkumarkuniyil
- Vector Calculus Solution ManualUploaded bytjohnson93
- Calculus Tutorial 1 --Differential CalculusUploaded byDr Srinivasan Nenmeli -K
- Calculus Cheat Sheet IntegralsUploaded byhyd arnes
- Calculus IIUploaded byallanviento
- Calculus - Complete Book on Calculus 1,2 and 3 - Paul DawkinsUploaded byvincepay
- Calculus I CompleteUploaded byxenocid3r
- Calculus IIIUploaded byallanviento
- Calculus Multivariable 2nd Edition Blank & Krantz - Vector Calculus PDFUploaded byJana
- Calculus Cheat Sheet Limits Definitions Limit at Infinity :Uploaded byapi-11922418
- Fundamentals of CalculusUploaded bycarlosbares
- Vector CalculusUploaded bysetideba
- Vector Calculus, Useful StuffUploaded byCarlos Fuentes Miranda
- Nathan Ida Ph.D., João P. a. Bastos Ph.D. (Auth.), R. Mittra Ph.D. (Eds.)-Electromagnetics and Calculation of Fields-Springer US (1992)Uploaded byRafael Garcia
- Curl & DivergenceUploaded byArnab Das

- Fundamentals of WiMAX - A Technology PrimerUploaded byMohamed Mounir Fekri
- CCNA MCQUploaded byMohamed Mounir Fekri
- AclUploaded byMohamed Mounir Fekri
- VOIPUploaded byMohamed Mounir Fekri
- Voice over Internet Protocol (VoIP)Uploaded byMohamed Mounir Fekri
- Partial Differential Equations: Analytical and Numerical MethodsUploaded byMohamed Mounir Fekri
- Harvard Entrance Exam - 1899Uploaded byJared Moya
- CV instructionsUploaded byMohamed Mounir Fekri
- Implementation of Maxwell’s Equations in MATLAB to Study the Effect of Absorption Using PMLUploaded byMohamed Mounir Fekri
- Sip Server Technical Overview White PaperUploaded byMohamed Mounir Fekri
- Solution of the Partial Differential EquationsUploaded byMohamed Mounir Fekri
- MATLAB as a CalculatorUploaded byMohamed Mounir Fekri
- ECT 120 - WiMAX Fundamentals - Fixed and MobileUploaded byMohamed Mounir Fekri
- What is Digital CommunicationsUploaded byMohamed Mounir Fekri
- Electromechanics of a Solenoid MatlabUploaded bysnthej
- 3 Tcp Ip ModelUploaded byMohamed Mounir Fekri
- V10 VoIP Service ReferenceUploaded byMohamed Mounir Fekri
- Sampling TheoremUploaded byMohamed Mounir Fekri
- Signals and System Question BankUploaded bySri Dhar
- Nyquist Shannon Sampling TheoremUploaded byMohamed Mounir Fekri

- kelompok 1 1D3TBUploaded byNico Fernanda Putra
- Chapter 01Uploaded bydctinocencio
- Math 55 Vector Fields HandoutUploaded byBea Ducao
- Formulas AlgebraUploaded byNahuel Acevedo
- ArtCAM Express Step by Step for iCarver Mar 8Uploaded byDario Zelic
- Gradient Curl Dan OperatorUploaded byAnonymous RU7gg1
- Vectors-1.pdfUploaded bypreetha
- 2.Vectors NotesUploaded byggmmnmcncnnm
- Vector Calculus Solution ManualUploaded bytjohnson93
- 8HM7CPEVHV9HIBTJTPFVL33UMJ3FKG.pdfUploaded byLuis Alfonso Ramos Bolaños
- 2VA-N5.pdfUploaded byKendid Mahmudi
- Co-3 Course Material (Vector Calculus)Uploaded bymahesh micky
- Chapter 1 Vector AlgebraUploaded byNabila Fauzi
- EMFUploaded byS Bharadwaj Reddy
- Puente Clase 3 Ejercicios VectoresUploaded bycarlosferda
- Math 234 TextUploaded byAaron Cottrell
- 12 Vector Fields - HandoutUploaded byJohn
- 02AP Physics C - VectorsUploaded byAditya Pal
- Statics-M.L.Khanna.pdfUploaded byAnonymous Ku3Q3eChF
- Ch03 physics for scientists and engineeringUploaded byjohnb2b
- 6421092Uploaded byLizandro Delgado Huañec
- Vector IdentitiesUploaded byRajendra Prasath
- Vectors Concept 2014Uploaded bysanjeev1000
- ALL TEST 1.docxUploaded byBabar Sultan
- app6Uploaded byReysan Caballero Gonzales
- 10 VectorsUploaded byHarsh Ravi
- P3 Chapter 7 VectorsUploaded byAnonymous Kx8TAybnXQ
- Vectors Lesson1 and 2 Class LessonUploaded byChevaneice Clarke
- Multiplication of VectorsUploaded bychashma
- CurlUploaded byraktimguha