in reply to Re: Bad While Loop
in thread Bad While Loop

Thanks for the tip, but my original problem persists...it appears as if all variables remain unchanged throughout the loop

Replies are listed 'Best First'.
Re^3: Bad While Loop
by pvaldes (Chaplain) on Oct 25, 2011 at 23:56 UTC

    lets see

    $A = ($a*($p1-$p2) + $b*($pT-$p1)/(-2)); $B = ($p1*($a*($p2-$p1) + $b*($pT-$p1)-$k*$d2-$d1i*$k));

    In your script $p1 = $p2, so this is the same as:

    $A = -0.5*$b*($pT-$p1); $B = $b*($pT-$p1)-$k*($d2-$d1i);

    What's the purpose of the var $p2?. Maybe you want to say:

    $p2 = $p1; $p1 += .01;

    Instead

     $p1 += .01; $p2 = $p1; ?

    Check that your equations are valid

      This was intentional. Later on in this project I'll be looking at what happens when p1 =/= p2, but for this case they are the same.