How does one solve equations between symbolic functions for functions

2 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Paul
Paul le 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) = 

Plus de réponses (0)

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by