How to code a function of relative rates
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
abc def
am 2 Jan. 2021
Bearbeitet: abc def
am 2 Jan. 2021
Hello, I have a function
d = sqrt(x^2+y^2)
then
d' = (x.x'+y.y')/sqrt(x^2+y^2)
I tried 2 ways:
1st I do :
syms f(x) f(y)
>> d = sqrt(f(x)^2+f(y)^2)
d =
(f(x)^2 + f(y)^2)^(1/2)
>> diff(d)
ans =
(f(x)*diff(f(x), x))/(f(x)^2 + f(y)^2)^(1/2)
2nd I do
>> diff(d,x,y)
ans =
-(f(x)*f(y)*diff(f(x), x)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(3/2)
but both of the answer are not what I want .
Is there any code lead to the result
(f(x)*diff(f(x), x)+f(y)*diff(f(y), y))/(f(x)^2 + f(y)^2)^(1/2)
What function should i use ?
Thank you !!!
2 Kommentare
Akzeptierte Antwort
Walter Roberson
am 2 Jan. 2021
syms x y f(t)
d = sqrt(f(x)^2+f(y)^2)
simplify(diff(d,x) + diff(d,y))
1 Kommentar
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


