So, say I wanted to assign a function J[x_, y_] :={D[system, x], D[system, y]}//Transpose where system is some system of equations. This seems to assign J to be the expression itself and the variables x,y are the variables it drives with respect to. How can I get it to assign to just the output of {D[system, x], D[system, y]} so that I don't get an error message when I try to plug actual numbers into the function?
Asked
Active
Viewed 129 times
0
SetDelayed(:=) andSet(=): https://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/18487#18487 Most of the time functions are best defined withSetDelayed, but this is an instance whereSetmay be more appropriate. – eyorble Dec 02 '22 at 18:41D[system, {{x, y}}]orGrad[sys, {x, y}]. – Alan Dec 02 '22 at 19:48