# Questions tagged [difference-equations]

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

44 questions
Filter by
Sorted by
Tagged with
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, ...
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 ...
1k 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 ...
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: <...
242 views

### Using NIntegrate in Finite Difference Derivative method

I'm trying to solve a second order differential equation using the code given by @xzczd here which is based on this. What this ...
654 views

### Can I simplify (solve) a certain DifferenceRoot expression?

I've generated this expression ...
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 ...
433 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 ...
44 views

### RecurrenceTable doesn't evaluate with constant right-hand side

One of my functions automatically generates systems for RecurrenceTable. Usually works fine, but today I encountered a problem. If the right-hand side is a ...
201 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: ...
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 ...
2k views

### RecurrenceTable with a recurrence function of two variables

I have to calculate the cool down process of a regenerative heat exchanger. I solved the problem in Excel before, but now I want to do it with Mathematica. I want to create a table with the variables ...
432 views

### Why does Mathematica not evaluate the difference recurrence using RSolve or RecurrenceTable?

Mathematica does not evaluate the following recurrence of two variables using RSolve and only echoes the input: ...
295 views

### Bifurcation diagram of a difference equation

The function is f[x_, a_] := Piecewise[{{x (1 + a - a*x), x <= 1/2}, {x (1 - a + a*x), x > 1/2}}] How to make the bifurcation graphic of it? What ...
251 views

### Explicit, closed formula for recursive integral as a function of the recursive parameter

This is a follow-up of this question/answer. I'm working on a recursive integral more complicated than the one on the linked question, but this one can be used as an example. I would like to obtain ...
461 views

86 views

### Finding a function/differential equation from a 2nd order recurrence relation

Consider the following 2nd order recurrence relation: $$A_{1}=1,\; A_{2}=z$$ $$A_{n+2}(z)=(b_n+z)A_{n+1}(z)+a_nA_{n}(z),\; n=1,2,3,...$$ where, b_n=n\left(n+m+\frac{1}{2}\right),\; a_n=k^2n\left(...
185 views

### Computing a sequence by recurrence

I am trying to create a list where each element of the list is calculated using the sum of all previous elements of the list and also uses the $N$th element of another list. The initial value of the ...
81 views

### Zeros of a rational fraction sequence

This is a follow-up of the question Finding a function/differential equation from a 2nd order recurrence relation, I asked yesterday. The reason why I didn't edit the original question was that in ...
133 views

### Computing a Sequence using Recurrence

I posted a similar question earlier today, but unfortunately I realized after several hours that I over-simplified the problem for this forum. There is a very good answer to the Computing a sequence ...
43 views

### General question about RSolveValue and general programming

If I have the following code: ...
284 views

### Chebyshev polynomials

How could I write the Chebyshev polynomial as a function that uses Nest? Also, how could I write it using recursion? Furthermore, how can I show that \$T_n(x)=\...
440 views

### Random variates in Recurrence Function

I'm completely new to Mathematica and can't seem to find an answer elsewhere so hopefully I can get some help here. I'm trying to plot a recurrence relation, where a random variate is generated at ...