Published
Edited
Apr 22, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
outPNxy = {
let p = new PN('c_P_TRAP', 1/h);
let E_0 = 10
let [R, L, C] = RLC;
let E = new PN('c_05111',E_0);// const for t > 0
let Z_C = new PN(1)
.div(p.mul(C));
let Z = Z_C.add(p.mul(L)).add(R);
let U_R = E.mul(R)
.div(Z);
let U_C = E.mul(Z_C)
.div(Z);

return ([ //data for d3chartPN()
{xy:E.asPointsList(h), nmHtml:'<b>‒‒‒</b> <i>e(t)</i>', color:`${colors_[0]}`}
, {xy:U_R.asPointsList(h), nmHtml:'‒○‒ <i>u<sub>R</sub>(t)</i>', color:`${colors_[2]}`
,pathAttrs:{"stroke-width": 1}
,symbAttrs:{symb: "circle", r:3}}
, {yh:U_C.asList(), h:h, nmHtml:'<b>‒○‒</b> <i>u<sub>C</sub>(t)</i>', color:`${colors_[1]}`
//can be ovr. in ..Attrs as "stroke": "..."
,pathAttrs:{"stroke-width": 2.5, "stroke": "DarkBlue"}
,symbAttrs:{symb: "circle", r:3}}
]);
}
Insert cell
chart_RLC = d3chartPN_(this, outPNxy, {xMinMax_:[0, 0.65], yMinMax_:[-2, 18]})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {PN} with {MAX_N} from "@andrzejq/polynomial-number-pn-class"
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
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