Plot y, x and t

Clear["Global*"]
eqns = {y[x]^2 - (2/13)*Sqrt*y[x]*Sqrt[y[x]^2 + 1/1000/x^2 - 7/10] + 19/39000/x^2 -7/10 == 0};
sol = DSolve[eqns, y, x];
Plot[y[x]^2 /. sol[], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]

Now if I have this expression for y[x] = y0 * Derivative[x][t]/x[t] and y0 = 71and how can I plot $$y$$ vs $$t$$ and $$x$$ vs $$t$$?

• Where did you define x[t]? Jan 4 at 13:55
• I didn't define it yet but I want to know how to introduce this to my equation? Jan 4 at 14:05
• What is the meaning of new parameter t? Jan 4 at 14:13
• t isn't parameter it is variable which means the time Jan 4 at 14:15
• I don't see a need for the first DSolve. It's just an equation in y[x]. Could have used Solve[eqn,y[x]]
– josh
Jan 4 at 14:30

Using the first solution of y[x] we may write an diff. equation for x[t]:

y1[x_] = y[x] /. sol[];
DSolve[{y1[x[t]] == x'[t]/71}, x[t], t] MMA can not find a closed form analytical solution. We may try to find a numerical solution. For this we need to assume an initial value, say e.g. x==1 and a start and end time, e.g. 0 and 10. With this we get x[t]:

x1[t_] = x[t] /.
NDSolve[{y1[x[t]] == 100 x'[t]/71, x == 1}, x[t], {t, 0, 10}]
Plot[x1[t], {t, 0, 10}, PlotRange -> All] From x[t] we get y[x[t]]:

Plot[y1[x1[t]], {t, 0, 10}, PlotRange -> All] For all other solutions to x[t] we proceed analogously.

• Thank you this is very good approach Jan 4 at 16:15

Problem is a bit ambiguous I think and setup has changed since initial posting. Here's my analysis of the current version: We are given the expression:

$$-\frac{2}{13} \sqrt{3} \sqrt{\frac{1}{1000 x^2}+y(x)^2-\frac{7}{10}} y(x)+\frac{19}{39000 x^2}+y(x)^2-\frac{7}{10}=0$$ with the stipulation:

Now if I have this expression for y[x] = y0 * Derivative[x][t]/x[t] and y0 = 71and how can I plot y vs t and x vs t?

which I interpret as $$x=x(t)$$ and $$y(x)=71\frac{x'(t)}{x(t)}$$ then:

eqn2 = {y[x]^2 - (2/13)*Sqrt*y[x]*
Sqrt[y[x]^2 + 1/1000/x^2 - 7/10] + 19/39000/x^2 - 7/10 ==
0} /. {y[x] -> 72 x'[t]/x[t], x -> x[t]}

produces: $$\frac{5184 x'(t)^2}{x(t)^2}-\frac{144 \sqrt{3} \sqrt{\frac{5184 x'(t)^2}{x(t)^2}+\frac{1}{1000 x(t)^2}-\frac{7}{10}} x'(t)}{13 x(t)}+\frac{19}{39000 x(t)^2}-\frac{7}{10}=0$$

Letting for example $$x_0=1$$, and solving:

x0 = 1;
sol = NDSolve[Append[eqn2, x == x0], x, {t, 0, 10}]

produces four solutions for $$x(t)$$. Using Bob's code above

Plot[
Evaluate[x[t] /. sol],
{t, 0, 10},
Frame -> True,
PlotLegends -> Placed[Automatic, {.8, .5}],
FrameLabel -> (Style[#, 14] & /@ {t, x})]

produces four plots for $$x(t)$$: but solving for $$y[x]$$ in the first expression:

theY = y[x] /.
Solve[y[x]^2 - (2/13)*Sqrt*y[x]*
Sqrt[y[x]^2 + 1/1000/x^2 - 7/10] + 19/39000/x^2 - 7/10 == 0,
y[x]]

produces four solutions for $$y(x)$$. So that $$y(t)$$ should be 8 solutions:

pTable = Table[
Plot[theY[[i]] /. x -> Evaluate[x[t] /. sol], {t, 0, 10}],
{i, 1, Length@theY}] Clear["Global*"]

Make the dependence on t explicit in eqns

eqns = {y[x]^2 - (2/13)*Sqrt*y[x]*Sqrt[y[x]^2 + 1/1000/x^2 - 7/10] +
19/39000/x^2 - 7/10 == 0} /. x -> x[t]

(* {-(7/10) + 19/(39000 x[t]^2) + y[x[t]]^2 -
2/13 Sqrt y[x[t]] Sqrt[-(7/10) + 1/(1000 x[t]^2) + y[x[t]]^2] == 0} *)

Substituting for the definition of y[x[t]]

y0 = 100; x0 = 71;

eqns2 = eqns /. y[x[t]] :> y0*x'[t]/x0

(* {-(7/10) + 19/(39000 x[t]^2) + (10000 Derivative[x][t]^2)/5041 -
200/923 Sqrt
Derivative[x][t] Sqrt[-(7/10) + 1/(1000 x[t]^2) + (
10000 Derivative[x][t]^2)/5041] == 0} *)

Assuming that x == x0, the solution for x[t] is

sol = NDSolve[Append[eqns2, x == x0],
x, {t, 0, 10}];

Plotting x versus t

Plot[
Evaluate[x[t] /. sol],
{t, 0, 10},
Frame -> True,
PlotLegends -> Placed[Automatic, {.8, .5}],
FrameLabel -> (Style[#, 14] & /@ {t, x})] Plotting y versus t

Plot[
Evaluate[y0*x'[t]/x0 /. sol],
{t, 0, 10},
Frame -> True,
PlotLegends -> Placed[Automatic, {.8, .5}],
FrameLabel -> (Style[#, 14] & /@ {t, y})] Plotting y versus x

ParametricPlot[
Evaluate[{x[t], y0*x'[t]/x0} /. sol],
{t, 0, 10},
Frame -> True,
AspectRatio -> 1,
PlotLegends -> Placed[Automatic, {.8, .5}],
FrameLabel -> (Style[#, 14] & /@ {x[t], y[t]})] • I changed little bit this answer but seems not working?! Clear["Global`*"] eqn2 = {y[x]^2 - (1/52)*Sqrt*y[x]* Sqrt[y[x]^2 + (x/x0)^-2/1000 - (69/100)] + ((49 (x/x0)^-2)/ 100000) - (69/100) == 0} /. {y[x] -> x'[t]/(H0 x[t]), x -> x[t]}; H0 = 71; x0 = 70; sol = NDSolve[Append[eqn2, x == x0], x, {t, 0, 10}] Jan 5 at 14:44
• Your revised equation needs to be evaluated with arbitrary-precision rather than machine precision. Add the option WorkingPrecision->15 to the NDSolve. However, the solution does not cover the full range of t. Look at the domain of the InterpolatingFunctions or sol[[All, 1, -1, 1]] Jan 5 at 16:41