A = {{-0.03333, 0, 0}, {0.0667, -0.6799, 0.6667}, {0,     0.3399, -0.3467}};
B = {0.0333, 0, 0};
CC = {1, 1, 1};
myInverse = Inverse[s*IdentityMatrix[3] - A];
P = CC*myInverse*B;
P = P[[1,1]];


Express the polynomial $P$ in the format $\frac{1}{1+\text{something}}$.


1. Trial: tried to play with denominator and numerator, FAIL, here.

2. Trial: tried Solve command but errs, the code here fires the error with a transfer function $G(s)$ and the picture here. I try to express the line 146 i.e. the equation $G(s)$ in the form $\frac{1}{1+C}$. How can I simplify this? Why do I get the error? How can I get the equation for the $G(s)$ in the requested form? Err report "Solve::ivar: ... is not a valid variable".

3. Trial: fixing the preserved-variable problem revealed by Artes's answer, I get very peculiar answer -- I get empty set!? Why? I should get some non-empty equation. Notice the line 336 in the picture here.

  • $\begingroup$ @NasserM.Abbasi thank you for the notice, done. $\endgroup$
    – hhh
    Dec 5, 2012 at 15:19

2 Answers 2


You can't use Solve[ mySeries == 1/(1 + A), A] because A had been defined in your code. Moreover you can't use capital C because

it is the default form for the i-th parameter or constant generated in representing
the results of various symbolic computations.

mySeries has been defined with mySeries = Series[ P[[1, 1]], {s, 0, 1}]; thus it has the value in terms of SeriesData :

Head @ mySeries

therefore you should use Normal. Because of inexact coefficients Solve produces this message :

Solve::ratnz: Solve was unable to solve the system with inexact coefficients.
The answer was obtained by solving a corresponding exact system and numericizing
the result. >>

If you want to suppress the message use Quiet. Then you'll get the result :

Solve[ Normal[mySeries] == 1/(1 + x), x] // Quiet
{{x -> (0.333333 (-3.19716*10^7 - 1.06476*10^12 s))/(-1.18295*10^10 + 3.5492*10^11 s)}}

A bit more involved algebraic expression was P and you wanted to find P[[1,1]] in the form 1/(1 + x). You can use the MaxExtraConditions option in Solve to get all conditions for a general solution.

Solve[ 1/(1 + x) == P[[1, 1]], x, MaxExtraConditions -> All] // Quiet

or if you know that conditions are satisfied you may simply write

1/(1 + x) /. Solve[ 1/(1 + x) == P[[1, 1]], x] // Quiet

to get the result in the expected form.

  • 1
    $\begingroup$ @hhh You wanted mySeries == 1/(1+x) so write simply 1/(1 + x) /. Solve[ Normal[mySeries] == 1/(1 + x), x] // Quiet $\endgroup$
    – Artes
    Dec 5, 2012 at 15:27
  • $\begingroup$ @hhh You are welcome. I recommend to edit your question once more and put your equations in a good order. Next you neednt use P = P[[1]][[1]]` because you set another value to P which was originally a matrix , moreover you can simply use P[[1,1]] instead of P[[1]][[1]]. $\endgroup$
    – Artes
    Dec 5, 2012 at 15:59

If you are only after "something" you could simply employ

something = Denominator[P]/Numerator[P] - 1 // Together

Note that system commands generally start with a capital letter. You can also apply this to Normal[ mySeries] (instead of P) if you wish/require. For target expressions more general than 1/(1+something) Artes answer can always be generalized.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.