# Trajectory differential equation

The soluton of this differential equation describes the trajectory of a particle considering the air resistance. Im wondering if anyone has a good way plot the solution in 2D.

       Clear[t]
solx = DSolve[{x''[t] + k x'[t] == 0, x[0] == 0,
x'[0] == v0 Cos[theta]}, x[t], t][[1, 1, 2]] // Simplify
soly = DSolve[{u''[t] + k u'[t] == -g, u'[0] == v0 Sin[theta],
u[0] == 0}, u[t], t][[1, 1, 2]] // Simplify
v0=10;(*m/s*)
k=1.;
theta=Pi/4;


EDIT

Just as a curiosity, an animation of the range in function of the angle:

Clear[t,theta]
g = 9.81;
Manipulate[ParametricPlot[{solx, soly} /. t -> tt /. theta -> \[Theta], {tt, 0, 1.8}, PlotRange -> {{0, 6}, {0, 5}}], {\[Theta], Pi/10, Pi/2}]


• ParametricPlot[{solx, soly} /. g -> 9.8, {t, 0, 1}, AspectRatio -> 1]. Dec 16, 2015 at 19:46

v0 = 10;
k = 1.;
theta = Pi/4;
g = 10;
solx = DSolve[{x''[t] + k x'[t] == 0, x[0] == 0, x'[0] == v0 Cos[theta]}, x[t], t]
soly = DSolve[{u''[t] + k u'[t] == -g, u'[0] == v0 Sin[theta], u[0] == 0}, u[t], t]
ParametricPlot[{x[t], u[t]} /. solx /. soly, {t, 0, 1}]


To plot until it comes down to earth:

tf = t /. First@Solve[(u[t] /. soly) == 0 && t > .1, t]
ParametricPlot[{x[t], u[t]} /. solx /. soly, {t, 0, tf}]


Here you have the same, done with the vectorial form of NDSolve[ ]

th = Pi/4;
k = 1.;
v0 = 10;
s = {0, -g};
ds = NDSolveValue[
{w'[t] == {0, 0}, w[0] == {0, -g},
r''[t] + k r'[t] == w[t], r[0] == {0, 0}, r'[0] == v0 {Cos@th, Sin@th},
WhenEvent[Last[r[t]] == 0, (tf = t; "StopIntegration")]},
{r, w}, {t, 0, 10}]

ParametricPlot[Through[ds[t]][[1]], {t, 0, tf}]