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, ...
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 ...
14
votes
2answers
991 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 ...
1
vote
1answer
385 views

Can I simplify (solve) a certain DifferenceRoot expression?

I've generated this expression ...
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 ...
4
votes
5answers
374 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 ...
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: ...
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 ...
2
votes
1answer
167 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 ...
1
vote
2answers
153 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 ...
0
votes
1answer
223 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 ...
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 $\...
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 ...
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: <...
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 ...
1
vote
0answers
399 views

How to derive finite-difference scheme automatically on a quite general stencil

Info This question is a generalization of the following one Derivation of numerical scheme for linear transport equation on a variable stencil. Statement of a problem Linear scalar hyperbolic (...
4
votes
2answers
168 views

RSolve not reducing for a certain recurrence relation

I'm trying to use RSolve as follows to solve a recurrence relation: ...
3
votes
2answers
525 views

How to simplify output of Series?

The command Series[Sum[Sum[1/(a*b), {b, a, 3 a}], {a, 1, N/Sqrt[3]}, Assumptions -> N > 0], {N, Infinity, 1}] produces a somewhat complicated answer <...
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 ...
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
1answer
398 views

How to find a recurrence relation for a sequence?

I have a sequence given by an explicit formula for n-th term: ...
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
1answer
236 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: \begin{equation} x_{n+1}=μ-x_n^4=f(x_n), \quad μ \in \mathbb{R} \end{equation} I have so far managed to ...
3
votes
1answer
263 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 ...
3
votes
1answer
313 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 ...
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
1k 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 ...
2
votes
2answers
367 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: ...
2
votes
1answer
72 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(...
2
votes
3answers
175 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 ...
2
votes
2answers
391 views

How can I express this recurrence function in Mathematica?

\begin{equation} r_{i+1}=r_{i}+V_{i}{\Delta}t \end{equation} Where \begin{equation} V_{i}=(0.01, 0.40) \end{equation} and ${\Delta}t$ is the difference in time. My implementation (this is for ${\...
1
vote
1answer
122 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 ...
1
vote
0answers
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 ...
1
vote
2answers
386 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 ...
1
vote
2answers
388 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 ...