COPASI API  4.16.103
Macros | Functions
CSteadyStateTask.cpp File Reference
#include "copasi.h"
#include "CSteadyStateTask.h"
#include "CSteadyStateProblem.h"
#include "CSteadyStateMethod.h"
#include "model/CModel.h"
#include "model/CState.h"
#include "model/CMetabNameInterface.h"
#include "report/CKeyFactory.h"
#include "report/CReport.h"
#include <sstream>
Include dependency graph for CSteadyStateTask.cpp:

Go to the source code of this file.

Macros

#define XXXX_Reporting
 

Functions

std::ostream & operator<< (std::ostream &os, const CSteadyStateTask &A)
 

Macro Definition Documentation

#define XXXX_Reporting

CSteadyStateTask class.

This class implements a steady state task which is comprised of a of a problem and a method. Additionally calls to the reporting methods are done when initialized.

Created for COPASI by Stefan Hoops 2002

Definition at line 38 of file CSteadyStateTask.cpp.

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CSteadyStateTask A 
)

Definition at line 439 of file CSteadyStateTask.cpp.

References CSteadyStateMethod::found, CSteadyStateMethod::foundEquilibrium, CSteadyStateMethod::foundNegative, CMetab::getConcentration(), CMetab::getConcentrationRate(), CModel::getConcentrationRateUnitsDisplayString(), CModel::getConcentrationUnitsDisplayString(), CMetabNameInterface::getDisplayName(), CReaction::getFlux(), CModel::getFrequencyUnitsDisplayString(), CEigen::getI(), CModel::getMetabolites(), CCopasiProblem::getModel(), CCopasiObject::getObjectName(), CReaction::getParticleFlux(), CModel::getQuantityRateUnitsDisplayString(), CEigen::getR(), CModelEntity::getRate(), CModel::getReactions(), CSteadyStateTask::getResult(), CSteadyStateTask::getState(), CModel::getTimeUnitsDisplayString(), CMetab::getTransitionTime(), CModelEntity::getValue(), CSteadyStateTask::mEigenValues, CSteadyStateTask::mEigenValuesX, CSteadyStateTask::mpJacobianAnn, CSteadyStateTask::mpJacobianXAnn, CCopasiTask::mpProblem, CSteadyStateMethod::notFound, CModel::setState(), CVectorCore< CType >::size(), CCopasiVector< T >::size(), CModel::updateNonSimulatedValues(), and CModel::updateSimulatedValues().

440 {
441  switch (A.getResult())
442  {
444  os << "A steady state with given resolution was found." << std::endl;
445  break;
446 
448  os << "No steady state with given resolution was found!" << std::endl;
449  os << "(below are the last unsuccessful trial values)" << std::endl;
450  break;
451 
453  os << "An equilibrium steady state (zero fluxes) was found." << std::endl;
454  break;
455 
457  os << "An invalid steady state (negative concentrations) was found." << std::endl;
458  }
459 
460  os << std::endl;
461 
462  // Update all necessary values.
463  CState * pState = const_cast<CState *>(A.getState());
464 
465  if (!pState) return os;
466 
467  CModel * pModel = A.mpProblem->getModel();
468 
469  if (!pModel) return os;
470 
471  pModel->setState(*pState);
472  pModel->updateSimulatedValues(true);
473  pModel->updateNonSimulatedValues();
474 
475  // Metabolite Info: Name, Concentration, Concentration Rate, Particle Number, Particle Rate, Transition Time
476  const CCopasiVector<CMetab> & Metabolites = pModel->getMetabolites();
477  const CMetab * pMetab;
478 
479  size_t i, imax = Metabolites.size();
480 
481  os << "Species" << "\t";
482  os << "Concentration";
483 
484  std::string Units = pModel->getConcentrationUnitsDisplayString();
485 
486  if (Units != "")
487  os << " (" << Units << ")";
488 
489  os << "\t";
490 
491  os << "Concentration Rate";
492  Units = pModel->getConcentrationRateUnitsDisplayString();
493 
494  if (Units != "")
495  os << " (" << Units << ")";
496 
497  os << "\t";
498 
499  os << "Particle Number" << "\t";
500 
501  os << "Particle Number Rate";
502  Units = pModel->getFrequencyUnitsDisplayString();
503 
504  if (Units != "")
505  os << " (" << Units << ")";
506 
507  os << "\t";
508 
509  os << "Transition Time";
510  Units = pModel->getTimeUnitsDisplayString();
511 
512  if (Units != "")
513  os << " (" << Units << ")";
514 
515  os << std::endl;
516 
517  for (i = 0; i < imax; ++i)
518  {
519  pMetab = Metabolites[i];
520  os << CMetabNameInterface::getDisplayName(pModel, *pMetab, false) << "\t";
521  os << pMetab->getConcentration() << "\t";
522  os << pMetab->getConcentrationRate() << "\t";
523  os << pMetab->getValue() << "\t";
524  os << pMetab->getRate() << "\t";
525  os << pMetab->getTransitionTime() << std::endl;
526  }
527 
528  os << std::endl;
529 
530  // Reaction Info: Name, Flux, Particle Flux
531  const CCopasiVector<CReaction>& Reactions = pModel->getReactions();
532  const CReaction * pReaction;
533 
534  imax = Reactions.size();
535 
536  os << "Reaction" << "\t";
537 
538  os << "Flux";
539  Units = pModel->getQuantityRateUnitsDisplayString();
540 
541  if (Units != "")
542  os << " (" << Units << ")";
543 
544  os << "\t";
545 
546  os << "Particle Flux";
547  Units = pModel->getFrequencyUnitsDisplayString();;
548 
549  if (Units != "")
550  os << " (" << Units << ")";
551 
552  os << std::endl;
553 
554  for (i = 0; i < imax; ++i)
555  {
556  pReaction = Reactions[i];
557  os << pReaction->getObjectName() << "\t";
558  os << pReaction->getFlux() << "\t";
559  os << pReaction->getParticleFlux() << std::endl;
560  }
561 
562  os << std::endl;
563 
564  if (static_cast<CSteadyStateProblem *>(A.mpProblem)->isJacobianRequested())
565  {
566  os << *A.mpJacobianAnn << std::endl;
567 
568  if (static_cast<CSteadyStateProblem *>(A.mpProblem)->isStabilityAnalysisRequested())
569  {
570  os << "Eigenvalues\treal\timaginary" << std::endl;
571  imax = A.mEigenValues.getR().size();
572 
573  for (i = 0; i < imax; i++)
574  os << "\t" << A.mEigenValues.getR()[i] << "\t" << A.mEigenValues.getI()[i] << std::endl;
575 
576  os << std::endl;
577  }
578 
579  os << *A.mpJacobianXAnn << std::endl;
580 
581  if (static_cast<CSteadyStateProblem *>(A.mpProblem)->isStabilityAnalysisRequested())
582  {
583  os << "Eigenvalues\treal\timaginary" << std::endl;
584  imax = A.mEigenValuesX.getR().size();
585 
586  for (i = 0; i < imax; i++)
587  os << "\t" << A.mEigenValuesX.getR()[i] << "\t" << A.mEigenValuesX.getI()[i] << std::endl;
588 
589  os << std::endl;
590  }
591  }
592 
593  if (static_cast<CSteadyStateProblem *>(A.mpProblem)->isStabilityAnalysisRequested())
594  {
595  os << "Stability Analysis of the Reduced System" << std::endl;
596  os << A.mEigenValuesX << std::endl;
597  }
598 
599  return os;
600 }
const CSteadyStateMethod::ReturnCode & getResult() const
std::string getTimeUnitsDisplayString() const
Definition: CModel.cpp:4531
const C_FLOAT64 & getParticleFlux() const
Definition: CReaction.cpp:201
const C_FLOAT64 & getRate() const
const CCopasiVector< CMetab > & getMetabolites() const
Definition: CModel.cpp:1051
std::string getConcentrationRateUnitsDisplayString() const
Definition: CModel.cpp:4607
const std::string & getObjectName() const
std::string getFrequencyUnitsDisplayString() const
Definition: CModel.cpp:4539
virtual size_t size() const
void updateNonSimulatedValues(void)
Definition: CModel.cpp:1892
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
std::string getQuantityRateUnitsDisplayString() const
Definition: CModel.cpp:4657
Definition: CState.h:305
const CState * getState() const
CArrayAnnotation * mpJacobianAnn
const C_FLOAT64 & getFlux() const
Definition: CReaction.cpp:192
static std::string getDisplayName(const CModel *model, const std::string &key, const bool &quoted)
Definition: CMetab.h:178
const CVector< C_FLOAT64 > & getI() const
Definition: CEigen.cpp:687
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
CArrayAnnotation * mpJacobianXAnn
void setState(const CState &state)
Definition: CModel.cpp:1785
const CVector< C_FLOAT64 > & getR() const
Definition: CEigen.cpp:690
size_t size() const
Definition: CVector.h:100
std::string getConcentrationUnitsDisplayString() const
Definition: CModel.cpp:4587
const C_FLOAT64 & getValue() const
CCopasiVectorNS< CReaction > & getReactions()
Definition: CModel.cpp:1039
const C_FLOAT64 & getConcentration() const
Definition: CMetab.cpp:218
Definition: CModel.h:50
const C_FLOAT64 & getTransitionTime() const
Definition: CMetab.cpp:229
C_FLOAT64 getConcentrationRate() const
Definition: CMetab.cpp:870
CModel * getModel() const