ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 13 Aug 2018 19:41:49 +0200How to solve and plot y' = x^2 + y^3https://ask.sagemath.org/question/43369/how-to-solve-and-plot-y-x2-y3/Hi.
My first post!
I am trying to complete this exercise:
12. Although it might not be obvious from the differential equation, its solution could “behave badly” near a point x at which we wish to approximate y(x). Numerical procedures may give widely differing results near this point. Let y(x) be the solution of the initial-value problem y' = x^2 + y^3, y(1) = 1.
(a) Use a numerical solver to graph the solution on the interval [1, 1.4].
(b) Using the step size h = 0.1, compare the results obtained from Euler’s method with the results from the improved Euler’s method in the approximation of y(1.4).
Please help?
THANK YOU!RobertWebbMon, 13 Aug 2018 19:41:49 +0200https://ask.sagemath.org/question/43369/solving a system of DEs numerically and plotting the solutionhttps://ask.sagemath.org/question/24766/solving-a-system-of-des-numerically-and-plotting-the-solution/Hi everyone. I want to hand Sage a system of nonlinear DEs with initial values, and I'd like a plot of the solutions. Is there a best way to do this? For example, to solve this system: ds/dt=-si, di/st=si-2i, dr/dt=2i, s(0)=1, i(0)= 0.00000127, r(0)=0, I did this in Sage:
sage: (s,i,r)=var('s,i,r')
sage: des=[-1*s*i, s*i-2*i, i]
sage: desolve_system_rk4(des, [s,i,r], ics=[0, 1, 0.00000127, 0], ivar=t, end_points=20)
Sage gave me a list of points, but I couldn't figure out a way to plot s, i, and r using the points it gave me. Thanks!
strangelove1661Mon, 03 Nov 2014 21:32:05 +0100https://ask.sagemath.org/question/24766/