Skip to content
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

Fixedpoint returns wrong result #231

Open
bertschi opened this issue Jan 20, 2020 · 5 comments
Open

Fixedpoint returns wrong result #231

bertschi opened this issue Jan 20, 2020 · 5 comments

Comments

@bertschi
Copy link

Hi,

consider the following function:
f(x, p) = p .* x

When I solve for a fixed point everything works fine when p != 0. But when p = 0, the call
fixedpoint(x -> f(x, 0.), [1.2])
just returns the initial condition, e.g. 1.2, and not the fixed point of zero. This also occurs when setting m = 0 which according to the documentation just gives Picard iteration. Don't understand how this could possibly fail. Any ideas?

Nils
@pkofod
Copy link
Member

pkofod commented Jan 23, 2020

Can you show me the output? I get the correct answer.

@pkofod
Copy link
Member

pkofod commented Jan 24, 2020

I'm seeing some test noise wrt fixedpoints so I'm looking into it.

@bertschi
Copy link
Author

Your right, it works in version 4.2.0

julia> fixedpoint(x -> f(x, 0.), [1.2])
Results of Nonlinear Solver Algorithm

  • Algorithm: Anderson m=1 beta=1 aa_start=1 droptol=0
  • Starting Point: [1.2]
  • Zero: [0.0]
  • Inf-norm of residuals: 0.000000
  • Iterations: 2
  • Convergence: true
    • |x - x'| < 0.0e+00: true
    • |f(x)| < 1.0e-08: true
  • Function Calls (f): 2
  • Jacobian Calls (df/dx): 0

With version 4.0.0 instead, I get

fixedpoint(x -> f(x, 0.), [1.2])
Results of Nonlinear Solver Algorithm

  • Algorithm: Anderson m=5 beta=1.0
  • Starting Point: [1.2]
  • Zero: [1.2]
  • Inf-norm of residuals: 1.200000
  • Iterations: 1
  • Convergence: true
    • |x - x'| < 0.0e+00: true
    • |f(x)| < 1.0e-08: false
  • Function Calls (f): 1
  • Jacobian Calls (df/dx): 0

In any case, I was running on Julia 1.3.0. Will upgrade my dependencies which hopefully also solves the issue with my larger model.

@pkofod
Copy link
Member

pkofod commented Jan 24, 2020

Fingers crossed :)

@pkofod
Copy link
Member

pkofod commented Jan 24, 2020

I think this solved your bug 9b4c7b3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants