A simple model of an elastic cantilever column

Figure 1: Elastic Cantilever Column [link]

 

Codes


var theDomain = new OpenSees.Components.DomainWrapper();
theDomain.AddNode(new Components.NodeWrapper(1, 3, 0, 0));
theDomain.AddNode(new Components.NodeWrapper(2, 3, 0, 432));

theDomain.AddSP_Constraint(new Components.Constraints.SP_ConstraintWrapper(1, 0, 0, true));
theDomain.AddSP_Constraint(new Components.Constraints.SP_ConstraintWrapper(1, 1, 0, true));
theDomain.AddSP_Constraint(new Components.Constraints.SP_ConstraintWrapper(1, 2, 0, true));

theDomain.SetMass(2, new MatrixWrapper(new double[3, 3] { { 5.18, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }));

var geoTransf = new OpenSees.Elements.CrdTransfs.LinearCrdTransf2dWrapper();
theDomain.AddElement(new Elements.ElasticBeam2dWrapper(1, 3600e6, 4227, 1080e3, 1, 2, geoTransf, 0, 0, 0, 0));

var savepath = System.Environment.CurrentDirectory + "\\data_ex1-a\\";
if (!System.IO.Directory.Exists(savepath))
    System.IO.Directory.CreateDirectory(savepath);

var recdofs = new OpenSees.IDWrapper(new int[] { 0, 1, 2 });

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\DFree.out");
    var recorder = new OpenSees.Recorders.NodeRecorderWrapper(
        recdofs,
        new OpenSees.IDWrapper(new int[] { 2 }),
        0,
        "disp",
        theDomain,
        opsstream
    );
    theDomain.AddRecorder(recorder);
}

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\DBase.out");
    var recorder = new OpenSees.Recorders.NodeRecorderWrapper(
        recdofs,
        new OpenSees.IDWrapper(new int[] { 1 }),
        0,
        "disp",
        theDomain,
        opsstream
    );
    theDomain.AddRecorder(recorder);
}

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\RBase.out");
    var recorder = new OpenSees.Recorders.NodeRecorderWrapper(
        recdofs,
        new OpenSees.IDWrapper(new int[] { 1 }),
        0,
        "reaction",
        theDomain,
        opsstream
    );
    theDomain.AddRecorder(recorder);
}

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\Drift.out");
    var recorder = new OpenSees.Recorders.DriftRecorderWrapper(new IDWrapper(new int[] { 1 }), new IDWrapper(new int[] { 2 }), 0, 1, theDomain, opsstream, true, 0);
    theDomain.AddRecorder(recorder);
}

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\FCol.out");
    var recorder = new OpenSees.Recorders.ElementRecorderWrapper(
        new IDWrapper(new int[] { 1 }),
        new string[] { "globalForce" },
        true,
        theDomain,
        opsstream
    );
    theDomain.AddRecorder(recorder);
}

{
    var opsstream = new OpenSees.Handlers.DataFileStreamWrapper(savepath + $"\\DCol.out");
    var recorder = new OpenSees.Recorders.ElementRecorderWrapper(
        new IDWrapper(new int[] { 1 }),
        new string[] { "deformation" },
        true,
        theDomain,
        opsstream
    );
    theDomain.AddRecorder(recorder);
}

{
    var theSeries = new OpenSees.Components.Timeseries.LinearSeriesWrapper();
    var theLoadPattern = new OpenSees.Components.LoadPatterns.LoadPatternWrapper(1);
    theLoadPattern.SetTimeSeries(theSeries);
    theDomain.AddLoadPattern(theLoadPattern);
    theDomain.AddNodalLoad(new Components.Loads.NodalLoadWrapper(1, 2, new VectorWrapper(new double[] { 0, -2000, 0 }), false), 1);
}

var theModel = new OpenSees.AnalysisModelWrapper();
var theHandler = new OpenSees.Handlers.PlainHandlerWrapper();
var theNumberer = new OpenSees.Numberers.PlainNumbererWrapper();
var theSolver = new OpenSees.Systems.Linears.BandGenLinLapackSolverWrapper();
var theSOE = new OpenSees.Systems.Linears.BandGenLinSOEWrapper(theSolver);
var test = new OpenSees.ConvergenceTests.CTestNormDispIncrWrapper(1e-8, 6, 2, 2, 1.0e10);
var theSolnAlgo = new OpenSees.Algorithms.NewtonRaphsonWrapper();
var theIntegrator = new OpenSees.Integrators.Static.LoadControlWrapper(0.1, 1, 0.1, 0.1);

var theAnalysis = new OpenSees.Analysis.StaticAnalysisWrapper(
    theDomain,
    theHandler,
    theNumberer,
    theModel,
    theSolnAlgo,
    theSOE,
    theIntegrator,
    test
);

theAnalysis.Analyze(10);

theDomain.SetLoadConst();
theDomain.SetCurrentTime(0);
theDomain.SetCommittedTime(0);

{
    var theSeries = new OpenSees.Components.Timeseries.LinearSeriesWrapper();
    var theLoadPattern = new OpenSees.Components.LoadPatterns.LoadPatternWrapper(2);
    theLoadPattern.SetTimeSeries(theSeries);
    theDomain.AddLoadPattern(theLoadPattern);
    theDomain.AddNodalLoad(new Components.Loads.NodalLoadWrapper(1, 2, new VectorWrapper(new double[] { 2000, 0, 0 }), false), 2);
}

theAnalysis.SetIntegrator(new OpenSees.Integrators.Static.DisplacementControlWrapper(2, 0, 0.1, theDomain, 1, 0.1, 0.1));
theAnalysis.Analyze(1000);
theDomain.GetNode(2).PrintSelf(0);
Console.WriteLine("Done!");

theAnalysis.ClearAll();
theDomain.ClearAll();
                        

# --------------------------------------------------------------------------------------------------
# Example 1. cantilever 2D
# static pushover analysis with gravity.
# all units are in kip, inch, second
# elasticBeamColumn ELEMENT
#			Silvia Mazzoni & Frank McKenna, 2006
#
#    ^Y
#    |
#    2       __ 
#    |         | 
#    |         | 
#    |         | 
#  (1)      36'
#    |         | 
#    |         | 
#    |         | 
#  =1=    ----  -------->X
#

# SET UP ----------------------------------------------------------------------------
wipe;						# clear opensees model
model basic -ndm 2 -ndf 3;				# 2 dimensions, 3 dof per node
file mkdir data; 					# create data directory

# define GEOMETRY -------------------------------------------------------------
# nodal coordinates:
node 1 0 0;					# node#, X Y
node 2 0 432

# Single point constraints -- Boundary Conditions
fix 1 1 1 1; 			# node DX DY RZ

# nodal masses:
mass 2 5.18 0. 0.;					# node#, Mx My Mz, Mass=Weight/g.

# Define ELEMENTS -------------------------------------------------------------
# define geometric transformation: performs a linear geometric transformation of beam stiffness and resisting force from the basic system to the global-coordinate system
geomTransf Linear 1;  		# associate a tag to transformation

# connectivity: (make A very large, 10e6 times its actual value)
element elasticBeamColumn 1 1 2 3600000000 4227 1080000 1;	# element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iz $transfTag

# Define RECORDERS -------------------------------------------------------------
recorder Node -file Data/DFree.out -time -node 2 -dof 1 2 3 disp;			# displacements of free nodes
recorder Node -file Data/DBase.out -time -node 1 -dof 1 2 3 disp;			# displacements of support nodes
recorder Node -file Data/RBase.out -time -node 1 -dof 1 2 3 reaction;			# support reaction
recorder Drift -file Data/Drift.out -time -iNode 1 -jNode 2 -dof 1  -perpDirn 2 ;		# lateral drift
recorder Element -file Data/FCol.out -time -ele 1 globalForce;			# element forces -- column
recorder Element -file Data/DCol.out -time -ele 1 deformation;			# element deformations -- column

# define GRAVITY -------------------------------------------------------------
pattern Plain 1 Linear {
   load 2 0. -2000. 0.;				# node#, FX FY MZ --  superstructure-weight
}
constraints Plain;     				# how it handles boundary conditions
numberer Plain;					# renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral;				# how to store and solve the system of equations in the analysis
test NormDispIncr 1.0e-8 6 ; 				# determine if convergence has been achieved at the end of an iteration step
algorithm Newton;					# use Newton's solution algorithm: updates tangent stiffness at every iteration
integrator LoadControl 0.1;				# determine the next time step for an analysis, # apply gravity in 10 steps
analysis Static					# define type of analysis static or transient
analyze 10;					# perform gravity analysis
loadConst -time 0.0;				# hold gravity constant and restart time

# define LATERAL load -------------------------------------------------------------
# Lateral load pattern
pattern Plain 2 Linear {
	load 2 2000. 0.0 0.0;			# node#, FX FY MZ -- representative lateral load at top node
}

# pushover: diplacement controlled static analysis
integrator DisplacementControl 2 1 0.1;		# switch to displacement control, for node 11, dof 1, 0.1 increment
analyze 1000;				# apply 100 steps of pushover analysis to a displacement of 10
print node 2;
puts "Done!"





                            
@* *@

Ground-motion file  : BM68elc.acc