ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 22 Feb 2011 00:04:19 -0600initial conditions in desolvehttp://ask.sagemath.org/question/7962/initial-conditions-in-desolve/In desolve, it is possible to specify (for a second order ODE) two different types of initial conditions i.e.: y(x_0) = y_0, y(x_1) = y_1 and y(x_0) = y_0, y'(x_0) = s_0.
Is it also possible to specify initial conditions of the form y(x_0) = y_0, y'(x_1) = s_1?
Thanks!Mon, 21 Feb 2011 08:56:44 -0600http://ask.sagemath.org/question/7962/initial-conditions-in-desolve/Answer by Simon for <p>In desolve, it is possible to specify (for a second order ODE) two different types of initial conditions i.e.: y(x_0) = y_0, y(x_1) = y_1 and y(x_0) = y_0, y'(x_0) = s_0.</p>
<p>Is it also possible to specify initial conditions of the form y(x_0) = y_0, y'(x_1) = s_1?</p>
<p>Thanks!</p>
http://ask.sagemath.org/question/7962/initial-conditions-in-desolve/?answer=12136#post-id-12136I believe that only [Dirichlet](http://en.wikipedia.org/wiki/Dirichlet_boundary_condition) and [Neumann](http://en.wikipedia.org/wiki/Neumann_boundary_condition) boundary conditions are implemented (but would happy to be proven wrong).
The [relevant part of the docs](http://www.sagemath.org/doc/reference/sage/calculus/desolvers.html) is:
- for a second-order equation, specify the initial ``x``, ``y``,
and ``dy/dx``, i.e. write `[x_0, y(x_0), y'(x_0)]`
- for a second-order boundary solution, specify initial and
final ``x`` and ``y`` boundary conditions, i.e. write `[x_0, y(x_0), x_1, y(x_1)]`.
So the first to boundary conditions you gave are ok. But the mixed boundary conditions don't work - you'll have to get the general solution and enforce the boundary conditions semi-manually. Here's [a sage notebook](http://demo.sagenb.org/home/pub/74/) with examples.Mon, 21 Feb 2011 12:48:09 -0600http://ask.sagemath.org/question/7962/initial-conditions-in-desolve/?answer=12136#post-id-12136Comment by Chris for <p>I believe that only <a href="http://en.wikipedia.org/wiki/Dirichlet_boundary_condition">Dirichlet</a> and <a href="http://en.wikipedia.org/wiki/Neumann_boundary_condition">Neumann</a> boundary conditions are implemented (but would happy to be proven wrong). </p>
<p>The <a href="http://www.sagemath.org/doc/reference/sage/calculus/desolvers.html">relevant part of the docs</a> is:</p>
<ul>
<li><p>for a second-order equation, specify the initial <code>x</code>, <code>y</code>,
and <code>dy/dx</code>, i.e. write <code>[x_0, y(x_0), y'(x_0)]</code></p></li>
<li><p>for a second-order boundary solution, specify initial and
final <code>x</code> and <code>y</code> boundary conditions, i.e. write <code>[x_0, y(x_0), x_1, y(x_1)]</code>.</p></li>
</ul>
<p>So the first to boundary conditions you gave are ok. But the mixed boundary conditions don't work - you'll have to get the general solution and enforce the boundary conditions semi-manually. Here's <a href="http://demo.sagenb.org/home/pub/74/">a sage notebook</a> with examples.</p>
http://ask.sagemath.org/question/7962/initial-conditions-in-desolve/?comment=22067#post-id-22067Thanks a lot, Simon! Cheers, ChrisTue, 22 Feb 2011 00:04:19 -0600http://ask.sagemath.org/question/7962/initial-conditions-in-desolve/?comment=22067#post-id-22067