# Getting Data from Differential Equation Solution

I am solving the following differential equation. I need to get the values of y[x] for x ranging from 1 to 30. I need to get this data into excel. How can I extract it from Mathematica ?

Stefan = 0.6929;
s = NDSolve[{y'[
x] == (Stefan*((x/2) - (((x^2) - 1)/(4*x*Log[x])))) + (x*Log[x]),
y[1.00000001] == 0}, y[x], x]

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. – Saurav Dec 12 '15 at 16:00

All your answers are right there in the documentation:

If you look into the NDSolve help, the first example gives you the correct way of writing the code. For your problem:

Stefan = 0.6929;
s = NDSolve[{y'[x] == (Stefan*((x/2) - (((x^2) - 1)/(4*x Log[x])))) + (x Log[x]),y[1.00000001] == 0}, y[x], {x, 1, 30}];


You can form the data list using the command Table:

val = Table[Evaluate[y[x] /. s], {x, 1, 30}]


You can export the data to excel using the command Export:

Export["data.xls", val]

• @Shaunak. Get very friendly with the Mathematica documentation, as suggested in this answer! – march Dec 10 '15 at 20:12
• Yes I just checked the documentation ! Thank you very much Saurav and march. – Shaunak Dec 12 '15 at 2:25