Comments (9)
@mseri I just found the bug in the RK4 stepper function, should have been more careful when I wrote the function 🤦.
I also noticed something weird with RK4 a while back, but I never looked into it.
Basically, the problem was with the update:
let dy = M.((k1 + k2 + k3 + k4) /$ 6.)
It should be
let dy = M.((k1 + (2. $* k2) + (2. $* k3) + k4) /$ 6.)
I've made the necessary changes and pushed. But yea I agree, we should add a test suite to test all these stepper functions 👍
from owl_ode.
Agree, we can use matlab (or other tools) to generate a set of solutions beforehand, then use owl-ode to check against it.
from owl_ode.
One example that we often use in Zélus is:
let f t y yd =
yd.{0} <- (-. y.{1}); (* cosine *)
yd.{1} <- y.{0} (* sine *)
let y_init = [| 1.0; 0.0 |]
from owl_ode.
can we add a test suite similar to owl so others can recreate the issue?
from owl_ode.
It's on the pipeline. I am still trying to figure out the best way of testing this. Maybe by taking a set of known ode+solutions and checking that the error is somewhat O(h^(method-order)).
from owl_ode.
We could even pick some equations with closed form solutions if we want to be more reliable, at that point is really about comparing numerical and analytical solutions.
from owl_ode.
Indeed, that's a quite good example.
PS. Zélus seems awesome, I did not know about it, thanks for mentioning it!
from owl_ode.
Thanks! I’ll try to prepare some tests following tbrk suggestion soon
from owl_ode.
I have a proposal for testing: #6
If you agree with the approach, I am going to merge and release a new version (including also @tachukao fixes)
from owl_ode.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from owl_ode.