**THIS CODE WAS WRITTEN FOR THE CONSTRAINT-BASED MODELING WORKSHOP J.REED (1/2008) *REACTIONS * v1: A -> B * v2: B -> C * b1: -> A * b2: B -> * b3: C -> sets metabolites /A,B,C,D/ reactions /v1,v2,b1,b2,b3/; parameters c(reactions) S(metabolites,reactions) /A.v1 -1 B.v1 1 A.v2 -1 C.v2 1 A.b1 1 B.b2 -1 C.b3 -1/; variables v(reactions) Z; equations massbalance(metabolites) S.v = 0 objectivefunction Z=c.v ; massbalance(metabolites).. sum(reactions, S(metabolites,reactions)*v(reactions))=e=0; objectivefunction.. Z=e=sum(reactions,c(reactions)*v(reactions)); *Place lower bounds of 0 for all fluxes v.lo(reactions)=0; *Place upper bounds of 10 for all fluxes v.up(reactions)=10; *Define c, without this c is defaulted as being all zeros c('v1')=1; model FBA /all/; solve FBA using lp maximizing Z;