TREBALL FINAL DE GRAU

Size: px
Start display at page:

Download "TREBALL FINAL DE GRAU"

Transcription

1 Estudi del procés constructiu de ponts atirantats construïts sobre suports provisionals. ANNEXOS Treball realitzat per: Joan Fraile Diana Dirigit per: José Turmo Coderque Jose Antonio Lozano Galant Grau en: Enginyeria Civil Barcelona, 20 de Setembre de 2017 Departament d Enginyeria de la Construcció TREBALL FINAL DE GRAU

2 Estudi del procés constructiu de ponts atirantats construïts sobre suports provisionals Joan Fraile Diana Grau en Enginyeria Civil

3 Estudi del procés constructiu de ponts atirantats sobre suports Autor: Joan Fraile Diana Annex 1 Codi MATLAB per esforços en barres i

4 5/09/17 16:51 C:\Users\caminstech...\VectorNodalForces.m 1 of 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % STIFFNESS METHOD FOR SOLVING STRUCTURES (PORTAL2) % % % % JOAN FRAILE DIANA % % % % DISSERTATION PROJECT FOR BACHELOR IN CIVIL ENGINEERING % % POLYTECHNIC UNIVERSITY OF CATALONIA, YEAR % % % % % % Latest version 15 of August 2017 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % That script converts the uniform distributed loads into loads aplied on % the nodes of the studied structure and it adds together with the node % loads applied to the structure. function [NodalForces]=VectorNodalForces global knownux1ux2uy1uy2uz1uz2umxumyumz global valueux1ux2uy1uy2uz1uz2umxumyumz global knownfx1fy1fz1mx1my1mz1fx2fy2fz2mx2my2mz2 global valuefx1fy1fz1mx1my1mz1fx2fy2fz2mx2my2mz2 L=16; knownux1ux2uy1uy2uz1uz2umxumyumz={[1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]}; valueux1ux2uy1uy2uz1uz2umxumyumz={[0]; [0]; [0]; [0]; [-205]; [-205]; [0]; [0]; [0]}; knownfx1fy1fz1mx1my1mz1fx2fy2fz2mx2my2mz2={[1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]; [1]}; valuefx1fy1fz1mx1my1mz1fx2fy2fz2mx2my2mz2={[0]; [0]; [0]; [0]; [0]; [0]; [0]; [0]; [0]; [0]; [0]; [0]}; Muxx1=(-(-L^2/60)*(3*valueux1ux2uy1uy2uz1uz2umxumyumz{1} +2*valueux1ux2uy1uy2uz1uz2umxumyumz{2})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{4}); Muxx2=(-(-L^2/60)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{1} +3*valueux1ux2uy1uy2uz1uz2umxumyumz{2})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2 {10}); Ruxx1=(-(L/6)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{1}+valueux1ux2uy1uy2uz1uz2umxumyumz {2})-((Muxx1-Muxx2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{1}); Ruxx2=(-(L/6)*(valueux1ux2uy1uy2uz1uz2umxumyumz{1}+2*valueux1ux2uy1uy2uz1uz2umxumyumz {2})-((Muxx1-Muxx2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{7}); Muyy1=(-(-L^2/60)*(3*valueux1ux2uy1uy2uz1uz2umxumyumz{3} +2*valueux1ux2uy1uy2uz1uz2umxumyumz{4})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{5}); Muyy2=(-(-L^2/60)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{3} +3*valueux1ux2uy1uy2uz1uz2umxumyumz{4})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2 {11}); Ruyy1=(-(L/6)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{3}+valueux1ux2uy1uy2uz1uz2umxumyumz {4})-((Muyy1-Muyy2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{2}); Ruyy2=(-(L/6)*(valueux1ux2uy1uy2uz1uz2umxumyumz{3}+2*valueux1ux2uy1uy2uz1uz2umxumyumz {4})-((Muyy1-Muyy2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{8}); Muzz1=(-(-L^2/60)*(3*valueux1ux2uy1uy2uz1uz2umxumyumz{5} +2*valueux1ux2uy1uy2uz1uz2umxumyumz{6})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{6}); Muzz2=(-(-L^2/60)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{5} +3*valueux1ux2uy1uy2uz1uz2umxumyumz{6})+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2 {12}); Ruzz1=(-(L/6)*(2*valueux1ux2uy1uy2uz1uz2umxumyumz{5}+valueux1ux2uy1uy2uz1uz2umxumyumz {6})-((Muzz1-Muzz2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{3});

5 5/09/17 16:51 C:\Users\caminstech...\VectorNodalForces.m 2 of 2 Ruzz2=(-(L/6)*(valueux1ux2uy1uy2uz1uz2umxumyumz{5}+2*valueux1ux2uy1uy2uz1uz2umxumyumz {6})-((Muzz1-Muzz2)/L)+valueFx1Fy1Fz1Mx1My1Mz1Fx2Fy2Fz2Mx2My2Mz2{9}); NodalForces=[Ruxx1; Ruxx2; Ruyy1; Ruyy2; Ruzz1; Ruzz2; Muxx1; Muxx2; Muyy1; Muyy2; Muzz1; Muzz2]; %Plotting information fid=fopen('nodalforces.txt','wt'); fprintf(fid,' fx1= %d\n fx2= %d\n fy1= %d\n fy2= %d\n fz1= %d\n fz2= %d\n mx1= %d\n mx2= %d\n my1= %d\n my2= %d\n mz1= %d\n mz2= %d\n', NodalForces); fclose(fid);

6 Estudi del procés constructiu de ponts atirantats sobre suports Autor: Joan Fraile Diana Annex 2 Codi MATLAB espacial ii

7 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 1 of 26 function varargout = Portal2(varargin) % PORTAL2 MATLAB code for Portal2.fig % PORTAL2, by itself, creates a new PORTAL2 or raises the existing % singleton*. % % H = PORTAL2 returns the handle to a new PORTAL2 or the handle to % the existing singleton*. % % PORTAL2('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in PORTAL2.M with the given input arguments. % % PORTAL2('Property','Value',...) creates a new PORTAL2 or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before Portal2_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to Portal2_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help Portal2 % Last Modified by GUIDE v AUG :26h % Begin initialization code - DO NOT EDIT gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Portal2 is made visible. function Portal2_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hobject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to Portal2 (see VARARGIN) clc, diary off %--- Centers the interface

8 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 2 of 26 scrsz=get(0,'screensize'); %screen size [x0,y0,width,high] act_pos=get(gcf,'position'); xp=round((scrsz(3)-act_pos(3))/2); yp=round((scrsz(4)-act_pos(4))/2); set(gcf,'position',[xp yp act_pos(3) act_pos(4)]) % Choose default command line output for Portal2 handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Portal2 wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Portal2_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hobject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % FULL OBSERVABILITY PACKAGE % % In this program, "Iz" is "EIz", Iy is "EIy" and "A" is "EA" % % % % INITIAL DATA % a) load example and plot function Select_Example_Callback(hObject, eventdata, handles) global Example ScreenOption global nodecoordinates beams global nnodes nbeams theta beamlength nsize global DisplaNames ForcesNames Shearrotation v %--- Selects the file to import_data and loads posible examples [FileName,PathName,res_ok]=uigetfile('*.m','Open a data file'); if res_ok pathf=[pathname FileName]; FileName=FileName(1:-2); cases={}; %--- Read the posible cases fid=fopen(pathf, 'r'); try while ~feof(fid) %read line by line tline = fgetl(fid); %reads the next line if strfind(tline,'case') %find the word 'case' pos=strfind(tline,''''); %find the '' aux=tline(pos(1)+1:pos(2)-1); cases=[cases, aux];

9 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 3 of 26 fclose(fid); if ~isempty(cases) %--- Show these cases. When there is a selection, export_data the data [NExample,ok]=listdlg('PromptString','Select a case:','selectionmode','single','listsize',[ ],'ListString',cases); if ok Example=sprintf('''%s''',char(cases(NExample))); set(handles.title, 'String', upper(cases(nexample))) eval(sprintf('%s(%s)',filename,example)) return %--- Clear previous calculus clearportal('nivel0',handles) %--- Updates the menu visibility set(handles.select_example, 'Check', 'on'); set(handles.direct_analysis, 'Enable', 'on'); set(handles.export_data, 'Enable', 'on'); set(handles.import_data, 'Enable', 'on'); cla(handles.squeme,'reset'); set(handles.squeme,'visible', 'off'); %--- Some options choice = questdlg('select a type of report','report','only summary','on screen','plotting for latex','only summary'); switch choice case 'Only summary' ScreenOption=0; case 'On screen' ScreenOption=1; case 'Plotting for latex' ScreenOption=2; %plotting for latex beams); squeme) %--- Initial evaluations PrepareReport2(Example); [nnodes,nbeams,theta,beamlength,nsize]=evaluategeneralinfo2(nodecoordinates, %PlotNetwork2(Example,beams,nodecoordinates,nnodes,nbeams,theta,handles. %CheckData2(nbeams) [ForcesNames,DisplaNames]=ForcesandDisplacements2(nnodes); Shearrotation=0; %--- Poisson v=0.25; warndlg('this file does not contain this kind of data.','error in Open File','modal');

10 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 4 of 26 % b) DIRECT ANALYSIS function Direct_Callback(hObject, eventdata, handles) global beams nnodes nbeams beamlength nsize nodecoordinates global measur_values reactions theta Shearrotation %--- "Calculating" bar h = waitbar(1,'calculating. Please wait...'); set(findobj(h,'type','patch'),'edgecolor','b','facecolor','b') for i=1:50 waitbar(i/100) %--- Calculate the stiffness matrix solution [measur_values,reactions]=stiffnessmatrixsolution2(beams,beamlength,nnodes,nbeams, nsize,nodecoordinates,theta); %--- Updates the menu visibility set(handles.measurements, 'Enable', 'on'); set(handles.loads, 'Enable', 'on'); set(handles.measurements, 'Check', 'off'); set(handles.loads, 'Check', 'off'); set(handles.enable, 'Check', 'on'); set(handles.shear_rotation, 'Check', 'off'); set(handles.perform_analysis, 'Check', 'on'); set(handles.h_displacements, 'Enable', 'on'); set(handles.h_displacements, 'Check', 'off'); set(handles.select_measurements, 'Enable', 'off'); set(handles.results_panel, 'Visible', 'off'); set(handles.execute, 'Enable', 'off'); Shearrotation=0; %--- "Calculating" bar for i=51:100 waitbar(i/100) pause(0.75) close(h) % c) CALCULUS function Execute_Callback(hObject, eventdata, handles) global beams nodecoordinates global ScreenOption global nnodes nbeams theta beamlength nsize global error global ForcesNames Measurement_set %--- Error input ok=0; while ~ok % a) ask for data prompt={'error: if exist('error','var')&& ~isempty(error) defaultvalue={num2str(error,'%-8.4e')}; '};

11 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 5 of 26 defaultvalue={'1e-14'}; answer_str = inputdlg(prompt,'error value',1,defaultvalue); % b) transform to number aux=str2double(answer_str); if isempty(aux) return if isnumeric(aux)&& aux>0 error=aux; ok=1; % c.1) change the default answer defaultanswer=answer_str; %--- "Calculating" bar h = waitbar(1,'calculating. Please wait...'); set(findobj(h,'type','patch'),'edgecolor','b','facecolor','b') for i=1:50 waitbar(i/100) %--- Create the modify stiffness matrix, the variable names associated with the GSM and vector of forces GSM=AssemblingModifiedStiffnessMatrixNEW2(beams,beamlength,nodecoordinates,nnodes, nbeams,nsize); [GSM,GSMVarsNames]=CreateGSMVarNames2(GSM,nsize,nbeams,beams); ForcesNames=CreateForcesVector2(nnodes); %--- Identify the known variables and impose the boundary conditions [KnownName,valuevars]=ReadKnownVars2(ForcesNames,nnodes,nbeams); [GSM,GSMVarsNames,KnownForces,KnownForcesValues]=BoundaryCond2(GSM,GSMVarsNames, ForcesNames,KnownName,valuevars); %--- Rearranging the system of equations B.z=d [B,z,d]=BuildMatrixB2(GSM,GSMVarsNames,ForcesNames,KnownForces,KnownForcesValues); %--- Compute the numeric result [Cumvars,Cumres]=EvalRes2(B,z,d); %--- Display the measurement set n=length(cumvars); if n==0 fprintf('\n ERROR --> No results obtained \n \n'); % RES=cell(n,2); % RES(:,1)=Cumvars; % for i=1:n % RES{i,2}=Cumres(i); % % % % b) loads data in table % set(handles.resvars_table, 'Data', RES);

12 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 6 of 26 %--- Close figure try close Measurements %--- Updates the menu visibility set(handles.results_panel, 'Visible', 'on'); set(handles.measurements_name, 'Data', Measurement_set); set(handles.execute, 'Enable', 'off'); set(handles.perform_analysis, 'Check', 'off'); %--- "Calculating" bar for i=51:100 waitbar(i/100) pause(0.75) close(h) % Delete all variables except Cumvars Cumres and measur_values clearvars -except Cumvars Cumres measur_values % OPTIONS MENU function Enable_Callback(hObject, eventdata, handles) %--- Updates the menu visibility set(handles.measurements, 'Enable', 'on'); set(handles.loads, 'Enable', 'on'); set(handles.h_displacements, 'Enable', 'on'); set(handles.enable, 'Check', 'on'); % --- Include the shear rotation in the direct analysis function Shear_Rotation_Callback(hObject, eventdata, handles) global Shearrotation Checked=get(handles.Shear_Rotation, 'Checked'); if Checked(1:2)=='of' Shearrotation=1; %--- Updates the menu visibility set(handles.shear_rotation, 'Check', 'on'); fprintf('\n Observability doesnt work with the shear rotation (Future work) \n'); Shearrotation=0; %--- Updates the menu visibility set(handles.shear_rotation, 'Check', 'off'); %--- Updates the menu visibility set(handles.perform_analysis, 'Check', 'off'); % --- Exclude horitzontal displacements (u) from the Observability function h_displacements_callback(hobject, eventdata, handles) global measur_values DisplaNames

13 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 7 of 26 cont=1; if ~exist('measur_values','var') isempty(measur_values) leng=length(displanames); for i=1:leng aux=char(displanames(i)); aux2=aux(1); if aux2~='dx' DisplaNames2(cont)=cellstr(aux); cont=cont+1; val=num2cell(zeros(cont-1,1)); measur_values={displanames2',cell2mat(val)}; var=(measur_values{1}); num=num2cell(cell2mat(measur_values(2))); for i=1:length(var) auxvar=char(var(i)); aux2=auxvar(1); auxval=num(i); if aux2~='dx' var2(cont)=cellstr(auxvar); num2(cont)=auxval; cont=cont+1; measur_values={var2' cell2mat(num2')}; %--- Updates the menu visibility set(handles.h_displacements, 'Check', 'on'); % --- Import the results of the direct analysis and organize the data in (dx,dy,dz,wx, wy,wz) function Measurements_Callback(hObject, eventdata, handles) global measur_values DisplaNames vardx={}; numdx=[]; vardy={}; numdy=[]; vardz={}; numdz=[]; varwx={}; numwx=[]; varwy={}; numwy=[]; varwz={}; numwz=[]; %--- Create the table measur_values whit all values iqual to zero if ~exist('measur_values','var') isempty(measur_values) leng=length(displanames); var=displanames; num=(zeros(leng,1));

14 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 8 of 26 cont=1; cont1=1; cont2=1; cont3=1; cont4=1; cont5=1; for i=1:length(var) auxvar=char(var(i)); aux2=auxvar(1); auxval=num(i); if aux2=='dx' vardx(cont)=cellstr(auxvar); numdx(cont)=auxval; cont=cont+1; if aux2=='dy' vardy(cont1)=cellstr(auxvar); numdy(cont1)=auxval; cont1=cont1+1; if aux2=='dz' vardz(cont2)=cellstr(auxvar); numdz(cont2)=auxval; cont2=cont2+1; if aux2=='wx' varwx(cont3)=cellstr(auxvar); numwx(cont3)=auxval; cont3=cont3+1; if aux2=='wy' varwy(cont4)=cellstr(auxvar); numwy(cont4)=auxval; cont4=cont4+1; varwz(cont5)=cellstr(auxvar); numwz(cont5)=auxval; cont5=cont5+1; var=[vardx';vardy';vardz';varwx';varwy';varwz']; num=[numdx';numdy';numdz';numwx';numwy';numwz']; value=[var,num2cell(num)]; measur_values={displanames,num}; aux=intromeasurements2(value); %--- Import values from the direct analysis var=(measur_values{1}); num=num2cell(cell2mat(measur_values(2))); cont=1; cont1=1; cont2=1; cont3=1; cont4=1; cont5=1; for i=1:length(var) auxvar=char(var(i)); aux2=auxvar(1);

15 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 9 of 26 auxval=cell2mat(num(i)); if aux2=='dx' vardx(cont)=cellstr(auxvar); numdx(cont)=auxval; cont=cont+1; if aux2=='dy' vardy(cont1)=cellstr(auxvar); numdy(cont1)=auxval; cont1=cont1+1; if aux2=='dz' vardz(cont2)=cellstr(auxvar); numdz(cont2)=auxval; cont2=cont2+1; if aux2=='wx' varwx(cont3)=cellstr(auxvar); numwx(cont3)=auxval; cont3=cont3+1; if aux2=='wy' varwy(cont4)=cellstr(auxvar); numwy(cont4)=auxval; cont4=cont4+1; varwz(cont5)=cellstr(auxvar); numwz(cont5)=auxval; cont5=cont5+1; var=[vardx';vardy';vardz';varwx';varwy';varwz']; num=[numdx';numdy';numdz';numwx';numwy';numwz']; value=[var,num2cell(num)]; aux=intromeasurements2(value); %--- Updates the menu visibility set(handles.measurements, 'Check', 'on'); % --- Import the loads from the ReadDATA function Loads_Callback(hObject, eventdata, handles) global loads_values nnodes ForcesNames global knownfxfyfzmxmymz valuefxfyfzmxmymz %--- Import_data the window to introduce the loads aux1=1; aux2=1; for i=1:nnodes*6 if aux1==1 loads_values{i,1}=sprintf('rx%04.0f',aux2); aux1=aux1+1; if aux1==2 loads_values{i,1}=sprintf('ry%04.0f',aux2); aux1=aux1+1; if aux1==3 loads_values{i,1}=sprintf('rz%04.0f',aux2); aux1=aux1+1; if aux1==4

16 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 10 of 26 loads_values{i,1}=sprintf('mx%04.0f',aux2); aux1=aux1+1; if aux1==5 loads_values{i,1}=sprintf('my%04.0f',aux2); aux1=aux1+1; loads_values{i,1}=sprintf('mz%04.0f',aux2); aux1=1; aux2=aux2+1; for i=1:6 aux=length(knownfxfyfzmxmymz{i}); if aux~=0; if i==1 var=('rx'); if i==2 var=('ry'); if i==3 var=('rz'); if i==4 var=('mx'); if i==5 var=('my'); var=('mz'); for j=1:aux auxf=knownfxfyfzmxmymz{i}(j); valf=valuefxfyfzmxmymz{i}(j); for l=1:length(loads_values) aux1=char(loads_values(l)); auxl=aux1(1:1); auxload=str2double(aux1(2:)); if auxf==auxload && var==auxl loads_values{l,2}=valf; aux=introloads2(loads_values); %--- Updates the menu visibility set(handles.loads, 'Check', 'on'); set(handles.select_measurements, 'Enable', 'on'); % --- Select the measurement set function select_measurements_callback(hobject, eventdata, handles) global measur_values t % Hint: get(hobject,'value') returns toggle state of checkbox1 var=(measur_values{1}); aux=length(var);

17 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 11 of 26 count=0; high=24+aux*20; if high>=644 high=644; f = figure('position',[ high],'dockcontrols','off',... 'MenuBar','none','NumberTitle','off','Name','Measurements'); for i=1:aux num(i)={false}; count=count+1; index(i)={count}; yourdata =[transpose(index) var transpose(num)]; columnname = {'Index', 'Displacements', 'Check'}; columnformat = {'char', 'char', 'logical'}; columneditable = [false false true]; t = uitable('units','normalized','position',[ ], 'Data', yourdata,... 'ColumnName', columnname,'columnformat', columnformat,'columneditable',... columneditable,'rowname',[],'backgroundcolor',[.7.9.8],'foregroundcolor', [0 0 0],... 'CellSelectionCallback',@(src,evnt)set(src,'UserData',evnt.Indices)); %--- Update the menu visibility set(handles.execute, 'Enable', 'on'); function Import_data_Callback(hObject, eventdata, handles) global loads_values measur_values %--- Selects the file to import_data [FileName,PathName,res_ok]=uigetfile('*.mat','Import measurements and loads'); if res_ok pathf=[pathname FileName]; try load(pathf,'loads_values','measur_values'); %--- Clear previous calculus clearportal('nivel2',handles) set(handles.import_data, 'Check', 'on'); catch warndlg('this file is not a valid project.','error in import file','modal'); function Export_data_Callback(hObject, eventdata, handles) global Example global loads_values measur_values %--- Reads the path for saving the file [FileName,PathName]=uiputfile([Example(2:-1), '_values.mat'],'export measurements and loads as'); if FileName pathf=[pathname FileName]; %save the file path

18 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 12 of 26 %--- Save the data if exist('loads_values','var') && exist('measur_values','var') save(pathf,'loads_values','measur_values'); if exist('loads_values','var') save(pathf,'loads_values'); if exist('measur_values','var') save(pathf,'measur_values'); warndlg('no data to export.','error in exportation','modal'); function Exit_Callback(hObject, eventdata, handles) clear all close (gcbf) function figure1_closerequestfcn(hobject, eventdata, handles) % --- Executes when user attempts to close figure1. choice = questdlg(' Are you sure?','exit MENU','YES','NO','NO'); if strcmp(choice,'yes') clear all fprintf('end OF PROGRAM\n'); diary off try delete ([pwd '\DATA.mat']), delete (gcbf) % COMMON FUNCTIONS function clearportal(nivel,handles) global measur_values loads_values data1=cell(4,2); data2=cell(4,3); auxnames={'equation','','','','',''}; involvdata={'','false','false','false','false','false'}; switch nivel case 'nivel0' % change the example: clear all prevoius data clc %--- Updates the menu visibility set(handles.execute, 'Enable', 'off'); set(handles.select_measurements, 'Enable', 'off'); % set(handles.resvars_table, 'Enable', 'off'); set(handles.export_data, 'Enable', 'off'); set(handles.import_data, 'Enable', 'off'); set(handles.direct_analysis, 'Enable', 'off'); set(handles.measurements, 'Enable', 'off'); set(handles.loads, 'Enable', 'off'); set(handles.h_displacements, 'Enable', 'off'); set(handles.results_panel,'visible','off'); set(handles.squeme,'visible','off'); set(handles.select_example, 'Check', 'off'); set(handles.export_data, 'Check', 'off'); set(handles.import_data, 'Check', 'off');

19 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 13 of 26 set(handles.direct_analysis, 'Check', 'off'); set(handles.measurements, 'Check', 'off'); set(handles.loads, 'Check', 'off'); set(handles.enable, 'Check', 'off'); set(handles.h_displacements, 'Check', 'off'); set(handles.enable, 'Check', 'off'); set(handles.perform_analysis, 'Check', 'off'); %--- Clear tables % set(handles.resvars_table, 'Data', data1); %--- Delete some variables measur_values={}; loads_values={}; case 'nivel1' %clear the observability and the calculated results set(handles.loads, 'Check', 'off'); % set(handles.resvars_table, 'Data', data1); % case 'nivel2' %clear the calculated results % set(handles.resvars_table, 'Data', data1); % OTHER FUNCTIONS function [Cumvars,Cumres]=EvalRes2(B,z,d) % Numeric Calculus global ScreenOption global error global measur_values loads_values t Measurement_set % Measured displacements and rotations in the observability try figdata=get(t,'data'); cont=0; for i=1:length(figdata(:,2)) check=figdata{i,3}; if check==1 cont=cont+1; Measured(cont,1)=figdata(i,2); Measurement_set=Measured; %--- Introduce a fix measurement set (The set selected in the GUI won't be taken into account) fprintf('\n--- In line 645 we can introduce a fix set of measurements \n\n') % Measured={'w0003';'d0005'} %--- Final solution Cumvars={}; Cumres=[];

20 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 14 of 26 %--- Data query validcol=find(d~=0); zpd_vector=d(validcol); Vars=[zpd_vector;Measured]; n=length(vars); NumVars=zeros(1,n); %--- Data identification if n>0 for j=1:n % search in measurements_name for k=1:length(measur_values{1}) aux=char(measur_values{1}(k)); aux=aux(1:5); if char(vars(j))==aux; NumVars(j)=measur_values{1,2}(k); % search in loads [c,ni,pos]=intersect(char(vars(j)),loads_values(:,1)); if ~isempty(c)&& ~isempty(loads_values{pos,2}) NumVars(j)=loads_values{pos,2}; %--- Calculus of the observed variables [Cumvars,Cumres]=ObtainingSingleInertia(B,z,d,Vars,NumVars,error); function [Cumvars,Cumres]=ObtainingSingleInertia(B,z,d,Vars,NumVars,error) % Solve the system B*z=d for the observable variables global v beamlength subbeamseaiziygjqizqiy M=B; [neq,ncol]=size(m); Cumvars=[]; Cumres=[]; while 1 %--- Multiply each column of M by the corresponding measurement factor=cell(1,ncol); sympl_x=z; % a)find any measurement in the complex variable and simplify the complex variables for i=1:ncol aux1=sympl_x{i}; for j=1:length(vars); aux2=char(vars(j)); commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); sympl_x{i}=aux1; if isempty(sympl_x{i})

21 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 15 of 26 sympl_x{i}=''; if isempty(factor{i}) factor{i}=aux2; factor{i}=[factor{i},'*',aux2]; %(factor,sympl_x such as x=factor*sympl_x) % b) evalue the introduced data for j=1:length(vars) eval(sprintf('syms %s;',char(vars(j)))) % c) multiply the matrix by the factors M1=M; for i=1:ncol if ~isempty(factor{i}) M1(:,i)= M(:,i)*eval(factor{i}); % d) get together the columns asociated with the equal terms x=unique(sympl_x); M2=sym(zeros(neq,length(x))); for i=1:length(x) pos=[]; %find the position of the equal terms for j=1:length(sympl_x) if strcmp(x{i},sympl_x{j}) %equal terms pos=[pos j]; M2(:,i)=sum(M1(:,pos),2); % e)if there is a completely known term, the associated column is moved to the indepent term % e.1) identify the completely known term complknown=[]; for i=1:length(x) if isempty(x{i}) complknown=[complknown, i]; keptvar=setdiff(1:length(x),complknown); one % e.2) update the matrices x=x(keptvar); indterm=zeros(neq,1); %indepent term %when there is any completly known term, this term is written as the indepent

22 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 16 of 26 if ~isempty(complknown) indterm=-m2(:,complknown); M2=M2(:,keptvar); %(in this point, M2*x=zpdast+indterm) %--- Results [r,c]=size(m2); IT=d+indterm; % d)nullspace and null collumns % d.1) null space NS=null(M2); if isempty(ns)==1 NS=sym(zeros(neq,1)); % d.2) null rows identvars=zeros(c,1); for i=1:c if sum(abs(ns(i,:)))==0 identvars(i)=1; unique_x=x(identvars==1); if any(identvars==1)~=0 % d.3) numerical solution for j=1:length(vars) eval(sprintf('%s=%d;',char(vars(j)),double(numvars(j)))) % evalue the introduced data L=1; %Val=eval(M2)\eval(IT); a=eval(m2); b=eval(it); Val=pinv(a, 1e-20)*b; %Calculation as a Pseudo inverse Val=Val(identVars==1); %--- Postprocess (simplify complex variables) % a) separate the simple vars from the other ones simplvar={}; complvar={}; possimplvar=[]; %positions of the simple variables poscomplvar=[]; %positions of the complex variables for i=1:length(unique_x) if length(char(unique_x{i}))==5 simplvar=[simplvar,unique_x{i}]; possimplvar=[possimplvar,i]; complvar=[complvar,unique_x{i}]; poscomplvar=[poscomplvar,i]; nsimplvar=length(simplvar);

23 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 17 of 26 simplval=val(possimplvar); % b) when there is any complex var, I try to simplify ind=[]; if ~isempty(complvar) for i=1:length(complvar) aux1=complvar{i}; for j=1:nsimplvar aux2=simplvar{j}; commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); simplvar=[simplvar,aux1]; simplval=[simplval;val(poscomplvar(i))/val(possimplvar(j))]; ind=[ind, i]; valid=setdiff(1:length(complvar),ind); complvar=complvar(valid); poscomplvar=poscomplvar(valid); % c) try to identify vars in subsystems if ~isempty(complvar) [simplvar1,simplval1]=observcouples(complvar,val(poscomplvar),error); simplvar=[simplvar,simplvar1']; simplval=[simplval,simplval1]; % d) save data to repeat the process nsimplvar=length(simplvar); if ~isempty(simplvar) for i=1:nsimplvar Vars=[Vars; sym(simplvar{i})]; NumVars=[NumVars, simplval']; Cumvars=[Cumvars, simplvar]; Cumres=[Cumres; simplval]; break; break; aux=0; aux1=0; numofiz=0; numofiy=0; numofqiz=0;

24 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 18 of 26 numofqiy=0; for i=1:length(cumvars) auxiz=cumvars{i}; if strcmp(auxiz(1),'iz')==1; aux=aux+1; numofiz(aux)=str2double(auxiz(2:)); auxiy=cumvars{i}; if strcmp(auxiy(1),'iy')==1; aux=aux+1; numofiy(aux)=str2double(auxiy(2:)); auxqiz=cumvars{i}; if strcmp(auxqiz(1),'qiz')==1; aux1=aux1+1; numofqiz(aux1)=str2double(auxqiz(2:)); auxqiy=cumvars{i}; if strcmp(auxqiy(1),'qiy')==1; aux1=aux1+1; numofqiy(aux1)=str2double(auxqiy(2:)); for i=1:length(subbeamseaiziygjqizqiy{3}) auxsubiz(i)=subbeamseaiziygjqizqiy{3}(i); auxsubiy(i)=subbeamseaiziygjqizqiy{4}(i); auxsubqiz(i)=subbeamseaiziygjqizqiy{7}(i); auxsubqiy(i)=subbeamseaiziygjqizqiy{8}(i); %--- If all the parameters are observed finish, apply the optimization if sort(numofiz)==sort(unique(auxsubiz)) & sort(numofqiz)==sort(unique(auxsubqiz)) %--- Error in the value of the shear area shearerror=1e-9; fprintf('\n--- Shear area error => 1e-9 \n') %--- Calculate the shear area from the QIz parameter for i=1:length(cumvars) auxqiz=cumvars{i}; if strcmp(auxqiz(1),'qiz')==1; auxnumqiz=str2double(cumvars{i}(2:)); for k=1:length(subbeamseaiziygjqizqiy{7}) if auxnumqiz==subbeamseaiziygjqizqiy{7}(k) posqiz=auxnumqiz; Cumvars{i}=strrep(auxQIz,'QIz','S'); valqiz=cumres(i); for j=1:length(cumvars) auxiz=cumvars{j}; if strcmp(auxiz(1),'iz')==1; auxnumiz=str2double(cumvars{j}(2:)); if auxnumiz==subbeamseaiziygjqizqiy{3}(posqiz) valiz=cumres(j); auxabs=abs(valqiz);

25 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 19 of 26 if auxabs<shearerror % if shear area is smaller than the shearerror --> Shear area = 0 Cumres(i)=0; Q=valQIz/valIz; auxl=beamlength(auxnumqiz); L=1; auxl=eval(auxl); Cumres(i)=-(24*valIz*(v+1)*(QIz-1))/(QIz*auxl^2); %--- Display the results fprintf('\n--- Numeric observed variables\n') for i=1:length(cumres) fprintf('%s = %d\n', Cumvars{i},Cumres(i)) [Cumvars,Cumres]=Optimization(M2,x,IT,Cumvars,Cumres); if sort(numofiy)==sort(unique(auxsubiy)) & sort(numofqiy)==sort(unique(auxsubqiy)) %--- Error in the value of the shear area shearerror=1e-9; fprintf('\n--- Shear area error => 1e-9 \n') %--- Calculate the shear area from the QIy parameter for i=1:length(cumvars) auxqiy=cumvars{i}; if strcmp(auxqiy(1),'qiy')==1; auxnumqiy=str2double(cumvars{i}(2:)); for k=1:length(subbeamseaiziygjqizqiy{8}) if auxnumqiy==subbeamseaiziygjqizqiy{8}(k) posqiy=auxnumqiy; Cumvars{i}=strrep(auxQIy,'QIy','S'); valqiy=cumres(i); for j=1:length(cumvars) auxiy=cumvars{j}; if strcmp(auxiy(1),'iy')==1; auxnumiy=str2double(cumvars{j}(2:)); if auxnumiy==subbeamseaiziygjqizqiy{4}(posqiy) valiy=cumres(j); auxabs=abs(valqiy); if auxabs<shearerror % if shear area is smaller than the shearerror --> Shear area = 0 Cumres(i)=0; Q=valQIy/valIy; auxl=beamlength(auxnumqiy);

26 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 20 of 26 L=1; auxl=eval(auxl); Cumres(i)=-(24*valIy*(v+1)*(QIy-1))/(QIy*auxl^2); %--- Display the results fprintf('\n--- Numeric observed variables\n') for i=1:length(cumres) fprintf('%s = %d\n', Cumvars{i},Cumres(i)) [Cumvars,Cumres]=Optimization(M2,x,IT,Cumvars,Cumres); function [SingleVars,SingleVal]=ObservCouples(var,val,error) % log(var)=abs(val) SingleVars={}; SingleVal=[]; %delete zeros indzeros=find(abs(val)<error); for i=indzeros' if length(var{i})<6 SingleVars=[SingleVars;var{i} ]; SingleVal=[SingleVal; 0]; valid=setdiff(1:length(val),indzeros); var=var(valid); val=val(valid); % logabsval=log(abs(val)); r=length(val); %identifyes the single variables singles=cell(1,2*r); sings=ones(1,2*r); delet=[]; for i=1:r singles{i}=var{i}(1:5); if ~any([strcmp(singles{i}(1),'a'),strcmp(singles{i}(1),'iz'),strcmp(singles{i} (1),'Iy'),strcmp(singles{i}(1),'J')]) sings(i)=sign(val(i)); if length(var{i})>5 singles{i+r}=var{i}(6:); if ~any([strcmp(singles{i+r}(1),'a'),strcmp(singles{i+r}(1),'iz'),strcmp (singles{i}(1),'iy'),strcmp(singles{i}(1),'j')]) sings(i+r)=sign(val(i));

27 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 21 of 26 delet=[delet,i+r]; singles=singles(setdiff(1:2*r,delet)); [singles,ind,ni]=unique(singles); sings=sings(ind); %build the 0/1 matrix log(var) c=length(singles); A=zeros(r,c); for i=1:r for j=1:c if findstr(var{i},singles{j}) A(i,j)=1; %solve the system % 1) null space NS=null(A,'r'); NS(abs(NS)<error)=0; % 2) null rows identvars=zeros(c,1); for i=1:c if sum(abs(ns(i,:)))==0 identvars(i)=1; unique_s=singles(identvars==1); sings=sings(identvars==1); if any(identvars==1)~=0 % 3) numerical solution Val=exp(A(:,identVars==1)\logabsval); % 4) recover sign Val=Val.*sings'; % Save results SingleVars=[SingleVars;unique_s' ]; SingleVal=[SingleVal; Val]; % --- Optimization function [Cumvars,Cumres]=Optimization(M2,x,IT,Cumvars,Cumres) syms Variables Normalized Recover Error_in_percent syms Exact Solved global v beamlength global subbeamseaiziygjqizqiy knowneaiziygjsdirect valueeaiziygjsdirect nbeams global measur_values loads_values

28 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 22 of 26 L=1; M2=subs(M2,'L',1); IT=subs(IT,'L',1); %--- Search in the results of the observability for j=1:length(cumvars) IT=subs(IT,Cumvars(j),Cumres(j)); M2=subs(M2,Cumvars(j),Cumres(j)); %--- Search in the loads applied for j=1:length(loads_values) new=loads_values{j,2}; if ~isempty (new) old=loads_values{j,1}; IT=subs(IT,old,new); %--- Search in the measurements from the Direct Analysis var_exact=sym(x); for i=1:length(measur_values{1}) old=measur_values{1}(i); new=measur_values{2}(i); M2=subs(M2,old,new); IT=subs(IT,old,new); var_exact=subs(var_exact,old,new); for k=1:length(x) auxx=char(x(k)); if length(auxx)>=6 if (auxx(6:))==char(old) auxd=subs(auxx(6:),old,new); var_exact(k)=sym(auxx(1:5))*auxd; %--- Put the unused forces as 0 ind=1; for beam=1:nbeams+1 namerx=['rx' sprintf('%04.0f',ind)]; namery=['ry' sprintf('%04.0f',ind)]; namerz=['rz' sprintf('%04.0f',ind)]; namemx=['mx' sprintf('%04.0f',ind)]; namemy=['my' sprintf('%04.0f',ind)]; namemz=['mz' sprintf('%04.0f',ind)]; ind=ind+1; IT=subs(IT,nameRx,0); IT=subs(IT,nameRy,0); IT=subs(IT,nameRz,0); IT=subs(IT,nameMx,0); IT=subs(IT,nameMy,0); IT=subs(IT,nameMz,0);

29 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 23 of 26 %--- Search in the ReadData for the values of E,A,Iz,Iy,G,J & Q j=1; ind=1; ind1=1; ind2=1; ind3=1; ind4=1; ind5=1; ind6=0; ind7=0; for k=1:4 for j=1:length(knowneaiziygjsdirect{k}) pos=(knowneaiziygjsdirect{k}(j)); if pos>0 switch k case 1 namee=['e' sprintf('%04.0f',ind)]; auxe(ind)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,namee,auxe(ind)); ind=ind+1; case 2 namea=['a' sprintf('%04.0f',ind1)]; auxa(ind1)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,namea,auxa(ind1)); ind1=ind1+1; case 3 nameiz=['iz' sprintf('%04.0f',ind2)]; auxiz(ind2)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,nameiz,auxiz(ind2)); ind2=ind2+1; case 4 nameiy=['iy' sprintf('%04.0f',ind3)]; auxiy(ind3)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,nameiy,auxiy(ind3)); ind3=ind3+1; case 5 nameg=['g' sprintf('%04.0f',ind4)]; auxg(ind4)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,nameg,auxg(ind4)); ind4=ind4+1; case 6 namej=['j' sprintf('%04.0f',ind5)]; auxj(ind5)=[valueeaiziygjsdirect{k}(pos)]; var_exact=subs(var_exact,namej,auxj(ind5)); ind5=ind5+1; case 7 ind6=ind6+1; nameqiz=['qiz' sprintf('%04.0f',ind6)]; auxqiz(ind3)=[valueeaiziygjsdirect{k}(pos)]; posqiz=subbeamseaiziygjqizqiy{7}(ind6); auxqizval=(24*auxiz(subbeamseaiziygjqizqiy{3}(posqiz))^2*(v + 1))/ (auxqiz(ind7)*(eval(beamlength(ind7)))^2 + 24*auxIz(subbeamsEAIzIyGJQIzQIy{3}(posQIz)) *(v + 1));

30 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 24 of 26 var_exact=subs(var_exact,nameq,auxqval); case 8 ind7=ind7+1; nameqiy=['qiy' sprintf('%04.0f',ind7)]; auxqiy(ind4)=[valueeaiziygjsdirect{k}(pos)]; posqiy=subbeamseaiziygjqizqiy{8}(ind7); auxqiyval=(24*auxiy(subbeamseaiziygjqizqiy{4}(posqiy))^2*(v + 1))/ (auxqiy(ind8)*(eval(beamlength(ind8)))^2 + 24*auxIy(subbeamsEAIzIyGJQIzQIy{4}(posQIy)) *(v + 1)); var_exact=subs(var_exact,nameq,auxqval); IT=eval(IT); var_exact=eval(var_exact); %--- Normalization of the matrix B B=eval(M2); nvar=length(var_exact); for i=1:nvar B(:,i)=B(:,i)*var_exact(i); %--- Optimization algorithm [x_opt,xsymb,nepsilon,fval,z_sorted]=minimleastsq_jun(b, x, IT); %% solve %--- Plot the optimization results n=length(xsymb)-size(m2,1); fprintf('--- Optimization results\n'); fprintf('%s\n',['variables Error_in_percent(%)' ]); Normalized for i=size(m2,1)+1:size(m2,1)+n fprintf('%8s%24.8f%s%24.1f\n',[char(xsymb{i}) ' ' ],x_opt(i), ' ',(x_opt (i)-1)*100); %--- Multiply the optimization results for the value of the variable used ind=0; for i=1:length(x) auxx=char(x(i)); if length(auxx)==5 for j=1:length(xsymb) auxxs=xsymb(j); if (~cellfun(@isempty,auxxs))==1 auxxs=char(auxxs); if length(auxxs)==5 if auxx==auxxs ind=ind+1; varop{ind}=auxx; valop{ind}=x_opt(j)*var_exact(i);

31 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 25 of 26 %--- Add the results of the optimization to the observability results aux=0; leng=length(cumvars); for i=1:length(varop) aux=aux+1; Cumvars(leng+aux)=varop(i); Cumres(leng+aux)=valop{i}; %--- Error in the value of the shear area shearerror=1e-9; fprintf('\n--- Shear area error => 1e-9 \n') %--- Calculate the shear area from the Q parameter for i=1:length(cumvars) auxqiz=cumvars{i}; if strcmp(auxqiz(1),'qiz')==1; auxnumqiz=str2double(cumvars{i}(2:)); for k=1:length(subbeamseaiziygjqizqiy{7}) if auxnumqiz==subbeamseaiziygjqizqiy{7}(k) posqiz=auxnumqiz; Cumvars{i}=strrep(auxQIz,'QIz','S'); valqiz=cumres(i); for j=1:length(cumvars) auxiz=cumvars{j}; if strcmp(auxiz(1),'iz')==1; auxnumiz=str2double(cumvars{j}(2:)); if auxnumiz==subbeamseaiziygjqizqiy{3}(posqiz) valiz=cumres(j); auxabs=abs(valqiz); if auxabs<shearerror % if shear area is smaller than the shearerror --> Shear area = 0 Cumres(i)=0; Q=valQIz/valIz; auxl=beamlength(auxnumqiz); L=1; auxl=eval(auxl); Cumres(i)=-(24*valIz*(v+1)*(QIz-1))/(QIz*auxl^2); auxqiy=cumvars{i}; if strcmp(auxqiy(1),'qiy')==1; auxnumqiy=str2double(cumvars{i}(2:)); for k=1:length(subbeamseaiziygjqizqiy{8})

32 5/09/17 16:50 C:\Users\caminstech\Desktop...\Portal2.m 26 of 26 if auxnumqiy==subbeamseaiziygjqizqiy{8}(k) posqiy=auxnumqiy; Cumvars{i}=strrep(auxQIz,'QIy','S'); valqiy=cumres(i); for j=1:length(cumvars) auxiy=cumvars{j}; if strcmp(auxiy(1),'iy')==1; auxnumiy=str2double(cumvars{j}(2:)); if auxnumiy==subbeamseaiziygjqizqiy{4}(posqiz) valiy=cumres(j); auxabs=abs(valqiy); if auxabs<shearerror % if shear area is smaller than the shearerror --> Shear area = 0 Cumres(i)=0; Q=valQIy/valIy; auxl=beamlength(auxnumqiy); L=1; auxl=eval(auxl); Cumres(i)=-(24*valIy*(v+1)*(QIy-1))/(QIy*auxl^2); %--- Display the results fprintf('\n--- Numeric observed variables\n') for i=1:length(cumres) fprintf('%s = %d\n', Cumvars{i},Cumres(i)) fprintf('\n')

33 5/09/17 16:44 C:\Users\caminstech\Desk...\AAReadDATA22.m 1 of 2 function AAReadDATA22(Example) global beams nodecoordinates global knowndxdydzwxwywz knownfxfyfzmxmymz knowneaiziygjqizqiy knowneaeizeiygjeqizeqiy knowneaiziygjsdirect global valuedxdydzwxwywz valuefxfyfzmxmymz valueeaiziygjqizqiy valueeaeizeiygjeqizeqiy valueeaiziygjsdirect global subbeamseaiziygjqizqiy % (De momento las E's son conocidas) % OPTIONS: % Viga biapoyada 3 tramos % IMPORTANT: Script without anotations. Follow AA_READATA2 for exted comments. % (CASES) syms L positive; switch Example case 'Viga biapoyada 3 tramos' %--- GEOMETRY nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[1]; [1 4]; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] valuedxdydzwxwywz={[0]; [0 0]; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; [2]; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] valuefxfyfzmxmymz={[]; [-100]; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[1]; [1 2 3]; [1 2 3]; [1 2 3]; []; []; [1]}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[ ]; [1 1 1]; [ ]; [ ]; []; []; [ ]}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy]

34 5/09/17 16:44 C:\Users\caminstech\Desk...\AAReadDATA22.m 2 of 2 valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy]

35 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 1 of 10 function ReadDATA_Example2(Example) global beams nodecoordinates global knowndxdydzwxwywz knownfxfyfzmxmymz knowneaiziygjqizqiy knowneaeizeiygjeqizeqiy knowneaiziygjsdirect global valuedxdydzwxwywz valuefxfyfzmxmymz valueeaiziygjqizqiy valueeaeizeiygjeqizeqiy valueeaiziygjsdirect global subbeamseaiziygjqizqiy % (CASES) % This data is used for both the [DIRECT] and the [INVERSE] analysis: % Information for [DIRECT] Analysis: % Knownfxfyfzmxmymz and Valuefxfyfzmxmymz: These vectors include the values of the actual known external forces. % KnownEAIzIyGJSdirect and ValueEAIzIyGJSdirect: These vectors include the values of the actual known geometry. % If the Direct Analysis does not include shear deformations include S=0. % Information for [INVERSE] Analysis: % KnownEAIzIyGJQIzQIy, ValueEAIzIyGJQIzQIy, KnownEAEIzEIyGJEQIzEQIy and ValueEAEIzEIyGJEQIzEQIy: These vectors include the known information in the observability. % If the Inverse Analysis does not include shear deformations include QI=0. syms L positive; switch Example case 'Viga puente Arriaca (Guadalajara)' nodecoordinates=l*[ ]; beams=[

36 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 2 of ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[ ]; [ ]; [ ]; [11 12]; [11 12]; [11 12]}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node. valuedxdydzwxwywz={[ ]; [ ]; [ ]; [0 0]; [0 0]; [0 0]}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; [ ]; []; []; [ ]}; % [fx] [fy] [fz] [mx] [my] [mz] introduce [] the number of node. valuefxfyfzmxmymz={[]; []; [ ]; []; []; [ ]}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[1]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[ ]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[1]; [1]; [1]; [1]; []; []; [1]}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[ ]; [1]; [1.9]; [5.0]; []; []; [2.10]}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[ ]; [ ]; [ ]; [ ]; [1 1]; [1 1]; [1 1]; [1 1]}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga biapoyada 3 nodos 10m' nodecoordinates=l*[ ]; beams=[

37 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 3 of ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga biapoyada 2 nodos intermedios' nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters

38 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 4 of 10 % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga continua 2 vanos' nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Portico prueba Josep'

39 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 5 of 10 nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Portico prueba 5 nodos' nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My]

40 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 6 of 10 [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Columna' nodecoordinates=l*[ ]; beams=[ 1 2]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga'

41 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 7 of 10 nodecoordinates=l*[ ]; beams=[ 1 2]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga inclinada negativa' nodecoordinates=l*[ ]; beams=[ 1 2]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G]

42 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 8 of 10 [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga inclinada' nodecoordinates=l*[ ]; beams=[ 1 2]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga inclinada negativa inversa' nodecoordinates=l*[ ]; beams=[ 1 2]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My]

43 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 9 of 10 [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy] valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam. case 'Viga empotrada 4 cargas' nodecoordinates=l*[ ]; beams=[ ]; %--- FORCES, DISPLACEMENTS AND MECHANICAL PROPERTIES % Displacements knowndxdydzwxwywz={[]; []; []; []; []; []}; % [dx] [dy] [dz] [wx] [wy] [wz] introduce [] the number of node valuedxdydzwxwywz={[]; []; []; []; []; []}; % Only boundary conditions for each node. % Forces knownfxfyfzmxmymz={[]; []; []; []; []; []}; % [Fx] [Fy] [Fz] [Mx] [My] [Mz] introduce [] the number of node valuefxfyfzmxmymz={[]; []; []; []; []; []}; % Only external forces applied for each node. % Mechanical Properties knowneaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] if the value is known % valueeaiziygjqizqiy={[]; []; []; []; []; []; []; []}; % Known parameters. % Introduce the real values of the E, A, Iz, Iy, G, J & S parameters % to calculate the stiffness method solution (DIRECT SOLUTION), % write [1] if the value is known. knowneaiziygjsdirect={[]; []; []; []; []; []; []}; % [E] [A] [Iz] [Iy] [G] [J] [S] (S => Shear Area) valueeaiziygjsdirect={[]; []; []; []; []; []; []}; % Real values. % Indicate the list of beams knowneaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % [EA] [EIz] [EIy] [GJ] [EQIz] [EQIy]

44 5/09/17 16:44 C:\Users\caminstech\De...\AA_ReadDATA2.m 10 of 10 valueeaeizeiygjeqizeqiy={[]; []; []; []; []; [];}; % Real values. % Diferents types of beams subbeamseaiziygjqizqiy={[]; []; []; []; []; []; []; [];}; % [E] [A] [Iz] [Iy] [G] [J] [QIz] [QIy] write [1] for each beam. In this case as there are 2 beams: [1] [1] one for each beam.

45 5/09/17 16:45 C:\Users\caminstech\Des...\BoundaryCond2.m 1 of 4 function [GSM,GSMVarsNames,KnownForces,KnownForcesValues,Alldisplacements] =BoundaryCond2(GSM0,GSMVarsNames,ForcesNames,KnownName,valuevars) global ScreenOption Symbway %--- VECTOR OF FORCES %--- a) Identify the known forces KnownForces=zeros(length(ForcesNames),1); KnownForcesValues=sym(zeros(length(ForcesNames),1)); KnownForcesname=cell(length(ForcesNames),1); typeknown=zeros(size(knownname)); for i=1:length(forcesnames) for j=1:length(knownname) if isequal(forcesnames{i},knownname{j}) KnownForces(i)=i; KnownForcesValues(i)=valuevars(j); KnownForcesname(i)=KnownName(j); typeknown(j)=1; break %--- E or G variable: delete from the list when it is known lengthgsmvars=length(gsmvarsnames); factor=ones(1,lengthgsmvars); for i=1:length(knownname) aux=knownname{i}; if strcmp('e',aux(1)) strcmp('g',aux(1)) typeknown(i)=2; EGvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,egvar); if ~isempty(pos) GSMVarsNames{j}=auxvar(setdiff(1:29,pos:pos+4)); factor(j)=factor(j)*valuevars(i); %--- A, Iz, Iy or J variable: delete from the list when it is known nulcol=[]; for i=1:length(knownname) aux=knownname{i}; if strcmp('a',aux(1)) strcmp('iz',aux(1)) strcmp('iy',aux(1)) strcmp('j',aux (1)) typeknown(i)=3; AIzIyJvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,aiziyjvar); if ~isempty(pos) len=length(gsmvarsnames{j});

46 5/09/17 16:45 C:\Users\caminstech\Des...\BoundaryCond2.m 2 of 4 if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i); %--- QIz variable: delete from the list when it is known for i=1:length(knownname) aux=knownname{i}; if strcmp('qiz',aux(1)) typeknown(i)=4; QIzvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,qizvar); if ~isempty(pos) len=length(gsmvarsnames{j}); if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i); %--- QIy variable: delete from the list when it is known for i=1:length(knownname) aux=knownname{i}; if strcmp('qiy',aux(1)) typeknown(i)=4; QIyvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,qiyvar); if ~isempty(pos) len=length(gsmvarsnames{j}); if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i);

47 5/09/17 16:45 C:\Users\caminstech\Des...\BoundaryCond2.m 3 of 4 Alldisplacements=unique(GSMVarsNames); %--- Multiply by the factor associated with the E, A, Iz, G, J, QIz and QIy for i=1:lengthgsmvars GSM0(:,i)=GSM0(:,i)*factor(i); %--- BOUNDARY CONDITIONS %--- a) Identify the known deplacements knowndesplac=knownname(typeknown==0); valuedesplac=valuevars(typeknown==0); %--- b) Identify the null known deplacements (boundary conditions) nulldesplac=knowndesplac(valuedesplac==0); %--- c) Delete the null variables and GSM columns associated with for i=1:length(nulldesplac) auxd=nulldesplac{i}; for j=1:lengthgsmvars if ~isempty(strfind(gsmvarsnames{j},auxd)) GSMVarsNames(j)={''}; nulcol=[nulcol j]; validcolumn=setdiff(1:lengthgsmvars,nulcol); GSMVarsNames=GSMVarsNames(validcolumn); GSM1=GSM0(:,validcolumn); %--- GSM %--- get the equal columns together (deleting the repeated ones) allgsmvarsnames=unique(gsmvarsnames); [r,ni]=size(gsm1); if Symbway==0 GSM=zeros(r,length(allGSMVarsNames)); GSM=sym(zeros(r,length(allGSMVarsNames))); for i=1:length(allgsmvarsnames) aux=[]; for j=1:length(gsmvarsnames) if isequal(allgsmvarsnames(i),gsmvarsnames(j)); aux=[aux j]; GSM(:,i)=sum(GSM1(:,aux),2); %--- identify null columns in GSM and delete variable and column if Symbway==1 validcolumns=find(sum(abs(gsm),1)~=0);

48 5/09/17 16:45 C:\Users\caminstech\Des...\BoundaryCond2.m 4 of 4 validcolumns=find(sum(abs(gsm),1)>1e-14); GSM=GSM(:,validcolumns); GSMVarsNames=allGSMVarsNames(validcolumns); %--- Plotting information L=1; GSMnum=eval(GSM); %numerical GSM if ScreenOption==1 fprintf('--- After applying boundary conditions, GSM and variables:\n') GSM, PrintMatrix('GSMnum:',GSMnum,'%10.3f'); GSMVarsNames' if ScreenOption==2 [r,c]=size(gsmnum); fprintf('%%--- After applying boundary conditions, GSM and variables:\n'); % Symbolic GSM fprintf('symbolic GSM: $$%s$$\n',latex(gsm)); % Numeric GSM fprintf('numeric GSM: $$\\left(\\begin{array}{'); for i=1:c fprintf('c'); fprintf('}'); for i=1:r-1 for j=1:c-1 fprintf('%-10.3f & ',GSMnum(i,j)); fprintf('%-10.3f \\\\',GSMnum(i,)); %last column for j=1:c-1 %last row fprintf('%-10.3f & ',GSMnum(,j)); fprintf('%-10.3f \\{array}\\right)$$\n',gsmnum(,)); %last column and last row % GSM variables fprintf('gsm variables: $$\\left(\\begin{array}{c}'); for i=1:length(gsmvarsnames)-1 fprintf('%s \\\\ ',GSMVarsNames{i}); fprintf('%s \\{array}\\right)$$ \n\n',gsmvarsnames{});

49 5/09/17 16:45 C:\Users\caminstech\De...\BuildD_Matrix2.m 1 of 2 function [D,zk,zd,zp,invB1]=BuildD_Matrix(B,z,d) %From the system: B*z=d, where d=[h;0], z=[zd;zk;f] and B=[B1,B2,0;B3,B4,-I], %and B1 is a full-rank matrix whose number of rows is the length of H. %Explanation: [B1 B2 0]*[zd;zk;F]=[H]; B1*zd+B2*zk=H; zd=inv(b1)*h-inv(b1)*b2*zk, %quedando: D=-inv(B1)*B2 y zp=inv(b1)*h global ScreenOption error %--- To numeric way L=1; B=eval(B); %eliminate the variable L %--- Select the rows associated with the non-null terms of H: rows=find(d~=0); nullrows=length(d)-length(rows); %--- Identify the matrizes H,[B1 B2] and [z1; z2] H=d(rows); B1B2=B(rows,1:-nullrows); zdzk=z(1:-nullrows); %--- Select a full-rank matrix whose number of rows is the length of H [B1,rankM,selectedr,validcol]=FullRankMatrix(B1B2,error); nonvalidcol=setdiff(1:length(zdzk),validcol); B2=B1B2(:,nonvalidcol); %--- Identify the D matrix invb1=inv(b1); invb1(abs(invb1)<error)=0; %precision cleaning D=-invB1*B2; D(abs(D)<error)=0; %precision cleaning %--- Identify the key and depent variables zd=zdzk(validcol); zk=zdzk(nonvalidcol); %--- Calculate the particular solution zp=invb1*h; %--- Plotting information if ScreenOption==1 fprintf('--- D, zk, zd and zp:\n') D,zk,zd,zp if ScreenOption==2 if ~isempty(d) [r,c]=size(d); fprintf('\n%%--- D, zk, zd and zp:\n'); fprintf('d: $$\\left(\\begin{array}{'); for i=1:c fprintf('c'); fprintf('}'); for i=1:r-1 for j=1:c-1 if D(i,j)==0,

50 5/09/17 16:45 C:\Users\caminstech\De...\BuildD_Matrix2.m 2 of 2 fprintf('0 & '); fprintf('%-10.3f & ',D(i,j)); if D(i,)==0, fprintf('0 \\\\ '); fprintf('%-10.3f \\\\',D(i,)); %last column for j=1:c-1 %last row if D(,j)==0, fprintf('0 & '); fprintf('%-10.3f & ',D(,j)); if D(,)==0, fprintf('0 \\{array}\\right)$$\n '); fprintf('%-10.3f \\{array}\\right)$$\n',d(,)); %last column and last row % vector zk fprintf('zk vector: $$\\left(\\begin{array}{c}'); for i=1:length(zk)-1 fprintf('%s \\\\ ',zk{i}); fprintf('%s \\{array}\\right)$$ \n',zk{}); fprintf('d matrix is empty. \n\n'); % vector zd fprintf('zd vector: $$\\left(\\begin{array}{c}'); for i=1:length(zd)-1 fprintf('%s \\\\ ',zd{i}); fprintf('%s \\{array}\\right)$$ \n',zd{}); % vector zp fprintf('zp vector: $$%s$$\n',latex(zp));

51 5/09/17 16:45 C:\Users\caminstech\Des...\BuildMatrixB2.m 1 of 2 function [B,z,d]=BuildMatrixB2(GSM,GSMVarsNames,ForcesNames,KnownForces, KnownForcesValues) %B.z=d global ScreenOption %Vector of forces: rows UnknownForces=KnownForces(KnownForces==0); Nu=length(UnknownForces); %number of unknown forces Nk=length(KnownForces(KnownForces~=0)); %number of known forces posknownforces=knownforces(knownforces~=0)'; posunknownforces=setdiff(1:nk+nu,posknownforces); %--- Matrix B sortgsm=gsm([posknownforces,posunknownforces],:); B=[sortGSM,[zeros(Nk,Nu);-eye(Nu)]]; %--- unknown variables (z) z=[gsmvarsnames,forcesnames(posunknownforces)']; %--- Indepent term (d) d=[knownforcesvalues(knownforces~=0);zeros(nu,1)]; %--- Plotting information L=1; Bnum=eval(B); %numerical B if ScreenOption==1 fprintf('--- B, z and d:\n') B PrintMatrix('Bnum:',Bnum,'%10.3f'); z',d if ScreenOption==2 [r,c]=size(bnum); fprintf('%%--- B, z and d:\n'); % Symbolic B fprintf('symbolic B: $$%s$$\n',latex(b)); % Numeric B fprintf('numeric B: $$\\left(\\begin{array}{'); for i=1:c fprintf('c'); fprintf('}'); for i=1:r-1 for j=1:c-1 fprintf('%-10.3f & ',Bnum(i,j)); fprintf('%-10.3f \\\\',Bnum(i,)); %last column for j=1:c-1 %last row fprintf('%-10.3f & ',Bnum(,j)); fprintf('%-10.3f \\{array}\\right)$$\n',bnum(,)); %last column and last row % vector z

52 5/09/17 16:45 C:\Users\caminstech\Des...\BuildMatrixB2.m 2 of 2 fprintf('z vector: $$\\left(\\begin{array}{c}'); for i=1:length(z)-1 fprintf('%s \\\\ ',z{i}); fprintf('%s \\{array}\\right)$$ \n',z{}); % vector d fprintf('d vector: $$%s$$\n',latex(d));

53 5/09/17 16:46 C:\Users\caminstech\Des...\BuildMatrixD2.m 1 of 3 function [D,zk,zd,zp,BInv]=BuildMatrixD2(B,z,d) %Depence matrix, key var., depent var. and particular solution %From the system: B*z=d, where d=[h;0] and z=[zi;f], identify the relation: %[zd]=[zp]+[d]*[zk] global ScreenOption %--- To numeric way % if Symbway==1 L=1; B=eval(B); %eliminate the variable L % %--- Calculate the null space NullSpace=null(B,'r'); [r,c]=size(nullspace); %--- Identify the identity matrix EyeElement=zeros(c,1); % % % % %%%%% % % % % aux=zeros(length(d),1); % % % % ll=max(find(d~=0)); % % % % aux2=rand(1,ll); % % % % aux(d~=0)=aux2'; % % % % parsol=b\aux; % % % % EyeElement=find(parsol==0); % % % % %%%% parsol=b\d; posiblepos=find(parsol==0); for i=1:c %vector [ ] aux=zeros(1,c); aux(i)=1; %find the row for j=posiblepos' %for the rows with null particular solution if isequal(aux,nullspace(j,:))) % if isequal(aux,abs(nullspace(j,:))) %OJOOOOOO: aquí igualo 1 o -1!!!! OJO EyeElement(i)=j %save the row: number associated with ValidVar posiblepos=setdiff(posiblepos,j); %delete this possible position break NonEyeElement=setdiff(1:r,EyeElement); %number associated with ValidVar %--- Identify the D matrix D=NullSpace(NonEyeElement,:); %--- Identify the key and depent variables zk=z(eyeelement); zd=z(noneyeelement); %--- Calculate the particular solution Baux=B(:,NonEyeElement);

54 5/09/17 16:46 C:\Users\caminstech\Des...\BuildMatrixD2.m 2 of 3 % partaux=baux\d; BInv=inv(Baux); BInv(abs(BInv)<1e-12)=0; %precision cleaning partaux=binv*d; zp=[zeros(c,1);partaux]; %--- Plotting information if ScreenOption==1 fprintf('--- D, zk, zd and zp:\n') D,zk,zd,zp if ScreenOption==2 if ~isempty(d) [r,c]=size(d); fprintf('\n%%--- D, zk, zd and zp:\n'); fprintf('d: $$\\left(\\begin{array}{'); for i=1:c fprintf('c'); fprintf('}'); for i=1:r-1 for j=1:c-1 if D(i,j)==0, fprintf('0 & '); fprintf('%-10.3f & ',D(i,j)); if D(i,)==0, fprintf('0 \\\\ '); fprintf('%-10.3f \\\\',D(i,)); %last column for j=1:c-1 %last row if D(,j)==0, fprintf('0 & '); fprintf('%-10.3f & ',D(,j)); if D(,)==0, fprintf('0 \\{array}\\right)$$\n '); fprintf('%-10.3f \\{array}\\right)$$\n',d(,)); %last column and last row % vector zk fprintf('zk vector: $$\\left(\\begin{array}{c}'); for i=1:length(zk)-1 fprintf('%s \\\\ ',zk{i}); fprintf('%s \\{array}\\right)$$ \n',zk{}); fprintf('d matrix is empty. \n\n');

55 5/09/17 16:46 C:\Users\caminstech\Des...\BuildMatrixD2.m 3 of 3 % vector zd fprintf('zd vector: $$\\left(\\begin{array}{c}'); for i=1:length(zd)-1 fprintf('%s \\\\ ',zd{i}); fprintf('%s \\{array}\\right)$$ \n',zd{}); % vector zp fprintf('zp vector: $$%s$$\n',latex(zp));

56 5/09/17 16:46 C:\Users\caminstech\De...\CALCULOFINAL42.m 1 of 5 function CALCULOFINAL4 global error clc M=B; [neq,ncol]=size(m); while 1 %--- Multiply each column of M by the corresponding measurement factor=cell(1,ncol); sympl_x=z; % a)find any measurement in the complex variable and simplify the complex variables for i=1:ncol aux1=sympl_x{i}; for j=1:length(vars); aux2=char(vars(j)); commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); sympl_x{i}=aux1; if isempty(sympl_x{i}) sympl_x{i}=''; if isempty(factor{i}) factor{i}=aux2; factor{i}=[factor{i},'*',aux2]; %(factor,sympl_x such as x=factor*sympl_x) % b) evalue the introduced data for j=1:length(vars) eval(sprintf('syms %s;',char(vars(j)))) % c) multiply the matrix by the factors M1=M; for i=1:ncol if ~isempty(factor{i}) M1(:,i)= M(:,i)*eval(factor{i}); % d) get together the columns asociated with the equal terms x=unique(sympl_x); M2=sym(zeros(neq,length(x))); for i=1:length(x) pos=[]; %find the position of the equal terms for j=1:length(sympl_x)

57 5/09/17 16:46 C:\Users\caminstech\De...\CALCULOFINAL42.m 2 of 5 if strcmp(x{i},sympl_x{j}) %equal terms pos=[pos j]; M2(:,i)=sum(M1(:,pos),2); % e)if there is a completely known term, the associated column is moved to the indepent term % e.1) identify the completely known term complknown=[]; for i=1:length(x) if isempty(x{i}) complknown=[complknown, i]; keptvar=setdiff(1:length(x),complknown); one % e.2) update the matrices x=x(keptvar); indterm=zeros(neq,1); %indepent term %when there is any completly known term, this term is written as the indepent if ~isempty(complknown) indterm=-m2(:,complknown); M2=M2(:,keptvar); %(in this point, M2*x=zpdast+indterm) %--- Results [r,c]=size(m2); IT=d+indterm; % d)nullspace and null collumns % d.1) null space NS=null(M2); % d.2) null rows identvars=zeros(c,1); for i=1:c if sum(abs(ns(i,:)))==0 identvars(i)=1; unique_x=x(identvars==1); if any(identvars==1)~=0 % d.3) numerical solution for j=1:length(vars) eval(sprintf('%s=%d;',char(vars(j)),double(numvars(j)))) % evalue the introduced data L=1; %Val=eval(M2)\eval(IT); a=eval(m2);

58 5/09/17 16:46 C:\Users\caminstech\De...\CALCULOFINAL42.m 3 of 5 b=eval(it); Val=pinv(a, 1e-20)*b; %Calculation as a Pseudo inverse Val=Val(identVars==1); %--- Postprocess (simplify complex variables) % a) separate the simple vars from the other ones simplvar={}; complvar={}; possimplvar=[]; %positions of the simple variables poscomplvar=[]; %positions of the complex variables for i=1:length(unique_x) if length(char(unique_x{i}))==5 simplvar=[simplvar,unique_x{i}]; possimplvar=[possimplvar,i]; complvar=[complvar,unique_x{i}]; poscomplvar=[poscomplvar,i]; nsimplvar=length(simplvar); simplval=val(possimplvar); % b) when there is any complex var, I try to simplify ind=[]; if ~isempty(complvar) for i=1:length(complvar) aux1=complvar{i}; for j=1:nsimplvar aux2=simplvar{j}; commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); simplvar=[simplvar,aux1]; simplval=[simplval;val(poscomplvar(i))/val(possimplvar(j))]; ind=[ind, i]; valid=setdiff(1:length(complvar),ind); complvar=complvar(valid); poscomplvar=poscomplvar(valid); % c) try to identify vars in subsystems if ~isempty(complvar) [simplvar1,simplval1]=observcouples(complvar,val(poscomplvar),error); simplvar=[simplvar,simplvar1']; simplval=[simplval,simplval1]; % d) save data to repeat the process nsimplvar=length(simplvar); if ~isempty(simplvar)

59 5/09/17 16:46 C:\Users\caminstech\De...\CALCULOFINAL42.m 4 of 5 break break for i=1:nsimplvar Vars=[Vars; sym(simplvar{i})]; NumVars=[NumVars, simplval']; Cumvars=[Cumvars, simplvar]; Cumres=[Cumres; simplval]; % function [SingleVars,SingleVal]=ObservCouples(var,val,error) % log(var)=abs(val) SingleVars={}; SingleVal=[]; %delete zeros indzeros=find(abs(val)<error); for i=indzeros' if length(var{i})<6 SingleVars=[SingleVars;var{i} ]; SingleVal=[SingleVal; 0]; valid=setdiff(1:length(val),indzeros); var=var(valid); val=val(valid); % logabsval=log(abs(val)); r=length(val); %identifyes the single variables singles=cell(1,2*r); sings=ones(1,2*r); delet=[]; for i=1:r singles{i}=var{i}(1:5); if ~any([strcmp(singles{i}(1),'a'),strcmp(singles{i}(1),'iz'),strcmp(singles{i} (1),'Iy'),strcmp(singles{i}(1),'G')]) sings(i)=sign(val(i)); if length(var{i})>5 singles{i+r}=var{i}(6:); if ~any([strcmp(singles{i+r}(1),'a'),strcmp(singles{i+r}(1),'iz'),strcmp (singles{i}(1),'iy'),strcmp(singles{i}(1),'g')]) sings(i+r)=sign(val(i));

60 5/09/17 16:46 C:\Users\caminstech\De...\CALCULOFINAL42.m 5 of 5 delet=[delet,i+r]; singles=singles(setdiff(1:2*r,delet)); [singles,ind,ni]=unique(singles); sings=sings(ind); %build the 0/1 matrix log(var) c=length(singles); A=zeros(r,c); for i=1:r for j=1:c if findstr(var{i},singles{j}) A(i,j)=1; %solve the system % 1) null space NS=null(A,'r'); NS(abs(NS)<error)=0; % 2) null rows identvars=zeros(c,1); for i=1:c if sum(abs(ns(i,:)))==0 identvars(i)=1; unique_s=singles(identvars==1); sings=sings(identvars==1); if any(identvars==1)~=0 % 3) numerical solution Val=exp(A(:,identVars==1)\logabsval); % 4) recover sign Val=Val.*sings'; % Save results SingleVars=[SingleVars;unique_s' ]; SingleVal=[SingleVal; Val];

61 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 1 of 7 function CheckData2(nbeams) global knowndxdydzwxwywz global valuedxdydzwxwywz global knownfxfyfzmxmymz global valuefxfyfzmxmymz global knowneaiziygjqizqiy global valueeaiziygjqizqiy global knowneaeizeiygjeqizeqiy global valueeaeizeiygjeqizeqiy global subbeamseaiziygjqizqiy global ScreenOption global beamlength corrected=0; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Checks compatibility of knowneaiziygjqizqiy and knowneaeizeiygjeqizeqiy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if ScreenOption==3 fprintf('%%--- Initial DATA\n'); PrintCellMatrix('knownEAIzIyGJQIzQIy',knownEAEIzEIyGJEQIzEQIy,'%4d'); PrintPrettyLatex('valueEAIzIyGJQIzQIy',valueEAIzIyGJQIzQIy); PrintCellMatrix('knownEAEIzEIyGJEQIzEQIy',knownEAEIzEIyGJEQIzEQIy,'%4d'); PrintPrettyLatex('valueEAEIzEIyGJEQIzEQIy',valueEAEIzEIyGJEQIzEQIy); PrintCellMatrix('knowndxdydzwxwywz',knowndxdydzwxwywz,'%4d'); PrintPrettyLatex('valuedxdydzwxwywz',valuedxdydzwxwywz); PrintCellMatrix('knownfxfyfzmxmymz',knownfxfyfzmxmymz,'%4d'); PrintPrettyLatex('valuefxfyfzmxmymz',valuefxfyfzmxmymz); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Check equal lengths %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for k=1:8 if length(knowneaiziygjqizqiy{k})~=length(valueeaiziygjqizqiy{k}) fprintf('unequal lengths of cells knowneaiziygjqizqiy and valueeaiziygjqizqiy\n'); corrected=1; for k=1:6 if length(knowndxdydzwxwywz{k})~=length(valuedxdydzwxwywz{k}) fprintf('unequal lengths of cells knownuvw and valuedxdydzwxwywz\n'); corrected=1; if length(knownfxfyfzmxmymz{k})~=length(valuefxfyfzmxmymz{k}) fprintf('unequal lengths of cells knownfxfyfzmxmymz and valuefxfyfzmxmymz\n'); corrected=1; if length(knowneaeizeiygjeqizeqiy{k})~=length(valueeaeizeiygjeqizeqiy{k}) fprintf('unequal lengths of cells knowneaeizeiygjeqizeqiy and valueeaeizeiygjeqizeqiy\n'); corrected=1;

62 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 2 of 7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Check that all beams appear in subbeamseaiziyqizqiy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for k=1:8 if length(subbeamseaiziygjqizqiy{k})~=nbeams fprintf('incorrect length of subbeamseaiziygjqizqiy\n'); corrected=1; maxtype=max([max(subbeamseaiziygjqizqiy{1}(:)),max(subbeamseaiziygjqizqiy{2}(:)),max (subbeamseaiziygjqizqiy{3}(:)),max(subbeamseaiziygjqizqiy{4}(:)),max (subbeamseaiziygjqizqiy{5}(:)),max(subbeamseaiziygjqizqiy{6}(:))]); for k=1:5 for type=1:maxtype switch k case 1 % case E % if E of a given type is known, it cannot appear in a beam % with known EA, EIz or EIy of the same type BeamsWithTypeE=find(subbeamsEAIzIyGJQIzQIy{1}==type); loc=find(knowneaiziygjqizqiy{1}==type); if loc>0 BeamsWithTypeEandKnownEA=intersect(knownEAIzIyGJQIzQIy{1}, BeamsWithTypeE); for ss=1:length(beamswithtypeeandknownea) corrected=1; beam=beamswithtypeeandknownea(ss); locbeam=find(knowneaeizeiygjeqizeqiy{1}==beam); typea=subbeamseaiziygjqizqiy{2}(beam); loc1=find(knowneaiziygjqizqiy{2},typea); if isempty(loc1) knowneaiziygjqizqiy{2}=[knowneaiziygjqizqiy{2} typea]; valueeaiziygjqizqiy{2}=[valueeaiziygjqizqiy{2} valueeaeizeiygjeqizeqiy{1}(locbeam)/valueeaiziygjqizqiy{1}(loc)]; knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{1} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{1} (:),locbeam); fprintf('beam %5.0f cannot have EA known because its E%5.0f is known\n',beam,type); fprintf('we correct this be making the A%5.0f known instead\n',typea); BeamsWithTypeEandKnownEIz=intersect(knownEAEIzEIyGJEQIzEQIy{2}, BeamsWithTypeE); for ss=1:length(beamswithtypeeandknowneiz) corrected=1; beam=beamswithtypeeandknowneiz(ss); locbeam=find(knowneaeizeiygjeqizeqiy{2}==beam); typeiz=subbeamseaiziygjqizqiy{3}(beam); loc1=find(knowneaiziygjqizqiy{3},typeiz); if isempty(loc1)

63 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 3 of 7 knowneaiziygjqizqiy{3}=[knowneaiziygjqizqiy{3} typeiz]; valueeaiziygjqizqiy{3}=[valueeaiziygjqizqiy{3} valueeaeizeiygjeqizeqiy{2}(locbeam)/valueeaiziygjqizqiy{1}(loc)]; knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{2} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{2} (:),locbeam); fprintf('beam %5.0f cannot have EIz known because its E%5.0f is known\n',beam,type); fprintf('we correct this be making the Iz%5.0f known instead\n',typeiz); BeamsWithTypeEandKnownEIy=intersect(knownEAEIzEIyGJEQIzEQIy{2}, BeamsWithTypeE); for ss=1:length(beamswithtypeeandknowneiy) corrected=1; beam=beamswithtypeeandknowneiy(ss); locbeam=find(knowneaeizeiygjeqizeqiy{3}==beam); typeiy=subbeamseaiziygjqizqiy{4}(beam); loc1=find(knowneaiziygjqizqiy{4},typeiy); if isempty(loc1) knowneaiziygjqizqiy{4}=[knowneaiziygjqizqiy{4} typeiy]; valueeaiziygjqizqiy{4}=[valueeaiziygjqizqiy{4} valueeaeizeiygjeqizeqiy{3}(locbeam)/valueeaiziygjqizqiy{1}(loc)]; knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{3} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{3} (:),locbeam); fprintf('beam %5.0f cannot have EIy known because its E%5.0f is known\n',beam,type); fprintf('we correct this be making the Iy%5.0f known instead\n',typeiy); case 2 % case A % if A of a given type is known, it cannot appear in a beam % with known EA of the same type BeamsWithTypeA=find(subbeamsEAIzIyGJQIzQIy{2}==type); loc=find(knowneaiziygjqizqiy{2}==type); if loc>0 BeamsWithTypeAandKnownEA=intersect(knownEAEIzEIyGJEQIzEQIy{1}, BeamsWithTypeA); for ss=1:length(beamswithtypeaandknownea) corrected=1; beam=beamswithtypeaandknownea(ss); locbeam=find(knowneaeizeiygjeqizeqiy{1}==beam); typee=subbeamseaiziygjqizqiy{1}(beam); loc1=find(knowneaiziygjqizqiy{1},typee); if isempty(loc1) knowneaiziygjqizqiy{1}=[knowneaiziygjqizqiy{1} typee]; valueeaiziygjqizqiy{1}=[valueeaiziygjqizqiy{1} valueeaeizeiygjeqizeqiy{1}(locbeam)/valueeaiziygjqizqiy{2}(loc)];

64 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 4 of 7 knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{1} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{1} (:),locbeam); fprintf('beam %5.0f cannot have EA known because its A%5.0f is known\n',beam,type); fprintf('we correct this be making the E%5.0f known instead\n',typee); case 3 % case Iz and Iy % if Iz or Iy of a given type is known, it cannot appear in a beam % with known EIz or EIy of the same type BeamsWithTypeIz=find(subbeamsEAIzIyGJQIzQIy{3}==type); loc=find(knowneaiziygjqizqiy{3}==type); if loc>0 BeamsWithTypeIandKnownEIz=intersect(knownEAEIzEIyGJEQIzEQIy{2}, BeamsWithTypeIz); for ss=1:length(beamswithtypeiandknowneiz) corrected=1; beam=beamswithtypeiandknowneiz(ss); locbeam=find(knowneaeizeiygjeqizeqiy{2}==beam); typee=subbeamseaiziygjqizqiy{1}(beam); loc1=find(knowneaiziygjqizqiy{1},typee); if isempty(loc1) knowneaiziygjqizqiy{1}=[knowneaiziygjqizqiy{1} typee]; valueeaiziygjqizqiy{1}=[valueeaiziygjqizqiy{1} valueeaeizeiygjeqizeqiy{2}(locbeam)/valueeaiziygjqizqiy{3}(loc)]; knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{2} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{2} (:),locbeam); fprintf('beam %5.0f cannot have EA known because its I%5.0f is known\n',beam,type); fprintf('we correct this be making the E%5.0f known instead\n',typee); BeamsWithTypeIy=find(subbeamsEAIzIyGJQIzQIy{4}==type); loc=find(knowneaiziygjqizqiy{4}==type); if loc>0 BeamsWithTypeIandKnownEIy=intersect(knownEAEIzEIyGJEQIzEQIy{2}, BeamsWithTypeIy); for ss=1:length(beamswithtypeiandknowneiy) corrected=1; beam=beamswithtypeiandknowneiy(ss); locbeam=find(knowneaeizeiygjeqizeqiy{3}==beam); typee=subbeamseaiziygjqizqiy{1}(beam); loc1=find(knowneaiziygjqizqiy{1},typee); if isempty(loc1) knowneaiziygjqizqiy{1}=[knowneaiziygjqizqiy{1} typee]; valueeaiziygjqizqiy{1}=[valueeaiziygjqizqiy{1} valueeaeizeiygjeqizeqiy{3}(locbeam)/valueeaiziygjqizqiy{4}(loc)];

65 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 5 of 7 knowneaeizeiygjeqizeqiy{1}=remove(knowneaeizeiygjeqizeqiy{3} (:),locbeam); valueeaeizeiygjeqizeqiy{1}=remove(valueeaeizeiygjeqizeqiy{3} (:),locbeam); fprintf('beam %5.0f cannot have EA known because its I%5.0f is known\n',beam,type); fprintf('we correct this be making the E%5.0f known instead\n',typee); case 4 % case G % if G of a given type is known, it cannot appear in a beam % with known GJ of the same type BeamsWithTypeG=find(subbeamsEAIzIyGJQIzQIy{5}==type); loc=find(knowneaiziygjqizqiy{5}==type); if loc>0 BeamsWithTypeGandKnownGJ=intersect(knownEAIzIyGJQIzQIy{5}, BeamsWithTypeG); for ss=1:length(beamswithtypegandknowngj) corrected=1; beam=beamswithtypegandknowngj(ss); locbeam=find(knowneaeizeiygjeqizeqiy{4}==beam); typej=subbeamseaiziygjqizqiy{6}(beam); loc1=find(knowneaiziygjqizqiy{6},typej); if isempty(loc1) knowneaiziygjqizqiy{6}=[knowneaiziygjqizqiy{6} typej]; valueeaiziygjqizqiy{6}=[valueeaiziygjqizqiy{6} valueeaeizeiygjeqizeqiy{4}(locbeam)/valueeaiziygjqizqiy{5}(loc)]; knowneaeizeiygjeqizeqiy{4}=remove(knowneaeizeiygjeqizeqiy{4} (:),locbeam); valueeaeizeiygjeqizeqiy{4}=remove(valueeaeizeiygjeqizeqiy{4} (:),locbeam); fprintf('beam %5.0f cannot have GJ known because its G%5.0f is known\n',beam,type); fprintf('we correct this be making the J%5.0f known instead\n',typej); case 5 % case J % if J of a given type is known, it cannot appear in a beam % with known GJ of the same type BeamsWithTypeJ=find(subbeamsEAIzIyGJQIzQIy{6}==type); loc=find(knowneaiziygjqizqiy{6}==type); if loc>0 BeamsWithTypeJandKnownGJ=intersect(knownEAEIzEIyGJEQIzEQIy{4}, BeamsWithTypeJ); for ss=1:length(beamswithtypejandknowngj) corrected=1; beam=beamswithtypejandknowngj(ss); locbeam=find(knowneaeizeiygjeqizeqiy{4}==beam); typeg=subbeamseaiziygjqizqiy{5}(beam); loc1=find(knowneaiziygjqizqiy{5},typeg); if isempty(loc1) knowneaiziygjqizqiy{5}=[knowneaiziygjqizqiy{5} typeg];

66 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 6 of 7 valueeaiziygjqizqiy{5}=[valueeaiziygjqizqiy{5} valueeaeizeiygjeqizeqiy{4}(locbeam)/valueeaiziygjqizqiy{6}(loc)]; knowneaeizeiygjeqizeqiy{4}=remove(knowneaeizeiygjeqizeqiy{4} (:),locbeam); valueeaeizeiygjeqizeqiy{4}=remove(valueeaeizeiygjeqizeqiy{4} (:),locbeam); fprintf('beam %5.0f cannot have GJ known because its J%5.0f is known\n',beam,type); fprintf('we correct this be making the G%5.0f known instead\n',typeg); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Check shear parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Due to the formulation of the shear parameter Q=(24*I^2*(v+1))/(Ac*L^2+24*I*(v+1)) % it is necesary to have the same number of I and Q. Besides this, if the % length of the beam (L) change the Q parameter have to change too. for k=1:length(subbeamseaiziygjqizqiy{3}) if (subbeamseaiziygjqizqiy{3}(k))~=(subbeamseaiziygjqizqiy{7}(k)) fprintf('insufficient number of Q in subbeamseaiziygjqizqiy according to the number of Iz\n'); corrected=1; for k=1:length(subbeamseaiziygjqizqiy{4}) if (subbeamseaiziygjqizqiy{4}(k))~=(subbeamseaiziygjqizqiy{8}(k)) fprintf('insufficient number of Q in subbeamseaiziygjqizqiy according to the number of Iy\n'); corrected=1; for k=1:length(beamlength)-1 if (beamlength(k))~=(beamlength(k+1)) if (subbeamseaiziygjqizqiy{7}(k))>=(subbeamseaiziygjqizqiy{7}(k+1)) fprintf('insufficient number of Q in subbeamseaiziygjqizqiy due to different beam length\n'); corrected=1; for k=1:length(beamlength)-1 if (beamlength(k))~=(beamlength(k+1)) if (subbeamseaiziygjqizqiy{8}(k))>=(subbeamseaiziygjqizqiy{8}(k+1)) fprintf('insufficient number of Q in subbeamseaiziygjqizqiy due to different beam length\n'); corrected=1;

67 5/09/17 16:46 C:\Users\caminstech\Deskto...\CheckData2.m 7 of 7 if corrected==1 pause(2); fprintf('corrected MATRICES:\n'); fprintf('****************************************\n'); PrintCellMatrix('knownEAIzIyGJQIzQIy',knownEAIzIyGJQIzQIy,'%4d'); PrintPrettyLatex('valueEAIzIyGJQIzQIy',valueEAIzIyGJQIzQIy); PrintCellMatrix('knownEAEIzEIyGJEQIzEQIy',knownEAEIzEIyGJEQIzEQIy,'%4d'); PrintPrettyLatex('valueEAEIzEIyGJEQIzEQIy',valueEAEIzEIyGJEQIzEQIy); PrintCellMatrix('knowndxdydzwxwywz',knowndxdydzwxwywz,'%4d'); PrintPrettyLatex('valuedxdydzwxwywz',valuedxdydzwxwywz); PrintCellMatrix('knownfxfyfzmxmymz',knownfxfyfzmxmymz,'%4d'); PrintPrettyLatex('valuefxfyfzmxmymz',valuefxfyfzmxmymz);

68 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 1 of 7 function [selection,value] = choosebox(varargin) %CHOOSEBOX Two-listed item selection dialog box. % [SELECTION,OK] = CHOOSEBOX('ListString',S) creates a modal dialog box % which allows you to select a string or multiple strings from a list. % Single or multiple strings can be transferred from a base list to a % selection list using an arrow-button. Single strings also can be % transferred by double-clicking; single or multiple strings are % transferred by pressing <CR>. % SELECTION is a vector of indices of the selected strings (length 1 % in the single selection mode). The indices will be in the order of % selection from the base list. If a group of multiple strings is % selected, its order inside the group will not change, but different % groups are ordered by their selection. % OK is 1 if you push the OK button, or 0 if you push the Cancel % button or close the figure. In that case SELECTION will be [], % regardless to the actual selection list. % Important parameter is 'ChooseMode', see list below. % % Inputs are in parameter,value pairs: % % Parameter Description % 'ChooseMode' string; can be 'pick' or 'copy'. % When set to 'pick', transferred string items from the % base list box are removed. When retransferred, they % again are listed in their initial positions. % When set to 'copy', transferred string items remain in % the base list and can be transferred several times. % default is 'pick'. % 'ListString' cell array of strings for the base list box. % 'SelectionMode' string; can be 'single' or 'multiple'; defaults to % 'multiple'. % 'ListSize' [width height] of listbox in pixels; defaults % to [ ]. % 'InitialValue' vector of indices of which items of the list box % are initially selected; defaults to none []. % 'Name' String for the figure's title. Defaults to ''. % 'PromptString' string matrix or cell array of strings which appears % as text above the base list box. Defaults to {}. % 'SelectString' string matrix or cell array of strings which appears % as text above the selection list box. Defaults to {}. % 'OKString' string for the OK button; defaults to 'OK'. % 'CancelString' string for the Cancel button; defaults to 'Cancel'. % 'uh' uicontrol button height, in pixels; default = 18. % 'fus' frame/uicontrol spacing, in pixels; default = 8. % 'ffs' frame/figure spacing, in pixels; default = 8. % % Example: % d = dir; % str = {d.name}; % [s,v] = choosebox('name','file deletion',... % 'PromptString','Files remaining in this directory:',... % 'SelectString','Files to delete:',... % 'ListString',str) % % inspired by listdlg.m from Mathworks.

69 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 2 of 7 % % programmed by Peter Wasmeier, Technical University of Munich % p.wasmeier@bv.tum.de % error(nargchk(1,inf,nargin)) arrow=[ ]; for i=1:3 rarrow(:,:,i)=arrow; larrow(:,:,i)=fliplr(arrow); clear arrow; figname = ''; smode = 2; % (multiple) cmode = 1; % remove from left hand side promptstring = {}; selectstring={}; liststring = []; listsize = [ ];

70 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 3 of 7 initialvalue = []; okstring = 'Ok'; cancelstring = 'Cancel'; fus = 8; ffs = 8; uh = 18; if mod(length(varargin),2) ~= 0 % input args have not com in pairs, woe is me error('arguments to LISTDLG must come param/value in pairs.') for i=1:2:length(varargin) switch lower(varargin{i}) case 'name' figname = varargin{i+1}; case 'promptstring' promptstring = varargin{i+1}; case 'selectstring' selectstring = varargin{i+1}; case 'selectionmode' switch lower(varargin{i+1}) case 'single' smode = 1; case 'multiple' smode = 2; case 'choosemode' switch lower(varargin{i+1}) case 'pick' cmode = 1; case 'copy' cmode = 2; case 'listsize' listsize = varargin{i+1}; case 'liststring' liststring = varargin{i+1}; case 'initialvalue' initialvalue = varargin{i+1}; case 'uh' uh = varargin{i+1}; case 'fus' fus = varargin{i+1}; case 'ffs' ffs = varargin{i+1}; case 'okstring' okstring = varargin{i+1}; case 'cancelstring' cancelstring = varargin{i+1}; otherwise error(['unknown parameter name passed to LISTDLG. Name was ' varargin{i}]) if isstr(promptstring)

71 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 4 of 7 promptstring = cellstr(promptstring); if isstr(selectstring) selectstring = cellstr(selectstring); if isempty(initialvalue) initialvalue = 1; if isempty(liststring) error('liststring parameter is required.') ex = get(0,'defaultuicontrolfontsize')*1.7; % height extent per line of uicontrol text (approx) fp = get(0,'defaultfigureposition'); w = 4*fus +2*ffs+2*listsize(1)+50; h = 2*ffs+7*fus+ex*length(promptstring)+listsize(2)+2*uh; fp = [fp(1) fp(2)+fp(4)-h w h]; % keep upper left corner fixed fig_props = {... 'name' figname... 'resize' 'off'... 'numbertitle' 'off'... 'menubar' 'none'... 'windowstyle' 'modal'... 'visible' 'off'... 'createfcn' ''... 'position' fp... 'closerequestfcn' 'delete(gcbf)'... }; ad.fromstring=cellstr(liststring); ad.tostring=''; ad.pos_left=[1:size(ad.fromstring,2)]'; ad.pos_right=[]; ad.value=0; ad.cmode=cmode; setappdata(0,'listdialogappdata',ad) fig = figure(fig_props{:}); uicontrol('style','frame', 'position',[1 1 fp([3 4])]) % uicontrol('style','frame', 'position',[ffs ffs 2*fus+listsize(1) 2*fus+uh]) % uicontrol('style','frame','position',[ffs+2*fus+50+listsize(1) ffs 2*fus+listsize(1) 2*fus+uh]) % uicontrol('style','frame','position',[ffs ffs+3*fus+uh 2*fus+listsize(1)... % listsize(2)+3*fus+ex*length(promptstring)+(uh+fus)*(smode==2)]) % uicontrol('style','frame', 'position',[ffs+2*fus+50+listsize(1) ffs+3*fus+uh 2*fus+listsize(1)... % listsize(2)+3*fus+ex*length(promptstring)+(uh+fus)*(smode==2)])

72 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 5 of 7 if length(promptstring)>0 prompt_text = uicontrol('style','text','fontsize',9,'string',promptstring,... 'horizontalalignment','left','units','pixels',... 'position',[ffs+fus fp(4)-(ffs+fus+ex*length (promptstring))... listsize(1) ex*length(promptstring)]); if length(selectstring)>0 select_text = uicontrol('style','text','fontsize',9,'string',selectstring,... 'horizontalalignment','left','units','pixels',... 'position',[ffs+3*fus+listsize(1)+50 fp(4)- (ffs+fus+ex*length(promptstring))... listsize(1) ex*length(selectstring)]); btn_wid = listsize(1); leftbox = uicontrol('style','listbox',... 'position',[ffs+fus ffs+uh+4*fus listsize(1) listsize(2)+25],... 'FontSize',9,'string',ad.fromstring,... 'backgroundcolor','w',... 'max',2,... 'tag','leftbox',... 'value',initialvalue,... 'callback',{@dofromboxclick}); rightbox = uicontrol('style','listbox',... 'position',[ffs+3*fus+listsize(1)+50 ffs+uh+4*fus listsize(1) listsize(2)+25],... 'FontSize',9,'string',ad.tostring,... 'backgroundcolor','w',... 'max',2,... 'tag','rightbox',... 'value',[],... 'callback',{@dotoboxclick}); ok_btn = uicontrol('style','pushbutton',... 'FontSize',9,'string',okstring,... 'position',[fus+ffs+btn_wid/2 ffs+fus btn_wid/2 uh],... 'callback',{@dook}); cancel_btn = uicontrol('style','pushbutton',... 'FontSize',9,'string',cancelstring,... 'position',[ffs+3*fus+btn_wid+50 ffs+fus btn_wid/2 uh],... 'callback',{@docancel}); toright_btn = uicontrol('style','pushbutton',... 'position',[ffs+2*fus+10+listsize(1) ffs+uh+4*fus+(smode==2)* (fus+uh)+listsize(2)/ ],... 'cdata',rarrow,... 'callback',{@doright}); toleft_btn = uicontrol('style','pushbutton',... 'position',[ffs+2*fus+10+listsize(1) ffs+uh+4*fus+(smode==2)* (fus+uh)+listsize(2)/ ],...

73 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 6 of 7 'cdata',larrow,... 'callback',{@doleft}); try set(fig, 'visible','on'); uiwait(fig); catch if ishandle(fig) delete(fig) if isappdata(0,'listdialogappdata') ad = getappdata(0,'listdialogappdata'); selection = ad.pos_right; value = ad.value; rmappdata(0,'listdialogappdata') % figure was deleted selection = []; value = 0; function dook(varargin) ad=getappdata(0,'listdialogappdata'); ad.value = 1; setappdata(0,'listdialogappdata',ad) delete(gcbf); function docancel(varargin) ad.value = 0; ad.pos_right = []; setappdata(0,'listdialogappdata',ad) delete(gcbf); function dofromboxclick(varargin) % if this is a doubleclick, dook if strcmp(get(gcbf,'selectiontype'),'open') doright; function dotoboxclick(varargin) % if this is a doubleclick, dook if strcmp(get(gcbf,'selectiontype'),'open') doleft; function doright(varargin) ad=getappdata(0,'listdialogappdata'); leftbox=findobj('tag','leftbox'); rightbox=findobj('tag','rightbox'); selection=get(leftbox,'value'); ad.pos_right=[ad.pos_right;ad.pos_left(selection)]; ad.tostring=[ad.tostring ad.fromstring(selection)];

74 5/09/17 16:46 C:\Users\caminstech\Deskto...\choosebox2.m 7 of 7 if ad.cmode==1 % remove selected items ad.pos_left(selection)=[]; ad.fromstring(selection)=[]; setappdata(0,'listdialogappdata',ad) set(leftbox,'string',ad.fromstring,'value',[]); set(rightbox,'string',ad.tostring,'value',[]); function doleft(varargin) ad=getappdata(0,'listdialogappdata'); leftbox=findobj('tag','leftbox'); rightbox=findobj('tag','rightbox'); selection=get(rightbox,'value'); if ad.cmode==1 % if selected items had been removed % Sort in the items from right hand side again for i=1:length(selection) next_item=min(find(ad.pos_left>ad.pos_right(selection(i)))); if isempty(next_item) % Inserting item is last one ad.pos_left(+1)=ad.pos_right(selection(i)); ad.fromstring(+1)=ad.tostring(selection(i)); if next_item==ad.pos_left(1) % Inserting item is first one ad.pos_left=[ad.pos_right(selection(i));ad.pos_left]; ad.fromstring=[ad.tostring(selection(i)) ad.fromstring]; % Inserting item is anywhere in the middle ad.pos_left=[ad.pos_left(1:next_item-1);ad.pos_right(selection(i));ad. pos_left(next_item:)]; ad.fromstring=[ad.fromstring(1:next_item-1) ad.tostring(selection(i)) ad. fromstring(next_item:)]; ad.pos_left=ad.pos_left(:); % Make sure it is a nx1-vector ad.pos_right(selection)=[]; ad.tostring(selection)=[]; setappdata(0,'listdialogappdata',ad) set(leftbox,'string',ad.fromstring,'value',[]); set(rightbox,'string',ad.tostring,'value',[]);

75 5/09/17 16:47 C:\Users\caminste...\CreateForcesVector2.m 1 of 1 function ForcesNames=CreateForcesVector2(nnodes) global ScreenOption ForcesNames=cell(6*nnodes,1); %--- Forces and force-pair variables for i=1:nnodes pos=6*i-5; ForcesNames{pos}=['Rx' sprintf('%04.0f',i)]; ForcesNames{pos+1}=['Ry' sprintf('%04.0f',i)]; ForcesNames{pos+2}=['Rz' sprintf('%04.0f',i)]; ForcesNames{pos+3}=['Mx' sprintf('%04.0f',i)]; ForcesNames{pos+4}=['My' sprintf('%04.0f',i)]; ForcesNames{pos+5}=['Mz' sprintf('%04.0f',i)]; %--- Plotting information if ScreenOption==1 fprintf('--- Initial vector of forces:\n') ForcesNames if ScreenOption==2 fprintf('%%--- Initial vector of forces:\n') fprintf('$$\\left(\\begin{array}{c}'); for i=1:length(forcesnames)-1 fprintf('%s \\\\ ',ForcesNames{i}); fprintf('%s \\{array}\\right)$$ \n\n',forcesnames{});

76 5/09/17 16:47 C:\Users\caminstec...\CreateGSMVarNames2.m 1 of 2 function [GSM,allGSMVarNames]=CreateGSMVarNames2(GSM0,nsize,nbeams,beams) global subbeamseaiziygjqizqiy global ScreenOption Symbway %--- create the complete list of variables varnames=['e' 'A' 'dx'; 'E' 'Iz' 'dx'; 'E' 'Iy' 'dx'; 'E' 'A' 'dy'; 'E' 'Iz' 'dy'; 'E' 'Iy' 'dy'; 'E' 'A' 'dz'; 'E' 'Iz' 'dz'; 'E' 'Iy' 'dz'; 'G' 'J' 'wx'; 'E' 'Iz' 'wx'; 'E' 'Iy' 'wx'; 'E' 'Iz' 'wy'; 'E' 'Iy' 'wy'; 'G' 'J' 'wy'; 'E' 'Iz' 'wz'; 'E' 'Iy' 'wz'; 'G' 'J' 'wz'; 'E' 'QIz' 'dx'; 'E' 'QIy' 'dx'; 'E' 'QIz' 'dy'; 'E' 'QIy' 'dy'; 'E' 'QIz' 'dz'; 'E' 'QIy' 'dz'; 'E' 'QIz' 'wx'; 'E' 'QIy' 'wx'; 'E' 'QIz' 'wy'; 'E' 'QIy' 'wy'; 'E' 'QIz' 'wz'; 'E' 'QIy' 'wz'] allgsmvarnames=cell(1,nsize); transformvar=[ ]; cont=0; for beam=1:nbeams for beamextreme=1:2 beamnode=beams(beam,beamextreme); for k=1:30 %related to the dimension of transformvar cont=cont+1; allgsmvarnames{cont}=[allgsmvarnames{cont} varnames(k,1) sprintf('%04.0f', subbeamseaiziygjqizqiy{1}(beam)) varnames(k,2) sprintf('%04.0f',subbeamseaiziygjqizqiy {transformvar(k)}(beam)) varnames(k,3) sprintf('%04.0f',beamnode)]; %--- identify the non-sense variables for this example validcolumns=find(sum(abs(gsm0),1)~=0); %--- delete the non-sense columns GSM0=GSM0(:,validcolumns); GSMVarNames=allGSMVarNames(validcolumns); %--- get the equal columns togueter (deleting the repeat ones) allgsmvarnames=unique(gsmvarnames); [r,ni]=size(gsm0); if Symbway==0 GSM=zeros(r,length(allGSMVarNames)); GSM=sym(zeros(r,length(allGSMVarNames))); for i=1:length(allgsmvarnames) aux=[]; for j=1:length(gsmvarnames) if isequal(allgsmvarnames(i),gsmvarnames(j)); aux=[aux j]; GSM(:,i)=sum(GSM0(:,aux),2); %--- Plotting information if ScreenOption==1

77 5/09/17 16:47 C:\Users\caminstec...\CreateGSMVarNames2.m 2 of 2 fprintf('--- Initial GSM and variables:\n') GSM allgsmvarnames' if ScreenOption==2 fprintf('%%--- Initial GSM and variables:\n$$%s$$\n',latex(gsm)); % fprintf('$$\\left(\\begin{array}{c}'); for i=1:length(allgsmvarnames)-1 fprintf('%s \\\\ ',allgsmvarnames{i}); fprintf('%s \\{array}\\right)$$ \n\n',allgsmvarnames{});

78 5/09/17 16:47 C:\Users\caminstec...\CreateLSMVarNames2.m 1 of 1 function [GSM,GSMVarNames]=CreateLSMVarNames2(GSM0,nsize,nbeams,beams) global subbeamseaiziygjqizqiy global ScreenOption Symbway %--- create the complete list of variables varnames=['e' 'A' 'dx'; 'E' 'Iz' 'dx'; 'E' 'Iy' 'dx'; 'E' 'A' 'dy'; 'E' 'Iz' 'dy'; 'E' 'Iy' 'dy'; 'E' 'A' 'dz'; 'E' 'Iz' 'dz'; 'E' 'Iy' 'dz'; 'G' 'J' 'wx'; 'E' 'Iz' 'wx'; 'E' 'Iy' 'wx'; 'E' 'Iz' 'wy'; 'E' 'Iy' 'wy'; 'G' 'J' 'wy'; 'E' 'Iz' 'wz'; 'E' 'Iy' 'wz'; 'G' 'J' 'wz'; 'E' 'QIz' 'dx'; 'E' 'QIy' 'dx'; 'E' 'QIz' 'dy'; 'E' 'QIy' 'dy'; 'E' 'QIz' 'dz'; 'E' 'QIy' 'dz'; 'E' 'QIz' 'wx'; 'E' 'QIy' 'wx'; 'E' 'QIz' 'wy'; 'E' 'QIy' 'wy'; 'E' 'QIz' 'wz'; 'E' 'QIy' 'wz']; allgsmvarnames=cell(1,nsize); transformvar=[ ]; cont=0; for beam=1:nbeams for beamextreme=1:2 beamnode=beams(beam,beamextreme); for k=1:30 % related to the dimension of varnames cont=cont+1; allgsmvarnames{cont}=[allgsmvarnames{cont} varnames(k,1) sprintf('%04.0f', subbeamseaiziygjqizqiy{1}(beam)) varnames(k,2) sprintf('%04.0f',subbeamseaiziygjqizqiy {transformvar(k)}(beam)) varnames(k,3) sprintf('%04.0f',beamnode)]; %--- identify the non-sense variables for this example validcolumns=find(sum(abs(gsm0),1)~=0);

79 5/09/17 16:47 C:\Users\caminstech\Deskto...\CreateZpd2.m 1 of 1 function [zpd,zpd_vector,zpd_matrix]=createzpd2(binv,d) % Particular solution associated with zd in matritial form global ScreenOption %--- Delete the null terms in d and in BInv validcol=find(d~=0); zpd_vector=d(validcol); %vector of forces % if Symbway==1 zpd_matrix=sym(binv); %matrix of coefficients %--- Compute the vector zpd zpd=zpd_matrix*zpd_vector; % % zpd_matrix=binv(:,validcol); %matrix of coefficients % zpd_aux=ones(size(zpd_vector)); % zpd=zpd_matrix*zpd_aux; % %--- Plotting information if ScreenOption==1 fprintf('--- zpd= zpd_matrix * zpd_vector:\n') zpd,zpd_matrix,zpd_vector if ScreenOption==2 fprintf('\n%%--- zpd= zpd_matrix * zpd_vector:\n'); fprintf('zpd: $$%s$$\n',latex(zpd)); fprintf('zpd matrix: $$%s$$\n',latex(zpd_matrix)); fprintf('zpd vector: $$%s$$\n\n',latex(zpd_vector));

80 5/09/17 16:47 C:\Users\caminstech\De...\Displacements2.m 1 of 4 function [KnownName,valuevars]=Displacements2(ForcesNames,nnodes,nbeams) global knowndxdydzwxwywz knowneaiziygjqizqiy knowneaeizeiygjeqizeqiy global valuedxdydzwxwywz valueeaiziygjqizqiy valueeaeizeiygjeqizeqiy global ScreenOption global subbeamseaiziygjqizqiy beamlength global direct knowneaiziygjsdirect valueeaiziygjsdirect % %--- Poisson % v=0.25; KnownName=cell(1,6*nnodes); valuevars=sym([]); ind=1; % %--- Create forces as symbolic variables % for i=1:nnodes % eval(sprintf('syms H%04.0f',i)) % eval(sprintf('syms V%04.0f',i)) % eval(sprintf('syms M%04.0f',i)) % %--- Displacements & forces [r c]=size(knowndxdydzwxwywz); auxvar='dxdydzwxwywz'; for node=1:nnodes for j=1:6 pos=find(node==knowndxdydzwxwywz{j,:}); % if ~isempty(pos) && valuedxdydzwxwywz{j}(pos)==0 KnownName{ind}=sprintf('%s%04.0f',auxvar(j),node); valuevars=[valuevars valuedxdydzwxwywz{j}(pos)]; % % KnownName(ind)=ForcesNames(6*(node-1)+j); % valuevars=[valuevars KnownName(ind)]; % ind=ind+1; % %--- Individual E,A,I % if direct==1 % transformdata={[1:16]; [ ]; [ ]; [ ]}; % auxvar='eaiq'; % for beam=1:nbeams % for k=1:4 % type=subbeamseaiqi{k}(beam); % pos=find(type==knowneaisdirect{k}); % if pos>0 % for r=transformdata{k} % KnownName{ind}=sprintf('%s%04.0f',auxvar(k),knownEAISdirect{k} (pos)); % valuevars=[valuevars valueeaisdirect{k}(pos)]; % ind=ind+1; %

81 5/09/17 16:47 C:\Users\caminstech\De...\Displacements2.m 2 of 4 % % % % % transformdata={[1:16]; [ ]; [ ]; [ ]}; % auxvar='eaiq'; % for beam=1:nbeams % for k=1:4 % type=subbeamseaiqi{k}(beam); % pos=find(type==knowneaiqi{k}); % if pos>0 % for r=transformdata{k} % KnownName{ind}=sprintf('%s%04.0f',auxvar(k),knownEAIQI{k}(pos)); % valuevars=[valuevars valueeaiqi{k}(pos)]; % ind=ind+1; % % % % % % % %--- Pairs EA and EI % auxvar='aeeieq'; % for beam=1:nbeams % for k=1:3 % pos=find(beam==knowneaeieqi{k}); % if pos>0 % for r=transformdata{k+1} % KnownName{ind}=sprintf('%s%04.0f%s%04.0f',auxvar(2*k-1),knownEAEIEQI {k}(pos),auxvar(2*k),knowneaeieqi{k}(pos)); % valuevars=[valuevars valueeaeieqi{k}(pos)]; % ind=ind+1; % % % % % % %--- Delete the empty cells % KnownName=KnownName(1:ind-1); % valuevars=valuevars(1:ind-1); % % %--- Sort and check the solution % [KnownName,ind]=sort(KnownName); % valuevars=valuevars(ind); % % [KnownName1,pos0,pos]=unique(KnownName); % valuevars1=valuevars(pos0); % % if direct==1 % cont1=1; % cont2=1; % cont3=1; % for i=1:length(knownname1) % aux1=char(knownname1(i)); % auxl=aux1(1:1);

82 5/09/17 16:47 C:\Users\caminstech\De...\Displacements2.m 3 of 4 % auxn=str2double(aux1(2:)); % if auxl=='e' % auxe(cont1)=auxn; % valuee(cont1)=valuevars1(i); % cont1=cont1+1; % % if auxl=='i' % auxi(cont2)=auxn; % valuei(cont2)=valuevars1(i); % cont2=cont2+1; % % if auxl=='q' % auxq(cont3)=auxn; % valueq(cont3)=valuevars1(i); % cont3=cont3+1; % % % % for i=1:length(subbeamseaiqi{1}) % auxl=beamlength(i); % sube=subbeamseaiqi{1}(i); % subi=subbeamseaiqi{3}(i); % subq=subbeamseaiqi{4}(i); % for j=1:length(auxe) % if auxe(j)==sube % vale=valuee(j); % % % for j=1:length(auxi) % if auxi(j)==subi % vali=valuei(j); % % % for j=1:length(auxq) % if auxq(j)==subq % valq=valueq(j); % % % if valq==0 % Q(i)=sym(0); % % Q(i)=valI*((12*valE*valI)/((valE/(2+2*v))*valQ*auxl^2))/(1+ ((12*valE*valI)/((valE/(2+2*v))*valQ*auxl^2))); % % % L=1; % Q=sym(eval(Q)); % cont1=1; % for i=1:length(knownname1) % aux1=char(knownname1(i)); % auxl=aux1(1:1); % if auxl=='q' % valuevars1(i)=q(cont1); % cont1=cont1+1; %

83 5/09/17 16:47 C:\Users\caminstech\De...\Displacements2.m 4 of 4 % % % % %--- Plotting information % if ScreenOption==1 % fprintf('--- Initial known forces and boundary conditions:\n') % for i=1:length(valuevars1) % fprintf('%s: %s\n',knownname1{i},char(valuevars1(i))) % % fprintf('\n') % if ScreenOption==2 % fprintf('%%--- Initial known forces and boundary conditions:\n') % fprintf('\\begin{tabular}{llllllll}\n'); % ncol=8; % for i=1:ceil(length(valuevars1)/ncol)*ncol % if i<=length(valuevars1) % fprintf('%s=%s',knownname1{i},char(valuevars1(i))); % % if floor(i/ncol)==i/ncol && i<length(valuevars1) % fprintf('\\\\ \n'); % if floor(i/ncol)==i/ncol && i==ceil(length(valuevars1)/ncol)*ncol % fprintf(' \n'); % % fprintf(' & '); % % % fprintf('\\{tabular}\n\n') %

84 5/09/17 16:47 C:\Users\caminstech\Deskt...\EQSolution2.m 1 of 1 function Val=EQSolution2 Val=[];

85 5/09/17 16:48 C:\Users\caminstech\Deskt...\EvalNumRes2.m 1 of 2 function U_num=EvalNumRes2(SelEq,Niter,Cumvars,Cumres) %Evaluate values numerically global ScreenOption global measur_values loads_value U_num=zeros(length(Cumvars),1); groupeq=sum(seleq>0,2); %# of equations per iteration eq=1; Vars=[]; for i=1:niter %--- Identifies the symbolic variables for j=1:groupeq(i) auxvars=symvar(cumres(eq+j-1)); NewVars=setdiff(auxvars,Vars); %--- Data identification n=length(newvars); NumVal=zeros(1,n); if n>0 for j=1:n % search in measurements [c,ni,pos]=intersect(newvars(j),measur_values(:,1)); if ~isempty(c) NumVal(j)=measur_values{pos,2}; % search in loads [c,ni,pos]=intersect(newvars(j),loads_value(:,1)); if ~isempty(c)&& ~isempty(loads_value{pos,2}) NumVal(j)=loads_value{pos,2}; % b)evalue the introduced data for j=1:n eval(sprintf('%s=%d;',char(newvars(j)),numval(j))); %--- Evaluate the equations per iteration U_num(eq:eq+groupeq(i)-1)=eval(Cumres(eq:eq+groupeq(i)-1)); %--- Add the new values to the symbolic variables for j=1:groupeq(i) Vars=unique([Vars NewVars Cumvars(eq:eq+groupeq(i)-1)']); eval(sprintf('%s=%d;',char(cumvars(j+eq-1)),u_num(j+eq-1))) %--- Next equations eq=eq+groupeq(i);

86 5/09/17 16:48 C:\Users\caminstech\Deskt...\EvalNumRes2.m 2 of 2 %--- Plotting information switch ScreenOption case {0,1} fprintf('\n--- Numeric observed values\n') for i=1:length(u_num) fprintf('%s = %d\n', Cumvars{i},U_num(i)) case 2 fprintf('%%--- Numeric observed values\n') % Numeric results fprintf('\\begin{tabular}{llllllll}\n'); ncol=4; for i=1:ceil(length(u_num)/ncol)*ncol if i<=length(u_num) fprintf('%s=%-8.2f',cumvars{i},u_num(i)); if floor(i/ncol)==i/ncol && i<length(u_num) fprintf('\\\\ \n'); if floor(i/ncol)==i/ncol && i==ceil(length(u_num)/ncol)*ncol fprintf(' \n'); fprintf(' & '); fprintf('\\{tabular}\n\n')

87 5/09/17 16:48 C:\Users\caminstech\Desktop\...\EvalRes2.m 1 of 2 function [Cumvars,Cumres]=EvalRes2(D,zk,zd,zpd_vector,zpd_matrix,SelEq,Niter,Measured) % NUMERIC CALCULUS global ScreenOption global measur_values loads_value %--- Final solution Cumvars={}; Cumres=[]; %--- Data query Vars=[zpd_vector;Measured]; n=length(vars); NumVars=zeros(1,n); %--- Data identification if n>0 for j=1:n % search in measurements [c,ni,pos]=intersect(char(vars(j)),measur_values(:,1)); if ~isempty(c) NumVars(j)=measur_values{pos,2}; % search in loads [c,ni,pos]=intersect(char(vars(j)),loads_value(:,1)); if ~isempty(c)&& ~isempty(loads_value{pos,2}) NumVars(j)=loads_value{pos,2}; %--- Iterative process to find the observed variables for i=1:niter SelEq_i=SelEq(i,SelEq(i,:)>0); %delete the null values [Var,Val]=StiffnessCalculus2(D,zk,zd,zpd_vector,zpd_matrix,SelEq_i,Measured,Vars, NumVars); Measured=[Measured; Var]; Vars=[Vars; Var]; NumVars=[NumVars, Val]; %--- Cumulate the results Cumvars=[Cumvars; Var]; Cumres=[Cumres, Val]; %--- Plotting information switch ScreenOption case {0,1} fprintf('\n--- Numeric observed variables\n') for i=1:length(cumres) fprintf('%s = %d\n', Cumvars{i},Cumres(i)) case 2 fprintf('%%--- Numeric observed variables\n')

88 5/09/17 16:48 C:\Users\caminstech\Desktop\...\EvalRes2.m 2 of 2 % Numeric results fprintf('$$\\left(\\begin{array}{c}'); for i=1:length(cumvars)-1 fprintf('%s \\\\ ',Cumvars{i}); fprintf('%s \\{array}\\right)= \n',cumvars{}); % Cumres digits(3) fprintf('%s$$\n\n',latex(sym(cumres,'d')));

89 5/09/17 16:48 C:\Users\caminstech\Deskt...\EvalSymRes2.m 1 of 1 function [Cumvars,Cumres]=EvalSymRes2(D,zk,zd,zpd_vector,zpd_matrix,SelEq,Niter, Measured) global ScreenOption %--- Final solution: Cumvars=Cumres1*Us_sym_vector+Cumres2 Cumvars={}; Cumres1={}; Cumres2={}; %indepent term %--- Iterative process to find the observed variables Knowns=Measured'; for i=1:niter SelEq_i=SelEq(i,SelEq(i,:)>0); %delete the null values [unique_x,us_sym_matrix,us_sym_vector,it_sym]=stiffnesssymcalculus2(d,zk,zd, zpd_vector,zpd_matrix,seleq_i,knowns); Knowns=[Knowns,unique_x]; %--- Cumulate the results Cumvars=[Cumvars; unique_x']; Cumres1=[Cumres1; Us_sym_matrix]; Cumres2=[Cumres2; IT_sym]; Cumres=Cumres1*Us_sym_vector+Cumres2; %--- Plotting information switch ScreenOption case {0,1} fprintf('\n--- Symbolic observed variables: Cumvars=Cumres1*Us_sym_vector+Cumres2\n') Cumvars,Cumres1,Us_sym_vector,Cumres2 case 2 fprintf('%%--- Symbolic observed variables\n') % Symbolic results fprintf('$$\\left(\\begin{array}{c}'); for i=1:length(cumvars)-1 fprintf('%s \\\\ ',Cumvars{i}); fprintf('%s \\{array}\\right)= \n',cumvars{}); % Cumres1 fprintf('%s\n',latex(cumres1)); % Cumres2 fprintf('%s + \n',latex(cumres2)); % IT_sym if any(it_sym~=0)==0 fprintf('$$\n'); fprintf('%s$$\n\n',latex(it_sym));

90 5/09/17 16:48 C:\Users\caminstech\D...\FullRankMatrix2.m 1 of 2 function [FullRMatrix,rankM,selectedr,selectedc]=FullRankMatrix2(A,error) %Determine a submatrix of A with full rank [r,c]=size(a); tol=error^.5; targrank=rank(a,tol); %--- Work with the matrix A such as r<=c. Transpose if it is necessary if r>c M=A'; aux=r; r=c; c=aux; M=A; %--- Identify the L.I. rows if targrank==r selectedr=1:r; i=0; while 1 i=i+1; if sum(abs(m(i,:)),2)>error i==r break selectedr=i; optr=setdiff(1:r,selectedr); for i=optr if rank(m([selectedr,i],:),tol)==length(selectedr)+1 selectedr=[selectedr,i]; if length(selectedr)==targrank %when the maximum rank is reached, it stops break %--- Identify the L.I. columns (add one by one until completing tthe rank) if targrank==c selectedc=1:c; M=M(selectedr,:); i=0; while 1 i=i+1; if sum(abs(m(:,i)),1)>error i==c break selectedc=i; optc=setdiff(1:c,selectedc); for i=optc

91 5/09/17 16:48 C:\Users\caminstech\D...\FullRankMatrix2.m 2 of 2 if rank(m(:,[selectedc,i]),tol)==length(selectedc)+1 selectedc=[selectedc,i]; if length(selectedc)==targrank %when the maximum rank is reached, it stops break %--- Check the full rank and correct it if it is necessary % (delete one by one the non-useful columns) if rank(m(:,selectedc),tol)<targrank fprintf('recalculating the full-rank matrix...\n') selectedc=1:c; for i=1:c temp_selectedc=setdiff(selectedc,i); if rank(m(:,temp_selectedc),tol)==targrank selectedc=temp_selectedc; %--- Solution FullRMatrix=M(:,selectedc); if r>c %transpose the solution FullRMatrix=FullRMatrix'; aux=selectedr; selectedr=selectedc; selectedc=aux; rankm=rank(fullrmatrix,tol);

92 5/09/17 16:49 C:\Users\caminstech\De...\Identif_J1_J22.m 1 of 3 function [mat_1,mat_2,mat_3,b_sorted,z_sorted,nf0,ndouble,nsingle,varsingle,vardouble, varf0]=identif_j1_j22(b_ampl,z,neq) % Identification of J1 and J2 \ % Restriction I001w001=(I001)*(w001) is expressed as % [mat_1]x = ([mat_2]x).* ([mat_3]x) % [omega I omega]x = ([omega omega J1]X).* ([omega omega J2]X), being % X=[epsilon; vardouble; varsingle_expanded] % 1)Sort z; z_sorted=[h;v;m; vardouble; varsingle]=[f0, D00; D0] lenz=length(z); new_pos=zeros(lenz,1); % identify F0 z_aux=z; cont=1; for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'rx')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z{i}; if ~isempty(strfind(auxvar,'ry')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'rz')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'mx')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values

93 5/09/17 16:49 C:\Users\caminstech\De...\Identif_J1_J22.m 2 of 3 for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'my')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'mz')); new_pos(cont)=i; cont=cont+1; varf0{cont-1}=z_aux{i}; z_aux{i}=''; %delete the identified values nf0=cont-1; %number of Reactions=[Rx,Ry,Rz,Mx,My,Mz] if cont==1 varf0={' '}; % identify double unknown for i=1:lenz auxvar=z_aux{i}; if length(auxvar)==10 %double unknown (be aware with the dynamic case and shear) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values ndouble=cont-1-nf0; %number of double variables % identify single unknown for i=1:lenz auxvar=z_aux{i}; if length(auxvar)==5 %single unknown (be aware with the dynamic case) new_pos(cont)=i; cont=cont+1; nsingle=cont-1-ndouble-nf0; %number of single variables % sort z and B B_sorted=B_ampl(:,new_pos); z_sorted=z(new_pos);

94 5/09/17 16:49 C:\Users\caminstech\De...\Identif_J1_J22.m 3 of 3 %--- Add single unknown lacking vardouble=z_sorted(nf0+1:nf0+ndouble); varsingle=z_sorted(nf0+ndouble+1:nf0+ndouble+nsingle); for i=1:ndouble aux1=vardouble{i}(1:5); %i.e. I0001 %try to find if it is already included if isempty(cell2mat(strfind(varsingle,aux1))) ;%if empty, add the var varsingle=[varsingle,{aux1}]; nsingle=nsingle+1; aux2=vardouble{i}(6:10); %i.e. w0001 %try to find if it is already included if isempty(cell2mat(strfind(varsingle,aux2))) ;%if empty, add the var varsingle=[varsingle,{aux2}]; nsingle=nsingle+1; % Identify J1 and J2 J1=zeros(ndouble,nsingle); J2=zeros(ndouble,nsingle); for i=1:ndouble aux1=vardouble{i}(1:5); %i.e. I0001 aux2=vardouble{i}(6:); %i.e. w0001 for j=1:nsingle %search within the single variable vector if strfind(aux1,varsingle{j}); J1(i,j)=1; if strfind(aux2,varsingle{j}); J2(i,j)=1; % Arrange matrices mat_1, mat_2 and mat_3 % number of row= number of double variables mat_1=[zeros(ndouble,neq+nf0), eye(ndouble), zeros(ndouble,nsingle)]; mat_2=[zeros(ndouble,neq+nf0+ndouble), J1]; mat_3=[zeros(ndouble,neq+nf0+ndouble), J2];

95 5/09/17 16:49 C:\Users\caminstec...\LocalMatrixValues2.m 1 of 3 function [GSM,GSMVarsNames,KnownForces,KnownForcesValues]=LocalMatrixValues2(GSM0, GSMVarsNames,ForcesNames,KnownName,valuevars) global ScreenOption Symbway %--- VECTOR OF FORCES %--- a) Identify the known forces KnownForces=zeros(length(ForcesNames),1); KnownForcesValues=sym(zeros(length(ForcesNames),1)); KnownForcesname=cell(length(ForcesNames),1); typeknown=zeros(size(knownname)); for i=1:length(forcesnames) for j=1:length(knownname) if isequal(forcesnames{i},knownname{j}) KnownForces(i)=i; KnownForcesValues(i)=valuevars(j); KnownForcesname(i)=KnownName(j); typeknown(j)=1; break %--- E or G variable: delete from the list when it is known lengthgsmvars=length(gsmvarsnames); factor=ones(1,lengthgsmvars); for i=1:length(knownname) aux=knownname{i}; if strcmp('e',aux(1)) strcmp('g',aux(1)) typeknown(i)=2; EGvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,egvar); if ~isempty(pos) GSMVarsNames{j}=auxvar(setdiff(1:29,pos:pos+4)); factor(j)=factor(j)*valuevars(i); %--- A, Iz, Iy or J variable: delete from the list when it is known nulcol=[]; for i=1:length(knownname) aux=knownname{i}; if strcmp('a',aux(1)) strcmp('iz',aux(1)) strcmp('iy',aux(1)) strcmp('j',aux (1)) typeknown(i)=3; AIJvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,aijvar); if ~isempty(pos) len=length(gsmvarsnames{j});

96 5/09/17 16:49 C:\Users\caminstec...\LocalMatrixValues2.m 2 of 3 if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i); %--- QIz variable: delete from the list when it is known for i=1:length(knownname) aux=knownname{i}; if strcmp('qiz',aux(1)) typeknown(i)=4; QIzvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,qizvar); if ~isempty(pos) len=length(gsmvarsnames{j}); if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i); %--- QIy variable: delete from the list when it is known for i=1:length(knownname) aux=knownname{i}; if strcmp('qiy',aux(1)) typeknown(i)=5; QIyvar=KnownName{i}; for j=1:lengthgsmvars auxvar=gsmvarsnames{j}; pos=strfind(auxvar,qiyvar); if ~isempty(pos) len=length(gsmvarsnames{j}); if valuevars(i)~=0 GSMVarsNames{j}=auxvar(setdiff(1:len,pos:pos+4)); GSMVarsNames{j}=''; nulcol=[nulcol,j]; factor(j)=factor(j)*valuevars(i);

97 5/09/17 16:49 C:\Users\caminstec...\LocalMatrixValues2.m 3 of 3 %--- Multiply by the factor associated with the E, A, Iz, Iy, G, J and Q for i=1:lengthgsmvars GSM1(:,i)=GSM0(:,i)*factor(i); %--- identify null columns in GSM and delete variable and column validcolumns=find(sum(abs(gsm1),1)~=0); GSM1=GSM1(:,validcolumns); GSMVarsNames=GSMVarsNames(validcolumns); % --- get the equal columns together (deleting the repeated ones) allgsmvarsnames=unique(gsmvarsnames,'stable'); [r,ni]=size(gsm1); if Symbway==0 GSM=zeros(r,length(allGSMVarsNames)); GSM=sym(zeros(r,length(allGSMVarsNames))); for i=1:length(allgsmvarsnames) aux=[]; for j=1:length(gsmvarsnames) if isequal(allgsmvarsnames(i),gsmvarsnames(j)); aux=[aux j]; GSM(:,i)=sum(GSM1(:,aux),2);

98 5/09/17 16:49 C:\Users\caminstech\Des...\MinimLeastSq2.m 1 of 4 function [X_sol,nepsilon,fval,z_sorted]=MinimLeastSq2(B_ampl, z, d_ampl, Wi) %Wi; weigths %B_ampl=[B;Eq.Equilibrium] %d_ampl=[d;cond.equilbrium] %--- Optimizacion NO lineal %Solving B*z=d+epsilon subject to equilibrium eq., relation between single %and double variables [neq_ampl,~]=size(b_ampl); neq=neq_ampl-3; %The output will be the minimum error associated with the equations and the unknown variables [mat_1,mat_2,mat_3,b_amplsorted,z_sorted,nf0,ndouble,nsingle]=identif_j1_j2(b_ampl,z, neq); % Identification of J1 and J2 nunknown=nf0+ndouble+nsingle; %to define the number of errors to minimize (an error per equation, i.e., an error per variable) objfun ^2); %neq de X0=[zeros(neq,1);ones(nunknown,1)]; A=[];b=[]; % A x <= b Aeq=[[-eye(neq);zeros(3,neq)], B_amplsorted, zeros(neq+3,nunknown-neq)]; beq=d_ampl; % Aeq x = beq lb=[-0.01*ones(neq,1);0.25*ones(nunknown,1)]; ub=[0.01*ones(neq,1);1.75*ones(nunknown,1)]; %options=optimset('algorithm','interior-point','display','off'); %matlab viejo options=optimoptions('fmincon','algorithm','sqp','display','on'); [X_sol,fval,exitflag,output]=fmincon(objfun,X0,A,b,Aeq,beq,lb,ub,@nonlcon,options); nepsilon=neq; % function [c, ceq]=nonlcon(x) c=[]; %Nonlinear inequality constraints ceq=(mat_1*x)-(mat_2*x).*(mat_3*x); %=0 function [mat_1,mat_2,mat_3,b_sorted,z_sorted,nf0,ndouble,nsingle]=identif_j1_j2(b,z, neq) % Identification of J1 and J2 \ % Restriction I001w001=(I001)*(w001) is expressed as % [mat_1]x = ([mat_2]x).* ([mat_3]x) % [omega I omega]x = ([omega omega J1]X).* ([omega omega J2]X), being % X=[epsilon; vardouble; varsingle_expanded] % 1)Sort z; z_sorted=[h;v;m; vardouble; varsingle]=[f0, D00; D0] lenz=length(z); new_pos=zeros(lenz,1); % identify F0 z_aux=z;

99 5/09/17 16:49 C:\Users\caminstech\Des...\MinimLeastSq2.m 2 of 4 cont=1; for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'rx')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z{i}; if ~isempty(strfind(auxvar,'ry')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'rz')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'mx')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'my')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values for i=1:lenz auxvar=z_aux{i}; if ~isempty(strfind(auxvar,'mz')) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values nf0=cont-1; %number of Reactions=[Rx,Ry,Rz,Mx,My,Mz] % identify double unknown for i=1:lenz auxvar=z_aux{i}; if ~isempty(length(auxvar)==8) %double unknown (be aware with the dynamic case and

100 5/09/17 16:49 C:\Users\caminstech\Des...\MinimLeastSq2.m 3 of 4 shear) new_pos(cont)=i; cont=cont+1; z_aux{i}=''; %delete the identified values ndouble=cont-1-nf0; %number of double variables % identify single unknown for i=1:lenz auxvar=z_aux{i}; if ~isempty(length(auxvar)==4) %single unknown (be aware with the dynamic case) new_pos(cont)=i; cont=cont+1; nsingle=cont-1-ndouble-nf0; %number of single variables % sort z and B B_sorted=B(:,new_pos); z_sorted=z(new_pos); %--- Add single unknown lacking vardouble=z_sorted(nf0+1:nf0+ndouble); varsingle=z_sorted(nf0+ndouble+1:nf0+ndouble+nsingle); for i=1:ndouble aux1=vardouble{i}(1:4); %i.e. I0001 %try to find if it is already included if isempty(cell2mat(strfind(varsingle,aux1))) %if empty, add the var varsingle=[varsingle,{aux1}]; nsingle=nsingle+1; aux2=vardouble{i}(5:); %i.e. w0001 %try to find if it is already included if isempty(cell2mat(strfind(varsingle,aux2))) %if empty, add the var varsingle=[varsingle,{aux2}]; nsingle=nsingle+1; % Identify J1 and J2 J1=zeros(ndouble,nsingle); J2=zeros(ndouble,nsingle); for i=1:ndouble aux1=vardouble{i}(1:4); %i.e. I0001 aux2=vardouble{i}(5:); %i.e. w0001 for j=1:nsingle %search within the single variable vector if strfind(aux1,varsingle{j}) J1(i,j)=1; strfind(aux2,varsingle{j}) J2(i,j)=1;

101 5/09/17 16:49 C:\Users\caminstech\Des...\MinimLeastSq2.m 4 of 4 % Arrange matrices mat_1, mat_2 and mat_3 % number of row= number of double variables mat_1=[zeros(ndouble,neq+nf0), eye(ndouble), zeros(ndouble,nsingle)]; mat_2=[zeros(ndouble,neq+nf0+double), J1]; mat_3=[zeros(ndouble,neq+nf0+double), J2];

102 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 1 of 7 function PlotNetwork2(Example,beams,nodecoordinates,nnodes,nbeams,theta,h) % Plot the Network, drawing some selected links in red global knowndxdydzwxwywz global valuedxdydzwxwywz global knownfxfyfzmxmymz global valuefxfyfzmxmymz global subbeamseaiziygjqizqiy % Transformation from symbolic to numeric L=1; nodecoordinates=eval(nodecoordinates); % graphical configuration %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % h=figure('name','network'); colors=gencolor(nbeams); xmax=max(nodecoordinates(:,1)); xmin=min(nodecoordinates(:,1)); ymax=max(nodecoordinates(:,2)); ymin=min(nodecoordinates(:,2)); %zmax=max(nodecoordinates(:,3)); %zmin=min(nodecoordinates(:,3)); PS=max(xmax-xmin,ymax-ymin); %Plot size R=max(0.1,PS/210); lettersize=10; hold(h,'on') axis(h,'square','off') % Beams %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for b=1:nbeams dx(1)=nodecoordinates(beams(b,1),1); dx(2)=nodecoordinates(beams(b,2),1); dy(1)=nodecoordinates(beams(b,1),2); dy(2)=nodecoordinates(beams(b,2),2); dz(1)=nodecoordinates(beams(b,1),3); dz(2)=nodecoordinates(beams(b,2),3); color=zeros(1,3); for k=1:3 color(k)=colors(subbeamseaiziygjqizqiy{k}(b),k); plot3(h,dx,dy,dz,'-b','color',color,'linewidth',4) hold(h,'on') % Nodes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for i=1:nnodes plot_circ(r,nodecoordinates(i,1),nodecoordinates(i,2),0,20,2) % Labels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

103 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 2 of 7 %- Beams labels for b=1:nbeams Labels(nodecoordinates(beams(b,1),:),nodecoordinates(beams(b,2),:),-R,num2str(b), lettersize*.8,'normal') %- Nodes labels for n=1:nnodes Labels(nodecoordinates(n,:),nodecoordinates(n,:),2*R,num2str(n),lettersize,'bold') % Supports %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for n=1:nnodes type=0; for k=1:6 loc=find(knowndxdydzwxwywz{k}==n); if ~isempty(loc) if valuedxdydzwxwywz{k}(loc)==0 type=type+10^(6-k); type=type+7^(k); ang=0; % fprintf('node: %2.0f type: %6.4f \n', n, type) switch type case {10,17,353,360}, roller(nodecoordinates(n,1),nodecoordinates(n,2), nodecoordinates(n,3),ang,r) case {11,18}, rollerfixed(nodecoordinates(n,1),nodecoordinates(n,2), nodecoordinates(n,3),ang,r) case {100,149,443,492}, % if isempty(find(beams(:,1)==n)) % implies a tail node % aux=find(beams(:,2)==n); % beta=theta(aux(1))-pi/2; % roller(nodecoordinates(n,1),nodecoordinates(n,2),nodecoordinates(n,3),angpi/2,r) case {101,150}, rollerfixed(nodecoordinates(n,1),nodecoordinates(n,2),nodecoordinates(n, 3),ang-pi/2,R) case {110,453}, hinged(nodecoordinates(n,1),nodecoordinates(n,2), nodecoordinates(n,3),ang,r) case 111, if ~isempty(find(beams(:,1)==n)) % implies a head node aux=find(beams(:,1)==n); ang=theta(aux(1)); fixed(nodecoordinates(n,1),nodecoordinates(n,2),nodecoordinates(n,3),angpi/2,r) % Annotation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

104 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 3 of 7 x=union(nodecoordinates(:,1),nodecoordinates(:,1)); y=union(nodecoordinates(:,2),nodecoordinates(:,2)); z=union(nodecoordinates(:,3),nodecoordinates(:,3)); nx=length(x); ny=length(y); nz=length(z); distx=max(abs(x()-x(1))/15,10*r); disty=max(abs(y()-y(1))/15,10*r); distz=max(abs(z()-z(1))/15,10*r); color=[.2.2.2]; if nx>1 annot=x(2:)-x(1:-1); yann=y(1)-disty; zann=z(1)-distz; plot3(h,[x(1)-distx/5; x; x()+distx/5],yann*ones(nx+2,1),zann*ones(nx+2,1),'- b','color',color,'linewidth',.5) for i=1:nx Cross(x(i),yann,zann,2*R,0,color) for i=1:nx-1 Labels([x(i) yann],[x(i+1) yann],r,num2str(annot(i),'%4.2f'),lettersize*. 8,'light') if ny>1 annot=y(2:)-y(1:-1); xann=x()+distx; zann=z()+distz; plot(h,xann*ones(ny+2,1),[y(1)-disty/5;y;y()+disty/5],'-b','color', color,'linewidth',.5) for i=1:ny Cross(xann,y(i),2*R,-pi/2,color) for i=1:ny-1 Labels([xann y(i)],[xann y(i+1)],r,num2str(annot(i),'%4.2f'),lettersize*. 8,'light') if nz>1 annot=z(2:)-z(1:-1); xann=x()+distx; plot(h,xann*ones(ny+2,1),[y(1)-disty/5;y;y()+disty/5],'-b','color', color,'linewidth',.5) for i=1:ny Cross(xann,y(i),2*R,-pi/2,color) for i=1:ny-1 Labels([xann y(i)],[xann y(i+1)],r,num2str(annot(i),'%4.2f'),lettersize*. 8,'light') % PROCEDURES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

105 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 4 of 7 function plot_circ(r, X0, Y0, theta, N,option) % PLOT_CIRCUNFERENCE % R: radio de la circunferencia % X0: coordenada de abcisas del centro de la circunferencia % Y0: coordenada de ordenadas del centro de la circunferencia % N: número de puntos de la representación % option: 0, sin fondo; 1, fondo blanco; 2, fondo color % theta: modifies the first point (0 implies o'clock) rot=pi/2+theta; angle=linspace(0,2*pi,n+1)+rot; X=cos(angle)*R+X0; Y=sin(angle)*R+Y0; switch option case 1 patch(x,y,[1 1 1]) case 2 patch (X,Y,[ ]) plot(x,y,'color',[0 0.5], 'MarkerSize', 2) axis equal function Labels(P1,P2,dist,label,lettersize,format) % WRITE LABELS IN THE MIDDLE OF A LINE DEFFINED BY P1=[x1 y1] AND P2=[x2 y2] % P1 and P2 are the coordinates of the line extremes % dist is the label distance to the line % label is the text to write % format: light normal demi bold if P2==P1 Xtitle=(P1(1)+P2(1))/2+dist*cos(pi/2); Ytitle=(P1(2)+P2(2))/2+dist*sin(pi/2); text(xtitle,ytitle, label,'horizontalalignment','center','verticalalignment','baseline','fontsize', lettersize,'fontweight',format) if (P2(2)-P1(2))>=0 if (P2(1)-P1(1))>=0 ANG=atan((P2(2)-P1(2))/(P2(1)-P1(1))); ANG=pi+atan((P2(2)-P1(2))/(P2(1)-P1(1))); if (P2(1)-P1(1))>=0 ANG=atan((P2(2)-P1(2))/(P2(1)-P1(1))); ANG=pi+atan((P2(2)-P1(2))/(P2(1)-P1(1))); Xtitle=(P1(1)+P2(1))/2+dist*cos(ANG+pi/2); Ytitle=(P1(2)+P2(2))/2+dist*sin(ANG+pi/2); text(xtitle,ytitle,label,'rotation', ANG*180/pi,'HorizontalAlignment','center','VerticalAlignment','baseline','FontSize', lettersize,'fontweight',format)

106 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 5 of 7 function Cross(x0,y0,Csize,theta,color) %PLOT AN ANNOTATION CROSS r=[cos(theta) sin(theta); -sin(theta) cos(theta)]; %-cross xx1=csize*[0 0]; yy1=csize*[2 -.8]; xx2=csize*[.5 -.5]; yy2=csize*[.5 -.5]; %-rotates and translates the plot XY1=r*[xx1;yy1]; x=x0+xy1(1,:); y=y0+xy1(2,:); plot(x,y,'color',color,'linewidth',.5); XY=r*[xx2;yy2]; x=x0+xy(1,:); y=y0+xy(2,:); plot(x,y,'color',color,'linewidth',2); function colors=gencolor(elements) % Generate a matrix of random colors (one color an element) % Fixing the seed value to repeat the same random numbers rand('seed',123456); colors=zeros(elements,3); for i=1:elements colors(i,:)=[rand rand rand ]; % Drawing Supports %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function roller(x0,y0,theta,r) %PLOT A ROLLER SUPPORT r=[cos(theta) sin(theta); -sin(theta) cos(theta)]; %-translates and rotates the origin XY=[x0;y0]+r*[0; -R]; x=xy(1); y=xy(2); %-triangle XY=[x;y]+r*[0; -2*R]; plot_circ(2*r,xy(1),xy(2),-theta,3,0) %-roller XY=[x x;y y]+r*[-.8*r +.8*R; -3.8*R -3.8*R]; plot_circ(0.8*r,xy(1,1),xy(2,1),0,15,0) plot_circ(0.8*r,xy(1,2),xy(2,2),0,15,0) %-floor XY=[x x;y y]+r*[-3.5*r 3.5*R; -4.7*R -4.7*R]; plot(xy(1,:),xy(2,:),'color',[0 0.5],'LineWidth',3); function hinged(x0,y0,theta,r) %PLOT A HINGED SUPPORT r=[cos(theta) sin(theta); -sin(theta) cos(theta)];

107 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 6 of 7 %-translates and rotates the origin XY=[x0;y0]+r*[0; -R]; x=xy(1); y=xy(2); %-triangle XY=[x;y]+r*[0; -3*R]; plot_circ(3*r,xy(1),xy(2),-theta,3,0) %-floor XY=[x x;y y]+r*[-3.5*r 3.5*R; -4.6*R -4.6*R]; plot(xy(1,:),xy(2,:),'color',[0 0.5],'LineWidth',3); function fixed(x0,y0,theta,r) %PLOT A FIXED SUPPORT theta=theta-pi/2; r=[cos(theta) sin(theta); -sin(theta) cos(theta)]; %-translates and rotates the origin XY=[x0;y0]+r*[-1.25*R; 0]; x=xy(1); y=xy(2); %-floor XY=[x x;y y]+r*[0 0; 3.5*R -3.5*R]; plot(xy(1,:),xy(2,:),'color',[0 0.5],'LineWidth',3); function rollerfixed(x0,y0,theta,r) %PLOT A ROLLER-FIXED SUPPORT r=[cos(theta) sin(theta); -sin(theta) cos(theta)]; %-translates and rotates the origin XY=[x0;y0]+r*[0; -1.25*R]; x=xy(1); y=xy(2); %-ceil XY=[x x;y y]+r*[-2*r 2*R; 0 0]; plot(xy(1,:),xy(2,:),'color',[0 0.5]); %-roller XY=[x x;y y]+r*[-.8*r +.8*R; -.8*R -.8*R]; plot_circ(0.8*r,xy(1,1),xy(2,1),0,15,0) plot_circ(0.8*r,xy(1,2),xy(2,2),0,15,0) %-floor XY=[x x;y y]+r*[-3.5*r 3.5*R; -1.7*R -1.7*R]; plot(xy(1,:),xy(2,:),'color',[0 0.5],'LineWidth',3); function spring(x0,y0,theta,r) %PLOT A SPRING SUPPORT r=[cos(theta) sin(theta); -sin(theta) cos(theta)]; %-translates and rotates the origin XY=[x0;y0]+r*[0; -R]; x=xy(1); y=xy(2); %-spring xx= R/2*[ ]; yy=-r/2*[ ]; XY=[x*ones(1,10);y*ones(1,10)]+r*[xx; yy]; plot(xy(1,:),xy(2,:),'color',[0 0.5]); %-floor XY=[x x;y y]+r*[-3.5*r 3.5*R; -4.5*R -4.5*R];

108 5/09/17 16:49 C:\Users\caminstech\Desk...\PlotNetwork2.m 7 of 7 plot(xy(1,:),xy(2,:),'color',[0 0.5],'LineWidth',3);

109 5/09/17 16:50 C:\Users\caminstech\De...\PrepareReport2.m 1 of 1 function PrepareReport2(Example) global ScreenOption %--- To save the results in a diary % a)file name switch ScreenOption case 0, nfile=['reports\',example,'(summary)']; case 1, nfile=['reports\',example,'(screen)']; case 2, nfile=['reports\',example,'(latex)']; % b)delete previous files if exist('reports','dir')==0 %when the directory does not exist mkdir('reports') %create the directory %when the file and the directory exists try delete(nfile); % c)create the diary diary(nfile); fprintf('example: %s\n',example);

110 5/09/17 16:50 C:\Users\caminstech\De...\ReadKnownVars2.m 1 of 5 function [KnownName1,valuevars1]=ReadKnownVars2(ForcesNames,nnodes,nbeams) global knowndxdydzwxwywz knowneaiziygjqizqiy knowneaeizeiygjeqizeqiy global valuedxdydzwxwywz valueeaiziygjqizqiy valueeaeizeiygjeqizeqiy global ScreenOption global subbeamseaiziygjqizqiy beamlength global direct knowneaiziygjsdirect valueeaiziygjsdirect v KnownName=cell(1,30*nnodes+29*nbeams); valuevars=sym([]); ind=1; %--- Create forces as symbolic variables for i=1:nnodes eval(sprintf('syms Rx%04.0f',i)) eval(sprintf('syms Ry%04.0f',i)) eval(sprintf('syms Rz%04.0f',i)) eval(sprintf('syms Mx%04.0f',i)) eval(sprintf('syms My%04.0f',i)) eval(sprintf('syms Mz%04.0f',i)) %--- Displacements & forces [r c]=size(knowndxdydzwxwywz); auxvar='dxdydzwxwywz'; for node=1:nnodes for j=1:6 pos=find(node==knowndxdydzwxwywz{j,:}); if ~isempty(pos) && valuedxdydzwxwywz{j}(pos)==0 KnownName{ind}=sprintf('%s%04.0f',auxvar(j),node); valuevars=[valuevars valuedxdydzwxwywz{j}(pos)]; KnownName(ind)=ForcesNames(6*(node-1)+j); valuevars=[valuevars KnownName(ind)]; ind=ind+1; %--- Individual E,A,Iz,Iy,G,J,QIz,QIy if direct==1 transformdata={[1:16]; [ ]; [ ]; [ ]; [ ]; [ ];[ ]; [ ]}; auxvar='eaiziygjqizqiy'; for beam=1:nbeams for k=1:8 type=subbeamseaiziygjqizqiy{k}(beam); pos=find(type==knowneaiziygjsdirect{k}); if pos>0 for r=transformdata{k} KnownName{ind}=sprintf('%s%04.0f',auxvar(k),knownEAIzIyGJSdirect {k}(pos)); valuevars=[valuevars valueeaiziygjsdirect{k}(pos)];

111 5/09/17 16:50 C:\Users\caminstech\De...\ReadKnownVars2.m 2 of 5 ind=ind+1; transformdata={[1:16]; [ ]; [ ]; [ ]; [ ]; [ ];[ ]; [ ]}; auxvar='eaiziygjqiziy'; for beam=1:nbeams for k=1:8 type=subbeamseaiziygjqizqiy{k}(beam); pos=find(type==knowneaiziygjqizqiy{k}); if pos>0 for r=transformdata{k} KnownName{ind}=sprintf('%s%04.0f',auxvar(k),knownEAIzIyGJQIzQIy{k} (pos)); valuevars=[valuevars valueeaiziygjqizqiy{k}(pos)]; ind=ind+1; %--- Pairs EA, EIz, EIy, GJ, EQIz and EQIy auxvar='aeeizeiygjeqizeqiy'; for beam=1:nbeams for k=1:6 pos=find(beam==knowneaeizeiygjeqizeqiy{k}); if pos>0 for r=transformdata{k+1} KnownName{ind}=sprintf('%s%04.0f%s%04.0f',auxvar(2*k-1), knowneaeizeiygjeqizeqiy{k}(pos),auxvar(2*k),knowneaeizeiygjeqizeqiy{k}(pos)); valuevars=[valuevars valueeaeizeiygjeqizeqiy{k}(pos)]; ind=ind+1; %--- Delete the empty cells KnownName=KnownName(1:ind-1); valuevars=valuevars(1:ind-1); %--- Sort and check the solution [KnownName,ind]=sort(KnownName); valuevars=valuevars(ind); [KnownName1,pos0,pos]=unique(KnownName); valuevars1=valuevars(pos0); if direct==1 cont1=1;

112 5/09/17 16:50 C:\Users\caminstech\De...\ReadKnownVars2.m 3 of 5 cont2=1; cont3=1; cont4=1; cont5=1; cont6=1; cont7=1; for i=1:length(knownname1) aux1=char(knownname1(i)); auxl=aux1(1:1); auxn=str2double(aux1(2:)); if auxl=='e' auxe(cont1)=auxn; valuee(cont1)=valuevars1(i); cont1=cont1+1; if auxl=='iz' auxiz(cont2)=auxn; valueiz(cont2)=valuevars1(i); cont2=cont2+1; if auxl=='iy' auxiy(cont3)=auxn; valueiy(cont3)=valuevars1(i); cont3=cont3+1; if auxl=='g' auxg(cont4)=auxn; valueg(cont4)=valuevars1(i); cont4=cont4+1; if auxl=='j' auxj(cont5)=auxn; valuej(cont5)=valuevars1(i); cont5=cont5+1; if auxl=='qiz' auxqiz(cont6)=auxn; valueqiz(cont6)=valuevars1(i); cont6=cont6+1; if auxl=='qiy' auxqiy(cont7)=auxn; valueqiy(cont7)=valuevars1(i); cont7=cont7+1; for i=1:length(subbeamseaiziygjqizqiy{1}) auxl=beamlength(i); sube=subbeamseaiziygjqizqiy{1}(i); subiz=subbeamseaiziygjqizqiy{3}(i); subiy=subbeamseaiziygjqizqiy{4}(i); subg=subbeamseaiziygjqizqiy{5}(i); subj=subbeamseaiziygjqizqiy{6}(i); subqiz=subbeamseaiziygjqizqiy{7}(i); subqiy=subbeamseaiziygjqizqiy{7}(i); for j=1:length(auxe) if auxe(j)==sube vale=valuee(j);

113 5/09/17 16:50 C:\Users\caminstech\De...\ReadKnownVars2.m 4 of 5 for j=1:length(auxiz) if auxiz(j)==subiz valiz=valueiz(j); for j=1:length(auxiy) if auxiy(j)==subiy valiy=valueiy(j); for j=1:length(auxg) if auxg(j)==subg valg=valueg(j); for j=1:length(auxj) if auxj(j)==subj valj=valuej(j); for j=1:length(auxqiz) if auxqiz(j)==subqiz valqiz=valueqiz(j); for j=1:length(auxqiy) if auxqiy(j)==subqiy valqiy=valueqiy(j); if valqiz==0 QIz(i)=sym(0); QIz(i)=valIz*((12*valE*valIz)/((valE/(2+2*dz))*valQIz*auxl^2))/(1+ ((12*valE*valIz)/((valE/(2+2*dz))*valQIz*auxl^2))); if valqiy==0 QIy(i)=sym(0); QIy(i)=valIy*((12*valE*valIy)/((valE/(2+2*dz))*valQIy*auxl^2))/(1+ ((12*valE*valIy)/((valE/(2+2*dz))*valQIy*auxl^2))); L=1; QIz=sym(eval(QIz)); QIy=sym(eval(QIy)); cont1=1; cont2=1; for i=1:length(knownname1) aux1=char(knownname1(i)); auxl=aux1(1:1); if auxl=='qiz' valuevars1(i)=qiz(cont1); cont1=cont1+1;

114 5/09/17 16:50 C:\Users\caminstech\De...\ReadKnownVars2.m 5 of 5 if auxl=='qiy' valuevars1(i)=qiy(cont2); cont2=cont2+1; %--- Plotting information if ScreenOption==1 fprintf('--- Initial known forces and boundary conditions:\n') for i=1:length(valuevars1) fprintf('%s: %s\n',knownname1{i},char(valuevars1(i))) fprintf('\n') if ScreenOption==2 fprintf('%%--- Initial known forces and boundary conditions:\n') fprintf('\\begin{tabular}{llllllll}\n'); ncol=8; for i=1:ceil(length(valuevars1)/ncol)*ncol if i<=length(valuevars1) fprintf('%s=%s',knownname1{i},char(valuevars1(i))); if floor(i/ncol)==i/ncol && i<length(valuevars1) fprintf('\\\\ \n'); if floor(i/ncol)==i/ncol && i==ceil(length(valuevars1)/ncol)*ncol fprintf(' \n'); fprintf(' & '); fprintf('\\{tabular}\n\n')

115 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 1 of 10 function [Var,Val]=StiffnessCalculus2(D,zk,zd,zpd_vector,zpd_matrix,Ud,Vars,NumVars) % NUMERIC CALCULUS % Solves the system [-D* I].[zk;zd*]=zpd* where D*,zd* and zpd* % zpd=zpd_matrix*zpd_vector is the particular solution associated with zd global ScreenOption error [neq,~]=size(d); %number of equations nm=length(ud); %number of measurements %--- Some definitions Dast=D; %D* zdast=zd; %zd* zpd_matrixast=zpd_matrix; %zpd* % [r,c]=size(zpd_matrixast); M=[-Dast,eye(r)]; M(abs(M)<error)=0; %precision cleaning x=[zk,zdast]; %--- Delete the null columns validcol=find(sum(abs(m),1)>0); M=M(:,validcol); x=x(validcol); %--- Multiply each column of M by the corresponding measurement ncol=length(validcol); factor=cell(1,ncol); sympl_x=x; % a)find any measurement in the complex variable and simplify the complex variables for i=1:ncol aux1=x{i}; for j=1:nm aux2=ud{j}; commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); sympl_x{i}=aux1; if isempty(factor{i}) factor{i}=aux2; factor{i}=[factor{i},'*',aux2]; %(factor,sympl_x such as x=factor*sympl_x) % b) evalue the introduced data for j=1:length(vars) eval(sprintf('%s=%d;',char(vars(j)),double(numvars(j)))); factnum=ones(1,ncol); for i=1:ncol if ~isempty(factor{i}) factnum(i)=eval(factor{i});

116 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 2 of 10 zpd_vector=eval(zpd_vector); % c) multiply the matrix by the factors M1=M; for i=1:ncol if ~isempty(factnum(i)) M1(:,i)= M(:,i)*factNum(i); % d)get together the columns asociated with the equal terms unique_x=unique(sympl_x); ncol=length(unique_x); M2=zeros(neq,ncol); for i=1:length(unique_x) pos=[]; %find the position of the equal terms for j=1:length(sympl_x) if strcmp(unique_x{i},sympl_x{j}) %equal terms pos=[pos j]; M2(:,i)=sum(M1(:,pos),2); % e)if there is a completely known term, the associated column is moved to the indepent term % e.1) identify the completely known term complknown=[]; for i=1:length(unique_x) if isempty(unique_x{i}) complknown=[complknown, i]; keptvar=setdiff(1:length(unique_x),complknown); % e.2) update the matrices unique_x=unique_x(keptvar); indterm=zeros(neq,1); %indepent term %when there is any completly known term, this term is written as the indepent one if ~isempty(complknown) indterm=-m2(:,complknown); M2=M2(:,keptvar); %(in this point, M2*unique_x=zpdast+indterm) %--- Results [r,c]=size(m2); IT=zpd_matrixast*zpd_vector+indterm; if r==c %square matrix % a) solve the system Val=eval(M2\IT);

117 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 3 of 10 %no square matrix: [unique_x,val]=specialcase(m2,unique_x,it); %--- Postprocess (simplify complex variables) % a) separate the simple vars from the other ones simplvar={}; complvar={}; possimplvar=[]; %positions of the simple variables poscomplvar=[]; %positions of the complex variables for i=1:length(unique_x) if length(char(unique_x{i}))==5 simplvar=[simplvar,unique_x{i}]; possimplvar=[possimplvar,i]; complvar=[complvar,unique_x{i}]; poscomplvar=[poscomplvar,i]; nsimplvar=length(simplvar); simplval=val(possimplvar); % b) when there is any complex var I try to simplify if ~isempty(complvar) for i=1:length(complvar) aux1=complvar{i}; for j=1:nsimplvar aux2=simplvar{j}; commtxt=strfind(aux1,aux2); %find common text if ~isempty(commtxt) validtxt=setdiff(1:length(aux1),commtxt:commtxt+4); %valid text position aux1=aux1(validtxt); simplvar=[simplvar,aux1]; simplval=[simplval;val(poscomplvar(i))/val(possimplvar(j))]; Val=simplVal'; Var=simplVar'; %--- Plotting information if ScreenOption<2 fprintf('\n--- Numeric observed values\n') Var,Val %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [Var,Val]=SpecialCase(M2,unique_x,b) global measur_values

118 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 4 of 10 % VERIFICACION [NI,nvar]=size(M2); %--- 1) Identify the stiffness and the displacements vect1={}; vect2={}; for i=1:nvar aux=unique_x{i}(1:5); if length(unique_x{i})<6 if strcmp(aux(1),'a') strcmp(aux(1),'iz') strcmp(aux(1),'iy') strcmp(aux (1),'J') vect1=[vect1;aux]; vect2=[vect2;'1']; vect1=[vect1;'1']; vect2=[vect2;aux]; vect1=[vect1;aux]; vect2=[vect2;unique_x{i}(6:)]; % vsimples=[setdiff(unique(vect1),'1');setdiff(unique(vect2),'1');]; nvsimples=length(vsimples); % vm=zeros(nvar,nvsimples); %verification matrix (simple variables per equation) for i=1:nvar for j=1:nvsimples if strcmp(vect1{i},vsimples{j}) strcmp(vect2{i},vsimples{j}) vm(i,j)=1; %vm necessaryvars=nvsimples-rank(vm); if necessaryvars>0; %es decir, que el número de columnas de vm fprintf('no tiene solución única. Solución en función de %d variable(s)\n', necessaryvars) %--- Data query for the some necessary vars %a) identify the displacements aux=[]; for i=1:nvsimples if ~isempty([strfind(vsimples{i},'dx'),strfind(vsimples{i},'dy'),strfind (vsimples{i},'dz'),strfind(vsimples{i},'wx'),strfind(vsimples{i},'wy'),strfind (vsimples{i},'wz')]) aux=[aux i]; %b) window to select naux=length(aux); str=cell(1,naux); pos=1; for i=aux

119 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 5 of 10 str{pos}=vsimples{i}; pos=pos+1; txt=sprintf('select %d measurements:',necessaryvars); [s,ok]=choosebox('name','seletion of some meassurents','promptstring','possible measurements:','selectstring',txt,'liststring',str); if Ok %AÑADIR CONTROL DE INTRODUCCION MENOR O MAYOR DE DATOS s=s(1:necessaryvars); %delete the possible error data knownvars=vsimples(aux(s)); for j=1:necessaryvars % search the values in the introduced measurements [c,ni,pos]=intersect(knownvars(j),measur_values(:,1)); if ~isempty(c) knownvals(j)=measur_values{pos,2}; return fprintf('tiene solución. \n') knownvars={}; knownvals=[]; %--- Resolution by Gams [Var,Val]=SolvebyGams(M2,unique_x,b,knownvars,knownvals); function [Var,Val]=SolvebyGams(M2,unique_x,IT,knownvars,knownvals) %Compute the solution for the system M2*unique_x=IT by GAMS %where knownvars are some known values (knownvals) global error [neq,nvar]=size(m2); %--- Write the vector of mixed variables into products of variables vect1={}; vect2={}; for i=1:nvar vect1=[vect1;unique_x{i}(1:5)]; if length(unique_x{i})>5 vect2=[vect2;unique_x{i}(6:10)]; vect2=[vect2;'1']; %--- Identify the positive or the other variables Allvars=unique([vect1;vect2]); if length(allvars)>neq %it is due to the '1' value Allvars=Allvars(2:); %delete the number '1' positive=[];

120 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 6 of 10 others=[]; for i=1:neq aux=allvars{i}; if strcmp(aux(1),'a') strcmp(aux(1),'iz') strcmp(aux(1),'iy') strcmp(aux (1),'J') positive=[positive; Allvars(i)]; others=[others; Allvars(i)]; npositive=length(positive); %--- Data query prompt=cell(1,npositive); defaultanswer=cell(1,npositive); for i=1:npositive prompt{i}=positive{i}; defaultanswer{i}=''; ok=0; while ~ok % a) ask for data options.resize='on'; options.windowstyle='normal'; answer_str = inputdlg(prompt,'approximate values',1,defaultanswer,options); % b) transform to number answer_num=zeros(npositive,1); for i=1:npositive aux=str2num(answer_str{i}); if ~isempty(aux) && isnumeric(aux)&& aux>0 answer_num(i,1)=aux; % c) check data if isempty(find(answer_num==0)) ok=1; h = errordlg('there is an error in the input data.'); % c.1) change the default answer defaultanswer=answer_str; %--- Create the equations as symbolic ones auxvar=cell(nvar,1); for i=1:nvar auxvar{i}=[vect1{i},'*',vect2{i}]; digits(-round(log10(error))) auxeq=sym(m2,'d')*auxvar-vpa(it); %--- Create the GAMS file %a) Open the file fid = fopen('eqsolve.gms','w');

121 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 7 of 10 %b) Write the headlines fprintf(fid,'$title EQSolve\n\n'); fprintf(fid,'file out/eq.out/;\n'); fprintf(fid,'file out0/eqsolution.m/; \n\n'); fprintf(fid,'put out;\n\n'); fprintf(fid,'option nlp=conopt;\n\n'); %c) Write the sets fprintf(fid,'sets\n'); fprintf(fid,'i equations /1*%d/;\n\n',neq); %d) Write the positive variables fprintf(fid,'positive VARIABLES\n'); for i=1:npositive fprintf(fid,'%s\n',char(positive(i))); fprintf(fid,';\n\n'); %e) Write the other variables fprintf(fid,'variables\n'); for i=1:length(others) fprintf(fid,'%s\n',char(others(i))); fprintf(fid,'epsilon(i)\n'); fprintf(fid,'z;\n\n'); %f) Write the equations fprintf(fid,'equations\n'); fprintf(fid,'obj\n'); for i=1:neq %totaleq fprintf(fid,'eq%d\n',i); fprintf(fid,';\n\n'); fprintf(fid,'obj..z=e=0.01*sum(i,power(epsilon(i),2));\n'); for i=1:neq fprintf(fid,'eq%d..epsilon(''%d'')=e=%s;\n',i,i,char(auxeq(i))); %%%%%%%%%%%%%%%%%%%%%% % fprintf(fid,'eq%d..0=e=%s;\n',i,char(auxeq(i))); %SOLO PARA PROBLEMAS SIN ERRORES NUMERICOS %g) Write the model fprintf(fid,'\nmodel M1/obj,'); for i=1:neq-1 %totaleq fprintf(fid,'eq%d,',i); fprintf(fid,'eq%d/;\n\n',neq); %totaleq % %h) Write the lower solution % fprintf(fid,'*--- LOWER SOLUTION\n'); % for i=1:length(positive) % fprintf(fid,'%s.lo=%d;\n',char(positive(i)), ); %%%%%%%%%%%%%%%%%%%%%%% % % for i=1:length(others)

122 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 8 of 10 % fprintf(fid,'%s.lo=%d;\n',char(others(i)),-0.001); %%%%%%%%%%%%%%%%%%%%%%% % % fprintf(fid,'\n'); % %h) Write the upper solution % fprintf(fid,'*--- UPPER SOLUTION\n'); % for i=1:length(positive) % fprintf(fid,'%s.up=%d;\n',char(positive(i)),100); % % for i=1:length(others) % fprintf(fid,'%s.up=100;\n',char(others(i))); % % fprintf(fid,'\n'); %h) Write the initial solution fprintf(fid,'*--- INITIAL SOLUTION\n'); for i=1:length(positive) fprintf(fid,'%s.l=%d;\n',char(positive(i)),answer_num(i)); %%%%%%%%%%%%%%%%%%%%%%% for i=1:length(others) fprintf(fid,'%s.l=0;\n',char(others(i))); fprintf(fid,'\n'); if ~isempty(knownvars) %h) Write the known variables fprintf(fid,'*--- FIXED VALUES\n'); for i=1:length(knownvars) fprintf(fid,'%s.fx=%d;\n',knownvars{i},knownvals(i)); %%%%%%%%%%%%%%%%%%%%%%% fprintf(fid,'\n'); %j) Write the solve fprintf(fid,'*--- SOLVING THE PROBLEM\n'); fprintf(fid,'m1.optfile=1;\n'); fprintf(fid,'solve M1 USING nlp MINIMIZING z;\n'); fprintf(fid,'put "z=",z.l:15:8," modelstat=",m1.modelstat," solvestat=",m1.solvestat," resusd=",m1.resusd/;\n\n'); %k) Write the solution fprintf(fid,'*--- WRITE IN A MATLAB FILE\n'); fprintf(fid,'put out0;\n'); fprintf(fid,'put "function Val=EQSolution"/;\n'); fprintf(fid,'put out;\n\n'); fprintf(fid,'*--- WRITTING THE SOLUTION\n'); fprintf(fid,'if(m1.modelstat>3 or M1.solvestat<>1,\n'); fprintf(fid,'* a) write the no existency of a optimal solutions\n'); fprintf(fid,' put "--- THERE IS NOT A OPTIMAL SOLUTION:"/;\n'); fprintf(fid,'* b) write in a MATLAB file \n'); fprintf(fid,' put out0;\n'); fprintf(fid,' put "Val=[];"/;\n'); fprintf(fid,' put out;\n'); fprintf(fid,'\n');

123 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 9 of 10 fprintf(fid,'* a) write on screen the solution\n'); fprintf(fid,' put "--- OPTIMAL SOLUTION:"/;\n'); fprintf(fid,' put " - Cost function: z=", z.l:10:5/;\n'); fprintf(fid,' put " - Values: "; put /;\n'); for i=1:length(positive) fprintf(fid,' put " %s= ";put %s.l:15:8/;\n',char(positive(i)),char (positive(i))); for i=1:length(others) fprintf(fid,' put " %s= ";put %s.l:15:8/;\n',char(others(i)),char (others(i))); fprintf(fid,' put " - Error[sum(asb(epsilon))]= ";put sum(i,abs(epsilon.l (I))):15:8/;\n'); fprintf(fid,'* b) write in a MATLAB file the value of the variables\n'); fprintf(fid,' put out0;\n'); fprintf(fid,' put "Val=[";\n'); for i=1:length(positive) fprintf(fid,' put %s.l:15:8;put/;\n',char(positive(i))); for i=1:length(others) fprintf(fid,' put %s.l:15:8;put/;\n',char(others(i))); fprintf(fid,' put "];"/;\n'); fprintf(fid,' put "fprintf(''error de la Solucion: %%-25.8f\\n'',";put sum(i, abs(epsilon.l(i))):15:8;put ")'';"/; \n'); fprintf(fid,' put out;\n'); fprintf(fid,');\n\n'); %l) Close the file fclose(fid); %--- Run GAMS %a) GAMS execution (In "variables de entorno>variables de sistema", añadir en "path" el correspondiente de GAMS) delete('eqsolution.m') %delete the previoux calculus!gams EQSolve.gms %b) Load the GAMS solution Val=EQSolution; if ~isempty(val) Var=[positive;others]; Var=[];

124 5/09/17 16:50 C:\Users\caminst...\StiffnessCalculus2.m 10 of 10

125 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 1 of 6 function GSM=AssemblingModifiedStiffnessMatrixNEW2(beams,beamlength,nodecoordinates, nnodes,nbeams,nsize) global Symbway if Symbway==0 GSM=zeros(6*nnodes,nsize); GSM=sym(zeros(6*nnodes,nsize)); %--- AssemblingStandardStiffessMatrix: for beam=1:nbeams sm=elementalmstiffmatrix(beamlength(beam),nodecoordinates(beams(beam,1),1), nodecoordinates(beams(beam,1),2),nodecoordinates(beams(beam,2),1),nodecoordinates (beams(beam,2),2)); GSM(6*beams(beam,1)-2:6*beams(beam,1),60*(beam-1)+1:60*(beam-1)+1:60*(beam-1)+30) =GSM(6*beams(beam,1)-2:6*beams(beam,1),60*(beam-1)+1:60*(beam-1)+60)+sM(1:6,1:30); GSM(6*beams(beam,1)-2:6*beams(beam,1),60*(beam-1)+36:60*(beam-1)+1:60*(beam-1)+60) =GSM(6*beams(beam,1)-2:6*beams(beam,1),60*(beam-1)+36:60*(beam-1)+30)+sM(1:6,36:60); GSM(6*beams(beam,2)-2:6*beams(beam,2),60*(beam-1)+1:60*(beam-1)+1:60*(beam-1)+30) =GSM(6*beams(beam,2)-2:6*beams(beam,2),60*(beam-1)+1:60*(beam-1)+60)+sM(7:12,1:30); GSM(6*beams(beam,2)-2:6*beams(beam,2),60*(beam-1)+36:60*(beam-1)+1:60*(beam-1)+60) =GSM(6*beams(beam,2)-2:6*beams(beam,2),60*(beam-1)+36:60*(beam-1)+30)+sM(7:12,36:60); function mm=elementalmstiffmatrix(l,r11,r12,r13,r21,r22,r23,r31,r32,r33) % xk=; % yk=; % zk=; % r11=(x2-x1)/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r12=(y2-y1)/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r13=(z2-z1)/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % yx=(z2-z1)*(yk-y1)-(y2-y1)-(zk-z1); % yy=(x2-x1)*(zk-z1)-(z2-z1)-(xk-x1); % yz=(y2-y1)*(xk-x1)-(x2-x1)-(yk-y1); % r21=yx/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r22=yy/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r23=yz/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % zx=(y2-y1)*(zk-z1)-(z2-z1)-(yk-y1); % zy=(z2-z1)*(xk-x1)-(x2-x1)-(zk-z1); % zz=(x2-x1)*(yk-y1)-(y2-y1)-(xk-x1); % r31=zx/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r32=zy/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); % r33=zz/sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2); L=10 r11=0.85 r12=0.79 r13=0.76 r21=0.79 r22=0.67 r23=0.77 r31=0.76 r32=0.77

126 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 2 of 6 r33=0.89 % %--- Esfuerzo Axil (EA) MEAdx1=[ (r11^2)/l; (r11*r21)/l; (r11*r31)/l; 0; 0; 0; -(r11^2)/l; -(r11*r21)/l; -(r11*r31)/l; 0; 0; 0]; MEAdy1=[ (r21*r11)/l; (r21^2)/l; (r21*r31)/l; 0; 0; 0; -(r21*r11)/l; -(r21^2)/l; -(r21*r31)/l; 0; 0; 0]; MEAdz1=[ (r31*r11)/l; (r31*r21)/l; (r31^2)/l; 0; 0; 0; -(r31*r11)/l; -(r31*r21)/l; -(r31^2)/l; 0; 0; 0]; MEAdx2=[ -(r11^2)/l; -(r21*r11)/l; -(r11*r31)/l; 0; 0; 0; (r11^2)/l; (r11*r21)/l; (r11*r31)/l; 0; 0; 0]; MEAdy2=[ -(r11*r21)/l; -(r21^2)/l; -(r31*r21)/l; 0; 0; 0; (r21*r11)/l; (r21^2)/l; (r21*r31)/l; 0; 0; 0]; MEAdz2=[ -(r11*r31)/l; -(r21*r31)/l; -(r31^2)/l; 0; 0; 0; (r31*r11)/l; (r31*r21)/l; (r31^2)/l; 0; 0; 0]; %--- Esfuerzo Flector en el Plano XY [1] (EIz) MEIzdx1=[ (r12^2*12)/l^3; (r12*r22*12)/l^3; (r12*r32*12)/l^3; (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2; -(r12^2*12)/l^3; -(r12*r22*12)/l^3; -(r12*r32*12)/l^3; (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2]; MEIzdy1=[ (r22*r12*12)/l^3; (r22^2*12)/l^3; (r22*r32*12)/l^3; (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2; -(r22*r12*12)/l^3; -(r22^2*12)/l^3; -(r22*r32*12)/l^3; (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2]; MEIzdz1=[ (r32*r12*12)/l^3; (r32*r22*12)/l^3; (r32^2*12)/l^3; (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2; -(r32*r12*12)/l^3; -(r32*r22*12)/l^3; -(r32^2*12)/l^3; (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2]; MEIzwx1=[ (r13*r12*6)/l^2; (r13*r22*6)/l^2; (r13*r32*6)/l^2; (r13^2*4)/l; (r13*r23*4)/l; (r13*r33*4)/l; -(r13*r12*6)/l^2; -(r13*r22*6)/l^2; -(r13*r32*6)/l^2; (r13^2*4)/l; (r13*r23*4)/l; (r13*r33*4)/l ]; MEIzwy1=[ (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2; (r23*r13*4)/l; (r23*r23*4)/l; (r23*r33*4)/l; -(r23*r12*6)/l^2; -(r23*r22*6)/l^2; -(r23*r32*6)/l^2; (r23*r13*4)/l; (r23*r23*4)/l; (r23*r33*4)/l ]; MEIzwz1=[ (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2; (r33*r13*4)/l; (r33*r23*4)/l; (r33^2*4)/l; -(r33*r12*6)/l^2; -(r33*r22*6)/l^2; -(r33*r32*6)/l^2; (r33*r13*4)/l; (r33*r23*4)/l; (r33^2*4)/l ]; MEIzdx2=[ -(r12^2*12)/l^3; -(r22*r12*12)/l^3; -(r32*r12*12)/l^3; - (r13*r12*6)/l^2; -(r23*r12*6)/l^2; -(r33*r12*6)/l^2; (r12^2*12)/l^3; (r12*r22*12)/l^3; (r12*r32*12)/l^3; -(r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2]; MEIzdy2=[ -(r12*r22*12)/l^3; -(r22^2*12)/l^3; -(r32*r22*12)/l^3; - (r13*r22*6)/l^2; -(r23*r22*6)/l^2; -(r33*r22*6)/l^2; (r22*r12*12)/l^3;

127 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 3 of 6 (r22^2*12)/l^3; (r22*r32*12)/l^3; -(r22*r13*6)/l^2; -(r22*r23*6)/l^2; -(r22*r33*6)/l^2]; MEIzdz2=[ -(r12*r32*12)/l^3; -(r22*r32*12)/l^3; -(r32^2*12)/l^3; - (r13*r32*6)/l^2; -(r23*r32*6)/l^2; -(r33*r32*6)/l^2; (r32*r12*12)/l^3; (r32*r22*12)/l^3; (r32^2*12)/l^3; -(r32*r13*6)/l^2; -(r32*r23*6)/l^2; -(r32*r33*6)/l^2]; MEIzwx2=[ (r12*r13*6)/l^2; (r22*r13*6)/l^2; (r32*r13*6)/l^2; (r13^2*4)/l; (r23*r13*4)/l; (r33*r13*4)/l; -(r13*r12*6)/l^2; -(r13*r22*6)/l^2; -(r13*r32*6)/l^2; (r13^2*4)/l; (r13*r23*4)/l; (r13*r33*4)/l ]; MEIzwy2=[ (r12*r23*6)/l^2; (r22*r23*6)/l^2; (r32*r23*6)/l^2; (r13*r23*4)/l; (r23*r23*4)/l; (r33*r23*4)/l; -(r23*r12*6)/l^2; -(r23*r22*6)/l^2; -(r23*r32*6)/l^2; (r23*r13*4)/l; (r23*r23*4)/l; (r23*r33*4)/l ]; MEIzwz2=[ (r12*r33*6)/l^2; (r22*r33*6)/l^2; (r32*r33*6)/l^2; (r13*r33*4)/l; (r23*r33*4)/l; (r33^2*4)/l; -(r33*r12*6)/l^2; -(r33*r22*6)/l^2; -(r33*r32*6)/l^2; (r33*r13*4)/l; (r33*r23*4)/l; (r33^2*4)/l ]; %--- Esfuerzo Flector en el Plano XZ [2] (EIy) MEIydx1=[ (r13^2*12)/l^2; (r13*r23*12)/l^2; (r13*r33*12)/l^2; - (r13*r12*6)/l^2; -(r13*r22*6)/l^2; -(r13*r32*6)/l^2; -(r13^2*12)/l^2; -(r13*r23*12)/l^2; -(r13*r33*12)/l^2; (r13*r12*6)/l^2; (r13*r22*6)/l^2; (r13*r32*6)/l^2]; MEIydy1=[ (r23*r13*12)/l^2; (r23*r23*12)/l^2; (r33*r33*12)/l^2; - (r23*r12*6)/l^2; -(r23*r22*6)/l^2; -(r23*r32*6)/l^2; -(r23*r13*12)/l^2; -(r23*r23*12)/l^2; -(r33*r33*12)/l^2; (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2]; MEIydz1=[ (r33*r13*12)/l^2; (r33*r23*12)/l^2; (r33*r33*12)/l^2; - (r33*r12*6)/l^2; -(r33*r22*6)/l^2; -(r33*r32*6)/l^2; -(r33*r13*12)/l^2; -(r33*r23*12)/l^2; -(r33*r33*12)/l^2; (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2]; MEIywx1=[ -(r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2; (r12*r12*4)/l^3; (r12*r22*4)/l^3; (r12*r32*4)/l^3; -(r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2; (r12*r12*4)/l^3; (r12*r22*4)/l^3; (r12*r32*4)/l^3]; MEIywy1=[ -(r22*r13*6)/l^2; -(r22*r23*6)/l^2; -(r22*r33*6)/l^2; (r22*r12*4)/l^3; (r22*r22*4)/l^3; (r22*r32*4)/l^3; -(r22*r13*6)/l^2; -(r22*r23*6)/l^2; -(r22*r33*6)/l^2; (r22*r12*4)/l^3; (r22*r22*4)/l^3; (r22*r32*4)/l^3]; MEIywz1=[ -(r32*r13*6)/l^2; -(r32*r23*6)/l^2; -(r32*r33*6)/l^2; (r32*r12*4)/l^3; (r32*r22*4)/l^3; (r32*r32*4)/l^3; -(r32*r13*6)/l^2; -(r32*r23*6)/l^2; -(r32*r33*6)/l^2; (r32*r12*4)/l^3; (r32*r22*4)/l^3; (r32*r32*4)/l^3]; MEIydx2=[ -(r13^2*12)/l^2; -(r23*r13*12)/l^2; -(r33*r13*12)/l^2; - (r12*r13*6)/l^2; -(r22*r13*6)/l^2; -(r32*r13*6)/l^2; (r13^2*12)/l^2; (r13*r23*12)/l^2; (r13*r33*12)/l^2; (r13*r12*6)/l^2; (r13*r22*6)/l^2; (r13*r32*6)/l^2]; MEIydy2=[ -(r13*r23*12)/l^2; -(r23*r23*12)/l^2; -(r33*r23*12)/l^2; - (r12*r23*6)/l^2; -(r22*r23*6)/l^2; -(r32*r23*6)/l^2; (r23*r13*12)/l^2; (r23*r23*12)/l^2; (r33*r33*12)/l^2; (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2]; MEIydz2=[ -(r13*r33*12)/l^2; -(r33*r33*12)/l^2; -(r33*r33*12)/l^2; - (r12*r33*6)/l^2; -(r22*r33*6)/l^2; -(r32*r33*6)/l^2; (r33*r13*12)/l^2;

128 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 4 of 6 (r33*r23*12)/l^2; (r33*r33*12)/l^2; (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2]; MEIywx2=[ (r13*r12*6)/l^2; (r23*r12*6)/l^2; (r33*r12*6)/l^2; (r12*r12*4)/l^3; (r22*r12*4)/l^3; (r32*r12*4)/l^3; (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2; (r12*r12*4)/l^3; (r12*r22*4)/l^3; (r12*r32*4)/l^3]; MEIywy2=[ (r13*r22*6)/l^2; (r23*r22*6)/l^2; (r33*r22*6)/l^2; (r12*r22*4)/l^3; (r22*r22*4)/l^3; (r32*r22*4)/l^3; (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2; (r22*r12*4)/l^3; (r22*r22*4)/l^3; (r22*r32*4)/l^3]; MEIywz2=[ (r13*r32*6)/l^2; (r23*r32*6)/l^2; (r33*r32*6)/l^2; (r12*r32*4)/l^3; (r22*r32*4)/l^3; (r32*r32*4)/l^3; (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2; (r32*r12*4)/l^3; (r32*r22*4)/l^3; (r32*r32*4)/l^3]; %--- Esfuerzo Cortante en el Plano XY [1] (EI) MEIzQdx1=[ -(r12^2*12)/l^3; -(r12*r22*12)/l^3; -(r12*r32*12)/l^3; - (r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2; (r12^2*12)/l^3; (r12*r22*12)/l^3; (r12*r32*12)/l^3; (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2 ]; MEIzQdy1=[ -(r22*r12*12)/l^3; -(r22^2*12)/l^3; -(r22*r32*12)/l^3; - (r22*r13*6)/l^2; -(r22*r23*6)/l^2; -(r22*r33*6)/l^2; (r22*r12*12)/l^3; (r22^2*12)/l^3; (r22*r32*12)/l^3; (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2 ]; MEIzQdz1=[ -(r32*r12*12)/l^3; -(r32*r22*12)/l^3; - (r32^2*12)/l^3; - (r32*r13*6)/l^2; - (r32*r23*6)/l^2; -(r32*r33*6)/l^2; (r32*r12*12)/l^3; (r32*r22*12)/l^3; (r32^2*12)/l^3; (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2 ]; MEIzQwx1=[ -(r13*r12*6)/l^2; -(r13*r22*6)/l^2; -(r13*r32*6)/l^2; - (r13^2*4)/l; -(r13*r23*4)/l; -(r13*r33*4)/l; (r13*r12*6)/l^2; (r13*r22*6)/l^2; (r13*r32*6)/l^2; (r13^2*4)/l; (r13*r23*4)/l; (r13*r33*4)/l ]; MEIzQwy1=[ -(r23*r12*6)/l^2; -(r23*r22*6)/l^2; -(r23*r32*6)/l^2; - (r23*r13*4)/l; -(r23*r23*4)/l; -(r23*r33*4)/l; (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2; (r23*r13*4)/l; (r23*r23*4)/l; (r23*r33*4)/l ]; MEIzQwz1=[ -(r33*r12*6)/l^2; -(r33*r22*6)/l^2; -(r33*r32*6)/l^2; - (r33*r13*4)/l; -(r33*r23*4)/l; -(r33^2*4)/l; (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2; (r33*r13*4)/l; (r33*r23*4)/l; ( r33^2*4)/l ]; MEIzQdx2=[ (r12^2*12)/l^3; (r22*r12*12)/l^3; (r32*r12*12)/l^3; (r13*r12*6)/l^2; (r23*r12*6)/l^2; (r33*r12*6)/l^2; -(r12^2*12)/l^3; -(r12*r22*12)/l^3; -(r12*r32*12)/l^3; -(r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2]; MEIzQdy2=[ (r12*r22*12)/l^3; (r22^2*12)/l^3; (r32*r22*12)/l^3; (r13*r22*6)/l^2; (r23*r22*6)/l^2; (r33*r22*6)/l^2; -(r22*r12*12)/l^3; -(r22^2*12)/l^3; -(r22*r32*12)/l^3; -(r22*r13*6)/l^2; -(r22*r23*6)/l^2; -(r22*r33*6)/l^2]; MEIzQdz2=[ (r12*r32*12)/l^3; (r22*r32*12)/l^3; (r32^2*12)/l^3; (r13*r32*6)/l^2; (r23*r32*6)/l^2; (r33*r32*6)/l^2; -(r32*r12*12)/l^3; -(r32*r22*12)/l^3; -(r32^2*12)/l^3; -(r32*r13*6)/l^2; -(r32*r23*6)/l^2; -(r32*r33*6)/l^2]; MEIzQwx2=[ -(r12*r13*6)/l^2; -(r22*r13*6)/l^2; -(r32*r13*6)/l^2; - (r13^2*4)/l; -(r23*r13*4)/l; -(r33*r13*4)/l; (r13*r12*6)/l^2;

129 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 5 of 6 (r13*r22*6)/l^2; (r13*r32*6)/l^2; (r13^2*4)/l; (r13*r23*4)/l; (r13*r33*4)/l ]; MEIzQwy2=[ -(r12*r23*6)/l^2; -(r22*r23*6)/l^2; -(r32*r23*6)/l^2; - (r13*r23*4)/l; -(r23*r23*4)/l; -(r33*r23*4)/l; (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2; (r23*r13*4)/l; (r23*r23*4)/l; (r23*r33*4)/l ]; MEIzQwz2=[ -(r12*r33*6)/l^2; -(r22*r33*6)/l^2; -(r32*r33*6)/l^2; - (r13*r33*4)/l; -(r23*r33*4)/l; -(r33^2*4)/l; (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2; (r33*r13*4)/l; (r33*r23*4)/l; (r33^2*4)/l ]; %--- Esfuerzo Cortante en el Plano XZ [2] (EI) MEIyQdx1=[ -(r13^2*12)/l^2; -(r13*r23*12)/l^2; -(r13*r33*12)/l^2; (r13*r12*6)/l^2; (r13*r22*6)/l^2; (r13*r32*6)/l^2; (r13^2*12)/l^2; (r13*r23*12)/l^2; (r13*r33*12)/l^2; -(r13*r12*6)/l^2; -(r13*r22*6) /L^2; -(r13*r32*6)/l^2]; MEIyQdy1=[ -(r23*r13*12)/l^2; -(r23*r23*12)/l^2; -(r33*r33*12)/l^2; (r23*r12*6)/l^2; (r23*r22*6)/l^2; (r23*r32*6)/l^2; (r23*r13*12)/l^2; (r23*r23*12)/l^2; (r33*r33*12)/l^2; -(r23*r12*6)/l^2; -(r23*r22*6) /L^2; -(r23*r32*6)/l^2]; MEIyQdz1=[ -(r33*r13*12)/l^2; -(r33*r23*12)/l^2; -(r33*r33*12)/l^2; (r33*r12*6)/l^2; (r33*r22*6)/l^2; (r33*r32*6)/l^2; (r33*r13*12)/l^2; (r33*r23*12)/l^2; (r33*r33*12)/l^2; -(r33*r12*6)/l^2; -(r33*r22*6) /L^2; -(r33*r32*6)/l^2]; MEIyQwx1=[ (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2; - (r12*r12*4)/l^3; -(r12*r22*4)/l^3; -(r12*r32*4)/l^3; (r12*r13*6)/l^2; (r12*r23*6)/l^2; (r12*r33*6)/l^2; -(r12*r12*4)/l^3; -(r12*r22*4) /L^3; -(r12*r32*4)/l^3]; MEIyQwy1=[ (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2; - (r22*r12*4)/l^3; -(r22*r22*4)/l^3; -(r22*r32*4)/l^3; (r22*r13*6)/l^2; (r22*r23*6)/l^2; (r22*r33*6)/l^2; -(r22*r12*4)/l^3; -(r22*r22*4) /L^3; -(r22*r32*4)/l^3]; MEIyQwz1=[ (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2; - (r32*r12*4)/l^3; -(r32*r22*4)/l^3; -(r32*r32*4)/l^3; (r32*r13*6)/l^2; (r32*r23*6)/l^2; (r32*r33*6)/l^2; -(r32*r12*4)/l^3; -(r32*r22*4) /L^3; -(r32*r32*4)/l^3]; MEIyQdx2=[ (r13^2*12)/l^2; (r23*r13*12)/l^2; (r33*r13*12)/l^2; (r12*r13*6)/l^2; (r22*r13*6)/l^2; (r32*r13*6)/l^2; -(r13^2*12)/l^2; -(r13*r23*12)/l^2; -(r13*r33*12)/l^2; -(r13*r12*6)/l^2; -(r13*r22*6) /L^2; -(r13*r32*6)/l^2]; MEIyQdy2=[ (r13*r23*12)/l^2; (r23*r23*12)/l^2; (r33*r23*12)/l^2; (r12*r23*6)/l^2; (r22*r23*6)/l^2; (r32*r23*6)/l^2; -(r23*r13*12)/l^2; -(r23*r23*12)/l^2; -(r33*r33*12)/l^2; -(r23*r12*6)/l^2; -(r23*r22*6) /L^2; -(r23*r32*6)/l^2]; MEIyQdz2=[ (r13*r33*12)/l^2; (r33*r33*12)/l^2; (r33*r33*12)/l^2; (r12*r33*6)/l^2; (r22*r33*6)/l^2; (r32*r33*6)/l^2; -(r33*r13*12)/l^2; -(r33*r23*12)/l^2; -(r33*r33*12)/l^2; -(r33*r12*6)/l^2; -(r33*r22*6) /L^2; -(r33*r32*6)/l^2]; MEIyQwx2=[ -(r13*r12*6)/l^2; -(r23*r12*6)/l^2; -(r33*r12*6)/l^2; - (r12*r12*4)/l^3; -(r22*r12*4)/l^3; -(r32*r12*4)/l^3; -(r12*r13*6)/l^2; -(r12*r23*6)/l^2; -(r12*r33*6)/l^2; -(r12*r12*4)/l^3; -(r12*r22*4)/l^3; -(r12*r32*4)/l^3]; MEIyQwy2=[ -(r13*r22*6)/l^2; -(r23*r22*6)/l^2; -(r33*r22*6)/l^2; - (r12*r22*4)/l^3; -(r22*r22*4)/l^3; -(r32*r22*4)/l^3; -(r22*r13*6)/l^2;

130 6/09/17 10:04 C:\Users\caminstech\Desktop\TFG_Scripts... 6 of 6 -(r22*r23*6)/l^2; -(r22*r33*6)/l^2; -(r22*r12*4)/l^3; -(r22*r22*4)/l^3; -(r22*r32*4)/l^3]; MEIyQwz2=[ -(r13*r32*6)/l^2; -(r23*r32*6)/l^2; -(r33*r32*6)/l^2; - (r12*r32*4)/l^3; -(r22*r32*4)/l^3; -(r32*r32*4)/l^3; -(r32*r13*6)/l^2; -(r32*r23*6)/l^2; -(r32*r33*6)/l^2; -(r32*r12*4)/l^3; -(r32*r22*4)/l^3; -(r32*r32*4)/l^3]; %--- Esfuerzo Torsor (GJ) MGJwx1=[ 0; 0; 0; (r11^2)/l; (r11*r21)/l; (r11*r31) /L; 0; 0; 0; -(r11^2)/l; -(r11*r21)/l; - (r11*r31)/l]; MGJwy1=[ 0; 0; 0; (r21*r11)/l; (r21*r21)/l; (r21*r31) /L; 0; 0; 0; -(r21*r11)/l; -(r21*r21)/l; - (r21*r31)/l]; MGJwz1=[ 0; 0; 0; (r31*r11)/l; (r31*r21)/l; (r31*r31) /L; 0; 0; 0; -(r31*r11)/l; -(r31*r21)/l; - (r31*r31)/l]; MGJwx2=[ 0; 0; 0; -(r11^2)/l; -(r21*r11)/l; -(r31*r11) /L; 0; 0; 0; (r11^2)/l; (r11*r21)/l; (r11*r31)/l]; MGJwy2=[ 0; 0; 0; -(r11*r21)/l; -(r21*r21)/l; -(r31*r21) /L; 0; 0; 0; (r21*r11)/l; (r21*r21)/l; (r21*r31)/l]; MGJwz2=[ 0; 0; 0; -(r11*r31)/l; -(r21*r31)/l; -(r31*r31) /L; 0; 0; 0; (r31*r11)/l; (r31*r21)/l; (r31*r31)/l]; mm=[meadx1 MEIzdx1 MEIydx1 MEAdy1 MEIzdy1 MEIydy1 MEAdz1 MEIzdz1 MEIydz1 MEIzwx1 MEIywx1 MGJwx1 MEIzwy1 MEIywy1 MGJwy1 MEIzwz1 MEIywz1 MGJwz1 MEIzQdx1 MEIyQdx1 MEIzQdy1 MEIyQdy1 MEIzQdz1 MEIyQdz1 MEIzQwx1 MEIyQwx1 MEIzQwy1 MEIyQwy1 MEIzQwz1 MEIyQwz1 MEAdx2 MEIzdx2 MEIydx2 MEAdy2 MEIzdy2 MEIydy2 MEAdz2 MEIzdz2 MEIydz2 MEIzwx2 MEIywx2 MGJwx2 MEIzwy2 MEIywy2 MGJwy2 MEIzwz2 MEIywz2 MGJwz2 MEIzQdx2 MEIyQdx2 MEIzQdy2 MEIyQdy2 MEIzQdz2 MEIyQdz2 MEIzQwx2 MEIyQwx2 MEIzQwy2 MEIyQwy2 MEIzQwz2 MEIyQwz2];

131 6/09/17 10:03 C:\Us...\AssemblingLocalStiffnessMatrix2.m 1 of 5 function LSM=AssemblingLocalStiffnessMatrix2(beams,beamlength,nbeams) global Symbway if Symbway==0 LSM=zeros(12*nbeams,60); LSM=sym(zeros(12*nbeams,60)); %---AssemblingLocalStiffnessMatrix2 for beam=1:nbeams sm=elementalmstiffnessmatrix2(beamlength(beam)); LSM(12*beam-11:12*beam,1:60)=LSM(12*beam-11:12*beam,1:60)+sM(1:12,1:60); function mm2=elementalmstiffmatrix2(l) %--- Esfuerzo Axil (EA) MEAdx1=[ 1/L; 0; 0; 0; 0; 0; -1/L; 0; 0; 0; 0; 0]; MEAdy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]; MEAdz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]; MEAdx2=[ -1/L; 0; 0; 0; 0; 0; 1/L; 0; 0; 0; 0; 0]; MEAdy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]; MEAdz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]; %--- Esfuerzo Flector en el plano XY [1] (EIz) MEIzdx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzdy1=[ 0; 12/L^3; 0; 0; 0; 6/L^2; 0; -12/L^3; 0; 0; 0; 6/L^2]; MEIzdz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzwx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzwy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzwz1=[ 0; 6/L^2; 0; 0; 0; 4/L; 0; -6/L^2; 0; 0; 0; 2/L ]; MEIzdx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzdy2=[ 0; -12/L^3; 0; 0; 0; -6/L^2; 0; 12/L^3; 0; 0; 0; -6/L^2]; MEIzdz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzwx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0;

132 6/09/17 10:03 C:\Us...\AssemblingLocalStiffnessMatrix2.m 2 of 5 0; 0 ]; MEIzwy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzwz2=[ 0; 6/L^2; 0; 0; 0; 2/L; 0; -6/L^2; 0; 0; 0; 4/L ]; %--- Esfuerzo Flector en el plano XZ [2] (EIy) MEIydx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIydy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIydz1=[ 0; 0; 12/L^3; 0; -6/L^2; 0; 0; 0; -12/L^3; 0; -6/L^2; 0 ]; MEIywx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIywy1=[ 0; 0; -6/L^2; 0; 4/L; 0; 0; 0; 6/L^2; 0; 2/L; 0 ]; MEIywz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIydx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIydy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIydz2=[ 0; 0; -12/L^3; 0; 6/L^2; 0; 0; 0; 12/L^3; 0; 6/L^2; 0 ]; MEIywx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIywy2=[ 0; 0; -6/L^2; 0; 2/L; 0; 0; 0; 6/L^2; 0; 4/L; 0 ]; MEIywz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; %--- Esfuerzo Cortante en el plano XY [1] (EIzQ) MEIzQdx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQdy1=[ 0; -12/L^3; 0; 0; 0; -6/L^2; 0; 12/L^3; 0; 0; 0; -6/L^2]; MEIzQdz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQwx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQwy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQwz1=[ 0; -6/L^2; 0; 0; 0; -3/L; 0; 6/L^2; 0; 0; 0; -3/L ]; MEIzQdx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQdy2=[ 0; 12/L^3; 0; 0; 0; 6/L^2; 0; -12/L^3; 0; 0; 0; 6/L^2]; MEIzQdz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQwx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ];

133 6/09/17 10:03 C:\Us...\AssemblingLocalStiffnessMatrix2.m 3 of 5 MEIzQwy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIzQwz2=[ 0; -6/L^2; 0; 0; 0; -3/L; 0; 6/L^2; 0; 0; 0; -3/L ]; %--- Esfuerzo Cortante en el plano XZ [2] (EIyQ] MEIyQdx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQdy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQdz1=[ 0; 0; -12/L^3; 0; 6/L^2; 0; 0; 0; 12/L^3; 0; 6/L^2; 0 ]; MEIyQwx1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQwy1=[ 0; 0; 6/L^2; 0; -3/L; 0; 0; 0; -6/L^2; 0; -3/L; 0 ]; MEIyQwz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQdx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQdy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQdz2=[ 0; 0; 12/L^3; 0; -6/L^2; 0; 0; 0; -12/L^3; 0; -6/L^2; 0 ]; MEIyQwx2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MEIyQwy2=[ 0; 0; 6/L^2; 0; -2/L; 0; 0; 0; -6/L^2; 0; -4/L; 0 ]; MEIyQwz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; %--- Esfuerzo Torsor (GJ) MGJwx1=[ 0; 0; 0; 1/L; 0; 0; 0; 0; 0; -1/L; 0; 0 ]; MGJwy1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MGJwz1=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MGJwx2=[ 0; 0; 0; -1/L; 0; 0; 0; 0; 0; 1/L; 0; 0 ]; MGJwy2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; MGJwz2=[ 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0 ]; mm2=[meadx1 MEIzdx1 MEIydx1 MEAdy1 MEIzdy1 MEIydy1 MEAdz1 MEIzdz1 MEIydz1 MEIzwx1 MEIywx1 MGJwx1 MEIzwy1 MEIywy1 MGJwy1 MEIzwz1 MEIywz1 MGJwz1 MEIzQdx1 MEIyQdx1 MEIzQdy1 MEIyQdy1 MEIzQdz1 MEIyQdz1 MEIzQwx1 MEIyQwx1 MEIzQwy1 MEIyQwy1 MEIzQwz1 MEIyQwz1 MEAdx2 MEIzdx2 MEIydx2 MEAdy2 MEIzdy2 MEIydy2 MEAdz2 MEIzdz2 MEIydz2 MEIzwx2 MEIywx2 MGJwx2 MEIzwy2 MEIywy2 MGJwy2 MEIzwz2 MEIywz2 MGJwz2 MEIzQdx2 MEIyQdx2 MEIzQdy2 MEIyQdy2 MEIzQdz2 MEIyQdz2 MEIzQwx2 MEIyQwx2 MEIzQwy2 MEIyQwy2 MEIzQwz2 MEIyQwz2];

134 6/09/17 10:03 C:\Us...\AssemblingLocalStiffnessMatrix2.m 4 of 5 % % %--- Esfuerzo axil (EA) % MEAdx1=[ 1/L; 0; 0; 0; 0; 0; -1/L; 0; 0; 0; 0; 0]; % MEAdx2=[ -1/L; 0; 0; 0; 0; 0; 1/L; 0; 0; 0; 0; 0]; % % %--- Esfuerzo flector (EI) % MEIdy1=[ 0; 12/L^3; 0; 0; 0; 6/L^2; 0; -12/L^3; 0; 0; 0; 6/L^2]; % MEIdz1=[ 0; 0; 12/L^3; 0; -6/L^2; 0; 0; 0; -12/L^3; 0; -6/L^2; 0 ]; % MEIwy1=[ 0; 0; -6/L^2; 0; 4/L; 0; 0; 0; 6/L^2; 0; 2/L; 0 ]; % MEIwz1=[ 0; 6/L^2; 0; 0; 0; 4/L; 0; -6/L^2; 0; 0; 0; 2/L ]; % MEIdy2=[ 0; -12/L^3; 0; 0; 0; -6/L^2; 0; 12/L^3; 0; 0; 0; -6/L^2]; % MEIdz2=[ 0; 0; -12/L^3; 0; 6/L^2; 0; 0; 0; 12/L^3; 0; 6/L^2; 0 ]; % MEIwy2=[ 0; 0; -6/L^2; 0; 2/L; 0; 0; 0; 6/L^2; 0; 4/L; 0 ]; % MEIwz2=[ 0; 6/L^2; 0; 0; 0; 2/L; 0; -6/L^2; 0; 0; 0; 4/L ]; % % %--- Esfuerzo cortante (EIQ) % MEIQdy1=[ 0; -12/L^3; 0; 0; 0; -6/L^2; 0; 12/L^3; 0; 0; 0; -6/L^2]; % MEIQdz1=[ 0; 0; 12/L^3; 0; -6/L^2; 0; 0; 0; -12/L^3; 0; -6/L^2; 0 ]; % MEIQwy1=[ 0; 0; -6/L^2; 0; 3/L; 0; 0; 0; 6/L^2; 0; 3/L; 0 ]; % MEIQwz1=[ 0; -6/L^2; 0; 0; 0; -3/L; 0; 6/L^2; 0; 0; 0; -3/L ]; % MEIQdy2=[ 0; 12/L^3; 0; 0; 0; 6/L^2; 0; -12/L^3; 0; 0; 0; 6/L^2]; % MEIQdz2=[ 0; 0; -12/L^3; 0; 6/L^2; 0; 0; 0; 12/L^3; 0; 6/L^2; 0 ]; % MEIQwy2=[ 0; 0; -6/L^2; 0; 2/L; 0; 0; 0; 6/L^2; 0; 4/L; 0 ]; % MEIQwz2=[ 0; -6/L^2; 0; 0; 0; -3/L; 0; 6/L^2; 0; 0; 0; -3/L ]; % % %--- Esfuerzo torsor (GJ) % MGJwx1=[ 0; 0; 0; 1/L; 0; 0; 0; 0; 0; -1 /L; 0; 0 ]; % MGJwx2=[ 0; 0; 0; -1/L; 0; 0; 0; 0; 0; 1/L; 0; 0 ]; % % mm=[meadx MEIdy1 MEIdz1 MEIwy1 MEIwz1 MEIQdy1 MEIQdz1 MEIQwy1 MEIQwz1 MGJwx1 % MEAdx2 MEIdy2 MEIdz2 MEIwy2 MEIwz2 MEIQdy2 MEIQdz2 MEIQwy2 MEIQwz2 % MGJwx2]

135 6/09/17 10:03 C:\Us...\AssemblingLocalStiffnessMatrix2.m 5 of 5

136 6/09/17 10:28 C:\Users\cami...\ForcesandDisplacements2.m 1 of 1 function [ForcesNames,DisplaNames]=ForcesandDisplacements2(nnodes) global knowndxdydzwxwywz ForcesNames=cell(6*nnodes,1); %Forces defined as a matrix (6x1) Displacements=cell(6*nnodes,1); %Displacements defined as a matrix (6x1) %--- Create the variables with Forces and Displacements. ind=1; k=1; for node=1:nnodes pos=6*node-5; ForcesNames{pos}=['Rx' sprintf('%04.0f',node)]; ForcesNames{pos+1}=['Ry' sprintf('%04.0f',node)]; ForcesNames{pos+2}=['Rz' sprintf('%04.0f',node)]; ForcesNames{pos+3}=['Mx' sprintf('%04.0f',node)]; ForcesNames{pos+4}=['My' sprintf('%04.0f',node)]; ForcesNames{pos+5}=['Mz' sprintf('%04.0f',node)]; Displacements{pos}=['dx' sprintf('%04.0f',node)]; Displacements{pos+1}=['dy' sprintf('%04.0f',node)]; Displacements{pos+2}=['dz' sprintf('%04.0f',node)]; Displacements{pos+3}=['wx' sprintf('%04.0f',node)]; Displacements{pos+4}=['wy' sprintf('%04.0f',node)]; Displacements{pos+5}=['wz' sprintf('%04.0f',node)]; for j=1:6 pos=find(node==knowndxdydzwxwywz{j,:}); if isempty(pos) DisplaNames{k,1}=Displacements{ind}; k=k+1

137 Estudi del procés constructiu de ponts atirantats sobre suports Autor: Joan Fraile Diana Annex 3 Resultats càlcul estructural amb Midas Civil iii

138 Reaction(Global) Node Load FX (kn) FY (kn) FZ (kn) MX (kn*m) MY (kn*m) MZ (kn*m) 1 TL , TL , TL , TL , TL , TL , TL , TL , TL , TL , TL , SUMMATION OF REACTION FORCES PRINTOUT Load FX (kn) FY (kn) FZ (kn) TL

139 Beam Force Elem Load Part Axial (kn) Shear-y (kn) Shear-z (kn) Torsion (kn*m) Moment-y (kn*m) Moment-z (kn*m) 1 TL I[1] , TL J[2] , , TL I[2] , , TL J[3] , , TL I[3] , , TL J[4] , , TL I[4] , , TL J[5] , , TL I[5] , , TL J[6] , ,9 0 6 TL I[6] , ,9 0 6 TL J[7] , , TL I[7] , , TL J[8] , , TL I[8] , , TL J[9] , , TL I[9] , , TL J[10] , , TL I[10] , ,81 0

140 10 TL J[11] , , TL I[11] , , TL J[12] , , TL I[12] , , TL J[13] , , TL I[13] , , TL J[14] , , TL I[14] , , TL J[15] , , TL I[15] , , TL J[16] , , TL I[16] , , TL J[17] , , TL I[17] , , TL J[18] , , TL I[18] , , TL J[19] , , TL I[19] , , TL J[20] , , TL I[20] , , TL J[21] , , TL I[21] , , TL J[22] , , TL I[22] , , TL J[23] , , TL I[23] , , TL J[24] , , TL I[24] , , TL J[25] , , TL I[25] , , TL J[26] , , TL I[26] , , TL J[27] , ,29 0

141 27 TL I[27] , , TL J[28] , , TL I[28] , , TL J[29] , , TL I[29] , , TL J[30] , , TL I[30] , , TL J[31] ,1 0-6, TL I[31] ,1 0-6, TL J[32] , , TL I[32] , , TL J[33] , , TL I[33] , , TL J[34] , , TL I[34] , , TL J[35] , , TL I[35] , , TL J[36] , , TL I[36] , , TL J[37] , , TL I[37] , , TL J[38] , , TL I[38] , , TL J[39] , , TL I[39] , , TL J[40] , , TL I[40] , , TL J[41] , , TL I[41] , , TL J[42] , , TL I[42] , , TL J[43] , , TL I[43] , ,29 0

142 43 TL J[44] , , TL I[44] , , TL J[45] , , TL I[45] , , TL J[46] , , TL I[46] , , TL J[47] , , TL I[47] , , TL J[48] 0 0-4, , TL I[48] 0 0-4, , TL J[49] , , TL I[49] , , TL J[50] , , TL I[50] , , TL J[51] , , TL I[51] , , TL J[52] , , TL I[52] , , TL J[53] , , TL I[53] , , TL J[54] , , TL I[54] , , TL J[55] , , TL I[55] , , TL J[56] , , TL I[56] , , TL J[57] , , TL I[57] , , TL J[58] , , TL I[58] , , TL J[59] , , TL I[59] , , TL J[60] , ,38 0

143 60 TL I[60] , , TL J[61] , , TL I[61] , , TL J[62] , , TL I[62] , , TL J[63] , , TL I[63] , , TL J[64] , , TL I[64] , , TL J[65] , , TL I[65] , , TL J[66] , , TL I[66] , , TL J[67] , , TL I[67] , , TL J[68] , , TL I[68] , , TL J[69] , , TL I[69] , , TL J[70] , , TL I[70] , , TL J[71] , , TL I[71] , , TL J[72] , , TL I[72] , , TL J[73] , , TL I[73] , , TL J[74] , , TL I[74] , , TL J[75] , , TL I[75] , , TL J[76] , , TL I[76] , ,55 0

144 76 TL J[77] , , TL I[77] , , TL J[78] , , TL I[78] , , TL J[79] , , TL I[79] , , TL J[80] , , TL I[80] , , TL J[81] , , TL I[81] , , TL J[82] , , TL I[82] , , TL J[83] , , TL I[83] , , TL J[84] , , TL I[84] , , TL J[85] , , TL I[85] , , TL J[86] , , TL I[86] , , TL J[87] , , TL I[87] , , TL J[88] , , TL I[88] , , TL J[89] , , TL I[89] , , TL J[90] , , TL I[90] , , TL J[91] , , TL I[91] , , TL J[92] , , TL I[92] , , TL J[93] , ,1 0

145 93 TL I[93] , , TL J[94] , , TL I[94] , , TL J[95] , , TL I[95] , , TL J[96] , , TL I[96] , , TL J[97] , , TL I[97] , , TL J[98] , , TL I[98] , , TL J[99] , , TL I[99] , , TL J[100] , , TL I[100] , , TL J[101] , , TL I[101] , , TL J[102] , , TL I[102] , , TL J[103] , , TL I[103] , , TL J[104] , , TL I[104] , , TL J[105] , , TL I[105] , , TL J[106] , , TL I[106] , , TL J[107] , , TL I[107] , , TL J[108] , , TL I[108] , , TL J[109] , , TL I[109] , ,72 0

146 109 TL J[110] , , TL I[110] , , TL J[111] , , TL I[111] , , TL J[112] , , TL I[112] , , TL J[113] , , TL I[113] , , TL J[114] , , TL I[114] , , TL J[115] , , TL I[115] , , TL J[116] , , TL I[116] , , TL J[117] , , TL I[117] , , TL J[118] , , TL I[118] , , TL J[119] , , TL I[119] , , TL J[120] , , TL I[120] , , TL J[121] , , TL I[121] , , TL J[122] , , TL I[122] , , TL J[123] , , TL I[123] , , TL J[124] , , TL I[124] , , TL J[125] , , TL I[125] , , TL J[126] , ,87 0

147 126 TL I[126] , , TL J[127] , , TL I[127] , , TL J[128] , , TL I[128] , , TL J[129] , , TL I[129] , , TL J[130] , , TL I[130] , , TL J[131] , , TL I[131] , , TL J[132] , , TL I[132] , , TL J[133] , , TL I[133] , , TL J[134] , , TL I[134] , , TL J[135] ,55 0 9, TL I[135] ,55 0 9, TL J[136] , , TL I[136] , , TL J[137] , , TL I[137] , , TL J[138] , , TL I[138] , , TL J[139] , , TL I[139] , , TL J[140] , , TL I[140] , , TL J[141] , , TL I[141] , , TL J[142] , , TL I[142] , ,47 0

148 142 TL J[143] , , TL I[143] , , TL J[144] , , TL I[144] , , TL J[145] , , TL I[145] , , TL J[146] , , TL I[146] , , TL J[147] , , TL I[147] , , TL J[148] , , TL I[148] , , TL J[149] , , TL I[149] , , TL J[150] , , TL I[150] , , TL J[151] , , TL I[151] , , TL J[152] 0 0 3, , TL I[152] 0 0 3, , TL J[153] , , TL I[153] , , TL J[154] , , TL I[154] , , TL J[155] , , TL I[155] , , TL J[156] , , TL I[156] , , TL J[157] , , TL I[157] , , TL J[158] , , TL I[158] , , TL J[159] , ,05 0

149 159 TL I[159] , , TL J[160] , , TL I[160] , , TL J[161] , , TL I[161] , , TL J[162] , , TL I[162] , , TL J[163] , , TL I[163] , , TL J[164] , , TL I[164] , , TL J[165] , , TL I[165] , , TL J[166] , , TL I[166] , , TL J[167] , , TL I[167] , , TL J[168] , , TL I[168] , , TL J[169] ,87 0-5, TL I[169] ,87 0-5, TL J[170] , , TL I[170] , , TL J[171] , , TL I[171] , , TL J[172] , , TL I[172] , , TL J[173] , , TL I[173] , , TL J[174] , , TL I[174] , , TL J[175] , , TL I[175] , ,33 0

150 175 TL J[176] , , TL I[176] , , TL J[177] , , TL I[177] , , TL J[178] , , TL I[178] , , TL J[179] , , TL I[179] , , TL J[180] , , TL I[180] , , TL J[181] , , TL I[181] , , TL J[182] , , TL I[182] , , TL J[183] , , TL I[183] , , TL J[184] , , TL I[184] , , TL J[185] , , TL I[185] , , TL J[186] , , TL I[186] , , TL J[187] , , TL I[187] , , TL J[188] , , TL I[188] , , TL J[189] , , TL I[189] , , TL J[190] , , TL I[190] , , TL J[191] , , TL I[191] , , TL J[192] , ,78 0

151 192 TL I[192] , , TL J[193] , , TL I[193] , , TL J[194] , , TL I[194] , , TL J[195] , , TL I[195] , , TL J[196] , , TL I[196] , , TL J[197] , , TL I[197] , , TL J[198] , , TL I[198] , , TL J[199] , , TL I[199] , , TL J[200] , , TL I[200] , TL J[201]

152 Barcelona, 20 de Setembre de 2017

Signal and Systems. Matlab GUI based analysis. XpertSolver.com

Signal and Systems. Matlab GUI based analysis. XpertSolver.com Signal and Systems Matlab GUI based analysis Description: This Signal and Systems based Project takes a sound file in.wav format and performed a detailed analysis, as well as filtering of the signal. The

More information

% Edit the above text to modify the response to help Video_Player. % Last Modified by GUIDE v May :38:12

% Edit the above text to modify the response to help Video_Player. % Last Modified by GUIDE v May :38:12 FILE NAME: Video_Player DESCRIPTION: Video Player Name Date Reason Sahariyaz 28-May-2015 Basic GUI concepts function varargout = Video_Player(varargin) VIDEO_PLAYER MATLAB code for Video_Player.fig VIDEO_PLAYER,

More information

LAMPIRAN 1. Percobaan

LAMPIRAN 1. Percobaan LAMPIRAN 1 1. Larutan 15 ppm Polystyrene ENERGI Percobaan 1 2 3 PROBABILITY 0.07 0.116 0.113 0.152 0.127 0.15 0.256 0.143 0.212 0.203 0.22 0.24 0.234 0.23 0.234 0.3 0.239 0.35 0.201 0.263 0.37 0.389 0.382

More information

1. Peralatan LAMPIRAN

1. Peralatan LAMPIRAN 1. Peralatan LAMPIRAN 2. Data Sampel a. Air murni 3ml Energy(mj) Probability Air Murni 0.07 0.001 0.15 0.003 0.22 0.006 0.3 0.028 0.37 0.045 0.39 0.049 0.82 0.053 0.89 0.065 1.28 0.065 1.42 0.106 1.7

More information

% Edit the above text to modify the response to help Principal

% Edit the above text to modify the response to help Principal function varargout = Principal(varargin) % OPFGUI MATLAB code for Principal.fig % OPFGUI, by itself, creates a new OPFGUI or raises the existing % singleton*. % % H = OPFGUI returns the handle to a new

More information

GUI code for different sections is in following sections

GUI code for different sections is in following sections Software Listing The Graphical User Interface (GUI) and Fuzzy Inference System (FIS) are developed in MATLAB. Software code is developed for different sections like Weaving section, Motor Status, Environment,

More information

Homeworks on FFT Instr. and Meas. for Communication Systems- Gianfranco Miele. Name Surname

Homeworks on FFT Instr. and Meas. for Communication Systems- Gianfranco Miele. Name Surname Homeworks on FFT 90822- Instr. and Meas. for Communication Systems- Gianfranco Miele Name Surname October 15, 2014 1 Name Surname 90822 (Gianfranco Miele): Homeworks on FFT Contents Exercise 1 (Solution)............................................

More information

LISTING PROGRAM. % Edit the above text to modify the response to help cover. % Last Modified by GUIDE v Jun :24:43

LISTING PROGRAM. % Edit the above text to modify the response to help cover. % Last Modified by GUIDE v Jun :24:43 A1 LISTING PROGRAM 1. Form Cover function varargout = cover(varargin) COVER MATLAB code for cover.fig COVER, by itself, creates a new COVER or raises the existing singleton*. H = COVER returns the handle

More information

Ear Recognition. By: Zeyangyi Wang

Ear Recognition. By: Zeyangyi Wang Ear Recognition By: Zeyangyi Wang Ear Recognition By: Zeyangyi Wang Online: < http://cnx.org/content/col11604/1.3/ > C O N N E X I O N S Rice University, Houston, Texas This selection and arrangement

More information

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1);

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1); LISTING PROGRAM FORM PERTAMA : function varargout = pertama(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @pertama_openingfcn,...

More information

Akkad Bakad Bambai Bo

Akkad Bakad Bambai Bo Akkad Bakad Bambai Bo The Josephus Problem Shivam Sharma, Rajat Saini and Natasha Sharma Cluster Innovation Center, University of Delhi Abstract We aim to give explanation of the recursive formula for

More information

1.Matlab Image Encryption Code

1.Matlab Image Encryption Code 1.Matlab Image Encryption Code (URL: http://www.cheers4all.com/2012/04/matlab-image-encryption-code/) This project is Image Encryption & Decryption. The user will give an input and encryption factor. The

More information

Lampiran 1. Script M-File Global Ridge

Lampiran 1. Script M-File Global Ridge LAMPIRAN 67 Lampiran 1. Script M-File Global Ridge function [l, e, L, E] = globalridge(h, Y, l) [l, e, L, E] = globalridge(h, Y, l, options, U) Calculates the best global ridge regression parameter (l)

More information

Supplementary Information

Supplementary Information Supplementary Information Retooling Laser Speckle Contrast Analysis Algorithm to Enhance Non-Invasive High Resolution Laser Speckle Functional Imaging of Cutaneous Microcirculation Surya C Gnyawali 1,

More information

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists 3,500 108,000 1.7 M Open access books available International authors and editors Downloads Our

More information

OMR Sheet Recognition

OMR Sheet Recognition International Journal of Information & Computation Technology. ISSN 0974-2239 Volume 8, Number 1 (2018), pp. 11-32 International Research Publications House http://www. irphouse.com OMR Sheet Recognition

More information

Lithium-Ion Battery Data. Management

Lithium-Ion Battery Data. Management Lithium-Ion Battery Data Management Frank Ferrato Dr. Jung-Hyun Kim April 2018 Abstract: Lithium Ion Battery research is growing due to the need for renewable resources. Since the amount of research is

More information

% --- Executes on button press in btn_gsn. function btn_gsn_callback(hobject, eventdata, handles) GaussianSpeckleNoise close AiSoftware;

% --- Executes on button press in btn_gsn. function btn_gsn_callback(hobject, eventdata, handles) GaussianSpeckleNoise close AiSoftware; A-2 'gui_openingfcn', @AiSoftware_OpeningFcn,... 'gui_outputfcn', @AiSoftware_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1});

More information

A NEW MACHINING COST CALCULATOR (MC 2 )

A NEW MACHINING COST CALCULATOR (MC 2 ) A NEW MACHINING COST CALCULATOR (MC 2 ) By MATHEW RUSSELL JOHNSON A THESIS PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER

More information

MV 1:00 1:05 1:00 1:05

MV 1:00 1:05 1:00 1:05 1 54 MV 1:00 1:05 1:00 1:05 55 DTW 56 function varargout = my_filter8(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @my_filter8_openingfcn,...

More information

Solving Sudoku with MATLAB

Solving Sudoku with MATLAB Solving Sudoku with MATLAB Raluca Marinescu Andrea Garcia Ivan Castro Eduard Paul Enoiu Mälardalen University, Västerås, Sweden {rmu09001, aga09001, ico09002, eeu09001}@student.mdh.se March 25, 2011 Abstract

More information

LAMPIRAN A PROGRAM PELATIHAN DAN PENGUJIAN

LAMPIRAN A PROGRAM PELATIHAN DAN PENGUJIAN LAMPIRAN A PROGRAM PELATIHAN DAN PENGUJIAN Program Preprocessing Image clc; clear all; % Preprocessing Image -------------------------------------------- daniel{1}=imread('daniel1.bmp'); daniel{2}=imread('daniel2.bmp');

More information

LAMPIRAN LISTING PROGRAM

LAMPIRAN LISTING PROGRAM A1 LAMPIRAN LISTING PROGRAM Prototype.m function varargout = prototype(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @prototype_openingfcn,...

More information

COMPLETELY AUTOMATED PUBLIC TURING TEST TO TELL COMPUTERS AND HUMANS APART

COMPLETELY AUTOMATED PUBLIC TURING TEST TO TELL COMPUTERS AND HUMANS APART COMPLETELY AUTOMATED PUBLIC TURING TEST TO TELL COMPUTERS AND HUMANS APART 1 Varjith Anchuri, 2 K.Hanuman Krishna, 3 M.Gopi Chand, 4 S.Rishi, UG Scholar Dept Of CSE, SRM University,Chennai. Abstract A

More information

Finding a Minimum Covering Circle Based on Infinity Norms

Finding a Minimum Covering Circle Based on Infinity Norms Finding a Minimum Covering Circle Based on Infinity Norms by Andrew A. Thompson ARL-TR-4495 July 2008 Approved for public release; distribution is unlimited. NOTICES Disclaimers The findings in this report

More information

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end A-1 LISTING PROGRAM 1. Form Cover function varargout = cover(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @cover_openingfcn,...

More information

Contents INTERFACING MATLAB WITH EMBEDDED SYSTEMS

Contents INTERFACING MATLAB WITH EMBEDDED SYSTEMS Contents MATLAB INTRODUCTION:... 1 Why it is useful for prototyping AI projects??... 2 Using MATLAB as a calculator:... 3 How to use conditions... 8 Serial/Parallel communication:... 9 Color Detection

More information

ECE Fall 05. Undergraduate Research: Digital Signal Processing & Quantization Effects

ECE Fall 05. Undergraduate Research: Digital Signal Processing & Quantization Effects ECE 491-153 Fall 05 Undergraduate Research: Digital Signal Processing & Quantization Effects Done By: Tanim Taher SID# 10370800 Date: December 19, 2005 DSP & Quantization 1 Tanim Taher ACKNOWLEDGEMENTS

More information

Airfoil Boundary Layer Separation Prediction

Airfoil Boundary Layer Separation Prediction Airfoil Boundary Layer Separation Prediction A project present to The Faculty of the Department of Aerospace Engineering San Jose State University in partial fulfillment of the requirements for the degree

More information

PROGRAMMING IN MATLAB

PROGRAMMING IN MATLAB PROGRAMMING IN MATLAB Rohan D sa Rafael Love Todd Page OBJECTIVE: This document gives an overview of a few aspects related to programming in Matlab. With the help of a sample program, it goes through some

More information

Parallel-connected solar arrays

Parallel-connected solar arrays Scholars' Mine Masters Theses Student Research & Creative Works Spring 2013 Parallel-connected solar arrays Majed Meshal Alabbass Follow this and additional works at: http://scholarsmine.mst.edu/masters_theses

More information

LAMPIRAN A LISTINGPROGRAM

LAMPIRAN A LISTINGPROGRAM LAMPIRAN A LISTINGPROGRAM 1. Form Utama (myprogram.fig) function varargout = myprogram(varargin) gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn',

More information

.., 7. References. [ 1] 1 mage Analysis and Mathematical Morphology:J.Serra. [2] Erosion, dilation and related operators,by Mariusz Jankowski

.., 7. References. [ 1] 1 mage Analysis and Mathematical Morphology:J.Serra. [2] Erosion, dilation and related operators,by Mariusz Jankowski 7. References [ 1] 1 mage Analysis and Mathematical Morphology:J.Serra [2] Erosion, dilation and related operators,by Mariusz Jankowski [3] Morphological Image Processing by Ranga Rodrigo [4] Application

More information

ALGORITHMS AND INTERFACE FOR OCEAN ACOUSTIC RAY-TRACING (Developed in MATLAB)

ALGORITHMS AND INTERFACE FOR OCEAN ACOUSTIC RAY-TRACING (Developed in MATLAB) ALGORITHMS AND INTERFACE FOR OCEAN ACOUSTIC RAY-TRACING (Developed in MATLAB) Technical Report No. NIO/TR 09/005 T.V.Ramana Murty M.M.Malleswara Rao S.Surya Prakash P.Chandramouli K.S.R.Murthy Regional

More information

Main Form visual Studio

Main Form visual Studio Main Form visual Studio using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

GUI Signal Analysis and Filtering Design

GUI Signal Analysis and Filtering Design i GUI Signal Analysis and Filtering Design Axel Daniela Campero Vega, Electrical Engineering Project Advisor: Dr. Dick Blandford April 26, 2018 Evansville, Indiana ii Acknowledgements I want to thank Dr.

More information

Finite Element Analysis Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology Madras. Module - 01 Lecture - 15

Finite Element Analysis Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology Madras. Module - 01 Lecture - 15 Finite Element Analysis Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology Madras Module - 01 Lecture - 15 In the last class we were looking at this 3-D space frames; let me summarize

More information

Accepted by... John H. Lienhard V

Accepted by... John H. Lienhard V The Understanding, Characterization, and Implementation of a SICK LMS-291 Laser Scanner for Use in an Experimental Environment by Marcos Berrios Submitted to the Department of Mechanical Engineering in

More information

Exercise Set Decide whether each matrix below is an elementary matrix. (a) (b) (c) (d) Answer:

Exercise Set Decide whether each matrix below is an elementary matrix. (a) (b) (c) (d) Answer: Understand the relationships between statements that are equivalent to the invertibility of a square matrix (Theorem 1.5.3). Use the inversion algorithm to find the inverse of an invertible matrix. Express

More information

Implementation of a Motion Detection System

Implementation of a Motion Detection System Implementation of a Motion Detection System Asif Ansari 1, T.C.Manjunath (Ph.D., IIT Bombay) 2, C.Ardil 3 Abstract In today s competitive environment, the security concerns have grown tremously. In the

More information

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices Introduction to Interactive Calculations Matlab is interactive, no need to declare variables >> 2+3*4/2 >> V = 50 >> V + 2 >> V Ans = 52 >> a=5e-3; b=1; a+b Most elementary functions and constants are

More information

Spring 2010 Instructor: Michele Merler.

Spring 2010 Instructor: Michele Merler. Spring 2010 Instructor: Michele Merler http://www1.cs.columbia.edu/~mmerler/comsw3101-2.html Type from command line: matlab -nodisplay r command Tells MATLAB not to initialize the visual interface NOTE:

More information

LESM. Linear Elements Structure Model. Version 1.0 August Luiz Fernando Martha

LESM. Linear Elements Structure Model. Version 1.0 August Luiz Fernando Martha LESM Linear Elements Structure Model Version 1.0 August 2017 http://www.tecgraf.puc-rio.br/lesm by Luiz Fernando Martha (lfm@tecgraf.puc-rio.br) Rafael Lopez Rangel (rafaelrangel@tecgraf.puc-rio.br) Pontifical

More information

IMAGE STEGANOGRAPHY USING DISCRETE COSINE TRNASFORM ALGORITHM

IMAGE STEGANOGRAPHY USING DISCRETE COSINE TRNASFORM ALGORITHM RCC Institute of Information Technology Canal South Road, Beliaghata, Kolkata 700 015 [Affiliated to West Bengal University of Technology] IMAGE STEGANOGRAPHY USING DISCRETE COSINE TRNASFORM ALGORITHM

More information

MATLAB. Creating Graphical User Interfaces Version 7. The Language of Technical Computing

MATLAB. Creating Graphical User Interfaces Version 7. The Language of Technical Computing MATLAB The Language of Technical Computing Note This revision of Creating Graphical User Interfaces, issued May 2006, adds three new chapters that provide more information for creating GUIs programmatically.

More information

LOK-Viewer : Graphical Interface Application for Geomagnetic Data in Observatory Geomagnetic Lombok

LOK-Viewer : Graphical Interface Application for Geomagnetic Data in Observatory Geomagnetic Lombok LOK-Viewer : Graphical Interface Application for Geomagnetic Data in Observatory Geomagnetic Lombok Giri W. Wiriasto, Teti Zubaidah, Bulkis Kanata Electrical Engineering Dept. Mataram University Lombok,

More information

Real-Time IIR Digital Filters

Real-Time IIR Digital Filters Real-Time IIR Digital Filters Chapter 8 Introduction Infinite impulse response (IIR) filter design has its roots in traditional analog filter design. One of the main issues in IIR digital filter design

More information

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective Department of Computing and Information Systems The Lecture outline Introduction Rotation about artibrary axis

More information

Preliminary remarks. Preliminary remarks. Preliminary remarks. CHAPTER 7 BM Analysis using Stiffness Method

Preliminary remarks. Preliminary remarks. Preliminary remarks. CHAPTER 7 BM Analysis using Stiffness Method CHAPTER 7 BM Analysis using Stiffness Method Objectives เข าใจว ธ ของ stiffness method ก บ โครงสร างประเภทคาน Member & node identification In general each element must be free from load & have a prismatic

More information

MEASURING INTERFACIAL TENSION WITH THE PENDANT DROP METHOD

MEASURING INTERFACIAL TENSION WITH THE PENDANT DROP METHOD MEASURING INTERFACIAL TENSION WITH THE PENDANT DROP METHOD A Thesis Presented to The Academic Faculty by Kevin K. Mohan-Nair In Partial Fulfillment of the Requirements for the Degree Bachelor of Science

More information

SECTION 2: PROGRAMMING WITH MATLAB. MAE 4020/5020 Numerical Methods with MATLAB

SECTION 2: PROGRAMMING WITH MATLAB. MAE 4020/5020 Numerical Methods with MATLAB SECTION 2: PROGRAMMING WITH MATLAB MAE 4020/5020 Numerical Methods with MATLAB 2 Functions and M Files M Files 3 Script file so called due to.m filename extension Contains a series of MATLAB commands The

More information

Chemical Engineering 541

Chemical Engineering 541 Chemical Engineering 541 Computer Aided Design Methods Matlab Tutorial 1 Overview 2 Matlab is a programming language suited to numerical analysis and problems involving vectors and matricies. Matlab =

More information

midas Civil Advanced Webinar Date: February 9th, 2012 Topic: General Use of midas Civil Presenter: Abhishek Das Bridging Your Innovations to Realities

midas Civil Advanced Webinar Date: February 9th, 2012 Topic: General Use of midas Civil Presenter: Abhishek Das Bridging Your Innovations to Realities Advanced Webinar Date: February 9th, 2012 Topic: General Use of midas Civil Presenter: Abhishek Das Contents: Overview Modeling Boundary Conditions Loading Analysis Results Design and Misc. Introduction

More information

SETTLEMENT OF A CIRCULAR FOOTING ON SAND

SETTLEMENT OF A CIRCULAR FOOTING ON SAND 1 SETTLEMENT OF A CIRCULAR FOOTING ON SAND In this chapter a first application is considered, namely the settlement of a circular foundation footing on sand. This is the first step in becoming familiar

More information

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms Chapter IV Spaces and Transforms Scaling 2D scaling with the scaling factors, s x and s y, which are independent. Examples When a polygon is scaled, all of its vertices are processed by the same scaling

More information

COMS 3101 Programming Languages: MATLAB. Lecture 2

COMS 3101 Programming Languages: MATLAB. Lecture 2 COMS 3101 Programming Languages: MATLAB Lecture 2 Fall 2013 Instructor: Ilia Vovsha hbp://www.cs.columbia.edu/~vovsha/coms3101/matlab Lecture Outline Quick review of array manipulanon Control flow Simple

More information

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set

More information

Low-Level File I/O. 1. Open a file. 2. Read or write data into the file. 3. Close the file. Zheng-Liang Lu 1 / 14

Low-Level File I/O. 1. Open a file. 2. Read or write data into the file. 3. Close the file. Zheng-Liang Lu 1 / 14 Low-Level File I/O Low-level file I/O functions allow the most control over reading or writing data to a file. However, these functions require that you specify more detailed information about your file

More information

Loads. Lecture 12: PRISMATIC BEAMS

Loads. Lecture 12: PRISMATIC BEAMS Loads After composing the joint stiffness matrix the next step is composing load vectors. reviously it was convenient to treat joint loads and member loads separately since they are manipulated in different

More information

Frame Analysis Using Visual Analysis

Frame Analysis Using Visual Analysis Frame Analysis Using Visual Analysis 1. The software is available at the Open Access Labs (OAL) and the Virtual OAL at http://voal.tamu.edu in Programs under the Windows Start menu. The software can also

More information

Practice Reading for Loops

Practice Reading for Loops ME 350 Lab Exercise 3 Fall 07 for loops, fprintf, if constructs Practice Reading for Loops For each of the following code snippets, fill out the table to the right with the values displayed when the code

More information

3D Coordinate Transformation Calculations. Space Truss Member

3D Coordinate Transformation Calculations. Space Truss Member 3D oordinate Transformation alculations Transformation of the element stiffness equations for a space frame member from the local to the global coordinate system can be accomplished as the product of three

More information

Computational Methods of Scientific Programming

Computational Methods of Scientific Programming 12.010 Computational Methods of Scientific Programming Lecturers Thomas A Herring, Jim Elliot, Chris Hill, Summary of Today s class We will look at Matlab: History Getting help Variable definitions and

More information

Geometry. Prof. George Wolberg Dept. of Computer Science City College of New York

Geometry. Prof. George Wolberg Dept. of Computer Science City College of New York Geometry Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce the elements of geometry -Scalars - Vectors - Points Develop mathematical operations among them in

More information

Assignment #2: False Position Method

Assignment #2: False Position Method University of Puerto Rico Mayaguez Campus Department of Electrical & Computer Engineering Assignment #2: False Position Method Osvaldo M. Cardona 841-08-0990 Diana Rivera Negrón 802-08-6908 Ricardo I.

More information

Working with Excel Files. a = round(rand(5,3)*100) xlswrite('rand.xlsx',a) b = xlsread('rand.xlsx')

Working with Excel Files. a = round(rand(5,3)*100) xlswrite('rand.xlsx',a) b = xlsread('rand.xlsx') File I/O Working with Excel Files a = round(rand(5,3)*100) xlswrite('rand.xlsx',a) b = xlsread('rand.xlsx') Excel files with mixed content >> [nums, txt, raw] = xlsread('texttest.xls') nums = 123 333 432

More information

UNIVERSITÀ DEGLI STUDI DI PADOVA

UNIVERSITÀ DEGLI STUDI DI PADOVA UNIVERSITÀ DEGLI STUDI DI PADOVA FACOLTÀ DI INGEGNERIA CORSO DI LAUREA IN INGEGNERIA BIOMEDICA DESIGN OF NEUROPHYSIOLOGICAL SIGNAL ANAYSIS SOFTWARE GIACOMO BASSETTO SUPERVISOR: PROFESSOR STEFANO VASSANELLI

More information

A METHOD TO MODELIZE THE OVERALL STIFFNESS OF A BUILDING IN A STICK MODEL FITTED TO A 3D MODEL

A METHOD TO MODELIZE THE OVERALL STIFFNESS OF A BUILDING IN A STICK MODEL FITTED TO A 3D MODEL A METHOD TO MODELIE THE OVERALL STIFFNESS OF A BUILDING IN A STICK MODEL FITTED TO A 3D MODEL Marc LEBELLE 1 SUMMARY The aseismic design of a building using the spectral analysis of a stick model presents

More information

1. Carlos A. Felippa, Introduction to Finite Element Methods,

1. Carlos A. Felippa, Introduction to Finite Element Methods, Chapter Finite Element Methods In this chapter we will consider how one can model the deformation of solid objects under the influence of external (and possibly internal) forces. As we shall see, the coupled

More information

Introduction To MATLAB Interactive Graphics

Introduction To MATLAB Interactive Graphics Introduction To MATLAB Interactive Graphics Eric Peasley, Department of Engineering Science, University of Oxford version 3.0, 2017 An Introduction to MATLAB Interactive Graphics Table of Contents Data

More information

Tutorial 1: Welded Frame - Problem Description

Tutorial 1: Welded Frame - Problem Description Tutorial 1: Welded Frame - Problem Description Introduction In this first tutorial, we will analyse a simple frame: firstly as a welded frame, and secondly as a pin jointed truss. In each case, we will

More information

1 Lab 3, Simulation of crank-piston system

1 Lab 3, Simulation of crank-piston system 1 Lab 3, Simulation of crank-piston system 1.1 Problem description Simulation 3 Slider-Crank Mechanism with a Piston In your text, the slider-crank kinematic mechanism is discussed and equations of motion

More information

Ansys Lab Frame Analysis

Ansys Lab Frame Analysis Ansys Lab Frame Analysis Analyze the highway overpass frame shown in Figure. The main horizontal beam is W24x162 (area = 47.7 in 2, moment of inertia = 5170 in 4, height = 25 in). The inclined members

More information

Introduction to Finite Element Method

Introduction to Finite Element Method Guest Lecture in Prodi Teknik Sipil Introduction to Finite Element Method Wong Foek Tjong, Ph.D. Petra Christian University Surabaya Lecture Outline 1. Overview of the FEM 2. Computational steps of the

More information

Design of Automated Digital Eye Palpation Exam for Intraocular Pressure Measurement

Design of Automated Digital Eye Palpation Exam for Intraocular Pressure Measurement Design of Automated Digital Eye Palpation Exam for Intraocular Pressure Measurement Item Type text; Electronic Thesis Authors Luce, Alexander Vallejo Publisher The University of Arizona. Rights Copyright

More information

2 T. x + 2 T. , T( x, y = 0) = T 1

2 T. x + 2 T. , T( x, y = 0) = T 1 LAB 2: Conduction with Finite Difference Method Objective: The objective of this laboratory is to introduce the basic steps needed to numerically solve a steady state two-dimensional conduction problem

More information

Pro MECHANICA STRUCTURE WILDFIRE 4. ELEMENTS AND APPLICATIONS Part I. Yves Gagnon, M.A.Sc. Finite Element Analyst & Structural Consultant SDC

Pro MECHANICA STRUCTURE WILDFIRE 4. ELEMENTS AND APPLICATIONS Part I. Yves Gagnon, M.A.Sc. Finite Element Analyst & Structural Consultant SDC Pro MECHANICA STRUCTURE WILDFIRE 4 ELEMENTS AND APPLICATIONS Part I Yves Gagnon, M.A.Sc. Finite Element Analyst & Structural Consultant SDC PUBLICATIONS Schroff Development Corporation www.schroff.com

More information

BUILDING A MATLAB GUI. Education Transfer Plan Seyyed Khandani, Ph.D. IISME 2014

BUILDING A MATLAB GUI. Education Transfer Plan Seyyed Khandani, Ph.D. IISME 2014 BUILDING A MATLAB GUI Education Transfer Plan Seyyed Khandani, Ph.D. IISME 2014 Graphical User Interface (GUI) A GUI is useful for presenting your final software. It makes adjusting parameters and visualizing

More information

Flow Control and Functions

Flow Control and Functions Flow Control and Functions Script files If's and For's Basics of writing functions Checking input arguments Variable input arguments Output arguments Documenting functions Profiling and Debugging Introduction

More information

Transforms. COMP 575/770 Spring 2013

Transforms. COMP 575/770 Spring 2013 Transforms COMP 575/770 Spring 2013 Transforming Geometry Given any set of points S Could be a 2D shape, a 3D object A transform is a function T that modifies all points in S: T S S T v v S Different transforms

More information

Beams. Lesson Objectives:

Beams. Lesson Objectives: Beams Lesson Objectives: 1) Derive the member local stiffness values for two-dimensional beam members. 2) Assemble the local stiffness matrix into global coordinates. 3) Assemble the structural stiffness

More information

Keywords: Learning automata, Vertex multicoloring.

Keywords: Learning automata, Vertex multicoloring. ISSN XXXX XXXX 2018 IJESC Research Article Volume 8 Issue No.4 Scheduling Algorithm for High Density MIMO Channels C.Elayaraja 1, P.Manju 2, I.Parsana Begam 3 Associate Professor 1, Student 2, 3 Department

More information

Lecture 5 2D Transformation

Lecture 5 2D Transformation Lecture 5 2D Transformation What is a transformation? In computer graphics an object can be transformed according to position, orientation and size. Exactly what it says - an operation that transforms

More information

Basic MATLAB. Getting MATLAB (for MIT students) Creating matrices and vectors. Some operation of matrices/vectors.

Basic MATLAB. Getting MATLAB (for MIT students) Creating matrices and vectors. Some operation of matrices/vectors. Basic MATLAB Getting MATLAB (for MIT students) http://web.mit.edu/matlab/www/home.html Creating matrices and vectors >> rowvector = [0 20] rowvector = 0 20 >> columnvector = [0; 20] columnvector = 0 20

More information

Statics of the truss with force and temperature load - test problem Nr 1

Statics of the truss with force and temperature load - test problem Nr 1 Statics of the truss with force and temperature load - test problem Nr E := GPa - Young modulus for truss material - steel α t := - - thermal expanssion coeficient - steel D := cm - Cross section (pipe)

More information

Beyond the Mouse A Short Course on Programming

Beyond the Mouse A Short Course on Programming 1 / 14 Beyond the Mouse A Short Course on Programming 5. Matlab IO: Getting data in and out of Matlab Ronni Grapenthin and Glenn Thompson Geophysical Institute, University of Alaska Fairbanks October 10,

More information

GENDER ESTIMATION BASED ON FACIAL IMAGE AZLIN BT YAJID UNIVERSITI TEKNOLOGI MALAYSIA

GENDER ESTIMATION BASED ON FACIAL IMAGE AZLIN BT YAJID UNIVERSITI TEKNOLOGI MALAYSIA GENDER ESTIMATION BASED ON FACIAL IMAGE AZLIN BT YAJID UNIVERSITI TEKNOLOGI MALAYSIA PSZ 19:16 (PIND. 1/97) UNIVERSITI TEKNOLOGI MALAYSIA BORANG PENGESAHAN STATUS TESIS JUDUL: GENDER ESTIMATION BASED ON

More information

Example Cantilever beam

Example Cantilever beam Course in ANSYS Example0300 Example Cantilever beam Objective: Compute the maximum deflection and locate point of maximum deflection Tasks: How should this be modelled? Compare results with results obtained

More information

Application nr. 2 (Global Analysis) Effects of deformed geometry of the structures. Structural stability of frames. Sway frames and non-sway frames.

Application nr. 2 (Global Analysis) Effects of deformed geometry of the structures. Structural stability of frames. Sway frames and non-sway frames. Application nr. 2 (Global Analysis) Effects of deformed geometry of the structures. Structural stability of frames. Sway frames and non-sway frames. Object of study: multistorey structure (SAP 2000 Nonlinear)

More information

FEMAP Freebody Deep-Dive Patrick Kriengsiri, FEMAP Development

FEMAP Freebody Deep-Dive Patrick Kriengsiri, FEMAP Development Femap Symposium 2015 Huntsville FEMAP Freebody Deep-Dive Patrick Kriengsiri, FEMAP Development Realize Innovation. FEMAP Freebody Deep Dive Topics What is a Freebody? Recovering Grid Point Forces in NASTRAN

More information

Jlinpro command glossary

Jlinpro command glossary Jlinpro command glossary Enes Šiljak Contents 1 Set up jlinpro project 1 2 Input file 1 3 Example 1 4 4 Results 6 5 Make change in input file 6 6 Print internal calculation results 7 1 Set up jlinpro project

More information

Scout Optimization Algorithms

Scout Optimization Algorithms Scout Optimization Algorithms 1 Scout Optimization Algorithms By Namir Clement Shammas Contents 1/ Introduction... 2 2/ Scout Optimization Algorithm Pseudo Code... 3 3/ The Scout Optimization Algorithm

More information

Access to Delimited Text Files

Access to Delimited Text Files Access to Delimited Text Files dlmread(filename, delimiter) reads ASCII-delimited file of numeric data. dlmwrite(filename, M, delimiter) writes the array M to the file using the specified delimiter to

More information

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

ixcube 4-10 Brief introduction for membrane and cable systems.

ixcube 4-10 Brief introduction for membrane and cable systems. ixcube 4-10 Brief introduction for membrane and cable systems. ixcube is the evolution of 20 years of R&D in the field of membrane structures so it takes a while to understand the basic features. You must

More information

In part 2, we demonstrate the following additional topics:

In part 2, we demonstrate the following additional topics: Problem description In this problem, we analyze a simple beam structure. Each part of this lesson shows the solution of one of the analyses. In part 1, we demonstrate the following topics: Starting up/shutting

More information

Still More About Matlab GUI s (v. 1.3) Popup Menus. Popup Menu Exercise. Still More GUI Info - GE /29/2012. Copyright C. S. Tritt, Ph.D.

Still More About Matlab GUI s (v. 1.3) Popup Menus. Popup Menu Exercise. Still More GUI Info - GE /29/2012. Copyright C. S. Tritt, Ph.D. Still More About Matlab GUI s (v. 1.3) Dr. C. S. Tritt with slides from Dr. J. LaMack January 24, 2012 Popup Menus User selects one from a mutually exclusive list of options The String property is typically

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I Guoying Zhao 1 / 52 Geometry Guoying Zhao 2 / 52 Objectives Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab 1 Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control Using of M-File Writing User

More information

MATLAB for the Sciences

MATLAB for the Sciences Error Checking,, and MATLAB Movies January 26, 2009 Making Sure Things Work Correctly All through each program we ve assumed that inputs are of a certain type and dimension. What if someone stumbles upon

More information