How does one solve equations between symbolic functions for functions

3 ビュー (過去 30 日間)
Duncan Carlsmith
Duncan Carlsmith 2024 年 5 月 28 日
コメント済み: Duncan Carlsmith 2024 年 5 月 30 日
I am testing out MATLAB FunctionalDerivative for generating and solving Euler equations derived from a Laargrangian with a holonomic resulting in functional equations. I want to combine these. When for example I try to solve the result of the functional derivative dL/d\lambda = z(t)-r*sin (theta(t)) = 0 for z(t)=r*sin(theta(t)) using solve, I can't do it. Other examples which I've followed and which work are to define symbolic variables not sym functions for functions of time and additonall for their derivatives which is cumbersome. The tutorial https://www.mathworks.com/help/symbolic/functional-derivative.html uses children of the equations which I don't quite understand to separate bits in an equality but this doesn't serve if says one has a not trivial relationship between functions.
Any suggestions?
Just to illustrate solve for variables working and for functions failing:
The following code gives an error in the last line:
clear all
syms a b
solve(a+b==0,a)
ans = b
syms c(t) d(t)
Warning: Can only make assumptions on variable names, not 'c(t)'.
Warning: Can only make assumptions on variable names, not 'd(t)'.
S=solve(c(t)+d(t)==0,c)%,"ReturnConditions",true)
Warning: Unable to find explicit solution. For options, see help.
S =
Empty sym: 0-by-1

採用された回答

Paul
Paul 2024 年 5 月 28 日
Maybe isolate is the solution ...
syms z(t) theta(t) r
eqn = z(t)-r*sin (theta(t)) == 0
eqn = 
z(t) = rhs(isolate(eqn,z(t)))
z(t) = 

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by