Good morning/afternoon/evening,

Using R, I am trying to calculate stream function (psi) and velocity potential 
(phi) from both 2D zonal (u) and meridional wind (v).

I Stream function

The stream function can be obtained from the vorticity (vorticity):

vorticity = curl(u,v)

or in other terms: 

vorticity = dv/dx - du/dy + u tan(th)/rad 

This second approach is easily done using the function 'grad' in 'oce' package.

Thus, the stream fuction is obtained solving the following Poisson equation (1):

laplacian(psi) = vorticity (1)

or:

div grad (psi) = vorticity


II Vorticity

The vorticity can be obtained from the divergence (divergence):

divergence = div(u,v)

or in other terms: 

divergence = du/dx + dv/dy - v tan(th)/rad 

This second approach is also easily done using the function 'grad' in 'oce' 
package.

Thus, the vorticity is obtained solving the following Poisson equation (2):

laplacian(phi) = divergence (2)

or:

div grad (phi) = divergence


Is there a way to solve both Poisson equations (1) and (2) in R?

Best Regards,
Pascal Oettli


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to