Mohr's Circle - mkraska/meclib GitHub Wiki

The student can move the circle and the line for the 1-axis using the red points. This is done using the special purpose objects "circle2p" and "line2p". They return their point co-ordinates in the names input field.

Question variabls

In tansdata you would usually use the actual coordinates of the solution.

i_circle: 2;
i_line: 3;
f:50;
initdata: [ 
  [ "grid", " ", " ", -6,6, -3, 3, 40, [f,f] ],
  [ "circle2p", "P","P'", [50,50],[100,100], f ],
  [ "line2p", "1-Achse", [200,100],[250,50], f ]
];
init: stackjson_stringify(float(initdata));

tansdata: [ 
  [ "grid", " ", " ", -6,6, -3, 3, 40, [f,f] ],
  [ "circle2p", "P","P'", [50,50],[100,100], f ],
  [ "line2p", "1-Achse", [200,100],[250,50], f ]
];
tans: stackjson_stringify(float(tansdata));

Question text

Here you use the setup for an interactive meclib widget with the input fields objects and names.

Feedback variables

In order to check the points P and P' and the slope of the line, you might use the following in the feedback variables. Note that this relies on object position in the list.

S_P: names[i_circle][1];
S_PP: names[i_circle][2];
[dx,dy]: names[i_line][2]-names[i_line][1];

One could extract the co-ordinates from objects as well by object name, but in with that few objects it can be kept simple.

Randomization issues

(Example TM2 05 02 b) If scaling of the axes is needed dependent on the tensor components, then several issues arise:

  • Make sure the circle fits in the given axes, without giving away too many information.
  • Account for the limited input precision (limited by grid snap to 0.1 gridspacing).
  • Reasonable decimal precision of the infobox (coordinate display at the control points).

In the following example pprec is the point precision, to be used for feedback on the control points of the circle. serr is an estimate of the expected precision of slope input of the 1-axis line.

f:1;
if i1<10 then f: 0.5;
if i1< 5 then f: 0.2;
pprec: 0.1*f;  /* absolute precision of the point coordinates */
serr: float(pprec/(iy-i2)+pprec/iyz);  /* estimate of relative precision of slope */

initdata: [ 
  [ "grid", " ", " ", -2,20, -10, 10, 20, [f,f], [2,2] ],
  [ "circle2p", "P","P'", [f,f],[2*f,2*f], f ],
  [ "line2p", "1-Achse", [3*f,2*f],[4*f,f], f ],
  [ "label", "\\(I_{\\rm ax}/a^3t\\)", [16,1] ],
  [ "label", "\\(I_{\\rm dev}/a^3t\\)", [1,9] ]
];
init: stackjson_stringify(float(initdata));