I'm messing around with solving the Lorenz system over a long timespan (0 to 100,000) in both MATLAB and Julia in an attempt to make a crude runtime comparison (I'm using ode45 in MATLAB, and DP5 in Julia, with both abstol and reltol set to 1e-6, hoping that what they compute is equivalent).
I got that MATLAB took about 18 seconds, and produced this trajectory plot:

Julia timed in at 14.517 ms but I got the following warning:
Warning: Interrupted. Larger maxiters is needed. If you are using an integrator for non-stiff ODEs or an automatic switching algorithm (the default), you may want to consider using a method for stiff equations.
And as well as that, the trajectory plot looks... well... janky!

Why is this happening? Anyone got any ideas? Are ode45 and DP5 even comparable? Should I be coding up my own differential equation solver to make sure I can compare the two fairly?
I tried making sure that I used equivalent solvers, used the same relative and absolute tolerances so that the step sizes the ODE solvers took would be similar, but got very different looking results.
Edit: Thanks so much for the tips so far! As per suggestion, here is my code for the Lorenz trajectory in Julia (wouldn't be surprised if it had a bug that I haven't noticed yet...)
# Lorenz system ODE function
function lorenz!(du, u, p, t)
sigma, rho, beta = p
du[1] = sigma * (u[2] - u[1])
du[2] = u[1] * (rho - u[3]) - u[2]
du[3] = u[1] * u[2] - beta * u[3]
end
function test()
# Lorenz system parameters as StaticArrays
params = @SVector [10.0, 28.0, 8/3.0]
# Initial conditions as StaticArrays
u0 = [1.0, 0.0, 0.0]
# Time span
tspan = (0.0, 100000.0)
# Solve the ODE using DP5
quick_prob = ODEProblem(lorenz!, u0, 10, params)
# function is compiled when we solve quick_prob
quick_sol = solve(quick_prob, DP5(), abstol=1e-6, reltol=1e-6; dt = 0.1)
# solve actual long problem and record execution time, excluding compilation time
prob = ODEProblem(lorenz!, u0, tspan, params)
@time sol = solve(prob, DP5(), abstol=1e-6, reltol=1e-6)
# Plot the trajectory
plot(sol, vars=(1, 2, 3), label="Lorenz System", xlabel="X", ylabel="Y", zlabel="Z", legend=:bottomright)
end
test()
ode45andDP5are comparable. You don't need to write your own ode solver. most likely your julia code for the integrator has a bug. The easiest way to check this is to call your integrand on a random input in both Matlab and Julia to make sure you actually have the same equation.