PHY103A Demos

(*     Lecture # 1   *)

One-Dimensional Function

Needs["VectorAnalysis`"]
ClearAll;
Clear[x, μ,σ]
μ=1;
σ=4;
f[x_]:= Exp[-((((x-μ))^2)/(2 (σ^2)))];
range=10;
Plot[f[x],{x,-range,range}, PlotRange->{0,1}]

Two-dimensional Function

ClearAll;
μ1=0;
μ2=0
σ1=2;
σ2=4;
g[x_, y_]:= Exp[-((((x-μ1))^2)/(2 ((σ1)^2)))] Exp[-((((y-μ2))^2)/(2 ((σ2)^2)))];
range=10;
Plot3D[g[x, y],{x,-range,range}, {y,-range,range}, PlotRange->{0,1}]

Vector Field

VectorPlot[{x, -y},{x,0,2},{y, 0, 2}]