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

fixes for SolveIVP implementation #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soypat
Copy link
Contributor

@soypat soypat commented Jun 3, 2023

Please take a look. Fixes issue raised in mail group: https://groups.google.com/g/gonum-dev/c/_B0R3518KNI

also adds initial conditions as part of result vector returned by SolveIVP as that seems reasonably intuitive.

@kortschak
Copy link
Member

What is the fix?

@@ -46,10 +48,12 @@ func SolveIVP(p IVP, solver Integrator, stepsize, tend float64) (results []State
if nx == 0 {
return nil, errors.New("state vector length can not be equal to zero. Has ivp been set?")
}
solver.Init(p)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kortschak Forgot to initialize the integrator. This was the pressing problem that caused the crash since it meant some fields were nil upon attempting to integrate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that was my suspcion. Can you make a note of that in the commit message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright!

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.

2 participants