MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SteadyStateGsl.cpp File Reference
#include "../basecode/header.h"
#include "../basecode/global.h"
#include "SparseMatrix.h"
#include "KinSparseMatrix.h"
#include "RateTerm.h"
#include "FuncTerm.h"
#include "VoxelPoolsBase.h"
#include "../mesh/VoxelJunction.h"
#include "XferInfo.h"
#include "ZombiePoolInterface.h"
#include "Stoich.h"
#include "OdeSystem.h"
#include "VoxelPools.h"
#include "SteadyStateGsl.h"
+ Include dependency graph for SteadyStateGsl.cpp:

Go to the source code of this file.

Classes

struct  reac_info
 

Functions

static bool checkAboveZero (const vector< double > &y)
 
static double invop (double x)
 
static bool isSolutionPositive (const vector< double > &x)
 
static double op (double x)
 
int ss_func (const gsl_vector *x, void *params, gsl_vector *f)
 

Variables

static const CinfosteadyStateCinfo = SteadyState::initCinfo()
 

Function Documentation

static bool checkAboveZero ( const vector< double > &  y)
static

Definition at line 1086 of file SteadyStateGsl.cpp.

1087 {
1088  for ( vector< double >::const_iterator
1089  i = y.begin(); i != y.end(); ++i )
1090  {
1091  if ( *i < 0.0 )
1092  return false;
1093  }
1094  return true;
1095 }
static double invop ( double  x)
static

Definition at line 674 of file SteadyStateGsl.cpp.

675 {
676  if ( x > 0.0 )
677  return sqrt( x );
678  return 0.0;
679 }
static bool isSolutionPositive ( const vector< double > &  x)
static

Definition at line 825 of file SteadyStateGsl.cpp.

826 {
827  for ( vector< double >::const_iterator
828  i = x.begin(); i != x.end(); ++i )
829  {
830  if ( *i < 0.0 )
831  {
832  cout << "Warning: SteadyState iteration gave negative concs\n";
833  return false;
834  }
835  }
836  return true;
837 }
static double op ( double  x)
static
int ss_func ( const gsl_vector *  x,
void *  params,
gsl_vector *  f 
)

This program works out a steady-state value for a reaction system. It uses GSL heavily, and isn't even compiled if the flag isn't set. It finds the ss value closest to the initial conditions.

If you want to find multiple stable states, it is best to do this in Python as it gives a lot of flexibility in working out how to find steady states. Likewise, if you want to carry out a dose-response calculation.

Variable Documentation

const Cinfo* steadyStateCinfo = SteadyState::initCinfo()
static

Definition at line 314 of file SteadyStateGsl.cpp.