You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a workaround, you can use Dates.value to coerce a usable differential.
julia> Dates.value.([t[i] - t[i-1] for i in 2:length(t)]) .* [(y[i] + y[i-1])/2 for i in 2:length(y)]
9-element Vector{Float64}:
8.07065043298154
5.152365177837516
5.567406752837018
5.6176907675128165
2.1005713848265097
3.9903424246305317
4.578827766243022
5.643092049922833
5.690176685766052
julia> sum(Dates.value.([t[i] - t[i-1] for i in 2:length(t)]) .* [(y[i] + y[i-1])/2 for i in 2:length(y)])
46.41112344255784
julia> integrate(Dates.value.(t), y)
46.41112344255784
The text was updated successfully, but these errors were encountered:
I am trying to compute the numerical integral from a time series. This fails due to a type conversion error that I do not really understand.
I don't think this is really a bug in NumericalIntegration.jl, since you can easily produce the same fault directly without the package.
As a workaround, you can use
Dates.value
to coerce a usable differential.The text was updated successfully, but these errors were encountered: