Error using symengine First argument must not contain functionals.

9 ビュー (過去 30 日間)
Arti
Arti 2024 年 6 月 11 日
回答済み: Avni Agrawal 2024 年 6 月 18 日
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);
  1 件のコメント
Torsten
Torsten 2024 年 6 月 11 日
Please supply executable code that reproduces the error.

サインインしてコメントする。

回答 (1 件)

Avni Agrawal
Avni Agrawal 2024 年 6 月 18 日
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.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by