help-octave
[Top][All Lists]
Advanced

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

Re: Newbie question on solving simple equations


From: Jaroslav Hajek
Subject: Re: Newbie question on solving simple equations
Date: Tue, 19 May 2009 17:06:07 +0200

On Tue, May 19, 2009 at 4:45 PM, Joe Kirchner <address@hidden> wrote:
> 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
>

Octave is not a CAS, which is what you apparently want, but rather a
numerical tool. It can solve equations (linear, nonlinear) only
approximately, and needs them specified in some canonical form.

For more info, see:
http://en.wikipedia.org/wiki/Computer_algebra_system

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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