[LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm

www www@source.lon-capa.org
Thu, 11 Nov 2010 15:57:49 -0000


www		Thu Nov 11 15:57:49 2010 EDT

  Modified files:              
    /loncom/homework	functionplotresponse.pm 
  Log:
  Now finally: the hopefully correct second derivative
  
  
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.33 loncom/homework/functionplotresponse.pm:1.34
--- loncom/homework/functionplotresponse.pm:1.33	Thu Nov 11 03:52:35 2010
+++ loncom/homework/functionplotresponse.pm	Thu Nov 11 15:57:49 2010
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: functionplotresponse.pm,v 1.33 2010/11/11 03:52:35 www Exp $
+# $Id: functionplotresponse.pm,v 1.34 2010/11/11 15:57:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -639,14 +639,10 @@
                    my $dxdt=&ddt_cubic_hermite($t,@xparms);
                    if ($dxdt) {
                       $Apache::functionplotresponse::dfuncdx[$xi]=&ddt_cubic_hermite($t,@yparms)/$dxdt;
-                   }
-# 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);
-                   if (($dxdt) && ($d2xdt2)) {
+# Second derivative
                       $Apache::functionplotresponse::d2funcdx2[$xi]=
-                         &d2dt2_cubic_hermite($t,@yparms)/($dxdt*$dxdt)
-                        +&ddt_cubic_hermite($t,@yparms)/$d2xdt2;
+                         ($dxdt*&d2dt2_cubic_hermite($t,@yparms)-&ddt_cubic_hermite($t,@yparms)*&d2dt2_cubic_hermite($t,@xparms))/
+                         ($dxdt*$dxdt*$dxdt);
                    }
                 }
             }