1
$\begingroup$

I have obtained a result h(x) from NDSolve data. I can plot it

data = Import["C:\\Users\\...\\Desktop\\data.dat"];
ListLinePlot@data

enter image description here

Now I want to get the 2-nd order derivative of h(x) with respect to x, i.e. hxx, and the reverse of h(x), i.e. h^-1, in order to proceeding other calculation, such as, to plot the function of h^-2-hxx. Anyone can give me some guides or advice on this issue? Thank you very much!

$\endgroup$
4
$\begingroup$

Let's pretend this is your data

dat = Table[{x, 2 Sin[x]^2 + Cos[2 x]^2}, {x, 0, 2 \[Pi], 2 \[Pi]/100}]

Ok, not your data, but similar enough

ListPlot@dat

Mathematica graphics

we create an Interpolation function

 f = Interpolation[dat]

and then just calculate derivatives and inverse

Plot[
 {
  f[x]
  , f''[x]
  , 1/f[x]
  }
 , {x, 0, 2 \[Pi]}
 ]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ Hi, @rhermans. Thanks for your helpful and rapid reply! $\endgroup$
    – Enter
    Oct 15 '14 at 9:41

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.