-
-
Notifications
You must be signed in to change notification settings - Fork 126
Update tutorial about Measurements.jl #28
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
Conversation
I think you should mention here that the default absolute tolerance is Other than that, looks great! |
Now I'm using a tighter tolerance in the tutorial, so that the plots are smoother, thanks for the tip However, I've just realized that the second example still fails if using DifferentialEquations, Measurements
g = 9.79 ± 0.02; # Gravitational constants
L = 1.00 ± 0.01; # Length of the pendulum
#Initial Conditions
u₀ = [0 ± 0, π / 60 ± 0.01] # Initial speed and initial angle
tspan = (0.0, 6.3)
#Define the problem
function simplependulum(du,u,p,t)
θ = u[1]
dθ = u[2]
du[1] = dθ
du[2] = -(g/L)*θ
end
#Pass to solvers
prob = ODEProblem(simplependulum, u₀, tspan)
sol = solve(prob, Tsit5()) error message:
|
Missing norm definition and one missed convert change. DiffEqBase + OrdinaryDiffEq masters now handle it fine. |
Should work on updated versions. |
Looks fantastic! |
I'm too late writing, but that's ok 😅 Before update: https://nbviewer.jupyter.org/github/giordano/DiffEqTutorials.jl/blob/7e3ccc6b73f2b2c5962f09a60723609741301e7b/PhysicalModels/NumberUncertainties.ipynb Yesterday I didn't pay much attention, but errorbars were probably wrong. There is no uncertainty on times, the only quantity with uncertatinty is half-life of Carbon-14, so I have no idea where those bars on x came from 😕 Current results look more OK, also the plot in Out[10] now shows difference between numerical and analytic solution smaller than the requested tolerance |
I've simplified the tutorial after fixes in
DiffEqBase.jl
andMeasurements.jl
. Preview: https://nbviewer.jupyter.org/github/giordano/DiffEqTutorials.jl/blob/3c2b974245af0738bc079739227722a48a2e41a9/PhysicalModels/NumberUncertainties.ipynb