Differential equations: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
<jsxgraph width="500" height="500"> | <jsxgraph width="500" height="500"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-11,11,11,-11]}); | var brd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[-11,11,11,-11]}); | ||
var N = brd.create('point',[[-7,7],[7,7],[-15,10,15]], {name:'N'}); | |||
var P = brd.create('point',[0,1], {name:'(x_0,y_0)'}); | var P = brd.create('point',[0,1], {name:'(x_0,y_0)'}); | ||
Line 15: | Line 16: | ||
function ode() { | function ode() { | ||
return JXG.Math.Numerics.rungeKutta(JXG.Math.Numerics.predefinedButcher.Heun, [P.Y()], [P.X(), P.X()+ | return JXG.Math.Numerics.rungeKutta(JXG.Math.Numerics.predefinedButcher.Heun, [P.Y()], [P.X(), P.X()+N.Value()], 200, f); | ||
} | } | ||
Line 21: | Line 22: | ||
g.updateDataArray = function() { | g.updateDataArray = function() { | ||
var data = ode(); | var data = ode(); | ||
var h = | var h = N.Value()/200; | ||
this.dataX = []; | this.dataX = []; | ||
this.dataY = []; | this.dataY = []; |
Revision as of 14:17, 14 July 2010