Matlab returns empty symbol when solving laplace transform

11 views (last 30 days)
Richard Baird on 24 Oct 2020 at 21:50
Commented: Star Strider on 26 Oct 2020 at 16:18
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.

Star Strider on 24 Oct 2020 at 23:14
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).

Richard Baird on 26 Oct 2020 at 16:15
That worked. Thank you!
Star Strider on 26 Oct 2020 at 16:18
My pleasure!
.