JSBeams project

Tool for numerical solution of beam structures in JavaScript

JSBeams is a tool for numerical solution of 2D beam structures (using direct stiffness method) in JavaScript. You can use it in your web applications like here. Just download the jsbeams.js file and place it into your HTML document. Before loading jsbeams.js, the jsmatrix.js file must be loaded first.

The usage is very simple and similar to other solvers (note that nodes has only geometrical meaning, degrees of freedom themselves has to be defined on each beam separately):
  • define nodes (their coordinates);
  • define beams (connected nodes, degrees of freedom, material properties, continuous and/or temperature load etc.);
  • define nodal load and/or prescribed nodal displacement;
  • insert these data into appropriate solver.
All other is done within solver's member method update like in example below:

ex01.png

/*
Simple example with one beam and continuous load. The beam cen either be modeled as clamped-clamped (with 6 degrees of freedom) with rotation of right-hand node as unknown, or as clamped-hinge beam with (with the help of static condensation) only 5 degress of freedom. The end displacement and end forces (both in local coordinate system) are computed regardless the type of the beam and results are of course the same
*/

var node1 = JSBeams.Node.create(0,0,0);
var node2 = JSBeams.Node.create(2,0,0);
var ea = 3600;
var ei = 48.0;
var fz = 10;

var dofs1 = [0,1,2,3,4,5];
var params1 = {dofs:dofs1,ea:ea,ei:ei,fzloc:fz,hasBodyLoad:true};
var beam1 = JSBeams.Beam2d.create(node1,node2,params1);
var p1 = [0,1,2,3,4];
var u1 = [5];
var solver1 = JSBeams.LinearStaticSolver.create([beam1],u1,p1);
solver1.update();

var dofs2 = [0,1,2,3,4];
var params2 = {dofs:dofs2,ea:ea,ei:ei,fzloc:fz,hasBodyLoad:true,type:JSBeams.CH};
var beam2 = JSBeams.Beam2d.create(node1,node2,params2);
var p2 = [0,1,2,3,4];
var u2 = [];
var solver2 = JSBeams.LinearStaticSolver.create([beam2],u2,p2);
solver2.update();

alert('beam1.dspl: '+beam1.dspl);
alert('beam2.dspl: '+beam2.dspl);
/* should be Vector([0, 0, 0, 0, 0, 3.47222222e-02])*/

alert('beam1.load: '+beam1.load);
alert('beam2.load: '+beam2.load);
/* should be Vector([0, -12.5, 5, 0, -7.5, 0])*/
Try it
JSBeams is a free software distributed under GNU LGPL license.

Current implementation contains:
  • Solution: linear statics, eigen velues dynamics
  • Load: nodal load, continuous constant load, temperature load
  • Prescribed displacement and/or rotation
  • Polygonal cross section properties (center of mass, moments of inertia etc.)

Plans for future (if time and duties allow it..):
  • Direct integration of equations of motion in dynamic problems
  • Geometrical and/or material nonlinearities
  • Non-axis-aligned supports

See documentation and/or examples for more information.
Contact: e-mail
Last update: 22th August 2011
© 2011 - 2022   Jan Stránský
All rights reserved
Valid XHTML 1.1
Valid CSS