Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
64 views

I am using NonlinearSolve to solve a steady state problem. When I do prob = SteadyStateProblem(eoms!, σ₀, p) sol = solve( prob, SSRootfind(), abstol = slv.abstol, reltol = slv.reltol, )...
mrW's user avatar
  • 49
1 vote
1 answer
185 views

Update: I changed the argument 1 in nth-root to 1.0, and then it works. Why are they different? Here's my original question. I have (define tolerance 0.00001) (define (fixed-point f first-guess) (...
run an's user avatar
  • 23
0 votes
0 answers
93 views

I am trying to find the roots of three equations, and currently I am using minimize from scipy. from scipy.optimize import basinhopping import numpy as np def get_attraction(b1,b2, b3): c1 = 20 * ...
jasmine's user avatar
  • 263
0 votes
0 answers
112 views

I am trying to find the fixed points f(x)=x. I transform it to find the root of g(x)=f(x)-x. from scipy.optimize import root import numpy as np def get_attraction(b1,b2, b3): c1 = 20 * b1 + 12 * ...
jasmine's user avatar
  • 263
0 votes
2 answers
1k views

I want to preface my question by saying that I am very new to Python and have only started using it for a specific class in grad school. I have written a script to find the root of a function using ...
Shahreem Ahsan's user avatar
12 votes
1 answer
330 views

I recently discovered how to simulate higher order types in Java in a somewhat roundabout way like so interface H<F, T> { } Here H encodes a higher order type that takes a type parameter F ...
michid's user avatar
  • 10.9k
2 votes
2 answers
7k views

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 ...
Alexandru Dinu's user avatar
2 votes
2 answers
272 views

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 ...
WhyMeasureTheory's user avatar
0 votes
1 answer
160 views

Here is the reference post I am drawing upon: Any Faster RMS Value Calculation in C? #define INITIAL 512 /* Initial value of the filter memory. */ #define SAMPLES 512 uint16_t rms_filter(uint16_t ...
apprenticeprogrammer's user avatar
4 votes
2 answers
232 views

The program below results in <<loop>> in GHC. ...Obviously. In hindsight. It happens because walk is computing a fixed point, but there are multiple possible fixed points. When the list ...
Jason Orendorff's user avatar
3 votes
1 answer
877 views

I am trying to find out how many iterations it takes when I run a secant iteration up to a certain tolerance in maple. However, I am receiving an error code, so if someone could point out where the ...
T.Omalley's user avatar
  • 345
0 votes
1 answer
323 views

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 ...
user3799934's user avatar
2 votes
0 answers
136 views

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; ...
Ohsik7322's user avatar
4 votes
1 answer
11k views

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 - ...
nick_nick_nick's user avatar
1 vote
0 answers
345 views

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; % ...
Alvaro sepulveda's user avatar
1 vote
1 answer
604 views

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 ...
Stasky's user avatar
  • 117
2 votes
2 answers
136 views

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 ...
radrow's user avatar
  • 7,413
1 vote
2 answers
120 views

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)) ...
Wizard's user avatar
  • 22.7k
1 vote
3 answers
128 views

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)...
Wizard's user avatar
  • 22.7k
7 votes
2 answers
1k views

I need to find the fixed point of a multivariable function in Julia. Consider the following minimal example: function example(p::Array{Float64,1}) q = -p return q end Ideally I'd use a ...
Levi Crews's user avatar
0 votes
0 answers
245 views

I am not sure if I have come across a trick question or not, but I am coding a fixed point recursion to find root for a given equation. To me, it seems like I have the answer right off the bat, but I ...
PattyWatty27's user avatar
-4 votes
3 answers
12k views

f(x) = x^2- 2x - 3 = 0 How can I solve this equation non-linear, and used fixed point iteration method in Python ?
OverLord's user avatar
0 votes
1 answer
285 views

I've just started digging into Z3's fixed point solver and I've cooked up an example that hangs when using multiplication but completes when defining multiplication as a series of additions. As I'm ...
Mike's user avatar
  • 826
1 vote
0 answers
221 views

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++) { ...
Isaac's user avatar
  • 396
5 votes
1 answer
444 views

I have a function with the following signature: simCon :: [Constraint] -> Maybe [Constraint] I would like to write a method which, incase simCon returns Just [Constraint], I want to feed them ...
Lana's user avatar
  • 1,334
2 votes
1 answer
366 views

I have an OCaml function for finding fixed points: >> let rec fix f x = let x' = f x in if x = x' then x else fix f x';; (system message) val fix : ('a -> 'a) -> 'a -> 'a = ...
JSong's user avatar
  • 370
1 vote
1 answer
960 views

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 ...
Schytheron's user avatar
0 votes
0 answers
397 views

I'm trying to figure out how to create a function for fixed point iteration. But I have been stuck on this for a good hour now and I am finally caving in. So what am I doing wrong? I would suspect ...
Aliasa Zarowny Pseudonymia's user avatar
2 votes
2 answers
1k views

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 ...
n3vdawg's user avatar
  • 29
1 vote
0 answers
581 views

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]]&...
user9727931's user avatar
6 votes
0 answers
345 views

Intro Fixed points are such arguments to a function that it would return unchanged: f x == x. An example would be (\x -> x^2) 1 == 1 -- here the fixed point is 1. Attractive fixed points are ...
Ignat Insarov's user avatar
3 votes
2 answers
766 views

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 ...
Sebastian Oberhoff's user avatar
5 votes
3 answers
1k views

I recently noticed that I quite often write functions which just iterates another function f until it reaches a fixed point (such that f x == x) I thought this is a pretty general concept, so I think ...
flawr's user avatar
  • 11.7k
11 votes
3 answers
1k views

Here is a function, which expressed in C is: uint32_t f(uint32_t x) { return (x * 0x156) ^ 0xfca802c7; } Then I came across a challenge: How to find all its fixed points? I know we can test ...
Max Gresham's user avatar
0 votes
0 answers
293 views

I've trouble creating a code for finding roots of a function as an input by the fixed point method, Here I've done it using Newton-Raphson method: clc,close all syms x; fprintf('Newton Raphson\n'); ...
MarcoV's user avatar
  • 1
2 votes
1 answer
872 views

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....
Muhammad Hewedy's user avatar
0 votes
1 answer
564 views

I am looking for a fixed point x when f(x)=x of a function, ofcourse numerically, but I have no idea how to solve it with R, I am trying with fsolve with following code, but possibly its not the right ...
Shaikh Tanvir Hossain's user avatar
2 votes
1 answer
78 views

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 ...
marky2k's user avatar
  • 97
1 vote
1 answer
2k views

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(...
Zahi Azmi's user avatar
  • 111
-3 votes
1 answer
3k views

I want to add an While-loop to my matlab-code so that it will stop when the iteration is good enough. With some kind of tolerance, eg. 1e-6. This is my code now. So i need to add some kind of ...
jossis's user avatar
  • 1
4 votes
4 answers
1k views

I'm rewatching some of the earlier lectures on SICP. The notion of a fixed-point is a bit confusing to me. The fixed-point procedure: should I be thinking about it this way, "it's the way to find a ...
runners3431's user avatar
  • 1,455
4 votes
2 answers
3k views

Is there a shortcut for the following code snippet? while (true) { val newClusters = this.iterate(instances, clusters) if (newClusters == clusters) { return clusters } clusters = ...
user3267915's user avatar
1 vote
4 answers
4k views

I am trying to find the fixed point of a logistic distribution function and determine how the fixed point changes for different parameter values. The code looks like: nfxp.reps <- 0 err <- 10 p ...
user1682980's user avatar
1 vote
1 answer
2k views

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,...
pauliwago's user avatar
  • 6,735
14 votes
5 answers
5k views

The fixed point combinator doesn't always produce the right answer given the definition: fix f = f (fix f) The following code does not terminate: fix (\x->x*x) 0 Of course, fix can't always ...
Chao Xu's user avatar
  • 2,206
6 votes
1 answer
234 views

I'm looking for a library that will compute the fixed point / closure of a set under a number of operators of variable arity. For example, fixwith [(+)] [1] for the integers should compute all of N (...
gatoatigrado's user avatar
  • 16.9k
6 votes
4 answers
5k views

I need to find fixed points and attractors of a Tent map function given by the definition below: xt = (3/2) * xt-1 when 0 <= x <= (2/3) and xt = 3* (1-xt-1) when (2/3) ...
Boliver's user avatar
  • 63
0 votes
3 answers
2k views

I need to find fixed points of iterative map x[n] == 1/2 x[n-1]^2 - Mu. My approach: Subscript[g, n_ ][Mu_, x_] := Nest[0.5 * x^2 - Mu, x, n] fixedPoints[n_] := Solve[Subscript[g, n][Mu, x] == x, ...
Sunday's user avatar
  • 87
0 votes
2 answers
4k views

I am asked to write a program to solve this equation ( x^3 + x -1 = 0 ) using fixed point iteration. What is the algorithm for fixed point iteration? Is there any fixed point iteration code sample ...
bbnn's user avatar
  • 3,620
9 votes
2 answers
11k views

How can I solve this equation x3 + x - 1 = 0 using fixed point iteration? Is there any fixed-point iteration code (especially in Python) I can find online?
bbnn's user avatar
  • 3,620