In [9]:
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")


WARNING: [a] concatenation is deprecated; use collect(a) instead
 in depwarn at ./deprecated.jl:73
while loading In[9], in expression starting on line 9
Out[9]:

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


Out[10]:

In [13]:
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)


WARNING: [a] concatenation is deprecated; use collect(a) instead
 in depwarn at ./deprecated.jl:73
while loading In[13], in expression starting on line 9
Out[13]:

In [ ]:


In [ ]:


In [ ]: