help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie question on solving simple equations


From: Joe Kirchner
Subject: Newbie question on solving simple equations
Date: Tue, 19 May 2009 07:45:39 -0700 (PDT)

Hi,

I just installed Octave and thought I would give it a try.

I tried to solve a trivial equation:

8 = 2 * x + 4

what is x?

When I type the equation, Octave complains that x is undefined.  The only way I can get Octave to solve for x is to do half the work myself by transforming the equation, such that x is alone on the left side of the equation:

x = (8 - 4) / 2

Only then does Octave reply that:

x = 2

How do I give Octave an equation or a set of equations and then ask it to solve them? 

A slightly less trivial example is:

10 = x * y + 2
8 = 2 * y + x

what are x and y?

In this case, I could not transform the equations as above because the transformation of the first equation to x = ... is not resolvable without the second equation, so it would complain that y is undefined. And if I transformed it to y =  ..., it would complain that x is undefined.  In this case, (before the second equation is defined) x and y are unknowable.  So what syntax do I use to submit both equations simultaneously to Octave, so that it can solve these simultaneously?

Of course, I could transform the equations and use substitution, but again I would be doing half the work by hand.

I have scanned through the help documentation, but such simple issues are not addressed.

Can anyone give me a few examples of syntax I would submit to address these trivial equations?

Thanks,

Joe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]