Public
Edited
Nov 4, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
if (startAnimation) {
mutable start = true;
}
}
Insert cell
started = {
if(start) {
await step(startPoint, eta)
mutable start = false; // Reset the flag after starting the animation
}
}
Insert cell
mutable start = false;
Insert cell
mutable optimalReached = false
Insert cell
mutable grad = 0;
Insert cell
mutable gradScale = 1;
Insert cell
mutable x_guess = startPoint;
Insert cell
mutable scaledV = 10 * v;
Insert cell
mutable v = 0;
Insert cell
function f(x) { return Math.pow(x, 4) - 3 * Math.pow(x, 3) + epsilon * Math.pow(x - 0.5, 2) + 12; }
Insert cell
function df(x) { return 4 * Math.pow(x, 3) - 9 * Math.pow(x, 2) + 2 * epsilon * (x - 0.5); }
Insert cell
epsilon= -1;
Insert cell
import {d3} from "https://d3js.org/d3.v7.min.js"
Insert cell
MathJax = require("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js").then(
() => {
return window.MathJax;
}
).catch(
(error) => {
console.error("Failed to load MathJax:", error);
return window["MathJax"];
}
);
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more