# Fading plots based on a function

I have this plot but it does not do what I want it to do. I have made A MOCK-UP OUTPUT of what I want.

 ClearAll[x, xi, σ, n]
xi = 2; k0 = 5; σ = 2;
Show[
Table[
sol = NDSolve[{D[x[t], t] == (Sinh[(σ^2) x[t] (t - xi)])/((Cos[2 k0 x[t]]))), x[0] == n}, x[t], {t, 0, 4}];
ParametricPlot[{x[t], t} /. sol, {t, 0, 4},
PlotRange -> All,
BaseStyle -> Thick, AxesStyle -> Thickness[.001],
LabelStyle -> {Black, Medium}, ColorFunctionScaling -> False,
ColorFunction ->
Function[{x, y, t},
Directive[
Opacity[0.02 + (e^(-1/2 (x[t] - xi)^2 σ^2) sqrt (π/
2) σ (1 + e^(2 x[t] (-xi) σ^2) +
2 e^(x[t] (-xi) σ^2) cos (2 k0 x))) /. sol[[1]] //
First], Blue]]], {n, -3, 3 - 1/4, 1/4}]]


This is what it should output with each iteration, the curves are faded based upon the function - such that curves close to the center fade. Notice that the curve holds it opacity all through its progress.

• Betty,there ar esime syntax errors in your code. For instance e^ should probably be E^ (uppercase) or Exp[...]. Similarly sqrt should be Sqrt[...]. Does it get any better if you fix those problems? I also think that your code should probably read sol = Table[...], rather than Table[sol =...]. – MarcoB Jun 4 '18 at 3:24
• Marco not really - the output above is not something that comes from the code I'd written, it what I want to code to produce. – Betty Jun 4 '18 at 5:55
• Did you notice that your NDSolve expression does not actually work though? If you try to evaluate it, it returns NDSolve::ndsz: At t == 9.421270636234184*^-14, step size is effectively zero; singularity or stiff system suspected.. Until you solve this issue, you won't be able to obtain a plot no matter what. – MarcoB Jun 6 '18 at 15:37

functions = Table[n x^4 + n/2 x^2 + n/5, {n, -4, 4}];


• @Betty Did you notice that your NDSolve expression does not actually work though? If you try to evaluate it, it returns NDSolve::ndsz: At t == 9.421270636234184*^-14, step size is effectively zero; singularity or stiff system suspected.. Until you solve this issue, you won't be able to obtain a plot no matter what. – MarcoB Jun 6 '18 at 15:37