I wrote the following problem to solve the Euler-Lagrange equation using 
dsolve. But sympy dot not provide me the particular solution of the 
Euler-equation, that is, with or without the initial conditions (ics), 
sympy give me the same result (the general solution). It seems that sympy 
does not take into account the ics provided.

The program:
=========

# -*- coding: utf-8 -*-

from sympy import Symbol, Function, diff
from sympy.calculus.euler import euler_equations
from sympy.solvers.ode import dsolve
from sympy import init_printing

init_printing()

x = Function('x')

t = Symbol('t')

# Integrand
L = 1 + diff(x(t),t)**2


# Euler-Lagrange equation
eq = euler_equations(L, x(t), t)


# Genral solution (without ics)

dsolve(eq[0],x(t))


# Particular solution (the initial conditions (ics) are specified)

s = dsolve(eq[0], x(t), ics = {x(0): 1, x(1): 2})

-- 
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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/b7fae6cc-8b68-43cc-b4ac-ec63fc361c8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to