Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solve::ivar: xxx is not a valid variable. >>

830 views
Skip to first unread message

Morten Jørgensen

unread,
Mar 11, 2011, 4:35:01 AM3/11/11
to
Hi guys,
why is it that I get this message

Solve::ivar: 3777.865080388886` is not a valid variable. >>

while using numbers from previous calculations (Q, m, C, T2) in this
equation

Solve[Q == m * C * (T3 - T2), T3]


Regards, Morten

Bill Rowe

unread,
Mar 12, 2011, 5:08:40 AM3/12/11
to

That should mean the value 3777.865080388886 is assigned to T3.
Try doing

Clear[T3];


Solve[Q == m * C * (T3 - T2), T3]

or

Block[{T3}, Solve[Q == m * C * (T3 - T2), T3]]


DrMajorBob

unread,
Mar 12, 2011, 5:09:02 AM3/12/11
to
Because Solve doesn't control the "scope" of T3.

This works when the variables are undefined:

Solve[Q == m*C*(T3 - T2), T3]

{{T3 -> (Q + C m T2)/(C m)}}

But if T3 has a value:

T3 = 3777.865080388886`;
Solve[Q == m*C*(T3 - T2), T3]

Solve[Q == C m (3777.87 - T2), 3777.87]

In that case, block the variable:

Block[{T3},
T3 /. First@Solve[Q == m*C*(T3 - T2), T3]]

(Q + C m T2)/(C m)

Bobby

On Fri, 11 Mar 2011 03:34:44 -0600, Morten J=F8rgensen <ma...@maarten.dk>
wrote:

> Hi guys,
> why is it that I get this message
>
> Solve::ivar: 3777.865080388886` is not a valid variable. >>
>
> while using numbers from previous calculations (Q, m, C, T2) in this
> equation
>
> Solve[Q == m * C * (T3 - T2), T3]
>
>

> Regards, Morten
>


--
DrMaj...@yahoo.com

0 new messages