John Travis
Mississippi College
Playing around with solutions of various first-order differential equations.
Solving the first order linear DE \frac{dy}{dt} = P(t)y+Q(t) using Sage symbolics only
Solution is y(t) = {\left(c + \int e^{\left(-\int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t}\right)} e^{\left(\int P\left(t\right)\,{d t}\right)}
Solving the first order linear DE \frac{dy}{dt} = P(t)y+Q(t) using Sage symbolics only
Solution is y(t) = {\left(c + \int e^{\left(-\int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t}\right)} e^{\left(\int P\left(t\right)\,{d t}\right)} |
Solving \frac{dy}{dt} = \frac{1}{\sqrt{t^{3} - 3}}y + t
Traceback (click to the left of this block for traceback) ... ValueError: The name "y(t)" is not a valid Python identifier.
Solving \frac{dy}{dt} = \frac{1}{\sqrt{t^{3} - 3}}y + t
Traceback (most recent call last): P = 1/sqrt(t^3-3) File "", line 1, in <module> File "/tmp/tmpSF0IHV/___code___.py", line 13, in <module> soln=desolve(DE,y,ivar=t,ics=[_sage_const_1 ,_sage_const_3 ]) File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/calculus/desolvers.py", line 501, in desolve soln=soln.sage() File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 865, in sage return self._sage_() File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/interfaces/maxima_abstract.py", line 1224, in _sage_ maxima=self.parent()) File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 1789, in symbolic_expression_from_maxima_string return symbolic_expression_from_string(s, syms, accept_sequence=True) File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 1961, in symbolic_expression_from_string return parse_func(s) File "parser.pyx", line 516, in sage.misc.parser.Parser.parse_sequence (sage/misc/parser.c:4109) File "parser.pyx", line 531, in sage.misc.parser.Parser.parse_sequence (sage/misc/parser.c:3990) File "parser.pyx", line 602, in sage.misc.parser.Parser.p_sequence (sage/misc/parser.c:4731) File "parser.pyx", line 692, in sage.misc.parser.Parser.p_eqn (sage/misc/parser.c:5513) File "parser.pyx", line 728, in sage.misc.parser.Parser.p_expr (sage/misc/parser.c:5816) File "parser.pyx", line 761, in sage.misc.parser.Parser.p_term (sage/misc/parser.c:6056) File "parser.pyx", line 800, in sage.misc.parser.Parser.p_factor (sage/misc/parser.c:6410) File "parser.pyx", line 803, in sage.misc.parser.Parser.p_factor (sage/misc/parser.c:6439) File "parser.pyx", line 833, in sage.misc.parser.Parser.p_power (sage/misc/parser.c:6599) File "parser.pyx", line 803, in sage.misc.parser.Parser.p_factor (sage/misc/parser.c:6439) File "parser.pyx", line 830, in sage.misc.parser.Parser.p_power (sage/misc/parser.c:6568) File "parser.pyx", line 893, in sage.misc.parser.Parser.p_atom (sage/misc/parser.c:7203) File "parser.pyx", line 731, in sage.misc.parser.Parser.p_expr (sage/misc/parser.c:5854) File "parser.pyx", line 761, in sage.misc.parser.Parser.p_term (sage/misc/parser.c:6056) File "parser.pyx", line 803, in sage.misc.parser.Parser.p_factor (sage/misc/parser.c:6439) File "parser.pyx", line 830, in sage.misc.parser.Parser.p_power (sage/misc/parser.c:6568) File "parser.pyx", line 888, in sage.misc.parser.Parser.p_atom (sage/misc/parser.c:7142) File "/usr/local/sage-5.3/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 1451, in at return ex.subs(**kwds) File "expression.pyx", line 3753, in sage.symbolic.expression.Expression.substitute (sage/symbolic/expression.cpp:18208) File "ring.pyx", line 520, in sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6956) File "ring.pyx", line 568, in sage.symbolic.ring.SymbolicRing.var (sage/symbolic/ring.cpp:6689) ValueError: The name "y(t)" is not a valid Python identifier. |
Solving a Bernoulli DE \frac{dy}{dt} = P(t)y+Q(t)y^2 using Sage symbolics only
Solution is y(t) = \frac{e^{\left(\int P\left(t\right)\,{d t}\right)}}{c - \int e^{\left(\int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t}}
Solving a Bernoulli DE \frac{dy}{dt} = P(t)y+Q(t)y^2 using Sage symbolics only
Solution is y(t) = \frac{e^{\left(\int P\left(t\right)\,{d t}\right)}}{c - \int e^{\left(\int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t}} |
Solving \frac{dy}{dt} = \frac{2}{t}y + -t^{2}y^2
Solution is y(t) = \frac{15 \, t^{2}}{3 \, t^{5} + 2}
Solving \frac{dy}{dt} = \frac{2}{t}y + -t^{2}y^2
Solution is y(t) = \frac{15 \, t^{2}}{3 \, t^{5} + 2} |
Solving \frac{dy}{dt} = P(t)y+Q(t)y^n using Sage symbolics only
Solution is y(t) = {\left(-{\left(n - 1\right)} \int e^{\left({\left(n - 1\right)} \int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t} + c\right)}^{{\left(-\frac{1}{n - 1}\right)}} e^{\left(\int P\left(t\right)\,{d t}\right)}
Solving \frac{dy}{dt} = P(t)y+Q(t)y^n using Sage symbolics only
Solution is y(t) = {\left(-{\left(n - 1\right)} \int e^{\left({\left(n - 1\right)} \int P\left(t\right)\,{d t}\right)} Q\left(t\right)\,{d t} + c\right)}^{{\left(-\frac{1}{n - 1}\right)}} e^{\left(\int P\left(t\right)\,{d t}\right)} |
Solving \frac{dy}{dt} = \frac{1}{t^{2}}y + 4y^n
Solution is y(t) = \frac{3 \, e^{\left(-\frac{1}{t} + 1\right)}}{{\left(-5184 \, e^{4} \Gamma\left(-1, \frac{4}{t}\right) + 5184 \, e^{4} \Gamma\left(-1, 4\right) + 1\right)}^{\frac{1}{4}}} verbose 0 (4075: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 199 points. verbose 0 (4075: plot.py, generate_plot_points) Last error message: 'negative number to a fractional power not real'
Solving \frac{dy}{dt} = \frac{1}{t^{2}}y + 4y^n
Solution is y(t) = \frac{3 \, e^{\left(-\frac{1}{t} + 1\right)}}{{\left(-5184 \, e^{4} \Gamma\left(-1, \frac{4}{t}\right) + 5184 \, e^{4} \Gamma\left(-1, 4\right) + 1\right)}^{\frac{1}{4}}} verbose 0 (4075: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 199 points. verbose 0 (4075: plot.py, generate_plot_points) Last error message: 'negative number to a fractional power not real' |
|