MATHEMATICA – AN INTRODUCTION R.C. Verma Physics Department Punjabi University Patiala – 147 002 PART III- GRAPHICS Two-dimensional plots Three-dimensional.

Slides:



Advertisements
Similar presentations
VC.01 Part B Vectors and Parametric Plotting. VC.01 Part B Make sure you read the Tutorials AND the Basics for this homework assignment.
Advertisements

CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
CSE 123 Symbolic Processing. Declaring Symbolic Variables and Constants To enable symbolic processing, the variables and constants involved must first.
MATHEMATICA – Computer Simulation R.C. Verma Physics Department Punjabi University Patiala – PART IX- Computer Simulation RC - Circuit LR-Circuit.
MATHEMATICA – Computer Simulation R.C. Verma Physics Department Punjabi University Patiala – PART IX- Computer Simulation Mechanics.
Copyright © Cengage Learning. All rights reserved.
QUADTRATIC RELATIONS Standard Form.
PARTIAL DERIVATIVES 14. PARTIAL DERIVATIVES 14.6 Directional Derivatives and the Gradient Vector In this section, we will learn how to find: The rate.
MATLAB GRAPHICS 2-D.
Computer Graphics - Class 14
17 VECTOR CALCULUS.
17 VECTOR CALCULUS.
Drawing Parametric Curves Jean-Paul Mueller. Curves - The parametric form of a curve expresses the value of each spatial variable for points on the curve.
Vectors in Physics (Continued)
2.1 Functions and their Graphs p. 67. Assignment Pp #5-48 all.
Section 11.3 Partial Derivatives
10-2 Graphing Functions Learn to represent linear functions using ordered pairs and graphs.
Is this relation a function? Explain. {(0, 5), (1, 6), (2, 4), (3, 7)} Draw arrows from the domain values to their range values.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
0.1 Functions and Their Graphs. Real Numbers A set is a collection of objects. The real numbers represent the set of numbers that can be represented as.
Linear Law “Transformation” of non-linear relationships into linear relationships.
Matlab Programming for Engineers Dr. Nidal Farhat Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
VC.01 Part B Vectors and Parametric Plotting. VC.01 Part B G4, G5, G7, G8 are all due by 7:30 AM on Friday Quiz on Friday, cumulative over all of VC.01.
ME 2304: 3D Geometry & Vector Calculus Dr. Faraz Junejo Gradient of a Scalar field & Directional Derivative.
Gradient of a Curve: this is given by the gradient of the tangent
Section 11.1 Plane Curves and Parametric Equations By Kayla Montgomery and Rosanny Reyes.
How to solve ODEs using MATHEMATICA Plasma Application Modeling POSTECH Gan-Young Park and Jae-Koo Lee Department of Electronic and Electrical Engineering,
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Section 8-6 Vectors and Parametric Equations. Vocabulary 11. Vector Equation – Equation of a vector 12. Parametric Equation – model of movement.
Precalculus Parametric Equations graphs. Parametric Equations  Graph parametric equations.  Determine an equivalent rectangular equation for parametric.
Wave Dispersion EM radiation Maxwell’s Equations 1.
Program design and algorithm development We will consider the design of your own toolbox to be included among the toolboxes already available with your.
GRAPHICS AND VISUALISATION WITH MATLAB UNIVERSITY OF SHEFFIELD CiCS DEPARTMENT Deniz Savas & Mike Griffiths May 2015.
Multivariable Calculus f (x,y) = x ln(y 2 – x) is a function of multiple variables. It’s domain is a region in the xy-plane:
Programming For Nuclear Engineers Lecture 11 MATLAB (2) 1.
CS100A, Fall 1998, Lecture 191 CS100A, Fall 1998 Lecture 19, Thursday Nov 05 Matlab Concepts: Matlab arrays Matlab subscripting Matlab plotting.
2.1 Functions and their Graphs Standard: Students will understand that when a element in the domain is mapped to a unique element in the range, the relation.
Section 4.2.  Label the quadrants on the graphic organizer  Identify the x-coordinate in the point (-5, -7)
Inverse Trig Functions Modified from the lesson at: Functions....%20Cached%20Similar.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
The unit normal is given by which of the following?
Copyright © Cengage Learning. All rights reserved.
Graphing Linear Equations
Copyright © Cengage Learning. All rights reserved.
Functions and their Graphs
Sketching Graphs Maths Methods Unit 1.
2.1 Functions and their Graphs
Copyright © Cengage Learning. All rights reserved.
8-1: Relations and Functions
Copyright © Cengage Learning. All rights reserved.
Section 3.6 Functions.
Graphing Absolute Value Equations in two variables
Copyright © Cengage Learning. All rights reserved.
MATLAB DENC 2533 ECADD LAB 9.
Functions of several variables
Basic Graphing Techniques
The natural base Chapter 4.3.
Net 222: Communications and networks fundamentals (Practical Part)
Static and dynamic surfaces representation
Plotting Signals in MATLAB
2.1 Represent Relations and Functions
y x y = x + 2 y = x + 4 y = x – 1 y = 6x – 3 y = 2x y = ½x y = 3x + 1
5.1 Functions and their Graphs
Aim: How do we graph lines using a table?
2.1 Represent Relations & Functions
Introduction to Functions & Function Notation
16.2: Line Integrals 16.3: The Fundamental Theorem for Line Integrals
Presentation transcript:

MATHEMATICA – AN INTRODUCTION R.C. Verma Physics Department Punjabi University Patiala – PART III- GRAPHICS Two-dimensional plots Three-dimensional plots. List plots Contour plots Density plots Parametric plots Parametric 3D-plots Anmation

30. Two-Dimensional Plot In[1]:= Plot[2x^3 –x^2 + 2, {x, -2, 2}]

30.1 Options for Plots: Setting Range, Scales, Labeling and PlotStyles The vertical range can be specified using the PlotRange option. This is useful for focusing on a significant feature of a graph. Plots may be assigned to some variable. In[2]:= p1=Plot[2x^3 –x^2 + 2,{x,-2, 2}, PlotRange->{-5, 5}]

In[3]:= p2 = Plot[ Exp[-0.1 x] Sin[x],{x,-5,5},PlotRange->{-2,2}]

In[4]:= Plot[Sin[x], {x, -Pi, Pi}, AxesLabel->{"x","Sin[x]"}]

ln[5]:= Plot[Sin[t], {t, 0, 2Pi}, AxesLabel -> {"Time","Amplitude"}, PlotLabel —> "Sine Wave"]

Plot[Sin[x], {x,0,2 Pi},PlotStyle->{RGBColor[1,0,1]}]

Mathematica also has ability to cope with poles. In[6]:= Plot[ 1/Sin[x], {x, -Pi, Pi}]

31. Plotting two or more functions ln[7]:= Plot[{ Exp[-0.1 x] Sin[x], x^2 -3x +1}, {x, -5, 5}] plots exp[-0.1x] sin(x) and x^2 –3 x + 1 over the interval [-5, 5].

31.1 Show The Show[ ] command superimposes many plots. For instance, plotting some of the earlier named plots, type In[8]:= Show[p1, p2]

32. Three Dimensional Plotting For creating three dimensional plots, use Plot3D[ ] The arguments of Plot3D[ ] are similar to those of the function Plot[ ]. In[9]:= Plot3D[Sin[x] Cos[y], {x.-Pi.Pi}, {y.-2Pi.2Pi}]

In[9]:= Plot3D[Sin[x] Cos[y], {x.-Pi.Pi}, {y.-2Pi.2Pi}, AxesLabel -> {x,y,z}, PlotPoints->40]

33 Evaluate command A list of expressions can be given to Mathematica to plot using the Table[ ] In such case, Evaluate command forces evaluation of the command. In[10]:=Plot[Evaluate[Table[ Cos[a*x],{a, 1, 5}]], (x, 0, 2Pi}];

34. ListPlot ListPlot[ ] command draws a list of points, given as coordinate pairs (x, y). ln[11]:= p3 =ListPlot[{{-5, -3}, {-3, 2}, {0.5, 6.3), {2.5, 1.4}, {5, 3}}, PlotJoined -> True];

To draw a plot joining the points (1, y1), (2,y2),..., (n, y n ). In[12]:= ListPlot[ { 2.5, 3.7, -1.2, 7.0, 9.1, -2.3}, PlotJoined->True ]

35. ContourPlot ContourPlot creates contours of an expression involving two variables. The contours are the curves on which the expression is constant. The contours are drawn on a rectangle. Ranges for each variable in the expression can be given. In[12]:= p4 = ContourPlot[x^3 +y^2, {x, -3, 3}, {y, -3. 3}]

36. DensityPlot This has the syntax similar to that of the ContourPlot[ ], but it has different options. For an expression involving two variables, this produces a shading of chosen rectangle. In[13]:= DensityPlot[x^3 +y^2, {x, -3, 3}, {y, -3. 3}]

Plotting a Vector field <<VectorFieldPlots`; VectorFieldPlot[{x, y}, {x, 0, 1}, {y, 0, 1}]

VectorPlot (* Needs["Graphics`PlotField`"]; *) <<VectorFieldPlots`; vector={x, y}/(x^2 + y^2)^(3/2) PlotVectorField[ vector, {x, -7,7,2}, {y, -7,7,2}]

Gradient of Scalar <<VectorFieldPlots`; scalar=1/Sqrt[x^2+y^2] PlotGradientField[scalar, {x,-5,5,2},{y,-5,5,2}]

37. ParametricPlot ParametriePlot[ ] draws the curve formed by a pair of expression {x[t], y[t]} as the parameter t varies. In[14]:= ParametricPlot[ {Exp[-t/20] Cos[t],Exp[-t/20] Sin[t]},{t,0,50}]

38. ParametricPlot3D This plots a parametrically defined three-dimensional curve (or a parametrically defined three-dimensional surface). It is part of the collection of Graphics packages, which must be loaded explicitly before it can be used, In[15]:= <<Graphics`ParametricPlot3D` In[16]:= ParametricPlot3D[{Cos[x], Sin[x],x/4}, {x, 0, 2Pi}];

SphericalPlot SphericalPlot3D[ 1+2 Cos[2 q], {q,0,Pi}, {f,0,2 Pi} ]

39. Plotting Spherical Harmonics (Math2.2) Needs["Graphics`ParametricPlot3D`"] SphericalPlot3D[ Abs[ SphericalHarmonicY[3, 1, theta, phi] ], {theta, 0, Pi, Pi/30}, {phi, 0, 2 Pi, Pi/15}]

In Math 6.0 SphericalPlot3D[Abs[SphericalHarmonicY[3,1,theta,phi]],{theta,0,Pi},{phi,0,2 Pi}]

SphericalPlot3D[Abs[SphericalHarmonicY[5,1,theta,phi]],{theta,0,Pi},{phi,0,2 Pi}]

End of part III