source: mystic/examples/example01.py @ 855

Revision 855, 824 bytes checked in by mmckerns, 5 months ago (diff)

updated copyright to 2016

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2#
3# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
4# Copyright (c) 1997-2016 California Institute of Technology.
5# License: 3-clause BSD.  The full license text is available at:
6#  - http://trac.mystic.cacr.caltech.edu/project/mystic/browser/mystic/LICENSE
7"""
8Example:
9    - Minimize Rosenbrock's Function with Powell's method.
10
11Demonstrates:
12    - standard models
13    - minimal solver interface
14"""
15
16# Powell's Directonal solver
17from mystic.solvers import fmin_powell
18
19# Rosenbrock function
20from mystic.models import rosen
21
22
23if __name__ == '__main__':
24
25    print "Powell's Method"
26    print "==============="
27
28    # initial guess
29    x0 = [0.8,1.2,0.7]
30
31    # use Powell's method to minimize the Rosenbrock function
32    solution = fmin_powell(rosen,x0)
33    print solution
34 
35# end of file
Note: See TracBrowser for help on using the repository browser.