D
David Arnold
All,
I have a file named "new".
\backtomargin
In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
differential equation is autonomous, identify the equilibrium
solution(s). Use a numerical solver to sketch the direction field
and superimpose the plot of the equilibrium solution(s) on the
direction field. Classify each equilibrium point as either
unstable or asymptotically stable.
\ex\label{exer2.9.1} $P'=0.05P-1000$
The spacing is intentional. Now, my perl file is saved as new.pl.
use strict;
use warnings;
# replace \backtomargin with instructions environment
my @instructions;
my $instruct_line;
while (my $line=<>) {
chomp($line);
if ($line=~/^\s*\\backtomargin/) {
push (@instructions,$');
while ($instruct_line=<>) {
chomp($instruct_line);
if ($instruct_line=~/\\ex/) {
last;
} else {
push(@instructions,$instruct_line);
}
}
print "\\begin{instructions}\n";
# remove blank lines from end of array
while($line=pop(@instructions)) {
if ($line=~/^\s*$/) {
print "true\n";;
} else {
print "false\n";
push (@instructions,$line);
last;
}
}
# remove blank lines from the beginning of the array
while($line=shift(@instructions)) {
if ($line=~/^\s+$/) {
;
} else {
unshift (@instructions,$line);
last;
}
}
print join("\n",@instructions);
# empty instructions array for next pass
@instructions=();
print "\\end{instructions}\n\n";
print "$instruct_line\n";
} else {
print "$line\n";
}
}
When I enter:
perl new.pl < new
I get the following output:
D:\NewBook\conversion>perl new.pl < new
\begin{instructions}
In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
differential equation is autonomous, identify the equilibrium
solution(s). Use a numerical solver to sketch the direction field
and superimpose the plot of the equilibrium solution(s) on the
direction field. Classify each equilibrium point as either
unstable or asymptotically stable.
\end{instructions}
\ex\label{exer2.9.1} $P'=0.05P-1000$
I am using ActiveState Perl on Win95. You might note the debugging
print statements and the fact that neither "true" nor "false" shows up
in the output.
I am completely stuck and in need of kind pair of eyes. If you can
help, it would be appreciated.
Thanks.
I have a file named "new".
\backtomargin
In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
differential equation is autonomous, identify the equilibrium
solution(s). Use a numerical solver to sketch the direction field
and superimpose the plot of the equilibrium solution(s) on the
direction field. Classify each equilibrium point as either
unstable or asymptotically stable.
\ex\label{exer2.9.1} $P'=0.05P-1000$
The spacing is intentional. Now, my perl file is saved as new.pl.
use strict;
use warnings;
# replace \backtomargin with instructions environment
my @instructions;
my $instruct_line;
while (my $line=<>) {
chomp($line);
if ($line=~/^\s*\\backtomargin/) {
push (@instructions,$');
while ($instruct_line=<>) {
chomp($instruct_line);
if ($instruct_line=~/\\ex/) {
last;
} else {
push(@instructions,$instruct_line);
}
}
print "\\begin{instructions}\n";
# remove blank lines from end of array
while($line=pop(@instructions)) {
if ($line=~/^\s*$/) {
print "true\n";;
} else {
print "false\n";
push (@instructions,$line);
last;
}
}
# remove blank lines from the beginning of the array
while($line=shift(@instructions)) {
if ($line=~/^\s+$/) {
;
} else {
unshift (@instructions,$line);
last;
}
}
print join("\n",@instructions);
# empty instructions array for next pass
@instructions=();
print "\\end{instructions}\n\n";
print "$instruct_line\n";
} else {
print "$line\n";
}
}
When I enter:
perl new.pl < new
I get the following output:
D:\NewBook\conversion>perl new.pl < new
\begin{instructions}
In Exercises~\ref{exer2.9.1}--\ref{exer2.9.2}, if the given
differential equation is autonomous, identify the equilibrium
solution(s). Use a numerical solver to sketch the direction field
and superimpose the plot of the equilibrium solution(s) on the
direction field. Classify each equilibrium point as either
unstable or asymptotically stable.
\end{instructions}
\ex\label{exer2.9.1} $P'=0.05P-1000$
I am using ActiveState Perl on Win95. You might note the debugging
print statements and the fact that neither "true" nor "false" shows up
in the output.
I am completely stuck and in need of kind pair of eyes. If you can
help, it would be appreciated.
Thanks.