- #1
sciwizeh
- 25
- 0
Hello, I've been reading up on Smoothed Particle Hydrodynamics. While reading some papers I found some math that I do not know how to do because I never took multi variable calculus. I need the gradient and laplacian of all three of the following functions ( h is a constant ):
Wpoly6(r,h)=[itex]\frac{315}{64\pi h^{9}}\begin{cases}
(h^{2}-|r|^{2})^{3} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
Wspiky(r,h)=[itex]\frac{15}{\pi h^{6}}\begin{cases}
(h-|r|)^{3} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
Wviscosity(r,h)=[itex]\frac{15}{2\pi h^{3}}\begin{cases}
-\frac{r^{3}}{2h^{3}}+\frac{r^{2}}{h^{2}}+\frac{h}{2r} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
note: almost copied the last one wrong, the last term of the top is h over 2r and the other terms are r's over h's
If I understand correctly the magnitude operation makes this an essentially 1 dimensional problem and the gradient is the derivative and the lapracian is the second derivative. Am I right in this thought? If not what does it mean?
I am very rusty in my calculus, so even if that is true, I would prefer the answers rather than the procedure. The only thing I need in order to translate the papers to an implementation is these 6 more equations.
Wpoly6(r,h)=[itex]\frac{315}{64\pi h^{9}}\begin{cases}
(h^{2}-|r|^{2})^{3} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
Wspiky(r,h)=[itex]\frac{15}{\pi h^{6}}\begin{cases}
(h-|r|)^{3} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
Wviscosity(r,h)=[itex]\frac{15}{2\pi h^{3}}\begin{cases}
-\frac{r^{3}}{2h^{3}}+\frac{r^{2}}{h^{2}}+\frac{h}{2r} & 0\leq r\leq h \\
0 & \text{ otherwise }
\end{cases}[/itex]
note: almost copied the last one wrong, the last term of the top is h over 2r and the other terms are r's over h's
If I understand correctly the magnitude operation makes this an essentially 1 dimensional problem and the gradient is the derivative and the lapracian is the second derivative. Am I right in this thought? If not what does it mean?
I am very rusty in my calculus, so even if that is true, I would prefer the answers rather than the procedure. The only thing I need in order to translate the papers to an implementation is these 6 more equations.