JuliaSymbolics / Symbolics.jl

Symbolic programming for the next generation of numerical software
https://symbolics.juliasymbolics.org/stable/
Other
1.32k stars 147 forks source link

Vector calculus operators #181

Open valentinsulzer opened 3 years ago

valentinsulzer commented 3 years ago

See https://github.com/SciML/DiffEqOperators.jl/issues/364

I was thinking of adding an abstract type AbstractDifferentialOperator which does what Differential currently does and making Differential, Laplacian, Gradient, and Divergence concrete subtypes.

Let me know if you have any suggestions that would help implement this

┆Issue is synchronized with this Trello card by Unito

ChrisRackauckas commented 3 years ago

I think that makes sense.

fgerick commented 3 years ago

Maybe it should be noted somewhere that this is restricted to Cartesian coordinates, or there should be a more general framework when implementing Laplacian, Gradient, Divergence and curl?

valentinsulzer commented 3 years ago

In the context of ModelingToolkit it makes sense to allow different coordinates based on the user-specified domain. Within pure Symbolics.jl and thinking about array symbolics I don't know what the solution is

ChrisRackauckas commented 3 years ago

Well array symbolics gives rise to manifold symbolics. "x is a point in on the sphere" is such an object. As a mathematical object, it can either be a 3-dimensional Cartesian vector or a 2-dimensional vector of angles. As an array object, it has to choose which of the two it is, but as a symbolic object it does not need to. In that sense, it would be really nice to be able to fully represent manifold equations in their equation-free form. In that sense, the manifold Laplacian is a well-defined coordinate-free object, so x in Sphere(); Laplacian(x) is a statement which would be really nice to have, as it could then generate the code in both coordinate systems for any discretization!

valentinsulzer commented 3 years ago

100% agree with this