# Questions tagged [difference-equations]

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

46 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, ...
• 54.1k
9k 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 ...
• 157
2k 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 ...
• 723
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: <...
• 195
264 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 ...
• 369
1 vote
751 views

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

I've generated this expression ...
• 2,245
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 ...
• 283
944 views

### Show Factorial instead of Gamma in the result of RSolve

Now I wanted to solve for a recurring function with RSolve. Here's how I tried: ...
• 175
445 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 ...
• 54.1k
48 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 ...
• 18k
205 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: ...
• 623
3k 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 ...
• 141
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 ...
• 33
459 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: ...
• 808
1 vote
341 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 ...
259 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 ...
• 101
484 views

• 251
194 views

### periodic point of a quadratic map

I am analyzing a discrete dynamic quadratic map. The bifurcation diagram shows the existence of an asymptotic 3- cycle periodic point for a given parameter. But the graphic of the lyapunov exponent ...
557 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. ...
• 247
613 views

### How to find a recurrence relation for a sequence?

I have a sequence given by an explicit formula for n-th term: ...
• 6,938
435 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. ...
• 8,638
323 views

### How to approximate the solution of a system of quartic equations

In an attempt to evaluate the point at which the cycle 2 becomes unstable for the given map: $$x_{n+1}=μ-x_n^4=f(x_n), \quad μ \in \mathbb{R}$$ I have so far managed to ...
• 707
339 views

### Find RSolve solution reflecting special structure of DifferenceRoot[Function[{\[FormalY], \[FormalN]}

RSolve yields a large (multi-page) solution (LeafCount=25891) containing a number of 7F6 (and higher) hypergeometric functions when applied to ...
• 2,245
115 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) ...
• 2,245
374 views

### Finite Difference - heat generation in a square (square within a square)

I am trying to develop a code that will allow me to solve the following problem. Lets say that I have a square block, inside that square block I have a smaller square box thats at a certain ...
• 45
612 views

### Problem plotting a bifurcation diagram of logistic map

I would like to plot a bifurcation diagram from the logistic map (difference equation) of the type $$x_{t+1} = r\,(1-x_{t})\,x_{t}.$$ The code I used for that was ...
• 1,120
437 views

1 vote
448 views

### Solving matrix equation

How can I solve the forward equation S[t]=C+A*S[t+1]*(Inverse((I-B*S(t+1)))*A for t=1 to t=10 and ...
1 vote
82 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 ...
• 1,504
1 vote
47 views

### RSolve not evaluating when given my system of recurrence equations

I am trying to solve the following system of recurrences with RSolve: ...
1 vote
47 views

### General question about RSolveValue and general programming

If I have the following code: ...
• 421
1 vote