Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- suptitle('circuit RLC, tension bobine')
- #Odeint
- X = linspace(t0,T,N)
- Z0 = array((ul0,ulp0))
- Y = odeint(f,Z0,X)
- Ul=[e[0] for e in Y]
- Ulp=[e[1] for e in Y]
- subplot(2,2,1)
- plot(X,Ul,label="UL")
- plot(X,Ulp,label="UL'")
- xlabel("temps(s)")
- ylabel("tension(mV)")
- title("Odeint")
- legend()
- #Euler
- Y = euler(f,t0,T,Z0,N)
- Ul=[e[0] for e in Y]
- Ulp=[e[1] for e in Y]
- subplot(2,2,2)
- plot(X,Ul,label="UL")
- plot(X,Ulp,label="UL'")
- xlabel("temps(s)")
- ylabel("tension(mV)")
- title("Euler")
- legend()
- #Heun
- Y = heun(f,t0,T,Z0,N)
- Ul=[e[0] for e in Y]
- Ulp=[e[1] for e in Y]
- subplot(2,2,3)
- plot(X,Ul,label="UL")
- plot(X,Ulp,label="UL'")
- xlabel("temps(s)")
- ylabel("tension(mV)")
- title("Heun")
- legend()
- tight_layout() # pour ajouter l'espace entre les figures
- show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement