// Created by libAntimony v2.13.0
function function_6(Vm, S1, S2, P1, P2, P3, k, K1, K2)
  Vm*(S1*S2 - P1*P2*P3/k)/(K1 + S1*S2*K1/K2 + P1*P2*P3/k);
end

function_6 is "PGA reduction"

function function_5(k, E, S, K)
  (k/2)*(E + S + K - sqrt((E + S + K)^2 - 4*E*S));
end

function_5 is "High Substrate MM - RuBisCO"

function function_7(Vm, S, K)
  Vm*S/(S + K);
end

function_7 is "MM s1 - reg (TP reduction)"

function function_8(Vm, S1, S2, K1, K2, K3, R)
  Vm*S1*S2/(K1*K2 + K2*S2 + S1*S2 + K3*R);
end

function_8 is "RuBP regeneration"

function function_10(Vm, s1, s2, K1, K2)
  Vm*s1*s2/((s1 + K1)*(s2 + K2));
end

function_10 is "MM s2 - reg (ATP synthesis)"

function function_9(S1, S2, P1, P2, K2, K1, Vm)
  Vm*(S1*S2 - P1*P2)/((S1 + P1)*K2 + (S2 + P2)*K1 + K1*K2*(S1/K1 + P2/K2)*(S2/K2 + P1/K1));
end

function_9 is "TP translocator"


model *Arnold2011_Giersch1990_CalvinCycle()

  // Compartments and Species:
  compartment chloroplast, cytosol;
  species RuBP in chloroplast, PGA in chloroplast, TP in chloroplast, Ru5P in chloroplast;
  species Pi in chloroplast, ATP in chloroplast, ADP in chloroplast, $E_RuBisCO in chloroplast;
  species $totRuBP in chloroplast, $TPc in cytosol, $Pic in cytosol;

  // Assignment Rules:
  totRuBP := (1/2)*(P_0 - (PGA + TP + Ru5P + Pi + ATP));

  // Reactions:
  RuBisCO: $totRuBP + RuBP => 2 PGA; chloroplast*function_5(RuBisCO_k, E_RuBisCO, totRuBP, RuBisCO_K);
  PGA_red: PGA + ATP -> ADP + TP + Pi; chloroplast*function_6(PGA_red_Vm, PGA, ATP, ADP, TP, Pi, PGA_red_k, PGA_red_K1, PGA_red_K2);
  TP_red: 5 TP => 3 Ru5P + 2 Pi; chloroplast*function_7(TP_red_Vm, TP, TP_red_K);
  RuBP_reg: Ru5P + ATP => RuBP + ADP; chloroplast*function_8(RuBP_reg_Vm, Ru5P, ATP, RuBP_reg_K1, RuBP_reg_K2, RuBP_reg_K3, Pi);
  TPT: TP + $Pic -> $TPc + Pi; function_9(TP, Pic, TPc, Pi, TPT_K2, TPT_K1, TPT_Vm);
  ATP_S: ADP + Pi => ATP; chloroplast*function_10(V6, ADP, Pi, ATP_S_K1, ATP_S_K2);

  // Species initializations:
  RuBP = 2;
  PGA = 2.4;
  TP = 0.5;
  Ru5P = 0.0500747384155456;
  Pi = 5;
  ATP = 0.68;
  ADP = 0.82;
  E_RuBisCO = 3.56;
  TPc = 0.2;
  Pic = 1.4;

  // Compartment initializations:
  chloroplast = 1;
  cytosol = 1;

  // Variable initializations:
  P_0 = 16;
  V6 = 5.8801285588795;
  RuBisCO_k = 0.504;
  RuBisCO_K = 0.04;
  PGA_red_Vm = 3.49;
  PGA_red_k = 14;
  PGA_red_K1 = 1;
  PGA_red_K2 = 1;
  TP_red_Vm = 1.06;
  TP_red_K = 0.4;
  RuBP_reg_Vm = 4.81;
  RuBP_reg_K1 = 0.05;
  RuBP_reg_K2 = 0.5;
  RuBP_reg_K3 = 0.05;
  TPT_K2 = 0.25;
  TPT_K1 = 0.08;
  TPT_Vm = 3.3;
  ATP_S_K1 = 0.08;
  ATP_S_K2 = 0.5;

  // Other declarations:
  const chloroplast, cytosol, P_0, V6;

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

  // Display Names:
  E_RuBisCO is "RuBisCo";
  PGA_red is "PGA reduction";
  TP_red is "TP reduction";
  RuBP_reg is "RuBP regeneration";
  TPT is "TP translocator";
  ATP_S is "ATP synthesis";

  // SBO terms:
  P_0.sboTerm = 9
  V6.sboTerm = 9
  RuBisCO_k.sboTerm = 9
  RuBisCO_K.sboTerm = 9
  PGA_red_Vm.sboTerm = 9
  PGA_red_k.sboTerm = 9
  PGA_red_K1.sboTerm = 9
  PGA_red_K2.sboTerm = 9
  TP_red_Vm.sboTerm = 9
  TP_red_K.sboTerm = 9
  RuBP_reg_Vm.sboTerm = 9
  RuBP_reg_K1.sboTerm = 9
  RuBP_reg_K2.sboTerm = 9
  RuBP_reg_K3.sboTerm = 9
  TPT_K2.sboTerm = 9
  TPT_K1.sboTerm = 9
  TPT_Vm.sboTerm = 9
  ATP_S_K1.sboTerm = 9
  ATP_S_K2.sboTerm = 9

  // CV terms:
  RuBP hypernym "http://identifiers.org/chebi/CHEBI:16710"
  PGA hypernym "http://identifiers.org/chebi/CHEBI:17050"
  TP hypernym "http://identifiers.org/pubchem.compound/24794350"
  Ru5P hypernym "http://identifiers.org/chebi/CHEBI:17363"
  Pi hypernym "http://identifiers.org/chebi/CHEBI:43474"
  ATP hypernym "http://identifiers.org/chebi/CHEBI:15422"
  ADP identity "http://identifiers.org/chebi/CHEBI:16761"
  E_RuBisCO hypernym "http://identifiers.org/interpro/IPR020871"
  TPc hypernym "http://identifiers.org/pubchem.compound/24794350"
  Pic hypernym "http://identifiers.org/chebi/CHEBI:43474"
end

Arnold2011_Giersch1990_CalvinCycle is "Arnold2011_Giersch1990_CalvinCycle"

Arnold2011_Giersch1990_CalvinCycle model_entity_is "http://identifiers.org/biomodels.db/MODEL1109270005"
Arnold2011_Giersch1990_CalvinCycle model_entity_is "http://identifiers.org/biomodels.db/BIOMD0000000390"
Arnold2011_Giersch1990_CalvinCycle description "http://identifiers.org/pubmed/22001849"
Arnold2011_Giersch1990_CalvinCycle encodement "http://identifiers.org/go/GO:0019253"
Arnold2011_Giersch1990_CalvinCycle taxon "http://identifiers.org/taxonomy/33090"
