Skip to main content
1-Visitor
April 17, 2011
Solved

Problems with rkfixed

  • April 17, 2011
  • 3 replies
  • 5230 views

Hello,

It's been a while since I've browsed these forums but I've run across a problem. I'm working on a project and I need to solve two coupled, second order DE's numerically. I'm pretty sure I have the formulas correct but rkfixed is giving me a problem. Please see attached.

Best answer by StuartBruff

The problem likely arises because the step size is too small for rkfixed - the DE has significant behaviour with short time-constants that rkfixed cannot track (it's probably going off to infinity). Rkadapt chooses a step size appropriate for the 'local' conditions, hence why that works. Choosing a smaller step size (larger N) gives better results for rkfixed.

Stuart

3 replies

1-Visitor
April 17, 2011

I just tried the exact same equation set up and it worked for Rkadapt. Weird.

23-Emerald V
April 18, 2011

The problem likely arises because the step size is too small for rkfixed - the DE has significant behaviour with short time-constants that rkfixed cannot track (it's probably going off to infinity). Rkadapt chooses a step size appropriate for the 'local' conditions, hence why that works. Choosing a smaller step size (larger N) gives better results for rkfixed.

Stuart

1-Visitor
April 18, 2011

Hmm, seems you are right. MathCAD was having a problem with my D(x,y) function saying "This function cannot be used here" so I thought it was an arguments or function definition problem. Thanks!