0
$\begingroup$
Clear["Global`*"]
eqns = {y[x]^2 - (2/13)*Sqrt[3]*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[[1]], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[[2]], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[[3]], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]
Plot[y[x]^2 /. sol[[4]], {x, 0, 10}, PlotStyle -> {Red}, AxesLabel -> {a/Subscript[a, 0], "E"}]

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

$\endgroup$
6
  • $\begingroup$ Where did you define x[t]? $\endgroup$ Jan 4 at 13:55
  • $\begingroup$ I didn't define it yet but I want to know how to introduce this to my equation? $\endgroup$
    – M.S MD
    Jan 4 at 14:05
  • $\begingroup$ What is the meaning of new parameter t? $\endgroup$ Jan 4 at 14:13
  • $\begingroup$ t isn't parameter it is variable which means the time $\endgroup$
    – M.S MD
    Jan 4 at 14:15
  • 1
    $\begingroup$ 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]] $\endgroup$
    – josh
    Jan 4 at 14:30
1
$\begingroup$

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

y1[x_] = y[x] /. sol[[1]];
DSolve[{y1[x[t]] == x'[t]/71}, x[t], t]

enter image description here

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[0]==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[0] == 1}, x[t], {t, 0, 10}]
Plot[x1[t], {t, 0, 10}, PlotRange -> All]

enter image description here

From x[t] we get y[x[t]]:

Plot[y1[x1[t]], {t, 0, 10}, PlotRange -> All]

enter image description here

For all other solutions to x[t] we proceed analogously.

$\endgroup$
1
  • $\begingroup$ Thank you this is very good approach $\endgroup$
    – M.S MD
    Jan 4 at 16:15
1
$\begingroup$

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[1][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[3]*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[0] == 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)$:

enter image description here

but solving for $y[x]$ in the first expression:

theY = y[x] /. 
  Solve[y[x]^2 - (2/13)*Sqrt[3]*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}]

enter image description here

$\endgroup$
0
$\begingroup$
Clear["Global`*"]

Make the dependence on t explicit in eqns

eqns = {y[x]^2 - (2/13)*Sqrt[3]*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[3] 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[1][x][t]^2)/5041 - 
   200/923 Sqrt[3]
     Derivative[1][x][t] Sqrt[-(7/10) + 1/(1000 x[t]^2) + (
     10000 Derivative[1][x][t]^2)/5041] == 0} *)

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

sol = NDSolve[Append[eqns2, x[0] == 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})]

enter image description here

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})]

enter image description here

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]})]

enter image description here

$\endgroup$
2
  • $\begingroup$ I changed little bit this answer but seems not working?! Clear["Global`*"] eqn2 = {y[x]^2 - (1/52)*Sqrt[3]*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[1] == x0], x, {t, 0, 10}] $\endgroup$
    – M.S MD
    Jan 5 at 14:44
  • $\begingroup$ 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]] $\endgroup$
    – Bob Hanlon
    Jan 5 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.