Ask Your Question

Using lists to create function to automate Runge-Kutta Method

asked 2015-02-03 23:33:20 +0200

r.jay.hutchinson gravatar image

updated 2015-02-04 01:04:46 +0200

vdelecroix gravatar image

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-04 02:39:34 +0200

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 16:29:17 +0200 )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 09:48:29 +0200 )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 23:33:20 +0200

Seen: 503 times

Last updated: Feb 04 '15