Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!dish.news.pipex.net!pipex!oleane!jussieu.fr!univ-lyon1.fr!news-rocq.inria.fr!news2.EUnet.fr!news.fnet.fr!ilog!puget
From: puget@ilog.ilog.fr (Jean-Francois Puget)
Subject: Re: Non-linear equation(s) code
Message-ID: <1995Jul12.092416.4437@ilog.fr>
To: zhuhail@vax.sbu.ac.uk
Sender: news@ilog.fr
Nntp-Posting-Host: laumiere
Organization: ILOG S.A., France
References:  <1995Jul4.164041.1@vax.sbu.ac.uk>
Date: Wed, 12 Jul 95 09:24:16 GMT
Lines: 54

In article <1995Jul4.164041.1@vax.sbu.ac.uk>, zhuhail@vax.sbu.ac.uk writes:
|> 
|> Hello,
|> 
|> If you like, you can try my code on solving non-linear equation or
|> multiple equations. (Newton method, Prolog)
|> 
|> An example is:
|> 
|> exp(x)-y+1=0
|> exp(y)+x-2=0
|> 
|> E-mail me if you need.
|> 
|> Lin.

Interval propagation is a powerful mean to solve non linear equations.

We have implemented interval propagation inside Ilog Solver, a C++ implementation of
Constraint Logic Programming. You should consult the comp.constraints newsgroup, and
especially its FAQ, in order to find information about other systems able to solve such
equations.

You can find more information about Ilog Solver on our web server, whose URL is
http://www.ilog.com

In Ilog Solver, the following code solves the previous example:

--------------------------- C++ code starts here ------------------------
#include <ilsolver/ilcfloat.h>

int main() {
    IlcInit();
    IlcFloatVar x (-1e10, 1e10), y (-1e10, 1e10);
    IlcTell(IlcExponent(x) == y-1);
    IlcTell(IlcExponent(y) == 2-x);
    cout << x << ' ' <<  y << endl; // prints
    IlcEnd();
    return 0;	
} 
--------------------------- C++ code ends here ------------------------

The output of this program is:

> equation
[-1.44276..-1.44276] [1.23627..1.23627]

The running time is less that 0.01 second on a sparc 20.

-- 
  Jean-Francois Puget		 net : puget@ilog.fr
  ILOG S.A.                      url : http://www.ilog.fr
  2 Avenue Gallieni - BP 85	 tel : +33 1 46 63 66 66
  F-94253 Gentilly Cedex FRANCE	 fax : +33 1 46 63 15 82
