ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 07 May 2012 22:33:55 +0200desolve not using/understanding assume()https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/I am trying to solve a differential equation with symbolic variables, but assume() does not seem to help answer maximas question:
t,a,b = var('t,a,b')
v = function('v',t)
de = diff(v,t)-a*v^2-b
assume((a*b)>0)
sol=desolve(de, dvar=v, ivar=t)
I still get the error message:
TypeError: ECL says: Maxima asks: Is a*b positive or negative?
How can i fix this?
Mon, 07 May 2012 09:35:59 +0200https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/Answer by ndomes for <p>I am trying to solve a differential equation with symbolic variables, but assume() does not seem to help answer maximas question:</p>
<pre><code>t,a,b = var('t,a,b')
v = function('v',t)
de = diff(v,t)-a*v^2-b
assume((a*b)>0)
sol=desolve(de, dvar=v, ivar=t)
</code></pre>
<p>I still get the error message:</p>
<pre><code>TypeError: ECL says: Maxima asks: Is a*b positive or negative?
</code></pre>
<p>How can i fix this?</p>
https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/?answer=13545#post-id-13545You try to pass an assumption on an expression to maxima.
Very Likely you can pass an assumption on symbolic variables only.
t,a,b = var('t,a,b')
v = function('v',t)
de = diff(v,t)-a*v^2-b
forget()
assume(a>0)
assume(b>0)
print assumptions()
sol=desolve(de, dvar=v, ivar=t)
print sol
forget()
assume(a<0)
assume(b<0)
print assumptions()
sol=desolve(de, dvar=v, ivar=t)
solMon, 07 May 2012 10:11:18 +0200https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/?answer=13545#post-id-13545Comment by kcrisman for <p>You try to pass an assumption on an expression to maxima.
Very Likely you can pass an assumption on symbolic variables only.</p>
<pre><code>t,a,b = var('t,a,b')
v = function('v',t)
de = diff(v,t)-a*v^2-b
forget()
assume(a>0)
assume(b>0)
print assumptions()
sol=desolve(de, dvar=v, ivar=t)
print sol
forget()
assume(a<0)
assume(b<0)
print assumptions()
sol=desolve(de, dvar=v, ivar=t)
sol
</code></pre>
https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/?comment=19811#post-id-19811You can actually sometimes pass in more complicated thing to Maxima's assume, but there isn't necessarily a guarantee it will do much with those more complex ones.Mon, 07 May 2012 22:33:55 +0200https://ask.sagemath.org/question/8959/desolve-not-usingunderstanding-assume/?comment=19811#post-id-19811