constrained FindFit is extremely slow?
- To: mathgroup at smc.vnet.net
- Subject: [mg131640] constrained FindFit is extremely slow?
- From: dantimatter <google at dantimatter.com>
- Date: Sun, 15 Sep 2013 07:06:26 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
hi all i'm trying to use FindFit to find parameters in a differential equation model, and give it a bit of help by adding constraints. But i'm finding that as soon as i add a single constraint, Mathematica grinds to a halt. is this something specifically to do with the differential equation model? code is: model[a_?NumberQ,b_?NumberQ,c_?NumberQ,d_?NumberQ,f_?NumberQ,Km1_?NumberQ,Km2_?NumberQ,Km3_?NumberQ,NTP0_?NumberQ]:=(model[a,b,c,d, f, Km1,Km2,Km3,NTP0]=First[MG/.NDSolve[{ MG'[t]==a*DNA*NTP[t]/(Sqrt[Km1^2]+NTP[t])-b MG[t], NTP'[t]==-f*a*DNA*NTP[t]/(Sqrt[Km1^2]+NTP[t])-d MG[t] NTP[t]/(Sqrt[Km2^2]+NTP[t])-c NTP[t]/(Sqrt[Km3^2]+NTP[t]), NTP[0]==NTP0,MG[0]==0},{MG,NTP},{t,0,800},Method->StiffnessSwitching]]); fit = FindFit[data, model[a, b, c, d, f, Km1, Km2, Km3, NTP0][ t], {{a, 10}, {b, 0.0737}, {c, 7}, {d, .99}, {f, 18}, {Km1, 12893.842}, {Km2, 8663.477}, {Km3, 1946}, {NTP0, 1500000}}, t] thanks!