résolution eq.dif. Runge&Kutta

188 days ago by mhbahichem

 
       
def RK4(a,b,N,ya): h=(b-a)/N y[0]=ya for i in range (N): t=a+ih tdemi=t+h/2 r1=f(t,y[i]) r2=f(tdemi,y[i]+(h/2)*r1) r3=f(tdemi,y[i]+(h/2)*r2) r4=f(t+h,y[i]+h*r3) y[i+1]=y[i]+(h/6)(r1+2*r2+2*r3+r4) return (y) 
       
Traceback (click to the left of this block for traceback)
...
IndentationError: expected an indented block
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_4.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGVmIFJLNChhLGIsTix5YSk6"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpDJqkjS/___code___.py", line 3
    
                      ^
IndentationError: expected an indented block