Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

NDsolve gives me a solution to a certain NL PDE. I want to evaluate the rate of exponential decay of the maxima of the solutions in time. So, I plot

Max1[t_?NumericQ] := First[Maximize[sol1[[1]][x, t], 0 <= x <= L, x]]
data1 = Table[{y, LMax1[y]}, {y, T0, Tfit}];
efit1 = FindFit[data1, Exp[a*t], {a}, t];
Plot[{Max1[y], Exp[efit1[1]*y]}, {y, T0, Tfit}, PlotRange -> All, Frame -> True] 

and it looks like this:

Now, since I would like to fit this exponentially, or take the logarithm to evaluate the slope, how can I smooth that little jump which creates me a lot of trouble?

Here is what I get if I take the Log:

LMax1[t_?NumericQ] := Log[Abs[First[Maximize[sol1[[1]][x, t], 0 <= x <= L, x]]] - 1]
data1 = Table[{y, LMax1[y]}, {y, T0, Tfit}];
fit1 = Fit[data1, {1, y}, y];
Plot[{LMax1[y], fit1}, {y, T0, Tfit}]

enter image description here

share|improve this question
You could try the HPFilter package, see this thread: (esp. the link to the updated package). – Yves Klett Nov 18 '13 at 12:18
... and please add all code to reproduce your problem, like e.g. sol1. – Yves Klett Nov 18 '13 at 12:20
Do you expect the little jump at all ? Can it be that you need to make the solution "smoother" ? – b.gatessucks Nov 18 '13 at 12:20
There was a topic about taking the function without sudden drops/peaks but I can't find it :/ – Kuba Nov 18 '13 at 12:23
@YvesKlett i = Import[""]; i1 = ImageTake[ColorReplace[i, Black], {20, 300}, {50, 500}]; l1 = PixelValuePositions[i1, Blue, .9]; ListPlot@l1 – Dr. belisarius Nov 18 '13 at 12:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.