Differences between revisions 1 and 2
Revision 1 as of 2010-08-09 14:04:38
Size: 805
Editor: PankajPandey
Comment:
Revision 2 as of 2010-08-09 14:06:53
Size: 1003
Editor: PankajPandey
Comment:
Deletions are marked like this. Additions are marked like this.
Line 37: Line 37:
# Notes: desolve sometimes cannot solve the DE if ics (initial conditions) are given, but can solve it if they are not given. This shouldn't be the case, since it is simply a direct substitution
  • Book

    Advanced Engineering Mathematics

    Author

    Erwin Kreyszig

    Edition

    8th Edition

x = var('x')    # define a variable x
y = function('y',x)   # define y to be a function of that variable
DE = diff(y,x)*cosh(x)^2 - sin(y)^2 == 0
print 'Differential Equation:'
show(DE)
soln = desolve(DE, [y,x])
print 'Solution:'
show(soln)

print 'Explicit solution:'
esoln = soln.solve(y)
esoln

inc_simp = (soln.solve(y)[0].rhs().subs(x=0)==pi/2)
inc_simp

simp = 1/tan(inc_simp).simplify_full()
simp

c = solve(simp,soln.variables()[0])
print 'Integration constant:'
show(c)

print 'Explicit solution:'
esoln[0].subs(c=c[0].rhs())

# Notes: desolve sometimes cannot solve the DE if ics (initial conditions) are given, but can solve it if they are not given. This shouldn't be the case, since it is simply a direct substitution

  • Solution by:

    • Pankaj Pandey, Student, IIT Bombay

SageDays/Kreyszig-1.3-17 (last edited 2010-08-09 14:06:53 by PankajPandey)