gpkit.tools package¶
Submodules¶
gpkit.tools.fmincon module¶
A module to facilitate testing GPkit against fmincon
-
gpkit.tools.fmincon.
generate_mfiles
(model, algorithm='interior-point', guesstype='ones', gradobj='on', gradconstr='on', writefiles=True)¶ A method for preparing fmincon input files to run a GPkit program
- INPUTS:
model [GPkit model] The model to replicate in fmincon
- algorithm: [string] Algorithm used by fmincon
- ‘interior-point’: uses the interior point solver ‘SQP’: uses the sequential quadratic programming solver
- guesstype: [string] The type of initial guess used
‘ones’: One for each variable ‘order-of-magnitude-floor’: The “log-floor” order of
magnitude of the GP/SP optimal solution (i.e. O(99)=10)- ‘order-of-magnitude-round’: The “log-nearest” order of
- magnitude of the GP/SP optimal solution (i.e. O(42)=100)
- ‘almost-exact-solution’: The GP/SP optimal solution rounded
- to 1 significant figure
- gradconstr: [string] Include analytical constraint gradients?
- ‘on’: Yes ‘off’: No
- gradobj: [string] Include analytical objective gradients?
- ‘on’: Yes ‘off’: No
writefiles: [Boolean] whether or not to actually write the m files
-
gpkit.tools.fmincon.
make_initial_guess
(model, newlist, guesstype='ones')¶ Returns initial guess
gpkit.tools.tools module¶
Non-application-specific convenience methods for GPkit
-
gpkit.tools.tools.
composite_objective
(*objectives, **kwargs)¶ Creates a cost function that sweeps between multiple objectives.
-
gpkit.tools.tools.
mdmake
(filename, make_tex=True)¶ Make a python file and (optional) a pandoc-ready .tex.md file
-
gpkit.tools.tools.
mdparse
(filename, return_tex=False)¶ Parse markdown file, returning as strings python and (optionally) .tex.md
-
gpkit.tools.tools.
te_exp_minus1
(posy, nterm)¶ Taylor expansion of e^{posy} - 1
- posy : gpkit.Posynomial
- Variable or expression to exponentiate
- nterm : int
- Number of non-constant terms in resulting Taylor expansion
- gpkit.Posynomial
- Taylor expansion of e^{posy} - 1, carried to nterm terms
-
gpkit.tools.tools.
te_secant
(var, nterm)¶ Taylor expansion of secant(var).
- var : gpkit.monomial
- Variable or expression argument
- nterm : int
- Number of non-constant terms in resulting Taylor expansion
- gpkit.Posynomial
- Taylor expansion of secant(x), carried to nterm terms
-
gpkit.tools.tools.
te_tangent
(var, nterm)¶ Taylor expansion of tangent(var).
- var : gpkit.monomial
- Variable or expression argument
- nterm : int
- Number of non-constant terms in resulting Taylor expansion
- gpkit.Posynomial
- Taylor expansion of tangent(x), carried to nterm terms
Module contents¶
Contains miscellaneous tools including fmincon comparison tool