Solve for a variable in terms of specific other variables

조회 수: 11 (최근 30일)
Aleem Andrew
Aleem Andrew 2021년 2월 23일
답변: Walter Roberson 2021년 2월 23일
The derivative of eq1 below is diff(x(t), t) == diff(y(t), t). I am trying to use the solve function to solve for diff(y(t)) and the output should be diff(x(t)) but a message stating that Matlab is unable to find an explicit solution is displayed. How can you specify the value of diff(x(t)), for example diff(x(t)) = 5, so that the solve function will solve for diff(y(t)) as 5, or if the value is not specified the solve function should return diff(x(t)) rather than an empty sym?
syms x(t) y(t)
eq1 = x == y+2;
solve(diff(eq1),diff(y(t)))

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 23일
syms x(t) y(t)
eq1 = x == y+2;
deq = diff(eq1)
deq(t) = 
isolate(deq, diff(y))
ans = 
subs(ans, diff(x),5)
ans = 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by