Skip to content

Commit c6a5566

Browse files
Merge branch 'patch-2'
2 parents 860bf69 + 2913a1e commit c6a5566

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/ode/filament_prob.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function (f::FilamentCache)(dr, r, p, t)
158158
mul!(S1, A, r)
159159
S1 .+= F
160160
mul!(S2, P, S1)
161-
copy!(dr, S2)
161+
copyto!(dr, S2)
162162
return dr
163163
end
164164

@@ -183,10 +183,10 @@ end
183183
function projection!(f::FilamentCache)
184184
# implement P[:] = I - J'/(J*J')*J in an optimized way to avoid temporaries
185185
J, P, J_JT, J_JT_LDLT, P0 = f.P.J, f.P.P, f.P.J_JT, f.P.J_JT_LDLT, f.P.P0
186-
A_mul_Bt!(J_JT, J, J)
186+
mul!(J_JT, J, J')
187187
LDLt_inplace!(J_JT_LDLT, J_JT)
188-
A_ldiv_B!(P0, J_JT_LDLT, J)
189-
At_mul_B!(P, P0, J)
188+
ldiv!(P0, J_JT_LDLT, J)
189+
mul!(P', P0, J)
190190
subtract_from_identity!(P)
191191
nothing
192192
end

src/ode/nonlinchem.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function nonLinChem(dy,y,p,t)
2+
dy[1] = -y[1]
3+
dy[2] = y[1]-(y[2])^2
4+
dy[3] = (y[2])^2
5+
end
6+
y0 = [1.0;0.0;0.0]
7+
tspan = (0.0,20)
8+
nlc_analytic(u0,p,t) = [exp(-t);
9+
(2sqrt(exp(-t))besselk(1,2sqrt(exp(-t)))-2besselk(1,2)/besseli(1,2)*sqrt(exp(-t))besseli(1,2sqrt(exp(-t))))/(2besselk(0,2sqrt(exp(-t)))+(2besselk(1,2)/besseli(1,2))besseli(0,2sqrt(exp(-t))));
10+
-exp(-t)+1+(-2sqrt(exp(-t))*besselk(1,2sqrt(exp(-t)))+sqrt(exp(-t))*besseli(1,2sqrt(exp(-t)))*2besselk(1,2)/besseli(1,2))/(2besselk(0,2sqrt(exp(-t)))+2besselk(1,2)/besseli(1,2)*besseli(0,2sqrt(exp(-t))))]
11+
nonLinChem_f = ODEFunction(nonLinChem,analytic = nlc_analytic)
12+
prob_ode_nonlinchem = ODEProblem(nonLinChem,y0,tspan)

src/ode/ode_premade_problems.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ export prob_ode_linear, prob_ode_bigfloatlinear, prob_ode_2Dlinear,
1010
prob_ode_lorenz, prob_ode_rober, prob_ode_threebody, prob_ode_mm_linear, prob_ode_pleiades,
1111
prob_ode_brusselator_1d, prob_ode_brusselator_2d, prob_ode_orego,
1212
prob_ode_hires, prob_ode_pollution, prob_ode_filament,
13+
prob_ode_nonlinchem,
1314
SolverDiffEq, filament_prob
1415

1516
include("ode_linear_prob.jl")
1617
include("ode_simple_nonlinear_prob.jl")
1718
include("brusselator_prob.jl")
1819
include("pollution_prob.jl")
1920
include("filament_prob.jl")
21+
include("nonlinchem.jl")

0 commit comments

Comments
 (0)