Differences between revisions 1 and 2
Revision 1 as of 2010-12-16 11:06:35
Size: 446
Editor: 172
Comment:
Revision 2 as of 2010-12-16 11:07:21
Size: 808
Editor: 172
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
# Sec 1.9
# Example 3
# Picard iteraction
# y'=1+y^2, y(0)=0
Line 10: Line 14:
y = function('y',x)
y=0
l=[]
m=[]
sol=
function('sol',x)
y = function('y',x)
new_y
= function ('new_y',x)
p=[]
Line 16: Line 18:
for i in range(4):
    sol=x+integral(y**2,x,0,x)
    y=sol
    l.append(y)
    plot(y,x,-3,3)
    print "y(",i,")=",show(y)
y = 0 # Initial condition y(0)=0

print 'y( 0 ) is', y

for i in range(4): # We calculate 4 iterations
    new_y = x + integral( y**2 , x , 0 , x ) # By picards Formula, y(n) = x + integral( y(n-1)**2 )
    y=new_y
    print 'y(',i+1,') is', show(y)
    p.append(plot(y,x,-1,1))
show(sum(p))
Line 27: Line 34:
   * <Komal>, <Student>, <IT-BHU>    * Aashita Kesarwani, Student, IIT Roorkee
   * <Your Name>, <Profession>, <Organization>
  • Book

    Advanced Engineering Mathematics

    Author

    Erwin Kreyszig

    Edition

    8th Edition

# Sec 1.9
# Example 3 
# Picard iteraction
# y'=1+y^2, y(0)=0

var('x')
y = function('y',x)
new_y = function ('new_y',x)
p=[]

y = 0                                    # Initial condition y(0)=0

print 'y( 0 ) is', y

for i in range(4):                            # We calculate 4 iterations   
    new_y = x + integral( y**2 , x , 0 , x )  # By picards Formula, y(n) = x + integral( y(n-1)**2 )
    y=new_y    
    print 'y(',i+1,') is', show(y)
    p.append(plot(y,x,-1,1))
show(sum(p))

  • Solution by:

    • Aashita Kesarwani, Student, IIT Roorkee
    • <Your Name>, <Profession>, <Organization>

Kreyszig-1.9-3 (last edited 2010-12-16 11:07:21 by 172)