// Created by libAntimony v2.13.0
function PGA_consumption(S1, Rp, R, Nt, Vc)
  (S1/Rp)*(R/Nt)*Vc;
end

PGA_consumption is "PGA consumption"

function NADPH_production(j, S1, Nt)
  (j/2)*(S1/Nt);
end

NADPH_production is "NADPH production"

function carboxylation(Vc, Vj)
  (Vc + Vj - abs(Vc - Vj))/2;
end

carboxylation is "Carboxylation"

function oxygenation(phi, Vc, Vj)
  phi*(Vc + Vj - abs(Vc - Vj))/2;
end

oxygenation is "Oxygenation"


model *Arnold2011_Medlyn2002_RuBisCO-CalvinCycle()

  // Compartments and Species:
  compartment chloroplast;
  species $RuBP in chloroplast, PGA in chloroplast, NADPH in chloroplast;
  species $CO2 in chloroplast, $O2 in chloroplast, $NADP in chloroplast;

  // Assignment Rules:
  NADP := Nt - NADPH;
  J := alpha*Q/(10 - 9*teta)/(65*0.5);
  Vomax := 0.21*Vcmax;
  Vj := (J/4)*CO2/(CO2 + 2*Gamma);
  phi := 0.21*(O2/Ko)/(CO2/Kc);
  Vc := Vcmax*CO2/((1 + O2/Ko)*Kc + CO2);

  // Reactions:
  PGA_prod_Vc: $RuBP + $CO2 + 2 NADPH => 2 PGA; chloroplast*carboxylation(Vc, Vj);
  PGA_prod_Vo: $RuBP + $O2 + 2 NADPH => 1.5 PGA; chloroplast*oxygenation(phi, Vc, Vj);
  PGA_cons: PGA => $RuBP; chloroplast*PGA_consumption(PGA, Rp, NADPH, Nt, Vcmax);
  NADPH_prod: $NADP => NADPH; chloroplast*NADPH_production(J, NADP, Nt);

  // Species initializations:
  RuBP = 2;
  PGA = 2.4;
  NADPH = 0.21;
  CO2 = 245;
  O2 = 210;

  // Compartment initializations:
  chloroplast = 1;

  // Variable initializations:
  Nt = 0.5;
  Rp = 3.2;
  alpha = 0.3;
  Q = 1000;
  teta = 0.9;
  Gamma = 42.8926627111176;
  Vcmax = 2.53232284114507;
  Kc = 406.066146391504;
  Ko = 276.900084789612;

  // Other declarations:
  var J, Vomax, Vj, phi, Vc;
  const chloroplast, Nt, Rp, alpha, Q, teta, Gamma, Vcmax, Kc, Ko;

  // Unit definitions:
  unit substance = 1e-3 mole;

  // Display Names:
  PGA_prod_Vc is "PGA production - v_c";
  PGA_prod_Vo is "PGA production - v_o";
  PGA_cons is "PGA consumption";
  NADPH_prod is "NADPH production";

  // SBO terms:
  Nt.sboTerm = 9
  alpha.sboTerm = 9
  Q.sboTerm = 9
  J.sboTerm = 9
  teta.sboTerm = 9
  Gamma.sboTerm = 9
  Vcmax.sboTerm = 9
  Kc.sboTerm = 9
  Vj.sboTerm = 9
  phi.sboTerm = 9
  Vc.sboTerm = 9

  // CV terms:
  RuBP hypernym "http://identifiers.org/obo.chebi/CHEBI:16710"
  PGA hypernym "http://identifiers.org/obo.chebi/CHEBI:17050"
  NADPH hypernym "http://identifiers.org/obo.chebi/CHEBI:16474"
  CO2 hypernym "http://identifiers.org/obo.chebi/CHEBI:16526"
  O2 hypernym "http://identifiers.org/obo.chebi/CHEBI:15379"
  NADP hypernym "http://identifiers.org/obo.chebi/CHEBI:25523"
end

Arnold2011_Medlyn2002_RuBisCO-CalvinCycle is "Arnold2011_Medlyn2002_RuBisCO-CalvinCycle"

Arnold2011_Medlyn2002_RuBisCO-CalvinCycle model_entity_is "http://identifiers.org/biomodels.db/MODEL1109270000"
Arnold2011_Medlyn2002_RuBisCO-CalvinCycle model_entity_is "http://identifiers.org/biomodels.db/BIOMD0000000384"
Arnold2011_Medlyn2002_RuBisCO-CalvinCycle description "http://identifiers.org/pubmed/22001849"
Arnold2011_Medlyn2002_RuBisCO-CalvinCycle encodement "http://identifiers.org/obo.go/GO:0019253"
Arnold2011_Medlyn2002_RuBisCO-CalvinCycle taxon "http://identifiers.org/taxonomy/33090"
