Error using symengine First argument must not contain functionals.
Mostra commenti meno recenti
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);
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);
1 Commento
Torsten
il 11 Giu 2024
Please supply executable code that reproduces the error.
Risposte (1)
Avni Agrawal
il 18 Giu 2024
0 voti
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.
Categorie
Scopri di più su Conversion Between Symbolic and Numeric in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!