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

Ls/fixed rosenbrock #28

Merged
merged 6 commits into from
Nov 18, 2024
Merged

Ls/fixed rosenbrock #28

merged 6 commits into from
Nov 18, 2024

Conversation

lsoucasse
Copy link
Member

@lsoucasse lsoucasse commented Nov 18, 2024

This work implements the Rosenbrock timestepping scheme for computation of stellar evolution quantities with a fixed time grid (though increasing timestep).

To determine the time grid, I ran the adaptive Rosenbrock scheme and plot the time step as a function of time. I roughly obtained a power law dAge = 0.1 Age^0.75 (Myr). I added a capping to a maximum time step of 50 Myr for further accuracy.

This time step is now set as the default one. I added a test but kept the one using the ForwardEuler scheme.

@lsoucasse lsoucasse linked an issue Nov 18, 2024 that may be closed by this pull request
@nichollsh
Copy link
Contributor

Fast work, thanks @lsoucasse. Does the Rosenbrock method roughly reproduce the results of the Euler method?

@lsoucasse
Copy link
Member Author

Fast work, thanks @lsoucasse. Does the Rosenbrock method roughly reproduce the results of the Euler method?

Yes, you can actually compare them as I kept same input for the two tests (Rosenbrock/Euler). Highest differences are of the order of 5% for XUV fluxes as spotted earlier with the adaptive Rosenbrock.

@lsoucasse
Copy link
Member Author

Actually I also ran the Proteus test (physical integration) and only escape rate is affected (which makes sense).

@nichollsh
Copy link
Contributor

I agree that that makes sense. If we run PROTEUS with the updated version of MORS, will it then automatically use this new integrator by default?

@lsoucasse
Copy link
Member Author

I agree that that makes sense. If we run PROTEUS with the updated version of MORS, will it then automatically use this new integrator by default?

Yes, I switch this new time scheme as the default as discussed this morning. I already have a proteus branch with updated test values. I will open a PR once pyPI release is published.

@lsoucasse
Copy link
Member Author

lsoucasse commented Nov 18, 2024

If you want to run with previous time stepping scheme use:
params = mors.NewParams()
params['TimeIntegrationMethod'] = 'ForwardEuler'
star = mors.Star(Mstar=inp[0], Omega=inp[1], params = params)

@lsoucasse lsoucasse merged commit c84d473 into main Nov 18, 2024
6 checks passed
@lsoucasse lsoucasse deleted the ls/fixed-rosenbrock branch November 18, 2024 14:56
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

Successfully merging this pull request may close these issues.

Deriving a fixed-timestep version of the Rosenbrock scheme
2 participants