The situation I have is as follows:
I have a symbolic expression like:
syms X Y Z K
P=[0 0 200];
Z are defined as symbolic.
P are vectors.
I need to get the gradient of
Sa but I get an error:
Error using symengine (line 59)
The first argument must be of type 'Type::Arithmetical'.
Error in sym/gradient (line 39)
res = mupadmex('symobj::gradient',fsym.s,x.s);
But if I write the same expression as:
I get the expected result
G(X, Y, Z) =
2*Z - 400
Does anyone knows why this is so and if there's any way of using the implicit expression as this is a particular case but in general I have different implicit expressions and my code should be able to deal with them.
I've read the documentation on
gradient and some sites, but if I found the answer I didn't notice.
I believe I could use the second form but still, I am curious about this subject.
Thanks for your time.