RStabilityConditions[eqn,a[n],n]
gives the fixed points and stability conditions for a recurrence equation.
RStabilityConditions[{eqn1,eqn2,…},{a1[n],a2[n],…},n]
gives the fixed points and stability conditions for a system of recurrence equations.
RStabilityConditions[{eqn1,eqn2,…},{a1[n],a2[n],…},n,{pnt1,pnt2,…}]
gives stability conditions only for the given fixed points.
RStabilityConditions
RStabilityConditions[eqn,a[n],n]
gives the fixed points and stability conditions for a recurrence equation.
RStabilityConditions[{eqn1,eqn2,…},{a1[n],a2[n],…},n]
gives the fixed points and stability conditions for a system of recurrence equations.
RStabilityConditions[{eqn1,eqn2,…},{a1[n],a2[n],…},n,{pnt1,pnt2,…}]
gives stability conditions only for the given fixed points.
Details and Options
- Stability is also known as asymptotic stability and fixed points are also known as equilibrium points or stationary points.
- RStabilityConditions is typically used to qualitatively analyze long-term behavior near fixed points. If the system is stable, then solutions converge to the fixed point if you are close enough.
- For a system of recurrence equations
, a point
is a fixed point iff
. In effect, the initial value
remains stationary; if you initialize at
you stay at
. - A fixed point
is asymptotically stable iff for
and
you have
for
sufficiently small. - RStabilityConditions returns a list of the form {{{
,
,…},cond},…}, where {
,
,…} is a fixed point. - RStabilityConditions gives sufficient conditions for local stability of fixed points. For linear systems, these conditions are also conditions for global stability.
- RStabilityConditions works for linear and nonlinear ordinary difference equations.
- The following options can be given:
-
Assumptions $Assumptions assumptions on parameters
Examples
open all close allBasic Examples (5)
Find the fixed point and determine its stability for the recursion
:
RStabilityConditions[a[n + 1] == (1/2)a[n], a[n], n]Find the fixed point and determine the stability for the recursion
:
RStabilityConditions[a[n + 1] == 2a[n] + 1, a[n], n]Find the fixed points and conditions for stability for the recursion
:
RStabilityConditions[y[n + 1] == a y[n], y, n]Plot several solutions for different values of a:
sol = RSolveValue[{y[n + 1] == a y[n], y[0] == 1}, y[n], n]Table[DiscretePlot[sol, {n, 0, 20}, ...], {a, {-1.1, 0.8, 1.1}}]Stability analysis of a two-dimensional system:
RStabilityConditions[{x[1 + n] == b x[n] + y[n], y[1 + n] == -2 x[n] + a y[n]}, {x, y}, n]Plot the parameter region for which the system is stable:
RegionPlot[%[[1, 2]], {a, -3, 3}, {b, -3, 3}]Find the fixed points for a nonlinear system of three ODEs:
sys = {x[n + 1] == (x[n] + 3 y[n]/4 + x[n] + y[n] + z[n]), y[n + 1] == (y[n] + 2 z[n]/4 + x[n] + y[n] + z[n]), z[n + 1] == (z[n]/4 + x[n] + y[n] + z[n])};points = RFixedPoints[sys, {x[n], y[n], z[n]}, n]Study the stability of the first point:
RStabilityConditions[sys, {x[n], y[n], z[n]}, n, {{-3, 0, 0}}]Study the stability of the second point:
RStabilityConditions[sys, {x[n], y[n], z[n]}, n, {{0, 0, 0}}]Scope (15)
Linear Equations (4)
Find the fixed point and determine its stability for the recursion
:
RStabilityConditions[a[n + 1] == 1 / 3 a[n], a[n], n]A first-order linear inhomogeneous equation:
RStabilityConditions[y[n + 1] == a y[n] + 5, y, n]sol = RSolveValue[{y[n + 1] == a y[n] + 5, y[0] == 1}, y[n], n];
DiscretePlot[sol /. a -> 0.5, {n, 0, 20}]sol = RSolveValue[{y[n + 1] == a y[n] + 5, y[0] == 1}, y[n], n];
DiscretePlot[sol /. a -> 1.5, {n, 0, 20}]RStabilityConditions[y[n + 2] + a y[n + 1] + b y[n] == 0, y, n]RegionPlot[%[[1, 2]], {a, -2, 2}, {b, -2, 2}, FrameLabel -> {a, b}]RStabilityConditions[y[n + 3] + a y[n + 2] + b y[n + 1] + c y[n] == 0, y, n]RegionPlot3D[%[[1, 2]], {b, -2, 2}, {c, -2, 2}, {a, -2, 2}, ...]Nonlinear Equations (4)
Stability analysis of a nonlinear recurrence equation:
RStabilityConditions[x[n + 1] == x[n]^2 + 3x[n], x, n]Use a cobweb plot to demonstrate the stability:
ResourceFunction["CobwebPlot"][x |-> x^2 + 3x, -2.9, 10, {-3, 1}, Rule[...]]The stability of a logistic equation:
RStabilityConditions[a[n + 1] == 2(1 - a[n])a[n], a[n], n]sol = Quiet[RSolveValue[{a[n + 1] == 2(1 - a[n])a[n], a[0] == 1 / 10}, a[n], n]]DiscretePlot[%, {n, 0, 20}]Use a cobweb plot to demonstrate the stability:
ResourceFunction["CobwebPlot"][a |-> 2(1 - a)a, 0.1, 10, {-0.2, 0.8}]The stability of a Riccati equation:
RStabilityConditions[a[n + 1] == -(a[n] + 15) / (a[n] + 7), a[n], n]Use a cobweb plot to demonstrate the stability:
ResourceFunction["CobwebPlot"][a |-> -(a + 15) / (a + 7), -4.5, 10, {-5.3, 0}]RStabilityConditions[ a[n + 2] == a[n + 1] a[n] ^ 2, a[n], n]RStabilityConditions[ a[n + 2] == b ^ n a[n + 1] a[n] ^ 2, a[n], n]Linear Systems (5)
The stability of a linear system of uncoupled equations:
RStabilityConditions[{x[n + 1] == 1 / 2x[n], y[n + 1] == 1 / 3y[n]}, {x, y}, n]The stability of a linear system with constant coefficients:
RStabilityConditions[{y[n + 1] == 3 - z[n], z[n + 1] == (1 - y[n]/2)}, {y[n], z[n]}, n]Use VectorPlot to visualize the stability:
VectorPlot[{3 - z - y, (1 - y/2) - z}, {y, 3, 7}, {z, -5, 2}, Rule[...]]Solve the system with boundary conditions:
sol = RSolve[{y[n + 1] + z[n] == 3, y[n] + 2 z[n + 1] == 1, y[0] == 4, z[0] == 1}, {y, z}, n]DiscretePlot[Evaluate[{y[n], z[n]} /. sol[[1]]], {n, 0, 20}]A first-order system with periodic coefficients:
RStabilityConditions[{x[n + 1] == (1 / 2) * (2 + (-1) ^ n)y[n], y[n + 1] == (1 / 2)(2 - (-1) ^ n) * x[n]}, {x, y}, n]Compare with the general solution:
sol = RSolve[{x[n + 1] == (1 / 2) * (2 + (-1) ^ n)y[n], y[n + 1] == (1 / 2)(2 - (-1) ^ n) * x[n]}, {x, y}, n]DiscretePlot[Evaluate[{x[n], y[n]} /. sol[[1]] /. {C[1] -> 1, C[2] -> 2}], {n, 0, 20}]A first-order system with eventually periodic coefficients:
RStabilityConditions[{x[n + 1] == Mod[2 ^ n, 6]y[n], y[n + 1] == (1 / 2) * (2 - (-1) ^ n) * x[n]}, {x, y}, n]Analyze the stability of a 10x10 discrete linear system with random constant coefficients:
SeedRandom[1234];
m = RandomInteger[10, {10, 10}];
g = RandomInteger[10, 10];dep = {x1[n], x2[n], x3[n], x4[n], x5[n], x6[n], x7[n], x8[n], x9[n], x10[n]};sys = Thread[(dep /. n -> n + 1) == m.dep + g];RStabilityConditions[sys, dep, n]Nonlinear Systems (2)
A nonlinear first-order system:
RStabilityConditions[{x1[n + 1] == x1[n] - x2[n](1 - x2[n]), x2[n + 1] == x1[n] / 13, x3[n + 1] == x3[n] / 2 + x1[n]},
{x1, x2, x3}, n]Check only the stability of the first fixed point:
RStabilityConditions[{x1[n + 1] == x1[n] - x2[n](1 - x2[n]), x2[n + 1] == x1[n] / 13, x3[n + 1] == x3[n] / 2 + x1[n]},
{x1, x2, x3}, n, {{0, 0, 0}}]Check only the stability of the second fixed point:
RStabilityConditions[{x1[n + 1] == x1[n] - x2[n](1 - x2[n]), x2[n + 1] == x1[n] / 13, x3[n + 1] == x3[n] / 2 + x1[n]},
{x1, x2, x3}, n, {{13, 1, 26}}]The stability of a linear fractional system:
RStabilityConditions[{y[n + 1] == (3y[n]/1 + y[n] + z[n]), z[n + 1] == (z[n]/1 + y[n] + z[n])}, {y[n], z[n]}, n]Use VectorPlot to visualize the stability at point
:
VectorPlot[{(3y/1 + y + z) - y, (z/1 + y + z) - z}, {y, -2, 4}, {z, -2, 2}, Rule[...]]Options (1)
Assumptions (1)
Without Assumptions, there are conditions on parameters for stability:
RStabilityConditions[y[n + 1] == a y[n], y, n]Using Assumptions can often result in simplified conditions:
RStabilityConditions[y[n + 1] == a y[n], y, n, Assumptions -> 0 < a < 1 / 2]Applications (8)
Numerical Analyses (3)
Analyze the stability of the Newton–Raphson difference equation for the function x2-a:
f[x_] := x^2 - aThe recurrence equation for the method is:
eqn = x[n + 1] == x[n] - (f[x[n]]/D[f[x[n]], x[n]])Study the stability of the system:
RStabilityConditions[eqn, x, n]Visualize the stability of fixed points for
:
pl1 = ResourceFunction["CobwebPlot"][x |-> x - (-4 + x^2/2 x), 1, 10, {0, 3}];
pl2 = ResourceFunction["CobwebPlot"][x |-> x - (-4 + x^2/2 x), -1, 10, {-3, 0}];
Show[pl1, pl2, PlotRange -> All]Analyze the stability of the Newton–Raphson difference equation for the function x1/3:
f[x_] := x^1 / 3The recurrence equation for the method is:
eqn = x[n + 1] == x[n] - (f[x[n]]/D[f[x[n]], x[n]])The equation has one unstable fixed point at origin:
RStabilityConditions[eqn, x, n]The instability of the point means that Newton's method cannot be used in this case:
x1[n_] = RSolveValue[{eqn, x[0] == 1}, x[n], n]TableForm[Quiet[Table[{x1[n], N[Abs[f[x1[n]]]]}, {n, 0, 10}]], TableHeadings -> {None, {"x[n]", "f[x[n]]"}}]Consider a system of linear equations
, where:
A = {{16, 3}, {7, -11}};
b = {11, 13};Construct the Gauss–Seidel difference equation for the system:
L = LowerTriangularize[A];U = UpperTriangularize[A, 1];reqn = Thread[{x1[n + 1], x2[n + 1]} == Inverse[L].(b - U.{x1[n], x2[n]})]Analyze the stability of the Gauss–Seidel equation:
RStabilityConditions[reqn, {x1, x2}, n]Solve the system using LinearSolve:
LinearSolve[A, b]Physics (1)
Consider an object with temperature
in the environment with constant temperature
. Let
be the change in temperature of the object over a time interval
. Newton's law of cooling states that the rate of change of the temperature of an object is proportional to the difference of the temperature of the object and its surroundings:
eqn = t[n + 1] == t[n] + k(r - t[n]);RStabilityConditions[eqn, t, n]sol = RSolveValue[{eqn, t[0] == t0}, t[n], n]DiscretePlot[Evaluate[sol /. {r -> 20, t0 -> 40, k -> 1 / 2}], {n, 0, 10}]DiscretePlot[Evaluate[sol /. {r -> 20, t0 -> 10, k -> 1 / 2}], {n, 0, 10}]Ecology and Biology (2)
Stability analysis for the competing species model:
RStabilityConditions[{a[n + 1] == 1.047a[n] - 0.012a[n]b[n], b[n + 1] == 1.023b[n] - 0.015a[n]b[n]}, {a, b}, n]Solve the equation for given initial conditions and plot the solution:
sol = RecurrenceTable[{a[n + 1] == 1.047a[n] - 0.012a[n]b[n], b[n + 1] == 1.023b[n] - 0.015a[n]b[n], a[0] == 25, b[0] == 30}, {a[n], b[n]}, {n, 0, 50}];ListPlot[{#[[1]]& /@ sol, #[[2]]& /@ sol}, PlotLegends -> {a[n], b[n]}]Stability analysis for the predator-prey model:
RStabilityConditions[{a[n + 1] == 0.99a[n] + 0.0001a[n]b[n], b[n + 1] == 1.1b[n] - 0.0005a[n]b[n]}, {a, b}, n]Vector field plot of the model:
VectorPlot[{0.99a + 0.0001a b - a, 1.1b - 0.0005a b - b}, {a, 0, 300}, {b, 0, 300}]Solve the system and plot solutions:
sol = RecurrenceTable[{a[n + 1] == 0.99a[n] + 0.0001a[n]b[n], b[n + 1] == 1.1b[n] - 0.0005a[n]b[n], a[0] == 25, b[0] == 100}, {a[n], b[n]}, {n, 0, 1000}];ListPlot[{#[[1]]& /@ sol, #[[2]]& /@ sol}, PlotLegends -> {"Predator", "Prey"}, PlotRange -> All]Economics (2)
Consider a bank account with initial deposit
, annual rate
and monthly withdrawal amount
. The amount in the saving account after
months satisfies a recurrence equation:
eqn = a[n + 1] == (1 + (r/1200))a[n] - v;The equation has an unstable fixed point
:
RStabilityConditions[a[n + 1] == (1 + (r/1200))a[n] - v, a, n, Assumptions -> 0 <= r < 100]The amount in the account will increase each month if
:
sol1 = RSolveValue[{a[n + 1] == (1 + (r/1200))a[n] - v, a[0] == (1201 v/r)}, a[n], n];sol2 = RSolveValue[{a[n + 1] == (1 + (r/1200))a[n] - v, a[0] == (1199 v/r)}, a[n], n];DiscretePlot[Evaluate[{sol1, sol2} /. {v -> 1000, r -> 6}], {n, 0, 50}]Stability analysis for the logistic equation:
RFixedPoints[y[n + 1] == r y[n](1 - y[n]), y, n]Check the stability of the fixed points:
RStabilityConditions[y[n + 1] == r y[n](1 - y[n]), y, n]Check the stability for given range of the parameter
:
RStabilityConditions[y[n + 1] == r y[n](1 - y[n]), y, n, Assumptions -> 1 < r < 3]ResourceFunction["CobwebPlot"][y |-> r y(1 - y) /. r -> 1 / 2, 0.8, 10, {-1, 1}]ResourceFunction["CobwebPlot"][y |-> r y(1 - y) /. r -> 2, 0.8, 10, {-1, 1}, PlotRange -> {-1, 1}]Properties & Relations (9)
RStabilityConditions returns fixed points and stability conditions for recurrence equations:
RStabilityConditions[y[n + 1] == a y[n], y, n]RStabilityConditions[a[n + 1] == (1/2)a[n], a[n], n]RStabilityConditions[y[n + 1] == 2 y[n], y, n]Use RFixedPoints to find all fixed points of a recurrence equation:
RFixedPoints[y[n + 1] == 2 y[n](1 - y[n]), y[n], n]Analyze the stability at specific fixed points:
RStabilityConditions[y[n + 1] == 2 y[n](1 - y[n]), y[n], n, {{0}}]RStabilityConditions[y[n + 1] == 2 y[n](1 - y[n]), y[n], n, {{1 / 2}}]Use RFixedPoints to find all fixed points of a nonlinear recurrence equation:
points = RFixedPoints[x[n + 1] == x[n]^2 + 3x[n], x, n]Use Solve to find the fixed points:
Solve[x^2 + 3x == x, x]Linearize the equation near the first fixed point:
f1 = D[x^2 + 3x, x] /. x -> points[[1, 1]];
leqn1 = x[n + 1] == f1 x[n]Check the stability near the first fixed point:
RStabilityConditions[leqn1, x, n][[1, 2]]Linearize the equation near the second fixed point:
f1 = D[x^2 + 3x, x] /. x -> points[[2, 1]];
leqn2 = x[n + 1] == f1 x[n]Check the stability near the second fixed point:
RStabilityConditions[leqn2, x, n][[1, 2]]Determine the stability of the nonlinear equation using RStabilityConditions:
RStabilityConditions[x[n + 1] == x[n]^2 + 3x[n], x, n]The fixed points for an n
-order recurrence equation are n-dimensional vectors:
RStabilityConditions[y[n + 2] + y[n + 1] + 3 y[n] == 5, y, n]The fixed points for a system of n first-order recurrence equations are n-dimensional vectors:
RStabilityConditions[{y[n + 1] + z[n] == 3, y[n] + 2 z[n + 1] == 1}, {y[n], z[n]}, n]f1[y1_, y2_] := 3y1 - y2;
f2[y1_, y2_] := (1 - y1 + y2/2);RStabilityConditions[{y1[n + 1] == f1[y1[n], y2[n]], y2[n + 1] == f2[y1[n], y2[n]]}, {y1[n], y2[n]}, n]Calculate the differences
and
to generate the vector field plot of the system:
VectorPlot[{f1[y1, y2] - y1, f2[y1, y2] - y2}, {y1, -2, 2}, {y2, -2, 2}, Rule[...]]Analyze the stability of a system of two ODEs:
RStabilityConditions[{a[n + 1] - b[n] == 2, a[n] - 3 b[n + 1] == 5}, {a, b}, n]Use RSolveValue to solve the system using a fixed point as initial condition:
sol = RSolveValue[{a[n + 1] - b[n] == 2, a[n] - 3 b[n + 1] == 5, a[0] == 1 / 2, b[0] == -3 / 2}, {a[n], b[n]}, n]Use RSolveValue to solve the system for given initial conditions:
sol = RSolveValue[{a[n + 1] - b[n] == 2, a[n] - 3 b[n + 1] == 5, a[0] == 3, b[0] == 1}, {a[n], b[n]}, n]DiscretePlot[Evaluate[sol], {n, 0, 20}]Analyze the stability of a nonlinear ODE:
RStabilityConditions[x[n + 1] == (1/2)x[n](1 - x[n]), x, n]Solve the ODE using RecurrenceTable:
sol = RecurrenceTable[{x[n + 1] == (1/2)x[n](1 - x[n]), x[0] == -9 / 10}, x, {n, 0, 20}, WorkingPrecision -> 10]ListPlot[sol, PlotRange -> All]Analyze the stability of a recurrence equation with eventually constant coefficients:
RStabilityConditions[y[n + 1] == ((1 / 2n ^ 3 + 1) / n ^ 3)y[n], y, n]Find a series solution using AsymptoticRSolveValue:
asol = AsymptoticRSolveValue[{y[n + 1] == ((1 / 2n ^ 3 + 1) / n ^ 3)y[n]}, y[n], {n, ∞, 10}]DiscretePlot[asol /. {C[1] -> -0.1}, {n, 2, 30}, PlotRange -> All]Possible Issues (2)
Sometimes the conditions for stability are not the simplest possible:
RStabilityConditions[y[n + 1] == r y[n](a - y[n]), y, n, Assumptions -> Re[a] == 0]Additional simplification can be achieved by further processing:
Reduce[%[[1, 2]] && Re[a] == 0]RStabilityConditions fails because the given point is not a fixed point:
RStabilityConditions[y[n + 1] == y[n](1 - y[n]), y, n, {{1}}]Use RFixedPoints to find all fixed points of the equation first:
points = RFixedPoints[y[n + 1] == 3 y[n](1 - y[n]), y[n], n]RStabilityConditions[y[n + 1] == 3 y[n](1 - y[n]), y, n, {points[[1]]}]RStabilityConditions[y[n + 1] == 3 y[n](1 - y[n]), y, n, {points[[2]]}]Related Guides
History
Text
Wolfram Research (2024), RStabilityConditions, Wolfram Language function, https://reference.wolfram.com/language/ref/RStabilityConditions.html.
CMS
Wolfram Language. 2024. "RStabilityConditions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RStabilityConditions.html.
APA
Wolfram Language. (2024). RStabilityConditions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RStabilityConditions.html
BibTeX
@misc{reference.wolfram_2026_rstabilityconditions, author="Wolfram Research", title="{RStabilityConditions}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/RStabilityConditions.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rstabilityconditions, organization={Wolfram Research}, title={RStabilityConditions}, year={2024}, url={https://reference.wolfram.com/language/ref/RStabilityConditions.html}, note=[Accessed: 12-June-2026]}