Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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.

share|improve this question
@NasserM.Abbasi thank you for the notice, done. – hhh Dec 5 '12 at 15:19
up vote 2 down vote accepted

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.

share|improve this answer
@hhh You wanted mySeries == 1/(1+x) so write simply 1/(1 + x) /. Solve[ Normal[mySeries] == 1/(1 + x), x] // Quiet – Artes Dec 5 '12 at 15:27
@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]]. – Artes Dec 5 '12 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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