Function Repository Resource:

HarmonicConjugate

Source Notebook

Compute the harmonic conjugate of a function

Contributed by: Jordan Hasler, Wolfram|Alpha Math Team

ResourceFunction["HarmonicConjugate"][f,{x,y}]

returns a harmonic conjugate of the function f with respect to x and y.

Details

A harmonic function f is a function that satisfies the Laplace equation.
A function u(x,y) and a harmonic conjugate v(x,y) satisfy the Cauchy-Riemann equations, xu=yv and yu=-xv, signifying that f(x,y)=u(x,y)+iv(x,y) is a differentiable function in the complex plane.
The function returns the harmonic conjugate with constant 0.

Examples

Basic Examples (1) 

Compute a harmonic conjugate of a polynomial function:

In[1]:=
ResourceFunction["HarmonicConjugate"][x^2 - y^2, {x, y}]
Out[1]=

Scope (2) 

Compute a harmonic conjugate of a rational function:

In[2]:=
ResourceFunction["HarmonicConjugate"][-x/(x^2 + y^2), {x, y}]
Out[2]=

Visualize the harmonic conjugate:

In[3]:=
ContourPlot[y/(x^2 + y^2), {x, -2, 2}, {y, -2, 2}]
Out[3]=

Possible Issues (1) 

The function returns unevaluated if the function is not harmonic:

In[4]:=
ResourceFunction["HarmonicConjugate"][x^2 + y^2, {x, y}]
Out[4]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 09 December 2022

Related Resources

Author Notes

To view the full source code for HarmonicConjugate, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "HarmonicConjugate.wl"}]]

License Information