Differential equations: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<html> | |||
<form> | |||
f(t,x)=<input type="text" id="odeinput"><input type=button value="ok" onclick="doIt()"> | |||
</form> | |||
</html> | |||
<jsxgraph width="500" height="500"> | <jsxgraph width="500" height="500"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-5,5,5,-5]}); | var brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-5,5,5,-5]}); | ||
var P = brd.create('point',[0,0], {name:'x_0'}); | var P = brd.create('point',[0,0], {name:'x_0'}); | ||
var f = function(t, | var f = function(t,xx) { | ||
var x = xx[0]; | |||
y = 3*x; | |||
return [y]; | |||
}; | }; | ||
function doIt() { | |||
var t = document.getElementById(odeinput).value; | |||
f = new Function("t", "xx", "var x = xx[0]; var y = " + t + "; return [y]"); | |||
} | |||
function ode() { | function ode() { |
Revision as of 09:36, 14 July 2010