Questions tagged [fixed-point-iteration]

Questions about fixed-point iteration, a method for calculating fixed points of functions. For combinators used to encode recursion, use [fixpoint-combinators] instead. For fixed-point arithmetic, use [fixed-point] instead. For the fixedpoint engine of Z3, use [z3-fixedpoint] instead.

A fixed point of a function f(x) is a value c such that f(c) = c. In words, a function takes its fixed points to themselves. Fixed points can be computed by an iterative algorithm. Various numerical analysis problems can be expressed in terms of obtaining fixed points, one example being Newton's method for obtaining roots of an equation (see the tag).

47 questions
3
votes
2 answers

How do I iterate until a fixed point in Clojure?

I'm frequently in the position that my code reads like so: (iterate improve x) And I'm looking for the first value that no longer is an improvement over the previous. Neither filter nor take-while lend themselves to an obvious solution. However,…
Sebastian Oberhoff
  • 1,271
  • 1
  • 10
  • 16
2
votes
2 answers

How to verify in Fortran whether an iterative formula of a non-linear system will converge

How to verify in Fortran whether an iterative formula of a non-linear system will converge to the root near (x,y)? It was easy for a programming language which support symbolic computations. But how to do that in Fortran? Like getting partial…
2
votes
0 answers

How to avoid taking negative base of power function during the problem solving process using NLsolve in Julia?

I am a Julia beginner. I would like to solve the following non-linear equation using nlsolve. #Variables D= 200 #number of dimension w= [0.17935458155165915; 0.02074763117110885; 0.429373018098153; 0.05169130596707894; 0.1268251892348001;…
2
votes
2 answers

Haskell: monadic fixpoint on RWS is looping if traversing on argument

I am writing a program which involves RWS for tracking mutable state and producing some log. My purpose is to define a computation that evaluates some action, gathers the aftercoming state and depending on it appends something to the beginning of…
radrow
  • 6,419
  • 4
  • 26
  • 53
2
votes
2 answers

Find a fixed point with only one input (an array) for the function

I am trying to find a fixed point in an array using a function that only accepts one input (an array). The problem is, I'm trying to avoid building another function that this function can call. If I could do that, this situation would be solved.…
n3vdawg
  • 29
  • 8
2
votes
1 answer

Fixed point theory and the isGoodEnough function

In Coursera course Functional Programming Principles in Scala, the Lecturer talks about the Fixed Point and wrote some simple implementation of it. def isCloseEnough(x: Double, y: Double) = math.abs((x - y) / x) / x < tolerance def…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
2
votes
1 answer

Matlab optimiziation where objective is implicitly given by a fixed point equation

I have the following problem: max CEQ(w) s.t. w in (0,1) and I don't know anything about CEQ(w) except that is given by a fixed point equation of the form CEQ(w) = F(CEQ(w)). If I fix a w, I can solve the fixed point equation using the fzero…
marky2k
  • 97
  • 1
  • 5
1
vote
2 answers

Express a "case ... of" pattern more elegantly in Haskell

I came across a pattern which I believe can be expressed more elegantly: I have two functions f1,f2 :: Int -> Int (their impl. is not relevant), and a process :: Int -> Int which does the following: if f1 x produces x1 different from x, then repeat…
Alexandru Dinu
  • 1,159
  • 13
  • 24
1
vote
0 answers

How to find fixed points or find the stationary points (numerically) in this system with Matlab?

I hope help me in this problem. I like find the fixes point in this system. I wrote a code in Matlab as follow: clear all; close all; clc; % tic; rand('state',sum(100*clock)); % seed % numreps=2; % Number of iterations for j=1:numreps options =…
1
vote
1 answer

Minizinc: how can I make the union of a set in this situation (fix point algorithm?)

I have an array of sets that means that the items inside the set must finish before the actual one starts. For example: before = [ {}, {1}, {}, {}, {2}]; I'm looking to make each line include the ones who go before…
Stasky
  • 107
  • 1
  • 5
1
vote
2 answers

Find root with Newton's method

I write the newton-method to find root from Scheme example in elisp as #+begin_src emacs-lisp :session sicp :lexical t (defun deriv(g) (lambda (x) (/ (- (funcall g (+ x dx)) (funcall g x)) dx))) (defvar dx 0.00001) (defvar tolerance…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
1
vote
3 answers

The inner `try` interation in `fixed-point`

I am reading the fix-point of SICP: #+begin_src emacs-lisp :session sicp :lexical t (defvar tolerance 0.00001) (defun fixed-point(f first-guess) (defun close-enoughp(v1 v2) (< (abs (- v1 v2)) tolerance)) (defun try(guess) ;; (let ((next…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
1
vote
0 answers

Break-Point Implementation for Fixed-Point Iteration for System of Equations in Javascript

const x = new Array(3).fill(0) const x0 = new Array(3).fill(0) const er = new Array(3).fill(0) const C = [1, 1, 1]; for (let j = 0; j < 1000; j++) { for (let i = 0; i < C.length; i++) { x[i] = C[i] + 1 / x0[i]; er[i] =…
Isaac
  • 396
  • 3
  • 13
1
vote
1 answer

Converting explicit euler to implicit euler (via fixed-point iteration)

So I have a school task where I need to calculate the position of a bunch of cars following each other on a road (AKA driving in a line, so if Car 10 [the car that is first in line] brakes, then Car 9 brakes and when Car 9 brakes, Car 8 has to brake…
Schytheron
  • 715
  • 8
  • 28
1
vote
0 answers

Fixed-Point Iteration Mathematica

This is a mathematica code for fixed point iteration. expr={1,0,9999}; f[{i_,xi_,err_}]:=(xipp=0.2062129*(20+(2*xi))^(2/5); {i+1,xipp,Abs[(((xipp-xi)/(xipp))*100)]}); NestWhileList[f,expr,#[[3]]>=.05&] If I were to prove this converges for all…