Hi all,
I have found a code in this discourse and modify it to solve the separable equation of:
\frac{dy}{dx} = \frac{x^{2}}{1 - y^{2}}
with separable equations, we obtain the equation for the integral curve is:
-x^{3} + 3y - y^{3} = c
I use this code then:
using Plots
gr()
#gr(size=(600,400))
function example()
X = range(-2, stop=2, length=50)
Y = range(-2, stop=2, length=50)
f(x, y) = -x^3 + 3y - y^3
contour(X, Y, f)
x = range(-2, stop=2, length=15)
y = range(-2, stop=2, length=15)
# Calculate the partial derivative for each variable manually:
df(x, y) = [-3x^2; 3 - 3y^2] / 25
quiver!(repeat(x,11), vec(repeat(y',11)), quiver=df, c=:blue)
xlims!(-2, 2)
ylims!(-2, 2)
# to save as png uncomment the code below and gr(size=(600,400))
#png("example")
end
example()
but, the solution does not look like the one in the book, even the quiver/arrow. Is the book plots it wrongly, since I am using Julia, and the author used Maple/Mathematica as plotting tool.