# Calculating the gradient of a surface

1. Aug 2, 2011

### kakarot1905

Hi

z(x,y,t)=a sin(ωt) sin(k/Lx*pi*x) sin(l/Ly*pi*y)

a = Amplitude
ω = Frequency
k and l are constants
Lx = Length in x direction
Ly = Length in y direction

How can I find [using an equation] the slope of the surface [ie the gradient] at any given point on the surface?

I know how to do it in the x direction and y direction independently:
dz/dx for x direction and dz/dy for y direction
But how do I combine these two things?

2. Aug 2, 2011

### tiny-tim

Last edited by a moderator: Apr 26, 2017
3. Aug 2, 2011

### kakarot1905

Thanks tiny-tim

I can calculate:

(dz/dx) = (k$\pi$a)/Lx sin($\omega$t) cos (k$\pi$x)/Lx
and
(dz/dy) = (l$\pi$b)/Ly sin($\omega$t) cos (l$\pi$y)/Ly

But what is dz/dt?

This is why I need to calculate the slope of the surface (z):

I am trying to calculate the weight [W] of a particle on the dynamic surface (z)
Because of the slope'ness' of the surface z, the acceleration of particle (parallel to the surface) is affected
So in order to calculate the surface parallel Weight, I need to W*(Gradient of the slope)

The above link by tiny-tim, helps me calculate the gradient in vector form, but how do convert it into a value to multiply it with W? Do I take the abs?

#### Attached Files:

• ###### Screen shot 2011-08-02 at 10.36.01 PM.png
File size:
3 KB
Views:
218
Last edited by a moderator: Apr 26, 2017
4. Aug 3, 2011

### tiny-tim

hi kakarot1905!
i really don't understand what you're trying to do

i don't see the relevance of the component W||, but it would be W times the sin of tan-1 of the gradient

5. Aug 3, 2011

### kakarot1905

Thanks for the suggestion tiny tim.

I got my plotting software [mathematica] to automatically calculate the gradient of the z function so I don't have to worry about taking dz/dx....

This is the code i used: [mathematica]
Code (Text):
(gradf[x_, y_, t_] = {D[z[x, y, t], x], D[z[x, y, t], y],
D[z[x, y, t], t]})