Using ode() from the deSolve Package in R

My latest adventures have revolved around solving ordinary differential equations (ODE’s), for the most part, in R. To do this, I’ve been using the ode() function from the deSolve package. In the next step of what I’m trying to do, though, it seems I need dede() for delayed differential equations. From what I understand, you […]

Continue reading..Using ode() from the deSolve Package in R

Part 2: Fixing the Stella R Python Script

Background Welcome to my continued adventures in translating Stella models to R. To catch you up in case you haven’t been following along (i.e. a high probability that this applies to you) I’ve been retooling the StellaR.py script that I found on the internet. The latest version on the linked site is buggy and old, […]

Continue reading..Part 2: Fixing the Stella R Python Script

Part 1: Fixing the Stella R Python Script

To fix along yourself, first download StellaR.py v. 1.3. First, I’ll start with in-place changes so I can reference the original line numbers. Line 321 needs an added test to see if there’s really anything “to” the model, even if the INIT is found: if init_match and len(lines[i-1].strip().split()[6:-2]) > 0: Line 354: I added the […]

Continue reading..Part 1: Fixing the Stella R Python Script

Some Lingering Questions: Stella –> R

I converted array variables to just regular variables; I replaced the front bracket with an underscore and removed the closing bracket. Does this have any consequence? I still may have some order of operations problems since I took parentheses out unless there are functions to be translated within if statements… Does case not matter  for […]

Continue reading..Some Lingering Questions: Stella –> R

Some Extra Considerations: Python 2-3

You can use the handy 2to3 script included with a Python 3 install, and I sincerely hope that solves all of your problems. If it doesn’t, here are some things to think about… The default open() behavior changes between versions, namely in what it considers a newline. I had something strange happen: the same things […]

Continue reading..Some Extra Considerations: Python 2-3