Hi all,
I am trying to calculate such a system:
For which I already know the solution:
But when I put all this stuff into Matlab, I get the following error:
>> syms L
C R s
;
>> C = [[R + s*L,-s*L];[-s*L, R + s*L + 1/(s*C)]]
C =
[ R + L*s, -L*s]
[ -L*s, R + L*s + 1/(C*s)]
>>V = [[R + s*L,1];[-s*L,0]]
V =
[ R + L*s, 1]
[ -L*s, 0]
>> i2 = det(V)/det(C)
ans =
(C*L*s^2)/(C*R^2*s + 2*C*L*R*s^2 + R + L*s)
>> vo = i2/(s*C)
Error
using symengine (line 59)
Operands
are invalid.
Error
in sym/privBinaryOp (line 903)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error
in
/
(line 297)
X = privBinaryOp(A, B,
'symobj::mrdivide'
);
Why Matlab cannot perform such a calculation ? This is not the first time I perform these kind of calculations.
Instead, If I declare a variable C1, it all works:
>> syms C1
>> C = [[(R + s*L),-s*L];[-s*L, (R + s*L + 1/(s*C1))]]
C =
[ R + L*s, -L*s]
[ -L*s, R + L*s + 1/(C1*s)]
>> V = [[R + s*L,1];[-s*L,0]]
V =
[ R + L*s, 1]
[ -L*s, 0]
>> i2 = det(V)/det(C)/(s*C1)
i2 =
(L*s)/(C1*R^2*s + 2*C1*L*R*s^2 + R + L*s)
What's the problem with variable named
C
? Thank you for yor help.