Error using symengine First argument must not contain functionals.

7 Ansichten (letzte 30 Tage)
Arti
Arti am 11 Jun. 2024
Beantwortet: Avni Agrawal am 18 Jun. 2024
Dear MathWorks-Community,
I recived the following error message:
Error using symengine
First argument must not contain functionals.
Error in mupadengine/evalin_internal
Error in mupadengine/fevalHelper
Error in mupadengine/feval_internal
Error in sym/diff (line 107)
R = feval_internal(symengine, 'symobj::diff', S, x, n);
When I wanted to run my code it appeard for line 10 where I am calculating diffL_over_theta1dot. Can someone please explain me why it worked for diffL_over_alpha1 in line 4 but not for line 10?
L is a symfun.
Can anyone help me with resolving this issue?
Thanks a lot in advance!
syms tau_1
syms theta_1(t) alpha_1(t)
alpha_1dot=diff(alpha_1,t);
diffL_over_alpha1dot=diff(L,alpha_1dot);
Unrecognized function or variable 'L'.
tau_1==diff(diffL_over_alpha1dot,t)-diff(L,alpha_1);
theta_1dot=diff(theta_1,t);
diffL_over_theta1dot=diff(L,theta_1dot)
0==diff(diffL_over_theta1dot,t)-diff(L,theta_1);

Antworten (1)

Avni Agrawal
Avni Agrawal am 18 Jun. 2024
Hi Arti,
I understand that you are facing the error while using symengine. The error message you sre encountering, Error using symengine with the detail that "First argument must not contain functionals," typically arises when the symbolic engine encounters an expression or operation that it cannot process due to the nature of the input arguments. In your case, the error occurs when trying to differentiate a symbolic function, L, with respect to the derivative of another symbolic function, theta_1dot, which is derived from theta_1(t).
Confirm that L is defined as a symbolic function that explicitly includes the variables you're differentiating with respect to. If L depends on theta_1dot, it must be defined as such.
For example:
syms L(tau_1, theta_1, theta_1dot)
I hope this helps.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by