Message Boards Message Boards

0
|
3965 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Problem with simultaneous equations

Posted 10 years ago

I don't get why I keep getting the Solve::ivar: 0 is not a valid variable. >> message. Here is the code:

Solve[{Rh + T1/Sqrt[2] + T2 == 0, Rv + T1/Sqrt[2] == 0, -(T1/Sqrt[2]) + T5/Sqrt[2] + T6 == 0, -(T1/Sqrt[2]) - T3 - T5/Sqrt[2] == 0, -T2 + T4 == 0, T3 == 0, 18 - T6 + T9/Sqrt[2] == 0, -T7 - T9/Sqrt[2] == 0, -T4 - T5/Sqrt[2] + T8 == 0, -45 + T5/Sqrt[2] + T7 == 0, -T8 - T9/Sqrt[2] == 0, N + T9/Sqrt[2] == 0}, {Rh, Rv, T1, T2, T3, T4, T5, T6, T7, T8, T9, N}] Solve::ivar: 0 is not a valid variable. >> Solve[{Rh + T1/Sqrt[2] == 0, Rv + T1/Sqrt[2] == 0, -(T1/Sqrt[2]) + T5/Sqrt[2] + T6 == 0, -(T1/Sqrt[2]) - T5/Sqrt[2] == 0, T4 == 0, True, 18 - T6 + T9/Sqrt[2] == 0, -T7 - T9/Sqrt[2] == 0, -T4 - T5/Sqrt[2] + T8 == 0, -45 + T5/Sqrt[2] + T7 == 0, -T8 - T9/Sqrt[2] == 0, N + T9/Sqrt[2] == 0}, {Rh, Rv, T1, 0, 0, T4, T5, T6, T7, T8, T9, N}]

I alredy did two similar problems and I didn't had this problem. Somebody knows how to solve it?

Posted 10 years ago

Look up the Mathematica N function in the documentation, change your variable N to n.

But even without that change, if I scrape-n-paste your code into a fresh start of Mathematica it still solves your problem instantly.

So it is possible, but very difficult to prove, that you have previously assigned zero to one of your variables and do not realize this.

Restart Mathematica, try exactly the same problem again and see if the problem disappears.

It is unfortunate that the error message doesn't tell you the name of the variable and that it has been assigned the value of zero. If you saw that you would know exactly what the problem was and how to fix it.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract