Dear all,
I have tried to solve this initial value problem
ty' + 2y = 4t^{2}
y(1) = 2
I plot it with this code:
using Plots, LaTeXStrings, Plots.PlotMeasures
gr()
f(x) = x^(2) + (1 / x^(2))
p = plot(f, -1, 5, xticks=false, xlims=(-2, 2), ylims=(-2, 4),
bottom_margin=10mm, label=L"t^{2} + \frac{c}{t^{2}}", framestyle=:zerolines,
legend=:outerright)
for i = 1:0.5:3
g(x) = x^(2) + (i / x^(2))
plot!(p, g, xticks=false, xlims=(-2, 2), ylims=(-2, 4),
bottom_margin=10mm, label="", framestyle=:zerolines,
legend=:outerright)
end
for i = 1:0.5:3
g(x) = x^(2) - (1 / x^(2))
plot!(p, g, xticks=false, xlims=(-2, 2), ylims=(-2, 4),
bottom_margin=10mm, label="", framestyle=:zerolines,
legend=:outerright)
end
display(p)
My plot is missing a lot of curves…
The book can plot it nicely:
I wonder how to plot like the book with Julia. Thanks