Questions tagged [difference-equations]

Tag for the usage of RSolve, RecurrenceTable, DifferenceRoot, and other functions related to difference equations.

Filter by
Sorted by
Tagged with
30
votes
1answer
2k views

Has this implementation of FDM touched the speed limit of Mathematica?

Still, I'll use the implementation of the 1D FDTD method (you can simply understand it as a kind of explicit finite difference scheme for the Maxwell's equation) as the example. Just for completeness, ...
16
votes
1answer
328 views

Mathematica 9 cannot solve a difference equation that Mathematica 8 can

Bug introduced in 9.0.1 and fixed in 10.0.0 Consider RSolve[{a[n + 1] == 2 a[n] + n (1 + 2^n), a[1] == 1}, a[n], n] Mathematica 8 can solve this quickly, but ...
14
votes
2answers
985 views

Finite difference method not converging to correct steady state or conserving area?

I am working with the following PDE, which is an advection-diffusion type equation. It describes the movement of a fluid-fluid interface inside an annulus of inner radius $R_1$ and outer $R_2$ under ...
12
votes
3answers
401 views

Archimedes' Scheme to find $\pi$

Given an Archimedes' scheme $$a_{n+1}=\frac{2a_nb_n}{a_n+b_n}$$ $$b_{n+1}=\sqrt{a_{n+1}b_n}$$ with initial values $a_0=2\sqrt{3},b_0=3.$ How do I prove using Mathematica that this converges to $\...
12
votes
2answers
323 views

RecurrenceTable iteration variable not localized? Bug or user error?

I recently lost a lot of time on this and need to understand whether I have misunderstood MMA operations or there's a problem. I am using MMA 10.1 on Windows 7 64-bit. The essence of the issue is ...
10
votes
2answers
292 views

Evolution of a trait in an asexual population (performance tuning)

I just coded a simple simulation module that looks at the evolution of a continuous trait in a haploid asexually reproducing population under density dependent competition in discrete time (i.e. non-...
10
votes
1answer
696 views

Is it possible to find a limit of a sequence given by its recurrence relation?

I need to calculate a limit of a sequence given by its recurrence relation. I tried the following: ...
9
votes
1answer
8k views

Bifurcation Diagram for 1D Map

Continuing with the same question I have posted earlier I would like to find the equation of the stable fixed point curve using my graph, i.e. from the curve somehow find the equation for $x=f(x)$. I ...
8
votes
3answers
213 views

Using Total inside the RecurrenceTable

I would like to perform an operation over IntegerDigits recurrently. The operation is the sum of cubes of the digits, for example: $12 \rightarrow (1^3 + 2^3) = 9$...
8
votes
4answers
185 views

Implementing delay in NestList?

The traditional iterated map can be implemented with NestList, such as the Logistic Map, x[n+1]=rxn, can be implemented with the single line: ...
8
votes
1answer
1k views

Poisson PDE over a irregular region with FDM

The problem modeled by the Poisson PDE is related to the torsion of prismatic beams and I use the Finite Differences Method (FDM). I've managed to solve the equation over a rectangle region with ...
7
votes
3answers
498 views

How do I recursively calculate this equation and generate a list of iteration?

How do I write a recursive equation to compute a list of answers? I tried NestList, but it didn't work. ...
7
votes
3answers
361 views

Solving coupled recursion equations for a target variable

I have a set of coupled recursion equations and want to express the final solution in terms of one of the variables: ...
7
votes
3answers
834 views

How can I solve a forward-backward-looking recurrence system?

I would like to (numerically) solve a forward-backward looking recurrence equation in Mathematica. The system is something like: ...
7
votes
1answer
197 views

Incorrect answer given by RSolve

Bug introduced in 9.0 or earlier and persisting through 11.0.1 or later Also posted in Wolfram Community. I tried to solve the following nonlinear recurrence relation using ...
7
votes
1answer
397 views

How to find a recurrence relation for a sequence?

I have a sequence given by an explicit formula for n-th term: ...
7
votes
1answer
331 views

Two dimensional recurrence

My actual problem is a bit more complicated, but let us first assume that we have a recurrence relation of the following type $a_{n,l} = a_{n-1,l} + a_{n-1,l-1} + a_{n,l-1}$ The boundary is given, ...
6
votes
6answers
461 views

Recursion question

The first two terms of a sequence are $a_1 = 1$ and $a_2 = \frac {1}{\sqrt3}$. For $n\ge1$, $$a_{n + 2} = \frac {a_n + a_{n + 1}}{1 - a_na_{n + 1}}.$$ What is $|a_{2009}|$? So I tried (thanks to ...
6
votes
2answers
171 views

Find a stable 3-cycle of the sine map

I am trying to find an stable 3-cycle for the sine map $g(x) = a \sin(\pi x)$ but I do not know exactly how to use mathematica to do so. Is there anyone familiar with this? $x$ lies as before ...
6
votes
2answers
192 views

RSolve gives a Context::ssle error

Bug introduced in 9.0 or earlier and fixed in 10.0 I want to solve the following recurrence equation RSolve[{(k + 2) c[k + 2] q^(k + 1) - c[k] == 0}, c[k], k] ...
6
votes
1answer
230 views

RSolve[{y[0] == y0, y[t + 1] == (1 - (t + 1)/100) y[t]}, y[t], t]

When I evaluate this code: RSolve[{y[0] == y0, y[t + 1] == (1 - (t + 1)/100) y[t]}, y[t], t] I get an RSolve::bvnul error. I don't understand why. Yet, if I ...
6
votes
3answers
468 views

RSolve with assumptions

Bug noticed for Mathematica 8 and persisting through 11.3; Submitted to Wolfram, Inc. as CASE:3729158 I want to solve the following non-linear first order difference equation: $$ k_{t+1} = (1-a) k_t^...
6
votes
1answer
111 views

Are there different Method options that can be used with FindSequenceFunction?

The help page states that Method is an option to use with FindSequenceFunction, but I don't find any further information. (There ...
6
votes
1answer
590 views

Calculating the Feigenbaum Constants

I would like to calculate the $δ$ and the $α$ Feigenbaum constants for the Logistic Map: \begin{equation} x_{n+1}=4μx_n(1-x_n)=f(x_n) \end{equation} as part of an undergraduate assigment of mine. I ...
6
votes
1answer
213 views

Solution to differential difference equation

I'm interested in finding the general solution $f(x)$ of the equation: $(1+x)f'(x)+(f(x/2)-f(x))=-1$, $x\ge0$. Can Mathematica help here? For instance, it is easy to verify that the (slightly ...
6
votes
0answers
250 views

How to solve this multivariate recurrence with Mathematica?

I would like to solve this recurrence relation: $a_{m,n}=a_{m-1,n}+a_{m,n-1}$ with $a_{0,0}=0, a_{m,0}=1, a_{0,n}=1$ for all $m\neq0$ and $n\neq0$ That's resembles the Tartaglia/Pascal's triangle, ...
5
votes
5answers
1k views

Limit n->Infinity of recursive sequence

I have defined a recursive sequence a[0] := 1 a[n_] := Sqrt[3] + 1/2 a[n - 1] because I want to calculate the Limit for this ...
5
votes
2answers
273 views

Periodic Orbits of the MacKay Map

For the MacKay (Henon action-angle transformation) Map (Mackay 1983): $x_{n+1}=q-\alpha x_n-x_n^2-y_n \\ y_{n+1}=x_n$ with $q, \alpha \in \mathbb{R}$ real parameters I would like to calculate the ...
5
votes
3answers
115 views

How to find a list of values of recurrence equation?

I tried with RSolve,but it fails: RSolve[{x[n + 1] == n + Sum[j*x[j], {j, 1, n}], x[1] == 1}, x[n], n] Returns unevaluated ...
5
votes
2answers
194 views

Solution to Simultaneous Arithmetic/Geometric Mean Recursion Relations

I'm trying to solve the simultaneous convergent sequences of geometric/arithmetic means where $a_{n+1}=\frac{1}{2}(a_n+b_n)$ and $b_{n+1}=\sqrt{a_nb_n}$ and initial values are $a_0=1+x$ and $b_0=1-x$. ...
5
votes
1answer
166 views

Random Variable in Recurrence Function

Following the previously published question, I'm looking for the solution of RecurrenceTable with explicit random variable. For example, something like ...
4
votes
4answers
546 views

Solving Recurrence Equation $a_{n+1}=a_n(1-a_n)$

How to solve following recurrence equation $$a_0=2$$ $$a_{n+1}=a_n(1-a_n)$$ I tried: ...
4
votes
3answers
409 views

Slow computation of recursive sequences

I want to investigate the asymptotic behavior of the following recursive system: ...
4
votes
1answer
903 views

RSolve Lotka-Volterra: A Closed Form Solution to this Difference Equation?

I would like to solve a difference equation, a Lotka-Volterra difference equation. I tried a model from http://www.stolaf.edu/people/mckelvey/envision.dir/nonDE.lotka-volt.html Using their ...
4
votes
2answers
165 views

RSolve not reducing for a certain recurrence relation

I'm trying to use RSolve as follows to solve a recurrence relation: ...
4
votes
1answer
414 views

Finding Hofstadter's Q-Sequence very slow

I'm trying to find Hofstadter's Q-Sequence. I tried: RSolve[{Q[n] == Q[n - Q[n - 1]] + Q[n - Q[n - 2]], Q[1] == 1, Q[2] == 1}, Q[n], n] but it doesn't work. ...
4
votes
5answers
373 views

Can I generate a “piecewise” list from a list in a fast and elegant way?

Suppose we have a number list a: n = 1000000; a = RandomReal[{0, 1}, {n}]; We want to generate a list ...
4
votes
1answer
705 views

Using RSolve to solve a recurrence relation

I am attempting to solve this recurrence relation. T[n] = n^(1.5) + T[n - 4] which I believe simplifies to n^(2.5) I ...
4
votes
1answer
436 views

Mathematica 10 issue: working with Entities slows down recurrence equations [duplicate]

I was looking at the Mathematica code given at http://community.wolfram.com/groups/-/m/t/326240 where example code is given to simulate the spreading of a supposed Ebola outbreak in Nigeria: ...
4
votes
1answer
2k views

Discrete-time Lyapunov exponent plot

I am trying to create a Lyapunov exponent plot as a function of $\alpha$ for two functions: $$ f(x) = (\alpha + 1)x - \alpha x^{3} $$ and a piecewise function given by following Mathematica code: <...
4
votes
1answer
192 views

How can I implement this recurrence equation in Mathematica?

I asked a similar question yesterday but today I realized that I was implementing the wrong function. I have tried changing the implementation but I can't get it to work. Problem: There is a river ...
4
votes
1answer
119 views

Problem with using RSolve to solve recurrence equations

Whenever I run the my code, the output of Mathematica is only a copy of the input again. ...
4
votes
3answers
2k views

Nonlinear recurrence relation

I entered the following recurrence relation into RSolve and it just gave the question back to me. $$a_{n+1} = \frac{(1+a_n +(a_{n−1})^3)} 3$$ Is there another way ...
4
votes
1answer
80 views

Weird RecurrenceTable bug

The output of RecurrenceTable seems to lose a level when there are more than 250 points and one variable. Easiest to explain with an example: Good: ...
3
votes
2answers
376 views

Solving a system of recurrence relations using Mathematica

Can Mathematica solve (for b[k] and c[r]) the following system of recurrence relations? b[k] ...
3
votes
3answers
284 views

Tangled up in sequences and recurrence relations

I took a trip through sequences and recurrence relations and I got tangled up since the documentation didn't help much. I'm sure you can. Given a sequence ...
3
votes
1answer
101 views

How to replace the symbol n in DifferenceRoot

I'd like to employ another symbol (say alpha or k) instead of n in the following (type of) ...
3
votes
2answers
99 views

Vector and matrix use in RecurrenceTable

Why is this code snippet that uses matrix and vector elements work? ...
3
votes
2answers
225 views

DifferenceRoot question

I was doing the following sum: $$\sum_{i=2}^k \frac{(-1)^i}{i-1} \binom{2k-i-1}{k-1}x^i$$ First, Mathematica simplifies it to some DifferenceRoot function: ...
3
votes
2answers
58 views

What is the fastest way to calculate series from recurrence solutions with no closed form?

I am not very experienced with Mathematica. I want to calculate the series from recurrence solutions. These solutions have no closed-form. I want to improve the approximation and hence need a good ...