<div dir="ltr"><div>I do research in the field of mathematical ecology and use R for numerical computations and simulations.  Now to deal with my new research problem, I have to first reproduce a numerical simulation from a published paper (<a href="https://royalsocietypublishing.org/doi/pdf/10.1098/rstb.2015.0281" target="_blank">https://royalsocietypublishing.org/doi/pdf/10.1098/rstb.2015.0281</a>). I`m having trouble doing this. I am telling the process briefly:</div><div>The simulation starts with a system of 2 odes, which I have to integrate for 10000 time steps and need the steady state. After that, the number of variables in the system of ode may increase to 3 (depending on some conditions) and again I have to integrate it for 10000 time steps. After that, the number of variables may be 4 and so on. Each step of increasing the number of variables is called the mutation steps in the language of ecology. </div><div><br></div><div>Now I have to do 50000 mutation steps (each step contains ode integration for 10000 time points) to get a complete data set. </div><div><br></div><div>I call the functions from C++ (using Rcpp), then integrate it using the RK4 method of numerical integration of ode but it is taking a huge amount of time (near about 50-60 hrs) to complete the process. </div><div><br></div><div>Can one suggest to me what I should do to reduce the time of the simulation process.</div></div>