On Fri, Apr 10, 2015 at 3:54 AM, Carsten Knoll <[email protected]> wrote:
> I just noticed that my message regarding the result of dsolve lacks a
> specific question.
>
> I will add some:
>
> 1. What does an object like
>
> Integral(F(t), (t, 0))
>
> mean?

It means the integral of F(t), evaluated at t = 0. It's the same as
Integral(F(t), (t, a, 0)) except we don't want to create a new
arbitrary symbol a.

Normally this is not a well-defined concept, but for solutions from
dsolve, it is, because there is always a + C arbitrary constant factor
in the solution that absorbs the term with a.

>
> 2. Is the behavior described below intended or is it kind of a bug?

If you mean Integral(F(t), t).subs(t, 0) returning Integral(F(t), (t,
0)) instead of vanishing, that is intended. SymPy can't know that
Integral(F(t), (t, 0)) is supposed to be 0. The only way to get
constants to absorb into C1 is to use constantsimp.

>
> 3. What would be a (generic) workaround? (I was thinking in replacing
> all Integrals occurring in the rhs-result of dsolve and replacing them
> by new definite integrals like Integral(F(tau), (tau, 0, t)). But maybe
> this should happen in dsolve itself.)

If you want to do this, it shouldn't be hard to use replace() to do it.

Aaron Meurer

>
> Tanks and best regards,
> Carsten.
>
>
> On 04/08/2015 06:18 PM, Carsten Knoll wrote:
>> I have the following problem
>>
>>
>> In [1]: from sympy import *
>>
>> In [3]: x, F, t = symbols('x, F, t')
>>
>> In [4]: ode = x(t).diff(t) - F(t)
>>
>> In [5]: sol = dsolve(ode).rhs
>>
>> In [7]: sol
>> Out[7]: C1 + Integral(F(t), t)
>>
>> In [8]: sol.subs(t, 0)
>> Out[8]: C1 + Integral(F(t), (t, 0))
>>
>>
>> I want the last expression to evaluate to C1, i.e.
>>
>> Integral(F(t), t).subs(t, 0)
>>
>> should vanish instead of returning a "strange" object with one bound
>> specified.
>>
>> The application of .doit() does not help either.
>>
>>
>> BTW: IMHO dsolve should return something like
>>
>> C1 + Integral(F(tau), (tau, 0, t))
>>
>> where tau is a dummy variable
>>
>>
>> Thanks in advance,
>>
>> Carsten
>>
>
> --
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/55278FCE.8020101%40gmx.de.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6LLoRiBPc7YVvwsQ1uGOenH5uxjxtQEDU10oivZEDT97g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to