[{"data":1,"prerenderedAt":3873},["ShallowReactive",2],{"lib:\u002Fplot\u002Fexercises":3,"lib-nav:en:\u002Fplot":3841},{"id":4,"title":5,"body":6,"description":3832,"extension":3833,"group":3834,"meta":3835,"navigation":170,"order":190,"path":3837,"seo":3838,"stem":3839,"__hash__":3840},"libs\u002Fplot\u002Fexercises.md","Exercises and tests",{"type":7,"value":8,"toc":3824},"minimark",[9,13,17,25,28,42,47,69,106,110,117,1624,1639,2237,2241,2252,2827,2877,2893,2914,2939,2943,2954,3421,3435,3442,3453,3472,3476,3483,3703,3710,3750,3762,3766,3821],[10,11,5],"h1",{"id":12},"exercises-and-tests",[14,15,16],"p",{},"Write a structure once as a function of a seed, and you have an exercise for every student, every week, each with an answer key that is always right: @edubeam\u002Ffem solves it, and @edubeam\u002Fplot draws the assignment and the key from the same model.",[14,18,19,20,24],{},"Press ",[21,22,23],"strong",{},"New exercise"," below. Each press is a new seed, generated, solved and drawn in your browser.",[26,27],"exercise-generator",{},[14,29,30,31,36,37,41],{},"The demo draws the problems of two pages on this site, both built from the pieces described here: ",[32,33,35],"a",{"href":34},"\u002Fpractice","practice problems",", where a student enters the reactions and the largest moment or bar force and has them checked at once, and the ",[32,38,40],{"href":39},"\u002Fexam","exam builder",", which prints a different version of a test for every student with an answer key, and saves the figures as SVG files and the answers as CSV. Try them before you write your own.",[43,44,46],"h2",{"id":45},"how-it-works","How it works",[48,49,50,57,63],"ol",{},[51,52,53,56],"li",{},[21,54,55],{},"A seed picks the numbers."," A seeded random generator gives the same exercise for the same seed, so the seed printed on a sheet finds its key again.",[51,58,59,62],{},[21,60,61],{},"The solver works the key."," @edubeam\u002Ffem solves each structure, so the reactions and moments come from the solver, not from a formula you might get wrong.",[51,64,65,68],{},[21,66,67],{},"The plot draws both."," The sheet shows the structure with its node labels, its dimensions and the unknown reactions by name; the key gives the reactions' values and adds the diagram.",[14,70,71,72,76,77,81,82,86,87,91,92,96,97,101,102,105],{},"A few short files take you from here to a printed test: ",[32,73,75],{"href":74},"#the-generator","the generator",", ",[32,78,80],{"href":79},"#the-exercise-in-a-page","a component"," for a web page, and ",[32,83,85],{"href":84},"#print-a-test","a script"," that prints a test or ",[32,88,90],{"href":89},"#figures-for-latex-and-word","writes figures"," for LaTeX and Word. Copy them into a project that has ",[32,93,95],{"href":94},"\u002Fplot\u002Fgetting-started#install","the libraries installed","; the scripts run with ",[98,99,100],"code",{},"node"," from version 22.18, or with ",[98,103,104],{},"npx tsx"," on older versions.",[43,107,109],{"id":108},"the-generator","The generator",[14,111,112,113,116],{},"One module, ",[98,114,115],{},"exercise.ts",", turns a seed into an exercise: a beam on a pin and a roller, half the time with an overhang carrying a point load at its tip. Both are statically determinate, so every seed can be solved by hand as well as by the solver.",[118,119,124],"pre",{"className":120,"code":121,"filename":115,"language":122,"meta":123,"style":123},"language-ts shiki shiki-themes github-light github-dark","import { DofID, LinearStaticSolver } from '@edubeam\u002Ffem'\nimport { extremes, modelFromSolver, type PlotModel } from '@edubeam\u002Fplot'\n\nexport interface Exercise {\n  readonly seed: number\n  readonly statement: string\n  \u002F** The solved structure as plain data: draws both the assignment and the key *\u002F\n  readonly model: PlotModel\n  \u002F** Upward support reactions, N, and the extreme bending moments, N·m *\u002F\n  readonly key: { RA: number; RB: number; mMax: number; mMin: number }\n}\n\n\u002F** mulberry32: a tiny seeded generator, so a seed names the same exercise for good *\u002F\nconst random = (seed: number) => () => {\n  seed = (seed + 0x6d2b79f5) | 0\n  let t = Math.imul(seed ^ (seed >>> 15), seed | 1)\n  t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n  return ((t ^ (t >>> 14)) >>> 0) \u002F 4294967296\n}\n\nexport const makeExercise = (seed: number): Exercise => {\n  const r = random(seed)\n  const pick = \u003CT>(xs: readonly T[]): T => xs[Math.floor(r() * xs.length)]\n  const int = (lo: number, hi: number) => lo + Math.floor(r() * (hi - lo + 1))\n\n  \u002F\u002F A span on a pin and a roller, with an overhang half the time: determinate, so always solvable\n  const L = pick([4, 5, 6]) \u002F\u002F m\n  const c = pick([0, 0, 1, 1.5, 2]) \u002F\u002F m of overhang\n  const q = int(4, 12) \u002F\u002F kN\u002Fm on the span\n  const F = int(2, 6) * 5 \u002F\u002F kN at the tip, or at `a` from A without an overhang\n  const a = int(1, L - 1) \u002F\u002F m\n\n  const solver = new LinearStaticSolver()\n  const { domain } = solver\n  domain.createMaterial(1, { e: 210e9, g: 81e9 })\n  domain.createCrossSection(1, { a: 28.5e-4, iy: 1943e-8, h: 0.2, k: 1e32 })\n  domain.createNode('A', [0, 0, 0], [DofID.Dx, DofID.Dz])\n  domain.createNode('B', [L, 0, 0], [DofID.Dz])\n  domain.createBeam2D(1, ['A', 'B'], 1, 1)\n  const lc = solver.loadCases[0]\n  lc.createBeamElementUniformEdgeLoad(1, [0, q * 1e3], true)\n  if (c > 0) {\n    domain.createNode('C', [L + c, 0, 0])\n    domain.createBeam2D(2, ['B', 'C'], 1, 1)\n    lc.createNodalLoad('C', { [DofID.Dz]: F * 1e3 })\n  } else {\n    lc.createBeamConcentratedLoad(1, [0, F * 1e3, 0, a], true)\n  }\n  solver.solve()\n\n  const statement =\n    c > 0\n      ? `Span L = ${L} m with an overhang c = ${c} m. q = ${q} kN\u002Fm on the span, F = ${F} kN at the tip C.`\n      : `Span L = ${L} m. q = ${q} kN\u002Fm over the span, F = ${F} kN at ${a} m from A.`\n\n  \u002F\u002F The key, from the solved model: reactions (z points down, so up is minus), exact extremes of M\n  const model = modelFromSolver(solver)\n  const { reactions, members } = model.results!\n  const up = (node: string) => -(reactions.find((x) => x.node === node && x.dof === 'dz')?.value ?? 0)\n  const m = Object.values(members).flatMap((member) => extremes(member.M) ?? [])\n  const mMax = Math.max(...m.map((e) => e.max.value))\n  const mMin = Math.min(...m.map((e) => e.min.value))\n\n  return { seed, statement, model, key: { RA: up('A'), RB: up('B'), mMax, mMin } }\n}\n","ts","",[98,125,126,146,165,172,188,205,218,225,238,244,296,302,307,313,348,374,416,456,490,495,500,533,549,615,679,684,690,724,765,791,821,851,856,875,893,921,959,988,1015,1046,1064,1096,1113,1145,1174,1200,1211,1246,1252,1263,1268,1278,1288,1319,1346,1351,1357,1372,1397,1468,1515,1553,1587,1592,1619],{"__ignoreMap":123},[127,128,131,135,139,142],"span",{"class":129,"line":130},"line",1,[127,132,134],{"class":133},"szBVR","import",[127,136,138],{"class":137},"sVt8B"," { DofID, LinearStaticSolver } ",[127,140,141],{"class":133},"from",[127,143,145],{"class":144},"sZZnC"," '@edubeam\u002Ffem'\n",[127,147,149,151,154,157,160,162],{"class":129,"line":148},2,[127,150,134],{"class":133},[127,152,153],{"class":137}," { extremes, modelFromSolver, ",[127,155,156],{"class":133},"type",[127,158,159],{"class":137}," PlotModel } ",[127,161,141],{"class":133},[127,163,164],{"class":144}," '@edubeam\u002Fplot'\n",[127,166,168],{"class":129,"line":167},3,[127,169,171],{"emptyLinePlaceholder":170},true,"\n",[127,173,175,178,181,185],{"class":129,"line":174},4,[127,176,177],{"class":133},"export",[127,179,180],{"class":133}," interface",[127,182,184],{"class":183},"sScJk"," Exercise",[127,186,187],{"class":137}," {\n",[127,189,191,194,198,201],{"class":129,"line":190},5,[127,192,193],{"class":133},"  readonly",[127,195,197],{"class":196},"s4XuR"," seed",[127,199,200],{"class":133},":",[127,202,204],{"class":203},"sj4cs"," number\n",[127,206,208,210,213,215],{"class":129,"line":207},6,[127,209,193],{"class":133},[127,211,212],{"class":196}," statement",[127,214,200],{"class":133},[127,216,217],{"class":203}," string\n",[127,219,221],{"class":129,"line":220},7,[127,222,224],{"class":223},"sJ8bj","  \u002F** The solved structure as plain data: draws both the assignment and the key *\u002F\n",[127,226,228,230,233,235],{"class":129,"line":227},8,[127,229,193],{"class":133},[127,231,232],{"class":196}," model",[127,234,200],{"class":133},[127,236,237],{"class":183}," PlotModel\n",[127,239,241],{"class":129,"line":240},9,[127,242,243],{"class":223},"  \u002F** Upward support reactions, N, and the extreme bending moments, N·m *\u002F\n",[127,245,247,249,252,254,257,260,262,265,268,271,273,275,277,280,282,284,286,289,291,293],{"class":129,"line":246},10,[127,248,193],{"class":133},[127,250,251],{"class":196}," key",[127,253,200],{"class":133},[127,255,256],{"class":137}," { ",[127,258,259],{"class":196},"RA",[127,261,200],{"class":133},[127,263,264],{"class":203}," number",[127,266,267],{"class":137},"; ",[127,269,270],{"class":196},"RB",[127,272,200],{"class":133},[127,274,264],{"class":203},[127,276,267],{"class":137},[127,278,279],{"class":196},"mMax",[127,281,200],{"class":133},[127,283,264],{"class":203},[127,285,267],{"class":137},[127,287,288],{"class":196},"mMin",[127,290,200],{"class":133},[127,292,264],{"class":203},[127,294,295],{"class":137}," }\n",[127,297,299],{"class":129,"line":298},11,[127,300,301],{"class":137},"}\n",[127,303,305],{"class":129,"line":304},12,[127,306,171],{"emptyLinePlaceholder":170},[127,308,310],{"class":129,"line":309},13,[127,311,312],{"class":223},"\u002F** mulberry32: a tiny seeded generator, so a seed names the same exercise for good *\u002F\n",[127,314,316,319,322,325,328,331,333,335,338,341,344,346],{"class":129,"line":315},14,[127,317,318],{"class":133},"const",[127,320,321],{"class":183}," random",[127,323,324],{"class":133}," =",[127,326,327],{"class":137}," (",[127,329,330],{"class":196},"seed",[127,332,200],{"class":133},[127,334,264],{"class":203},[127,336,337],{"class":137},") ",[127,339,340],{"class":133},"=>",[127,342,343],{"class":137}," () ",[127,345,340],{"class":133},[127,347,187],{"class":137},[127,349,351,354,357,360,363,366,368,371],{"class":129,"line":350},15,[127,352,353],{"class":137},"  seed ",[127,355,356],{"class":133},"=",[127,358,359],{"class":137}," (seed ",[127,361,362],{"class":133},"+",[127,364,365],{"class":203}," 0x6d2b79f5",[127,367,337],{"class":137},[127,369,370],{"class":133},"|",[127,372,373],{"class":203}," 0\n",[127,375,377,380,383,385,388,391,394,397,399,402,405,408,410,413],{"class":129,"line":376},16,[127,378,379],{"class":133},"  let",[127,381,382],{"class":137}," t ",[127,384,356],{"class":133},[127,386,387],{"class":137}," Math.",[127,389,390],{"class":183},"imul",[127,392,393],{"class":137},"(seed ",[127,395,396],{"class":133},"^",[127,398,359],{"class":137},[127,400,401],{"class":133},">>>",[127,403,404],{"class":203}," 15",[127,406,407],{"class":137},"), seed ",[127,409,370],{"class":133},[127,411,412],{"class":203}," 1",[127,414,415],{"class":137},")\n",[127,417,419,422,425,427,429,431,433,436,438,441,443,446,449,451,454],{"class":129,"line":418},17,[127,420,421],{"class":137},"  t ",[127,423,424],{"class":133},"^=",[127,426,382],{"class":137},[127,428,362],{"class":133},[127,430,387],{"class":137},[127,432,390],{"class":183},[127,434,435],{"class":137},"(t ",[127,437,396],{"class":133},[127,439,440],{"class":137}," (t ",[127,442,401],{"class":133},[127,444,445],{"class":203}," 7",[127,447,448],{"class":137},"), t ",[127,450,370],{"class":133},[127,452,453],{"class":203}," 61",[127,455,415],{"class":137},[127,457,459,462,465,467,469,471,474,477,479,482,484,487],{"class":129,"line":458},18,[127,460,461],{"class":133},"  return",[127,463,464],{"class":137}," ((t ",[127,466,396],{"class":133},[127,468,440],{"class":137},[127,470,401],{"class":133},[127,472,473],{"class":203}," 14",[127,475,476],{"class":137},")) ",[127,478,401],{"class":133},[127,480,481],{"class":203}," 0",[127,483,337],{"class":137},[127,485,486],{"class":133},"\u002F",[127,488,489],{"class":203}," 4294967296\n",[127,491,493],{"class":129,"line":492},19,[127,494,301],{"class":137},[127,496,498],{"class":129,"line":497},20,[127,499,171],{"emptyLinePlaceholder":170},[127,501,503,505,508,511,513,515,517,519,521,524,526,528,531],{"class":129,"line":502},21,[127,504,177],{"class":133},[127,506,507],{"class":133}," const",[127,509,510],{"class":183}," makeExercise",[127,512,324],{"class":133},[127,514,327],{"class":137},[127,516,330],{"class":196},[127,518,200],{"class":133},[127,520,264],{"class":203},[127,522,523],{"class":137},")",[127,525,200],{"class":133},[127,527,184],{"class":183},[127,529,530],{"class":133}," =>",[127,532,187],{"class":137},[127,534,536,539,542,544,546],{"class":129,"line":535},22,[127,537,538],{"class":133},"  const",[127,540,541],{"class":203}," r",[127,543,324],{"class":133},[127,545,321],{"class":183},[127,547,548],{"class":137},"(seed)\n",[127,550,552,554,557,559,562,565,568,571,573,576,579,582,584,586,588,591,594,597,600,603,606,609,612],{"class":129,"line":551},23,[127,553,538],{"class":133},[127,555,556],{"class":183}," pick",[127,558,324],{"class":133},[127,560,561],{"class":137}," \u003C",[127,563,564],{"class":183},"T",[127,566,567],{"class":137},">(",[127,569,570],{"class":196},"xs",[127,572,200],{"class":133},[127,574,575],{"class":133}," readonly",[127,577,578],{"class":183}," T",[127,580,581],{"class":137},"[])",[127,583,200],{"class":133},[127,585,578],{"class":183},[127,587,530],{"class":133},[127,589,590],{"class":137}," xs[Math.",[127,592,593],{"class":183},"floor",[127,595,596],{"class":137},"(",[127,598,599],{"class":183},"r",[127,601,602],{"class":137},"() ",[127,604,605],{"class":133},"*",[127,607,608],{"class":137}," xs.",[127,610,611],{"class":203},"length",[127,613,614],{"class":137},")]\n",[127,616,618,620,623,625,627,630,632,634,636,639,641,643,645,647,650,652,654,656,658,660,662,664,667,670,672,674,676],{"class":129,"line":617},24,[127,619,538],{"class":133},[127,621,622],{"class":183}," int",[127,624,324],{"class":133},[127,626,327],{"class":137},[127,628,629],{"class":196},"lo",[127,631,200],{"class":133},[127,633,264],{"class":203},[127,635,76],{"class":137},[127,637,638],{"class":196},"hi",[127,640,200],{"class":133},[127,642,264],{"class":203},[127,644,337],{"class":137},[127,646,340],{"class":133},[127,648,649],{"class":137}," lo ",[127,651,362],{"class":133},[127,653,387],{"class":137},[127,655,593],{"class":183},[127,657,596],{"class":137},[127,659,599],{"class":183},[127,661,602],{"class":137},[127,663,605],{"class":133},[127,665,666],{"class":137}," (hi ",[127,668,669],{"class":133},"-",[127,671,649],{"class":137},[127,673,362],{"class":133},[127,675,412],{"class":203},[127,677,678],{"class":137},"))\n",[127,680,682],{"class":129,"line":681},25,[127,683,171],{"emptyLinePlaceholder":170},[127,685,687],{"class":129,"line":686},26,[127,688,689],{"class":223},"  \u002F\u002F A span on a pin and a roller, with an overhang half the time: determinate, so always solvable\n",[127,691,693,695,698,700,702,705,708,710,713,715,718,721],{"class":129,"line":692},27,[127,694,538],{"class":133},[127,696,697],{"class":203}," L",[127,699,324],{"class":133},[127,701,556],{"class":183},[127,703,704],{"class":137},"([",[127,706,707],{"class":203},"4",[127,709,76],{"class":137},[127,711,712],{"class":203},"5",[127,714,76],{"class":137},[127,716,717],{"class":203},"6",[127,719,720],{"class":137},"]) ",[127,722,723],{"class":223},"\u002F\u002F m\n",[127,725,727,729,732,734,736,738,741,743,745,747,750,752,755,757,760,762],{"class":129,"line":726},28,[127,728,538],{"class":133},[127,730,731],{"class":203}," c",[127,733,324],{"class":133},[127,735,556],{"class":183},[127,737,704],{"class":137},[127,739,740],{"class":203},"0",[127,742,76],{"class":137},[127,744,740],{"class":203},[127,746,76],{"class":137},[127,748,749],{"class":203},"1",[127,751,76],{"class":137},[127,753,754],{"class":203},"1.5",[127,756,76],{"class":137},[127,758,759],{"class":203},"2",[127,761,720],{"class":137},[127,763,764],{"class":223},"\u002F\u002F m of overhang\n",[127,766,768,770,773,775,777,779,781,783,786,788],{"class":129,"line":767},29,[127,769,538],{"class":133},[127,771,772],{"class":203}," q",[127,774,324],{"class":133},[127,776,622],{"class":183},[127,778,596],{"class":137},[127,780,707],{"class":203},[127,782,76],{"class":137},[127,784,785],{"class":203},"12",[127,787,337],{"class":137},[127,789,790],{"class":223},"\u002F\u002F kN\u002Fm on the span\n",[127,792,794,796,799,801,803,805,807,809,811,813,815,818],{"class":129,"line":793},30,[127,795,538],{"class":133},[127,797,798],{"class":203}," F",[127,800,324],{"class":133},[127,802,622],{"class":183},[127,804,596],{"class":137},[127,806,759],{"class":203},[127,808,76],{"class":137},[127,810,717],{"class":203},[127,812,337],{"class":137},[127,814,605],{"class":133},[127,816,817],{"class":203}," 5",[127,819,820],{"class":223}," \u002F\u002F kN at the tip, or at `a` from A without an overhang\n",[127,822,824,826,829,831,833,835,837,839,842,845,847,849],{"class":129,"line":823},31,[127,825,538],{"class":133},[127,827,828],{"class":203}," a",[127,830,324],{"class":133},[127,832,622],{"class":183},[127,834,596],{"class":137},[127,836,749],{"class":203},[127,838,76],{"class":137},[127,840,841],{"class":203},"L",[127,843,844],{"class":133}," -",[127,846,412],{"class":203},[127,848,337],{"class":137},[127,850,723],{"class":223},[127,852,854],{"class":129,"line":853},32,[127,855,171],{"emptyLinePlaceholder":170},[127,857,859,861,864,866,869,872],{"class":129,"line":858},33,[127,860,538],{"class":133},[127,862,863],{"class":203}," solver",[127,865,324],{"class":133},[127,867,868],{"class":133}," new",[127,870,871],{"class":183}," LinearStaticSolver",[127,873,874],{"class":137},"()\n",[127,876,878,880,882,885,888,890],{"class":129,"line":877},34,[127,879,538],{"class":133},[127,881,256],{"class":137},[127,883,884],{"class":203},"domain",[127,886,887],{"class":137}," } ",[127,889,356],{"class":133},[127,891,892],{"class":137}," solver\n",[127,894,896,899,902,904,906,909,912,915,918],{"class":129,"line":895},35,[127,897,898],{"class":137},"  domain.",[127,900,901],{"class":183},"createMaterial",[127,903,596],{"class":137},[127,905,749],{"class":203},[127,907,908],{"class":137},", { e: ",[127,910,911],{"class":203},"210e9",[127,913,914],{"class":137},", g: ",[127,916,917],{"class":203},"81e9",[127,919,920],{"class":137}," })\n",[127,922,924,926,929,931,933,936,939,942,945,948,951,954,957],{"class":129,"line":923},36,[127,925,898],{"class":137},[127,927,928],{"class":183},"createCrossSection",[127,930,596],{"class":137},[127,932,749],{"class":203},[127,934,935],{"class":137},", { a: ",[127,937,938],{"class":203},"28.5e-4",[127,940,941],{"class":137},", iy: ",[127,943,944],{"class":203},"1943e-8",[127,946,947],{"class":137},", h: ",[127,949,950],{"class":203},"0.2",[127,952,953],{"class":137},", k: ",[127,955,956],{"class":203},"1e32",[127,958,920],{"class":137},[127,960,962,964,967,969,972,975,977,979,981,983,985],{"class":129,"line":961},37,[127,963,898],{"class":137},[127,965,966],{"class":183},"createNode",[127,968,596],{"class":137},[127,970,971],{"class":144},"'A'",[127,973,974],{"class":137},", [",[127,976,740],{"class":203},[127,978,76],{"class":137},[127,980,740],{"class":203},[127,982,76],{"class":137},[127,984,740],{"class":203},[127,986,987],{"class":137},"], [DofID.Dx, DofID.Dz])\n",[127,989,991,993,995,997,1000,1002,1004,1006,1008,1010,1012],{"class":129,"line":990},38,[127,992,898],{"class":137},[127,994,966],{"class":183},[127,996,596],{"class":137},[127,998,999],{"class":144},"'B'",[127,1001,974],{"class":137},[127,1003,841],{"class":203},[127,1005,76],{"class":137},[127,1007,740],{"class":203},[127,1009,76],{"class":137},[127,1011,740],{"class":203},[127,1013,1014],{"class":137},"], [DofID.Dz])\n",[127,1016,1018,1020,1023,1025,1027,1029,1031,1033,1035,1038,1040,1042,1044],{"class":129,"line":1017},39,[127,1019,898],{"class":137},[127,1021,1022],{"class":183},"createBeam2D",[127,1024,596],{"class":137},[127,1026,749],{"class":203},[127,1028,974],{"class":137},[127,1030,971],{"class":144},[127,1032,76],{"class":137},[127,1034,999],{"class":144},[127,1036,1037],{"class":137},"], ",[127,1039,749],{"class":203},[127,1041,76],{"class":137},[127,1043,749],{"class":203},[127,1045,415],{"class":137},[127,1047,1049,1051,1054,1056,1059,1061],{"class":129,"line":1048},40,[127,1050,538],{"class":133},[127,1052,1053],{"class":203}," lc",[127,1055,324],{"class":133},[127,1057,1058],{"class":137}," solver.loadCases[",[127,1060,740],{"class":203},[127,1062,1063],{"class":137},"]\n",[127,1065,1067,1070,1073,1075,1077,1079,1081,1084,1086,1089,1091,1094],{"class":129,"line":1066},41,[127,1068,1069],{"class":137},"  lc.",[127,1071,1072],{"class":183},"createBeamElementUniformEdgeLoad",[127,1074,596],{"class":137},[127,1076,749],{"class":203},[127,1078,974],{"class":137},[127,1080,740],{"class":203},[127,1082,1083],{"class":137},", q ",[127,1085,605],{"class":133},[127,1087,1088],{"class":203}," 1e3",[127,1090,1037],{"class":137},[127,1092,1093],{"class":203},"true",[127,1095,415],{"class":137},[127,1097,1099,1102,1105,1108,1110],{"class":129,"line":1098},42,[127,1100,1101],{"class":133},"  if",[127,1103,1104],{"class":137}," (c ",[127,1106,1107],{"class":133},">",[127,1109,481],{"class":203},[127,1111,1112],{"class":137},") {\n",[127,1114,1116,1119,1121,1123,1126,1128,1130,1133,1136,1138,1140,1142],{"class":129,"line":1115},43,[127,1117,1118],{"class":137},"    domain.",[127,1120,966],{"class":183},[127,1122,596],{"class":137},[127,1124,1125],{"class":144},"'C'",[127,1127,974],{"class":137},[127,1129,841],{"class":203},[127,1131,1132],{"class":133}," +",[127,1134,1135],{"class":137}," c, ",[127,1137,740],{"class":203},[127,1139,76],{"class":137},[127,1141,740],{"class":203},[127,1143,1144],{"class":137},"])\n",[127,1146,1148,1150,1152,1154,1156,1158,1160,1162,1164,1166,1168,1170,1172],{"class":129,"line":1147},44,[127,1149,1118],{"class":137},[127,1151,1022],{"class":183},[127,1153,596],{"class":137},[127,1155,759],{"class":203},[127,1157,974],{"class":137},[127,1159,999],{"class":144},[127,1161,76],{"class":137},[127,1163,1125],{"class":144},[127,1165,1037],{"class":137},[127,1167,749],{"class":203},[127,1169,76],{"class":137},[127,1171,749],{"class":203},[127,1173,415],{"class":137},[127,1175,1177,1180,1183,1185,1187,1190,1193,1196,1198],{"class":129,"line":1176},45,[127,1178,1179],{"class":137},"    lc.",[127,1181,1182],{"class":183},"createNodalLoad",[127,1184,596],{"class":137},[127,1186,1125],{"class":144},[127,1188,1189],{"class":137},", { [DofID.Dz]: ",[127,1191,1192],{"class":203},"F",[127,1194,1195],{"class":133}," *",[127,1197,1088],{"class":203},[127,1199,920],{"class":137},[127,1201,1203,1206,1209],{"class":129,"line":1202},46,[127,1204,1205],{"class":137},"  } ",[127,1207,1208],{"class":133},"else",[127,1210,187],{"class":137},[127,1212,1214,1216,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237,1239,1242,1244],{"class":129,"line":1213},47,[127,1215,1179],{"class":137},[127,1217,1218],{"class":183},"createBeamConcentratedLoad",[127,1220,596],{"class":137},[127,1222,749],{"class":203},[127,1224,974],{"class":137},[127,1226,740],{"class":203},[127,1228,76],{"class":137},[127,1230,1192],{"class":203},[127,1232,1195],{"class":133},[127,1234,1088],{"class":203},[127,1236,76],{"class":137},[127,1238,740],{"class":203},[127,1240,1241],{"class":137},", a], ",[127,1243,1093],{"class":203},[127,1245,415],{"class":137},[127,1247,1249],{"class":129,"line":1248},48,[127,1250,1251],{"class":137},"  }\n",[127,1253,1255,1258,1261],{"class":129,"line":1254},49,[127,1256,1257],{"class":137},"  solver.",[127,1259,1260],{"class":183},"solve",[127,1262,874],{"class":137},[127,1264,1266],{"class":129,"line":1265},50,[127,1267,171],{"emptyLinePlaceholder":170},[127,1269,1271,1273,1275],{"class":129,"line":1270},51,[127,1272,538],{"class":133},[127,1274,212],{"class":203},[127,1276,1277],{"class":133}," =\n",[127,1279,1281,1284,1286],{"class":129,"line":1280},52,[127,1282,1283],{"class":137},"    c ",[127,1285,1107],{"class":133},[127,1287,373],{"class":203},[127,1289,1291,1294,1297,1299,1302,1305,1308,1311,1314,1316],{"class":129,"line":1290},53,[127,1292,1293],{"class":133},"      ?",[127,1295,1296],{"class":144}," `Span L = ${",[127,1298,841],{"class":203},[127,1300,1301],{"class":144},"} m with an overhang c = ${",[127,1303,1304],{"class":137},"c",[127,1306,1307],{"class":144},"} m. q = ${",[127,1309,1310],{"class":137},"q",[127,1312,1313],{"class":144},"} kN\u002Fm on the span, F = ${",[127,1315,1192],{"class":203},[127,1317,1318],{"class":144},"} kN at the tip C.`\n",[127,1320,1322,1325,1327,1329,1331,1333,1336,1338,1341,1343],{"class":129,"line":1321},54,[127,1323,1324],{"class":133},"      :",[127,1326,1296],{"class":144},[127,1328,841],{"class":203},[127,1330,1307],{"class":144},[127,1332,1310],{"class":137},[127,1334,1335],{"class":144},"} kN\u002Fm over the span, F = ${",[127,1337,1192],{"class":203},[127,1339,1340],{"class":144},"} kN at ${",[127,1342,32],{"class":137},[127,1344,1345],{"class":144},"} m from A.`\n",[127,1347,1349],{"class":129,"line":1348},55,[127,1350,171],{"emptyLinePlaceholder":170},[127,1352,1354],{"class":129,"line":1353},56,[127,1355,1356],{"class":223},"  \u002F\u002F The key, from the solved model: reactions (z points down, so up is minus), exact extremes of M\n",[127,1358,1360,1362,1364,1366,1369],{"class":129,"line":1359},57,[127,1361,538],{"class":133},[127,1363,232],{"class":203},[127,1365,324],{"class":133},[127,1367,1368],{"class":183}," modelFromSolver",[127,1370,1371],{"class":137},"(solver)\n",[127,1373,1375,1377,1379,1382,1384,1387,1389,1391,1394],{"class":129,"line":1374},58,[127,1376,538],{"class":133},[127,1378,256],{"class":137},[127,1380,1381],{"class":203},"reactions",[127,1383,76],{"class":137},[127,1385,1386],{"class":203},"members",[127,1388,887],{"class":137},[127,1390,356],{"class":133},[127,1392,1393],{"class":137}," model.results",[127,1395,1396],{"class":133},"!\n",[127,1398,1400,1402,1405,1407,1409,1411,1413,1416,1418,1420,1422,1425,1428,1431,1434,1436,1438,1441,1444,1447,1450,1453,1455,1458,1461,1464,1466],{"class":129,"line":1399},59,[127,1401,538],{"class":133},[127,1403,1404],{"class":183}," up",[127,1406,324],{"class":133},[127,1408,327],{"class":137},[127,1410,100],{"class":196},[127,1412,200],{"class":133},[127,1414,1415],{"class":203}," string",[127,1417,337],{"class":137},[127,1419,340],{"class":133},[127,1421,844],{"class":133},[127,1423,1424],{"class":137},"(reactions.",[127,1426,1427],{"class":183},"find",[127,1429,1430],{"class":137},"((",[127,1432,1433],{"class":196},"x",[127,1435,337],{"class":137},[127,1437,340],{"class":133},[127,1439,1440],{"class":137}," x.node ",[127,1442,1443],{"class":133},"===",[127,1445,1446],{"class":137}," node ",[127,1448,1449],{"class":133},"&&",[127,1451,1452],{"class":137}," x.dof ",[127,1454,1443],{"class":133},[127,1456,1457],{"class":144}," 'dz'",[127,1459,1460],{"class":137},")?.value ",[127,1462,1463],{"class":133},"??",[127,1465,481],{"class":203},[127,1467,415],{"class":137},[127,1469,1471,1473,1476,1478,1481,1484,1487,1490,1492,1495,1497,1499,1502,1505,1508,1510,1512],{"class":129,"line":1470},60,[127,1472,538],{"class":133},[127,1474,1475],{"class":203}," m",[127,1477,324],{"class":133},[127,1479,1480],{"class":137}," Object.",[127,1482,1483],{"class":183},"values",[127,1485,1486],{"class":137},"(members).",[127,1488,1489],{"class":183},"flatMap",[127,1491,1430],{"class":137},[127,1493,1494],{"class":196},"member",[127,1496,337],{"class":137},[127,1498,340],{"class":133},[127,1500,1501],{"class":183}," extremes",[127,1503,1504],{"class":137},"(member.",[127,1506,1507],{"class":203},"M",[127,1509,337],{"class":137},[127,1511,1463],{"class":133},[127,1513,1514],{"class":137}," [])\n",[127,1516,1518,1520,1523,1525,1527,1530,1532,1535,1538,1541,1543,1546,1548,1550],{"class":129,"line":1517},61,[127,1519,538],{"class":133},[127,1521,1522],{"class":203}," mMax",[127,1524,324],{"class":133},[127,1526,387],{"class":137},[127,1528,1529],{"class":183},"max",[127,1531,596],{"class":137},[127,1533,1534],{"class":133},"...",[127,1536,1537],{"class":137},"m.",[127,1539,1540],{"class":183},"map",[127,1542,1430],{"class":137},[127,1544,1545],{"class":196},"e",[127,1547,337],{"class":137},[127,1549,340],{"class":133},[127,1551,1552],{"class":137}," e.max.value))\n",[127,1554,1556,1558,1561,1563,1565,1568,1570,1572,1574,1576,1578,1580,1582,1584],{"class":129,"line":1555},62,[127,1557,538],{"class":133},[127,1559,1560],{"class":203}," mMin",[127,1562,324],{"class":133},[127,1564,387],{"class":137},[127,1566,1567],{"class":183},"min",[127,1569,596],{"class":137},[127,1571,1534],{"class":133},[127,1573,1537],{"class":137},[127,1575,1540],{"class":183},[127,1577,1430],{"class":137},[127,1579,1545],{"class":196},[127,1581,337],{"class":137},[127,1583,340],{"class":133},[127,1585,1586],{"class":137}," e.min.value))\n",[127,1588,1590],{"class":129,"line":1589},63,[127,1591,171],{"emptyLinePlaceholder":170},[127,1593,1595,1597,1600,1603,1605,1607,1610,1612,1614,1616],{"class":129,"line":1594},64,[127,1596,461],{"class":133},[127,1598,1599],{"class":137}," { seed, statement, model, key: { RA: ",[127,1601,1602],{"class":183},"up",[127,1604,596],{"class":137},[127,1606,971],{"class":144},[127,1608,1609],{"class":137},"), RB: ",[127,1611,1602],{"class":183},[127,1613,596],{"class":137},[127,1615,999],{"class":144},[127,1617,1618],{"class":137},"), mMax, mMin } }\n",[127,1620,1622],{"class":129,"line":1621},65,[127,1623,301],{"class":137},[14,1625,1626,1629,1630,1634,1635,1638],{},[98,1627,1628],{},"modelFromSolver"," reads the solved structure into a ",[32,1631,1633],{"href":1632},"\u002Fplot\u002Fmodel","plot model",": plain data with the reactions and every member's results as exact polynomials, so ",[98,1636,1637],{},"extremes"," finds the largest moments without sampling. The exercise keeps only that model; the solver is no longer needed.",[14,1640,1641,1642,1646,1647,1858,1859,1858,2004,2119,2120,2236],{},"Seed 5 gives ",[1643,1644,1645],"em",{},"\"Span L = 6 m with an overhang c = 1.5 m. q = 5 kN\u002Fm on the span, F = 25 kN at the tip C.\""," Its key: ",[127,1648,1651],{"className":1649},[1650],"katex",[127,1652,1655,1737,1763,1782,1803,1822,1848],{"className":1653,"ariaHidden":1093},[1654],"katex-html",[127,1656,1659,1664,1725,1730,1734],{"className":1657},[1658],"katex-base",[127,1660],{"className":1661,"style":1663},[1662],"katex-strut","height:0.8333em;vertical-align:-0.15em;",[127,1665,1668,1674],{"className":1666},[1667],"mord",[127,1669,1673],{"className":1670,"style":1672},[1667,1671],"mathnormal","margin-right:0.0077em;","R",[127,1675,1678],{"className":1676},[1677],"msupsub",[127,1679,1683,1716],{"className":1680},[1681,1682],"vlist-t","vlist-t2",[127,1684,1687,1711],{"className":1685},[1686],"vlist-r",[127,1688,1692],{"className":1689,"style":1691},[1690],"vlist","height:0.3283em;",[127,1693,1695,1700],{"style":1694},"top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;",[127,1696],{"className":1697,"style":1699},[1698],"pstrut","height:2.7em;",[127,1701,1707],{"className":1702},[1703,1704,1705,1706],"katex-sizing","reset-size6","size3","mtight",[127,1708,1710],{"className":1709},[1667,1671,1706],"A",[127,1712,1715],{"className":1713},[1714],"vlist-s","​",[127,1717,1719],{"className":1718},[1686],[127,1720,1723],{"className":1721,"style":1722},[1690],"height:0.15em;",[127,1724],{},[127,1726],{"className":1727,"style":1729},[1728],"mspace","margin-right:0.2778em;",[127,1731,356],{"className":1732},[1733],"mrel",[127,1735],{"className":1736,"style":1729},[1728],[127,1738,1740,1744,1748,1751,1755,1760],{"className":1739},[1658],[127,1741],{"className":1742,"style":1743},[1662],"height:1em;vertical-align:-0.25em;",[127,1745,596],{"className":1746},[1747],"mopen",[127,1749,712],{"className":1750},[1667],[127,1752],{"className":1753,"style":1754},[1728],"margin-right:0.2222em;",[127,1756,1759],{"className":1757},[1758],"mbin","⋅",[127,1761],{"className":1762,"style":1754},[1728],[127,1764,1766,1770,1773,1776,1779],{"className":1765},[1658],[127,1767],{"className":1768,"style":1769},[1662],"height:0.6444em;",[127,1771,717],{"className":1772},[1667],[127,1774],{"className":1775,"style":1754},[1728],[127,1777,1759],{"className":1778},[1758],[127,1780],{"className":1781,"style":1754},[1728],[127,1783,1785,1789,1793,1796,1800],{"className":1784},[1658],[127,1786],{"className":1787,"style":1788},[1662],"height:0.7278em;vertical-align:-0.0833em;",[127,1790,1792],{"className":1791},[1667],"3",[127,1794],{"className":1795,"style":1754},[1728],[127,1797,1799],{"className":1798},[1758],"−",[127,1801],{"className":1802,"style":1754},[1728],[127,1804,1806,1809,1813,1816,1819],{"className":1805},[1658],[127,1807],{"className":1808,"style":1769},[1662],[127,1810,1812],{"className":1811},[1667],"25",[127,1814],{"className":1815,"style":1754},[1728],[127,1817,1759],{"className":1818},[1758],[127,1820],{"className":1821,"style":1754},[1728],[127,1823,1825,1828,1831,1835,1839,1842,1845],{"className":1824},[1658],[127,1826],{"className":1827,"style":1743},[1662],[127,1829,754],{"className":1830},[1667],[127,1832,523],{"className":1833},[1834],"mclose",[127,1836,1838],{"className":1837},[1667],"\u002F6",[127,1840],{"className":1841,"style":1729},[1728],[127,1843,356],{"className":1844},[1733],[127,1846],{"className":1847,"style":1729},[1728],[127,1849,1851,1854],{"className":1850},[1658],[127,1852],{"className":1853,"style":1769},[1662],[127,1855,1857],{"className":1856},[1667],"8.75"," kN, ",[127,1860,1862],{"className":1861},[1650],[127,1863,1865,1922,1940,1958,1976,1994],{"className":1864,"ariaHidden":1093},[1654],[127,1866,1868,1871,1913,1916,1919],{"className":1867},[1658],[127,1869],{"className":1870,"style":1663},[1662],[127,1872,1874,1877],{"className":1873},[1667],[127,1875,1673],{"className":1876,"style":1672},[1667,1671],[127,1878,1880],{"className":1879},[1677],[127,1881,1883,1905],{"className":1882},[1681,1682],[127,1884,1886,1902],{"className":1885},[1686],[127,1887,1889],{"className":1888,"style":1691},[1690],[127,1890,1891,1894],{"style":1694},[127,1892],{"className":1893,"style":1699},[1698],[127,1895,1897],{"className":1896},[1703,1704,1705,1706],[127,1898,1901],{"className":1899,"style":1900},[1667,1671,1706],"margin-right:0.0502em;","B",[127,1903,1715],{"className":1904},[1714],[127,1906,1908],{"className":1907},[1686],[127,1909,1911],{"className":1910,"style":1722},[1690],[127,1912],{},[127,1914],{"className":1915,"style":1729},[1728],[127,1917,356],{"className":1918},[1733],[127,1920],{"className":1921,"style":1729},[1728],[127,1923,1925,1928,1931,1934,1937],{"className":1924},[1658],[127,1926],{"className":1927,"style":1769},[1662],[127,1929,712],{"className":1930},[1667],[127,1932],{"className":1933,"style":1754},[1728],[127,1935,1759],{"className":1936},[1758],[127,1938],{"className":1939,"style":1754},[1728],[127,1941,1943,1946,1949,1952,1955],{"className":1942},[1658],[127,1944],{"className":1945,"style":1788},[1662],[127,1947,717],{"className":1948},[1667],[127,1950],{"className":1951,"style":1754},[1728],[127,1953,362],{"className":1954},[1758],[127,1956],{"className":1957,"style":1754},[1728],[127,1959,1961,1964,1967,1970,1973],{"className":1960},[1658],[127,1962],{"className":1963,"style":1788},[1662],[127,1965,1812],{"className":1966},[1667],[127,1968],{"className":1969,"style":1754},[1728],[127,1971,1799],{"className":1972},[1758],[127,1974],{"className":1975,"style":1754},[1728],[127,1977,1979,1982,1985,1988,1991],{"className":1978},[1658],[127,1980],{"className":1981,"style":1769},[1662],[127,1983,1857],{"className":1984},[1667],[127,1986],{"className":1987,"style":1729},[1728],[127,1989,356],{"className":1990},[1733],[127,1992],{"className":1993,"style":1729},[1728],[127,1995,1997,2000],{"className":1996},[1658],[127,1998],{"className":1999,"style":1769},[1662],[127,2001,2003],{"className":2002},[1667],"46.25",[127,2005,2007],{"className":2006},[1650],[127,2008,2010,2067,2088,2106],{"className":2009,"ariaHidden":1093},[1654],[127,2011,2013,2016,2058,2061,2064],{"className":2012},[1658],[127,2014],{"className":2015,"style":1663},[1662],[127,2017,2019,2023],{"className":2018},[1667],[127,2020,1507],{"className":2021,"style":2022},[1667,1671],"margin-right:0.109em;",[127,2024,2026],{"className":2025},[1677],[127,2027,2029,2050],{"className":2028},[1681,1682],[127,2030,2032,2047],{"className":2031},[1686],[127,2033,2035],{"className":2034,"style":1691},[1690],[127,2036,2038,2041],{"style":2037},"top:-2.55em;margin-left:-0.109em;margin-right:0.05em;",[127,2039],{"className":2040,"style":1699},[1698],[127,2042,2044],{"className":2043},[1703,1704,1705,1706],[127,2045,1901],{"className":2046,"style":1900},[1667,1671,1706],[127,2048,1715],{"className":2049},[1714],[127,2051,2053],{"className":2052},[1686],[127,2054,2056],{"className":2055,"style":1722},[1690],[127,2057],{},[127,2059],{"className":2060,"style":1729},[1728],[127,2062,356],{"className":2063},[1733],[127,2065],{"className":2066,"style":1729},[1728],[127,2068,2070,2073,2076,2079,2082,2085],{"className":2069},[1658],[127,2071],{"className":2072,"style":1788},[1662],[127,2074,1799],{"className":2075},[1667],[127,2077,1812],{"className":2078},[1667],[127,2080],{"className":2081,"style":1754},[1728],[127,2083,1759],{"className":2084},[1758],[127,2086],{"className":2087,"style":1754},[1728],[127,2089,2091,2094,2097,2100,2103],{"className":2090},[1658],[127,2092],{"className":2093,"style":1769},[1662],[127,2095,754],{"className":2096},[1667],[127,2098],{"className":2099,"style":1729},[1728],[127,2101,356],{"className":2102},[1733],[127,2104],{"className":2105,"style":1729},[1728],[127,2107,2109,2112,2115],{"className":2108},[1658],[127,2110],{"className":2111,"style":1788},[1662],[127,2113,1799],{"className":2114},[1667],[127,2116,2118],{"className":2117},[1667],"37.5"," kNm over the support, and ",[127,2121,2123],{"className":2122},[1650],[127,2124,2126,2145,2205,2226],{"className":2125,"ariaHidden":1093},[1654],[127,2127,2129,2133,2136,2139,2142],{"className":2128},[1658],[127,2130],{"className":2131,"style":2132},[1662],"height:0.6833em;",[127,2134,1507],{"className":2135,"style":2022},[1667,1671],[127,2137],{"className":2138,"style":1729},[1728],[127,2140,356],{"className":2141},[1733],[127,2143],{"className":2144,"style":1729},[1728],[127,2146,2148,2152,2156,2187,2190,2193,2196,2199,2202],{"className":2147},[1658],[127,2149],{"className":2150,"style":2151},[1662],"height:1.0641em;vertical-align:-0.25em;",[127,2153,2155],{"className":2154},[1667],"8.7",[127,2157,2159,2162],{"className":2158},[1667],[127,2160,712],{"className":2161},[1667],[127,2163,2165],{"className":2164},[1677],[127,2166,2168],{"className":2167},[1681],[127,2169,2171],{"className":2170},[1686],[127,2172,2175],{"className":2173,"style":2174},[1690],"height:0.8141em;",[127,2176,2178,2181],{"style":2177},"top:-3.063em;margin-right:0.05em;",[127,2179],{"className":2180,"style":1699},[1698],[127,2182,2184],{"className":2183},[1703,1704,1705,1706],[127,2185,759],{"className":2186},[1667,1706],[127,2188,486],{"className":2189},[1667],[127,2191,596],{"className":2192},[1747],[127,2194,759],{"className":2195},[1667],[127,2197],{"className":2198,"style":1754},[1728],[127,2200,1759],{"className":2201},[1758],[127,2203],{"className":2204,"style":1754},[1728],[127,2206,2208,2211,2214,2217,2220,2223],{"className":2207},[1658],[127,2209],{"className":2210,"style":1743},[1662],[127,2212,712],{"className":2213},[1667],[127,2215,523],{"className":2216},[1834],[127,2218],{"className":2219,"style":1729},[1728],[127,2221,356],{"className":2222},[1733],[127,2224],{"className":2225,"style":1729},[1728],[127,2227,2229,2232],{"className":2228},[1658],[127,2230],{"className":2231,"style":1769},[1662],[127,2233,2235],{"className":2234},[1667],"7.66"," kNm in the span, where the shear is zero. The solver agrees to the last digit.",[43,2238,2240],{"id":2239},"the-exercise-in-a-page","On a web page",[14,2242,2243,2244,2247,2248,2251],{},"A component, ",[98,2245,2246],{},"ExerciseCard.vue",", draws the assignment, or with ",[98,2249,2250],{},"answers"," the key:",[118,2253,2257],{"className":2254,"code":2255,"filename":2246,"language":2256,"meta":123,"style":123},"language-vue shiki shiki-themes github-light github-dark","\u003Cscript setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { formatQuantity, KN_UNITS, StructurePlot, type PlotLayer } from '@edubeam\u002Fplot'\nimport { makeExercise } from '.\u002Fexercise'\n\nconst props = defineProps\u003C{ seed: number; answers?: boolean }>()\nconst exercise = computed(() => makeExercise(props.seed))\n\nconst sheet: PlotLayer[] = ['members', 'supports', 'loads', 'reactions', 'nodeLabels', 'dimensions']\nconst key: PlotLayer[] = ['members', 'supports', 'reactions', 'M']\nconst twoDecimals = new Intl.NumberFormat('en', { maximumFractionDigits: 2 })\nconst kN = (si: number) => formatQuantity(si, KN_UNITS.force, twoDecimals)\nconst kNm = (si: number) => formatQuantity(si, KN_UNITS.moment, twoDecimals)\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Carticle>\n    \u003Ch3>Exercise {{ seed }}\u003C\u002Fh3>\n    \u003Cp>{{ exercise.statement }} Find the reactions and draw the bending moment diagram.\u003C\u002Fp>\n    \u003CStructurePlot\n      :model=\"exercise.model\"\n      :layers=\"answers ? key : sheet\"\n      :reserve=\"[...sheet, ...key]\"\n      :reaction-labels=\"answers ? 'values' : 'names'\"\n      :reserve-reaction-labels=\"['names', 'values']\"\n    \u002F>\n    \u003Cp v-if=\"answers\">\n      R\u003Csub>A\u003C\u002Fsub> = {{ kN(exercise.key.RA) }}, R\u003Csub>B\u003C\u002Fsub> = {{ kN(exercise.key.RB) }},\n      M from {{ kNm(exercise.key.mMin) }} to {{ kNm(exercise.key.mMax) }}\n    \u003C\u002Fp>\n  \u003C\u002Farticle>\n\u003C\u002Ftemplate>\n","vue",[98,2258,2259,2282,2294,2310,2322,2326,2360,2382,2386,2436,2469,2498,2532,2562,2571,2575,2584,2594,2609,2622,2629,2647,2673,2699,2723,2749,2754,2770,2796,2801,2810,2819],{"__ignoreMap":123},[127,2260,2261,2264,2268,2271,2274,2276,2279],{"class":129,"line":130},[127,2262,2263],{"class":137},"\u003C",[127,2265,2267],{"class":2266},"s9eBZ","script",[127,2269,2270],{"class":183}," setup",[127,2272,2273],{"class":183}," lang",[127,2275,356],{"class":137},[127,2277,2278],{"class":144},"\"ts\"",[127,2280,2281],{"class":137},">\n",[127,2283,2284,2286,2289,2291],{"class":129,"line":148},[127,2285,134],{"class":133},[127,2287,2288],{"class":137}," { computed } ",[127,2290,141],{"class":133},[127,2292,2293],{"class":144}," 'vue'\n",[127,2295,2296,2298,2301,2303,2306,2308],{"class":129,"line":167},[127,2297,134],{"class":133},[127,2299,2300],{"class":137}," { formatQuantity, KN_UNITS, StructurePlot, ",[127,2302,156],{"class":133},[127,2304,2305],{"class":137}," PlotLayer } ",[127,2307,141],{"class":133},[127,2309,164],{"class":144},[127,2311,2312,2314,2317,2319],{"class":129,"line":174},[127,2313,134],{"class":133},[127,2315,2316],{"class":137}," { makeExercise } ",[127,2318,141],{"class":133},[127,2320,2321],{"class":144}," '.\u002Fexercise'\n",[127,2323,2324],{"class":129,"line":190},[127,2325,171],{"emptyLinePlaceholder":170},[127,2327,2328,2330,2333,2335,2338,2341,2343,2345,2347,2349,2351,2354,2357],{"class":129,"line":207},[127,2329,318],{"class":133},[127,2331,2332],{"class":203}," props",[127,2334,324],{"class":133},[127,2336,2337],{"class":183}," defineProps",[127,2339,2340],{"class":137},"\u003C{ ",[127,2342,330],{"class":196},[127,2344,200],{"class":133},[127,2346,264],{"class":203},[127,2348,267],{"class":137},[127,2350,2250],{"class":196},[127,2352,2353],{"class":133},"?:",[127,2355,2356],{"class":203}," boolean",[127,2358,2359],{"class":137}," }>()\n",[127,2361,2362,2364,2367,2369,2372,2375,2377,2379],{"class":129,"line":220},[127,2363,318],{"class":133},[127,2365,2366],{"class":203}," exercise",[127,2368,324],{"class":133},[127,2370,2371],{"class":183}," computed",[127,2373,2374],{"class":137},"(() ",[127,2376,340],{"class":133},[127,2378,510],{"class":183},[127,2380,2381],{"class":137},"(props.seed))\n",[127,2383,2384],{"class":129,"line":227},[127,2385,171],{"emptyLinePlaceholder":170},[127,2387,2388,2390,2393,2395,2398,2401,2403,2406,2409,2411,2414,2416,2419,2421,2424,2426,2429,2431,2434],{"class":129,"line":240},[127,2389,318],{"class":133},[127,2391,2392],{"class":203}," sheet",[127,2394,200],{"class":133},[127,2396,2397],{"class":183}," PlotLayer",[127,2399,2400],{"class":137},"[] ",[127,2402,356],{"class":133},[127,2404,2405],{"class":137}," [",[127,2407,2408],{"class":144},"'members'",[127,2410,76],{"class":137},[127,2412,2413],{"class":144},"'supports'",[127,2415,76],{"class":137},[127,2417,2418],{"class":144},"'loads'",[127,2420,76],{"class":137},[127,2422,2423],{"class":144},"'reactions'",[127,2425,76],{"class":137},[127,2427,2428],{"class":144},"'nodeLabels'",[127,2430,76],{"class":137},[127,2432,2433],{"class":144},"'dimensions'",[127,2435,1063],{"class":137},[127,2437,2438,2440,2442,2444,2446,2448,2450,2452,2454,2456,2458,2460,2462,2464,2467],{"class":129,"line":246},[127,2439,318],{"class":133},[127,2441,251],{"class":203},[127,2443,200],{"class":133},[127,2445,2397],{"class":183},[127,2447,2400],{"class":137},[127,2449,356],{"class":133},[127,2451,2405],{"class":137},[127,2453,2408],{"class":144},[127,2455,76],{"class":137},[127,2457,2413],{"class":144},[127,2459,76],{"class":137},[127,2461,2423],{"class":144},[127,2463,76],{"class":137},[127,2465,2466],{"class":144},"'M'",[127,2468,1063],{"class":137},[127,2470,2471,2473,2476,2478,2480,2483,2486,2488,2491,2494,2496],{"class":129,"line":298},[127,2472,318],{"class":133},[127,2474,2475],{"class":203}," twoDecimals",[127,2477,324],{"class":133},[127,2479,868],{"class":133},[127,2481,2482],{"class":137}," Intl.",[127,2484,2485],{"class":183},"NumberFormat",[127,2487,596],{"class":137},[127,2489,2490],{"class":144},"'en'",[127,2492,2493],{"class":137},", { maximumFractionDigits: ",[127,2495,759],{"class":203},[127,2497,920],{"class":137},[127,2499,2500,2502,2505,2507,2509,2512,2514,2516,2518,2520,2523,2526,2529],{"class":129,"line":304},[127,2501,318],{"class":133},[127,2503,2504],{"class":183}," kN",[127,2506,324],{"class":133},[127,2508,327],{"class":137},[127,2510,2511],{"class":196},"si",[127,2513,200],{"class":133},[127,2515,264],{"class":203},[127,2517,337],{"class":137},[127,2519,340],{"class":133},[127,2521,2522],{"class":183}," formatQuantity",[127,2524,2525],{"class":137},"(si, ",[127,2527,2528],{"class":203},"KN_UNITS",[127,2530,2531],{"class":137},".force, twoDecimals)\n",[127,2533,2534,2536,2539,2541,2543,2545,2547,2549,2551,2553,2555,2557,2559],{"class":129,"line":309},[127,2535,318],{"class":133},[127,2537,2538],{"class":183}," kNm",[127,2540,324],{"class":133},[127,2542,327],{"class":137},[127,2544,2511],{"class":196},[127,2546,200],{"class":133},[127,2548,264],{"class":203},[127,2550,337],{"class":137},[127,2552,340],{"class":133},[127,2554,2522],{"class":183},[127,2556,2525],{"class":137},[127,2558,2528],{"class":203},[127,2560,2561],{"class":137},".moment, twoDecimals)\n",[127,2563,2564,2567,2569],{"class":129,"line":315},[127,2565,2566],{"class":137},"\u003C\u002F",[127,2568,2267],{"class":2266},[127,2570,2281],{"class":137},[127,2572,2573],{"class":129,"line":350},[127,2574,171],{"emptyLinePlaceholder":170},[127,2576,2577,2579,2582],{"class":129,"line":376},[127,2578,2263],{"class":137},[127,2580,2581],{"class":2266},"template",[127,2583,2281],{"class":137},[127,2585,2586,2589,2592],{"class":129,"line":418},[127,2587,2588],{"class":137},"  \u003C",[127,2590,2591],{"class":2266},"article",[127,2593,2281],{"class":137},[127,2595,2596,2599,2602,2605,2607],{"class":129,"line":458},[127,2597,2598],{"class":137},"    \u003C",[127,2600,2601],{"class":2266},"h3",[127,2603,2604],{"class":137},">Exercise {{ seed }}\u003C\u002F",[127,2606,2601],{"class":2266},[127,2608,2281],{"class":137},[127,2610,2611,2613,2615,2618,2620],{"class":129,"line":492},[127,2612,2598],{"class":137},[127,2614,14],{"class":2266},[127,2616,2617],{"class":137},">{{ exercise.statement }} Find the reactions and draw the bending moment diagram.\u003C\u002F",[127,2619,14],{"class":2266},[127,2621,2281],{"class":137},[127,2623,2624,2626],{"class":129,"line":497},[127,2625,2598],{"class":137},[127,2627,2628],{"class":2266},"StructurePlot\n",[127,2630,2631,2633,2636,2638,2641,2644],{"class":129,"line":502},[127,2632,1324],{"class":137},[127,2634,2635],{"class":183},"model",[127,2637,356],{"class":137},[127,2639,2640],{"class":144},"\"",[127,2642,2643],{"class":137},"exercise.model",[127,2645,2646],{"class":144},"\"\n",[127,2648,2649,2651,2654,2656,2658,2661,2664,2667,2669,2671],{"class":129,"line":535},[127,2650,1324],{"class":137},[127,2652,2653],{"class":183},"layers",[127,2655,356],{"class":137},[127,2657,2640],{"class":144},[127,2659,2660],{"class":137},"answers ",[127,2662,2663],{"class":133},"?",[127,2665,2666],{"class":137}," key ",[127,2668,200],{"class":133},[127,2670,2392],{"class":137},[127,2672,2646],{"class":144},[127,2674,2675,2677,2680,2682,2684,2687,2689,2692,2694,2697],{"class":129,"line":551},[127,2676,1324],{"class":137},[127,2678,2679],{"class":183},"reserve",[127,2681,356],{"class":137},[127,2683,2640],{"class":144},[127,2685,2686],{"class":137},"[",[127,2688,1534],{"class":133},[127,2690,2691],{"class":137},"sheet, ",[127,2693,1534],{"class":133},[127,2695,2696],{"class":137},"key]",[127,2698,2646],{"class":144},[127,2700,2701,2703,2706,2708,2710,2712,2714,2717,2720],{"class":129,"line":617},[127,2702,1324],{"class":137},[127,2704,2705],{"class":183},"reaction-labels",[127,2707,356],{"class":137},[127,2709,2640],{"class":144},[127,2711,2660],{"class":137},[127,2713,2663],{"class":133},[127,2715,2716],{"class":144}," 'values'",[127,2718,2719],{"class":133}," :",[127,2721,2722],{"class":144}," 'names'\"\n",[127,2724,2725,2727,2730,2732,2734,2736,2739,2741,2744,2747],{"class":129,"line":681},[127,2726,1324],{"class":137},[127,2728,2729],{"class":183},"reserve-reaction-labels",[127,2731,356],{"class":137},[127,2733,2640],{"class":144},[127,2735,2686],{"class":137},[127,2737,2738],{"class":144},"'names'",[127,2740,76],{"class":137},[127,2742,2743],{"class":144},"'values'",[127,2745,2746],{"class":137},"]",[127,2748,2646],{"class":144},[127,2750,2751],{"class":129,"line":686},[127,2752,2753],{"class":137},"    \u002F>\n",[127,2755,2756,2758,2760,2763,2765,2768],{"class":129,"line":692},[127,2757,2598],{"class":137},[127,2759,14],{"class":2266},[127,2761,2762],{"class":183}," v-if",[127,2764,356],{"class":137},[127,2766,2767],{"class":144},"\"answers\"",[127,2769,2281],{"class":137},[127,2771,2772,2775,2778,2781,2783,2786,2788,2791,2793],{"class":129,"line":726},[127,2773,2774],{"class":137},"      R\u003C",[127,2776,2777],{"class":2266},"sub",[127,2779,2780],{"class":137},">A\u003C\u002F",[127,2782,2777],{"class":2266},[127,2784,2785],{"class":137},"> = {{ kN(exercise.key.RA) }}, R\u003C",[127,2787,2777],{"class":2266},[127,2789,2790],{"class":137},">B\u003C\u002F",[127,2792,2777],{"class":2266},[127,2794,2795],{"class":137},"> = {{ kN(exercise.key.RB) }},\n",[127,2797,2798],{"class":129,"line":767},[127,2799,2800],{"class":137},"      M from {{ kNm(exercise.key.mMin) }} to {{ kNm(exercise.key.mMax) }}\n",[127,2802,2803,2806,2808],{"class":129,"line":793},[127,2804,2805],{"class":137},"    \u003C\u002F",[127,2807,14],{"class":2266},[127,2809,2281],{"class":137},[127,2811,2812,2815,2817],{"class":129,"line":823},[127,2813,2814],{"class":137},"  \u003C\u002F",[127,2816,2591],{"class":2266},[127,2818,2281],{"class":137},[127,2820,2821,2823,2825],{"class":129,"line":853},[127,2822,2566],{"class":137},[127,2824,2581],{"class":2266},[127,2826,2281],{"class":137},[118,2828,2830],{"className":2254,"code":2829,"language":2256,"meta":123,"style":123},"\u003CExerciseCard :seed=\"5\" \u002F>\n\u003CExerciseCard :seed=\"5\" answers \u002F>\n",[98,2831,2832,2854],{"__ignoreMap":123},[127,2833,2834,2836,2839,2841,2843,2845,2847,2849,2851],{"class":129,"line":130},[127,2835,2263],{"class":137},[127,2837,2838],{"class":2266},"ExerciseCard",[127,2840,2719],{"class":137},[127,2842,330],{"class":183},[127,2844,356],{"class":137},[127,2846,2640],{"class":144},[127,2848,712],{"class":203},[127,2850,2640],{"class":144},[127,2852,2853],{"class":137}," \u002F>\n",[127,2855,2856,2858,2860,2862,2864,2866,2868,2870,2872,2875],{"class":129,"line":148},[127,2857,2263],{"class":137},[127,2859,2838],{"class":2266},[127,2861,2719],{"class":137},[127,2863,330],{"class":183},[127,2865,356],{"class":137},[127,2867,2640],{"class":144},[127,2869,712],{"class":203},[127,2871,2640],{"class":144},[127,2873,2874],{"class":183}," answers",[127,2876,2853],{"class":137},[14,2878,2879,2880,2888,2889,2892],{},"The second card ends with ",[1643,2881,1673,2882,2884,2885,2887],{},[2777,2883,1710],{}," = 8.75 kN, R",[2777,2886,1901],{}," = 46.25 kN, M from −37.5 kNm to 7.66 kNm",". ",[98,2890,2891],{},"formatQuantity"," writes the unit and a true minus sign, as the plot does.",[14,2894,2895,2896,2899,2900,76,2904,76,2909,2913],{},"On the sheet, ",[98,2897,2898],{},"reaction-labels=\"names\""," draws the reactions as the unknowns: an arrow for every direction a support holds, pointing the way it counts as positive (to the right, upwards, counter-clockwise), named ",[1643,2901,1710,2902],{},[2777,2903,1433],{},[1643,2905,1710,2906],{},[2777,2907,2908],{},"z",[1643,2910,1507,2911],{},[2777,2912,1710],{}," instead of sized. The sign of every answer is then defined on the drawing: a reaction that acts the other way is negative. The key writes the values.",[14,2915,2916,2918,2919,2921,2922,2925,2926,2930,2931,2933,2934,2938],{},[98,2917,2679],{}," lays out the layers of both views from the start, so switching ",[98,2920,2250],{}," on, with a ",[1643,2923,2924],{},"Show the solution"," button for self-study, fades the diagram in where it belongs (",[32,2927,2929],{"href":2928},"\u002Fplot\u002Fstructure-plot#figures-that-build-up","Figures that build up","). ",[98,2932,2729],{}," does the same for the reactions, so the beam stays put while their names turn into values: see ",[32,2935,2937],{"href":2936},"\u002Fplot\u002Fstructure-plot#reactions-as-unknowns","Reactions as unknowns",".",[43,2940,2942],{"id":2941},"print-a-test","A printed test",[14,2944,2945,2946,2949,2950,2953],{},"For a written test, a Node script, ",[98,2947,2948],{},"print-test.ts",", writes one page per student and the keys after them. ",[98,2951,2952],{},"structureSvg"," turns each model into SVG text, so the script needs neither Vue nor a browser:",[118,2955,2957],{"className":120,"code":2956,"filename":2948,"language":122,"meta":123,"style":123},"import { writeFileSync } from 'node:fs'\nimport { structureSvg, type PlotLayer } from '@edubeam\u002Fplot'\nimport { makeExercise } from '.\u002Fexercise.ts'\n\nconst students = ['Ada', 'Ben', 'Cleo']\nconst exercises = students.map((_, i) => makeExercise(1000 + i)) \u002F\u002F seeds 1000, 1001, …\n\nconst sheet: PlotLayer[] = ['members', 'supports', 'loads', 'reactions', 'nodeLabels', 'dimensions']\nconst key: PlotLayer[] = ['members', 'supports', 'reactions', 'M']\nconst task = 'Find the reactions and draw the bending moment diagram.'\n\nconst pages = [\n  ...exercises.map((e, i) => `\u003Ch2>${students[i]}, exercise ${e.seed}\u003C\u002Fh2>\n    \u003Cp>${e.statement} ${task}\u003C\u002Fp>${structureSvg(e.model, { layers: sheet, reactionLabels: 'names' })}`),\n  ...exercises.map((e) => `\u003Ch2>Key, exercise ${e.seed}\u003C\u002Fh2>\n    ${structureSvg(e.model, { layers: key })}`),\n]\n\nconst style = `body { font: 15px\u002F1.5 system-ui, sans-serif; max-width: 640px; margin: 2rem auto }\n  section { break-after: page }`\nwriteFileSync('test.html', `\u003C!doctype html>\u003Cmeta charset=\"utf-8\">\u003Ctitle>Test\u003C\u002Ftitle>\n  \u003Cstyle>${style}\u003C\u002Fstyle>${pages.map((page) => `\u003Csection>${page}\u003C\u002Fsection>`).join('\\n')}`)\n",[98,2958,2959,2971,2986,2997,3001,3027,3070,3074,3114,3146,3158,3162,3174,3220,3271,3298,3324,3328,3332,3344,3349,3364],{"__ignoreMap":123},[127,2960,2961,2963,2966,2968],{"class":129,"line":130},[127,2962,134],{"class":133},[127,2964,2965],{"class":137}," { writeFileSync } ",[127,2967,141],{"class":133},[127,2969,2970],{"class":144}," 'node:fs'\n",[127,2972,2973,2975,2978,2980,2982,2984],{"class":129,"line":148},[127,2974,134],{"class":133},[127,2976,2977],{"class":137}," { structureSvg, ",[127,2979,156],{"class":133},[127,2981,2305],{"class":137},[127,2983,141],{"class":133},[127,2985,164],{"class":144},[127,2987,2988,2990,2992,2994],{"class":129,"line":167},[127,2989,134],{"class":133},[127,2991,2316],{"class":137},[127,2993,141],{"class":133},[127,2995,2996],{"class":144}," '.\u002Fexercise.ts'\n",[127,2998,2999],{"class":129,"line":174},[127,3000,171],{"emptyLinePlaceholder":170},[127,3002,3003,3005,3008,3010,3012,3015,3017,3020,3022,3025],{"class":129,"line":190},[127,3004,318],{"class":133},[127,3006,3007],{"class":203}," students",[127,3009,324],{"class":133},[127,3011,2405],{"class":137},[127,3013,3014],{"class":144},"'Ada'",[127,3016,76],{"class":137},[127,3018,3019],{"class":144},"'Ben'",[127,3021,76],{"class":137},[127,3023,3024],{"class":144},"'Cleo'",[127,3026,1063],{"class":137},[127,3028,3029,3031,3034,3036,3039,3041,3043,3046,3048,3051,3053,3055,3057,3059,3062,3064,3067],{"class":129,"line":207},[127,3030,318],{"class":133},[127,3032,3033],{"class":203}," exercises",[127,3035,324],{"class":133},[127,3037,3038],{"class":137}," students.",[127,3040,1540],{"class":183},[127,3042,1430],{"class":137},[127,3044,3045],{"class":196},"_",[127,3047,76],{"class":137},[127,3049,3050],{"class":196},"i",[127,3052,337],{"class":137},[127,3054,340],{"class":133},[127,3056,510],{"class":183},[127,3058,596],{"class":137},[127,3060,3061],{"class":203},"1000",[127,3063,1132],{"class":133},[127,3065,3066],{"class":137}," i)) ",[127,3068,3069],{"class":223},"\u002F\u002F seeds 1000, 1001, …\n",[127,3071,3072],{"class":129,"line":220},[127,3073,171],{"emptyLinePlaceholder":170},[127,3075,3076,3078,3080,3082,3084,3086,3088,3090,3092,3094,3096,3098,3100,3102,3104,3106,3108,3110,3112],{"class":129,"line":227},[127,3077,318],{"class":133},[127,3079,2392],{"class":203},[127,3081,200],{"class":133},[127,3083,2397],{"class":183},[127,3085,2400],{"class":137},[127,3087,356],{"class":133},[127,3089,2405],{"class":137},[127,3091,2408],{"class":144},[127,3093,76],{"class":137},[127,3095,2413],{"class":144},[127,3097,76],{"class":137},[127,3099,2418],{"class":144},[127,3101,76],{"class":137},[127,3103,2423],{"class":144},[127,3105,76],{"class":137},[127,3107,2428],{"class":144},[127,3109,76],{"class":137},[127,3111,2433],{"class":144},[127,3113,1063],{"class":137},[127,3115,3116,3118,3120,3122,3124,3126,3128,3130,3132,3134,3136,3138,3140,3142,3144],{"class":129,"line":240},[127,3117,318],{"class":133},[127,3119,251],{"class":203},[127,3121,200],{"class":133},[127,3123,2397],{"class":183},[127,3125,2400],{"class":137},[127,3127,356],{"class":133},[127,3129,2405],{"class":137},[127,3131,2408],{"class":144},[127,3133,76],{"class":137},[127,3135,2413],{"class":144},[127,3137,76],{"class":137},[127,3139,2423],{"class":144},[127,3141,76],{"class":137},[127,3143,2466],{"class":144},[127,3145,1063],{"class":137},[127,3147,3148,3150,3153,3155],{"class":129,"line":246},[127,3149,318],{"class":133},[127,3151,3152],{"class":203}," task",[127,3154,324],{"class":133},[127,3156,3157],{"class":144}," 'Find the reactions and draw the bending moment diagram.'\n",[127,3159,3160],{"class":129,"line":298},[127,3161,171],{"emptyLinePlaceholder":170},[127,3163,3164,3166,3169,3171],{"class":129,"line":304},[127,3165,318],{"class":133},[127,3167,3168],{"class":203}," pages",[127,3170,324],{"class":133},[127,3172,3173],{"class":137}," [\n",[127,3175,3176,3179,3182,3184,3186,3188,3190,3192,3194,3196,3199,3202,3204,3206,3208,3211,3213,3215,3217],{"class":129,"line":309},[127,3177,3178],{"class":133},"  ...",[127,3180,3181],{"class":137},"exercises.",[127,3183,1540],{"class":183},[127,3185,1430],{"class":137},[127,3187,1545],{"class":196},[127,3189,76],{"class":137},[127,3191,3050],{"class":196},[127,3193,337],{"class":137},[127,3195,340],{"class":133},[127,3197,3198],{"class":144}," `\u003Ch2>${",[127,3200,3201],{"class":137},"students",[127,3203,2686],{"class":144},[127,3205,3050],{"class":137},[127,3207,2746],{"class":144},[127,3209,3210],{"class":144},"}, exercise ${",[127,3212,1545],{"class":137},[127,3214,2938],{"class":144},[127,3216,330],{"class":137},[127,3218,3219],{"class":144},"}\u003C\u002Fh2>\n",[127,3221,3222,3225,3227,3229,3232,3235,3238,3241,3243,3245,3247,3249,3251,3254,3257,3260,3262,3265,3268],{"class":129,"line":315},[127,3223,3224],{"class":144},"    \u003Cp>${",[127,3226,1545],{"class":137},[127,3228,2938],{"class":144},[127,3230,3231],{"class":137},"statement",[127,3233,3234],{"class":144},"} ${",[127,3236,3237],{"class":137},"task",[127,3239,3240],{"class":144},"}\u003C\u002Fp>${",[127,3242,2952],{"class":183},[127,3244,596],{"class":144},[127,3246,1545],{"class":137},[127,3248,2938],{"class":144},[127,3250,2635],{"class":137},[127,3252,3253],{"class":144},", { layers: ",[127,3255,3256],{"class":137},"sheet",[127,3258,3259],{"class":144},", reactionLabels: ",[127,3261,2738],{"class":144},[127,3263,3264],{"class":144}," })",[127,3266,3267],{"class":144},"}`",[127,3269,3270],{"class":137},"),\n",[127,3272,3273,3275,3277,3279,3281,3283,3285,3287,3290,3292,3294,3296],{"class":129,"line":350},[127,3274,3178],{"class":133},[127,3276,3181],{"class":137},[127,3278,1540],{"class":183},[127,3280,1430],{"class":137},[127,3282,1545],{"class":196},[127,3284,337],{"class":137},[127,3286,340],{"class":133},[127,3288,3289],{"class":144}," `\u003Ch2>Key, exercise ${",[127,3291,1545],{"class":137},[127,3293,2938],{"class":144},[127,3295,330],{"class":137},[127,3297,3219],{"class":144},[127,3299,3300,3303,3305,3307,3309,3311,3313,3315,3318,3320,3322],{"class":129,"line":376},[127,3301,3302],{"class":144},"    ${",[127,3304,2952],{"class":183},[127,3306,596],{"class":144},[127,3308,1545],{"class":137},[127,3310,2938],{"class":144},[127,3312,2635],{"class":137},[127,3314,3253],{"class":144},[127,3316,3317],{"class":137},"key",[127,3319,3264],{"class":144},[127,3321,3267],{"class":144},[127,3323,3270],{"class":137},[127,3325,3326],{"class":129,"line":418},[127,3327,1063],{"class":137},[127,3329,3330],{"class":129,"line":458},[127,3331,171],{"emptyLinePlaceholder":170},[127,3333,3334,3336,3339,3341],{"class":129,"line":492},[127,3335,318],{"class":133},[127,3337,3338],{"class":203}," style",[127,3340,324],{"class":133},[127,3342,3343],{"class":144}," `body { font: 15px\u002F1.5 system-ui, sans-serif; max-width: 640px; margin: 2rem auto }\n",[127,3345,3346],{"class":129,"line":497},[127,3347,3348],{"class":144},"  section { break-after: page }`\n",[127,3350,3351,3354,3356,3359,3361],{"class":129,"line":502},[127,3352,3353],{"class":183},"writeFileSync",[127,3355,596],{"class":137},[127,3357,3358],{"class":144},"'test.html'",[127,3360,76],{"class":137},[127,3362,3363],{"class":144},"`\u003C!doctype html>\u003Cmeta charset=\"utf-8\">\u003Ctitle>Test\u003C\u002Ftitle>\n",[127,3365,3366,3369,3372,3375,3378,3380,3382,3384,3387,3389,3391,3394,3396,3399,3402,3405,3407,3410,3413,3415,3417,3419],{"class":129,"line":535},[127,3367,3368],{"class":144},"  \u003Cstyle>${",[127,3370,3371],{"class":137},"style",[127,3373,3374],{"class":144},"}\u003C\u002Fstyle>${",[127,3376,3377],{"class":137},"pages",[127,3379,2938],{"class":144},[127,3381,1540],{"class":183},[127,3383,1430],{"class":144},[127,3385,3386],{"class":203},"page",[127,3388,337],{"class":144},[127,3390,340],{"class":133},[127,3392,3393],{"class":144}," `\u003Csection>${",[127,3395,3386],{"class":137},[127,3397,3398],{"class":144},"}\u003C\u002Fsection>`",[127,3400,3401],{"class":144},").",[127,3403,3404],{"class":183},"join",[127,3406,596],{"class":144},[127,3408,3409],{"class":144},"'",[127,3411,3412],{"class":203},"\\n",[127,3414,3409],{"class":144},[127,3416,523],{"class":144},[127,3418,3267],{"class":144},[127,3420,415],{"class":137},[118,3422,3426],{"className":3423,"code":3424,"language":3425,"meta":123,"style":123},"language-bash shiki shiki-themes github-light github-dark","node print-test.ts\n","bash",[98,3427,3428],{"__ignoreMap":123},[127,3429,3430,3432],{"class":129,"line":130},[127,3431,100],{"class":183},[127,3433,3434],{"class":144}," print-test.ts\n",[14,3436,3437,3438,3441],{},"Open ",[98,3439,3440],{},"test.html"," in a browser and print it, or save it as PDF: every student's exercise and every key gets a page of its own. Ada's page and its key:",[14,3443,3444],{},[3445,3446],"img",{"alt":3447,"className":3448,"height":3450,"src":3451,"width":3452},"Exercise 1000: a 6 m span with a 2 m overhang, 10 kN\u002Fm on the span and 30 kN at the tip, the unknown reactions named A_x, A_z and B_z, and chain dimensions of 6 m and 2 m with 8 m overall; below it the key, with reactions of 20 and 70 and the bending moment from −60 over the support to 20 in the span",[3449],"shot-lg",1210,"\u002Fscreenshots\u002Fp2p-plot-exercise-sheet.webp",1440,[14,3454,3455,3456,3459,3460,3463,3464,3467,3468,2938],{},"The ",[98,3457,3458],{},"dimensions"," layer gives every span and the overall length, as an exercise sheet does, and ",[98,3461,3462],{},"reactionLabels: 'names'"," names the unknowns, each arrow pointing the way its answer counts as positive. In the key, reactions and diagram values are bare numbers in kN and kNm, as in the EduBeam app: say so in the key's heading if your students need telling. For a black-and-white copier, pass ",[98,3465,3466],{},"colors"," with every tone set to black: see ",[32,3469,3471],{"href":3470},"\u002Fplot\u002Ftheming#black-and-white","Black and white",[43,3473,3475],{"id":3474},"figures-for-latex-and-word","Figures for LaTeX and Word",[14,3477,3478,3479,3482],{},"If your tests are written in LaTeX or Word, write the figures as files instead and keep your own template. ",[98,3480,3481],{},"figures.ts"," writes the sheet and the key of 30 seeds:",[118,3484,3486],{"className":120,"code":3485,"filename":3481,"language":122,"meta":123,"style":123},"import { writeFileSync } from 'node:fs'\nimport { structureSvg, type PlotLayer } from '@edubeam\u002Fplot'\nimport { makeExercise } from '.\u002Fexercise.ts'\n\nconst sheet: PlotLayer[] = ['members', 'supports', 'loads', 'reactions', 'nodeLabels', 'dimensions']\nconst key: PlotLayer[] = ['members', 'supports', 'reactions', 'M']\n\nfor (let seed = 1000; seed \u003C 1030; seed++) {\n  const { model } = makeExercise(seed)\n  writeFileSync(`exercise-${seed}.svg`, structureSvg(model, { layers: sheet, reactionLabels: 'names' }))\n  writeFileSync(`exercise-${seed}-key.svg`, structureSvg(model, { layers: key }))\n}\n",[98,3487,3488,3498,3512,3522,3526,3566,3598,3602,3636,3652,3679,3699],{"__ignoreMap":123},[127,3489,3490,3492,3494,3496],{"class":129,"line":130},[127,3491,134],{"class":133},[127,3493,2965],{"class":137},[127,3495,141],{"class":133},[127,3497,2970],{"class":144},[127,3499,3500,3502,3504,3506,3508,3510],{"class":129,"line":148},[127,3501,134],{"class":133},[127,3503,2977],{"class":137},[127,3505,156],{"class":133},[127,3507,2305],{"class":137},[127,3509,141],{"class":133},[127,3511,164],{"class":144},[127,3513,3514,3516,3518,3520],{"class":129,"line":167},[127,3515,134],{"class":133},[127,3517,2316],{"class":137},[127,3519,141],{"class":133},[127,3521,2996],{"class":144},[127,3523,3524],{"class":129,"line":174},[127,3525,171],{"emptyLinePlaceholder":170},[127,3527,3528,3530,3532,3534,3536,3538,3540,3542,3544,3546,3548,3550,3552,3554,3556,3558,3560,3562,3564],{"class":129,"line":190},[127,3529,318],{"class":133},[127,3531,2392],{"class":203},[127,3533,200],{"class":133},[127,3535,2397],{"class":183},[127,3537,2400],{"class":137},[127,3539,356],{"class":133},[127,3541,2405],{"class":137},[127,3543,2408],{"class":144},[127,3545,76],{"class":137},[127,3547,2413],{"class":144},[127,3549,76],{"class":137},[127,3551,2418],{"class":144},[127,3553,76],{"class":137},[127,3555,2423],{"class":144},[127,3557,76],{"class":137},[127,3559,2428],{"class":144},[127,3561,76],{"class":137},[127,3563,2433],{"class":144},[127,3565,1063],{"class":137},[127,3567,3568,3570,3572,3574,3576,3578,3580,3582,3584,3586,3588,3590,3592,3594,3596],{"class":129,"line":207},[127,3569,318],{"class":133},[127,3571,251],{"class":203},[127,3573,200],{"class":133},[127,3575,2397],{"class":183},[127,3577,2400],{"class":137},[127,3579,356],{"class":133},[127,3581,2405],{"class":137},[127,3583,2408],{"class":144},[127,3585,76],{"class":137},[127,3587,2413],{"class":144},[127,3589,76],{"class":137},[127,3591,2423],{"class":144},[127,3593,76],{"class":137},[127,3595,2466],{"class":144},[127,3597,1063],{"class":137},[127,3599,3600],{"class":129,"line":220},[127,3601,171],{"emptyLinePlaceholder":170},[127,3603,3604,3607,3609,3612,3615,3617,3620,3623,3625,3628,3631,3634],{"class":129,"line":227},[127,3605,3606],{"class":133},"for",[127,3608,327],{"class":137},[127,3610,3611],{"class":133},"let",[127,3613,3614],{"class":137}," seed ",[127,3616,356],{"class":133},[127,3618,3619],{"class":203}," 1000",[127,3621,3622],{"class":137},"; seed ",[127,3624,2263],{"class":133},[127,3626,3627],{"class":203}," 1030",[127,3629,3630],{"class":137},"; seed",[127,3632,3633],{"class":133},"++",[127,3635,1112],{"class":137},[127,3637,3638,3640,3642,3644,3646,3648,3650],{"class":129,"line":240},[127,3639,538],{"class":133},[127,3641,256],{"class":137},[127,3643,2635],{"class":203},[127,3645,887],{"class":137},[127,3647,356],{"class":133},[127,3649,510],{"class":183},[127,3651,548],{"class":137},[127,3653,3654,3657,3659,3662,3664,3667,3669,3671,3674,3676],{"class":129,"line":246},[127,3655,3656],{"class":183},"  writeFileSync",[127,3658,596],{"class":137},[127,3660,3661],{"class":144},"`exercise-${",[127,3663,330],{"class":137},[127,3665,3666],{"class":144},"}.svg`",[127,3668,76],{"class":137},[127,3670,2952],{"class":183},[127,3672,3673],{"class":137},"(model, { layers: sheet, reactionLabels: ",[127,3675,2738],{"class":144},[127,3677,3678],{"class":137}," }))\n",[127,3680,3681,3683,3685,3687,3689,3692,3694,3696],{"class":129,"line":298},[127,3682,3656],{"class":183},[127,3684,596],{"class":137},[127,3686,3661],{"class":144},[127,3688,330],{"class":137},[127,3690,3691],{"class":144},"}-key.svg`",[127,3693,76],{"class":137},[127,3695,2952],{"class":183},[127,3697,3698],{"class":137},"(model, { layers: key }))\n",[127,3700,3701],{"class":129,"line":304},[127,3702,301],{"class":137},[14,3704,3705,3706,3709],{},"Run it with ",[98,3707,3708],{},"node figures.ts",": that is 60 files for 30 students, each a plain SVG with fixed colours, no CSS and no scripts.",[3711,3712,3713,3722],"ul",{},[51,3714,3715,3718,3719,2938],{},[21,3716,3717],{},"Word"," (2019 and Microsoft 365) inserts an SVG as it is: ",[1643,3720,3721],{},"Insert › Pictures",[51,3723,3724,3727,3728,327,3734,3737,3738,3741,3742,3745,3746,3749],{},[21,3725,3726],{},"LaTeX"," includes PDF rather than SVG. Convert once, with ",[32,3729,3733],{"href":3730,"rel":3731},"https:\u002F\u002Fcairosvg.org",[3732],"nofollow","CairoSVG",[98,3735,3736],{},"cairosvg exercise-1000.svg -o exercise-1000.pdf",") or Inkscape, then ",[98,3739,3740],{},"\\includegraphics[width=\\linewidth]{exercise-1000.pdf}",". The ",[98,3743,3744],{},"svg"," package's ",[98,3747,3748],{},"\\includesvg"," does the conversion for you if Inkscape is installed.",[14,3751,3752,3753,3756,3757,3761],{},"A figure is 640 units wide with 13-unit text, so at the width of an A4 text column, about 16 cm, its labels are 9 pt. Set ",[98,3754,3755],{},"fontFamily"," to a font your document uses: see ",[32,3758,3760],{"href":3759},"\u002Fplot\u002Ffunctions#a-standalone-svg-file","A standalone SVG file"," for every option.",[43,3763,3765],{"id":3764},"make-it-your-own","Make it your own",[3711,3767,3768,3774,3780,3786,3800],{},[51,3769,3770,3773],{},[21,3771,3772],{},"More kinds of structure."," Add cases: a cantilever, a two-span continuous beam, a portal frame, a truss. The live demo at the top picks from eight kinds, from a simply supported beam to a three-hinged frame, a Warren truss and a portal frame.",[51,3775,3776,3779],{},[21,3777,3778],{},"Statically indeterminate exercises."," The solver handles them just as well; only the hand solution gets longer.",[51,3781,3782,3785],{},[21,3783,3784],{},"Round numbers."," Draw loads and lengths from short lists, as above, so the key comes out as round as you like. Loop over a few hundred seeds and skip those whose key has more decimals than you want.",[51,3787,3788,3791,3792,3795,3796,2938],{},[21,3789,3790],{},"Guard against mechanisms."," A generator that can place supports badly should solve inside a ",[98,3793,3794],{},"try"," and skip the seeds that throw: see ",[32,3797,3799],{"href":3798},"\u002Fsolver\u002Fsolving#when-solving-fails","When solving fails",[51,3801,3802,3805,3806,3809,3810,3813,3814,3820],{},[21,3803,3804],{},"Ask for more."," Draw the shear force (",[98,3807,3808],{},"'V'","), the deflection (",[98,3811,3812],{},"'w'",", with the values from ",[32,3815,3817],{"href":3816},"\u002Fsolver\u002Fresults#displacements",[98,3818,3819],{},"getUnknowns","), or the normal force in an inclined member.",[3371,3822,3823],{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":123,"searchDepth":148,"depth":167,"links":3825},[3826,3827,3828,3829,3830,3831],{"id":45,"depth":148,"text":46},{"id":108,"depth":148,"text":109},{"id":2239,"depth":148,"text":2240},{"id":2941,"depth":148,"text":2942},{"id":3474,"depth":148,"text":3475},{"id":3764,"depth":148,"text":3765},"Generate a different statics exercise for every student from a seed, with an answer key that is always right: on a web page, a printed test or SVG figures.","md","Use cases",{"source":3836},"site","\u002Fplot\u002Fexercises",{"title":5,"description":3832},"plot\u002Fexercises","TL2WbIfVq1OkcqHNSoKkGQ88z2Iw1doP9s_uKnu2ErE",[3842,3846,3850,3854,3857,3858,3861,3864,3868,3870],{"path":3843,"title":3844,"order":130,"group":3845},"\u002Fplot\u002Fgetting-started","Getting started","Introduction",{"path":3847,"title":3848,"order":148,"group":3849},"\u002Fplot\u002Fstructure-plot","StructurePlot","Components",{"path":3851,"title":3852,"order":167,"group":3853},"\u002Fplot\u002Fdiagram-stack","DiagramStack",null,{"path":3855,"title":3856,"order":174,"group":3853},"\u002Fplot\u002Ftheming","Theming and colours",{"path":3837,"title":5,"order":190,"group":3834},{"path":3859,"title":3860,"order":207,"group":3853},"\u002Fplot\u002Fslides","Slides and notes",{"path":3862,"title":3863,"order":220,"group":3853},"\u002Fplot\u002Fembedding","Embedding",{"path":3865,"title":3866,"order":227,"group":3867},"\u002Fplot\u002Fcomponents","Component API","Reference",{"path":1632,"title":3869,"order":240,"group":3853},"Plot model",{"path":3871,"title":3872,"order":246,"group":3853},"\u002Fplot\u002Ffunctions","Functions",1795108676407]