/[ascend]/trunk/models/roots_of_poly.a4c
ViewVC logotype

Diff of /trunk/models/roots_of_poly.a4c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by aw0a, Fri Oct 29 20:54:12 2004 UTC revision 1155 by johnpye, Tue Jan 16 11:33:52 2007 UTC
# Line 1  Line 1 
1    (*  ASCEND modelling environment
2        Copyright (C) 2006 Carnegie Mellon University
3    
4        This program is free software; you can redistribute it and/or modify
5        it under the terms of the GNU General Public License as published by
6        the Free Software Foundation; either version 2, or (at your option)
7        any later version.
8    
9        This program is distributed in the hope that it will be useful,
10        but WITHOUT ANY WARRANTY; without even the implied warranty of
11        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12        GNU General Public License for more details.
13        
14        You should have received a copy of the GNU General Public License
15        along with this program; if not, write to the Free Software
16        Foundation, Inc., 59 Temple Place - Suite 330,
17        Boston, MA 02111-1307, USA.
18    *)
19  REQUIRE "system.a4l";  REQUIRE "system.a4l";
 (* => system.a4l, basemodel.a4l *)  
 PROVIDE "roots_of_poly.a4c";  
20  (*  (*
21   * This file is part of the ASCEND Modeling Library and is released      Numeric root finding example, 5th order polynomial.
22   * under the GNU Public License as described at the end of this file.      
23   *      This model is the first example in "Solved simple models with ASCEND"
24   * This model is the first example in "Solved simple models with ASCEND."      @TODO citation needed
  *)  
25    
26  MODEL polynomial_roots;      by Arthur Westerberg, 1997
27    *)
28    
29    MODEL roots_of_poly;
30      x IS_A generic_real;      x IS_A generic_real;
31      (x-1)*(x-5)*(x+7)*(x^2+1) = 0;      (x-1)*(x-5)*(x+7)*(x^2+1) = 0;
 END polynomial_roots;  
32    
33    METHODS
34        (* test-case checks convergence to just one of these roots *)
35        METHOD on_load;
36            x := 7.0001;
37        END on_load;
38    
39  (*      METHOD self_test;
40   *  Numeric root finding example, 5th order polynomial.          ASSERT (x - 1.0) < 1e-5;
41   *  by Arthur Westerberg      END self_test;
42   *  Part of the ASCEND Library  END roots_of_poly;
  *  $Date: 1998/06/17 19:25:07 $  
  *  $Revision: 1.2 $  
  *  $Author: mthomas $  
  *  $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/roots_of_poly.a4c,v $  
  *  
  *  This file is part of the ASCEND Modeling Library.  
  *  
  *  Copyright (C) 1997 Carnegie Mellon University  
  *  
  *  The ASCEND Modeling Library is free software; you can redistribute  
  *  it and/or modify it under the terms of the GNU General Public  
  *  License as published by the Free Software Foundation; either  
  *  version 2 of the License, or (at your option) any later version.  
  *  
  *  The ASCEND Modeling Library is distributed in hope that it  
  *  will be useful, but WITHOUT ANY WARRANTY; without even the implied  
  *  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  *  See the GNU General Public License for more details.  
  *  
  *  You should have received a copy of the GNU General Public License  
  *  along with the program; if not, write to the Free Software  
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check  
  *  the file named COPYING.  
  *)  

Legend:
Removed from v.1  
changed lines
  Added in v.1155

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22