I need help solving RC circuit using Leplace inverse, then graph the output which is in the symsum form

3 views (last 30 days)
So I solved the following Ciruit using Leplace Transform, as I want to find the output on V3.
and this is what I got
then I used Symbolic Math Toolbox Laplace transforms .. with the following code
Ys2(s)=((2*s^2+7*s+3)/(2*s^3+11*s^2+15*s+4)*(2*s+2)/(2*s^2+7*s+3)*1/(s+1)*1/s)
yt = ilaplace(Ys2,s,t)
and this is the output
1/2 - symsum((exp(t*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k))*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k)^2)/(6*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k)^2 + 22*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k) + 15), k, 1, 3) - (15*symsum(exp(t*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k))/(6*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k)^2 + 22*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k) + 15), k, 1, 3))/2 - (11*symsum((exp(root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k)*t)*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k))/(22*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k) + 6*root(z^3 + (11*z^2)/2 + (15*z)/2 + 2, z, k)^2 + 15), k, 1, 3))/2
Now I don't understand why I got my code in such a weirdo format? what did I do wrong?
And if nothing is wrong with this code, how to graph it?
I tried using syms, and declaring W and putting it equal to the output, but failed.
Any help is appreciated

Accepted Answer

Star Strider
Star Strider on 23 Nov 2021
Sometimes a bit fo force (such as using vpa) is necessary —
syms s t
Ys2(s)=((2*s^2+7*s+3)/(2*s^3+11*s^2+15*s+4)*(2*s+2)/(2*s^2+7*s+3)*1/(s+1)*1/s)
Ys2(s) = 
yt = ilaplace(Ys2,s,t)
yt = 
yt = vpa(simplify(yt, 500),5)
yt = 
ytfcn = matlabFunction(yt)
ytfcn = function_handle with value:
@(t)exp(t.*-3.514647277636355e-1).*-7.105148673541635e-1+exp(t.*-1.606599092554053).*2.562392432382694e-1-exp(t.*-3.541936179682311).*4.572437588399225e-2+5.0e-1
figure
fplot(ytfcn, [0, 50])
grid on
The matlabFunciton call is not absolutely necessary, however it may make life easier if the intent is to use ‘yt’ outside the Symbolic Math Toolbox.
.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!