dots | Darstellung als Punktmenge (Standardeinstellung) |
line | Darstellung als Linienzug |
joined | Darstellung als Linienzug mit Punkten |
multi | Alle Funktionen in einer Graphik (Standardeinstellung) |
single | Jede Funktion in einer eigenen Graphik |
2d | Zweidimensionale Graphik (nur bei zweidimensionalen Problemen anwendbar) |
animation | Animierte zweidimensionale Graphik (nur bei zweidimensionalen Problemen anwendbar) |
<html>
<head>
<script src="taramath.js"></script>
</head>
<body>
<div id="plot"></div>
<script>
var d = "x1' = -x2; x2' = x1";
var z = "x(0) = (1,0)";
Ode.equidistant_grid(0.1);
Ode.solve(d, z, 5.0);
Ode.plot_options("joined"); // dots, line, joined
Ode.plot_solution("plot", 600, 300);
</script>
</body>
</html>
xxxxxxxxxx
<html>
<head>
<script src="taramath.js"></script>
</head>
<body>
<div id="plot"></div>
<script>
var d = "x1' = -x2; x2' = x1";
var z = "x(0) = (1,0)";
Ode.equidistant_grid(0.1);
Ode.solve(d, z, 5.0);
Ode.plot_options("joined", "2d");
Ode.plot_solution("plot", 400, 400);
</script>
</body>
</html>
xxxxxxxxxx
<html>
<head>
<script src="taramath.js"></script>
</head>
<body>
<div id="plot"></div>
<script>
var d1 = "x1'' = -0.02*x1 * pow(x2*x2+x1*x1, -3/2);";
var d2 = "x2'' = -0.02*x2 * pow(x2*x2+x1*x1, -3/2);";
var z1 = "x(0) = (1.2, 1.2);";
var z2 = "x'(0) = (0.05, 0);";
Ode.equidistant_grid(0.1);
Ode.solve(d1+d2, z1+z2, 40);
Ode.plot_options("animation");
Ode.plot_solution("plot", 540, 400);
</script>
</body>
</html>