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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.