# Nonlinear iterative equation which evolves after every kick in Mathematica?

I am new to Mathematica. I am struggling but I can't code properly. Please help me plot the Wigner function between x and p. In the following equation $$n$$ is the number of iterations, and $$b=5$$, $$k=2$$, and $$\alpha=2\pi/3$$:

$$W[x_{n+1},p_{n+1}]=Exp[-[(p_{n}+KSinx_{n})Cos\alpha-Sin(\alpha)x_{n}]^{2}-[x_{n}Cos\alpha+Sin\alpha(p_{n}+KSinx_{n}-b)]^{2}]$$

Here is code which I use to plot it:

  Animate[ListPlot[x = Table[0, {i, 1, m}];
p = Table[0, {i, 1, m}];
\[Alpha] = 2 \[Pi]/q;
q = 3;
k = 2;
b = 5;
x[[1]] = 1.9;
p[[1]] = 2;
Do[
W[x[[n + 1]], p[[n + 1]]] =
2*Exp[4 \[Pi]^2*(Cos[\[Alpha]]*(p[[n]] + k*Sin[x[[n]]]) -
x[[n]]* Sin[\[Alpha]])^2 - (
x[[n]]*Cos[\[Alpha]] +
Sin[\[Alpha]]*(p[[n]] + k * Sin[x[[n]]]))^2 - b], {n, 1,
Length[x] - 1}];

Transpose[{x, p}], Joined -> True, AspectRatio -> 1], {m, 1, 1000,
1}, AnimationRate -> 100, AnimationRunning -> False]

• Please post your equation as Mathematica code, (and indent with four spaces) rather than LaTeX. It makes it much easier for people to copy and paste, and also helps to identify any mistakes in your coding. Commented Nov 16, 2017 at 6:59
• I do not see any equation here, but an expression. Further, explain please more clearly, what do you want to do with it? May be a simple example is available to let us understand your question? Commented Nov 16, 2017 at 8:35
• – Alexei Boulbitch ....Sir this is basicaly evolution of wigner function which evolves after every kick
– Ali
Commented Nov 16, 2017 at 9:11
• The reason you see no plot is that you never set values for x or p anywhere (except for the initial x[[1]] and p[[1]]). I would first define W as a function and then iterate using NestList or Table. Commented Nov 16, 2017 at 13:43

w[{x_, p_}] := {x Cos[p], p Exp[x]};