add-my-pet / DEBtool_J.jl

Beta version of DEBtool_M coded in Julia language
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

General first comments issues to address (brought up by Bas) #1

Open starraugustine opened 1 year ago

starraugustine commented 1 year ago

Matlab in DEBtool_M is running Perl (via select), C++ (via popDyn), Java (via NetLogo in popDyn), Latex/BibTex (to compose references) and outputs in HTML, JavaScript. If we finally master the DOI archiving, we can perhaps add R to the list as well. Moreover it runs a collection of functions, such as wget, in the shell and reads in HTML pages, e.g. to classify the species. I doubtlessly forgot some more. The list shows that we should not think in terms of either/or, but of and/and. If the Julia exercise shows us what parts is slowing down the procedure most, we can also think of replacing those modules directly by C++. We also might try to run Julia under Matlab.

Can Julia handle Matlab's concept "persistent"? We use it to avoid the need to re-load allStat, but also in DEBtool_M/animal/get_tjm to set s_M if v_H < v_Hj and use it if v_H > v_Hj.

Small remarks about the js pars_init file:

1) the zoom factor is dimless (does not have dim length)

2) DEBtool_M pars_init files use DEBtool_M/lib/pet/get_d_V and get_N_waste for default values for d_E, dV and n*N, based on the classification of the species. The user can overwrite the default values.

mrke commented 4 months ago

I finally got back to this and removed all the globals and multi-species capacity so it's a very bare bones version that we can build from. It runs 3x faster than Matlab now (20s vs 1 min) and converges to almost identical values in almost the same number of steps (~1660 vs ~1650). Note that there are slight differences in the calculations of age at birth because it's using a different quadrature formulation (Julia's quadgk uses adaptive Gauss–Kronrod quadrature whereas Matlab's quad uses Simpson quadrature).