Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Why does Inverse[M] hesitate?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54475] Re: [mg54431] Re: Why does Inverse[M] hesitate?
  • From: DrBob <drbob at bigfoot.com>
  • Date: Mon, 21 Feb 2005 03:44:43 -0500 (EST)
  • References: <200502200509.AAA20149@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

>> This is becuase you used MatrixForm which puts a wrapper around the expression.

Actually, it's because MatrixForm DOESN'T act as a wrapper. According to Help, it doesn't interfere with evaluation, but clearly, it does.

Bobby

On Sun, 20 Feb 2005 00:09:53 -0500 (EST), Bill Rowe <readnewsciv at earthlink.net> wrote:

> On 2/19/05 at 2:32 AM, skirmantas.janusonis at yale.edu (Skirmantas)
> wrote:
>
>> The Inverse function sometimes calculates the inverse of a matrix
>> immediately, sometimes it does not. Try this example in Mathematica
>> 5.1:
>
>> A={{(1-g)-1,1},{-w P(1-g)/C,-1}}//MatrixForm
>> B={{0},{-P(w+1)}}//MatrixForm
>
>> I get Out: Inverse[(expanded A)].(expanded B)
>
>> If I do just
>> A={{a,b},{c,d}}
>> B={{e},{f}}
>> Inverse[A].B
>
>> I get the final correct result.
>
> Right. This is becuase you used MatrixForm which puts a wrapper around the expression.
>
> If you do
>
> A={{(1-g)-1,1},{-w P(1-g)/C,-1}}//MatrixForm
> MatrixQ[A]
>
> you will get False indicating A is not a matrix. The same is true of B. Consequently, neither Inverse nor . can work
>
> There are a couple of ways around this issue. First, you could do
>
> (A={{(1-g)-1,1},{-w P(1-g)/C,-1}})//MatrixForm
> (B={{0},{-P(w+1)}})//MatrixForm
>
> This forces assignment to A and B before MatrixForm does its thing. As a consequence,
> MatrixQ[A] will evaluate as True and Inverse[A].B will do what you expect.
>
> But I think the more elegant way around this issue is to set the default output display to TraditionalForm and simply not use MatrixForm
> --
> To reply via email subtract one hundred and four
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Printing numbers
  • Next by Date: Re: my mathematica no longer renders graphics, even after reinstall
  • Previous by thread: Re: Why does Inverse[M] hesitate?
  • Next by thread: Re: Why does Inverse[M] hesitate?