Matlab returns empty symbol when solving laplace transform

3 vues (au cours des 30 derniers jours)
Richard Baird
Richard Baird le 24 Oct 2020
Commenté : Star Strider le 26 Oct 2020
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.

Réponses (1)

Star Strider
Star Strider le 24 Oct 2020
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 commentaires
Richard Baird
Richard Baird le 26 Oct 2020
That worked. Thank you!
Star Strider
Star Strider le 26 Oct 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by