Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CurrentToInitialRatioChemical.cpp

Go to the documentation of this file.
00001 // CurrentToInitialRatioChemical.cpp: implementation of the CCurrentToInitialRatioChemical class.
00002 //      numerator has to be 0th element of chemRefVector,
00003 //  denominator has to be 1th element of chemRefVector
00004 //  computes Current:Initial
00006 
00007 #include "CurrentToInitialRatioChemical.h"
00008 
00010 // Construction/Destruction
00012 
00013 CCurrentToInitialRatioChemical::CCurrentToInitialRatioChemical(int chemicalNumber, std::string name, std::vector<Chemical *> chemRefVector)
00014 :CAlgebraicChemical(chemicalNumber,name,chemRefVector)
00015 {
00016 
00017 }
00018 
00019 CCurrentToInitialRatioChemical::~CCurrentToInitialRatioChemical()
00020 {
00021 
00022 }
00023 
00024 void CCurrentToInitialRatioChemical::ComputeAmount()
00025 {
00026         double tempnumerator = 0.0;
00027         double tempdenominator = 0.0;
00028         tempnumerator = m_vpChemRefVector[0]->GetAmount();
00029         tempdenominator = m_vpChemRefVector[1]->GetInitialAmount();
00030         
00031         amount = tempnumerator/tempdenominator;
00032 }
00033 
00034 void CCurrentToInitialRatioChemical::ComputeInitialAmount()
00035 {
00036         double tempnumerator = 0.0;
00037         double tempdenominator = 0.0;
00038         tempnumerator = m_vpChemRefVector[0]->GetInitialAmount();
00039         tempdenominator = m_vpChemRefVector[1]->GetInitialAmount();
00040         initialAmount = tempnumerator/tempdenominator;
00041 }
00042 
00043 void CCurrentToInitialRatioChemical::ComputeErrorInInitialAmount()
00044 {
00045         double errornumerator;
00046         double valuenumerator;
00047         double errordenominator;
00048         double valuedenominator;
00049 
00050         errornumerator = m_vpChemRefVector[0]->GetErrorInInitialAmount();
00051         valuenumerator = m_vpChemRefVector[0]->GetInitialAmount();
00052         errordenominator = m_vpChemRefVector[1]->GetErrorInInitialAmount();
00053         valuedenominator = m_vpChemRefVector[1]->GetInitialAmount();
00054 
00055         errornumerator = errornumerator*errornumerator;
00056         valuenumerator = valuenumerator*valuenumerator;
00057         errordenominator = errordenominator*errordenominator;
00058         valuedenominator = valuedenominator*valuedenominator;
00059         
00060         errorInInitialAmount = sqrt(errornumerator/valuedenominator + errordenominator/valuenumerator);
00061 }

Generated on Mon Nov 3 09:37:45 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002