# -*- coding: utf-8 -*-
# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .jl
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Julia 0.4.5
#     language: julia
#     name: julia-0.4
# ---

using ODE,Plots
pyplot(size=(300,200),leg=false,
guidefont=font(7), titlefont=font(7));
#function oscillator(t, y)
 #   y[2] = - 3* + y[1] - y[2] / 10
#end
oscillator(t, y) = [y[2], - 3* + y[1] - y[2] / 10]
initial = [1.0,0.0]; 
t = 0:0.01:50   
t,y = ode23(oscillator, initial, t)
y=hcat(y...).';
y[1:5,:];
vₓ=y[:,1];
vᵥ=y[:,2];
plot(t,y,title="Mouvement",
bg=RGB(.2,.2,.2),
xlabel ="Temps",ylabel = "Vitesse")

plot(vₓ,vᵥ,title="portrait de phase",
bg=RGB(.2,.2,.2),
xlabel ="Temps",ylabel = "Vitesse")

using ODE,Plots
pyplot(size=(700,300),leg=false,
guidefont=font(7), titlefont=font(7));
#function oscillator(t, y)
 #   y[2] = - 3* + y[1] - y[2] / 10
#end
oscillator(t, y) = [y[2], - 3* + y[1] - y[2] / 10]
initial = [1.0,0.0]; 
t = float([0:0.01:50]);   
t,y = ode23(oscillator, initial, t)
y=hcat(y...).';
y[1:5,:];
vₓ=y[:,1];
vᵥ=y[:,2];
o=plot(t,y,title="Mouvement",
bg=RGB(.2,.2,.2),
xlabel ="Temps",ylabel = "Vitesse")
l=plot(vₓ,vᵥ,title="portrait de phase",
bg=RGB(.2,.2,.2),
xlabel ="Temps",ylabel = "Vitesse")
plot(o,l,layout=2)







StarcoderdataJupyterScriptsDedupFiltered