Are you sure you're using the git head? The T(t - (x/V)) in the integral is not allowed (we stopped making SymPy objects arbitrarily callable). I'm not sure if you meant for that to be a substitution or a multiplication, so I didn't try it further. Chances are it's fixed in https://github.com/sympy/sympy/pull/2126 though.
Aaron Meurer On Tue, May 28, 2013 at 9:23 AM, Will Furnass <[email protected]> wrote: > Hi, > > I'm fairly new to sympy. I'm trying to evalute an integral analytically > over the range 0..oo but when I run the last line in the script below I get > the following error (using the sympy git head). > > CoercionFailed: can't convert DMP([[1], []], ZZ, ZZ[_a1,_b1]) of type <class > 'sympy.polys.polyclasses.DMP'> from ZZ[_a1,_b1] to RR > > Anyone got any ideas as to what this means? > > Regards, > > Will Furnass > > > ###### > > D, dx, k, L, n, P, Q, t, tau_a, tau_s, x= symbols('D dx k, L, n, P, Q, t, > \\tau_a, \\tau_s x') > > V = Q * 4 / (pi * (D**2)) > > expr1 = (tau_a - tau_s)**n * k > expr2 = (t * P * (tau_a - tau_s)**n * n) - (t * P * (tau_a - tau_s)**n) + (k > * tau_a) - (k * tau_s) > expr3 = 1 / (n-1) > expr4 = P * (tau_a - tau_s)**n > expr5 = (t * P * (tau_a - tau_s)**n * n) - (t * P * (tau_a - tau_s)**n) + (k > * tau_a) - (k * tau_s) > expr6 = ((expr1 / expr2) ** expr3) * expr4 / expr5 > expr7 = - P * exp(-t * P / k ) * (-tau_a + tau_s) / k > expr8 = Piecewise((expr6, Ne(n,1)), (expr7, Eq(n,1))) > > T = Piecewise((0, t < 0), (k * D * pi * dx * expr8 / Q, t >= 0)) > > curve_expr = integrate(T(t - (x/V)), (x, 0, L)) > > vals = { > P : 0.00022, > k : 0.5, > tau_s : 0.01, > tau_a : 2.0, > Q : 0.01, > D : 0.125, > L : 1225, > n : 3.0, > dx : 1} > > integrate(curve_expr.subs(vals)).eval() > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy?hl=en-US. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
