I recently started to thinking about switching my simulations to Julia and got to know about Catalyst.jl package and its convenient macro to create and modify reaction networks.
I wanted to add a reaction to an already defined reaction network using the addreaction!() function but am unable to do so because I am unable to understand the syntax mentioned.
This is my network:
@reaction_func Hsn(thr,N,lbd,cop) = ((thr^cop)/((thr^cop) + (N^cop))) - lbd*(1-((thr^cop)/((thr^cop) + (N^cop))))
@reaction_func Hsp(thr,N,lbd,cop) = (((thr^cop)/((thr^cop) + (N^cop))) - lbd*(1-((thr^cop)/((thr^cop) + (N^cop)))))/lbd
coupled_switch = @reaction_network begin
(kA,kB,kC,kD), (A,B,C,D) β β
gA*(Hsn(tBA,B,fBA,nBA)*Hsn(tCA,C,fCA,nCA)), β
β A
gB*(Hsn(tAB,A,fAB,nAB)*Hsn(tDB,B,fDB,nDB)), β
β B
gC*(Hsn(tAC,A,fAC,nAC)*Hsn(tDC,D,fDC,nDC)), β
β C
# This is the reaction I am trying to add as a test.
#gD*(Hsn(tBD,B,fBD,nBD)*Hsn(tCD,C,fCD,nCD)), β
β D
end
And to add the reaction I am doing:
addreaction!(coupled_switch, gD*(Hsn(tBD,B,fBD,nBD)*Hsn(tCD,C,fCD,nCD)), β
β D )
and I am getting the following error:
UndefVarError: Hsn not defined
in top-level scope at r.jl:45
I realise this is completely wrong, but I am unable to find the right method to do so as I am unable to understand the documentation.
The documentation does not mention anything about the format of the the reaction to be passed to the addreaction!() function. Does anyone know the right way to do it?