# How does one solve equations between symbolic functions for functions

3 Ansichten (letzte 30 Tage)
Duncan Carlsmith am 28 Mai 2024
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
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Paul am 28 Mai 2024
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) =
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
Duncan Carlsmith am 30 Mai 2024
Thank you! I knew this but forgot!

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Formula Manipulation and Simplification finden Sie in Help Center und File Exchange

R2024a

### Community Treasure Hunt

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

Start Hunting!

Translated by