# Mathematica Compute Time Is Extremely Long (Integrate simple function with parameter scan)

I was wondering if you can help. I have a set of equations I need to solve for a list of parameters; entering each parameter value and solving anew each time is simply not economical.

I found a way to vary the parameter and have Mathematica solve the equation, but the calculation now takes extremely long and does not even return a solution. Here is my code below (very simple):

What am I doing wrong? What can be done to make the calculation faster?

– ciao
Apr 12 '14 at 5:48
• Still no proper Mathematica code. :( Mar 25 '15 at 18:08

Combined symbolic and numeric calculation can be hard to deal with. You may do the symbolic part first and then do the substitution, or do the pure numeric integration NItegrate many times.

Integrate[(n3 +
s^2/(2 r))*(c e n)/(g r^(2/3) (s/lb (end - beg) + beg)^(4/3)), {s, 0, lb}][[1]]


Output:

(3 c e lb n (beg^(
1/3) (5 beg + 6 beg^(2/3) end^(1/3) + 3 beg^(1/3) end^(2/3) +
end) lb^2 +
10 (beg^(2/3) + beg^(1/3) end^(1/3) + end^(
2/3))^2 n3 r))/(10 beg^(
1/3) (beg^(2/3) + beg^(1/3) end^(1/3) + end^(2/3))^3 end^(1/3)
g r^(5/3))