Ask Your Question
0

Using lists to create function to automate Runge-Kutta Method

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

r.jay.hutchinson gravatar image

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

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
0

answered 2015-02-04 02:39:34 +0100

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

Comments

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 +0100 )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 +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: 2015-02-03 23:33:20 +0100

Seen: 565 times

Last updated: Feb 04 '15