version 1.27, 2010/11/07 12:28:28
|
version 1.28, 2010/11/07 13:15:28
|
Line 591 sub populate_arrays {
|
Line 591 sub populate_arrays {
|
$xiold=$xi; |
$xiold=$xi; |
# Function value |
# Function value |
$Apache::functionplotresponse::func[$xi]=&cubic_hermite($t,@yparms); |
$Apache::functionplotresponse::func[$xi]=&cubic_hermite($t,@yparms); |
|
# Chain rule |
# dy/dx=dy/dt/(dx/dt) |
# dy/dx=dy/dt/(dx/dt) |
my $dxdt=&ddt_cubic_hermite($t,@xparms); |
my $dxdt=&ddt_cubic_hermite($t,@xparms); |
if ($dxdt) { |
if ($dxdt) { |
$Apache::functionplotresponse::dfuncdx[$xi]=&ddt_cubic_hermite($t,@yparms)/$dxdt; |
$Apache::functionplotresponse::dfuncdx[$xi]=&ddt_cubic_hermite($t,@yparms)/$dxdt; |
} |
} |
# d^2y/dx^2 |
# Faa di Bruno |
|
# d^2y/dx^2=(d^2y/dt^2)/(dx/dt)^2+(dy/dt)/(d^2x/dt^2) |
my $d2xdt2=&d2dt2_cubic_hermite($t,@xparms); |
my $d2xdt2=&d2dt2_cubic_hermite($t,@xparms); |
if ($d2xdt2) { |
if (($dxdt) && ($d2xdt2)) { |
$Apache::functionplotresponse::d2funcdx2[$xi]=&d2dt2_cubic_hermite($t,@yparms)/$d2xdt2; |
$Apache::functionplotresponse::d2funcdx2[$xi]= |
|
&d2dt2_cubic_hermite($t,@yparms)/($dxdt*$dxdt) |
|
+&ddt_cubic_hermite($t,@yparms)/$d2xdt2; |
} |
} |
} |
} |
} |
} |