Skip to content

Feedback for Free Body Diagrams

mkraska edited this page Mar 16, 2024 · 28 revisions

FBD Feedback Structure

FBD Generic Validation Feedback

Helper functions and feedback for specific objects

These functions are defined in fb_fbd.mac. To use them, include the macro file in the question variables

stack_include("https://raw.githubusercontent.com/mkraska/meclib/main/Maxima/fb_fbd.mac");

Duplicate Names

This is a temporary state of a function which finds duplicate names,

  • names contents of the input field
  • res list of reserved names (perhaps used for external loads)
  • user list of indices of supports (where reactions can appear)
fb_duplicates(%_names, %_res, %_user):=block( 
  [%_loi: [], %_unames, %_tmp: [], %_dup: [], %_i, %_n],
  /* user supplied names */
  for %_i in %_user do (
    if listp(%_names[%_i]) then %_loi: append(%_loi, %_names[%_i])
  ),
  return([%_loi, true]),
  %_unames: map(lambda([%_i], names[%_i]), %_loi),
  /* check for duplicates */
  for %_n in %_unames do (
    if member(%_n,%_tmp) 
      then %_dup: append(%_dup, [%_n]) 
      else %_tmp: append(%_tmp, [%_n])
  ),
  if not emptyp(%_dup) then return([castext("Der Name \\({@%_dup[1]@}\\) tritt mehrfach auf."), false]),
  ["", true]
);

Attached Forces and Moments

if a de-activated element has active forces or moments nearby, a list of indices is returned in the names list

Tryout Space

In order to try code snippets in jsfiddle,

  1. copy the code from the wiki page to the clipboard
  2. follow the link for the JSXGraph version you want to try
  3. Replace the code in the HTML section (contents of <p hidden id="init">) with the content of the clipboard
Clone this wiki locally