Can Matlab create Laplace Transfer equations using symbolic math.

2 views (last 30 days)
I would like to create a program to model the Laplace transform of a circuit using the MATLAB symbolic tool box. I have written the following code:
clc
clear all
close
syms s I1 I2 I3 Vs
Z = [(2*s+2) -(2*s+1) -1
-(2*s+1) (9*s+1) -4*s
-1 -4*s (4*s+1+s^-1)];
V = [Vs;0;0];
I = Z\V
I2 = I(2)
Gs = sym('I2*3*s/Vs')
G3 = sym('(Vs*(8*s^3 + 10*s^2 + 3*s + 1))/(24*s^4 + 30*s^3 + 17*s^2 + 16*s + 1)*3*s/Vs')
The line beginning with Gs does not result in an output. The line beginning with G3 will deliver a usable output when I copy and past the output from the I2 output.
Can code be written to symbolically calculate a Laplace output of all possible combinations of voltage or current in a circuit?

Answers (1)

jerry
jerry on 19 Jan 2014
I made the following change to my coding:
clc
clear all
close
syms s I1 I2 I3 Vs
Z = [(2*s+2) -(2*s+1) -1
-(2*s+1) (9*s+1) -4*s
-1 -4*s (4*s+1+s^-1)];
V = [Vs;0;0];
I = Z\V
I2 = I(2)
char(I(2))
Gs = sym('(char(I(2))*3*s)/Vs')
G3 = sym('(Vs*(8*s^3 + 10*s^2 + 3*s + 1))/(24*s^4 + 30*s^3 + 17*s^2 + 16*s + 1)*3*s/Vs')
MATLAB gave the following answer to Gs:
Gs = (3*s*char(i))/Vs
Notice the "I" has been changed to "i". I've never seen this phenomena before and I'm still as far away as I was before.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!