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.Sat, 13 Nov 2021 13:12:04 +0100ICS with diffhttps://ask.sagemath.org/question/59723/ics-with-diff/I'm trying to solve a very easy ODE, with ics including diff:
sage: m, t, g = var('m t g')
sage: z = function('z')(t)
sage: DE = diff(z, t,2)+m*g
sage: sol = desolve(DE,[z,t])
sage: z0, v0 = var('z0 v0')
sage: sol_ics = desolve(DE, [z, t], ics=[0, z0, diff(sol, t)(t=0), v0])
sage: sol_ics
-1/2*g*m*t^2 + 1/2*(_K2^2*g*m + 2*v0 - 2*z0)*t/_K2 + z0
It does not seem to work well... What am I missing?Fri, 12 Nov 2021 20:48:20 +0100https://ask.sagemath.org/question/59723/ics-with-diff/Comment by slelievre for <p>I'm trying to solve a very easy ODE, with ics including diff:</p>
<pre><code>sage: m, t, g = var('m t g')
sage: z = function('z')(t)
sage: DE = diff(z, t,2)+m*g
sage: sol = desolve(DE,[z,t])
sage: z0, v0 = var('z0 v0')
sage: sol_ics = desolve(DE, [z, t], ics=[0, z0, diff(sol, t)(t=0), v0])
sage: sol_ics
-1/2*g*m*t^2 + 1/2*(_K2^2*g*m + 2*v0 - 2*z0)*t/_K2 + z0
</code></pre>
<p>It does not seem to work well... What am I missing?</p>
https://ask.sagemath.org/question/59723/ics-with-diff/?comment=59731#post-id-59731Welcome to Ask Sage! Thank you for your question!Sat, 13 Nov 2021 13:11:42 +0100https://ask.sagemath.org/question/59723/ics-with-diff/?comment=59731#post-id-59731Answer by eleger for <p>I'm trying to solve a very easy ODE, with ics including diff:</p>
<pre><code>sage: m, t, g = var('m t g')
sage: z = function('z')(t)
sage: DE = diff(z, t,2)+m*g
sage: sol = desolve(DE,[z,t])
sage: z0, v0 = var('z0 v0')
sage: sol_ics = desolve(DE, [z, t], ics=[0, z0, diff(sol, t)(t=0), v0])
sage: sol_ics
-1/2*g*m*t^2 + 1/2*(_K2^2*g*m + 2*v0 - 2*z0)*t/_K2 + z0
</code></pre>
<p>It does not seem to work well... What am I missing?</p>
https://ask.sagemath.org/question/59723/ics-with-diff/?answer=59727#post-id-59727I just read the docs...
sage: sol_ics = desolve(DE, [z, t], ics=[0, z0, v0])
sage: sol_ics
-1/2*g*m*t^2 + t*v0 + z0Sat, 13 Nov 2021 09:05:21 +0100https://ask.sagemath.org/question/59723/ics-with-diff/?answer=59727#post-id-59727Comment by slelievre for <p>I just read the docs...</p>
<pre><code>sage: sol_ics = desolve(DE, [z, t], ics=[0, z0, v0])
sage: sol_ics
-1/2*g*m*t^2 + t*v0 + z0
</code></pre>
https://ask.sagemath.org/question/59723/ics-with-diff/?comment=59732#post-id-59732Congratulations for finding the answer! You can accept it by clicking the check mark next to it.
This will marked the question as solved.Sat, 13 Nov 2021 13:12:04 +0100https://ask.sagemath.org/question/59723/ics-with-diff/?comment=59732#post-id-59732