-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1-dimensional equations are converted to scalar equations #20
Comments
f <- function(u,p,t) {
return(1.01*u)
}
u0 = 1/2
tspan <- list(0.0,1.0)
sol = diffeqr::ode.solve(f,u0,tspan) works with the latest versions, but f <- JuliaCall::julia_eval("
function f(du,u,p,t)
du .= 1.01.*u
end") does not because in R there is no difference between scalars and arrays, so the R->Julia connection converts arrays of length 1 into scalars, meaning on the Julia side it should have scalar semantics instead of array semantics. That |
As discussed here, @dlekshmi and myself are having trouble running 1D example from the CRAN ODE vignette.
The original code with function definition through R
gives the following error
And a modified version with function definition through JuliaCall
gives
Issue can be circumvented by turning the function into a system of equations. I put together a more detailed R notebook with my session info/system of equations hack, and previously suggested fixes.
The text was updated successfully, but these errors were encountered: