![]() ![]() probably faster to run the equation solver recursively, as it'll converge faster with better initial guesses - using the previous value instead of the initial value is surely better. ![]() There are a few places where there are some potential speed-ups: This code is not optimized for efficiency. Your equation in B(t) is just-about separable since you can divide out B(t), from which you can get that B(t) = C * exp)įinally, simply run `tthetas` to get the maximizer. Update: I think this problem can be solved with the deSolve package in R, linked here, however I am having trouble implementing it using my particular example. How can I analytically solve for the value of of_interest that maximizes dAdt in R? If an analytical solution is not possible, how can I know, and how can I go about solving this numerically? Then plotting: plot(out~range, pch=16,col='purple') ST<- stode(y=y,func=model,parms=parameters,pos=T) So far I have been able to solve the model at steady state, across the possible values of of_interest to demonstrate there should be a maximum. This will be the value of the parameter of_interest that maximizes the function dAdt. ![]() I would like to write a function to take the derivative of dAdt with respect to of_interest, set the derived equation to 0, then rearrange and solve for the value of of_interest. #differential equations of component fluxes They are calculated as simple difference equations of four component fluxes flux1-flux4, 5 parameters p1-p5, and a 6th parameter, of_interest, that can take on values between 0-1. It boils down to two differential equations that model two state variables within the model, we'll call them A and B. ![]()
0 Comments
Leave a Reply. |