[R-sig-dyn-mod] FME Fitting a multicompartmental model using the sum of several variables
Blanco Pérez, Juan Carlos
ju@n@c@r|o@@b|@nco@perez @end|ng |rom xunt@@g@|
Tue Sep 17 15:02:23 CEST 2019
Hi Jesus,
Thank you for your solution. It seems a good alternative to using the modCost function of FME, which does not seem to work if all variables are not included.
-----Mensaje original-----
De: R-sig-dynamic-models [mailto:r-sig-dynamic-models-bounces using r-project.org] En nombre de Jesus Maria Frias Celayeta
Enviado el: martes, 17 de septiembre de 2019 12:24
Para: Special Interest Group for Dynamic Simulation Models in R
Asunto: Re: [R-sig-dyn-mod] FME Fitting a multicompartmental model using the sum of several variables
Hi Juan,
Using the example from
https://www.r-bloggers.com/learning-r-parameter-fitting-for-models-involving-differential-equations/
you could include the sum in your ode system like:
rxnrate=function(t,c,parms){
# rate constant passed through a list called parms
k1=parms$k1
k2=parms$k2
# c is the concentration of species
# derivatives dc/dt are computed below
r=rep(0,length(c))
r[1]=-k1*c["A"] #dcA/dt
r[2]=k1*c["A"]-k2*c["B"] #dcB/dt
r[3]=k2*c["B"] #dcC/dt
r[4]= r[1]+r[2]+r[3] # sum of A,B,C
# the computed derivatives are returned as a list # order of derivatives needs to be the same as the order of species in c
return(list(r))
}
all the best,
Jesus
________________________________
From: R-sig-dynamic-models <r-sig-dynamic-models-bounces using r-project.org> on behalf of Blanco P rez, Juan Carlos <juan.carlos.blanco.perez using xunta.gal>
Sent: Tuesday 17 September 2019 10:35
To: r-sig-dynamic-models using r-project.org <r-sig-dynamic-models using r-project.org>
Subject: [R-sig-dyn-mod] FME Fitting a multicompartmental model using the sum of several variables
I'm new to deSolve and FME.
I'm trying to fit a two-compartment model but the observed data are the sum of the two compartments. Can this be done with FME?. I have tried to compute the sum from the ODE output but then the result is not longer a deSolve object and multiple errors appear.
Juan
[[alternative HTML version deleted]]
_______________________________________________
R-sig-dynamic-models mailing list
R-sig-dynamic-models using r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
--
*This email originated from TU Dublin. If you received this email in error, please delete it from your system. Please note that if you are not the named addressee, disclosing, copying, distributing or taking any action based on the contents of this email or attachments is prohibited. *******
*Is OT Baile tha Cliath a th inig an r omhphost seo. M fuair t an r omhphost seo tr earr id, scrios de do ch ras le do thoil. Tabhair ar aird, mura t an seola ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon ch ipe il, aon d ileadh n ar aon ghn omh a dh anfar bunaithe ar an bhar at sa r omhphost n sna hiat in seo.*
This email originated from TU Dublin. If you received this email in error, please delete it from your system. Please note that if you are not the named addressee, disclosing, copying, distributing or taking any action based on the contents of this email or attachments is prohibited.
Is OT Baile tha Cliath a th inig an r omhphost seo. M fuair t an r omhphost seo tr earr id, scrios de do ch ras le do thoil. Tabhair ar aird, mura t an seola ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon ch ipe il, aon d ileadh n ar aon ghn omh a dh anfar bunaithe ar an bhar at sa r omhphost n sna hiat in seo.
[[alternative HTML version deleted]]
More information about the R-sig-dynamic-models
mailing list