Ask Your Question
1

ICS with diff

asked 2021-11-12 20:48:20 +0100

eleger gravatar image

updated 2021-11-13 13:09:43 +0100

slelievre gravatar image

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?

edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2021-11-13 13:11:42 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-11-13 09:05:21 +0100

eleger gravatar image

updated 2021-11-13 13:11:29 +0100

slelievre gravatar image

I 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 + z0
edit flag offensive delete link more

Comments

Congratulations for finding the answer! You can accept it by clicking the check mark next to it. This will marked the question as solved.

slelievre gravatar imageslelievre ( 2021-11-13 13:12:04 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-11-12 20:48:20 +0100

Seen: 25 times

Last updated: Nov 13 '21