SciML / SciMLTutorials.jl

Tutorials for doing scientific machine learning (SciML) and high-performance differential equation solving with open source software.
https://tutorials.sciml.ai
Other
712 stars 128 forks source link

as for code readable, I have a little suggestion #528

Open phpsmarter opened 1 year ago

phpsmarter commented 1 year ago

eg. lorenz

function lorenz!(du,u,p,t)
    σ,ρ,β = p

    du[1] = σ*(u[2]-u[1])
    du[2] = u[1]*(ρ-u[3]) - u[2]
    du[3] = u[1]*u[2] - β*u[3]
end

modify to :

function lorenz!(du,u,p,t)
    σ,ρ,β = p
    x,y,z = u

    du[1] = σ*(y-x)
    du[2] = x*(ρ-z) -y
    du[3] = x*y - β*z
end

better or worse?

ChrisRackauckas commented 1 year ago

Yes that's reasonable.