[SciPy-user] odeint-lsoda

Robert VERGNES robert.vergnes@yahoo...
Fri Mar 2 07:57:30 CST 2007


Hello,

is there a manual for odeint and lsoda ?

On the following small code (see below) oedint gives a warning and I would like to understand what is it... exactly and how to adjust it.

Thanx

Robert

Warning messgae:

Commandline: C:\Python25\python.exe F:\RFV-WO~1\DT_DAN~1\SOFTWA~1\MQE_PE~1\PYTHON~1\FEB200~2\SmallODE.py
##Workingdirectory: F:\RFV-WorkFiles\DT_Danil_EQM\SoftwarePendulumEQM\MQE_Pendulum_2006\Python_rfv\Feb20007_QPendulum
##Timeout: 0 ms
##
## lsoda--  at current t (=r1), mxstep (=i1) steps
##       taken on this call before reaching tout
##      In above message,  I1 =       500
##      In above message,  R1 =  0.3691558106967E+02
##Excess work done on this call (perhaps wrong Dfun type).
##Run with full_output = 1 to get quantitative information.
##[[ 0.05        0.785     ]
## [-0.08825151  0.78480528]
## [-0.22531056  0.78323728]
## ...,
## [ 0.          0.        ]
## [ 0.          0.        ]
## [ 0.          0.        ]]
##
##Process "Pyhton Interpreter" terminated, ExitCode: 00000000

small ode code:


#Import of librairies used:
from scipy import *
from scipy.integrate import *
from math import *
#from pylab import *
#from string import *
#import time
import types
#import logging
------------------------------------------------------
Small ode test
-------------------------------------------------------

def func_r3(y,t):
    return [ - fo*sign(y[0])- w0**2*sin(y[1])+ eval(RHS), y[0]]
    # rhs as alpha*sin(gamma*t+beta)

def func_f3(y,t):
    return [ - fo*sign(y[0])- w0**2*sin(y[1]), y[0]]

#----Param Settings:----
#Set the time:
t=arange(1. ,50. ,0.01)   # from 1 to aaa in steps of bbb
#Define wo
w0 = sqrt (9.81/0.5)
#Define fo
fo = 0.15   #example value fo=0.2
#we define parameters of the electrical or mechanical circuit
alpha = 1.5 # try between 0.3 and 5
gamma =  4.43 #for 50Hz - gamma = 314.159 / and for 60Hz gamma = 376.99 - or w0 for forced oscillation
beta = 0  #(used only if we now the exact phase change
RHS=rhs = 'alpha*sin(gamma*t+beta)'
#Define Initial Condtion
rfv_y0_0 =  0.05  # = theta_dot(t=0) in rd/s
rfv_y1_0 =  0.785  # = theta (t=0) in rd
y0 = [rfv_y0_0, rfv_y1_0]  # definition of the initial condition vector
# 0.08727 rd = 5 deg
rfv_qm=-0.08727
rfv_qp=0.08727
#---------------------------------------
#QPendulum(Pendultype , y0, t, w0, fo =0, RHS='', qp=0, qm=0, args='', Dfun='')

y_final = array([[0,0]]) # we define y_final with 2 vectors - the same
y=odeint(func_f3,y0,t)

print y

 		
---------------------------------
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20070302/53394059/attachment.html 


More information about the SciPy-user mailing list