Вы находитесь на странице: 1из 23

HOMEWORK 2

Discipline: Advanced Earthquake Engineering

Student: Alin Negara

Group: M2 Structural Engineering

Teacher: Prof Fideliu Păuleț-Crăiniceanu

June, 2020
APPLICATION 1

SINGLE DEGREE OF FREEDOM (CANTILEVER)

A single degree-of-freedom (SDOF) system is one whose motion is governed


by a single, second-order differential equation. Only two variables, displacement
and velocity, are needed to describe the trajectory of the system. Many structures
can be idealized as SDOF systems. Understanding how a single degree-of-freedom
system responds to shock provides insights into the fundamental behavior of
general systems.

Problem Statement. Design an SDOF system (cantilever) using the MATLAB


application software to determine the dynamic characteristics.

Progressive Steps in Using MATLAB to Solve SDOF System Problems

a. Input data and simple graphics of the SDOF.


b. Graphics for a recorded earthquake.
c. Dynamic characteristics of the SDOF system.
d. Free undamped/damped response of the SDOF system.
e. Seismic response of the SDOF system (classical).
f. Seismic response of SDOF (in ST).
g. Seismic spectrum of an earthquake.
Input Data

h = 3m
bs = 0.2m
hs = 0.6m
m = 106 kg
csi = 5%
E = 2.1*1011 N/mm2

Simple Graphics
Graphics for Recorded Earthquake

El Centro 1940 NS- Vrancea 1977 EW, NS, UD Kobe 1995 EW, NS, UD
Application 3
Double T sectional characteristics.

Application
double T sectional characteristics

Problem statement
Be a double T section, symmetrical on
vertical direction. Calculate the moments of
inertia of this section on vertical and
horizontal axes directions.
Analysis
The section is divided into three rectangles
(upper flange, web and lower flange)
denoted as number 1, 2 and 3. Then the
next must be calculated:
 Area of each rectangle
A1=bts∗hts ; A2=bi∗hi; A3 =bti∗h ti
 Total area
At = A1 + A2 + A3
Center of gravity (on vertical direction)
3

∑ Ai yi
y g= i=1 =
( h2 +h + h )+ A ∗( h2 + h )+ A ∗h2
A 1∗ ts
i ti 2
i
ti
3 ti

At At
 Moment of inertia for each rectangle
bts∗h ts3 bi∗hi3 bti∗h ti3
I x 1= ; I x 2= ; I x 3=
12 12 12
3 3
hts∗bts hi∗b i hti∗bti 3
I y 1= ; I y 2= ; I y 3=
12 12 12
 Moment of inertia on x direction
hts 2
(
I xg =I x 1+ A 1∗ H− y g−
2
+¿ )
h 2 2
h
( )
+ I x 2 + A 2∗ H− y g−hts − i + I x3 + A 3∗ y g− ti
2 2 ( )
 Moment of inertia on y direction
I yg=I y 1 + I y2 + I y 3

The computer program (Matlab script)


 For the Graphical User Interface, the next Matlab program was generated
and processed, doublet1.m
function varargout = doublet1(varargin)

% Last Modified by GUIDE v2.5 04-Mar-2020 14:50:10

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @doublet1_OpeningFcn, ...

'gui_OutputFcn', @doublet1_OutputFcn, ...

'gui_LayoutFcn', [] , ...

'gui_Callback', []);

if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1});

end

if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

else

gui_mainfcn(gui_State, varargin{:});

end
% End initialization code - DO NOT EDIT

function doublet1_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);

% image

axes(handles.axes1)

mim=imread('dt1.png');

hdl1=image(mim);

axis off

% image

proc(handles)

function varargout = doublet1_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;

function axes1_CreateFcn(hObject, eventdata, handles)

function edit1_Callback(hObject, eventdata, handles)

proc(handles)

function edit1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');
end

function edit2_Callback(hObject, eventdata, handles)

proc(handles)

function edit2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

function edit3_Callback(hObject, eventdata, handles)

proc(handles)

function edit3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

function edit4_Callback(hObject, eventdata, handles)

proc(handles)

function edit4_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');
end

function edit5_Callback(hObject, eventdata, handles)

proc(handles)

function edit5_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

function edit6_Callback(hObject, eventdata, handles)

proc(handles)

function edit6_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

function pushbutton1_Callback(hObject, eventdata, handles)

close

 The Matlab function used for input data, intermediate calculations and
output data (on GUI) processing
function proc(handles)

disp('data process')

[bts,ok1]=str2num(get(handles.edit1,'String'));
[bi,ok2]=str2num(get(handles.edit2,'String'));

[bti,ok3]=str2num(get(handles.edit3,'String'));

[hts,ok4]=str2num(get(handles.edit4,'String'));

[hi,ok5]=str2num(get(handles.edit5,'String'));

[hti,ok6]=str2num(get(handles.edit6,'String'));

if (ok1*ok2*ok3*ok4*ok5*ok6==0) | ...

bts<=0 | bi<=0 | bti<=0 | hts<=0 | hi<=0 | hti<=0

set(handles.text8,'String','Wrong input data!')

else

set(handles.text8,'String','Good input data!')

H=hts+hi+hti; set(handles.text10,'String',num2str(H))

A1=bts*hts; A2=bi*hi; A3=bti*hti;


At=A1+A2+A3;

yg=(A1*(hts/2+hi+hti)+A2*(hi/2+hti)
+A3*hti/2)/At;

set(handles.text12,'String',num2str(yg))

Ix1=bts*hts^3/12; Ix2=bi*hi^3/12;
Ix3=bti*hti^3/12;

Ixg=Ix1+A1*(H-yg-hts/2)^2+Ix2+A2*(H-yg-hts-
hi/2)^2+...

Ix3+A3*(yg-hti/2)^2;

set(handles.text14,'String',num2str(Ixg))

Iy1=hts*bts^3/12; Iy2=hi*bi^3/12;
Iy3=hti*bti^3/12;

Iyg=Iy1+Iy2+Iy3;

set(handles.text16,'String',num2str(Iyg))
end

 GUI design
The GUI is composed from (see also the ”Object Browser” capture):

- title ”Section Characteristics” (text7)

- drawing space (axes1)

- ”Input data” panel (uipanel1) containing

- text1 (”bts”) and edit1 for the value

- text2 (”bi”) and edit2 for the value

- text3 (”bti”) and edit3 for the value

- text4 (”hts”) and edit4 for the value

- text5 (”hi”) and edit5 for the value

- text6 (”hti”) and edit6 for the value

- ”!” panel (uipanel2) containing

- text8 (”messages”) for warnings on data

-”Results” panel (uipanel4) containing

- text9 (”H=”) and text10 for the value

- text11 (”yg=”) and text12 for the value

- text13 (”Ixg=”) and text14 for the value

- text15 (”Iyg=”) and text16 for the value

- pushbutton1 (”final”) for closing the GUI.


Results
 At the starting point, the GUI shows as
 In the case of wrong or incomplete data, the GUI might look as:

 Next results are shown as examples of use:


The first result is the case for a common double T section, while the second case is used for verifications
purposes (i.e. the section is actually a square with edges lengths equal to 3).

Comments
 Using Graphical User Interfaces, GUIs, makes the product (Matalab script) to be
easier to manipulate and the input data easier to use and change, if needed.
Results are clearly shown and more systematic.
 The drawing inside the GUI presents the physical parameters (input data) – in
this case, the elements of the double T section, the dimensions and the notations
are seen.
 Through the time dedicated for GUI realization, a more friendly computer
program is obtained. This program could be passed for use of Matlab non-
experienced programmers and could be later modified for other purposes.
 Use of GUIs might be proposed for adapting existing, classical Matlab programs
(without GUIs) in order to open them to a larger range of users.
Note the figure included in the GUI
 The initial drawing from the Graphical User Interface (GUI) above was
realized in MS Word (see the file DubT.docx).
 At the end of the above drawing, all the elements of the drawing had been
grouped and its dimensions had been noticed.
 Then, Word’s page dimensions had been reduced (with 0 margins) such a
way that the already created drawing could fill in a square page. Any other
proportions between the page’s dimensions could be chosen. This
proportion should be later respected in the axes1 object of the GUI. – see
the file DubT2.docx.
 The file DubT2.docx is saved in the pdf format (DubT2.pdf).
 The pdf file, DubT2.pdf, is open with (for example) Adobe Reader and the
image is selected.
 Optionally, in Adobe Reader, the figure resolution can be changed (with
zoom) and it is copied (CTRL/C).
 MS Paint (or any other image editor) is open and the image copied from the
pdf file is transferred to it (CTRL/V).
 From Paint the image is saved in a chosen format, for example png – see
the file dt1.png.
Appendix no. 2. The App Designer’s generated program and author’s
interventions (marked in yellow)

classdef doublet1 < matlab.apps.AppBase


% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
SectioncharacteristicsLabel matlab.ui.control.Label
finishButton matlab.ui.control.Button
Panel matlab.ui.container.Panel
messagesLabel matlab.ui.control.Label
Image matlab.ui.control.Image
InputdataPanel matlab.ui.container.Panel
btsEditFieldLabel matlab.ui.control.Label
btsEditField matlab.ui.control.NumericEditField
biEditFieldLabel matlab.ui.control.Label
biEditField matlab.ui.control.NumericEditField
btiEditFieldLabel matlab.ui.control.Label
btiEditField matlab.ui.control.NumericEditField
htsEditFieldLabel matlab.ui.control.Label
htsEditField matlab.ui.control.NumericEditField
hiEditFieldLabel matlab.ui.control.Label
hiEditField matlab.ui.control.NumericEditField
htiEditFieldLabel matlab.ui.control.Label
htiEditField matlab.ui.control.NumericEditField
ResultsPanel matlab.ui.container.Panel
htiEditFieldLabel_2 matlab.ui.control.Label
HEditFieldLabel matlab.ui.control.Label
HEditFieldLabel_2 matlab.ui.control.Label
htiEditFieldLabel_3 matlab.ui.control.Label
HEditFieldLabel_3 matlab.ui.control.Label
htiEditFieldLabel_4 matlab.ui.control.Label
HEditFieldLabel_4 matlab.ui.control.Label
htiEditFieldLabel_5 matlab.ui.control.Label
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
proc(app)
end

% Button pushed function: finishButton


function finishButtonPushed(app, event)
closereq
end
% Value changed function: btsEditField
function btsEditFieldValueChanged(app, event)
proc(app)
end
% Value changed function: biEditField
function biEditFieldValueChanged(app, event)
proc(app)
end
% Value changed function: btiEditField
function btiEditFieldValueChanged(app, event)
proc(app)
end
% Value changed function: htsEditField
function htsEditFieldValueChanged(app, event)
proc(app)
end
% Value changed function: hiEditField
function hiEditFieldValueChanged(app, event)
proc(app)
end
% Value changed function: htiEditField
function htiEditFieldValueChanged(app, event)
proc(app)
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 701 596];
app.UIFigure.Name = 'MATLAB App';
% Create SectioncharacteristicsLabel
app.SectioncharacteristicsLabel = uilabel(app.UIFigure);
app.SectioncharacteristicsLabel.FontSize = 24;
app.SectioncharacteristicsLabel.FontColor = [0 0 1];
app.SectioncharacteristicsLabel.Position = [84 553 248 30];
app.SectioncharacteristicsLabel.Text = 'Section characteristics';

% Create finishButton
app.finishButton = uibutton(app.UIFigure, 'push');
app.finishButton.ButtonPushedFcn = createCallbackFcn(app,
@finishButtonPushed, true);
app.finishButton.BackgroundColor = [0.5922 0.7686 0.4627];
app.finishButton.FontSize = 24;
app.finishButton.Position = [1 1 100 37];
app.finishButton.Text = 'finish';
% Create Panel
app.Panel = uipanel(app.UIFigure);
app.Panel.Title = '!';
app.Panel.FontSize = 24;
app.Panel.Position = [48 61 334 74];
% Create messagesLabel
app.messagesLabel = uilabel(app.Panel);
app.messagesLabel.BackgroundColor = [0.902 0.7725 0.4784];
app.messagesLabel.HorizontalAlignment = 'center';
app.messagesLabel.FontSize = 18;
app.messagesLabel.Position = [19 8 295 31];
app.messagesLabel.Text = 'messages';
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Position = [15 144 400 400];
app.Image.ImageSource = 'dt1.png';
% Create InputdataPanel
app.InputdataPanel = uipanel(app.UIFigure);
app.InputdataPanel.ForegroundColor = [0.4667 0.6745 0.1882];
app.InputdataPanel.Title = 'Input data';
app.InputdataPanel.BackgroundColor = [0.8902 0.7569 0.4431];
app.InputdataPanel.FontSize = 24;
app.InputdataPanel.Position = [442 257 249 287];
% Create btsEditFieldLabel
app.btsEditFieldLabel = uilabel(app.InputdataPanel);
app.btsEditFieldLabel.HorizontalAlignment = 'right';
app.btsEditFieldLabel.FontSize = 24;
app.btsEditFieldLabel.Position = [18 219 65 30];
app.btsEditFieldLabel.Text = 'bts = ';
% Create btsEditField
app.btsEditField = uieditfield(app.InputdataPanel, 'numeric');
app.btsEditField.ValueChangedFcn = createCallbackFcn(app,
@btsEditFieldValueChanged, true);
app.btsEditField.FontSize = 24;
app.btsEditField.Position = [82 220 146 30];

% Create biEditFieldLabel
app.biEditFieldLabel = uilabel(app.InputdataPanel);
app.biEditFieldLabel.HorizontalAlignment = 'right';
app.biEditFieldLabel.FontSize = 24;
app.biEditFieldLabel.Position = [31 178 52 30];
app.biEditFieldLabel.Text = 'bi = ';
% Create biEditField
app.biEditField = uieditfield(app.InputdataPanel, 'numeric');
app.biEditField.ValueChangedFcn = createCallbackFcn(app,
@biEditFieldValueChanged, true);
app.biEditField.FontSize = 24;
app.biEditField.Position = [82 179 146 30];
% Create btiEditFieldLabel
app.btiEditFieldLabel = uilabel(app.InputdataPanel);
app.btiEditFieldLabel.HorizontalAlignment = 'right';
app.btiEditFieldLabel.FontSize = 24;
app.btiEditFieldLabel.Position = [25 137 58 30];
app.btiEditFieldLabel.Text = 'bti = ';
% Create btiEditField
app.btiEditField = uieditfield(app.InputdataPanel, 'numeric');
app.btiEditField.ValueChangedFcn = createCallbackFcn(app,
@btiEditFieldValueChanged, true);
app.btiEditField.FontSize = 24;
app.btiEditField.Position = [82 138 146 30];
% Create htsEditFieldLabel
app.htsEditFieldLabel = uilabel(app.InputdataPanel);
app.htsEditFieldLabel.HorizontalAlignment = 'right';
app.htsEditFieldLabel.FontSize = 24;
app.htsEditFieldLabel.Position = [18 96 65 30];
app.htsEditFieldLabel.Text = 'hts = ';
% Create htsEditField
app.htsEditField = uieditfield(app.InputdataPanel, 'numeric');
app.htsEditField.ValueChangedFcn = createCallbackFcn(app,
@htsEditFieldValueChanged, true);
app.htsEditField.FontSize = 24;
app.htsEditField.Position = [82 97 146 30];
% Create hiEditFieldLabel
app.hiEditFieldLabel = uilabel(app.InputdataPanel);
app.hiEditFieldLabel.HorizontalAlignment = 'right';
app.hiEditFieldLabel.FontSize = 24;
app.hiEditFieldLabel.Position = [31 55 52 30];
app.hiEditFieldLabel.Text = 'hi = ';
% Create hiEditField
app.hiEditField = uieditfield(app.InputdataPanel, 'numeric');
app.hiEditField.ValueChangedFcn = createCallbackFcn(app,
@hiEditFieldValueChanged, true);
app.hiEditField.FontSize = 24;
app.hiEditField.Position = [82 56 146 30];
% Create htiEditFieldLabel
app.htiEditFieldLabel = uilabel(app.InputdataPanel);
app.htiEditFieldLabel.HorizontalAlignment = 'right';
app.htiEditFieldLabel.FontSize = 24;
app.htiEditFieldLabel.Position = [25 14 58 30];
app.htiEditFieldLabel.Text = 'hti = ';
% Create htiEditField
app.htiEditField = uieditfield(app.InputdataPanel, 'numeric');
app.htiEditField.ValueChangedFcn = createCallbackFcn(app,
@htiEditFieldValueChanged, true);
app.htiEditField.FontSize = 24;
app.htiEditField.Position = [82 15 146 30];
% Create ResultsPanel
app.ResultsPanel = uipanel(app.UIFigure);
app.ResultsPanel.ForegroundColor = [0 0.4471 0.7412];
app.ResultsPanel.Title = 'Results';
app.ResultsPanel.BackgroundColor = [0.6353 0.6863 0.9098];
app.ResultsPanel.FontSize = 24;
app.ResultsPanel.Position = [442 37 249 204];
% Create htiEditFieldLabel_2
app.htiEditFieldLabel_2 = uilabel(app.ResultsPanel);
app.htiEditFieldLabel_2.BackgroundColor = [0.902 0.902 0.902];
app.htiEditFieldLabel_2.HorizontalAlignment = 'right';
app.htiEditFieldLabel_2.FontSize = 24;
app.htiEditFieldLabel_2.Position = [18 131 58 30];
app.htiEditFieldLabel_2.Text = 'H = ';
% Create HEditFieldLabel
app.HEditFieldLabel = uilabel(app.ResultsPanel);
app.HEditFieldLabel.BackgroundColor = [0.902 0.902 0.902];
app.HEditFieldLabel.HorizontalAlignment = 'right';
app.HEditFieldLabel.FontSize = 24;
app.HEditFieldLabel.Position = [82 131 146 30];
app.HEditFieldLabel.Text = '';
% Create HEditFieldLabel_2
app.HEditFieldLabel_2 = uilabel(app.ResultsPanel);
app.HEditFieldLabel_2.BackgroundColor = [0.902 0.902 0.902];
app.HEditFieldLabel_2.HorizontalAlignment = 'right';
app.HEditFieldLabel_2.FontSize = 24;
app.HEditFieldLabel_2.Position = [82 91 146 30];
app.HEditFieldLabel_2.Text = '';
% Create htiEditFieldLabel_3
app.htiEditFieldLabel_3 = uilabel(app.ResultsPanel);
app.htiEditFieldLabel_3.BackgroundColor = [0.902 0.902 0.902];
app.htiEditFieldLabel_3.HorizontalAlignment = 'right';
app.htiEditFieldLabel_3.FontSize = 24;
app.htiEditFieldLabel_3.Position = [18 91 58 30];
app.htiEditFieldLabel_3.Text = 'yg = ';
% Create HEditFieldLabel_3
app.HEditFieldLabel_3 = uilabel(app.ResultsPanel);
app.HEditFieldLabel_3.BackgroundColor = [0.902 0.902 0.902];
app.HEditFieldLabel_3.HorizontalAlignment = 'right';
app.HEditFieldLabel_3.FontSize = 24;
app.HEditFieldLabel_3.Position = [82 51 146 30];
app.HEditFieldLabel_3.Text = '';
% Create htiEditFieldLabel_4
app.htiEditFieldLabel_4 = uilabel(app.ResultsPanel);
app.htiEditFieldLabel_4.BackgroundColor = [0.902 0.902 0.902];
app.htiEditFieldLabel_4.HorizontalAlignment = 'right';
app.htiEditFieldLabel_4.FontSize = 24;
app.htiEditFieldLabel_4.Position = [11 51 65 30];
app.htiEditFieldLabel_4.Text = 'Ixg = ';
% Create HEditFieldLabel_4
app.HEditFieldLabel_4 = uilabel(app.ResultsPanel);
app.HEditFieldLabel_4.BackgroundColor = [0.902 0.902 0.902];
app.HEditFieldLabel_4.HorizontalAlignment = 'right';
app.HEditFieldLabel_4.FontSize = 24;
app.HEditFieldLabel_4.Position = [82 11 146 30];
app.HEditFieldLabel_4.Text = '';
% Create htiEditFieldLabel_5
app.htiEditFieldLabel_5 = uilabel(app.ResultsPanel);
app.htiEditFieldLabel_5.BackgroundColor = [0.902 0.902 0.902];
app.htiEditFieldLabel_5.HorizontalAlignment = 'right';
app.htiEditFieldLabel_5.FontSize = 24;
app.htiEditFieldLabel_5.Position = [11 11 65 30];
app.htiEditFieldLabel_5.Text = 'Iyg = ';
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = doublet1
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
% Execute the startup function
runStartupFcn(app, @startupFcn)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end

Вам также может понравиться