FBD: Randomization - mkraska/meclib GitHub Wiki
This is part of the FBD Example Question tutorial.
We want to randomize the position of point C and the distributed load.
Question Variables
- Create a random variable for point C
- Parametrize the system sketch and the model answer
- "bar" object (bar 1)
- "fix12" object (support at point C)
- "force" object ($F_1$ in the model answer)
pC: rand([ [1,-2], [-1,-2], [2,-2]]);
[q1,q2, qn1, qn2, xcg]: rand([
[0,1,"","q_0", 2], [1,0,"q_0","", 1]
]);
initdata: [
[ "grid", "","",-2, 5,-4,4, 40],
[ "bar", "1", [0, 0], pC, "show" ],
[ "beam","white", "gray80",[0, 0],[3,0],0.15, "show"],
[ "crosshair","", [3, -1], [0,0], [1,1], [1,1], "grid" ],
[ "dim", "a", [3, 2], [4,2], 0 ],
[ "fix12", "C", pC, 0 , "show"],
[ "fix13", "B", [3, 0], 180, "show"],
[ "node", "A", [0,0] ],
[ "q", qn1, qn2, [0, 0.2], [3,0.2], q1 , q2, 0, "show"],
[ "forceGen", "F_1", [-1, 3]],
[ "momentGen", "M_1", [1, 3]]
];
init: stackjson_stringify(initdata);
tansdata: [
["grid","","",-2,5,-4,4,40],
[ "bar", "1", [0, 0], pC, "hide" ],
["beam","white","gray80",[0,0],[3,0],0.15,"show"],
["crosshair","",[0,0],[0,0],[1,1],[1,1],"grid"],
["dim","a",[3,2],[4,2],0],
["fix12","C",pC,0,"show"],
["fix13","B",[3,0],180,"hide"],
["node","A",[0,0]],
[ "q", qn1, qn2, [0, 0.2], [3,0.2], q1 , q2, 0, "hide"],
["forceGen","F_2",[-1,3]],
["momentGen","M_1",[1,3]],
["force","F_1",[0,0],0.6*pC,10,"active"],
["force","B",[3,0],[4.2,0],10,"active"],
["force","3/2 a q_0",[xcg,0.7],[xcg,-0.5],10,"active"],
["moment","M_B",[3,0],[2.6,-0.3],[3.4,-0.3],"active"]
];
tans: stackjson_stringify(tansdata);
Question note
We show the random variable and the solution for the support reaction (as to remove variants with complicated expressions)
{@pC@}, {@[q1,q2]@}, {@TR@}
Input names
This is required for the question test in the deployment form
- Add the model answer:
tansnames
PRT fb_q
Question variables
obj: stackjson_parse(objects);
[text, isOK]: fb_q(obj, names, i_q, "Streckenlast: ", q1*q_0, q2*q_0, a);
Check
Use the "Variants and Question Test" page to verify the variants.
This allows you to browse the variants easily.