Get C Code of InverseFunction and Eliptical Integral of First Kind?

Hello;

I have the below output for a nonlinear differential equation.
I want to c-code the answer (in PIC-C). But I dont understand what the answer is mathematically. Can you help?

Here is the code:

DSolve[{-x^2 + (0.231486 - 0.2290576*cos[y[x]]) Derivative[1][y][
      x]^2 == 0, y[0] == Q1, y'[0] == 0}, y[x], x]

Try

sol = NDSolve[{-x^2 + (0.231486 - 0.2290576*Cos[y[x]]) Derivative[1][y][x]^2 == 0, y'[0] == 0}, y, {x, 0, 2}]

Hello Shengui;

Thanks for this suggestion. In the output it gives me an interpolating function but i dont see what the function is?
What are the coefficients and degree etc?
Interpolating functions seem embedded inside mathematica so its not possible to see what the function is. Therefore i cannot code it in c environment.
Anyother suggestions?

Hello Shengui;

Thanks for this suggestion. In the output it gives me an interpolating function but i dont see what the function is?
What are the coefficients and degree etc?
Interpolating functions seem embedded inside mathematica so its not possible to see what the function is. Therefore i cannot code it in c environment.
Anyother suggestions?

You will be better off solving this ODE numerically in C. I believe InverseFunction will also use numerical methods to compute results.

Can you give me an example? Which numerical method would be the best alternative for coding in C?

Numerical ODE solving is a whole topic on its own. It is covered in many books. Take a look e.g. at Numerical Recipes, which has a very gentle introduction, if I recall correctly.

If you want something quick and clear, I highly recommend you to checkout Dr. Shen’s videos on

Pick the control points from Mathematica’s InterpolationFunction (assign x to some values and evaluate them) and use the formulae presented in the videos above.