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

ForestNitrogenCycleNetwork.cpp

Go to the documentation of this file.
00001 // ForestNitrogenCycleNetwork.cpp: implementation of the CForestNitrogenCycleNetwork class.
00002 //
00004 
00005 #include "ForestNitrogenCycleNetwork.h"
00006 
00008 // Construction/Destruction
00010 
00011 CForestNitrogenCycleNetwork::CForestNitrogenCycleNetwork()
00012 {
00013         // "Chemicals" - these are actual dynamical variables
00014         Chemical *AboveGroundBiomass = new Chemical(chemicals.size(),351.0,"AboveGroundBiomass");
00015         chemicals.push_back(AboveGroundBiomass);
00016         
00017         Chemical *BelowGroundBiomass = new Chemical(chemicals.size(),181.0,"BelowGroundBiomass");
00018         chemicals.push_back(BelowGroundBiomass);
00019 
00020         Chemical *ForestFloor = new Chemical(chemicals.size(),1256.0,"ForestFloor");
00021         chemicals.push_back(ForestFloor);
00022 
00023         // "Chemicals" - forcing function with time evolution defined externally
00024         Chemical *IP = new Chemical(chemicals.size(),0.0,"IP");
00025         chemicals.push_back(IP);
00026 
00027         // Rate Parameters - assume 20% relative error
00028         // Units are kg/ha/day
00029         RateConstant *k1 = new RateConstant(4.51,0.2*4.51,"k1");
00030         rateConstants.push_back(k1);
00031 
00032         RateConstant *k2 = new RateConstant(0.39,0.2*0.39,"k2");
00033         rateConstants.push_back(k2);
00034 
00035         RateConstant *k3 = new RateConstant(6.63,0.2*6.63,"k3");
00036         rateConstants.push_back(k3);
00037 
00038         RateConstant *k4 = new RateConstant(0.35,0.2*0.35,"k4");
00039         rateConstants.push_back(k4);
00040 
00041         RateConstant *k56 = new RateConstant(0.595,0.2*0.595,"k56");
00042         rateConstants.push_back(k56);
00043 
00044         RateConstant *k7 = new RateConstant(5.8,0.2*5.8,"k7");
00045         rateConstants.push_back(k7);
00046 
00047         std::vector<RateConstant *> rVec;
00048         rVec.push_back(k3);
00049         rVec.push_back(k4);
00050         rVec.push_back(k7);
00051         std::vector<Chemical *> cVec;
00052         cVec.push_back(ForestFloor);
00053 
00054         // Special chemical for this network
00055         Chemical *MDO = new CMDOChemical(chemicals.size(),"MDO",cVec,rVec);
00056         chemicals.push_back(MDO);
00057 
00058         // "Reactions" - relationships between the dynamicals
00059         // Affecting AboveGroundBiomass
00060         Reaction *AGB1 = new CConstantSourceReaction(AboveGroundBiomass,k1,"AGB1");
00061         reactions.push_back(AGB1);
00062 
00063         Reaction *AGB2 = new CConstantSourceReaction(AboveGroundBiomass,k2,"AGB2");
00064         reactions.push_back(AGB2);
00065 
00066         Reaction *AGB3 = new CNormalizedLinearAttenuator(AboveGroundBiomass,AboveGroundBiomass,k1,"AGB3");
00067         reactions.push_back(AGB3);
00068         
00069         // BelowGroundBiomass
00070         Reaction *BGB1 = new CConstantSourceReaction(BelowGroundBiomass,k3,"BGB1");
00071         reactions.push_back(BGB1);
00072 
00073         Reaction *BGB2 = new CConstantSinkReaction(BelowGroundBiomass,k1,"BGB2");
00074         reactions.push_back(BGB2);
00075 
00076         Reaction *BGB3 = new CConstantSinkReaction(BelowGroundBiomass,k2,"BGB3");
00077         reactions.push_back(BGB3);
00078 
00079         Reaction *BGB4 = new CConstantSourceReaction(BelowGroundBiomass,k4,"BGB4");
00080         reactions.push_back(BGB4);
00081 
00082         Reaction *BGB5 = new CNormalizedLinearAttenuator(BelowGroundBiomass,BelowGroundBiomass,k56,"BGB5");
00083         reactions.push_back(BGB5);
00084 
00085         // ForestFloor
00086         Reaction *FF1 = new CChemicalSource(ForestFloor,IP,"FF1");
00087         reactions.push_back(FF1);
00088 
00089         Reaction *FF2 = new CNormalizedLinearAmplifier(AboveGroundBiomass,ForestFloor,k1,"FF2");
00090         reactions.push_back(FF2);
00091 
00092         Reaction *FF3 = new CNormalizedLinearAmplifier(BelowGroundBiomass,ForestFloor,k56,"FF3");
00093         reactions.push_back(FF3);
00094 
00095         Reaction *FF4 = new CNormalizedLinearAttenuator(ForestFloor,ForestFloor,k7,"FF4");
00096         reactions.push_back(FF4);
00097 
00098 }
00099 
00100 CForestNitrogenCycleNetwork::~CForestNitrogenCycleNetwork()
00101 {
00102 
00103 }

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