Plotting runge kutta 4 stability region

Click For Summary

Discussion Overview

The discussion revolves around plotting the stability region of the Runge-Kutta 4 method. Participants explore methods for visualizing this region, including the shape and characteristics of the plot, as well as technical challenges encountered while using MATLAB for this purpose.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant inquires about how to plot the Runge-Kutta 4 stability region, noting its heart-like shape and the maximum values on the imaginary axis.
  • Another participant shares a link to an article that explains how to plot the stability region.
  • A participant attempts to use MATLAB code from the article but encounters an error related to an undefined function 'contourplot'.
  • One participant mentions they do not have MATLAB and did not realize the provided code called an extrinsic function.
  • Another participant claims to have successfully plotted the stability region and shares an image link of the result.
  • A participant compliments the image shared and asks if a custom contourplot function was written to achieve the plot.
  • The participant who created the plot clarifies that they did not write their own contourplot function and provides the MATLAB code they used to generate the plot.

Areas of Agreement / Disagreement

Participants express varying levels of success with plotting the stability region, with some successfully creating plots while others face technical difficulties. There is no consensus on a single method or solution for plotting the stability region.

Contextual Notes

The discussion highlights limitations related to the MATLAB code provided, including dependencies on specific functions that may not be available to all users.

Dustinsfl
Messages
2,217
Reaction score
5
How can I plot the runge kutta 4 stability region? I know on the i axis the max is \(\pm 2\sqrt{2}\). The plot makes a heart type shape. I don't know how to plot it though but would like to.
 
Physics news on Phys.org
Here is an article explaining how to plot this stability region:

http://homepages.cwi.nl/~jason/Classes/numwisk/ch10.pdf
 
MarkFL said:
Here is an article explaining how to plot this stability region:

http://homepages.cwi.nl/~jason/Classes/numwisk/ch10.pdf

I just tried their Matlab code to plot the region but it returns an error:

Undefined function 'contourplot' for input arguments of type 'double'.

Have you tried to plot it?
 
No, I don't have Matlab, and I didn't realize their code was calling an extrinsic function. (Rain)
 
Beautiful image, Dustin! (Clapping)

Did you write your own contourplot function?
 
MarkFL said:
Beautiful image, Dustin! (Clapping)

Did you write your own contourplot function?

Definitely not:

Code:
[X, Y] = meshgrid(-3:.01:1, -3:.01:3); 
Mu = X + i*Y; 
R = 1 + Mu + .5*Mu.^2 + (1/6)*Mu.^3 + (1/24)*Mu.^4; 
Rhat = abs(R); 
Rhat = Rhat.*(Rhat<1);  %# here I truncate 
imagesc([min(X(:)) max(X(:))],[min(Y(:)) max(Y(:))], Rhat) 
colormap(flipud(bone))
 
Last edited:

Similar threads

  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K