symbolic calculation of filter transmission function

5 views (last 30 days)
Hello All,
here is my three-liner:
# #
clear all
syms s kp ki inp Hs out sum
[out]=solve('out=Hs/s','sum=inp-out','Hs=(kp+ki/s)*sum')
# #
I need an expression out(inp) .
The 3 equations are solvable, I did it by hand.
But matlab R2009b complains:
## Warning: Explicit solution could not be found. ##
Any hints, please?

Answers (1)

Martin Maschmann
Martin Maschmann on 9 Dec 2011
R2008a does the job
S=solve('out=Hs/s','sum=inp-out','Hs=(kp+ki/s)*sum','out,Hs,sum')
S =
Hs: [1x1 sym]
out: [1x1 sym]
sum: [1x1 sym]
>> S.out
ans =
(kp*s+ki)*inp/(s^2+kp*s+ki)
>> S.out/inp ??? Undefined function or variable 'inp'.
>> syms inp >> S.out/inp
ans =
(kp*s+ki)/(s^2+kp*s+ki) -> this is what I want
  1 Comment
Walter Roberson
Walter Roberson on 9 Dec 2011
In this version you specify the variables explicitly, but in the first one you did not. The three variables that would have been chosen to solve for are probably not the ones to choose to solve for.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!