@@ -100,22 +100,42 @@ function solution_new_retcode(sol::AbstractODESolution{T,N},retcode) where {T,N}
100
100
sol. alg,sol. interp,sol. dense,sol. tslocation,sol. destats,retcode)
101
101
end
102
102
103
- function solution_new_tslocation (sol:: AbstractODESolution{T,N} ,tslocation) where {T,N}
104
- ODESolution{T,N,typeof (sol. u),typeof (sol. u_analytic),typeof (sol. errors),
105
- typeof (sol. t),typeof (sol. k),
106
- typeof (sol. prob),typeof (sol. alg),typeof (sol. interp),typeof (sol. destats)}(
107
- sol. u,sol. u_analytic,sol. errors,sol. t,sol. k,sol. prob,
108
- sol. alg,sol. interp,sol. dense,tslocation,sol. destats,sol. retcode)
103
+ function solution_new_tslocation (sol:: AbstractODESolution{T,N} ,tslocation) where {T,N}
104
+ ODESolution{T,N,typeof (sol. u),typeof (sol. u_analytic),typeof (sol. errors),
105
+ typeof (sol. t),typeof (sol. k),
106
+ typeof (sol. prob),typeof (sol. alg),typeof (sol. interp),typeof (sol. destats)}(
107
+ sol. u,sol. u_analytic,sol. errors,sol. t,sol. k,sol. prob,
108
+ sol. alg,sol. interp,sol. dense,tslocation,sol. destats,sol. retcode)
109
+ end
110
+
111
+ function solution_slice (sol:: AbstractODESolution{T,N} ,I) where {T,N}
112
+ ODESolution{T,N,typeof (sol. u),typeof (sol. u_analytic),typeof (sol. errors),
113
+ typeof (sol. t),typeof (sol. k),
114
+ typeof (sol. prob),typeof (sol. alg),typeof (sol. interp),typeof (sol. destats)}(
115
+ sol. u[I],
116
+ sol. u_analytic === nothing ? nothing : sol. u_analytic[I],
117
+ sol. errors,sol. t[I],
118
+ sol. dense ? sol. k[I] : sol. k,
119
+ sol. prob,
120
+ sol. alg,sol. interp,false ,sol. tslocation,sol. destats,sol. retcode)
121
+ end
122
+
123
+ function sensitivity_solution (sol:: AbstractODESolution ,u,t)
124
+ T = eltype (eltype (u))
125
+ N = length ((size (sol. prob. u0)... , length (u)))
126
+ interp = if typeof (sol. interp) <: LinearInterpolation
127
+ LinearInterpolation (t,u)
128
+ elseif typeof (sol. interp) <: ConstantInterpolation
129
+ ConstantInterpolation (t,u)
130
+ else
131
+ SensitivityInterpolation (t,u)
109
132
end
110
133
111
- function solution_slice (sol:: AbstractODESolution{T,N} ,I) where {T,N}
112
- ODESolution{T,N,typeof (sol. u),typeof (sol. u_analytic),typeof (sol. errors),
113
- typeof (sol. t),typeof (sol. k),
114
- typeof (sol. prob),typeof (sol. alg),typeof (sol. interp),typeof (sol. destats)}(
115
- sol. u[I],
116
- sol. u_analytic === nothing ? nothing : sol. u_analytic[I],
117
- sol. errors,sol. t[I],
118
- sol. dense ? sol. k[I] : sol. k,
119
- sol. prob,
120
- sol. alg,sol. interp,false ,sol. tslocation,sol. destats,sol. retcode)
121
- end
134
+ ODESolution{T,N,typeof (u),typeof (sol. u_analytic),typeof (sol. errors),
135
+ typeof (t),Nothing,typeof (sol. prob),typeof (sol. alg),
136
+ typeof (interp),typeof (sol. destats)}(
137
+ u,sol. u_analytic,sol. errors,t,nothing ,sol. prob,
138
+ sol. alg,interp,
139
+ sol. dense,sol. tslocation,
140
+ sol. destats,sol. retcode)
141
+ end
0 commit comments