필터 지우기
필터 지우기

Solve equation for symbolic function

조회 수: 3 (최근 30일)
Jonathan Aust
Jonathan Aust 2019년 9월 9일
답변: Roshni Garnayak 2019년 9월 13일
I have this simple example:
syms a(t) b(t);
eqn = a(t) * 2 == b(t);
solve(eqn, a(t))
The output is:
Warning: Unable to find explicit solution. For options, see help.
ans =
Empty sym: 0-by-1
Why is MATLAB not able to solve this? It works if I make a and b constant (not dependent on t), but thats not what I want. The answer I would expect would be something like
a(t) = b(t) * 0.5
  댓글 수: 3
Jonathan Aust
Jonathan Aust 2019년 9월 9일
They are symbolic functions. They do not have a body assigned to them though.
John D'Errico
John D'Errico 2019년 9월 9일
Solve apparently does not understand when you ask it to solve for a function.
But there is no reason why you cannot just leave it as a variable, a simple unknown. That it would at some point be dependent on t is something you can deal with later.

댓글을 달려면 로그인하십시오.

채택된 답변

Roshni Garnayak
Roshni Garnayak 2019년 9월 13일
In this example, the solution doesn’t depend on t. It’s just a representation, so you can use any symbol. Hence, a can be used in place of a(t).
If you have a differential equation where the solution is dependent on t, then you can use the “dsolve” function. Refer to the link below for details on “dsolve” function:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by