This live script is written as a guided walkthrough for a post-processing workflow. It focuses on retrieving, organizing, and visualizing model or response data after an OpenSees analysis. Read the text cells first, then run each code cell in order so that the variables, model state, and recorded results are available for the later sections.
As we all know, the units should be unified in the finite element analysis. Common basic units include length, force, and time. The units of the base system can be combined in any combination, but other units including pressure, stress, mass, etc. should be unified with base system. In order to facilitate unit processing in the model, OpenSeesMatlab has developed a class that can automatically perform unit conversion based on the basic units you set.
The following commands carry out this step of the workflow. Run this cell after the previous sections so the required variables and model state already exist.
12345678
length_unit="m";% base unitforce_unit="kN";% base unitUNIT=opsMAT.pre.unitSystem;UNIT.setBasicUnits(length_unit,force_unit,"sec");fprintf("Length: %g %g %g %g %g %g\n",...UNIT.mm,UNIT.mm2,UNIT.cm,UNIT.m,UNIT.inch,UNIT.ft);
Let’s look at a truss example. You can set the practical values of structural parameters in the model, and unitSystem will help you automatically convert to the base unit system you specify.
fprintf('Reaction at node 2: %s/%s = %g, %s/%s = %g\n',...char(force_unit2),char(force_unit1),forces2(end)/forces1(end),...char(force_unit3),char(force_unit1),forces3(end)/forces1(end));
Output
Reaction at node 2: N/kN = 1000, lbf/kN = 224.809
The displacement and force values depend on the base unit system you set up, but they are proportional to each other. Well, the rest is left to you to verify.
This section creates the finite-element idealization used by the rest of the example. Check the dimensions, tags, and connectivity here before moving on.