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).

43 questions
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
  • 4,248
  • 1
  • 19
  • 36
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
  • 6
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
  • 26,344
  • 42
  • 116
  • 201
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
3 answers

Fixed point iteration in Python

Im beginner at Python and I have a problem with this task: Write a function which find roots of user's mathematical function using fixed-point iteration. Use this function to find roots of: x^3 + x - 1. Draw a graph of the dependence of roots…
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
  • 11
  • 1
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
  • 14,203
  • 14
  • 49
  • 94
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
  • 14,203
  • 14
  • 49
  • 94
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
  • 1
  • 11
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
  • 703
  • 7
  • 23
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…
1
vote
1 answer

solve equation using fixed point in scilab?

I have a equation f(x)=exp(x)+3x^2, f(x)=0, x=? then I use scilab to solve that equation using fixed point iteration this is my code function fixed_point(fung,x0,err) x=zeros(100); ea = 100; i = 1; x(i)=x0; printf(" \t i \t x(i) \t …
Zahi Azmi
  • 11
  • 5
1
vote
1 answer

Ocaml fixed point implementation

I'm trying to figure out how to implement fixed point iteration in Ocaml. That is, given a function f and an x, I want to calculate what the final value of what f(f(f(x)...)) will be. So for example, if my function is x/2 and my x=50, my answer…
pauliwago
  • 5,359
  • 10
  • 36
  • 48
0
votes
1 answer

Fastest way to compute large amount of fixed points in python?

I have a large amount of one-dimensional nonlinear fixed point problems to solve, what is the most efficient numerical solver? I'm currently using scipy.optimize.fixed_point, it takes around 17s to run 1000 of my tasks. Thanks for any suggestions.