Difference between revisions of "Differential equations"

From JSXGraph Wiki
Jump to navigationJump to search
Line 1: Line 1:
 
<html>
 
<html>
 
<form>
 
<form>
f(t,x)=<input type="text" id="odeinput"><input type=button value="ok" onclick="doIt()">
+
f(t,x)=<input type="text" id="odeinput" value="3*x"><input type=button value="ok" onclick="doIt()">
 
</form>
 
</form>
 
</html>
 
</html>
Line 17: Line 17:
 
   var t = document.getElementById("odeinput").value;
 
   var t = document.getElementById("odeinput").value;
 
   f = new Function("t", "xx", "var x = xx[0]; var y = " + t + "; return [y]");
 
   f = new Function("t", "xx", "var x = xx[0]; var y = " + t + "; return [y]");
 +
  brd.update();
 
}
 
}
  
 
function ode() {
 
function ode() {
   return JXG.Math.Numerics.rungeKutta(JXG.Math.Numerics.predefinedButcher.Heun, [P.Y()], [0, 10], 20, f);
+
   return JXG.Math.Numerics.rungeKutta(JXG.Math.Numerics.predefinedButcher.Heun, [P.Y()], [0, 10], 100, f);
 
}
 
}
  

Revision as of 10:39, 14 July 2010

f(t,x)=

The underlying JavaScript code