Closed gszep closed 4 years ago
This call
ContinuationPar{eltype(u₀),AbstractLinearSolver,EigenSolver}
is strange. You should never use AbstractLinearSolver
, it is used for dispatch. Looking at Newton.jl
, I understand why you where mislead.
Something like the following should be favoured:
u₀, _, stable = Cont.newton( u -> f(u,p₀), u₀, Cont.NewtonPar(verbose=false) )
optCont = Cont.ContinuationPar{eltype(u₀),typeof(DefaultLS()), typeof(DefaultEig())}(
pMin=kwargs[:pMin],pMax=kwargs[:pMax],ds=kwargs[:ds],
maxSteps=kwargs[:maxSteps])
It seems they did not implement broadcasting:
u0 = param([-2.0,0.0])
u1 = copy(u0)
All of this fails except the last one:
u0 .= u0 .- u1
axpy!(2,u0,u1)
u0 = u0 .- u1
It comes from the fact that copyto!
is not implemented. This is troublesome because typeof(u0) <: AbstractArray
and hence, all my BorderedArrays methods will be called, like this one.
So you have to extend minus!(x::TrackedArray, y::TrackedArray) = x = x .- y
. However, in newton
, the return type of d
by the linear solver is not TrackedArray
. So I define:
minus!(x::TrackedArray, y) = x = x .- y
Now the code works but newton does not converge. At least it does not error!
The branch errors because of finiteDifferences
. You can either import finiteDifferences
and redefine it for TrackedArrays
or use the function fdTracked
I put on master.
adding any kwarg into
Cont.continuation
- in the below exampleverbosity=0
crashes julia when running
main.jl
with the following output