gradient & mathematical modeling and simulation using matlab prof. muhammad saeed
TRANSCRIPT
![Page 1: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/1.jpg)
Gradient & 2
Mathematical Modeling and Simulation Using
MATLAB
Prof. Muhammad Saeed
![Page 2: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/2.jpg)
Gradient I:x =-2:0.2:2;y = x .* exp(-x.^2);px = gradient(y,.2);quiver(x,px)
-5 0 5 10 15 20 250
0.5
1
1.5
2
2.5
3
![Page 3: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/3.jpg)
Gradient II:[x,y] = meshgrid(-2:0.2:2);z = x .* exp(-x.^2 - y.^2);[px,py] = gradient(z,.2,.2);contour(x,y,z), hold on, quiver(x,y,px,py), hold off
![Page 4: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/4.jpg)
Gradient II:[x,y] = meshgrid(-2:0.2:2);u = x .* exp(-x.^2 - y.^2);[gx,gy] = gradient(u,.2,.2);contour(x,y,u), hold on, quiver(x,y,gx,gy), hold off
![Page 5: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/5.jpg)
:2
[x,y] = meshgrid(-4:4,-3:3);u = x.*x+y.*y;
v = 4*del2(u)
V =4 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 44 4 4 4 4 4 4 4 4
![Page 6: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/6.jpg)
:2
,6
1
6 2
2
2
2
2
22
z
u
y
u
x
uul
[x,y,z] = meshgrid(-3:3,-3:3,-3:3);u = x.*x + y.*y + z.*z;v = 6*del2(u)
222 zyxu
![Page 7: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/7.jpg)
v(:,:,1) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,2) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,3) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,4) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,5) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,6) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
v(:,:,7) =
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
![Page 8: Gradient & Mathematical Modeling and Simulation Using MATLAB Prof. Muhammad Saeed](https://reader036.vdocuments.site/reader036/viewer/2022082408/5514d805550346935c8b51d8/html5/thumbnails/8.jpg)
End