There is a built-in jacobian function, but no grad; there should be a built-in grad function, even if it only punts to jacobian. People looking for grad are unlikely to find jacobian.
Don't several share packages define grad or gradient? Are their definitions consistent?
Do they assume that you're working in Cartesian coordinates?
Isn't it useful to have a grad operator that doesn't calculate out the diffs, but can be used symbolically?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(1) About jacobian and grad, I just want them to be consistent with each other.
(2) About existing definitions, there's at least one I can think of (share/vector/vect.mac), and it allows different coordinate systems (share/vector/vect_transform.mac). I didn't look for other definitions.
Incidentally vect.mac also defines div, curl, etc.; dunno if we want to try to import all that stuff too.
(3) Agreed that allowing symbolic gradients is desirable. Probably diff, grad, jacobian, etc., should all be consistent in that respect.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using jacobian to find a gradient one would have to write
and the result would be a matrix. Instead of punting to jacobian, I would prefer defining it:
Which is easier to use:
and returns a list instead of a matrix.
Don't several share packages define grad or gradient? Are their definitions consistent?
Do they assume that you're working in Cartesian coordinates?
Isn't it useful to have a grad operator that doesn't calculate out the diffs, but can be used symbolically?
These are all great points.
(1) About
jacobian
andgrad
, I just want them to be consistent with each other.(2) About existing definitions, there's at least one I can think of (share/vector/vect.mac), and it allows different coordinate systems (share/vector/vect_transform.mac). I didn't look for other definitions.
Incidentally vect.mac also defines
div
,curl
, etc.; dunno if we want to try to import all that stuff too.(3) Agreed that allowing symbolic gradients is desirable. Probably
diff
,grad
,jacobian
, etc., should all be consistent in that respect.