-
Notifications
You must be signed in to change notification settings - Fork 40
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
[DOC] what is the expected output type for the Jacobian? #21
Comments
Hi, For For the jacobian
This iterator docs, uses the above definition for the jacobian. It returns a diagonal matrix, as explained above. For the use or ForwardDiff, please check the docs online, it has been used many times in the tutorials either in the matrix way or functions. For static vectors, I have not tried and it is unlikely to work I would guess. For example, this line would break. This could be corrected by specializing the methods BorderedArrays.jl of to static arrays. I will modify the docs with your suggestions. Thank you for opening this issue. |
I don't understand this at all :( What is Jacobian for you? I recall that Jacobian is the derivative of the vector field F towards each of the variables, like so: In our discussion so far, only two things exist: There is another problem: I also don't understand
|
I was wrong! The jacobian object is used for 2 things
For example, the first part is done in the default linear solver implemented as callable struct Thus, 2 cases are allowed:
|
AHAAAAA! Alright, but then, for the first case, shouldn't in-place versions be much more performant? I.e. a function Jacobian!(J, x, p) that updates an existing matrix |
Probably but for the matrix-free case, it should not matter much as you have to build a Krylov space anyway: this is the usual bottleneck for the Now I can put everything inplace for the jacobian solver without breaking much in the package. |
I am thinking of making an interface from DynamicalSystems.jl to BifurcationKit.jl, because there for any It seems that at the moment neither of the two approaches would work here. Thus, if any of these two Jacobian forms became possible here, please do tag me! Such an interface would be very helpful, given how well bifurcation analysis ties in with dynamical systems theory. Even though the main goal of this package is PDEs, nothing stops us from using it for ODEs as well! |
I just corrected the docs of What is I dont understand why it wouldnot work |
It won't work because the out of place version returns a static matrix (performance gains) instead of |
Coming back to this. Can't you do something along the lines of:
|
Indeed! Since I anyways have to make a transformation to drop the |
Can we close this issue? |
Yeap! If I have other doc questions or suggestions I'll open new issues! |
👍 |
Hi there,
I'm trying to come up with a simple example for the bifurcation of 1-dimensional system to contribute to the documentation, under guidance of @gszep . I have the example running, by altering the code https://rveltz.github.io/BifurcationKit.jl/dev/iterator/# , but there are some things that are not yet clear enough for me.
What I really want to know is what is the allowed return types for both the vector field
f
and the Jacobian. The code has:but it was confusing for me because when I tried other types of
Jac_m
I got errors (I am not reporting errors here until I first see what is the expected form of Jacobian). I also tried to use the output ofForwardDiff.jacobian
, also getting errors.So, can you please document somewhere centrally in the documentation what is the expected forms for
f, J
? Not only what are the input arguments, but what is the expected output. The documentation of e.g. https://rveltz.github.io/BifurcationKit.jl/dev/library/#BifurcationKit.continuation does not discuss with clarity whatJ
should be. There you can also provide tips and tricks, as e.g. the above usage ofdiagm
is definitely something advanced for me, I would expected a 1-element matrix as return type in this example.A comment on how the docstring is structured: it provides:
This, almost always, is invalid Julia code. If
F
is an existing function, here you are redefining it as an anonymous functionF
, and Julia will just error. It also doesn't highlight what is the return type ofF
, yet repeats what are the expected input arguments.Why not consider replacing it with the more valid
F(x,p)::AbstractVector
, or simply explicitly write things out as e.g. "F
is a function with input arguments(x, p)
returning a vectorr
that represents the vector field of the dynamics".Are static vectors supported?
The text was updated successfully, but these errors were encountered: