Conservative Dynamical systems of 1DoF
Repelling Forces - Hyperbolic system

Clear["Global`*"]

Force

f[x_]=a^2 x

Analytic solution

Clear[a]
deq1=x'[t]==y[t] 
deq2=y'[t]==a^2  x[t]
sol=DSolve[{deq1,deq2,x[0]==x0,y[0]==y0},{x,y},t];
xt=x[t]/.sol[[1]] //FullSimplify;
yt=y[t]/.sol[[1]] //FullSimplify;
Print["x(t)=",xt]
Print["y(t)=",yt]

xx=TrigToExp[xt] 
yy=TrigToExp[yt]

Collect[xx,{Exp[-a t], Exp[a t]}]
Collect[yy,{Exp[-a t], Exp[a t]}]

Example (a=1/2)

xt1=xt /.{x0->0.1, y0->0, a->1/2}
yt1=yt /.{x0->0.1, y0->0,a->1/2}
Plot[{xt1,yt1},{t,0,6},PlotStyle->{Red,Blue}]
ParametricPlot[{xt1,yt1},{t,0,6},PlotStyle->RGBColor[1,0,1],PlotRange->{{-1,1},{-1,1}}, AspectRatio->Automatic]

Potential, limits of motions

V[x_]=-∫f[x]\[DifferentialD]x
Plot[V[x]/.a->1/2,{x,-3,3}]
Energy[x_,y_]=(1/2)y^2+V[x]

motionBorder=Solve[E0-V[x]==0,x]
x1=x/.motionBorder[[1]]; x2=x/.motionBorder[[2]];
Print["intervals of motion for E0<0,   x<=",x1,"  x>= ",x2]

Phase Space

graph1=VectorPlot[{y,f[x]/.a->1/2},{x,-1,1},{y,-1,1},VectorPoints->15, VectorScale->{0.03,1,None}, VectorStyle->Gray, Frame->None];
graph2=ContourPlot[Energy[x,y]/.a->1/2,{x,-1,1}, {y,-1,1}, ContourShading->False, Contours->{-0.1,-0.05,-0.02,0,0.02,0.05,0.1,0.2,0.3}, PlotPoints->100];
Show[graph2,graph1]

Asymptotic solutions for Ε=0

Phase trajectory for E=0

Solve[Energy[x,y]==0,y]

Solution 1 (ustable branch , a>0)

y0=a x0;
sol=DSolve[{deq1,deq2,x[0]==x0, y[0]==y0},{x,y},t];
xa1=x[t]/.sol[[1]]
ya1=y[t]/.sol[[1]]

Plot[xa1/.{a->1/2 ,x0->0.001},{t,0,15}, PlotRange->All]
Plot[ya1/.{a->1/2 ,x0->0.001},{t,0,15}, PlotRange->All]

Solution 2  (stable branch, a>0)

y0=-a x0;
sol=DSolve[{deq1,deq2,x[0]==x0, y[0]==y0},{x,y},t];
xa2=x[t]/.sol[[1]]
ya2=y[t]/.sol[[1]]

Plot[xa2/.{a->1/2 ,x0->1},{t,0,16}]
Plot[ya2/.{a->1 /2,x0->1},{t,0,16}]

Deviation from stable branch

y0=-a x0+0.001;
sol=DSolve[{deq1,deq2,x[0]==x0, y[0]==y0},{x,y},t];
xa2=x[t]/.sol[[1]]
ya2=y[t]/.sol[[1]]

Plot[xa2/.{a->1/2,x0->1},{t,0,16}]
Plot[ya2/.{a->1/2,x0->1},{t,0,16}]