./ 40755 764 764 0 6672727714 10177 5 ustar melvin melvin COPYING 100644 764 764 1073 6432372773 11166 0 ustar melvin melvin Copyright 1997 by Richard Mansfield.
Permission is granted to anyone to use this software for any
purpose on any computer system, and to redistribute it freely,
subject to the following restrictions:
1. The author is not responsible for the consequences of use of
this software, no matter how awful, even if they arise from
defects in it.
2. The origin of this software must not be misrepresented, either
by explicit claim or by omission.
3. Altered versions must be plainly marked as such, and must not
be misrepresented as being the original software.
Examples.html 100644 764 764 3556 6432372773 12607 0 ustar melvin melvin
Example ODE Problems
Examples
- Plot the solutions of y'= y*(1-y). Why is y=1 a stable solution
to the equation and y'=0 an unstable solution.
- Plot the solutions to y'=(exp(x)-y)/x. Describe how the solutions
appear to behave as x goes to infinity and as x goes to 0 from the
right. Estimate the value for y(1) which gives a bounded solution as
x goes to 0 from the right. Solve the equation analytically and determine
this value exactly.
- Consider the predator-prey equations, x' = a*x-b*x*y; y' =
-c*y+d*x*y. They are meant to model two populations where population
y depends on x as its food supply. Plot the solutions in the region
x>0, y>0 for the parameter values a=3, b=2, c=5, d=3. What do you
conclude about the long term behavior of the populations. Determine the
equlibrium solution.
- Consider the initial value problem y'=3*x^2, x'=3y^2-4, y(1)=0.
Determine the largest interval on which this problem has a single-valued
solution. Solve the equation analytically and determine the interval
exactly.
- Plot the solutions to Van der Pol's equation, x'=y, y'=-x+(1-x^2)*y.
- Plot the solutions to x'=sin(y)-2*sin(x^2)*sin(2*y),
y'=-cos(x)-2*x*cos(x^2)*cos(2*y) in the region -6 <= x <= 6,
-6 <= y <= 6. Can you see why this is called the "teddy bear" equation?
- Describe the behavior of solutions to the Ricati equation,
y'= -y^2-x*y+1. Why do all solutions passing thru a point between the two
y-nullcline curves converge to the nullclines after first crossing them?
- Plot nullclines and solutions to y'= x*sin(x*y) in the window
0 <= x <= 10, 0 <= y <= 5. Explain what you see. (Be a little patient. There
are a lot of nullclines and plotting them may take some time.) Now do the
same thing in the window 0 <= x <= 20, 0 <= y <= 5. (In this case the
nullclines are so close together the program misses most of them.)
Rthree.java 100644 764 764 344 6432376431 12202 0 ustar melvin melvin // Copyright 1997 by Richard Mansfield; see the file COPYING.
public class Rthree {
double xcord = 0,
ycord = 0,
tcord = 0;
Rthree() {;}
Rthree(double x, double y, double t) {
xcord = x;
ycord = y;
tcord = t;
}
}
RealFrame.java 100644 764 764 2150 6432372773 12631 0 ustar melvin melvin // Copyright 1997 by Richard Mansfield; see the file COPYING.
import java.awt.*;
import java.applet.*;
public class RealFrame extends Frame {
private double xmin = -3,
xmax = 3,
ymin = -3,
ymax = 3,
xscale,
yscale,
width,
height;
int stepcount = 200;
double stepsize = (xmax + ymax - xmin - ymin)/stepcount;
RealFrame(){;}
void realSetup(int i, int j) { // The arguments are the size of the
width = i; // graphics window
height = j;
xscale = (xmax - xmin)/width;
yscale = (ymin -ymax)/height;
}
//conversions between real and pixel coordinates.
Rtwo toRtwo(int x, int y){
return new Rtwo(xscale*x + xmin, yscale*y + ymax);
}
Rtwo range() { return new Rtwo(xmax-xmin, ymax-ymin);}
Point fromRtwo(double x, double y) {
return new Point((int)((x - xmin)/xscale),
(int)((y - ymax)/yscale));
}
void setframe (double xll, double xur, double yll, double yur) {
xmin = xll; xmax = xur; ymin = yll; ymax = yur;
xscale = (xmax - xmin)/width;
yscale = (ymin -ymax)/height;
stepsize = (xmax +ymax - xmin - ymin)/stepcount;
newphase.c.clear();
}
}
Rtwo.class 100664 764 764 523 6672727724 12104 0 ustar melvin melvin - Rtwo java/lang/Object xcord D ycord ()V Code LineNumberTable
(DD)V
SourceFile Rtwo.java ! / *
* *
= *
* * *' *)
Rtwo.java 100644 764 764 272 6432372773 11711 0 ustar melvin melvin // Copyright 1997 by Richard Mansfield; see the file COPYING.
public class Rtwo {
double xcord = 0,
ycord = 0;
Rtwo() {;}
Rtwo(double x, double y) {
xcord = x;
ycord = y;
}
}
newphase.class 100664 764 764 16245 6672727724 13033 0 ustar melvin melvin - newphase java/applet/Applet java/awt/event/ActionListener java/awt/event/ItemListener c
LmyCanvas; d LSolutions; text1 Ljava/awt/TextField; text2 stepper LSingleStep; mesh I level back Ljava/awt/Color; fore setframe Ljava/awt/Frame; xminField xmaxField yminField ymaxField tminField tmaxField pplane splane chklines Ljava/awt/Checkbox; chkshow init ()V Code LineNumberTable java/awt/BorderLayout ) + &
* , (Ljava/awt/LayoutManager;)V setLayout / . java/awt/Container 1
2 0 java/awt/Panel 4 + &
5 6 South 8 <(Ljava/lang/String;Ljava/awt/Component;)Ljava/awt/Component; add ; :
2 < java/awt/Label > x' = @ (Ljava/lang/String;)V + B
? C *(Ljava/awt/Component;)Ljava/awt/Component; ; E
2 F
H y' = J L North N Center P java/awt/Button R reset T + B
S V "(Ljava/awt/event/ActionListener;)V addActionListener Y X
S Z window \ << ^ >> ` undo b
nullclines d java/awt/Checkbox f
line elements h .(Ljava/lang/String;Ljava/awt/CheckboxGroup;Z)V + j
g k " # m (Ljava/awt/event/ItemListener;)V addItemListener p o
g q java/awt/Choice s + &
t u Black w addItem y B
t z Blue | Orange ~ Yellow Green Red p o
t Examples Van der Pol Volterra
Predator-prey Pendulum
Teddy bear show solutions? $ # myCanvas + &
java/awt/GridLayout (II)V +
min max x y t setSize java/awt/Component
ok Solutions + &
java/awt/Frame Phase Portrait + B
! start (Z)V
setVisible
repaint &
Z plot_solutions stop itemStateChanged (Ljava/awt/event/ItemEvent;)V ()Ljava/awt/ItemSelectable; getItemSelectable java/awt/event/ItemEvent
()Ljava/lang/Object; getItem
java/lang/String (Ljava/lang/Object;)Z equals
black java/awt/Color
orbitcolor orange yellow green red blue y setText
B java/awt/TextComponent
(1-x^2)*y-x @ (DDDDDD)V
> @>
x-x*y! -y+x*y# 5*(1-x/3.2-2*y/(1+x))*x%
y*(x-1)/(1+x)'? -sin(x)+ @ sin(y)-2*sin(x^2)*sin(2*y)1 -cos(x)-2*x*cos(x^2)*cos(2*y)3 ()Ljava/lang/String; getLabel65
g7 ()Z getState:9
g;
plotslopes= > replay@ &
A clearC &
D actionPerformed (Ljava/awt/event/ActionEvent;)V getActionCommandH5 java/awt/event/ActionEventJ
KI getTextM5
N &(Ljava/lang/String;)Ljava/lang/Double; valueOfQP java/lang/DoubleS
TR ()D doubleValueWV
TX> Ljava/io/PrintStream; out]\ java/lang/System_ `^ Number Format Exceptionb printlnd B java/io/PrintStreamf
ge java/lang/NumberFormatExceptioniC &
k goforthm n forwardLoopp &
q records &
t backwardLoopv &
w b &
y Ljava/awt/Graphics; gpad|{ } magenta (Ljava/awt/Color;)V setColor java/awt/Graphics
LXYTFunction; f (LXYTFunction;)V drawBoxes
cyan g + &
java/awt/TextField -0.1*x-y (Ljava/lang/String;I)V +
x
RungeKutta?zG{ (DDDD)V +
white pink
Choose Limits -3 3 -30 30
SourceFile
newphase.java !
! " # $ # % &