2
$\begingroup$

In a previous question, I had obtained a differential equation from:

Starts with this implicit equation:

(x - a)^2 + y^2 == 1(1) ( circles on x -axis ) $(x-a)^2+y^2=1$

Is the set of equations of the given circles. This set contains one parameter namely a. So, it is the solution set of a differential equation of the first order.

NOTE: see my previous question for additional details how the differential equation is derived

This differential equation : DSolve[y[x]^2*Derivative[1][y][x]^2 == 1 - y[x]^2, {y[x]}, {x}]

Is a general solution : how to plot the general solution and a particular solution for say in the origin (0,0) ? (type ODE ?: first order))

EDIT The integralcurves

enter image description here

$\endgroup$
2
  • $\begingroup$ The general solution is a family of solutions. How do you want to plot these? Only particular solutions can be plotted. $\endgroup$ Apr 29 at 10:40
  • $\begingroup$ (x - a)^2 + y^2 == 1 is a implicit equation, and for some values of parameter a i can plot these circles Now it is a ODE with parameter C to plot, $\endgroup$
    – janhardo
    Apr 29 at 10:53

2 Answers 2

3
$\begingroup$

Draw the slope field for the general solution. There are two solutions. Pick one

ClearAll[y,x];
ode = y[x]^2*y'[x]^2 == 1 - y[x]^2;
sol = Solve[ode, y'[x]]

Mathematica graphics

Lets try the second one

fld = VectorPlot[{1, Sqrt[1 - y^2]/y}, {x, -3, 3}, {y, -2, 2}, 
  VectorColorFunction -> None, VectorStyle -> Gray]

Mathematica graphics

Add a particular solution by specifying a solution curve that passes through a point. Try {1,1}

fld = VectorPlot[{1, Sqrt[1 - y^2]/y}, {x, -3, 3}, {y, -2, 2}, 
  VectorColorFunction -> None, VectorStyle -> Gray, 
  StreamPoints -> {1, 1}]

Mathematica graphics

You can try different particular solutions by changing the stream point location. See help for many more options.

Picking a point that the solution curve passes through is like picking a value for your a parameter. You are basically saying you want to look at some particular solution curve.

See drawing-lines-on-differential-equation-slope-field for more examples.

$\endgroup$
7
  • $\begingroup$ Nasser, thanks. you use y', while i have used y. Its a family of circles with centre on x-axis. The other y' gives another part of the circle $\endgroup$
    – janhardo
    Apr 29 at 11:00
  • $\begingroup$ @janhardo I am using VectorPlot which uses the form $y'=f(x,y)$ to plot the solution curves. It has nothing to do with your implicit solution. $\endgroup$
    – Nasser
    Apr 29 at 11:04
  • $\begingroup$ Another idea is to use the general solutions with C : a example : Table[y[t] /. %[[1]] /. C[1] -> n, {n, -500, 500, 50}] $\endgroup$
    – janhardo
    Apr 29 at 11:07
  • $\begingroup$ Nasser: quote "It has nothing to do with your implicit solution." ? I ended up with a differential equation.. $\endgroup$
    – janhardo
    Apr 29 at 11:10
  • $\begingroup$ @janhardo Yes, you can always do it manually like this. But the whole point is that VectorField will plot the solution curves for you without having to solve the ODE at all. You can not just plot the general solution as it has unknowns. VectorField shows family of solution curves. You use StreamPoints to basically highlight one of these solution curves, which correspond to one particular solution curve. $\endgroup$
    – Nasser
    Apr 29 at 11:10
3
$\begingroup$

Manipulate parameters to get overview

eq = (x - a)^2 + y^2 == 1;

deq = D[eq /. y -> y[x], x]

eq /. y -> y[x] /. x -> a

(*   y[a]^2 == 1   *)

ysol[a_] = y /. DSolve[{deq, y[a]^2 == 1}, y, x]

(*   {Function[{x}, -Sqrt[1 - a^2 + 2 a x - x^2]], 
      Function[{x}, Sqrt[1 - a^2 + 2 a x - x^2]]}   *)

Manipulate[
 Plot[Evaluate[Through[ysol[a][x]]], {x, -3, 3}, PlotRange -> 3, 
  AspectRatio -> 1], {{a, -2}, -3, 3, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Akku14,thanks for this dynamic plot. I added a picture at the question, and it are all circles. In your example it is a circle with center (-2,0) and radius 1 for a circle It looks a ellipse now ;) $\endgroup$
    – janhardo
    Apr 29 at 19:01
  • $\begingroup$ Add AspectRatio -> 1 to Plot to get equal scaling for x and y achses. Changed it now. $\endgroup$
    – Akku14
    Apr 29 at 19:07
  • $\begingroup$ It is an ingenious plot you have made and so again adapted by you, nicely done I'm not doing it after you :). Challencing too is to plot these integralcurves ( circles) in a directionfield ( don't know how to do this yet ) $\endgroup$
    – janhardo
    Apr 29 at 19:39

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.