Skip to content
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

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

Open
phpsmarter opened this issue Jul 16, 2022 · 1 comment
Open

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

phpsmarter opened this issue Jul 16, 2022 · 1 comment

Comments

@phpsmarter
Copy link

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
Copy link
Member

Yes that's reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants