Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #Lodka-Volterra non linear model
  2. def MakeModel(Alpha,Beta,Gamma,Delta,Variables):
  3. Equation1=Variables[0]*(Alpha-Beta*Variables[1])
  4. Equation2=-Variables[1]*(Gamma-Delta*Variables[0])
  5. return [Equation1,Equation2]
  6.  
  7. #Integration time
  8. SolverTime=np.linspace(0,50,num=200)
  9.  
  10. #Parameters of the model
  11. alpha=0.25
  12. beta=0.55
  13. gamma=0.3
  14. delta=0.6
  15.  
  16. #Initial conditions
  17. Int=np.array([3,1])
  18.  
  19. #Model Solution
  20. def ODEModel(InitialConditions,t):
  21. return MakeModel(alpha,beta,gamma,delta,InitialConditions)
  22.  
  23. Solution=odeint(ODEModel,Int,SolverTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement