Matlab returns empty symbol when solving laplace transform

조회 수: 3 (최근 30일)
Richard Baird
Richard Baird 2020년 10월 24일
댓글: Star Strider 2020년 10월 26일
I have a laplace equation defined in matlab that I believe to be correct. It is defined as eqnLT
% R1, R2, C1, C2 are positive symbols
% i(t) is a symbolic function
% i(0) is set to be 0
eqn(t) =
0 == R1*i(t) + R2*i(t) + diff(i(t), t)/10 + int(i(t), t)/C1 + int(i(t), t)/C2
eqnLT = laplace(eqn, t, s) =
0 == (s*laplace(i(t), t, s))/10 - i(0)/10 + laplace(int(i(t), t), t, s)/C1 + laplace(int(i(t), t), t, s)/C2 + R1*laplace(i(t), t, s) + R2*laplace(i(t), t, s)
I want to solve for `laplace(i(t), t, s)` let it be called `I(s)`. Following the instructions I can find in the matlab documentation, I do the following:
subs(eqnLT, laplace(i(t),t,s),I(s)));
solve(eqnLT, I(s))
The answer I get is empty sym. I am not sure what I am doing wrong.

답변 (1개)

Star Strider
Star Strider 2020년 10월 24일
Try this:
syms s t C1 C2 R1 R2 i(t) I(s)
eqn(t) = 0 == R1*i(t) + R2*i(t) + diff(i(t), t)/10 + int(i(t), t)/C1 + int(i(t), t)/C2
eqnLT = laplace(eqn, t, s)
eqnLT = 0 == (s*laplace(i(t), t, s))/10 - i(0)/10 + laplace(int(i(t), t), t, s)/C1 + laplace(int(i(t), t), t, s)/C2 + R1*laplace(i(t), t, s) + R2*laplace(i(t), t, s)
eqnLT = subs(eqnLT, {laplace(i(t), t, s), laplace(int(i(t), t), t, s)}, {I(s), I(s)/s})
isoI = simplify(isolate(eqnLT,I), 'Steps',500)
Experiment with it to get the result you want (works in R2020b, Update 1).
  댓글 수: 2
Richard Baird
Richard Baird 2020년 10월 26일
That worked. Thank you!
Star Strider
Star Strider 2020년 10월 26일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by