Solve an equation and get a solution that depends on a variable

조회 수: 2 (최근 30일)
Jonas Ström Seez
Jonas Ström Seez 2020년 3월 28일
댓글: Jonas Ström Seez 2020년 3월 29일
Hi everyone! I need some help with getting a solution to a equation. I am trying to solve a equation using solve. However i dont get any solution to the equation, i only get Empty sym: 0-by-1. I can solve the equation manually, the problem is that i have other equation that i cant solve manually and would like a better way to solve them. Is there any good way to solve a equation and get a solution that has a dependent variable in return. Here is what i have tried so far.
syms Nin(t)
% Vin = (sign(t - 200/11)/2 + 1/2)*((11*t)/100000 - 1/500) - (11*t)/100000 + 1/500
eq1 = Nin == Constant * Vin;
sol = solve(eq1, t);
sol -> Empty sym: 0-by-1
Manually
Nin = Constant * Vin;
-> Nin = Constant * (sign(t - 200/11)/2 + 1/2)*((11*t)/100000 - 1/500) - (11*t)/100000 + 1/500
Any guidance is appreciated.
  댓글 수: 4
Torsten
Torsten 2020년 3월 28일
편집: Torsten 2020년 3월 28일
syms Nin t
instead of
syms Nin(t)
Jonas Ström Seez
Jonas Ström Seez 2020년 3월 29일
It worked! Thank you very much!

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 3월 28일
syms Nin(t)
% Vin = (sign(t - 200/11)/2 + 1/2)*((11*t)/100000 - 1/500) - (11*t)/100000 + 1/500
eq1 = Nin == Constant * Vin;
sol = solve(eq1, t);
That code requests that an unknown function, Nin(t) be compared to Constant times an expression in t, and that the result be solved for the t that makes the two sides equal. The result would implicitly be of the form
t = some function of Nin(t) and Constant * Vin
except it cannot be, because the right hand side of solving for t cannot contain t, but it must because Nin(t) is an unknown function of t.
Therefore solve() must fail.
Nin = Constant * Vin;
-> Nin = Constant * (sign(t - 200/11)/2 + 1/2)*((11*t)/100000 - 1/500) - (11*t)/100000 + 1/500
That is not a solution for t, it would simply make the two sides of eqn1 the same as each other, in which case solving for t would have to give all t.

카테고리

Help CenterFile Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by