Ask Your Question

Using lists to create function to automate Runge-Kutta Method

asked 2015-02-03 16:33:20 -0500

updated 2015-02-03 18:04:46 -0500

I'm in a differential equations class in which we're expected to use computers to solve some of the problems. My professor uses Maple, but I'm choosing to use Sage because it won't cost me hundreds of dollars. I have a very limited CS background.

One part of our homework this week is to estimate the value of y(x_n) given dy/dx = f(x,y) and y(x_0) = y_0 using the Runge-Kutta Method. I know this shouldn't be that hard to do in Sage, but I'm having a hard time figuring this out. Any pointers?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-02-03 19:39:34 -0500

tmonteil gravatar image

If you just need a solution, you can have a look at this page and that page, methods and algorithms whose name contain rk are the one to look at. But perhaps is your homework about implementing the method by yourself ? In this case, it is impossible to provide you a programming lecture on this website, so you should have a look at some Python tutorial about lists and loops, try to implement the method, and possibly come back with more precise questions about problems you encountered in your implementation.

edit flag offensive delete link more


I didn't realize that Sage had a built-in function for Runge-Kutta! And here I spent two hours trying to figure out how to make my own... Thank you!

r.jay.hutchinson gravatar imager.jay.hutchinson ( 2015-02-04 09:29:17 -0500 )edit

@r.jay.hutchinson: you can accept @tmonteil's answer by clicking the tick mark at the top left of the answer. This will mark the answer as accepted and will mark the question as solved in the list of questions. Accepting answers that solve your problem makes Ask Sage more useful for everyone.

slelievre gravatar imageslelievre ( 2015-02-05 02:48:29 -0500 )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


Asked: 2015-02-03 16:33:20 -0500

Seen: 79 times

Last updated: Feb 03 '15