### Start gnuplot Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to navigate to the examples directory and launch the gnuplot utility. ```bash cd ~/Desktop/Code/frame3dd/examples gnuplot ``` -------------------------------- ### Install build-essential on Linux Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Command to install necessary build tools on Linux systems. ```bash sudo apt install build-essential ``` -------------------------------- ### PROP statement example with default orientation Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Example of a PROP statement for a library section (250UB37.3) with 'Y default' orientation. The I_yy and I_xx values can be checked against the OneSteel datasheet. ```text PROP 43 LIBR asw 250UB37.3 Y default 4.7500E-03 0.000 0.000 1.5800E-07 5.6600E-06 5.5700E-05 ``` -------------------------------- ### NODE statement example Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Shows the format of a NODE statement with node ID, X, Y, Z coordinates, and flags. The flags appear to be 0-1 values, but their purpose is not yet clear. ```text NODE 6340 4.6742 -4.6738 7.2825 000000 ``` -------------------------------- ### MEMB statement examples (axis alignment and node alignment) Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Two MEMB statement formats: one with alignment to +Z axis and one with alignment to a third node. The 4th field indicates member alignment, either to a global axis or to another node. ```text MEMB 6025 643 637 Z 63 6 000000 000000 ``` ```text MEMB 805 42 49 2048 4 1 000000 000000 ``` -------------------------------- ### PROP statement example for library section Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Example of a PROP statement for a library section (114.3X3.6CHS) with section properties. The 'Y' field is present, and the following line gives area, shear areas, torsional modulus, and second moments of area. ```text PROP 7 LIBR asw 114.3X3.6CHS Y 1.2500E-03 0.000 0.000 3.8400E-06 1.9200E-06 1.9200E-06 ``` -------------------------------- ### MATL statement example Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Example of a MATL statement with material ID, Young's modulus, yield stress, density, and a beta value (uncertain). The fields are annotated in the source. ```text MATL 1 2.000E+08 2.500E-01 7.850E+00 1.170E-05 ``` -------------------------------- ### PROP statement example for custom section Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/FORMAT.txt Example of a PROP statement for a custom section (LH80603010x1.5) where the 'Y' field is replaced by a section name. The same properties are given on the following line. ```text PROP 1 PRIS LH80603010x1.5 Lipped Hat G350 2.9180E-04 0.000 0.000 0.000 2.8270E-07 4.0540E-07 ``` -------------------------------- ### Frame3DD command-line options reference Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html A list of available command-line flags and their descriptions for configuring Frame3DD execution. ```text ------------------------------------------------------------------------- -i InFile the input data file name --- described in the manual -o OutFile the output data file name -h print this help message and exit -v display program version, website, brief help info and exit -a display program version, website, and exit -c data check only - the output data reviews the input data -q suppress screen output except for warning messages -w write stiffness and mass matrices to files named Ks Kd Md -x suppress writing of 't' or 'c' for sign of axial forces -s On|Off On: include shear deformation or Off: neglect ... -g On|Off On: include geometric stiffness or Off: neglect ... -e value static deformation exaggeration factor for gnuplot output -z force X-Y-Z plotting -l On|Off On: lumped mass matrix or Off: consistent mass matrix -f value modal frequency shift for unrestrained structures -m J|S modal analysis method: J=Jacobi-Subspace or S=Stodola -t value convergence tolerance for modal analysis -p value pan rate for mode shape animation -r value matrix condensation method: 0, 1, 2, or 3 ------------------------------------------------------------------------- ``` -------------------------------- ### Display help information Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Print the help message and exit the program. ```bash frame3dd -h ``` -------------------------------- ### Open OS profile for editing Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to open the appropriate profile configuration file for Windows, macOS, or Linux. ```bash notepad $PROFILE # Windows TextEdit ~/.zprofile # macOS Gedit ~/.profile # linux ``` -------------------------------- ### Configure mass matrix, animation, and plotting Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Set consistent mass matrix, static deformation exaggeration, animation pan rate, and force 3D plotting. ```bash frame3dd -i InFile -o OutFile -lOff -e100 -p3.4 -z ``` -------------------------------- ### Run Frame3DD with file arguments Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Execute Frame3DD by specifying input and output files directly. ```bash frame3dd InFile OutFile ``` -------------------------------- ### Run Frame3DD with command-line options Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Execute Frame3DD using flags to specify files and override input data file values. ```bash frame3dd -i InFile -o OutFile [OPTIONS] ``` -------------------------------- ### Configure environment variables Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Configuration code to add the Frame3DD executable to the system PATH and define the output directory, to be added to the user profile. ```bash # for Frame3DD ... http://github.com/hpgavin/frame3dd/ # add Frame3DD executable directory to the path # Windows ... $env:PATH="$env:PATH;%USERPROFILE%\Desktop\Code\frame3dd" # create a frame3dd output directory if [ ! -d %TMP%/frame3dd_temp_%USERNAME% ]; then mkdir %TMP%/frame3dd_temp_%USERNAME% echo "creating %TMP%/frame3dd_temp_%USERNAME% for Frame3DD" fi $env:FRAME3DD_OUTDIR="env:%TMP%/frame3dd_temp_%USERNAME% # ... Windows # macOS and linux ... export PATH=$PATH:$HOME/Desktop/Code/frame3dd/ if [ ! -d /tmp/frame3dd_temp_$USER ]; then mkdir /tmp/frame3dd_temp_$USER echo "creating /tmp/frame3dd_temp_$USER for Frame3DD" fi # specify the Frame3DD output directory export FRAME3DD_OUTDIR=/tmp/frame3dd_temp_$USER # ... macOS and linux ``` -------------------------------- ### Run Frame3DD interactively Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Execute Frame3DD with interactive prompting for file names. ```bash frame3dd ``` -------------------------------- ### Activate OS profile changes Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to apply the updated environment variables in the current terminal session. ```bash . $PROFILE # Windows source ~/.profile # linux source ~/.zprofile # macOS ``` -------------------------------- ### Clone and compile Frame3DD Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to clone the required repositories and compile the Frame3DD program. ```bash cd ~/Desktop/Code git clone https://github.com/hpgavin/frame3dd git clone https://github.com/hpgavin/HPGnumlib cd ~/Desktop/Code/frame3dd/ make make install ``` -------------------------------- ### Run Frame3DD analysis Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Command to execute a Frame3DD analysis on an input file and specify an output file. ```bash cd ~/Desktop/Code/frame3dd frame3dd examples/exE.3dd examples/exE.out ``` -------------------------------- ### Include shear deformation Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Run the analysis with shear deformation enabled, overriding the input file setting. ```bash frame3dd -i InFile -o OutFile -sOn ``` -------------------------------- ### Clone the Frame3DD repository Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to navigate to the code directory and clone the Frame3DD repository from GitHub. ```bash cd ~/Desktop/Code git clone http://github.com/hpgavin/frame3dd ``` -------------------------------- ### Run Frame3DD analysis Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Command to execute the Frame3DD program on a specific input file and generate an output file. ```bash cd ~/Desktop/Code/frame3dd frame3dd examples/exE.3dd examples/exE.out ``` -------------------------------- ### Run Frame3DD from terminal Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Executes Frame3DD with an input file and an output file. The output file is appended with results from the most recent analysis. ```bash frame3dd inputfile.3dd outputfile.txt ``` -------------------------------- ### Run Frame3DD with CSV input Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Executes the Frame3DD program using a CSV input file, which generates both a standard output file and a CSV results file. ```bash frame3dd examples/MyFrame.CSV MyResultsA.out ``` -------------------------------- ### Clone and copy Frame3DD executable Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to clone the Frame3DD repository and copy the appropriate executable for your operating system. ```bash cd ~/Desktop/Code git clone http://github.org/hpgavin/frame3dd cp frame3dd/build/Win11/frame3dd.exe . # Windows cp frame3dd/build/macOS/framd3dd . # macOS cp frame3dd/build/linux/framd3dd . # linux ``` -------------------------------- ### Set geometric stiffness and exaggeration factor Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Enable geometric stiffness and set the static deformation exaggeration factor. ```bash frame3dd -i InFile -o OutFile -e100 -gOn ``` -------------------------------- ### Add Frame3DD to Matlab path on Windows Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Matlab commands to add the Frame3DD directories to the path on Windows systems. ```matlab path([ getenv('USERPROFILE') '/Desktop/Code/frame3dd' ],path) path([ getenv('USERPROFILE') '/Desktop/Code/frame3dd/matlab' ],path) ``` -------------------------------- ### Add Frame3DD to Matlab path on Linux/OS X Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Matlab commands to add the Frame3DD directories to the path on Unix-like systems. ```matlab path([ getenv('HOME') '/Desktop/Code/frame3dd' ],path) path([ getenv('HOME') '/Desktop/Code/frame3dd/matlab' ],path) ``` -------------------------------- ### Parser result and failure macros Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Macros to handle parser results and failure states in C. ```c #define result(assignment) (assignment,1) #define fail (0) #define condition(cond) (cond) ``` -------------------------------- ### Frame3DD Input Data Template Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html A template illustrating the required structure for node, reaction, element, and load data in a .3dd file. ```text Template Input Data file for Frame3DD - 3D structural frame analysis (N,mm,ton) # this template indicates units of Newton, millimeter, and tonne # other units may be specified as desired # node data ... nN # number of nodes #.node X-coord Y-coord Z-coord radius # mm mm mm mm N[1] x[1] y[1] z[1] rj[1] : : : : : N[nN] x[nN] y[nN] z[nN] rj[nN] # reaction data ... nR # number of nodes with reactions #.node X Y Z XX YY ZZ 0:free, 1:fixed N[1] Rx[1] Ry[1] Rz[1] Rxx[1] Ryy[1] Rzz[1] : : : : : : : N[nR] Rx[nR] Ry[nR] Rz[nR] Rxx[nR] Ryy[nR] Rzz[nR] # frame element data ... nE # number of frame elements #.elmnt n1 n2 Ax Asy Asz Jx Iy Iz E G roll density # . . mm^2 mm^2 mm^2 mm^4 mm^4 mm^4 MPa MPa deg tonne/mm^3 EL[1] N1[1] N2[1] Ax[1] Asy[1] Asz[1] Jx[1] Iy[1] Iz[1] E[1] G[1] p[1] d[1] : : : : : : : : : : : : : EL[nE] N1[nE] N2[nE] Ax[nE] Asy[nE] Asz[nE] Jx[nE] Iy[nE] Iz[nE] E[nE] G[nE] p[nE] d[nE] shear # 1=Do, 0=Don't include shear deformation effects geom # 1=Do, 0=Don't include geometric stiffness effects exagg_static # exaggeration factor for static mesh deformations scale # zoom scale for 3D plotting dx # length of x-axis increment for frame element internal force data, mm # if dx is -1 then internal force calculations are skipped # load data ... nL # number of static load cases, 1..30 # Begin Static Load Case 1 # gravitational acceleration for self-weight loading, mm/s^2 (global) # gX gY gZ # mm/s^2 mm/s^2 mm/s^2 gX gY gZ nF # number of loaded nodes (global) #.node X-load Y-load Z-load X-mom Y-mom Z-mom # N N N N.mm N.mm N.mm N[1] Fx[1] Fy[1] Fz[1] Mxx[1] Myy[1] Mzz[1] : : : : : : : N[nF] Fx[nF] Fy[nF] Fz[nF] Mxx[nF] Myy[nF] Mzz[nF] nU # number of uniformly-distributed element loads (local) #.elmnt X-load Y-load Z-load uniform member loads in member coordinates # N/mm N/mm N/mm EL[1] Ux[1] Uy[1] Uz[1] : : : : EL[nU] Ux[nU] Uy[nU] Uz[nU] nW # number of trapezoidally-distributed element loads (local) # start stop start stop #.elmnt loc'n loc'n load load # mm mm N/mm N/mm EL[1] xx1[1] xx2[2] wx1[1] wx2[1] # locations and loads - local x-axis xy1[1] xy2[2] wy1[1] wy2[1] # locations and loads - local y-axis xz1[1] xz2[2] wz1[1] wz2[1] # locations and loads - local z-axis : : : : : EL[nW] xx1[nW] xx2[nW] wx1[nW] wx2[nW] # x1 and x2: start and end locations xy1[nW] xy2[nW] wy1[nW] wy2[nW] # w1 and w2: start load and end load xz1[nW] xz2[nW] wz1[nW] wz2[nW] # 0 < x1 < x2 < L nP # number of concentrated interior point loads (local) #.elmnt X-load Y-load Z-load x-loc'n point loads in member coordinates EL[1] Px[1] Py[1] Pz[1] x[1] : : : : : # x=distance from coordinate N1 EL[nP] Px[nP] Py[nP] Pz[nP] x[nP] # 0 < x < L nT # number of frame elements with temperature changes (local) #.elmnt coef. y-depth z-depth deltaTy+ deltaTy- deltaTz+ deltaTz- # /deg.C mm mm deg.C deg.C deg.C deg.C EL[1] a[1] hy[1] hz[1] Ty+[1] Ty-[1] Tz+[1] Tz-[1] : : : : : : : : EL[nT] a[nT] hy[nT] hz[nT] Ty+[nT] Ty-[nT] Tz+[nT] Tz-[nT] ``` -------------------------------- ### Frame3DD Source Code File Structure Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html A list of the primary source code files in the Frame3DD project and their respective roles in the application. ```text file name description ------------- ------------------------------- main.c main driver routines frame3dd.c frame analysis frame3dd_io.c input-output functions coordtrans.c coordinate transformation HPGeig.c generalized eigenvalue analysis HPGmatrix.c LU decomposition, LDL' decomposition, pseudo-inverse, HPGutil.c ansi.sys color functions NRutil.c dynamic memory allocation ``` -------------------------------- ### Gnuplot interaction controls Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Reference list of keyboard and mouse controls for navigating 3D structure plots in gnuplot. ```text zoom : hold Alt + scroll ... or ... hold the scroll button and drag left-right pan : hold Left mouse button + drag the mouse ... or ... arrow key (up, down, left, right) ... or ... shift + arrow key shift X : hold shift + scroll shift Y : scroll shift Z : hold shift + hold the scroll wheel + drag up-down autoscale : the 'a' key toggle border : the 'b' key toggle grid : the 'g' key toggle mouse functions on/off : the 'm' key undo shift : the 'u' key ``` -------------------------------- ### Visualize results with gnuplot Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Commands to load and display structural plots within the gnuplot environment. ```gnuplot gnuplot> cd 'Desktop/Code/frame3dd/examples' gnuplot> load 'exE.plt' ``` -------------------------------- ### Suppress screen output Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Run the analysis while suppressing standard screen output, excluding warning messages. ```bash frame3dd -i InFile -o OutFile -q ``` -------------------------------- ### Basic parse type operations Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Fundamental operations for advancing and backing up in the parse stream. ```c bool parseGetChar( parse *p, char *c ); /* advancing */ bool parseUnGetChar( parse *p, char c ); /* backing up */ ``` -------------------------------- ### Matlab interface function definition Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html The function signature and documentation for the frame_3dd Matlab interface. ```matlab function [D,R,F,L,Ks] = frame_3dd(XYZ,JTS,RCT,EAIJ,P,U,D) % [D,R,F,L,Ks] = frame_3dd (XYZ,JTS,RCT,EAIJ,P,U,D) % % Solve a a three-dimensional frame analysis problem % % INPUT DATA: % % XYZ : a 4xJ matrix containing the XYZ coordinate of each node % row 1 = X-axis coordinate for each node % row 2 = Y-axis coordinate for each node % row 3 = Z-axis coordinate for each node % row 4 = rigid radius for each node % % JTS : a 2xB matrix indicating which 2 nodes each frame element connects % row 1 = the 'starting' node for each frame element % row 2 = the 'ending' node for each frame element % % RCT : a 6xJ matrix indicated which nodes have reactions % 0: the node has no reaction in that degree of freedom, % 1: the node does have a reaction in that degree of freedom. % % EAIJ : a 10xB containing the section and modulus properties of each frame el. % row 1 = Ax cross section area for each frame el. % row 2 = Asy shear area y-directionfor each frame el. % row 3 = Asz shear area z-directionfor each frame el. % row 4 = Jxx torsional moment of inertia - x axis for each frame el. % row 5 = Iyy bending moment of inertia - y axis for each frame el. % row 6 = Izz bending moment of inertia - z axis for each frame el. % row 7 = E elastic modulus for each frame el. % row 8 = G shear modulus for each frame el. % row 9 = p roll angle for each frame el. % row 10 = d mass density for each frame el. % % P : a 6xJ matrix containing the components of the external % forces and moments applied to each node. % row 1 = External nodal force in X-direction for each node % row 2 = External nodal force in Y-direction for each node % row 3 = External nodal force in Z-direction for each node % row 4 = External nodal moment about X-axis for each node % row 5 = External nodal moment about Y-axis for each node % row 6 = External nodal moment about Z-axis for each node % % U : a 3xB matrix containing the unif. dist. load on each frame element % row 1 = uniform distributed load along the local element x axis % row 2 = uniform distributed load in the local element y axis % row 3 = uniform distributed load in the local element z axis % % D : a 6xJ matrix of prescribed displacements at the reaction DoF's % row 1 = prescribed node displ. in the X-direction for each node % row 2 = prescribed node displ. in the Y-direction for each node % row 3 = prescribed node displ. in the Z-direction for each node % row 4 = prescribed node rot'n about the X-axis for each node % row 5 = prescribed node rot'n about the Y-axis for each node % row 6 = prescribed node rot'n about the Z-axis for each node % % OUTPUT DATA: % % D : a 6xJ matrix of the deflections and rotations of each node % R : a 6xJ matrix of the reaction forces and moments % F : a 12xB matrix of the end forces of each frame element % L : a 1xB vector of the length of each frame element % Ks : a 6Jx6J matrix of the structural stiffness matrix ``` -------------------------------- ### Haskell monadic bind operator signature Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html The standard monadic bind operator signature in Haskell. ```haskell (>>=) :: Parser a -> (a -> Parser b) -> Parser b ``` -------------------------------- ### parseNumber: Parse a sequence of digits into an integer Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Parses one or more digits using parseDigit in a while loop, then converts the collected string to an integer with atoi. Requires at least one digit; otherwise fails. Uses a fixed-size buffer of 300 characters. ```C bool parseNumber( parse *p, int *n ) { char s[300]; int i = 0; while ( parseDigit( p, &(s[i]) ) && result ( i++ ) ); return ( condition ( i > 0 ) && result ( s[i] = '\0' ) && result ( *n = atoi( s ) ) ); } ``` -------------------------------- ### Load plot results in gnuplot Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Command to load a specific plot file within the gnuplot environment. ```bash gnuplot> load 'MyResultsA.plt' ``` -------------------------------- ### Parser for any character Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html A parser that consumes any character and returns it as a result. ```c bool parseAChar( parse *p, char &c ) { return ( parseGetChar( p, &c ) ); } ``` -------------------------------- ### C specialized then operator signature Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html A specialized, non-polymorphic version of the bind operator for C. ```c (>>) :: Parser () -> Parser () -> Parser () ``` -------------------------------- ### Parser for a specific character Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html A parser that attempts to match a specific character, backing up if the match fails. ```c bool parseThisChar( parse *p, char c ) { char d; return ( parseAChar( p, &d ) && ( condition( c == d ) || parseUnGetChar( p, d ) && fail ) ); } ``` -------------------------------- ### parseSignedNumber: Parse numbers with optional sign Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Parses an optional leading '-' or '+' followed by a number, or just a number. Uses the || operator for choice. Note: this parser violates the safety condition; if a '+' is followed by a non-number, it fails without restoring input. ```C bool parseSignedNumber( parse *p, int *n ) { return ( parseThisChar( p, '-' ) && parseNumber( p, n ) && result ( *n = -(*n) ) || parseThisChar( p, '+' ) && parseNumber( p, n ) || parseNumber( p, n ) ); } ``` -------------------------------- ### parseSpaceAndComments: Skip spaces and C/C++ comments Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Parses and discards spaces, tabs, newlines, C-style block comments (/* ... */), and C++ line comments (// ...). Uses many, parseThisChar, parseThisString, and parseAnyChar. Handles nested block comments? No, it stops at the first '*/'. ```C bool parseSpaceAndComments( parse *p ) { return ( many ( parseThisChar( p, ' ' ) || parseThisChar( p, '\t' ) || parseThisChar( p, '\n' ) || parseThisString( p, "/*" ) && ( many ( !parseThisString( p, "*/" ) && parseAnyChar( p ) ) ) || parseThisString( p, "//" ) && ( many ( !parseThisChar( p, '\n' ) && parseAnyChar( p ) ) ) ) ); } ``` -------------------------------- ### frame_3dd Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Matlab function that solves a three-dimensional frame analysis problem. It accepts node coordinates, element connectivity, reaction constraints, section properties, applied loads, distributed loads, and prescribed displacements, and returns displacements, reactions, element end forces, element lengths, and the structural stiffness matrix. ```APIDOC ## frame_3dd ### Description Solves a three-dimensional frame analysis problem. The function takes structural data as input matrices and returns displacements, reactions, element end forces, element lengths, and the structural stiffness matrix. ### Method Matlab function call ### Endpoint [D,R,F,L,Ks] = frame_3dd(XYZ,JTS,RCT,EAIJ,P,U,D) ### Parameters #### Input Arguments - **XYZ** (4xJ matrix) - Required - Contains the XYZ coordinate of each node: row 1 = X-axis coordinate, row 2 = Y-axis coordinate, row 3 = Z-axis coordinate, row 4 = rigid radius. - **JTS** (2xB matrix) - Required - Indicates which 2 nodes each frame element connects: row 1 = starting node, row 2 = ending node. - **RCT** (6xJ matrix) - Required - Indicates which nodes have reactions: 0 = no reaction in that degree of freedom, 1 = reaction in that degree of freedom. - **EAIJ** (10xB matrix) - Required - Contains section and modulus properties of each frame element: row 1 = Ax (cross section area), row 2 = Asy (shear area y-direction), row 3 = Asz (shear area z-direction), row 4 = Jxx (torsional moment of inertia - x axis), row 5 = Iyy (bending moment of inertia - y axis), row 6 = Izz (bending moment of inertia - z axis), row 7 = E (elastic modulus), row 8 = G (shear modulus), row 9 = p (roll angle), row 10 = d (mass density). - **P** (6xJ matrix) - Required - Contains external forces and moments applied to each node: row 1 = force in X-direction, row 2 = force in Y-direction, row 3 = force in Z-direction, row 4 = moment about X-axis, row 5 = moment about Y-axis, row 6 = moment about Z-axis. - **U** (3xB matrix) - Required - Contains uniform distributed loads on each frame element: row 1 = load along local element x axis, row 2 = load in local element y axis, row 3 = load in local element z axis. - **D** (6xJ matrix) - Required - Contains prescribed displacements at reaction degrees of freedom: row 1 = displacement in X-direction, row 2 = displacement in Y-direction, row 3 = displacement in Z-direction, row 4 = rotation about X-axis, row 5 = rotation about Y-axis, row 6 = rotation about Z-axis. ### Output - **D** (6xJ matrix) - Deflections and rotations of each node. - **R** (6xJ matrix) - Reaction forces and moments. - **F** (12xB matrix) - End forces of each frame element. - **L** (1xB vector) - Length of each frame element. - **Ks** (6Jx6J matrix) - Structural stiffness matrix. ### Usage Example ```matlab [D,R,F,L,Ks] = frame_3dd(XYZ,JTS,RCT,EAIJ,P,U,D); ``` ``` -------------------------------- ### Exit gnuplot Source: https://github.com/hpgavin/frame3dd/blob/main/web/Frame3DD-manual.html Command to terminate the gnuplot session. ```bash gnuplot> quit ``` -------------------------------- ### parseDigit: Parse a single digit character Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Parses one character and checks if it is a digit (0-9). Uses parseAChar and condition, with parseUnGetChar and fail to restore state on failure. The result is stored in the output parameter c. ```C bool parseDigit( parse *p, char *c ) { return ( parseAChar( p, c ) && ( condition( '0' <= *c && *c <= '9' ) || parseUnGetChar( p, *c ) && fail ) ); } ``` -------------------------------- ### Haskell choice operator signature Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html The specialized type signature for the choice operator in Haskell. ```haskell (+++) :: Parser () -> Parser () -> Parser () ``` -------------------------------- ### parseThisString: Parse a specific string Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Attempts to parse a given string character by character. On failure, it ungets the characters it consumed and fails. Uses many, condition, parseThisChar, result, and parseUnGetChar. ```C bool parseThisString( parse *p, char *s ) { int i = 0; return ( many ( condition ( s[i] != '\0' ) && parseThisChar( p, s[i] ) && result ( i++ ) ) && condition ( s[i] == '\0' ) || many ( condition ( i-- >= 0 ) && parseUnGetChar( p, s[i] ) ) && fail ); } ``` -------------------------------- ### parseNumber rewritten with many macro Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Rewritten version of parseNumber using the many macro to combine the digit loop and the return statement into a single expression. Requires GCC for the statement expression. ```C bool parseNumber( parse *p, int *n ) { char s[300]; int i = 0; return ( many ( parseDigit( p, &(s[i]) ) && result ( i++ ) ) && condition ( i > 0 ) && result ( s[i] = '\0' ) && result ( *n = atoi( s ) ) ); } ``` -------------------------------- ### many macro: GCC statement expression for repetition Source: https://github.com/hpgavin/frame3dd/blob/main/src/microstran/parser-combo-c.html Defines a macro 'many' that repeatedly evaluates its argument while it succeeds, using a GCC statement expression. This allows combining loops with return statements in a single expression. ```C #define many(p) ({while(p);1}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.