├── .gitattributes ├── .gitignore ├── Citation.cff ├── LICENSE ├── NEWS.md ├── README.md ├── analysis ├── BC_I1_5.m ├── BC_I1_5_atpoint.m ├── Ym_at_ys.m ├── Ymprime_at_ys.m ├── addspring.m ├── assemble.m ├── cFSM │ ├── DOF_ordering.m │ ├── Kglobal_transv.m │ ├── assemble_m.m │ ├── assemble_single.m │ ├── base_column.m │ ├── base_properties.m │ ├── base_update.m │ ├── base_update_orth.m │ ├── base_vectors.m │ ├── classify.m │ ├── constr_planar_xz.m │ ├── constr_user.m │ ├── constr_xz_y.m │ ├── constr_yd_yg.m │ ├── constr_ys_ym.m │ ├── constr_yu_yd.m │ ├── create_Ks.m │ ├── kglocal_m.m │ ├── klocal_m.m │ ├── klocal_transv.m │ ├── meta_elems.m │ ├── mode_class.asv │ ├── mode_class.m │ ├── mode_class2.m │ ├── mode_constr.m │ ├── mode_nr.m │ ├── mode_select.m │ ├── node_class.m │ ├── trans_m.m │ ├── trans_single.m │ └── yDOFs.m ├── constr_BCFlag.m ├── cutwp_prop2.m ├── doubler.m ├── elemprop.m ├── fcFSM │ ├── SecAnal_fcFSM.m │ └── stripmain_fcFSM.m ├── gammait.m ├── gammait2.m ├── kglocal.m ├── klocal.m ├── msort.m ├── plastic │ ├── PMM_Plastic.asv │ ├── PMM_Plastic.m │ ├── Plastic_Int.m │ └── fiber4elem.m ├── shapef.m ├── spring_assemble.m ├── spring_klocal.m ├── spring_trans.m ├── stresgen.m ├── stripmain.m ├── trans.m ├── vectorized │ ├── BC_I1_5_vec.m │ ├── kglocal_vec.m │ ├── klocal_vec.m │ └── trans_vec.m ├── vibration │ ├── mlocal.m │ └── stripmain_vib.m └── yieldMP.m ├── compiled └── mac standalone app │ ├── .DS_Store │ ├── CUFSM505_mac_install.app │ └── Contents │ │ ├── Info.plist │ │ ├── MacOS │ │ ├── setup │ │ └── setup.dSYM │ │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ └── DWARF │ │ │ └── setup │ │ └── Resources │ │ ├── bundle.zip │ │ ├── en.lproj │ │ └── MainMenu.nib │ │ ├── installAgentURL.txt │ │ ├── installer.icns │ │ └── splash.png │ └── CUFSM505_matlab_install.mlappinstall ├── cufsm5.m ├── cutwp ├── cutwp.m ├── cutwp_draw.m ├── cutwp_print.m ├── cutwp_prop.m ├── fromcufsm.mat └── imcutwp.mat ├── examples ├── 2006_dsm_design_guide │ ├── dsm guide jan 2006 FINAL.pdf │ ├── files_and_scripts │ │ ├── Cwlip_Mx.eps │ │ ├── Cwlip_P.eps │ │ ├── anolip.mat │ │ ├── anolip_Mx_post.m │ │ ├── anolip_Mxr.mat │ │ ├── anolip_P.mat │ │ ├── anolip_P_global.mat │ │ ├── anolip_P_post.m │ │ ├── awlip.mat │ │ ├── awlip_Mx_post.m │ │ ├── awlip_Mx_post_more.m │ │ ├── awlip_Mxr.mat │ │ ├── awlip_Mxr_andpin.mat │ │ ├── awlip_Mxr_mathcad.mat │ │ ├── awlip_P.mat │ │ ├── awlip_P_post.m │ │ ├── awlip_m22.mat │ │ ├── awlip_m22_post.m │ │ ├── builtupcwlip.mat │ │ ├── builtupcwlip_Pstress.mat │ │ ├── builtupcwlip_Pstress_warpfix.mat │ │ ├── builtupcwlip_post.m │ │ ├── cnolip.mat │ │ ├── cnolip_Mx.mat │ │ ├── cnolip_Mx_post.m │ │ ├── cnolip_My.mat │ │ ├── cnolip_My2.mat │ │ ├── cnolip_My2_post.m │ │ ├── cnolip_My_post.m │ │ ├── cnolip_P.mat │ │ ├── cnolip_P_post.m │ │ ├── cnolip_beamcolpic.m │ │ ├── cnolip_halfMP.mat │ │ ├── cnolip_halfMP_post.m │ │ ├── cnolip_halfMPrevised.mat │ │ ├── cnolip_halfMPrevised_post.m │ │ ├── cnolip_modified.mat │ │ ├── cnolip_modified_Mx.mat │ │ ├── cnolip_modified_Mx_post.m │ │ ├── cnolip_modified_My.mat │ │ ├── cnolip_modified_P.mat │ │ ├── cnolip_modified_P_post.m │ │ ├── cufsm2p5_default_badcurve.mat │ │ ├── cwlip.mat │ │ ├── cwlip_Mx.mat │ │ ├── cwlip_Mx_matchad.mat │ │ ├── cwlip_Mx_post.m │ │ ├── cwlip_P.mat │ │ ├── cwlip_P_mathcad.mat │ │ ├── cwlip_P_pinned_corners.mat │ │ ├── cwlip_P_post.m │ │ ├── cwlip_P_post_closeup.m │ │ ├── cwlip_P_post_highmodes.m │ │ ├── cwlip_P_post_longfit.m │ │ ├── cwlip_Pstress.mat │ │ ├── cwlip_Pstress_post.m │ │ ├── cwlip__modified_P_mathcad.mat │ │ ├── cwlip_beamchart.m │ │ ├── cwlip_modified.mat │ │ ├── cwlip_modified_Mx.mat │ │ ├── cwlip_modified_Mx_mathcad.mat │ │ ├── cwlip_modified_Mx_post.m │ │ ├── cwlip_modified_Mx_post_compare.m │ │ ├── cwlip_modified_P.mat │ │ ├── cwlip_modified_P_post.m │ │ ├── cwlip_modified_mx.eps │ │ ├── cwlip_modified_p.eps │ │ ├── distortional_fixed.m │ │ ├── geom.m │ │ ├── hat.mat │ │ ├── hat_Mx.mat │ │ ├── hat_P.mat │ │ ├── hat_P_post.m │ │ ├── hat_P_post2ndmode.m │ │ ├── hat_mx_post.m │ │ ├── howmanylengths.m │ │ ├── igetwaves.m │ │ ├── junk.mat │ │ ├── panel.mat │ │ ├── panel_mxbot.m │ │ ├── panel_mxbot.mat │ │ ├── panel_mxtop.m │ │ ├── panel_mxtop2.m │ │ ├── panel_mxtopfix.mat │ │ ├── panel_mxtopfree.mat │ │ ├── rack_Mx.mat │ │ ├── rack_Mx_post.m │ │ ├── rack_Mz.mat │ │ ├── rack_Mz_post.m │ │ ├── rack_P.mat │ │ ├── rack_P_post.m │ │ ├── sigma.mat │ │ ├── sigma0.mat │ │ ├── sigma_Mx.mat │ │ ├── sigma_Mx_post.m │ │ ├── sigma_P.mat │ │ ├── sigma_P_D.mat │ │ ├── sigma_P_G.mat │ │ ├── sigma_P_post.m │ │ ├── sigma_P_xfix.mat │ │ ├── sigma_P_xfix.zip │ │ ├── zwlip.mat │ │ ├── zwlip_Mx_post.m │ │ ├── zwlip_Mx_post_rotspring.m │ │ ├── zwlip_Mxfree.mat │ │ ├── zwlip_Mxfree_post.m │ │ ├── zwlip_Mxr.mat │ │ ├── zwlip_Mxr_p7rotspring.mat │ │ ├── zwlip_Mzr.mat │ │ ├── zwlip_P.mat │ │ ├── zwlip_P_mathcad.mat │ │ ├── zwlip_P_post.m │ │ ├── zwlip_mod.mat │ │ ├── zwlip_mod_Mx_post.m │ │ ├── zwlip_mod_Mxr.mat │ │ ├── zwlip_mod_P.mat │ │ ├── zwlip_mod_P_mathcad.mat │ │ ├── zwlip_mod_P_post.m │ │ ├── zwlip_mod_nowebst.mat │ │ ├── zwlip_mod_webstonly.mat │ │ ├── zwlip_modweb.mat │ │ ├── zwlip_mxr_mathcad.mat │ │ └── zwlip_mxr_mod_mathcad.mat │ └── readme ├── An introduction to fcFSM.txt ├── batchcufsm5.m ├── batchcufsm5_fcFSM.m ├── batchcufsm5results.mat ├── fcFSM_examples │ ├── C_120X80X15X1 │ │ └── modelData.m │ ├── C_120X80X15X1_B.C.=S-C │ │ └── modelData.m │ ├── C_120X80X15X1_Beam │ │ └── modelData.m │ ├── C_120X80X15X1_CurvedConer │ │ └── modelData.m │ ├── C_120X80X15X1_SpringsN5N10_K=1e10 │ │ └── modelData.m │ ├── C_120X80X15X1_SpringsN5N10_K=5 │ │ └── modelData.m │ ├── C_120X80X15X1_m=1to20 │ │ └── modelData.m │ ├── C_200X90X20X2_CurvedConer │ │ └── modelData.m │ ├── CircularTube_D100X1 │ │ └── modelData.m │ ├── Lipped_Channel_with_Curved_Web │ │ └── modelData.m │ └── theDefaultSection │ │ └── modelData.m └── vibration │ ├── ffplate.m │ └── ffplate1.mat ├── helpers ├── BetaThetaPhitoPMM.m ├── MxxtoM11.m ├── PMMtoBetaThetaPhi.m ├── Warp.m ├── combine_one.m ├── cutwp_prop2.m ├── divide_one.m ├── doubler.m ├── dup_model.m ├── energy_density_recovery.m ├── energy_recovery.m ├── findjobj.m ├── firstyield.m ├── grosprop.m ├── loader.m ├── longtermpart.m ├── m_recommend.m ├── master_slave.m ├── plastic │ ├── B2xyzr.m │ ├── B2xyzr_P.m │ ├── Fiber_Optimization_plastic_point.m │ ├── PMM_Dumping.m │ ├── PMM_Dumping_V1.m │ ├── PMM_fiber_node_element_Z_rot.m │ ├── PMM_fiber_node_element_Z_rot_general.m │ ├── PMM_point_finder.m │ ├── SFIA.mat │ ├── SFIA_Section_Parameters.mat │ ├── YS_for_DSM_Fiber.m │ ├── YS_for_DSM_Fiber_g.m │ ├── Y_P_Code_V1.m │ ├── Zsections.mat │ ├── crossect1.m │ ├── grosprop1.m │ ├── misc │ │ └── Fig_3D_P_Y_Surfaces.fig │ ├── templatecalc2.m │ └── templatecalc2_g.m ├── post_make.m ├── renumbernodes.m ├── saver.m ├── sfiadata.m ├── shapef.m ├── signature_ss.m ├── stresgen.m ├── stress_to_action.m ├── superseded │ ├── tempctest.mat │ ├── temptesting.m │ └── tempztest.mat ├── template_out_to_in.m ├── templatecalc.m ├── trans_or_rot_model.m ├── translate_nodes.m ├── warp_stress.m ├── yieldB.m └── yieldMP.m ├── icons ├── VectorizeIcons.mat ├── abaqus.paint ├── abaqus.png ├── about.gif ├── about.jpg ├── about.paint ├── about.png ├── blank.png ├── boundcon.paint ├── boundcon.png ├── cFSM.paint ├── cFSM.png ├── cufsm5.paint ├── cufsm5.png ├── ebanalysis.paint ├── ebanalysis.png ├── hole.paint ├── hole.png ├── mastanin.paint ├── mastanin.png ├── mastanout.paint ├── mastanout.png ├── one.paint ├── one.png ├── opendoc.mat ├── pan.mat ├── plastic.paint ├── plastic.png ├── post.paint ├── post.png ├── pre.paint ├── pre.png ├── printdoc.mat ├── quit.paint ├── quit.png ├── reset.gif ├── reset.paint ├── reset.png ├── rotate.mat ├── savedoc.mat ├── sectprop.paint ├── sectprop.png ├── stressgen.paint ├── stressgen.png ├── template.paint ├── template.png ├── three.paint ├── three.png ├── two.paint ├── two.png ├── twp.paint ├── twp.png └── zoom.mat ├── interface ├── boundcond.m ├── boundcond_cb.m ├── cfsm.m ├── cfsm_cb.m ├── commandbar.m ├── commandbar_cb.m ├── compareout.m ├── compareout_cb.m ├── cufsmhelp.html ├── cufsmhelp.m ├── loading.m ├── loading_cb.m ├── msuggest.m ├── msuggest_cb.m ├── plasticbuild.m ├── plasticbuild_cb.m ├── pre2.m ├── pre2_cb.m ├── propout.m ├── propout_cb.m ├── superseded │ ├── cufsm4p04.ico │ ├── loading old.m │ └── loading_cb old.m ├── template.m └── template_cb.m ├── plotters ├── PMMplasticplotter.m ├── PMMplotter.m ├── beamcolplotdev.m ├── class_post.m ├── classifycurve.m ├── classifycurvemode.m ├── crossect.m ├── crossect_hole.m ├── dispshap.m ├── dispshap_absolutescale.m ├── dispshp2.m ├── dispshp2_fine.m ├── fibplotoverlay.m ├── propplot.m ├── strainEpic.m ├── strainpic.m ├── strainpic2.m ├── strespic.m ├── templatepic.m ├── thecurve2.m ├── thecurve3.m ├── thecurve3mode.m ├── thecurve_signature.m ├── vdisppic.m ├── vdisppic_absolutescale.m └── warppic.m └── test.m /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization: 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS: 2 | .DS_Store 3 | 4 | # Windows default autosave extension: 5 | *.asv 6 | 7 | # OSX / *nix default autosave extension: 8 | *.m~ 9 | 10 | # Compiled MEX binaries (all platforms): 11 | *.mex* 12 | 13 | # Generated helpsearch folders: 14 | helpsearch*/ 15 | 16 | # Simulink code generation folders: 17 | slprj/ 18 | sccprj/ 19 | 20 | # MATLAB code generation folders: 21 | codegen/ 22 | 23 | # Simulink autosave extension: 24 | *.autosave 25 | 26 | # Simulink cache files: 27 | *.slxc 28 | 29 | # Octave session info: 30 | octave-workspace -------------------------------------------------------------------------------- /Citation.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: > 3 | If you use CUFSM, please cite the software using the reference below. 4 | Additionally, consider citing the related academic papers. 5 | title: CUFSM 6 | version: 5.50 7 | doi: 10.xxxx/zenodo.xxxxx # This will be updated with Zenodo DOI at next new release 8 | authors: 9 | - family-names: Schafer 10 | given-names: Benjamin W. 11 | orcid: 0000-0002-5375-3511 12 | - family-names: Ádány 13 | given-names: Sandor 14 | - family-names: Li 15 | given-names: Zhanjie 16 | - family-names: Jin 17 | given-names: Sheng 18 | keywords: 19 | - cold-formed steel 20 | - finite strip method 21 | - buckling analysis 22 | - structural engineering 23 | - constrained finite strip 24 | date-released: 2025-01-16 # date of last update to this CFF file 25 | url: https://github.com/thinwalled/cufsm-git # Replace with your GitHub repository URL 26 | references: 27 | - type: article 28 | authors: 29 | - family-names: Schafer 30 | given-names: Benjamin W. 31 | - family-names: Li 32 | given-names: Zhanjie 33 | title: > 34 | Buckling analysis of cold-formed steel members with general boundary conditions using CUFSM: 35 | conventional and constrained finite strip methods 36 | journal: Proceedings of the 20th International Specialty Conference on Cold-Formed Steel Structures 37 | year: 2010 38 | month: 11 39 | pages: 17-32 40 | url: https://scholarsmine.mst.edu/isccss/20iccfss/20iccfss-session1/2/ 41 | - type: article 42 | authors: 43 | - family-names: Schafer 44 | given-names: Benjamin W. 45 | - family-names: Ádány 46 | given-names: Sandor 47 | title: > 48 | Buckling analysis of cold-formed steel members using CUFSM: 49 | conventional and constrained finite strip methods 50 | journal: Proceedings of the Eighteenth International Specialty Conference on Cold-Formed Steel Structures 51 | year: 2006 52 | month: 10 53 | pages: 39-54 54 | url: https://scholarsmine.mst.edu/isccss/18iccfss/18iccfss-session1/2/ 55 | - type: article 56 | authors: 57 | - family-names: Jin 58 | given-names: Sheng 59 | - family-names: Ádány 60 | given-names: Sandor 61 | - family-names: Schafer 62 | given-names: Benjamin W. 63 | title: > 64 | Constrained Finite Strip Method: kinematic- and force-based approaches 65 | journal: Proceedings of the Annual Stability Conference, Structural Stability Research Council 66 | year: 2024 67 | month: 4 68 | url: https://aisc.s3-us-east-2.amazonaws.com/SSRC/2024/Jin_et_al_SSRC_2024.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Benjamin W. Schafer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CUFSM 2 | 3 | This is the GitHub repository for the cross-section elastic buckling analysis tool CUFSM written in MATLAB. 4 | 5 | ## Description 6 | 7 | CUFSM - is the Constrained and Unconstrained Finite Strip Method - and provides elastic buckling for member cross-sections as utilized by structural engineers. The method employs the finite strip method, a variant of the finite element method. The implementation allows for general end boundary conditions through series approximations or provides the signature curve analysis aligned with classical buckling solutions with idealized end conditions. 8 | 9 | ## Installation 10 | 11 | The latest version of the software is available for download on [the latest release page](https://github.com/thinwalled/cufsm-git/releases). The software is provided as both (1) the MATLAB source code and (2) compiled standalone applications. For researchers, students, or anyone with access to MATLAB, it is highly recommended to use the source code directly in MATLAB, this is much more stable and manageable. 12 | 13 | Note installation of the standalone version (PC or Mac) will also require downloading of libraries from Matlab (Mathworks). In addition, be patient at boot up of the standalone version it takes a few moments for the code to load. 14 | 15 | Note installation of the matlab app version will place an icon for cufsm in the matlab app toolbar and allow users to use the GUI without knowing underlying file structures etc., Anyone using cufsm for research, or in batch mode, should use the source files. Open cufsm5.m and modify your directory for location of installation and then run cufsm5 from the command line in matlab to start the GUI. 16 | 17 | ## License 18 | 19 | Software is open source and distributed under [MIT license](https://github.com/thinwalled/cufsm-git/blob/main/LICENSE). 20 | 21 | ## Help and Support 22 | 23 | For assistance with the package, please raise an issue on the Github Issues page. Please use the appropriate labels to indicate the specific functionality you are inquiring about. 24 | 25 | ## Additional Information 26 | 27 | The websites [www.ce.jhu.edu/cufsm](www.ce.jhu.edu/cufsm) and [www.ce.jhu.edu/bschafer](www.ce.jhu.edu/bschafer) provide more information on the software. 28 | -------------------------------------------------------------------------------- /analysis/BC_I1_5_atpoint.m: -------------------------------------------------------------------------------- 1 | function [I1,I5] = BC_I1_5_atpoint(BC,kk,nn,a,ys) 2 | % 3 | % Calculate the value of the longitundinal shape functions for discrete springs 4 | % 5 | % BC: a string specifying boundary conditions to be analyzed: 6 | %'S-S' simply-pimply supported boundary condition at loaded edges 7 | %'C-C' clamped-clamped boundary condition at loaded edges 8 | %'S-C' simply-clamped supported boundary condition at loaded edges 9 | %'C-F' clamped-free supported boundary condition at loaded edges 10 | %'C-G' clamped-guided supported boundary condition at loaded edges 11 | %Outputs: 12 | %I1,I5 13 | %calculation of I1 is the value of Ym(y/L)*Yn(y/L) 14 | %calculation of I5 is the value of Ym'(y/L)*Yn'(y/L) 15 | 16 | Ykk = Ym_at_ys(BC,kk,ys,a); 17 | Ynn = Ym_at_ys(BC,nn,ys,a); 18 | Ykkprime = Ymprime_at_ys(BC,kk,ys,a); 19 | Ynnprime = Ymprime_at_ys(BC,nn,ys,a); 20 | I1=Ykk*Ynn; 21 | I5=Ykkprime*Ynnprime; 22 | -------------------------------------------------------------------------------- /analysis/Ym_at_ys.m: -------------------------------------------------------------------------------- 1 | function [Ym] = Ym_at_ys(BC,m,ys,a) 2 | %Longitudinal shape function values 3 | %written by BWS in 2015 4 | %could be called in lots of places, but now (2015) is hardcoded by Zhanjie 5 | %in several places in the interface 6 | %written in 2015 because wanted it for a new idea on discrete springs 7 | 8 | if strcmp(BC,'S-S') 9 | Ym=sin(m*pi*ys/a); 10 | elseif strcmp(BC,'C-C') 11 | Ym=sin(m*pi*ys/a).*sin(pi*ys/a); 12 | elseif strcmp(BC,'S-C')|strcmp(BC,'C-S') 13 | Ym=sin((m+1)*pi*ys/a)+(m+1)/m*sin(m*pi*ys/a); 14 | elseif strcmp(BC,'C-F')|strcmp(BC,'F-C') 15 | Ym=1-cos((m-0.5)*pi*ys/a); 16 | elseif strcmp(BC,'C-G')|strcmp(BC,'G-C') 17 | Ym=sin((m-0.5)*pi*ys/a).*sin(pi*ys/a/2); 18 | end 19 | 20 | 21 | -------------------------------------------------------------------------------- /analysis/Ymprime_at_ys.m: -------------------------------------------------------------------------------- 1 | function [Ymprime] = Ym_at_ys(BC,m,ys,a) 2 | %First Derivative of Longitudinal shape function values 3 | %written by BWS in 2015 4 | %could be called in lots of places, but now (2015) is hardcoded by Zhanjie 5 | %in several places in the interface 6 | %written in 2015 because wanted it for a new idea on discrete springs 7 | 8 | if strcmp(BC,'S-S') 9 | Ymprime=(pi*m*cos((pi*m*ys)/a))/a; 10 | elseif strcmp(BC,'C-C') 11 | Ymprime=(pi*cos((pi*ys)/a)*sin((pi*m*ys)/a))/a + (pi*m*sin((pi*ys)/a)*cos((pi*m*ys)/a))/a; 12 | elseif strcmp(BC,'S-C')|strcmp(BC,'C-S') 13 | Ymprime=(pi*cos((pi*ys*(m + 1))/a)*(m + 1))/a + (pi*cos((pi*m*ys)/a)*(m + 1))/a; 14 | elseif strcmp(BC,'C-F')|strcmp(BC,'F-C') 15 | Ymprime=(pi*sin((pi*ys*(m - 1/2))/a)*(m - 1/2))/a; 16 | elseif strcmp(BC,'C-G')|strcmp(BC,'G-C') 17 | Ymprime=(pi*sin((pi*ys*(m - 1/2))/a)*cos((pi*ys)/(2*a)))/(2*a) + (pi*cos((pi*ys*(m - 1/2))/a)*sin((pi*ys)/(2*a))*(m - 1/2))/a; 18 | end 19 | 20 | 21 | -------------------------------------------------------------------------------- /analysis/addspring.m: -------------------------------------------------------------------------------- 1 | function [K]=addspring(K,springs,nnodes,a,BC,m_a) 2 | %BWS 3 | %August 2000 4 | 5 | %[K]=addspring(K,springs,nnodes,a,m_a,BC) 6 | %Add spring stiffness to global elastic stiffness matrix 7 | % 8 | %K is the complete elastic stiffness matrix 9 | %springs is the definiton of any external springs added to the member 10 | %springs=[node# DOF(x=1,z=2,y=3,theta=4) ks] 11 | 12 | % modified by Z. Li, Aug. 09, 2009 for general B.C. 13 | % Z. Li, June 2010 14 | 15 | if springs==0|isempty(springs) 16 | %nothing to calculate 17 | else 18 | totalm = length(m_a); %Total number of longitudinal terms m 19 | 20 | for i=1:size(springs,1) 21 | node=springs(i,1); 22 | dof=springs(i,2); 23 | k=springs(i,3); 24 | kflag=springs(i,4); 25 | 26 | if dof==1 27 | rc=2*node-1; 28 | elseif dof==2 29 | rc=2*nnodes+2*node-1; 30 | elseif dof==3 31 | rc=2*node; 32 | elseif dof==4 33 | rc=2*nnodes+2*node; 34 | else 35 | rc=1; 36 | ks=0; 37 | end 38 | for kk=1:1:totalm 39 | for nn=1:1:totalm 40 | if kflag==0 41 | ks=k; %k is the total stiffness and may be added directly 42 | else 43 | if dof==3 44 | ks=0; %axial dof with a foundation stiffness has no net stiffness 45 | else 46 | [I1,I2,I3,I4,I5] = BC_I1_5(BC,m_a(kk),m_a(nn),a); 47 | ks=k*I1; %k is a foundation stiffness and an equivalent total stiffness must be calculated 48 | end 49 | end 50 | 51 | K(4*nnodes*(kk-1)+rc,4*nnodes*(nn-1)+rc)=K(4*nnodes*(kk-1)+rc,4*nnodes*(nn-1)+rc)+ks; 52 | end 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /analysis/cFSM/DOF_ordering.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/analysis/cFSM/DOF_ordering.m -------------------------------------------------------------------------------- /analysis/cFSM/Kglobal_transv.m: -------------------------------------------------------------------------------- 1 | function [K_transv]=Kglobal_transv(node,elem,prop,m,a,BC) 2 | % 3 | %this routine creates the global stiffness matrix for planar displacements 4 | %basically the same way as in the main program, however: 5 | % only one half-wave number m is considered, 6 | % only w,teta terms are considered, 7 | % plus Ey=vx=vy=0 is assumed 8 | % plus the longit. displ. DOFs are explicitely eliminated 9 | % the multipication by 'a' (member length) is not done here, must be done 10 | % outside of this routine 11 | % 12 | %input/output data 13 | % node, elem, prop - same as elsewhere throughout this program 14 | % m - number of half waves 15 | % K_transv - global stifness matrix (geometric not included) 16 | % 17 | % S. Adany, Feb 08, 2004 18 | % Z. Li, Jul 10, 2009 19 | % 20 | nnode=length(node(:,1)); 21 | nelem=length(elem(:,1)); 22 | [elprop]=elemprop(node,elem,nnode,nelem); 23 | [K_transv]=zeros(4*nnode,4*nnode); 24 | % 25 | for i=1:nelem 26 | %to generate element stiffness matrix (k) in local coordinates 27 | t=elem(i,4); 28 | %a=1; 29 | b=elprop(i,2); 30 | matnum=elem(i,5); 31 | row=find(matnum==prop(:,1)); 32 | Ex=prop(row,2); 33 | Ey=prop(row,3); 34 | vx=prop(row,4); 35 | vy=prop(row,5); 36 | G=prop(row,6); 37 | %m=1; 38 | [k_l]=klocal_transv(Ex,Ey,vx,vy,G,t,a,b,m,BC); 39 | %to transform k into global coordinates 40 | alpha=elprop(i,3); 41 | [k]=trans_single(alpha,k_l); 42 | %to add element contribution of k to full matrix K 43 | nodei=elem(i,2); 44 | nodej=elem(i,3); 45 | [K_transv]=assemble_single(K_transv,k,nodei,nodej,nnode); 46 | end 47 | -------------------------------------------------------------------------------- /analysis/cFSM/assemble_single.m: -------------------------------------------------------------------------------- 1 | function [K]=assemble_single(K,k,nodei,nodej,nnodes) 2 | % 3 | %this routine adds the element contribution to the global stiffness matrix 4 | %basically it does the same as rutine 'assemble', however: 5 | % it does not care about Kg (geom stiff matrix) 6 | % only involves single half-wave number m 7 | 8 | % S. Adany, Feb 06, 2004 9 | % Z. Li, Jul 10, 2009 10 | % 11 | %submatrices for the initial stiffness 12 | k11=k(1:2,1:2); 13 | k12=k(1:2,3:4); 14 | k13=k(1:2,5:6); 15 | k14=k(1:2,7:8); 16 | k21=k(3:4,1:2); 17 | k22=k(3:4,3:4); 18 | k23=k(3:4,5:6); 19 | k24=k(3:4,7:8); 20 | k31=k(5:6,1:2); 21 | k32=k(5:6,3:4); 22 | k33=k(5:6,5:6); 23 | k34=k(5:6,7:8); 24 | k41=k(7:8,1:2); 25 | k42=k(7:8,3:4); 26 | k43=k(7:8,5:6); 27 | k44=k(7:8,7:8); 28 | % 29 | % 30 | K2=zeros(4*nnodes,4*nnodes); 31 | % 32 | %the additional terms for K are stored in K2 33 | skip=2*nnodes; 34 | K2(nodei*2-1:nodei*2,nodei*2-1:nodei*2)=k11; 35 | K2(nodei*2-1:nodei*2,nodej*2-1:nodej*2)=k12; 36 | K2(nodej*2-1:nodej*2,nodei*2-1:nodei*2)=k21; 37 | K2(nodej*2-1:nodej*2,nodej*2-1:nodej*2)=k22; 38 | % 39 | K2(skip+nodei*2-1:skip+nodei*2,skip+nodei*2-1:skip+nodei*2)=k33; 40 | K2(skip+nodei*2-1:skip+nodei*2,skip+nodej*2-1:skip+nodej*2)=k34; 41 | K2(skip+nodej*2-1:skip+nodej*2,skip+nodei*2-1:skip+nodei*2)=k43; 42 | K2(skip+nodej*2-1:skip+nodej*2,skip+nodej*2-1:skip+nodej*2)=k44; 43 | % 44 | K2(nodei*2-1:nodei*2,skip+nodei*2-1:skip+nodei*2)=k13; 45 | K2(nodei*2-1:nodei*2,skip+nodej*2-1:skip+nodej*2)=k14; 46 | K2(nodej*2-1:nodej*2,skip+nodei*2-1:skip+nodei*2)=k23; 47 | K2(nodej*2-1:nodej*2,skip+nodej*2-1:skip+nodej*2)=k24; 48 | % 49 | K2(skip+nodei*2-1:skip+nodei*2,nodei*2-1:nodei*2)=k31; 50 | K2(skip+nodei*2-1:skip+nodei*2,nodej*2-1:nodej*2)=k32; 51 | K2(skip+nodej*2-1:skip+nodej*2,nodei*2-1:nodei*2)=k41; 52 | K2(skip+nodej*2-1:skip+nodej*2,nodej*2-1:nodej*2)=k42; 53 | K=K+K2; 54 | % 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /analysis/cFSM/base_column.m: -------------------------------------------------------------------------------- 1 | function [b_v_l,ngm,ndm,nlm]=base_column(node,elem,prop,a,BC,m_a) 2 | % 3 | %this routine creates base vectors for a column with length a for all the 4 | %specified longitudinal terms in m_a 5 | 6 | %assumptions 7 | % othogonalization is not performed unless the user wants 8 | % orthogonalization is done by solving the eigen-value problem within each sub-space 9 | % normalization is not done 10 | 11 | %input data 12 | % node,elem,prop - basic data 13 | % BC: ['S-S'] a string specifying boundary conditions to be analyzed: 14 | %'S-S' simply-pimply supported boundary condition at loaded edges 15 | %'C-C' clamped-clamped boundary condition at loaded edges 16 | %'S-C' simply-clamped supported boundary condition at loaded edges 17 | %'C-F' clamped-free supported boundary condition at loaded edges 18 | %'C-G' clamped-guided supported boundary condition at loaded edges 19 | % m_a - longitudinal terms (half-wave numbers) 20 | 21 | %output data 22 | % b_v_l - base vectors (each column corresponds to a certain mode) 23 | % assemble for each half-wave number m on its diagonal 24 | % b_v_l=diag(b_v_m) 25 | % for each half-wave number m, b_v_m 26 | % columns 1..ngm: global modes 27 | % columns (ngm+1)..(ngm+ndm): dist. modes 28 | % columns (ngm+ndm+1)..(ngm+ndm+nlm): local modes 29 | % columns (ngm+ndm+nlm+1)..ndof: other modes 30 | % ngm,ndm,nlm - number of G,D,L modes, respectively 31 | % 32 | 33 | % S. Adany, Aug 28, 2006 34 | % B. Schafer, Aug 29, 2006 35 | % Z. Li, Dec 22, 2009 36 | % Z. Li, June 2010 37 | 38 | node(:,8)=node(:,8)*0+1; %set up stress to 1.0 for finding Kg and K for axial modes 39 | 40 | % natural base first 41 | % properties all the longitudinal terms share 42 | [elprop,m_node,m_elem,node_prop,nmno,ncno,nsno,ndm,nlm,DOFperm]=base_properties(node,elem); 43 | 44 | %construct the base for all the longitudinal terms 45 | nnodes = length(node(:,1)); 46 | ndof_m= 4*nnodes; 47 | totalm=length(m_a); 48 | b_v_l=zeros(ndof_m*totalm); 49 | for ml=1:totalm 50 | [Rx,Rz,Rp,Ryd,Rys,Rud]=mode_constr(node,elem,prop,node_prop,m_node,m_elem,DOFperm,m_a(ml),a,BC); 51 | [dy,ngm]=yDOFs(node,elem,m_node,nmno,ndm,Ryd,Rud); 52 | [b_v_m]=base_vectors(dy,elem,elprop,a,m_a(ml),node_prop,nmno,ncno,nsno,ngm,ndm,nlm,Rx,Rz,Rp,Rys,DOFperm); 53 | b_v_l((ndof_m*(ml-1)+1):ndof_m*ml,(ndof_m*(ml-1)+1):ndof_m*ml)=b_v_m; 54 | end 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /analysis/cFSM/base_properties.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/analysis/cFSM/base_properties.m -------------------------------------------------------------------------------- /analysis/cFSM/classify.m: -------------------------------------------------------------------------------- 1 | function [clas]=classify(prop,node,elem,lengths,shapes,GBTcon,BC,m_all);%,clas_GDLO 2 | %MODAL CLASSIFICATION 3 | % 4 | 5 | % 6 | %input 7 | %prop: [matnum Ex Ey vx vy G] 6 x nmats 8 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 9 | %elem: [elem# nodei nodej t matnum] nelems x 5; 10 | %lengths: lengths to be analyzed 11 | %shapes: array of mode shapes dof x lengths x mode 12 | %method: 13 | % method=1=vector norm 14 | % method=2=strain energy norm 15 | % method=3=work norm 16 | % 17 | % 18 | %output 19 | %clas: array or % classification 20 | 21 | %BWS August 29, 2006 22 | %modified SA, Oct 10, 2006 23 | %Z.Li, June 2010 24 | 25 | wait_message=waitbar(0,'Performing Modal Classification'); %callback for cancel is at the end of strip 26 | % 27 | nnodes = length(node(:,1)); 28 | ndof_m= 4*nnodes; 29 | 30 | %CLEAN UP INPUT 31 | %clean up 0's, multiple terms. or out-of-order terms in m_all 32 | [m_all]=msort(m_all); 33 | 34 | %loop for the lengths 35 | nlengths = length(lengths); 36 | l=0; %length_index = one 37 | while l0 29 | nod1=m_node(m_elem(i,2),4); 30 | nod3=m_node(m_elem(i,3),4); 31 | x1 = node(nod1,2); x3 = node(nod3,2); 32 | z1 = node(nod1,3); z3 = node(nod3,3); 33 | bm = sqrt((x3-x1)^2+(z3-z1)^2); 34 | nnew1=node_prop(nod1,2); 35 | nnew3=node_prop(nod3,2); 36 | for j=1:m_elem(i,4) 37 | nod2=m_elem(i,(j+4)); 38 | x2 = node(nod2,2); 39 | z2 = node(nod2,3); 40 | bs = sqrt((x2-x1)^2+(z2-z1)^2); 41 | nnew2=node_prop(nod2,2); 42 | Rys((nnew2-nmno),nnew1)=(bm-bs)/bm; 43 | Rys((nnew2-nmno),nnew3)=bs/bm; 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /analysis/cFSM/create_Ks.m: -------------------------------------------------------------------------------- 1 | function [K,Kg]=create_Ks(m,node,elem,elprop,prop,a,BC); 2 | % 3 | %called from base_update, while only single longitudinal term m involved 4 | % 5 | %created on Aug 28, 2006, by S. Adany 6 | %modified on Jul 10, 2009 by Z. Li 7 | 8 | %MATRIX SIZES 9 | nnodes = length(node(:,1)); 10 | nelems = length(elem(:,1)); 11 | % 12 | %ZERO OUT THE GLOBAL MATRICES 13 | K=sparse(zeros(nnodes*4,nnodes*4)); 14 | Kg=sparse(zeros(nnodes*4,nnodes*4)); 15 | % 16 | %ASSEMBLE THE GLOBAL STIFFNESS MATRICES 17 | for i=1:nelems 18 | %Generate element stiffness matrix (k) in local coordinates 19 | t=elem(i,4); 20 | b=elprop(i,2); 21 | matnum=elem(i,5); 22 | row=find(matnum==prop(:,1)); 23 | Ex=prop(row,2); 24 | Ey=prop(row,3); 25 | vx=prop(row,4); 26 | vy=prop(row,5); 27 | G=prop(row,6); 28 | [k_l]=klocal_m(Ex,Ey,vx,vy,G,t,a,b,m,BC); 29 | %Generate geometric stiffness matrix (kg) in local coordinates 30 | Ty1=node(elem(i,2),8)*t; 31 | Ty2=node(elem(i,3),8)*t; 32 | [kg_l]=kglocal_m(a,b,m,Ty1,Ty2,BC); 33 | %Transform k and kg into global coordinates 34 | alpha=elprop(i,3); 35 | [k,kg]=trans_m(alpha,k_l,kg_l); 36 | %Add element contribution of k to full matrix K and kg to Kg 37 | nodei=elem(i,2); 38 | nodej=elem(i,3); 39 | [K,Kg]=assemble_m(K,Kg,k,kg,nodei,nodej,nnodes); 40 | end 41 | -------------------------------------------------------------------------------- /analysis/cFSM/kglocal_m.m: -------------------------------------------------------------------------------- 1 | function [kg]=kglocal_m(a,b,m,Ty1,Ty2,BC) 2 | 3 | %assemble local geometric stiffness matrix for a single longitudinal term m 4 | 5 | %created on Jul 10, 2009 by Z. Li 6 | 7 | %Generate geometric stiffness matrix (kg) in local coordinates 8 | % kg=sparse(zeros(8*m,8*m)); 9 | % 10 | kk=m; 11 | nn=m; 12 | gm_mp=zeros(4,4); 13 | z0=zeros(4,4); 14 | gf_mp=zeros(4,4); 15 | um=kk*pi; 16 | up=nn*pi; 17 | % 18 | [I1,I2,I3,I4,I5] = BC_I1_5(BC,kk,nn,a); 19 | % 20 | %asemble the matrix of gm_mp (symmetric membrane stability matrix) 21 | gm_mp(1,1)=b*(3*Ty1+Ty2)*I5/12; 22 | gm_mp(1,3)=b*(Ty1+Ty2)*I5/12; 23 | gm_mp(3,1)=gm_mp(1,3); 24 | gm_mp(2,2)=b*a^2*(3*Ty1+Ty2)*I4/12/um/up; 25 | gm_mp(2,4)=b*a^2*(Ty1+Ty2)*I4/12/um/up; 26 | gm_mp(4,2)=gm_mp(2,4); 27 | gm_mp(3,3)=b*(Ty1+3*Ty2)*I5/12; 28 | gm_mp(4,4)=b*a^2*(Ty1+3*Ty2)*I4/12/um/up; 29 | % 30 | %asemble the matrix of gf_mp (symmetric flexural stability matrix) 31 | gf_mp(1,1)=(10*Ty1+3*Ty2)*b*I5/35; 32 | gf_mp(1,2)=(15*Ty1+7*Ty2)*b^2*I5/210/2; 33 | gf_mp(2,1)=gf_mp(1,2); 34 | gf_mp(1,3)=9*(Ty1+Ty2)*b*I5/140; 35 | gf_mp(3,1)=gf_mp(1,3); 36 | gf_mp(1,4)=-(7*Ty1+6*Ty2)*b^2*I5/420; 37 | gf_mp(4,1)=gf_mp(1,4); 38 | gf_mp(2,2)=(5*Ty1+3*Ty2)*b^3*I5/2/420; 39 | gf_mp(2,3)=(6*Ty1+7*Ty2)*b^2*I5/420; 40 | gf_mp(3,2)=gf_mp(2,3); 41 | gf_mp(2,4)=-(Ty1+Ty2)*b^3*I5/140/2; 42 | gf_mp(4,2)=gf_mp(2,4); 43 | gf_mp(3,3)=(3*Ty1+10*Ty2)*b*I5/35; 44 | gf_mp(3,4)=-(7*Ty1+15*Ty2)*b^2*I5/420; 45 | gf_mp(4,3)=gf_mp(3,4); 46 | gf_mp(4,4)=(3*Ty1+5*Ty2)*b^3*I5/420/2; 47 | %assemble the membrane and flexural stiffness matrices 48 | kgmp=[gm_mp z0 49 | z0 gf_mp]; 50 | %add it into local geometric stiffness matrix by corresponding to m 51 | kg=kgmp; 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /analysis/cFSM/mode_class2.m: -------------------------------------------------------------------------------- 1 | function [GDLO_DirectSum,GDLO_WeightedFactor]=mode_class2(b_v,displ,ngm,ndm,nlm,hwn,ndof_m) 2 | % 3 | %to determine mode contribution in the current displacement 4 | % 5 | %input data 6 | % b_v - base vectors (each column corresponds to a certain mode) 7 | % columns 1..ngm: global modes 8 | % columns (ngm+1)..(ngm+ndm): dist. modes 9 | % columns (ngm+ndm+1)..(ngm+ndm+nlm): local modes 10 | % columns (ngm+ndm+nlm+1)..ndof: other modes 11 | % displ - vector of nodal displacements 12 | % ngm,ndm,nlm - number of global, distortional and local buckling modes, respectively 13 | % 14 | %output data 15 | % cl_gdlo - array with the contributions of the modes in percentage 16 | % elem1: global, elem2: dist, elem3: local, elem4: other 17 | % 18 | % S. Adany, Mar 10, 2004 19 | % 20 | % 21 | % b_v_m=b_v((ndof_m*(ml-1)+1):ndof_m*ml,(ndof_m*(ml-1)+1):ndof_m*ml); 22 | % ndof=length(b_v_m(:,1)); 23 | % 24 | %indices 25 | dofindex(1,1)=1; 26 | dofindex(1,2)=ngm; 27 | dofindex(2,1)=ngm+1; 28 | dofindex(2,2)=ngm+ndm; 29 | dofindex(3,1)=ngm+ndm+1; 30 | dofindex(3,2)=ngm+ndm+nlm; 31 | dofindex(4,1)=ngm+ndm+nlm+1; 32 | dofindex(4,2)=ndof_m; 33 | % 34 | 35 | %classification 36 | clas=b_v\displ; 37 | clas=abs(clas); 38 | totalm = length(hwn); %number of longitudinal terms m 39 | for i=1:4 40 | for j=1:totalm 41 | cl_gdlo(i,j)=sum(clas((j-1)*ndof_m+dofindex(i,1):(j-1)*ndof_m+dofindex(i,2))); 42 | end 43 | clas_gdlo(i)=sum(cl_gdlo(i,:)); 44 | end 45 | GDLO_DirectSum=clas_gdlo/sum(clas)*100; 46 | GDLO_WeightedFactor=0; -------------------------------------------------------------------------------- /analysis/cFSM/mode_constr.m: -------------------------------------------------------------------------------- 1 | function [Rx,Rz,Rp,Ryd,Rys,Rud]=mode_constr(node,elem,prop,node_prop,m_node,m_elem,DOFperm,m,a,BC) 2 | % 3 | %this routine creates the constraint matrices necessary for mode 4 | %separation/classification for each specified half-wave number m 5 | % 6 | %assumtions 7 | % GBT-like assumptions are used 8 | % the cross-section must not be closed and must not contain closed parts 9 | % 10 | % must check whether 'Warp' works well for any open section !!! 11 | % 12 | % 13 | %input/output data 14 | % node, elem, prop - same as elsewhere throughout this program 15 | % m_node [main nodes] - array of [nr, x, z, orig node nr, nr of adj meta-elems, m-el-1, m-el-2, ...] 16 | % m_elem [meta-elements] - array of [nr, main-node-1, main-node-2, nr of sub-nodes, sub-no-1, sub-nod-2, ...] 17 | % node_prop - array of [original node nr, new node nr, nr of adj elems, node type] 18 | % 19 | % 20 | %notes: 21 | % m-el-? is positive if the starting node of m-el-? coincides with 22 | % the given m-node, otherwise negative 23 | % node types: 1-corner, 2-edge, 3-sub 24 | % sub-node numbers are the original one, of course 25 | % 26 | % S. Adany, Mar 10, 2004 27 | % Z. Li, Jul 10, 2009 28 | 29 | %to create Rx and Rz constraint matrices 30 | [Rx,Rz]=constr_xz_y(m_node,m_elem); 31 | % 32 | %to create Rp constraint matrix for the rest of planar DOFs 33 | [Rp]=constr_planar_xz(node,elem,prop,node_prop,DOFperm,m,a,BC); 34 | % 35 | %to create Rys constraint matrix for the y DOFs of sub-nodes 36 | [Rys]=constr_ys_ym(node,m_node,m_elem,node_prop); 37 | % 38 | %to create Ryd for y DOFs of main nodes for distortional buckling 39 | [Ryd]=constr_yd_yg(node,elem,node_prop,Rys,length(m_node(:,1))); 40 | % 41 | %to create Rud for y DOFs of undefinite main nodes 42 | [Rud]=constr_yu_yd(m_node,m_elem); -------------------------------------------------------------------------------- /analysis/cFSM/mode_nr.m: -------------------------------------------------------------------------------- 1 | function [ndm,nlm]=mode_nr(nmno,ncno,nsno,m_node) 2 | % 3 | %this routine determines the number of distortional and local buckling modes 4 | % if GBT-like assumptions are used 5 | % 6 | % 7 | %input/output data 8 | % nmno, nsno - number of main nodes and sub_nodes, respectively 9 | % m_node [main nodes] - array of [nr, x, z, orig node nr, nr of adj meta-elems, m-el-1, m-el-2, ...] 10 | % ndm,nlm - number of distortional and local buckling modes, respectively 11 | % 12 | % S. Adany, Feb 09, 2004 13 | % 14 | % 15 | %to count the number of distortional modes 16 | ndm=nmno-4; 17 | for i=1:nmno 18 | if m_node(i,5)>2 19 | ndm=ndm-(m_node(i,5)-2); 20 | end 21 | end 22 | if ndm<0 23 | ndm=0; 24 | end 25 | % 26 | %to count the number of local modes 27 | neno=nmno-ncno; %nr of edge nodes 28 | nlm=nmno+2*nsno+neno; 29 | 30 | -------------------------------------------------------------------------------- /analysis/cFSM/mode_select.m: -------------------------------------------------------------------------------- 1 | function [b_v_red]=mode_select(b_v,ngm,ndm,nlm,if_g,if_d,if_l,if_o,ndof_m,m_a) 2 | % 3 | %this routine selects the required base vectors 4 | % b_v_red forms a reduced space for the calculation, including the 5 | % selected modes only 6 | % b_v_red itself is the final constraint matrix for the selected modes 7 | % 8 | % 9 | %input data 10 | % b_v - base vectors (each column corresponds to a certain mode) 11 | % columns 1..ngm: global modes 12 | % columns (ngm+1)..(ngm+ndm): dist. modes 13 | % columns (ngm+ndm+1)..(ngm+ndm+nlm): local modes 14 | % columns (ngm+ndm+nlm+1)..ndof: other modes 15 | % ngm,ndm,nlm - number of global, distortional and local buckling modes, respectively 16 | % if_g - indicator which global modes are selected 17 | % if_d - indicator which dist. modes are selected 18 | % if_l - indicator whether local modes are selected 19 | % if_o - indicator whether other modes are selected 20 | % ndof_m: 4*nnodes, total DOF for a singal longitudinal term 21 | 22 | %output data 23 | % b_v_red - reduced base vectors (each column corresponds to a certain mode) 24 | 25 | % 26 | %note: 27 | % for all if_* indicator: 1 if selected, 0 if eliminated 28 | % 29 | % 30 | % S. Adany, Mar 22, 2004 31 | % BWS May 2004 32 | % modifed on Jul 10, 2009 by Z. Li for general BC 33 | % Z. Li, June 2010 34 | 35 | totalm=length(m_a); 36 | for ml=1:totalm 37 | % b_v_m=b_v((ndof_m*(ml-1)+1):ndof_m*ml,(ndof_m*(ml-1)+1):ndof_m*ml); 38 | nom=ndof_m-ngm-ndm-nlm; %nr of other modes 39 | % 40 | nmo=0; 41 | for i=1:ngm 42 | if if_g(i)==1 43 | nmo=nmo+1; 44 | b_v_red_m(:,nmo)=b_v(:,ndof_m*(ml-1)+i); 45 | end 46 | end 47 | for i=1:ndm 48 | if if_d(i)==1 49 | nmo=nmo+1; 50 | b_v_red_m(:,nmo)=b_v(:,(ndof_m*(ml-1)+ngm+i)); 51 | end 52 | end 53 | % if if_l==1 54 | % b_v_red(:,(nmo+1):(nmo+nlm))=b_v(:,(ngm+ndm+1):(ngm+ndm+nlm)); 55 | % nmo=nmo+nlm; 56 | % end 57 | for i=1:nlm 58 | if if_l(i)==1 59 | nmo=nmo+1; 60 | b_v_red_m(:,nmo)=b_v(:,(ndof_m*(ml-1)+ngm+ndm+i)); 61 | end 62 | end 63 | for i=1:nom 64 | if if_o(i)==1 65 | nmo=nmo+1; 66 | b_v_red_m(:,nmo)=b_v(:,(ndof_m*(ml-1)+ngm+ndm+nlm+i)); 67 | end 68 | end 69 | % if if_o==1 70 | % nom=length(b_v(:,1))-ngm-ndm-nlm; %nr of other modes 71 | % b_v_red(:,(nmo+1):(nmo+nom))=b_v(:,(ngm+ndm+nlm+1):(ngm+ndm+nlm+nom)); 72 | % %b_v_red(:,(nmo+1))=b_v(:,(ngm+ndm+nlm+1)); 73 | % end 74 | b_v_red(:,(nmo*(ml-1)+1):nmo*ml)=b_v_red_m; 75 | end 76 | -------------------------------------------------------------------------------- /analysis/cFSM/node_class.m: -------------------------------------------------------------------------------- 1 | function [nmno,ncno,nsno]=node_class(node_prop) 2 | % 3 | %this routine determines how many nodes of the various types exist 4 | % 5 | %input/output data 6 | % node_prop - array of [original node nr, new node nr, nr of adj elems, node type] 7 | % nmno,ncno,nsno - number of main nodes, corner nodes and sub-nodes, respectively 8 | % 9 | %notes: 10 | % node types in node_prop: 1-corner, 2-edge, 3-sub 11 | % sub-node numbers are the original one, of course 12 | % 13 | % S. Adany, Feb 09, 2004 14 | % 15 | % 16 | %to count corner-, edge- and sub-nodes 17 | nno=length(node_prop(:,1)); 18 | ncno=0; 19 | neno=0; 20 | nsno=0; 21 | for i=1:nno 22 | if node_prop(i,4)==1 23 | ncno=ncno+1; 24 | end 25 | if node_prop(i,4)==2 26 | neno=neno+1; 27 | end 28 | if node_prop(i,4)==3 29 | nsno=nsno+1; 30 | end 31 | end 32 | nmno=ncno+neno; %nr of main nodes 33 | % 34 | -------------------------------------------------------------------------------- /analysis/cFSM/trans_m.m: -------------------------------------------------------------------------------- 1 | function [kglobal,kgglobal]=trans_m(alpha,k,kg) 2 | % 3 | % transfer the local stiffness into global stiffness 4 | 5 | %created on Jul 10, 2009 by Z. Li 6 | 7 | a=alpha; 8 | % 9 | z0=0; 10 | gamma=[cos(a) z0 z0 z0 -sin(a) z0 z0 z0 11 | z0 1 z0 z0 z0 z0 z0 z0 12 | z0 z0 cos(a) z0 z0 z0 -sin(a) z0 13 | z0 z0 z0 1 z0 z0 z0 z0 14 | sin(a) z0 z0 z0 cos(a) z0 z0 z0 15 | z0 z0 z0 z0 z0 1 z0 z0 16 | z0 z0 sin(a) z0 z0 z0 cos(a) z0 17 | z0 z0 z0 z0 z0 z0 z0 1 ]; 18 | %extend to multi-m 19 | % for i=1:m 20 | % gamma(8*(i-1)+1:8*i,8*(i-1)+1:8*i)=gam; 21 | % end 22 | % 23 | kglobal=gamma*k*gamma'; 24 | kgglobal=gamma*kg*gamma'; -------------------------------------------------------------------------------- /analysis/cFSM/trans_single.m: -------------------------------------------------------------------------------- 1 | function [kglobal]=trans_single(alpha,k) 2 | % 3 | %this routine make the local-to-global co-ordinate transformation 4 | %basically it does the same as routine 'trans', however: 5 | % it does not care about kg (geom stiff matrix) 6 | % onle involve one half-wave number m 7 | 8 | % S. Adany, Feb 06, 2004 9 | % Z. Li, Jul 10, 2009 10 | % 11 | c=cos(alpha); 12 | s=sin(alpha); 13 | % 14 | % 15 | gamma=[ c 0 0 0 -s 0 0 0 16 | 0 1 0 0 0 0 0 0 17 | 0 0 c 0 0 0 -s 0 18 | 0 0 0 1 0 0 0 0 19 | s 0 0 0 c 0 0 0 20 | 0 0 0 0 0 1 0 0 21 | 0 0 s 0 0 0 c 0 22 | 0 0 0 0 0 0 0 1 ]; 23 | % 24 | kglobal=gamma*k*gamma'; 25 | -------------------------------------------------------------------------------- /analysis/constr_BCFlag.m: -------------------------------------------------------------------------------- 1 | function [BCFlag]=constr_BCFlag(node,constraints) 2 | % 3 | % this subroutine is to determine flags for user constraints and internal (at node) B.C.'s 4 | 5 | %inputs: 6 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 7 | %constraints:: [node#e dofe coeff node#k dofk] e=dof to be eliminated k=kept dof dofe_node = coeff*dofk_nodek 8 | 9 | %Output: 10 | %BCFlag: 1 if there are user constraints or node fixities 11 | % 0 if there is no user constraints and node fixities 12 | 13 | % Z. Li, June 2010 14 | 15 | %Check for boundary conditions on the nodes 16 | nnodes = length(node(:,1)); 17 | BCFlag=0; 18 | for i=1:nnodes 19 | for j=4:7 20 | if node(i,j)==0 21 | BCFlag=1; 22 | return 23 | end 24 | end 25 | end 26 | %Check for user defined constraints too 27 | if (isempty(constraints)|constraints==0)&(BCFlag==0) 28 | BCFlag=0; 29 | else 30 | BCFlag=1; 31 | end -------------------------------------------------------------------------------- /analysis/doubler.m: -------------------------------------------------------------------------------- 1 | function [node_out,elem_out]=doubler(node,elem) 2 | %BWS 3 | %1998 (last modified) 4 | %A function to double the number of elements to help 5 | %out the discretization of the member somewhat. 6 | % 7 | %node=[node# x z dofx dofz dofy doftheta stress] 8 | %elem=[elem# nodei nodej thickness] 9 | % 10 | old_num_elem=length(elem(:,1)); 11 | old_num_node=length(node(:,1)); 12 | elem_out=zeros(2*old_num_elem,5); 13 | node_out=zeros(old_num_node+old_num_elem,8); 14 | % 15 | %For node_out set all the old numbers to odd numbers and fill in the 16 | %new ones with even numbers. 17 | for i=1:old_num_node 18 | node_out(2*i-1,:)=[2*node(i,1)-1 node(i,2:8)]; 19 | end 20 | % 21 | for i=1:old_num_elem 22 | elem_out(2*i-1,:)=[2*elem(i,1)-1 2*elem(i,2)-1 2*i elem(i,4) elem(i,5)]; 23 | elem_out(2*i,:)=[2*i 2*i 2*elem(i,3)-1 elem(i,4) elem(i,5)]; 24 | nnumi=elem(i,2); 25 | nnumj=elem(i,3); 26 | xcoord=mean([node(nnumi,2),node(nnumj,2)]); 27 | zcoord=mean([node(nnumi,3),node(nnumj,3)]); 28 | stress=mean([node(nnumi,8),node(nnumj,8)]); 29 | node_out(2*i,:)=[2*i xcoord zcoord node(nnumi,4:7) stress]; 30 | end 31 | % 32 | %remove 0 node_out entries which occur in multi-cell closed sections 33 | index=find(node_out(:,1)==0); %finds rows that lead with a zero node number 34 | node_out(index,:)=[] %deletes those rows 35 | 36 | -------------------------------------------------------------------------------- /analysis/elemprop.m: -------------------------------------------------------------------------------- 1 | function [elprop]=elemprop(node,elem,nnodes,nelems) 2 | %BWS 3 | %1998 (last modified) 4 | % 5 | %INPUT 6 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 7 | %elem: [elem# nodei nodej t] nelems x 4; 8 | %OUTPUT 9 | %elprop: [elem# width alpha] 10 | % 11 | elprop=zeros(nelems,3); 12 | % 13 | for i=1:nelems 14 | nodei = elem(i,2); 15 | nodej = elem(i,3); 16 | xi = node(nodei,2); 17 | zi = node(nodei,3); 18 | xj = node(nodej,2); 19 | zj = node(nodej,3); 20 | dx = xj - xi; 21 | dz = zj - zi; 22 | width = sqrt(dx^2 + dz^2); 23 | alpha = atan2(dz,dx); 24 | elprop(i,:)=[i width alpha]; 25 | end 26 | 27 | 28 | -------------------------------------------------------------------------------- /analysis/gammait.m: -------------------------------------------------------------------------------- 1 | function d=gammait(phi,dbar) 2 | %BWS 3 | %1998 (last modified) 4 | % 5 | %transform global coordinates into local coordinates 6 | p=phi; 7 | gamma=[cos(p) 0 0 0 -sin(p) 0 0 0 8 | 0 1 0 0 0 0 0 0 9 | 0 0 cos(p) 0 0 0 -sin(p) 0 10 | 0 0 0 1 0 0 0 0 11 | sin(p) 0 0 0 cos(p) 0 0 0 12 | 0 0 0 0 0 1 0 0 13 | 0 0 sin(p) 0 0 0 cos(p) 0 14 | 0 0 0 0 0 0 0 1 ]; 15 | d=gamma*dbar; -------------------------------------------------------------------------------- /analysis/gammait2.m: -------------------------------------------------------------------------------- 1 | function dlbar=gammait2(phi,dl) 2 | %BWS 3 | %1998 last modified 4 | %transform local disps into global dispa 5 | p=phi; 6 | %dl=gamma*dlbar so... 7 | gamma=[ cos(p) 0 -sin(p) 8 | 0 1 0 9 | sin(p) 0 cos(p)]; 10 | dlbar=inv(gamma)*dl; -------------------------------------------------------------------------------- /analysis/msort.m: -------------------------------------------------------------------------------- 1 | function [m_all]=msort(m_all); 2 | % 3 | %this routine is to clean up 0's, multiple longitudinal terms. or out-of-order terms in m_all 4 | 5 | %m_all: m_all{length#}=[longitudinal_num# ... longitudinal_num#],longitudinal terms m for all the lengths in cell notation 6 | % each cell has a vector including the longitudinal terms for this 7 | % length 8 | % Z. Li, June 2010 9 | 10 | nlengths=max(size(m_all)); 11 | for i=1:nlengths 12 | m_a=m_all{i}; 13 | m_a=unique(m_a); % remove repetive longitudinal terms 14 | m_a=nonzeros(m_a); %return all the nonzeros longitudinal terms in m_a as a column vector 15 | m_a=sort(m_a); % order the longitudinal terms 16 | m_all{i}=m_a'; 17 | end 18 | -------------------------------------------------------------------------------- /analysis/plastic/PMM_Plastic.asv: -------------------------------------------------------------------------------- 1 | function [M11_P,M22_P,P_P]=PMM_Plastic(fib,node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm,Ne,Deg) 2 | 3 | %%% Fiber element Model 4 | %%% ST March 2013 5 | %%% ST Modified March 2016 6 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7 | 8 | %GUI WAIT BAR FOR BUILDIG SURFACE 9 | wait_message=waitbar(0,'Building Plastic Surface','position',[150 300 384 68],... 10 | 'CreateCancelBtn',... 11 | 'setappdata(gcbf,''canceling'',1)'); 12 | setappdata(wait_message,'canceling',0) 13 | 14 | 15 | 16 | theta=Deg/180*pi; 17 | NF=length(fib); 18 | 19 | [Py,~,~,M11_y,M22_y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm); 20 | 21 | %%% Moving center to Centroid 22 | %fib:[fiber# x_f z_f A_f] 23 | 24 | fib(:,2)=fib(:,2)-xcg; 25 | fib(:,3)=fib(:,3)-zcg; 26 | 27 | %%% Rotating fibers to Principal Coordinate System 28 | 29 | R = [cos(-thetap/180*pi) -sin(-thetap/180*pi) ; sin(-thetap/180*pi) cos(-thetap/180*pi)]; 30 | 31 | fib_rot=fib; 32 | Dim_r=R*fib(:,2:3)'; 33 | fib_rot(:,2:3)=Dim_r'; 34 | fib=fib_rot; 35 | 36 | 37 | for k=1:length(theta) 38 | %info=['Angle ',num2str(lengths(l)),' done.']; 39 | waitbar(k/length(theta),wait_message); 40 | %%%Plastic N.A 41 | 42 | xmin=min(fib(:,2)); 43 | xmax=max(fib(:,2)); 44 | zmin=min(fib(:,3)); 45 | zmax=max(fib(:,3)); 46 | 47 | CP(1,2:3)=[xmin,zmin]; 48 | CP(2,2:3)=[xmin,zmax]; 49 | CP(3,2:3)=[xmax,zmin]; 50 | CP(4,2:3)=[xmax,zmax]; 51 | 52 | for i=1:4 53 | dCP(i)=(cos(theta(k))*CP(i,3)-sin(theta(k))*CP(i,2)); 54 | end 55 | 56 | emin=min(dCP)*1.02; 57 | emax=max(dCP)*1.02; 58 | r=max(abs(emin),abs(emax)); 59 | De=2*r/Ne; 60 | e=-r:De:r; 61 | 62 | M1(length(e),k)=0; 63 | M2(length(e),k)=0; 64 | P(length(e),k)=0; 65 | 66 | for i=1:length(e) 67 | M1(i,k)=0; 68 | M2(i,k)=0; 69 | P(i,k)=0; 70 | for j=1:NF 71 | 72 | CL=fib(j,3)*cos(theta(k))-fib(j,2)*sin(theta(k))-e(i); 73 | 74 | if CL>0 75 | fib(j,5)=-fib(j,4)*fy; 76 | elseif CL<0 77 | fib(j,5)=+fib(j,4)*fy; 78 | else 79 | fib(j,5)=0; 80 | end 81 | 82 | M1(i,k)=M1(i,k)-fib(j,5)*fib(j,3); 83 | M2(i,k)=M2(i,k)+fib(j,5)*fib(j,2); 84 | P(i,k)=P(i,k)+fib(j,5); 85 | 86 | end 87 | end 88 | 89 | 90 | end 91 | 92 | if ishandle(wait_message) 93 | delete(wait_message); 94 | end 95 | 96 | M11_P=M1/M11_y; 97 | M22_P=M2/M22_y; 98 | P_P=P/Py; 99 | 100 | 101 | end 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /analysis/plastic/fiber4elem.m: -------------------------------------------------------------------------------- 1 | function [fib] = fiber4elem(node,elem,nfiber) 2 | %BWS dummy function for fiber maker routine 3 | %input 4 | %node,elem standard CUFSM inputs 5 | %fiber column vector the length of elem that defines number of through 6 | %thickness sections (fibers) for the fiber element calculator 7 | % 8 | %output 9 | %elem_fiber 10 | %elem(:,1:5)-standard definition 11 | %elem(:,6)-fibers through the thickness in the given element 12 | %ST 2016 13 | 14 | elem(:,6)=nfiber; 15 | 16 | [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem); 17 | 18 | 19 | k=1; 20 | NEM=max(elem(:,1)); 21 | NNM=max(node(:,1)); 22 | 23 | for i=1:length(elem(:,1)) 24 | x1=node(elem(i,2),2); 25 | z1=node(elem(i,2),3); 26 | x2=node(elem(i,3),2); 27 | z2=node(elem(i,3),3); 28 | elem(i,7)=pi-atan2((z2-z1),(x2-x1)); 29 | 30 | Istart=find(node(:,1)==elem(i,2)); 31 | Iend=find(node(:,1)==elem(i,3)); 32 | elem(i,8)=(node(Istart,2)+node(Iend,2))/2; 33 | elem(i,9)=(node(Istart,3)+node(Iend,3))/2; 34 | elem(i,10)=((node(Istart,2)-node(Iend,2))^2+(node(Istart,3)-node(Iend,3))^2)^0.5; 35 | k=k+1; 36 | end 37 | 38 | k=1; 39 | NE=length(elem(:,1)); 40 | for i=1:NE 41 | for j=1:elem(i,6) 42 | 43 | NL=elem(i,6); 44 | 45 | if NL~=1 46 | if j==1; 47 | fib_g(j,1)=-elem(i,4)/2+elem(i,4)/NL/2; 48 | fib_g(j,2)=0; 49 | else 50 | fib_g(j,1)=fib_g(j-1,1)+elem(i,4)/NL; 51 | fib_g(j,2)=0; 52 | end 53 | else 54 | fib_g(1,1)=0; 55 | fib_g(1,2)=0; 56 | end 57 | end 58 | 59 | R = [cos(elem(i,7)+pi/2) -sin(elem(i,7)+pi/2) ; sin(elem(i,7)+pi/2) cos(elem(i,7)+pi/2)]; 60 | 61 | fib_rot=fib_g(:,:)*R; 62 | fib(((i-1)*NL+1):(i*NL),1)=((i-1)*NL+1):(i*NL); 63 | fib(((i-1)*NL+1):(i*NL),2:3)=fib_rot+ones(NL,1)*elem(i,8:9); 64 | fib(((i-1)*NL+1):(i*NL),4)=elem(i,10)*elem(i,4)/NL; 65 | end 66 | 67 | %%% Moving Center to Centroid 68 | %fib:[fiber# x_f z_f A_f] 69 | 70 | % fib(:,2)=fib(:,2)-xcg; 71 | % fib(:,3)=fib(:,3)-zcg; 72 | 73 | 74 | %%% Rotating fibers to Principal Coordinate System 75 | %fib:[fiber# x_f z_f A_f] 76 | 77 | % R = [cos(-thetap/180*pi) -sin(-thetap/180*pi) ; sin(-thetap/180*pi) cos(-thetap/180*pi)]; 78 | % fib_rot=fib; 79 | % Dim_r=R*fib(:,2:3)'; 80 | % fib_rot(:,2:3)=Dim_r'; 81 | % fib=fib_c_rot; 82 | 83 | 84 | end -------------------------------------------------------------------------------- /analysis/shapef.m: -------------------------------------------------------------------------------- 1 | function dl=shapef(links,d,b); 2 | %BWS 3 | %1998 4 | % 5 | %links: the number of additional line segments used to show the disp shape 6 | %d: the vector of nodal displacements 7 | %b: the actual length of the element 8 | % 9 | inc=1/links; 10 | xb=(inc:inc:1-inc); %location of additional displacements 11 | for i=1:length(xb) 12 | N1=(1-3*xb(i)^2+2*xb(i)^3); 13 | N2=xb(i)*b*(1-2*xb(i)+xb(i)^2); 14 | N3=3*xb(i)^2-2*xb(i)^3; 15 | N4=xb(i)*b*(xb(i)^2-xb(i)); 16 | N=[(1-xb(i)) 0 xb(i) 0 0 0 0 0 17 | 0 (1-xb(i)) 0 xb(i) 0 0 0 0 18 | 0 0 0 0 N1 N2 N3 N4]; 19 | dl(:,i)=N*d; 20 | end -------------------------------------------------------------------------------- /analysis/spring_klocal.m: -------------------------------------------------------------------------------- 1 | function [k]=spring_klocal(ku,kv,kw,kq,a,BC,m_a,discrete,ys) 2 | % 3 | %Generate spring stiffness matrix (k) in local coordinates, modified from 4 | %klocal 5 | %BWS DEC 2015 6 | 7 | % Inputs: 8 | % ku,kv,kw,kq spring stiffness values 9 | % a: length of the strip in longitudinal direction 10 | % BC: ['S-S'] a string specifying boundary conditions to be analyzed: 11 | %'S-S' simply-pimply supported boundary condition at loaded edges 12 | %'C-C' clamped-clamped boundary condition at loaded edges 13 | %'S-C' simply-clamped supported boundary condition at loaded edges 14 | %'C-F' clamped-free supported boundary condition at loaded edges 15 | %'C-G' clamped-guided supported boundary condition at loaded edges 16 | % m_a: longitudinal terms (or half-wave numbers) for this length 17 | % discrete == 1 if discrete spring 18 | % ys = location of discrete spring 19 | 20 | % Output: 21 | % k: local stiffness matrix, a totalm x totalm matrix of 8 by 8 submatrices. 22 | % k=[kmp]totalm x totalm block matrix 23 | % each kmp is the 8 x 8 submatrix in the DOF order [u1 v1 u2 v2 w1 theta1 w2 theta2]'; 24 | 25 | % 26 | totalm = length(m_a); %Total number of longitudinal terms m 27 | % 28 | k=sparse(zeros(8*totalm,8*totalm)); 29 | z0=zeros(4,4); 30 | for m=1:1:totalm 31 | for p=1:1:totalm 32 | % 33 | km_mp=zeros(4,4); 34 | kf_mp=zeros(4,4); 35 | um=m_a(m)*pi; 36 | up=m_a(p)*pi; 37 | % 38 | if discrete 39 | [I1,I5] = BC_I1_5_atpoint(BC,m_a(m),m_a(p),a,ys); 40 | else %foundation spring 41 | [I1,I2,I3,I4,I5] = BC_I1_5(BC,m_a(m),m_a(p),a); 42 | end 43 | % 44 | %asemble the matrix of km_mp 45 | km_mp=[ ku*I1 0 -ku*I1 0 46 | 0 kv*I5*a^2/(um*up) 0 -kv*I5*a^2/(um*up) 47 | -ku*I1 0 ku*I1 0 48 | 0 -kv*I5*a^2/(um*up) 0 kv*I5*a^2/(um*up)]; 49 | % 50 | %asemble the matrix of kf_mp 51 | kf_mp=[ kw*I1 0 -kw*I1 0 52 | 0 kq*I1 0 -kq*I1 53 | -kw*I1 0 kw*I1 0 54 | 0 -kq*I1 0 kq*I1]; 55 | %assemble the membrane and flexural stiffness matrices 56 | kmp=[km_mp z0 57 | z0 kf_mp]; 58 | 59 | %add it into local element stiffness matrix by corresponding to m 60 | k(8*(m-1)+1:8*m,8*(p-1)+1:8*p)=kmp; 61 | end 62 | end 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /analysis/spring_trans.m: -------------------------------------------------------------------------------- 1 | function [ksglobal]=spring_trans(alpha,ks,m_a) 2 | % 3 | % Transfer the local stiffness into global stiffness 4 | % Zhanjie 2008 5 | % modified by Z. Li, Aug. 09, 2009 6 | % adapted for spring Dec 2015 7 | 8 | totalm = length(m_a); %Total number of longitudinal terms m 9 | a=alpha; 10 | % 11 | z0=0; 12 | gam=[cos(a) z0 z0 z0 -sin(a) z0 z0 z0 13 | z0 1 z0 z0 z0 z0 z0 z0 14 | z0 z0 cos(a) z0 z0 z0 -sin(a) z0 15 | z0 z0 z0 1 z0 z0 z0 z0 16 | sin(a) z0 z0 z0 cos(a) z0 z0 z0 17 | z0 z0 z0 z0 z0 1 z0 z0 18 | z0 z0 sin(a) z0 z0 z0 cos(a) z0 19 | z0 z0 z0 z0 z0 z0 z0 1 ]; 20 | %extend to multi-m 21 | for i=1:totalm 22 | gamma(8*(i-1)+1:8*i,8*(i-1)+1:8*i)=gam; 23 | end 24 | % 25 | ksglobal=gamma*ks*gamma'; 26 | -------------------------------------------------------------------------------- /analysis/stresgen.m: -------------------------------------------------------------------------------- 1 | function [node]=stresgen(node,P,Mxx,Mzz,M11,M22,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm) 2 | %BWS 3 | %1998 4 | if unsymm==0 5 | Ixz=0; 6 | end 7 | stress=zeros(length(node(:,1)),1); 8 | stress=stress+P/A; 9 | stress=stress-((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg))/(Izz*Ixx-Ixz^2); 10 | th=thetap*pi/180; 11 | prin_coord=inv([cos(th) -sin(th) ; sin(th) cos(th)])*[(node(:,2)-xcg)' ; (node(:,3)-zcg)']; 12 | stress=stress-M11*prin_coord(2,:)'/I11; 13 | stress=stress-M22*prin_coord(1,:)'/I22; 14 | node(:,8)=stress; -------------------------------------------------------------------------------- /analysis/trans.m: -------------------------------------------------------------------------------- 1 | function [kglobal,kgglobal]=trans(alpha,k,kg,m_a) 2 | % 3 | % Transfer the local stiffness into global stiffness 4 | % Zhanjie 2008 5 | % modified by Z. Li, Aug. 09, 2009 6 | 7 | totalm = length(m_a); %Total number of longitudinal terms m 8 | a=alpha; 9 | % 10 | z0=0; 11 | gam=[cos(a) z0 z0 z0 -sin(a) z0 z0 z0 12 | z0 1 z0 z0 z0 z0 z0 z0 13 | z0 z0 cos(a) z0 z0 z0 -sin(a) z0 14 | z0 z0 z0 1 z0 z0 z0 z0 15 | sin(a) z0 z0 z0 cos(a) z0 z0 z0 16 | z0 z0 z0 z0 z0 1 z0 z0 17 | z0 z0 sin(a) z0 z0 z0 cos(a) z0 18 | z0 z0 z0 z0 z0 z0 z0 1 ]; 19 | %extend to multi-m 20 | for i=1:totalm 21 | gamma(8*(i-1)+1:8*i,8*(i-1)+1:8*i)=gam; 22 | end 23 | % 24 | kglobal=gamma*k*gamma'; 25 | kgglobal=gamma*kg*gamma'; -------------------------------------------------------------------------------- /analysis/vectorized/trans_vec.m: -------------------------------------------------------------------------------- 1 | function [kglobal,kgglobal]=trans_vec(x1,z1,x2,z2,k,kg,m_a) 2 | % 3 | % Transfer the local stiffness into global stiffness 4 | % Modefied by Sheng Jin, Jan. 2024 5 | 6 | totalm = length(m_a); %Total number of longitudinal terms m 7 | dz=z2-z1; 8 | dx=x2-x1; 9 | b=sqrt(dx^2+dz^2); 10 | sinAlpha=dz/b; 11 | cosAlpha=dx/b; 12 | 13 | % 14 | %t_Mat=[cosAlpha 0 0 0 sinAlpha 0 0 0 15 | % 0 1 0 0 0 0 0 0 16 | % 0 0 cosAlpha 0 0 0 sinAlpha 0 17 | % 0 0 0 1 0 0 0 0 18 | % -sinAlpha 0 0 0 cosAlpha 0 0 0 19 | % 0 0 0 0 0 1 0 0 20 | % 0 0 -sinAlpha 0 0 0 cosAlpha 0 21 | % 0 0 0 0 0 0 0 1 ]; 22 | % 23 | % %extend to multi-m 24 | % T_Mat=repmat(sparse(t_Mat),totalm,totalm); 25 | T_Mat=eye(8*totalm); 26 | T_Mat(sub2ind([totalm*8,totalm*8],1:2:totalm*8,1:2:totalm*8))=cosAlpha; 27 | T_Mat(sub2ind([totalm*8,totalm*8],(1:8:totalm*8)+[4;6],(1:8:totalm*8)+[0;2]))=-sinAlpha; 28 | T_Mat(sub2ind([totalm*8,totalm*8],(1:8:totalm*8)+[0;2],(1:8:totalm*8)+[4;6]))=sinAlpha; 29 | T_Mat=sparse(T_Mat); 30 | % 31 | kglobal=T_Mat'*k*T_Mat; 32 | kgglobal=T_Mat'*kg*T_Mat; 33 | 34 | -------------------------------------------------------------------------------- /analysis/yieldMP.m: -------------------------------------------------------------------------------- 1 | function [Py,Mxx_y,Mzz_y,M11_y,M22_y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,... 2 | I11,I22,unsymm) 3 | %BWS 4 | %August 2000 5 | %[Py,Mxx_y,Mzz_y,M11_y,M22_y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm) 6 | % 7 | % 8 | %Py 9 | Py=fy*A; 10 | % 11 | %account for the possibility of restrained bending vs. unrestrained bending 12 | if unsymm==0 13 | Ixz=0; 14 | end 15 | %Mxx_y 16 | %calculate stress at every point based on Mxx=1 17 | Mxx=1;, Mzz=0; 18 | stress=((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg)) / (Izz*Ixx-Ixz^2); 19 | factor=fy/max(abs(stress)); 20 | Mxx_y=factor*Mxx; 21 | %Mzz_y 22 | %calculate stress at every point based on Mxx=1 23 | Mxx=0;, Mzz=1; 24 | stress=((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg)) / (Izz*Ixx-Ixz^2); 25 | factor=fy/max(abs(stress)); 26 | Mzz_y=factor*Mzz; 27 | % 28 | %M11_y, M22_y 29 | %transform coordinates of nodes into principal coordinates 30 | th=thetap*pi/180; 31 | prin_coord=inv([cos(th) -sin(th) ; sin(th) cos(th)])*[(node(:,2)-xcg)' ; (node(:,3)-zcg)']; 32 | % 33 | M11=1; 34 | stress=M11*prin_coord(2,:)'/I11; 35 | factor=fy/max(abs(stress)); 36 | M11_y=factor*M11; 37 | % 38 | M22=1; 39 | stress=M22*prin_coord(1,:)'/I22; 40 | factor=fy/max(abs(stress)); 41 | M22_y=factor*M22; 42 | 43 | -------------------------------------------------------------------------------- /compiled/mac standalone app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/.DS_Store -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | setup 9 | CFBundleIconFile 10 | installer.icns 11 | CFBundleIdentifier 12 | com.mathworks.toolbox.compiler.setup 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | 11.0 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | mathworks.com 30 | 31 | NSIncludesSubdomains 32 | 33 | NSThirdPartyExceptionRequiresForwardSecrecy 34 | 35 | 36 | 37 | 38 | NSMainNibFile 39 | MainMenu 40 | NSPrincipalClass 41 | NSApplication 42 | 43 | 44 | -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/MacOS/setup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/MacOS/setup -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/MacOS/setup.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.mathworks.toolbox.compiler.setup 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/MacOS/setup.dSYM/Contents/Resources/DWARF/setup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/MacOS/setup.dSYM/Contents/Resources/DWARF/setup -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/bundle.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/bundle.zip -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/en.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/en.lproj/MainMenu.nib -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/installAgentURL.txt: -------------------------------------------------------------------------------- 1 | https://ssd.mathworks.com/supportfiles/downloads/R2023b/Release/5/deployment_files/installagent/complete/maci64/InstallAgent_R2023b_Update_5_maci64.zip -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/installer.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/installer.icns -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_mac_install.app/Contents/Resources/splash.png -------------------------------------------------------------------------------- /compiled/mac standalone app/CUFSM505_matlab_install.mlappinstall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/compiled/mac standalone app/CUFSM505_matlab_install.mlappinstall -------------------------------------------------------------------------------- /cutwp/fromcufsm.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/cutwp/fromcufsm.mat -------------------------------------------------------------------------------- /cutwp/imcutwp.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/cutwp/imcutwp.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/dsm guide jan 2006 FINAL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/dsm guide jan 2006 FINAL.pdf -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/Cwlip_Mx.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/Cwlip_Mx.eps -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/Cwlip_P.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/Cwlip_P.eps -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/anolip.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/anolip.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/anolip_Mxr.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/anolip_Mxr.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/anolip_P.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/anolip_P.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/anolip_P_global.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/anolip_P_global.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr_andpin.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr_andpin.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr_mathcad.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip_Mxr_mathcad.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip_P.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip_P.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/awlip_m22.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/awlip_m22.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip_Pstress.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip_Pstress.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip_Pstress_warpfix.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/builtupcwlip_Pstress_warpfix.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_Mx.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_Mx.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_My.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_My.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_My2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_My2.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_P.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_P.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_beamcolpic.m: -------------------------------------------------------------------------------- 1 | %BWS 2 | %June 2005 3 | % 4 | clear all 5 | close all 6 | % 7 | Py=14.91; 8 | Pcrl=0.37*Py; 9 | Pcre=0.408*Py; 10 | Pn=4.58; 11 | % 12 | My=1.69; 13 | Mcrl=2.31*My; 14 | Mcre=3.24*My; 15 | Mn=1.69; 16 | % 17 | Pu=2.8; 18 | Mu=0.59; 19 | theta=atan2(Pu/Py,Mu/My); 20 | b=sqrt((Pu/Py)^2+(Mu/My)^2); 21 | by=33/17.7485*b; 22 | bcrl=2.35*b; 23 | bcre=2.21*b; 24 | bn=0.53;% 25 | % 26 | plot(0,Py/Py,'.') 27 | %text(0,Py/Py,'P_y/P_y') 28 | hold on 29 | plot(0,Pcrl/Py,'.') 30 | text(0,Pcrl/Py,'P_{crl}/P_y') 31 | plot(0,Pcre/Py,'.') 32 | text(0,Pcre/Py,'P_{cre}/P_y') 33 | plot(0,Pn/Py,'.') 34 | text(0,Pn/Py,'P_{n}/P_y') 35 | plot(0,0.8*Pn/Py,'.') 36 | text(0,0.8*Pn/Py,'\phiP_{n}/P_y') 37 | % 38 | plot(My/My,0,'.') 39 | %text(My/My,0,'M_y/M_y') 40 | plot(Mcrl/My,0,'.') 41 | text(Mcrl/My,0,'M_{crl}/M_y') 42 | plot(Mcre/My,0,'.') 43 | text(Mcre/My,0,'M_{cre}/M_y') 44 | plot(Mn/My,0,'.') 45 | text(Mn/My,0,'M_{n}/M_y') 46 | plot(0.8*Mn/My,0,'.') 47 | text(0.8*Mn/My,0,'\phiM_{n}/M_y') 48 | % 49 | h2=plot(Mu/My,Pu/Py,'ro'); 50 | h1=plot([0 0.8*Mn/My],[0.8*Pn/Py 0],'-') 51 | h3=plot([0 1],[1 0],':') 52 | legend([h3,h1,h2],'yield','interaction diagram \phi=0.8','demand') 53 | % 54 | c=cos(theta); 55 | s=sin(theta); 56 | %plot(b*c,b*s,'.') 57 | plot(bcrl*c,bcrl*s,'.') 58 | text(bcrl*c,bcrl*s,'\beta_{crl}') 59 | plot(bcre*c,bcre*s,'.') 60 | text(bcre*c,bcre*s,'\beta_{cre}') 61 | plot(by*c,by*s,'.') 62 | text(by*c,by*s,'\beta_{y}') 63 | plot(bn*c,bn*s,'.') 64 | text(bn*c,bn*s,'\beta_{n}') 65 | plot(0.8*bn*c,0.8*bn*s,'.') 66 | text(0.8*bn*c,0.8*bn*s,'\phi\beta_{n}') 67 | % 68 | %axis('equal') 69 | axis([0 1 0 1]) 70 | xlabel('M/M_y (weak axis)') 71 | ylabel('P/P_y') 72 | % 73 | hold off 74 | -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_halfMP.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_halfMP.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_halfMPrevised.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_halfMPrevised.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_Mx.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_Mx.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_My.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_My.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_P.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cnolip_modified_P.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cufsm2p5_default_badcurve.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cufsm2p5_default_badcurve.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_Mx.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_Mx.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_Mx_matchad.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_Mx_matchad.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_Mx_post.m: -------------------------------------------------------------------------------- 1 | %BWS 2 | %May 2005 3 | %Post-processing an analysis 4 | % 5 | clear all 6 | close all 7 | % 8 | currentlocation=['c:\ben\cufsm\cufsm_working\cufsm3\source']; 9 | addpath([currentlocation]); 10 | addpath([currentlocation,'\analysis']); 11 | addpath([currentlocation,'\analysis\GBTconstraints']); 12 | addpath([currentlocation,'\helpers']); 13 | addpath([currentlocation,'\interface']); 14 | addpath([currentlocation,'\plotters']); 15 | % 16 | %minimum inputs 17 | load cwlip_mx 18 | Fy=55; 19 | b=9; 20 | length_index_plotted=[23 46 76] 21 | label=['C-section (AISI 2002 Ex. I-08)']; 22 | % 23 | %Figures 24 | figure(1) 25 | semilogx(curve(:,1),curve(:,2),'k.-') 26 | axis([1 1000 0 1.6]) 27 | hold on,plot([b b],[0.6 1],'k:'),hold off 28 | xlabel('half-wavelength (in.)') 29 | ylabel('M_{cr} / M_y ') 30 | hold on 31 | semilogx(curve(length_index_plotted,1),curve(length_index_plotted,2),'o') 32 | hold off 33 | %embelish the plot a bit with the cross-section 34 | scale=1; 35 | [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem); 36 | unsymm=0; 37 | [Py,Mxx_y,Mzz_y,M11_y,M22_y]=yieldMP(node,Fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm) 38 | %flags:[node# element# mat# stress# stresspic coord constraints springs origin] 1 means show 39 | flags=[0 0 0 0 0 0 1 1 1]; %these flags control what is plotted, node#, elem# 40 | axesnum=axes('Units','normalized','Position',[0.2 0.6 0.25 0.25],'visible','off'); 41 | strespic(node,elem,axesnum,scale) 42 | %crossect(node,elem,axesnum,springs,constraints,flags) 43 | %propplot(node,elem,xcg,zcg,thetap,axesnum) 44 | title(label) 45 | text(1,b/2,['M_y=',num2str(Mxx_y,'%4.2f'),'kip-in.']); 46 | % 47 | %and with the mode shapes 48 | scale=1; 49 | modeindex=1; 50 | undefv=1; 51 | scale=1; 52 | springs=0; 53 | %local 54 | axesshape=axes('Units','normalized','Position',[0.12 0.13 0.25 0.25],'visible','off'); 55 | scale=1; 56 | lengthindex=length_index_plotted(1); 57 | dispshap(undefv,node,elem,shapes(:,lengthindex,modeindex),axesshape,scale,springs); 58 | title(['Local M_{cr}/M_y=',num2str(curve(lengthindex,2),'%2.2f')]) 59 | %distortional 60 | axesshape=axes('Units','normalized','Position',[0.39 0.13 0.25 0.25],'visible','off'); 61 | scale=1; 62 | lengthindex=length_index_plotted(2); 63 | dispshap(undefv,node,elem,shapes(:,lengthindex,modeindex),axesshape,scale,springs); 64 | title(['Distortional M_{cr}/M_y=',num2str(curve(lengthindex,2),'%2.2f')]) 65 | %LTB 66 | axesshape=axes('Units','normalized','Position',[0.68 0.2 0.25 0.25],'visible','off'); 67 | scale=-1; 68 | lengthindex=length_index_plotted(3); 69 | dispshap(undefv,node,elem,shapes(:,lengthindex,modeindex),axesshape,scale,springs); 70 | title('Lateral-torsional') 71 | %title(['Lateral-torsional M_{cr}/M_y=',num2str(curve(lengthindex,2),'%2.2f')]) 72 | 73 | 74 | -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_P.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_P.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_P_mathcad.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_P_mathcad.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_P_pinned_corners.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_P_pinned_corners.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_Pstress.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip_Pstress.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip__modified_P_mathcad.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/examples/2006_dsm_design_guide/files_and_scripts/cwlip__modified_P_mathcad.mat -------------------------------------------------------------------------------- /examples/2006_dsm_design_guide/files_and_scripts/cwlip_beamchart.m: -------------------------------------------------------------------------------- 1 | %BWS 2 | %5 August 2004 3 | %Beam Chart Creation 4 | % 5 | %Load results file 6 | load cwlip_Mx 7 | % 8 | %Elastic buckling results 9 | %half-wavelngth (in.) 10 | L=curve(:,1,1); 11 | %buckling load factor Mcr/My 12 | LF=curve(:,2,1); 13 | % 14 | %section 15 | My=126.55; %kip-in 16 | % 17 | %LOCAL BUCKLING 18 | %ignore any dependency of local buckling on length 19 | for i=1:length(L) 20 | Mcrl_My(i,1)=LF(23); 21 | end 22 | % 23 | %DISTORTIONAL BUCKLING 24 | Mcrd_My_star=LF(46); 25 | Lcrd=L(46); 26 | for i=1:length(L) 27 | if L(i) i1-----------------j2 21 | %Find element 1 which calls the lost node at its jth end 22 | elem1_row=find(elem(:,3)==lost_node); 23 | %Find element 2 which calls the lost node at its ith end 24 | elem2_row=find(elem(:,2)==lost_node); 25 | %Change element 1 into its new element by changing its jth node 26 | elem(elem1_row,3)=elem(elem2_row,3); 27 | %Remove the offending row 28 | elem(elem2_row,:)=[]; 29 | %Remove the offending node 30 | node(find(node(:,1)==lost_node),:)=[]; 31 | %Call the function renumbernodes to clean things up 32 | [node,elem]=renumbernodes(node,elem); 33 | % 34 | node_out=node; 35 | elem_out=elem; 36 | 37 | -------------------------------------------------------------------------------- /helpers/divide_one.m: -------------------------------------------------------------------------------- 1 | function [node_out,elem_out]=divide_one(divide_me,at_location,node,elem) 2 | % 3 | %Function to divide 1 element into 2 elements at a given location 4 | %3 December 2002, BWS 5 | % 6 | %node=[node# x z dofx dofz dofy doftheta stress] 7 | %elem=[elem# nodei nodej thickness mat#] 8 | %divide_me=element to be divided 9 | %at_location=number between 0 and 1 along the length 10 | % 11 | %error checking 12 | if at_location>=1|at_location<=0 13 | at_location=0.5 14 | end 15 | if max(divide_me==elem(:,1)) %implies there is a match for the divided element 16 | %ok 17 | else 18 | node_out=node; 19 | elem_out=elem; 20 | return 21 | end 22 | 23 | %FIRST THE NODE 24 | %nodes i and k are the nodes of element divide_me 25 | ni=elem(divide_me,2); 26 | nix=node(find(node(:,1)==ni),2); 27 | niz=node(find(node(:,1)==ni),3); 28 | nidof=node(find(node(:,1)==ni),4:7); 29 | nistress=node(find(node(:,1)==ni),8); 30 | nk=elem(divide_me,3); 31 | nkx=node(find(node(:,1)==nk),2); 32 | nkz=node(find(node(:,1)==nk),3); 33 | nkdof=node(find(node(:,1)==nk),4:7); 34 | nkstress=node(find(node(:,1)==nk),8); 35 | %now the new node j 36 | nj=nk; %we will renumber k and all subsequent nodes by +1 37 | njx=nix+at_location*(nkx-nix); 38 | njz=niz+at_location*(nkz-niz); 39 | njdof=nkdof; 40 | njstress=nistress+at_location*(nkstress-nistress); 41 | %for all nodes with numbers greater than or equal to nk add 1 42 | node(find(node(:,1)>=nk),1)=node(find(node(:,1)>=nk),1)+1; 43 | %assign the new node 44 | node(length(node(:,1))+1,:)=[nj njx njz njdof njstress]; 45 | %sort 46 | node=sortrows(node,1); 47 | % 48 | %NOW ON TO THE ELEMENT 49 | %for all elements with numbers greater than divide_me add 1 50 | elem(find(elem(:,1)>divide_me),1)=elem(find(elem(:,1)>divide_me),1)+1; 51 | %for all nodes with numbers greater than or equal to nk add 1 52 | elem(find(elem(:,2)>=nk),2)=elem(find(elem(:,2)>=nk),2)+1; 53 | elem(find(elem(:,3)>=nk),3)=elem(find(elem(:,3)>=nk),3)+1; 54 | %cleanup the old element 55 | elem(find(elem(:,1)==divide_me),:)=[divide_me ni nj elem(find(elem(:,1)==divide_me),4:5)]; 56 | %add the new element 57 | elem(length(elem(:,1))+1,:)=[divide_me+1 nj nj+1 elem(find(elem(:,1)==divide_me),4:5)]; 58 | %sort 59 | elem=sortrows(elem,1); 60 | % 61 | node_out=node; 62 | elem_out=elem; 63 | 64 | -------------------------------------------------------------------------------- /helpers/doubler.m: -------------------------------------------------------------------------------- 1 | function [node_out,elem_out]=doubler(node,elem); 2 | %BWS 3 | %1998 (last modified) 4 | %A function to double the number of elements to help 5 | %out the discretization of the member somewhat. 6 | % 7 | %node=[node# x z dofx dofz dofy doftheta stress] 8 | %elem=[elem# nodei nodej thickness] 9 | % 10 | old_num_elem=length(elem(:,1)); 11 | old_num_node=length(node(:,1)); 12 | elem_out=zeros(2*old_num_elem,5); 13 | node_out=zeros(old_num_node+old_num_elem,8); 14 | % 15 | %For node_out set all the old numbers to odd numbers and fill in the 16 | %new ones with even numbers. 17 | for i=1:old_num_node 18 | node_out(2*i-1,:)=[2*node(i,1)-1 node(i,2:8)]; 19 | end 20 | % 21 | for i=1:old_num_elem 22 | elem_out(2*i-1,:)=[2*elem(i,1)-1 2*elem(i,2)-1 2*i elem(i,4) elem(i,5)]; 23 | elem_out(2*i,:)=[2*i 2*i 2*elem(i,3)-1 elem(i,4) elem(i,5)]; 24 | nnumi=elem(i,2); 25 | nnumj=elem(i,3); 26 | xcoord=mean([node(nnumi,2),node(nnumj,2)]); 27 | zcoord=mean([node(nnumi,3),node(nnumj,3)]); 28 | stress=mean([node(nnumi,8),node(nnumj,8)]); 29 | node_out(2*i,:)=[2*i xcoord zcoord node(nnumi,4:7) stress]; 30 | end 31 | % 32 | %remove 0 node_out entries which occur in multi-cell closed sections 33 | index=find(node_out(:,1)==0); %finds rows that lead with a zero node number 34 | node_out(index,:)=[]; %deletes those rows 35 | 36 | -------------------------------------------------------------------------------- /helpers/dup_model.m: -------------------------------------------------------------------------------- 1 | function [nodeo,elemo]=dup_model(mz,mx,x,z,q,node,elem); 2 | % 3 | %Function to duplicate the entire model 4 | %26 October 2015 5 | % 6 | %node=[node# x z dofx dofz dofy doftheta stress] 7 | %elem=[elem# nodei nodej t mat#] 8 | % 9 | %find the max node number in the existing model 10 | maxnode=max(node(:,1)); 11 | maxelem=max(elem(:,1)); 12 | % 13 | node2=node; 14 | node2(:,1)=node(:,1)+maxnode; 15 | % 16 | elem2=elem; 17 | elem2(:,1)=elem(:,1)+maxelem; 18 | elem2(:,2)=elem(:,2)+maxnode; 19 | elem2(:,3)=elem(:,3)+maxnode; 20 | % 21 | %mirror about z axis 22 | if isnan(mz) 23 | else 24 | node2(:,2)=-(node2(:,2)-mz); 25 | end 26 | % 27 | %mirror about x axis 28 | if isnan(mx) 29 | else 30 | node2(:,3)=-(node2(:,3)-mx); 31 | end 32 | % 33 | %translate first 34 | node2(:,2)=node2(:,2)+x; 35 | node2(:,3)=node2(:,3)+z; 36 | %then rotate 37 | R=[cos(q) -sin(q); sin(q) cos(q)]; 38 | x=node2(:,2); 39 | z=node2(:,3); 40 | v=[x';z']; 41 | V=R*v; 42 | node2(:,2)=V(1,:)'; 43 | node2(:,3)=V(2,:)'; 44 | % 45 | nodeo=[node;node2]; 46 | elemo=[elem;elem2]; 47 | 48 | -------------------------------------------------------------------------------- /helpers/energy_density_recovery.m: -------------------------------------------------------------------------------- 1 | function [se]=energy_density_recovery(prop,node,elem,mode,L,BC,m_a) 2 | %BWS 3 | %7 January 2004 4 | %Calculate all membrane and bending strain energy for any mode shape 5 | % 6 | %Input 7 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 8 | %elem: [elem# nodei nodej t mat#] nelems x 5; 9 | %mode: vector of displacements global dof [u1 v1...un vn w1 01...wn 0n]', 10 | % example is shapes(:,i,j) where i is length index, j is mode index 11 | %L: length at which mode is taken, i.e., lengths(i) 12 | % 13 | %Output 14 | %se = [sem seb] 15 | % 16 | %August 2009 17 | %sem and seb are divided by tba to turn it into energy density. 18 | % 19 | %Z. Li, August 2010 20 | %for general boundary conditions. 21 | % 22 | nnodes=length(node(:,1)); 23 | for i=1:length(elem(:,1)) 24 | %Get element geometry 25 | nodei = elem(i,2); nodej = elem(i,3); 26 | xi = node(nodei,2); xj = node(nodej,2); 27 | zi = node(nodei,3); zj = node(nodej,3); 28 | b = sqrt((xj-xi)^2+(zj-zi)^2); 29 | t = elem(i,4); 30 | %Determine the global element displacements 31 | %dbar is the nodal displacements for the element in global 32 | %coordinates. dbar=(u1 v1 u2 v2 w1 o1 w2 o2)'; 33 | totalm=length(m_a);%Total number of longitudinal terms 34 | duv=zeros(4*totalm,1); 35 | dwo=zeros(4*totalm,1); 36 | for mn=1:totalm 37 | dbar(1:2,1)=mode(4*nnodes*(mn-1)+2*nodei-1:4*nnodes*(mn-1)+2*nodei); 38 | dbar(3:4,1)=mode(4*nnodes*(mn-1)+2*nodej-1:4*nnodes*(mn-1)+2*nodej); 39 | dbar(5:6,1)=mode(4*nnodes*(mn-1)+2*nnodes+2*nodei-1:4*nnodes*(mn-1)+2*nnodes+2*nodei); 40 | dbar(7:8,1)=mode(4*nnodes*(mn-1)+2*nnodes+2*nodej-1:4*nnodes*(mn-1)+2*nnodes+2*nodej); 41 | %transform the dbar to local coordinates d 42 | phi=atan2(-(zj-zi),(xj-xi)); 43 | d=gammait(phi,dbar); 44 | duv((4*(mn-1)+1):(4*(mn-1)+4),1)=d(1:4,1); 45 | dwo((4*(mn-1)+1):(4*(mn-1)+4),1)=d(5:8,1); 46 | end 47 | %determine the local element stiffness 48 | a=L; 49 | matnum=elem(i,5); 50 | row=find(matnum==prop(:,1)); 51 | Ex=prop(row,2); 52 | Ey=prop(row,3); 53 | vx=prop(row,4); 54 | vy=prop(row,5); 55 | G=prop(row,6); 56 | [k_l]=klocal(Ex,Ey,vx,vy,G,t,a,b,BC,m_a); 57 | kuv=zeros(4*totalm); 58 | kwo=zeros(4*totalm); 59 | for mn=1:totalm 60 | for mp=1:totalm 61 | kuv((4*(mn-1)+1):(4*(mn-1)+4),(4*(mp-1)+1):(4*(mp-1)+4))=k_l((8*(mn-1)+1):(8*(mn-1)+4),(8*(mp-1)+1):(8*(mp-1)+4)); 62 | kwo((4*(mn-1)+1):(4*(mn-1)+4),(4*(mp-1)+1):(4*(mp-1)+4))=k_l((8*(mn-1)+5):(8*(mn-1)+8),(8*(mp-1)+5):(8*(mp-1)+8)); 63 | end 64 | end 65 | se(i,1)=(0.5*duv'*kuv*duv)/(t*a*b); 66 | se(i,2)=(0.5*dwo'*kwo*dwo)/(t*a*b); 67 | end 68 | -------------------------------------------------------------------------------- /helpers/energy_recovery.m: -------------------------------------------------------------------------------- 1 | function [se]=energy_recovery(prop,node,elem,mode,L) 2 | %BWS 3 | %7 January 2004 4 | %Calculate all membrane and bending strain energy for any mode shape 5 | % 6 | %Input 7 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 8 | %elem: [elem# nodei nodej t mat#] nelems x 5; 9 | %mode: vector of displacements global dof [u1 v1...un vn w1 01...wn 0n]', 10 | % example is shapes(:,i,j) where i is length index, j is mode index 11 | %L: length at which mode is taken, i.e., lengths(i) 12 | %y L distance where strain is desired, typically at L=0 or L/2 13 | % 14 | %Output 15 | %se = [sem seb] 16 | % 17 | nnodes=length(node(:,1)); 18 | for i=1:length(elem(:,1)) 19 | %Get element geometry 20 | nodei = elem(i,2); nodej = elem(i,3); 21 | xi = node(nodei,2); xj = node(nodej,2); 22 | zi = node(nodei,3); zj = node(nodej,3); 23 | b = sqrt((xj-xi)^2+(zj-zi)^2); 24 | t = elem(i,4); 25 | %Determine the global element displacements 26 | %dbar is the nodal displacements for the element in global 27 | %coordinates. dbar=(u1 v1 u2 v2 w1 o1 w2 o2)'; 28 | dbar(1:2,1)=mode(2*nodei-1:2*nodei); 29 | dbar(3:4,1)=mode(2*nodej-1:2*nodej); 30 | dbar(5:6,1)=mode(2*nnodes+2*nodei-1:2*nnodes+2*nodei); 31 | dbar(7:8,1)=mode(2*nnodes+2*nodej-1:2*nnodes+2*nodej); 32 | %transform the dbar to local coordinates d 33 | phi=atan2(-(zj-zi),(xj-xi)); 34 | d=gammait(phi,dbar); 35 | %determine the local element stiffness 36 | m=1; 37 | a=L; 38 | matnum=elem(i,5); 39 | row=find(matnum==prop(:,1)); 40 | Ex=prop(row,2); 41 | Ey=prop(row,3); 42 | vx=prop(row,4); 43 | vy=prop(row,5); 44 | G=prop(row,6); 45 | [k_l]=klocal(Ex,Ey,vx,vy,G,t,a,b,m); 46 | se(i,1)=0.5*d(1:4)'*k_l(1:4,1:4)*d(1:4); 47 | se(i,2)=0.5*d(5:8)'*k_l(5:8,5:8)*d(5:8); 48 | end 49 | -------------------------------------------------------------------------------- /helpers/firstyield.m: -------------------------------------------------------------------------------- 1 | function [betay,PMMy] = firstyield(node,elem,fy,thetaMM,phiPM) 2 | %Calculation of first yield point in PMM space 3 | %BWS 13 November 2015 4 | % 5 | %input 6 | %node and elem, standard CUFSM properties 7 | %thetaMM and phiPM as equal n-length column vectors that finding first yield is 8 | %desired for in the PMM space. 9 | % 10 | %output 11 | %betay a column vector to go with thetaMM and phiPM 12 | %PMMy=[P/Py M11/M11y M22/M22y] nx3 array of first yield values 13 | % 14 | %Determine section properties 15 | [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,J,Xs,Ys,Cw,B1,B2,w] = cutwp_prop2(node(:,2:3),elem(:,2:4)); 16 | thetap=thetap*180/pi; %degrees... 17 | % 18 | %Determine first yield anchor points 19 | [Py,Mxxy,Mzzy,M11y,M22y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,1); 20 | % 21 | for i=1:length(thetaMM) 22 | theta=thetaMM(i); 23 | phi=phiPM(i); 24 | %Determine reference PMM demands 25 | beta=1; 26 | [PonPyref,M11onM11yref,M22onM22yref] = BetaThetaPhitoPMM(beta,theta,phi); 27 | Pref=PonPyref*Py; 28 | M11ref=M11onM11yref*M11y; 29 | M22ref=M22onM22yref*M22y; 30 | %Determine stress at reference level 31 | unsymm=1; 32 | inode=stresgen(node,Pref,0,0,M11ref,M22ref,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm); 33 | fmax=max(abs([inode(:,8);0])); 34 | %Determine PMM demands that create yield at this theta, phi angle 35 | yPonPy=PonPyref*fy/fmax; 36 | yM11onM11y=M11onM11yref*fy/fmax; 37 | yM22onM22y=M22onM22yref*fy/fmax; 38 | %Determine beta at yield 39 | betay(i)=sqrt(yPonPy^2+yM11onM11y^2+yM22onM22y^2); 40 | %PMM at yield in saved form 41 | PMMy(i,:)=[yPonPy yM11onM11y yM22onM22y]; 42 | end 43 | 44 | 45 | end 46 | 47 | -------------------------------------------------------------------------------- /helpers/grosprop.m: -------------------------------------------------------------------------------- 1 | function [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem) 2 | %[A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem) 3 | %December 8, 1997 4 | %Benjamin Schafer 5 | %Input 6 | %node=[# x z DOFX DOFZ DOFY DOF0 stress] 7 | %elem=[# i j t] 8 | %Ouput 9 | % 10 | A=0;, Ax=0;, Az=0;, Axx=0;, Azz=0;, Axz=0; 11 | Ixx_o=0;, Izz_o=0;, Ixz_o=0; 12 | for k=1:length(elem(:,1)) 13 | ni=elem(k,2); 14 | nj=elem(k,3); 15 | t=elem(k,4); 16 | xi=node(ni,2); 17 | xj=node(nj,2); 18 | zi=node(ni,3); 19 | zj=node(nj,3); 20 | % 21 | delx=xj-xi; 22 | delz=zj-zi; 23 | theta_xx=pi/2-atan2(delz,delx); 24 | theta_zz=theta_xx+pi/2; 25 | xcg_elem=1/2*(xi+xj); 26 | zcg_elem=1/2*(zi+zj); 27 | L_elem=sqrt(delx^2+delz^2); 28 | A_elem=t*L_elem; 29 | Ixx_elem=1/12*t*L_elem*(t^2*(sin(theta_xx))^2 + L_elem^2*(cos(theta_xx))^2); 30 | Izz_elem=1/12*t*L_elem*(t^2*(sin(theta_zz))^2 + L_elem^2*(cos(theta_zz))^2); 31 | Ixz_elem=1/12*t*L_elem*(t^2*sin(theta_xx)*cos(theta_xx) + ... 32 | L_elem^2*cos(theta_xx)*sin(theta_xx)); 33 | % 34 | A=A + A_elem; 35 | Ax=Ax + A_elem*xcg_elem; 36 | Az=Az + A_elem*zcg_elem; 37 | Axx=Axx + A_elem*xcg_elem*xcg_elem; 38 | Azz=Azz + A_elem*zcg_elem*zcg_elem; 39 | Axz=Axz + A_elem*xcg_elem*zcg_elem; 40 | Ixx_o=Ixx_o + Ixx_elem; 41 | Izz_o=Izz_o + Izz_elem; 42 | Ixz_o=Ixz_o + Ixz_elem; 43 | % 44 | end 45 | xcg=Ax/A; 46 | zcg=Az/A; 47 | Ixx=Ixx_o + Azz - A*zcg^2; 48 | Izz=Izz_o + Axx - A*xcg^2; 49 | Ixz=Ixz_o + Axz - A*xcg*zcg; 50 | thetap=180/pi*1/2*atan2(-2*Ixz,Ixx-Izz); 51 | I11=1/2*(Ixx+Izz) + sqrt( (1/2*(Ixx-Izz))^2 + Ixz^2 ); 52 | I22=1/2*(Ixx+Izz) - sqrt( (1/2*(Ixx-Izz))^2 + Ixz^2 ); 53 | -------------------------------------------------------------------------------- /helpers/longtermpart.m: -------------------------------------------------------------------------------- 1 | function [d_part]=longtermpart(nnodes,mode,m_a) 2 | % 3 | 4 | 5 | % 6 | % nnodes=length(node(:,1)); 7 | % mode=shapes(:,22,1); 8 | ddd=0; 9 | totalm=length(m_a);%Total number of longitudinal terms 10 | for mn=1:1:totalm 11 | dg(:,mn)=mode((mn-1)*4*nnodes+1:(mn)*4*nnodes); 12 | dg_norm(mn,1)=norm(dg(:,mn)); 13 | ddd=dg_norm(mn,1)+ddd; 14 | end 15 | d_part=dg_norm./ddd;%norm(dg_norm,2); 16 | % hist(d_norm);hold on 17 | % bar(m_a,d_part) -------------------------------------------------------------------------------- /helpers/master_slave.m: -------------------------------------------------------------------------------- 1 | function [constraints]=master_slave(master,slave,node,elem) 2 | %master = master node 3 | %slave = slave node(s) 4 | %node = nodal matrix, defined elsewhere 5 | %elem = element connectivity matrix defined elsewhere 6 | % 7 | %MASTER-SLAVE CONSTRAINT EQUATIONS 8 | %for each slave, if the master undergoes rotation, q, determine the constraint condition 9 | for i=1:length(slave) 10 | dz=node(slave(i),3)-node(master,3); %z distance between master and slave 11 | dx=node(slave(i),2)-node(master,2); %x distance between master and slave 12 | r=sqrt(dx^2 + dz^2); %radial distance between master and slave 13 | theta=atan2(dz,dx); %angle between master and slave 14 | %if q is the rotation of the master then we need to write constraint conditions 15 | %for the change in x and z due to master rotation q (dof 4) 16 | uq=-r*sin(theta); %u = uq*q 17 | wq=r*cos(theta); %note these are small angle approximations, to have linear constraint equations 18 | %we also need to consider translation of the master node 19 | %we may read the below as 20 | %slave node i, u disp (dof 1) = uq*master_rotation(dof 4) + 1.0*master_u(dof 1) 21 | constraints1(i,:)=[slave(i) 1 uq master 4 1.0 master 1]; 22 | %z displacements 23 | constraints2(i,:)=[slave(i) 2 wq master 4 1.0 master 2]; 24 | %rotations 25 | constraints3(i,:)=[slave(i) 4 1.0 master 4 0 0 0]; 26 | end 27 | constraints(:,:)=[constraints1; constraints2; constraints3]; 28 | -------------------------------------------------------------------------------- /helpers/plastic/B2xyzr.m: -------------------------------------------------------------------------------- 1 | function [ xyzr ] = B2xyzr(B,Teta,Phi) 2 | % Converting B data to xyzr 3 | 4 | Teta=Teta/180*pi; 5 | Phi=Phi/180*pi; 6 | 7 | 8 | L=length(B); 9 | 10 | k=1; 11 | for i=1:length(Teta) 12 | for j=1:length(Phi) 13 | xyzr(k,1)=Teta(i)/pi*180; 14 | xyzr(k,2)=Phi(j)/pi*180; 15 | xyzr(k,3)=B(k); 16 | xyzr(k,4)=B(k)*cos(Teta(i))*sin(Phi(j)); 17 | xyzr(k,5)=B(k)*sin(Teta(i))*sin(Phi(j)); 18 | xyzr(k,6)=B(k)*cos(Phi(j)); 19 | if k<=L/2||length(Teta)==1 20 | xyzr(k,7)=B(k)*sin(Phi(j)); 21 | else 22 | xyzr(k,7)=-B(k)*sin(Phi(j)); 23 | end 24 | k=k+1; 25 | end 26 | end 27 | 28 | end 29 | 30 | -------------------------------------------------------------------------------- /helpers/plastic/B2xyzr_P.m: -------------------------------------------------------------------------------- 1 | function [ xyzr ] = B2xyzr_P(B,Teta,Phi) 2 | % Converting B data to xyzr 3 | 4 | Teta=Teta/180*pi; 5 | Phi=Phi/180*pi; 6 | 7 | 8 | L=length(B); 9 | 10 | k=1; 11 | for i=1:length(Teta) 12 | for j=1:length(Phi) 13 | if Phi(j)~=0||k==1 14 | xyzr(k,1)=Teta(i)/pi*180; 15 | xyzr(k,2)=Phi(j)/pi*180; 16 | xyzr(k,3)=B(k); 17 | xyzr(k,4)=B(k)*cos(Teta(i))*sin(Phi(j)); 18 | xyzr(k,5)=B(k)*sin(Teta(i))*sin(Phi(j)); 19 | xyzr(k,6)=B(k)*cos(Phi(j)); 20 | if k<=L/2||length(Teta)==1 21 | xyzr(k,7)=B(k)*sin(Phi(j)); 22 | else 23 | xyzr(k,7)=-B(k)*sin(Phi(j)); 24 | end 25 | k=k+1; 26 | end 27 | end 28 | end 29 | 30 | end 31 | 32 | -------------------------------------------------------------------------------- /helpers/plastic/PMM_Dumping.m: -------------------------------------------------------------------------------- 1 | function [Mxn,Mzn,Pn]=PMM_Dumping(fib_c,Fy,PY,MxxY,MzzY,Ne,Deg) 2 | 3 | %%% In the name of Allah 4 | %%% Fiber element Model 5 | %%% March 2013 6 | %%% Shahabeddin Torabian 7 | 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | 10 | k=0; 11 | teta=Deg/180*pi; 12 | NF=length(fib_c); 13 | 14 | for k=1:length(teta) 15 | 16 | %%%Plastic N.A 17 | 18 | xmin=min(fib_c(:,2)); 19 | xmax=max(fib_c(:,2)); 20 | zmin=min(fib_c(:,3)); 21 | zmax=max(fib_c(:,3)); 22 | 23 | CP(1,2:3)=[xmin,zmin]; 24 | CP(2,2:3)=[xmin,zmax]; 25 | CP(3,2:3)=[xmax,zmin]; 26 | CP(4,2:3)=[xmax,zmax]; 27 | 28 | for i=1:4 29 | dCP(i)=(cos(teta(k))*CP(i,3)-sin(teta(k))*CP(i,2)); 30 | end 31 | 32 | emin=min(dCP)*1.02; 33 | emax=max(dCP)*1.02; 34 | r=max(abs(emin),abs(emax)); 35 | De=2*r/Ne; 36 | e=-r:De:r; 37 | 38 | Mx(length(e),k)=0; 39 | Mz(length(e),k)=0; 40 | P(length(e),k)=0; 41 | 42 | for i=1:length(e) 43 | Mx(i,k)=0; 44 | Mz(i,k)=0; 45 | P(i,k)=0; 46 | for j=1:NF 47 | 48 | CL=fib_c(j,3)*cos(teta(k))-fib_c(j,2)*sin(teta(k))-e(i); 49 | 50 | if CL>0 51 | fib_c(j,5)=-fib_c(j,4)*Fy; 52 | elseif CL<0 53 | fib_c(j,5)=+fib_c(j,4)*Fy; 54 | else 55 | fib_c(j,5)=0; 56 | end 57 | 58 | Mx(i,k)=Mx(i,k)-fib_c(j,5)*fib_c(j,3); 59 | Mz(i,k)=Mz(i,k)+fib_c(j,5)*fib_c(j,2); 60 | P(i,k)=P(i,k)+fib_c(j,5); 61 | 62 | end 63 | end 64 | 65 | 66 | end 67 | 68 | Mxn=Mx/MxxY; 69 | Mzn=Mz/MzzY; 70 | Pn=P/PY; 71 | 72 | 73 | end 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /helpers/plastic/PMM_Dumping_V1.m: -------------------------------------------------------------------------------- 1 | function [thetaMM,phiPM,beta]=PMM_Dumping_V1(fib_c,Fy,PY,MxxY,MzzY,Par) 2 | 3 | %%% Plastic moment @ an arbitrary neutral axis 4 | %%% March 2013 5 | %%% Shahabeddin Torabian 6 | %%% Version 1 December 2015 7 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8 | 9 | e=Par(1); 10 | alpha=Par(2)/180*pi; 11 | NF=length(fib_c); 12 | 13 | Mx=0; 14 | Mz=0; 15 | P=0; 16 | 17 | for i=1:NF 18 | 19 | CL=fib_c(i,3)*cos(alpha)-fib_c(i,2)*sin(alpha)-e; 20 | 21 | if CL>0 22 | fib_c(i,5)=-fib_c(i,4)*Fy; 23 | elseif CL<0 24 | fib_c(i,5)=+fib_c(i,4)*Fy; 25 | else 26 | fib_c(i,5)=0; 27 | end 28 | 29 | Mx=Mx-fib_c(i,5)*fib_c(i,3); 30 | Mz=Mz+fib_c(i,5)*fib_c(i,2); 31 | P=P+fib_c(i,5); 32 | 33 | end 34 | 35 | M11onM11y=Mx/MxxY; 36 | M22onM22y=Mz/MzzY; 37 | PonPy=P/PY; 38 | 39 | 40 | beta=0; 41 | thetaMM=0; 42 | phiPM=0; 43 | 44 | beta=(M11onM11y^2+M22onM22y^2+PonPy^2)^0.5; 45 | 46 | thetaMM=atan2(M22onM22y,M11onM11y); 47 | 48 | if thetaMM<0 49 | thetaMM=2*pi+thetaMM; 50 | end 51 | 52 | phiPM=acos(PonPy/beta); 53 | 54 | thetaMM=thetaMM/pi*180; 55 | phiPM=phiPM/pi*180; 56 | 57 | end 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /helpers/plastic/PMM_point_finder.m: -------------------------------------------------------------------------------- 1 | function [BP]=PMM_point_finder(az,el,r,azi,eli) 2 | 3 | %%% March 2013 4 | %%% Shahabeddin Torabian 5 | 6 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7 | azi=azi/180*pi; 8 | eli=eli/180*pi; 9 | 10 | 11 | % [m,n]=size(Pn); 12 | % 13 | % Inter1=[reshape(Mxn,m*n,1) reshape(Mzn,m*n,1) reshape(Pn,m*n,1)]; 14 | % Inter=unique(Inter1, 'rows'); 15 | % 16 | % [az,el,r] = cart2sph(Inter(:,1),Inter(:,2),Inter(:,3)); 17 | 18 | % ri = griddata(az,el,r,azi,eli,'cubic'); 19 | F = TriScatteredInterp(az,el,r); 20 | ri = F(azi,eli); 21 | 22 | if isnan(ri) 23 | ri = griddata(az,el,r,azi,eli,'nearest'); 24 | end 25 | 26 | % if azi==pi 27 | % ri = griddata(az,el,r,azi,eli,'nearest'); 28 | % end 29 | 30 | BP=ri; 31 | 32 | end 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /helpers/plastic/SFIA.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/plastic/SFIA.mat -------------------------------------------------------------------------------- /helpers/plastic/SFIA_Section_Parameters.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/plastic/SFIA_Section_Parameters.mat -------------------------------------------------------------------------------- /helpers/plastic/YS_for_DSM_Fiber.m: -------------------------------------------------------------------------------- 1 | function [BY,ay,ayc,ayt] = YS_for_DSM_Fiber(TetaMM,PhiPM,B,nodef_c,Fy,A,Ixx,Izz,Sxx,Sz1,Sz2,node_c90,n_elem_cufsm) 2 | 3 | 4 | 5 | Br=B; 6 | TetaMM=TetaMM/180*pi; 7 | PhiPM=PhiPM/180*pi; 8 | 9 | xr=Br*cos(TetaMM)*sin(PhiPM); 10 | yr=Br*sin(TetaMM)*sin(PhiPM); 11 | zr=Br*cos(PhiPM); 12 | 13 | 14 | %% Yield Forces 15 | 16 | MxxY=Sxx*Fy; 17 | MzzY=Sz1*Fy; 18 | PY=A*Fy; 19 | 20 | %% P and M 21 | PP=zr*PY; 22 | Mxx=xr*MxxY; 23 | Mzz=yr*MzzY; 24 | 25 | NN=length(nodef_c); 26 | 27 | for i=1:NN 28 | 29 | nodef_c(i,8)=PP/A-Mxx*nodef_c(i,3)/Ixx+Mzz*nodef_c(i,2)/Izz; 30 | 31 | end 32 | 33 | Smaxc=max(nodef_c(:,8)); 34 | Smaxt=min(nodef_c(:,8)); 35 | 36 | ayc=(Fy/Smaxc); 37 | ayt=(Fy/Smaxt); 38 | 39 | if abs(ayc)<=abs(ayt) 40 | ay=ayc; 41 | else 42 | ay=ayt; 43 | end 44 | 45 | 46 | 47 | BY=abs(ay*Br); 48 | end 49 | 50 | -------------------------------------------------------------------------------- /helpers/plastic/YS_for_DSM_Fiber_g.m: -------------------------------------------------------------------------------- 1 | function [BY,ay,ayc,ayt] = YS_for_DSM_Fiber_g(TetaMM,PhiPM,B,nodef_c,Fy,A,Ixx,Izz,Sxx1,Sxx2,Sz1,Sz2,node_c90,n_elem_cufsm) 2 | 3 | 4 | 5 | Br=B; 6 | TetaMM=TetaMM/180*pi; 7 | PhiPM=PhiPM/180*pi; 8 | 9 | xr=Br*cos(TetaMM)*sin(PhiPM); 10 | yr=Br*sin(TetaMM)*sin(PhiPM); 11 | zr=Br*cos(PhiPM); 12 | 13 | 14 | %% Yield Forces 15 | 16 | MxxY=min(Sxx1,Sxx2)*Fy; 17 | MzzY=min(Sz1,Sz2)*Fy; 18 | PY=A*Fy; 19 | 20 | %% P and M 21 | PP=zr*PY; 22 | Mxx=xr*MxxY; 23 | Mzz=yr*MzzY; 24 | 25 | NN=length(nodef_c); 26 | 27 | for i=1:NN 28 | 29 | nodef_c(i,8)=PP/A-Mxx*nodef_c(i,3)/Ixx+Mzz*nodef_c(i,2)/Izz; 30 | 31 | end 32 | 33 | Smaxc=max(nodef_c(:,8)); 34 | Smaxt=min(nodef_c(:,8)); 35 | 36 | ayc=(Fy/Smaxc); 37 | ayt=(Fy/Smaxt); 38 | 39 | if abs(ayc)<=abs(ayt) 40 | ay=ayc; 41 | else 42 | ay=ayt; 43 | end 44 | 45 | 46 | BY=abs(ay*Br); 47 | end 48 | 49 | -------------------------------------------------------------------------------- /helpers/plastic/Zsections.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/plastic/Zsections.mat -------------------------------------------------------------------------------- /helpers/plastic/grosprop1.m: -------------------------------------------------------------------------------- 1 | function [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,fib]=grosprop1(node,elem) 2 | %[A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem) 3 | %December 8, 1997 4 | %Benjamin Schafer 5 | %Input 6 | %node=[# x z DOFX DOFZ DOFY DOF0 stress] 7 | %elem=[# i j t] 8 | %Ouput 9 | % 10 | A=0;, Ax=0;, Az=0;, Axx=0;, Azz=0;, Axz=0; 11 | Ixx_o=0;, Izz_o=0;, Ixz_o=0; 12 | for k=1:length(elem(:,1)) 13 | ni=elem(k,2); 14 | nj=elem(k,3); 15 | t=elem(k,4); 16 | xi=node(ni,2); 17 | xj=node(nj,2); 18 | zi=node(ni,3); 19 | zj=node(nj,3); 20 | % 21 | delx=xj-xi; 22 | delz=zj-zi; 23 | theta_xx=pi/2-atan2(delz,delx); 24 | theta_zz=theta_xx+pi/2; 25 | 26 | xcg_elem=1/2*(xi+xj); 27 | xcg_e(k)=xcg_elem; 28 | 29 | zcg_elem=1/2*(zi+zj); 30 | zcg_e(k)=zcg_elem; 31 | 32 | L_elem=sqrt(delx^2+delz^2); 33 | A_elem=t*L_elem; 34 | A_e(k)=A_elem; 35 | 36 | Ixx_elem=1/12*t*L_elem*(t^2*(sin(theta_xx))^2 + L_elem^2*(cos(theta_xx))^2); 37 | Izz_elem=1/12*t*L_elem*(t^2*(sin(theta_zz))^2 + L_elem^2*(cos(theta_zz))^2); 38 | Ixz_elem=1/12*t*L_elem*(t^2*sin(theta_xx)*cos(theta_xx) + ... 39 | L_elem^2*cos(theta_xx)*sin(theta_xx)); 40 | % 41 | A=A + A_elem; 42 | Ax=Ax + A_elem*xcg_elem; 43 | Az=Az + A_elem*zcg_elem; 44 | Axx=Axx + A_elem*xcg_elem*xcg_elem; 45 | Azz=Azz + A_elem*zcg_elem*zcg_elem; 46 | Axz=Axz + A_elem*xcg_elem*zcg_elem; 47 | Ixx_o=Ixx_o + Ixx_elem; 48 | Izz_o=Izz_o + Izz_elem; 49 | Ixz_o=Ixz_o + Ixz_elem; 50 | % 51 | end 52 | fib=[1:length(A_e);xcg_e;zcg_e;A_e]'; 53 | xcg=Ax/A; 54 | zcg=Az/A; 55 | Ixx=Ixx_o + Azz - A*zcg^2; 56 | Izz=Izz_o + Axx - A*xcg^2; 57 | Ixz=Ixz_o + Axz - A*xcg*zcg; 58 | thetap=180/pi*1/2*atan2(-2*Ixz,Ixx-Izz); 59 | I11=1/2*(Ixx+Izz) + sqrt( (1/2*(Ixx-Izz))^2 + Ixz^2 ); 60 | I22=1/2*(Ixx+Izz) - sqrt( (1/2*(Ixx-Izz))^2 + Ixz^2 ); 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /helpers/plastic/misc/Fig_3D_P_Y_Surfaces.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/plastic/misc/Fig_3D_P_Y_Surfaces.fig -------------------------------------------------------------------------------- /helpers/post_make.m: -------------------------------------------------------------------------------- 1 | %BWS 2 | %19 October 2001 3 | %a tool for making summary plots of finite strip analyses 4 | % 5 | clear all 6 | close all 7 | % 8 | % 9 | filename=['defaultC.mat']; 10 | % 11 | % 12 | eval(['load ',filename]) 13 | % 14 | %BEGIN BY PLOTTING THE BUCKLING CURVE 15 | fig=figure(1); 16 | set(fig,'Units','inches') 17 | set(fig,'position',[1.0 1.0 6.00 4.00])% 18 | axescurve=axes('Units','normalized','Position',[0.1 0.15 0.8 0.75],'Box','on','XTickLabel','','YTickLabel',''); 19 | xmin=0; 20 | ymin=0; 21 | xmax=max(curve(:,1)); 22 | ymax=max(curve(:,2)); 23 | minopt=1; 24 | logopt=1; 25 | maxmode=1; 26 | lengthindex=1; 27 | modeindex=1; 28 | picpoint=[lengths(lengthindex) curve(lengthindex,2,modeindex)]; 29 | thecurve(curve,minopt,logopt,axescurve,xmin,xmax,ymin,ymax,maxmode,picpoint) 30 | xlabel('half-wavelength (in.)') 31 | ylabel('M_{cr}/M_y') 32 | title('Buckling results') 33 | % 34 | %NOW PLOT A MODE SHAPE 35 | select_length=5; 36 | position=[0.1 0.1 0.2 0.2]; %normalized units left,bottom,width,height 37 | % 38 | modeindex=1; 39 | lengthindex=lengths==select_length; 40 | undef=1; 41 | scalem=1; 42 | mode=shapes(:,lengthindex,modeindex); 43 | axesnum=axes('Units','normalized','Position',position,'visible','off'); 44 | dispshap(undef,node,elem,mode,axesnum,scalem,springs) 45 | -------------------------------------------------------------------------------- /helpers/renumbernodes.m: -------------------------------------------------------------------------------- 1 | function [node,elem]=renumbernodes(node,elem) 2 | %BWS 3 | %August 2000 (last modified) 4 | % 5 | %renumber the nodes so that they are 1 to n 6 | %number of nodes 7 | n=size(node,1); 8 | %lookup table 9 | table=[node(:,1) (1:1:n)']; 10 | %renumber nodes 11 | node(:,1)=(1:1:n)'; 12 | %number of elements 13 | ne=size(elem,1); 14 | %cleanup element numbers 15 | elem(:,1)=(1:1:ne)'; 16 | %use table to correct node numbering in element 17 | for i=1:ne 18 | elem(i,:)=[elem(i,1) table(find(elem(i,2)==table(:,1)),2) table(find(elem(i,3)==table(:,1)),2) elem(i,4) elem(i,5)]; 19 | end -------------------------------------------------------------------------------- /helpers/saver.m: -------------------------------------------------------------------------------- 1 | function [pathname,filename]=saver(prop,node,elem,lengths,curve,shapes,springs,constraints,GBTcon,clas,BC,m_all) 2 | %BWS 3 | %August 2000 (last modified) 4 | % 5 | [filename,pathname]=uiputfile('*.mat','Save as'); 6 | if filename==0 7 | return 8 | else 9 | %if isempty(curve)|curve(1,1)==0|isempty(shapes)|shapes(1,1)==0 10 | if exist('curve')<1 & exist('shapes')<1 11 | save([pathname,filename],'prop','node','elem','lengths','springs','constraints','GBTcon','BC','m_all'); 12 | else 13 | if exist('clas')<1 14 | save([pathname,filename],'prop','node','elem','lengths','springs','constraints','GBTcon','curve','shapes','BC','m_all'); 15 | elseif exist('clas')==1 16 | save([pathname,filename],'prop','node','elem','lengths','springs','constraints','GBTcon','curve','shapes','clas','BC','m_all'); 17 | 18 | end 19 | end 20 | end 21 | 22 | -------------------------------------------------------------------------------- /helpers/shapef.m: -------------------------------------------------------------------------------- 1 | function dl=shapef(links,d,b); 2 | %BWS 3 | %1998 4 | % 5 | %links: the number of additional line segments used to show the disp shape 6 | %d: the vector of nodal displacements 7 | %b: the actual length of the element 8 | % 9 | inc=1/links; 10 | xb=(inc:inc:1-inc); %location of additional displacements 11 | for i=1:length(xb) 12 | N1=(1-3*xb(i)^2+2*xb(i)^3); 13 | N2=xb(i)*b*(1-2*xb(i)+xb(i)^2); 14 | N3=3*xb(i)^2-2*xb(i)^3; 15 | N4=xb(i)*b*(xb(i)^2-xb(i)); 16 | N=[(1-xb(i)) 0 xb(i) 0 0 0 0 0 17 | 0 (1-xb(i)) 0 xb(i) 0 0 0 0 18 | 0 0 0 0 N1 N2 N3 N4]; 19 | dl(:,i)=N*d; 20 | end -------------------------------------------------------------------------------- /helpers/signature_ss.m: -------------------------------------------------------------------------------- 1 | function [icurve,ishapes]=signature_ss(prop,node,elem,iGBTcon) 2 | % 3 | %Z. Li, July 2010 (last modified) 4 | %generate the signature curve solution 5 | % 6 | Mm=1000000;%Minimum element length 7 | Mw=0;%Maximum element length 8 | for i=1:length(elem(:,1)) 9 | hh1=abs(sqrt((node(elem(i,2),2)-node(elem(i,3),2))^2+(node(elem(i,2),3)-node(elem(i,3),3))^2)); 10 | if hh1Mw 14 | Mw=hh1; 15 | end 16 | end 17 | hlengths=logspace(log10(Mm),log10(1000*Mw),100); 18 | % 19 | isprings=0; 20 | iconstraints=0; 21 | iBC='S-S'; 22 | for i=1:length(hlengths) 23 | im_all{i}=[1]; 24 | end 25 | [icurve,ishapes]=stripmain(prop,node,elem,hlengths,isprings,iconstraints,iGBTcon,iBC,im_all,10); 26 | 27 | -------------------------------------------------------------------------------- /helpers/stresgen.m: -------------------------------------------------------------------------------- 1 | function [node]=stresgen(node,P,Mxx,Mzz,M11,M22,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm) 2 | %BWS 3 | %1998 4 | if unsymm==0 5 | Ixz=0; 6 | end 7 | stress=zeros(length(node(:,1)),1); 8 | %from P 9 | stressinc=P/A; 10 | if max(isnan(stressinc)) 11 | stressinc=0; 12 | end 13 | stress=stress+stressinc; 14 | %from Mxx Mzz 15 | stressinc=-((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg))/(Izz*Ixx-Ixz^2); 16 | if max(isnan(stressinc)) 17 | stressinc=0; 18 | end 19 | stress=stress+stressinc; 20 | %or from M11 and M22 21 | th=thetap*pi/180; 22 | prin_coord=inv([cos(th) -sin(th) ; sin(th) cos(th)])*[(node(:,2)-xcg)' ; (node(:,3)-zcg)']; 23 | %M11 24 | stressinc=M11*prin_coord(2,:)'/I11; 25 | if max(isnan(stressinc)) 26 | stressinc=0; 27 | end 28 | stress=stress+stressinc; 29 | %M22 30 | stressinc=-M22*prin_coord(1,:)'/I22; 31 | if max(isnan(stressinc)) 32 | stressinc=0; 33 | end 34 | stress=stress+stressinc; 35 | %assign stress to node variable 36 | node(:,8)=stress; -------------------------------------------------------------------------------- /helpers/stress_to_action.m: -------------------------------------------------------------------------------- 1 | function [P,M11,M22,B,err] = stress_to_action(node,xcg,zcg,thetap,A,I11,I22,w,Cw) 2 | %BWS 8 December 2015, Convert stresses to actions as close as possible 3 | %{s}=[G]{f}, {f}=pinv([G]){s} 4 | % 5 | %determine principal coordinates 6 | th=thetap*pi/180; 7 | prin_coord=inv([cos(th) -sin(th) ; sin(th) cos(th)])*[(node(:,2)-xcg)' ; (node(:,3)-zcg)']; 8 | % 9 | %stress 10 | s=node(:,8); 11 | nn=length(s); 12 | %axial 13 | G(:,1)=ones(nn,1)/A; 14 | %11 bending 15 | G(:,2)=prin_coord(2,:)'/I11; 16 | %22 bending 17 | G(:,3)=prin_coord(1,:)'/-I22; 18 | %bimoment 19 | G(:,4)=w/Cw; 20 | % 21 | %solution 22 | %f=pinv(G)*s; 23 | f=G\s 24 | P=f(1); 25 | M11=f(2); 26 | M22=f(3); 27 | B=f(4); 28 | % 29 | %error 30 | err=norm(G*f-s); 31 | 32 | end 33 | 34 | -------------------------------------------------------------------------------- /helpers/superseded/tempctest.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/superseded/tempctest.mat -------------------------------------------------------------------------------- /helpers/superseded/temptesting.m: -------------------------------------------------------------------------------- 1 | %temptesting 2 | load tempztest 3 | [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,J,Xs,Ys,Cw,B1,B2,w] = cutwp_prop2(node(:,2:3),elem(:,2:4)); 4 | thetap=thetap*180/pi; %degrees... 5 | restrained=1; 6 | Mxx=0; 7 | Mzz=1; 8 | [M11,M22]=MxxtoM11(Mxx,Mzz,Ixx,Izz,Ixz,thetap,I11,I22,restrained); 9 | M11 10 | M22 11 | -------------------------------------------------------------------------------- /helpers/superseded/tempztest.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/helpers/superseded/tempztest.mat -------------------------------------------------------------------------------- /helpers/template_out_to_in.m: -------------------------------------------------------------------------------- 1 | function [h,b1,d1,q1,b2,d2,q2,r1,r2,r3,r4,t] = template_out_to_in(H,B1,D1,q1,B2,D2,q2,ri1,ri2,ri3,ri4,t) 2 | %BWS 2015 3 | %reference AISI Design Manual for the lovely corner radius calcs. 4 | %For template calc, convert outer dimensons and inside radii to centerline 5 | %dimensiosn throughout 6 | %convert the inner radii to centerline if nonzero 7 | if ri1==0, 8 | r1=0 9 | else 10 | r1=ri1+t/2; 11 | end 12 | if ri2==0, 13 | r2=0 14 | else 15 | r2=ri2+t/2; 16 | end 17 | if ri3==0, 18 | r3=0 19 | else 20 | r3=ri3+t/2; 21 | end 22 | if ri4==0, 23 | r4=0 24 | else 25 | r4=ri4+t/2; 26 | end 27 | h=H-t/2-r1-r3-t/2; 28 | if D1==0 29 | b1=B1-r1-t/2; 30 | d1=0; 31 | else 32 | b1=B1-r1-t/2-(r2+t/2)*tan(q1/2); 33 | d1=(D1-(r2+t/2)*tan(q1/2)); 34 | end 35 | if D2==0 36 | b2=B2-r3-t/2; 37 | d2=0; 38 | else 39 | b2=B2-r3-t/2-(r4+t/2)*tan(q2/2); 40 | d2=(D2-(r4+t/2)*tan(q2/2)); 41 | end 42 | end 43 | 44 | -------------------------------------------------------------------------------- /helpers/trans_or_rot_model.m: -------------------------------------------------------------------------------- 1 | function [node_out]=trans_or_rot_model(x,z,q,node) 2 | % 3 | %Function to translate or rotate entire model 4 | %26 October 2015 5 | % 6 | %node=[node# x z dofx dofz dofy doftheta stress] 7 | % 8 | %translate first 9 | node(:,2)=node(:,2)+x; 10 | node(:,3)=node(:,3)+z; 11 | %then rotate 12 | R=[cos(q) -sin(q); sin(q) cos(q)]; 13 | x=node(:,2); 14 | z=node(:,3); 15 | v=[x';z']; 16 | V=R*v; 17 | node(:,2)=V(1,:)'; 18 | node(:,3)=V(2,:)'; 19 | % 20 | %save new nodes 21 | node_out=node; 22 | 23 | -------------------------------------------------------------------------------- /helpers/translate_nodes.m: -------------------------------------------------------------------------------- 1 | function [node_out]=translate_nodes(move_me,this_much,node) 2 | % 3 | %Function to translate nodes a fixed amount 4 | %14 August 2003, BWS 5 | % 6 | %node=[node# x z dofx dofz dofy doftheta stress] 7 | %elem=[elem# nodei nodej thickness mat#] 8 | %divide_me=element to be divided 9 | %at_location=number between 0 and 1 along the length 10 | % 11 | %error checking 12 | if min(move_me)>0 13 | else 14 | node_out=node; 15 | return 16 | end 17 | 18 | %Translate the nodes 19 | %x change 20 | node(move_me',2)=node(move_me',2)+this_much(1); 21 | %z change 22 | node(move_me',3)=node(move_me',3)+this_much(2); 23 | %write the result 24 | node_out=node; 25 | 26 | -------------------------------------------------------------------------------- /helpers/warp_stress.m: -------------------------------------------------------------------------------- 1 | function [node]=warp_stress(node,prop,Tflag,T,B,L,x,Cw,J,w,Tcheck) 2 | global outBedit outTedit 3 | 4 | if Tcheck==1 5 | E=prop(1,2); 6 | G=prop(1,6); 7 | a=sqrt(E*Cw/(G*J)); 8 | x=abs(x); 9 | L=abs(L); 10 | if x>L/2 11 | x=abs(L-x); 12 | end 13 | stress=E*T*sinh(x/a)*w/(G*J*a*cosh(L/(2*a))); 14 | for i=1:size(node,1) 15 | B=stress(i)*Cw/w(i); 16 | end 17 | set(outBedit,'String',num2str(B)); 18 | else 19 | Tflag; 20 | if Tflag==1 21 | stress=B*w/Cw; 22 | if max(isnan(stress)) 23 | stress=0; 24 | end 25 | node(:,8)=node(:,8)+stress; 26 | end 27 | end -------------------------------------------------------------------------------- /helpers/yieldB.m: -------------------------------------------------------------------------------- 1 | function [By]=yieldB(fy,Cw,w) 2 | %BWS 3 | %October 2015 4 | %May 2019 5 | %Trap NaN when w, Cw 0 as in a flat plate 6 | % 7 | B=1; 8 | stress=B*w/Cw; 9 | factor=fy/max(abs(stress)); 10 | By=factor*B; 11 | if isnan(By) 12 | By=0; 13 | end 14 | 15 | 16 | -------------------------------------------------------------------------------- /helpers/yieldMP.m: -------------------------------------------------------------------------------- 1 | function [Py,Mxx_y,Mzz_y,M11_y,M22_y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,... 2 | I11,I22,unsymm) 3 | %BWS 4 | %August 2000 5 | %[Py,Mxx_y,Mzz_y,M11_y,M22_y]=yieldMP(node,fy,A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22,unsymm) 6 | %May 2019 trap nan when flat plate or other properites are zero 7 | % 8 | % 9 | %Py 10 | Py=fy*A; 11 | % 12 | %account for the possibility of restrained bending vs. unrestrained bending 13 | if unsymm==0 14 | Ixz=0; 15 | end 16 | %Mxx_y 17 | %calculate stress at every point based on Mxx=1 18 | Mxx=1;, Mzz=0; 19 | stress=((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg)) / (Izz*Ixx-Ixz^2); 20 | factor=fy/max(abs(stress)); 21 | Mxx_y=factor*Mxx; 22 | if isnan(Mxx_y) 23 | Mxx_y=0; 24 | end 25 | %Mzz_y 26 | %calculate stress at every point based on Mxx=1 27 | Mxx=0;, Mzz=1; 28 | stress=((Mzz*Ixx+Mxx*Ixz)*(node(:,2)-xcg)-(Mzz*Ixz+Mxx*Izz)*(node(:,3)-zcg)) / (Izz*Ixx-Ixz^2); 29 | factor=fy/max(abs(stress)); 30 | Mzz_y=factor*Mzz; 31 | if isnan(Mzz_y) 32 | Mzz_y=0; 33 | end 34 | % 35 | %M11_y, M22_y 36 | %transform coordinates of nodes into principal coordinates 37 | th=thetap*pi/180; 38 | prin_coord=inv([cos(th) -sin(th) ; sin(th) cos(th)])*[(node(:,2)-xcg)' ; (node(:,3)-zcg)']; 39 | % 40 | M11=1; 41 | stress=M11*prin_coord(2,:)'/I11; 42 | factor=fy/max(abs(stress)); 43 | M11_y=factor*M11; 44 | if isnan(M11_y) 45 | M11_y=0; 46 | end 47 | % 48 | M22=1; 49 | stress=M22*prin_coord(1,:)'/I22; 50 | factor=fy/max(abs(stress)); 51 | M22_y=factor*M22; 52 | if isnan(M22_y) 53 | M22_y=0; 54 | end 55 | 56 | -------------------------------------------------------------------------------- /icons/VectorizeIcons.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/VectorizeIcons.mat -------------------------------------------------------------------------------- /icons/abaqus.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/abaqus.paint -------------------------------------------------------------------------------- /icons/abaqus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/abaqus.png -------------------------------------------------------------------------------- /icons/about.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/about.gif -------------------------------------------------------------------------------- /icons/about.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/about.jpg -------------------------------------------------------------------------------- /icons/about.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/about.paint -------------------------------------------------------------------------------- /icons/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/about.png -------------------------------------------------------------------------------- /icons/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/blank.png -------------------------------------------------------------------------------- /icons/boundcon.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/boundcon.paint -------------------------------------------------------------------------------- /icons/boundcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/boundcon.png -------------------------------------------------------------------------------- /icons/cFSM.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/cFSM.paint -------------------------------------------------------------------------------- /icons/cFSM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/cFSM.png -------------------------------------------------------------------------------- /icons/cufsm5.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/cufsm5.paint -------------------------------------------------------------------------------- /icons/cufsm5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/cufsm5.png -------------------------------------------------------------------------------- /icons/ebanalysis.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/ebanalysis.paint -------------------------------------------------------------------------------- /icons/ebanalysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/ebanalysis.png -------------------------------------------------------------------------------- /icons/hole.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/hole.paint -------------------------------------------------------------------------------- /icons/hole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/hole.png -------------------------------------------------------------------------------- /icons/mastanin.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/mastanin.paint -------------------------------------------------------------------------------- /icons/mastanin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/mastanin.png -------------------------------------------------------------------------------- /icons/mastanout.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/mastanout.paint -------------------------------------------------------------------------------- /icons/mastanout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/mastanout.png -------------------------------------------------------------------------------- /icons/one.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/one.paint -------------------------------------------------------------------------------- /icons/one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/one.png -------------------------------------------------------------------------------- /icons/opendoc.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/opendoc.mat -------------------------------------------------------------------------------- /icons/pan.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/pan.mat -------------------------------------------------------------------------------- /icons/plastic.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/plastic.paint -------------------------------------------------------------------------------- /icons/plastic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/plastic.png -------------------------------------------------------------------------------- /icons/post.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/post.paint -------------------------------------------------------------------------------- /icons/post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/post.png -------------------------------------------------------------------------------- /icons/pre.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/pre.paint -------------------------------------------------------------------------------- /icons/pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/pre.png -------------------------------------------------------------------------------- /icons/printdoc.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/printdoc.mat -------------------------------------------------------------------------------- /icons/quit.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/quit.paint -------------------------------------------------------------------------------- /icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/quit.png -------------------------------------------------------------------------------- /icons/reset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/reset.gif -------------------------------------------------------------------------------- /icons/reset.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/reset.paint -------------------------------------------------------------------------------- /icons/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/reset.png -------------------------------------------------------------------------------- /icons/rotate.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/rotate.mat -------------------------------------------------------------------------------- /icons/savedoc.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/savedoc.mat -------------------------------------------------------------------------------- /icons/sectprop.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/sectprop.paint -------------------------------------------------------------------------------- /icons/sectprop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/sectprop.png -------------------------------------------------------------------------------- /icons/stressgen.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/stressgen.paint -------------------------------------------------------------------------------- /icons/stressgen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/stressgen.png -------------------------------------------------------------------------------- /icons/template.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/template.paint -------------------------------------------------------------------------------- /icons/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/template.png -------------------------------------------------------------------------------- /icons/three.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/three.paint -------------------------------------------------------------------------------- /icons/three.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/three.png -------------------------------------------------------------------------------- /icons/two.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/two.paint -------------------------------------------------------------------------------- /icons/two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/two.png -------------------------------------------------------------------------------- /icons/twp.paint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/twp.paint -------------------------------------------------------------------------------- /icons/twp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/twp.png -------------------------------------------------------------------------------- /icons/zoom.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/icons/zoom.mat -------------------------------------------------------------------------------- /interface/superseded/cufsm4p04.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/interface/superseded/cufsm4p04.ico -------------------------------------------------------------------------------- /plotters/beamcolplotdev.m: -------------------------------------------------------------------------------- 1 | clear all 2 | close all 3 | 4 | load temp 5 | %developing figure 6 | P=0.5 7 | Py=1 8 | M11=0.25 9 | M11y=1 10 | M22=0.75 11 | M22y=1 12 | firstyieldflag=1 13 | fy=50; 14 | inc=1; 15 | 16 | if firstyieldflag 17 | %Generate First Yield surface 18 | %degree increment for generating first yield surfaces 19 | %inc=1; %degree 20 | %let's create a first yield surface for M11-M22 space 21 | thetaMM=[0:inc:360]'; 22 | phiPM=0*thetaMM+90; 23 | [betay,PMMymm] = firstyield(node,elem,fy,thetaMM,phiPM); 24 | %let's create a first yield surface for P-M11 space 25 | phiPM=[0:inc:360]'; 26 | thetaMM=0*phiPM; 27 | [betay,PMMypm1] = firstyield(node,elem,fy,thetaMM,phiPM); 28 | %let's create a first yield surface for P-M22 space 29 | phiPM=[0:inc:360]'; 30 | thetaMM=0*phiPM+90; 31 | [betay,PMMypm2] = firstyield(node,elem,fy,thetaMM,phiPM); 32 | end 33 | 34 | %M11-M22 35 | subplot(2,2,2) 36 | plot([0 M11/M11y],[0 M22/M22y],'b--',[M11/M11y],[M22/M22y],'b.','MarkerSize',14) 37 | if firstyieldflag 38 | hold on 39 | plot(PMMymm(:,2),PMMymm(:,3),'r-') 40 | end 41 | xlabel('M_{11}/M_{11y}') 42 | ylabel('M_{22}/M_{22y}') 43 | xrange=xlim; 44 | xrange=[min([-1,xrange(1)]),max([1,xrange(2)])]; 45 | yrange=ylim; 46 | yrange=[min([-1,yrange(1)]),max([1,yrange(2)])]; 47 | axis([xrange yrange]) 48 | hold on,plot(xrange,[0 0],'k-',[0 0],yrange,'k-','LineWidth',0.1) 49 | 50 | %P-M11 51 | subplot(2,2,3) 52 | plot([0 M11/M11y],[0 P/Py],'b--',[M11/M11y],[P/Py],'b.','MarkerSize',14) 53 | if firstyieldflag 54 | hold on 55 | plot(PMMypm1(:,2),PMMypm1(:,1),'r-') 56 | end 57 | xlabel('M_{11}/M_{11y}') 58 | ylabel('P/P_y') 59 | xrange=xlim; 60 | xrange=[min([-1,xrange(1)]),max([1,xrange(2)])]; 61 | yrange=ylim; 62 | yrange=[min([-1,yrange(1)]),max([1,yrange(2)])]; 63 | axis([xrange yrange]) 64 | hold on,plot(xrange,[0 0],'k-',[0 0],yrange,'k-','LineWidth',0.1) 65 | 66 | %P-M22 67 | subplot(2,2,4) 68 | plot([0 M22/M22y],[0 P/Py],'b--',[M22/M22y],[P/Py],'b.','MarkerSize',14) 69 | if firstyieldflag 70 | hold on 71 | plot(PMMypm2(:,3),PMMypm2(:,1),'r-') 72 | end 73 | xlabel('M_{22}/M_{22y}') 74 | ylabel('P/P_y') 75 | xrange=xlim; 76 | xrange=[min([-1,xrange(1)]),max([1,xrange(2)])]; 77 | yrange=ylim; 78 | yrange=[min([-1,yrange(1)]),max([1,yrange(2)])]; 79 | axis([xrange yrange]) 80 | hold on,plot(xrange,[0 0],'k-',[0 0],yrange,'k-','LineWidth',0.1) 81 | 82 | 83 | -------------------------------------------------------------------------------- /plotters/class_post.m: -------------------------------------------------------------------------------- 1 | whos 2 | % 3 | % for i=1:length(lengths) 4 | % clas(i,1:4)=mode_class(b_v,shapes(:,i,mod),ndm,nlm); 5 | % end 6 | % 7 | mod=[1:1:4]; 8 | figure(2) 9 | subplot(2,1,1) 10 | semilogx(lengths,curve(:,2,mod)) 11 | title('standard finite strip half-wavelength vs. lambda curve'), axis tight %axis([10 1e5 0 5]) 12 | subplot(2,1,2) 13 | semilogx(lengths,clas(:,1),'-.',lengths,clas(:,2),':',lengths,clas(:,3),'--',lengths,clas(:,4),'-'),legend('global','distortional','local','other'),axis tight 14 | title('contribution of buckling modes') 15 | -------------------------------------------------------------------------------- /plotters/classifycurve.m: -------------------------------------------------------------------------------- 1 | function []=classifycurve(curvecell,filenamecell,clascell,filedisplay,axesnum,logopt,xmin,xmax,ymin,ymax,fileindex,modeindex) 2 | %BWS 3 | %October 2006 4 | % 5 | axes(axesnum) 6 | cla 7 | % 8 | %Classification breakdown plot 9 | 10 | clas=clascell{fileindex}; 11 | 12 | if ~isempty(clas) 13 | curve=curvecell{fileindex}; 14 | for i=1:max(size(curve)); 15 | curve_length(i,1)=curve{i}(modeindex,1); 16 | clasplot(i,:)=clas{i}(modeindex,:); 17 | end 18 | if logopt 19 | set(gca,'XScale','log') 20 | else 21 | set(gca,'XScale','linear') 22 | end 23 | hold on 24 | hc=plot(curve_length,clasplot(:,1),'-',curve_length,clasplot(:,2),'--',curve_length,clasplot(:,3),'-.',curve_length,clasplot(:,4),':'); 25 | set(hc,'LineWidth',2); 26 | legend(hc,'global','distortional','local','other') 27 | axis tight 28 | axis([xmin xmax 0 100]) 29 | xlabel('length'); 30 | ylabel('modal participation'); 31 | colormap lines(4)%jet 32 | end 33 | % 34 | -------------------------------------------------------------------------------- /plotters/classifycurvemode.m: -------------------------------------------------------------------------------- 1 | function []=classifycurvemode(curvecell,filenamecell,clascell,axesnum,logopt,xmin,xmax,ymin,ymax,fileindex,lengthindex) 2 | %zli 3 | %August 2010 4 | % 5 | axes(axesnum) 6 | cla 7 | % 8 | %Classification breakdown plot 9 | 10 | clas=clascell{fileindex}; 11 | 12 | if ~isempty(clas) 13 | curve=curvecell{fileindex}; 14 | curve_length=[1:length(curve{lengthindex}(:,1))]; 15 | clasplot=clas{lengthindex}; 16 | if logopt 17 | set(gca,'XScale','log') 18 | else 19 | set(gca,'XScale','linear') 20 | end 21 | hold on 22 | hc=plot(curve_length,clasplot(:,1),'-',curve_length,clasplot(:,2),'--',curve_length,clasplot(:,3),'-.',curve_length,clasplot(:,4),':'); 23 | set(hc,'LineWidth',2); 24 | legend(hc,'global','distortional','local','other') 25 | axis tight 26 | axis([xmin xmax 0 100]) 27 | xlabel('mode number'); 28 | ylabel('modal participation'); 29 | colormap lines(4)%jet 30 | end -------------------------------------------------------------------------------- /plotters/dispshp2.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinwalled/cufsm-git/e7a285c814a8b0979056a1a45c0cb430fc1d7ae4/plotters/dispshp2.m -------------------------------------------------------------------------------- /plotters/fibplotoverlay.m: -------------------------------------------------------------------------------- 1 | function [ ] = fibplotoverlay(node,elem,nfiber,fib) 2 | % 3 | %BWS March 2016 4 | %plotter provides an overlay on top of crosssect with fiber locations 5 | 6 | %Plot the elements 7 | for i=1:length(elem(:,1)) 8 | nf=nfiber(i); 9 | nodei = elem(i,2); 10 | nodej = elem(i,3); 11 | xi = node(find(node(:,1)==nodei),2); 12 | zi = node(find(node(:,1)==nodei),3); 13 | xj = node(find(node(:,1)==nodej),2); 14 | zj = node(find(node(:,1)==nodej),3); 15 | theta = atan2((zj-zi),(xj-xi)); 16 | t=elem(i,4); 17 | for j=1:nf 18 | xpatch=[ 19 | ([xi xj]+[-1 -1]*sin(theta)*t/2 + 2*(j-1)/nf*[1 1]*sin(theta)*t/2)', 20 | ([xj xi]+[-1 -1]*sin(theta)*t/2 + 2*(j)/nf*[1 1]*sin(theta)*t/2)'];%, 21 | zpatch=[ 22 | ([zi zj]+[1 1]*cos(theta)*t/2 + 2*(j-1)/nf*[-1 -1]*cos(theta)*t/2)', 23 | ([zj zi]+[1 1]*cos(theta)*t/2 + 2*(j)/nf*[-1 -1]*cos(theta)*t/2)'];%, 24 | patch(xpatch,zpatch,'c','FaceAlpha',0.2) 25 | hold on 26 | end 27 | end 28 | 29 | 30 | 31 | 32 | hold on 33 | 34 | plot (fib(:,2),fib(:,3),'k.'); 35 | 36 | hold off 37 | 38 | end 39 | 40 | -------------------------------------------------------------------------------- /plotters/strainEpic.m: -------------------------------------------------------------------------------- 1 | function []=strainEpic(prop,node,elem,axesnum,scale,mode,L,BC,m_a) 2 | %BWS 3 | %January 2004, modificiations of stress plot for strain energy plot 4 | % 5 | %Recover the strain energy 6 | [se]=energy_density_recovery(prop,node,elem,mode,L,BC,m_a); 7 | %se = [sem seb] m=membrane SE, b=bending SE 8 | % 9 | axes(axesnum) 10 | cla 11 | % 12 | axis('equal') 13 | axis('off') 14 | % 15 | maxse=max(max(abs(se))); 16 | sescale=.1*(max(max(node(:,2:3))))/maxse*scale; 17 | % 18 | hold on 19 | for i=1:length(elem(:,1)) 20 | nodei = elem(i,2); 21 | nodej = elem(i,3); 22 | xi = node(find(node(:,1)==nodei),2); 23 | zi = node(find(node(:,1)==nodei),3); 24 | xj = node(find(node(:,1)==nodej),2); 25 | zj = node(find(node(:,1)==nodej),3); 26 | %Plot the undeformed geometry with the proper element thickness 27 | theta = atan2((zj-zi),(xj-xi)); 28 | t=elem(i,4); 29 | plot( ([xi xj]+[-1 -1]*sin(theta)*t/2),[zi zj]+[1 1]*cos(theta)*t/2 , 'k') 30 | plot( ([xi xj]+[1 1]*sin(theta)*t/2),[zi zj]+[-1 -1]*cos(theta)*t/2 , 'k') 31 | plot( ([xi xi]+[-1 1]*sin(theta)*t/2),[zi zi]+[1 -1]*cos(theta)*t/2 , 'k') 32 | plot( ([xj xj]+[-1 1]*sin(theta)*t/2),[zj zj]+[1 -1]*cos(theta)*t/2 , 'k') 33 | %Plot the strain energy 34 | %element membrane strain energy 35 | sm=sescale*sum(se(i,1)); 36 | %vertices for element by element plotting 37 | xv=[[xi xj]+[-1 -1]*sin(theta)*sm/2 [xj xi]+[1 1]*sin(theta)*sm/2]; 38 | zv=[[zi zj]+[-1 -1]*cos(theta)*sm/2 [zj zi]+[1 1]*cos(theta)*sm/2]; 39 | yv=[0 0 0 0]; 40 | %element total strain energy 41 | stot=sescale*sum(se(i,:)); %element total strain energy 42 | xv2=xv+[[-1 -1]*sin(theta)*stot/2 [1 1]*sin(theta)*stot/2]; 43 | zv2=zv+[[-1 -1]*cos(theta)*stot/2 [1 1]*cos(theta)*stot/2]; 44 | %total (bending actually as membrane goes over the top) 45 | h1=patch(xv2,zv2,yv,[0 1 0]); 46 | %membrane 47 | h2=patch(xv,zv,yv,[1 1 1]); 48 | end 49 | %legend 50 | legend([h1 h2],'SE_{bending}','SE_{membrane}') 51 | -------------------------------------------------------------------------------- /plotters/strainpic.m: -------------------------------------------------------------------------------- 1 | function []=strainpic(node,elem,axesnum,scale,mode) 2 | %BWS 3 | %1998 modified to plot longitudinal displacements in 2003 4 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 5 | %elem: [elem# nodei nodej t] nelems x 4; 6 | %mode: vector of displacements global dof [u1 v1...un vn w1 01...wn 0n]' 7 | % 8 | %v (axial) displacements 9 | disp=mode(2:2:length(node(:,1))*2); 10 | % 11 | axes(axesnum) 12 | cla 13 | % 14 | maxdisp=max(abs(disp)); 15 | %whos node disp maxdisp 16 | dispnorm=[node(:,1) disp/maxdisp]; 17 | maxoffset=scale*1/10*max(max(abs(node(:,2:3)))); 18 | for i=1:length(dispnorm(:,1)) 19 | dispcoord(i,1:3)=[node(i,1) node(i,2)+maxoffset*dispnorm(i,2)... 20 | node(i,3)-maxoffset*dispnorm(i,2)]; 21 | end 22 | % 23 | % 24 | % 25 | for i=1:length(node(:,1)) 26 | if dispnorm(i,2)>=0 27 | plot(node(i,2),node(i,3),'r.','markersize',12) 28 | hold on 29 | else 30 | plot(node(i,2),node(i,3),'b.','markersize',12) 31 | hold on 32 | end 33 | end 34 | axis('equal') 35 | axis('off') 36 | %title('Strain Distribution') 37 | hold on 38 | for i=1:length(elem(:,1)) 39 | nodei = elem(i,2); 40 | nodej = elem(i,3); 41 | xi = node(find(node(:,1)==nodei),2); 42 | zi = node(find(node(:,1)==nodei),3); 43 | xj = node(find(node(:,1)==nodej),2); 44 | zj = node(find(node(:,1)==nodej),3); 45 | % snodei = elem(i,2); 46 | % snodej = elem(i,3); 47 | sxi = dispcoord(find(node(:,1)==nodei),2); 48 | szi = dispcoord(find(node(:,1)==nodei),3); 49 | sxj = dispcoord(find(node(:,1)==nodej),2); 50 | szj = dispcoord(find(node(:,1)==nodej),3); 51 | % plot([xi xj],[zi zj],'k',[sxi sxj],[szi szj],'r',... 52 | % [xi sxi],[zi szi],'r',[xj sxj],[zj szj],'r') 53 | %Plot the undeformed geometry with the proper element thickness 54 | theta = atan2((zj-zi),(xj-xi)); 55 | t=elem(i,4); 56 | plot( ([xi xj]+[-1 -1]*sin(theta)*t/2),[zi zj]+[1 1]*cos(theta)*t/2 , 'k') 57 | plot( ([xi xj]+[1 1]*sin(theta)*t/2),[zi zj]+[-1 -1]*cos(theta)*t/2 , 'k') 58 | plot( ([xi xi]+[-1 1]*sin(theta)*t/2),[zi zi]+[1 -1]*cos(theta)*t/2 , 'k') 59 | plot( ([xj xj]+[-1 1]*sin(theta)*t/2),[zj zj]+[1 -1]*cos(theta)*t/2 , 'k') 60 | %Plot the strain distribution 61 | if dispnorm(i,2)>=0 62 | plot([xi sxi],[zi szi],'r') 63 | else 64 | plot([xi sxi],[zi szi],'b') 65 | end 66 | if dispnorm(i,2)>=0 67 | plot([xj sxj],[zj szj],'r') 68 | else 69 | plot([xj sxj],[zj szj],'b') 70 | end 71 | plot([sxi sxj],[szi szj],'k') 72 | end 73 | hold off 74 | -------------------------------------------------------------------------------- /plotters/strainpic2.m: -------------------------------------------------------------------------------- 1 | function []=strainpic2(node,elem,axesnum,scale,disp) 2 | %BWS 3 | %2004 modification to plot any nodal quantity out-of-plane 4 | % 5 | %1998 modified to plot displacements in 2003 6 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 7 | %elem: [elem# nodei nodej t] nelems x 4; 8 | %mode: vector of displacements global dof [u1 v1...un vn w1 01...wn 0n]' 9 | % 10 | %v (axial) displacements 11 | %disp=mode(2:2:length(node(:,1))*2); 12 | % 13 | axes(axesnum) 14 | cla 15 | % 16 | maxdisp=max(abs(disp)); 17 | %whos node disp maxdisp 18 | dispnorm=[node(:,1) disp/maxdisp]; 19 | maxoffset=scale*1/10*max(max(abs(node(:,2:3)))); 20 | for i=1:length(dispnorm(:,1)) 21 | dispcoord(i,1:3)=[node(i,1) node(i,2)+maxoffset*dispnorm(i,2)... 22 | node(i,3)-maxoffset*dispnorm(i,2)]; 23 | end 24 | % 25 | % 26 | % 27 | for i=1:length(node(:,1)) 28 | if dispnorm(i,2)>=0 29 | plot(node(i,2),node(i,3),'r.','markersize',12) 30 | hold on 31 | else 32 | plot(node(i,2),node(i,3),'b.','markersize',12) 33 | hold on 34 | end 35 | end 36 | axis('equal') 37 | axis('off') 38 | %title('Strain Distribution') 39 | hold on 40 | for i=1:length(elem(:,1)) 41 | nodei = elem(i,2); 42 | nodej = elem(i,3); 43 | xi = node(find(node(:,1)==nodei),2); 44 | zi = node(find(node(:,1)==nodei),3); 45 | xj = node(find(node(:,1)==nodej),2); 46 | zj = node(find(node(:,1)==nodej),3); 47 | snodei = elem(i,2); 48 | snodej = elem(i,3); 49 | sxi = dispcoord(find(node(:,1)==nodei),2); 50 | szi = dispcoord(find(node(:,1)==nodei),3); 51 | sxj = dispcoord(find(node(:,1)==nodej),2); 52 | szj = dispcoord(find(node(:,1)==nodej),3); 53 | plot([xi xj],[zi zj],'k',[sxi sxj],[szi szj],'r',... 54 | [xi sxi],[zi szi],'r',[xj sxj],[zj szj],'r') 55 | end 56 | hold off 57 | -------------------------------------------------------------------------------- /plotters/strespic.m: -------------------------------------------------------------------------------- 1 | function []=strespic(node,elem,axesnum,scale) 2 | %BWS 3 | %1998 4 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 5 | %elem: [elem# nodei nodej t] nelems x 4; 6 | axes(axesnum) 7 | cla 8 | % 9 | maxstress=max(abs(node(:,8))); 10 | stress=[node(:,1) node(:,8)/maxstress]; 11 | maxoffset=scale*1/10*max(max(abs(node(:,2:3)))); 12 | for i=1:length(stress(:,1)) 13 | stresscoord(i,1:3)=[node(i,1) node(i,2)+maxoffset*stress(i,2)... 14 | node(i,3)-maxoffset*stress(i,2)]; 15 | end 16 | % 17 | % 18 | % 19 | axis('equal') 20 | axis('off') 21 | %title('Stress Distribution') 22 | hold on 23 | for i=1:length(elem(:,1)) 24 | nodei = elem(i,2); 25 | nodej = elem(i,3); 26 | xi = node(find(node(:,1)==nodei),2); 27 | zi = node(find(node(:,1)==nodei),3); 28 | xj = node(find(node(:,1)==nodej),2); 29 | zj = node(find(node(:,1)==nodej),3); 30 | %snodei = elem(i,2); 31 | %snodej = elem(i,3); 32 | sxi = stresscoord(find(node(:,1)==nodei),2); 33 | szi = stresscoord(find(node(:,1)==nodei),3); 34 | sxj = stresscoord(find(node(:,1)==nodej),2); 35 | szj = stresscoord(find(node(:,1)==nodej),3); 36 | %Plot the undeformed geometry with the proper element thickness 37 | theta = atan2((zj-zi),(xj-xi)); 38 | t=elem(i,4); 39 | xpatch=[ 40 | ([xi xj]+[-1 -1]*sin(theta)*t/2)', 41 | ([xj xi]+[1 1]*sin(theta)*t/2)'];%, 42 | zpatch=[ 43 | ([zi zj]+[1 1]*cos(theta)*t/2)', 44 | ([zj zi]+[-1 -1]*cos(theta)*t/2)'];%, 45 | patch(xpatch,zpatch,'y') 46 | hold on 47 | %plot([xi xj],[zi zj],'b.'); 48 | %plot( ([xi xj]+[-1 -1]*sin(theta)*t/2),[zi zj]+[1 1]*cos(theta)*t/2 , 'k') 49 | %plot( ([xi xj]+[1 1]*sin(theta)*t/2),[zi zj]+[-1 -1]*cos(theta)*t/2 , 'k') 50 | %plot( ([xi xi]+[-1 1]*sin(theta)*t/2),[zi zi]+[1 -1]*cos(theta)*t/2 , 'k') 51 | %plot( ([xj xj]+[-1 1]*sin(theta)*t/2),[zj zj]+[1 -1]*cos(theta)*t/2 , 'k') 52 | %Plot the stress distribution 53 | if node(nodei,8)>=0 54 | plot([xi sxi],[zi szi],'r') 55 | else 56 | plot([xi sxi],[zi szi],'b') 57 | end 58 | if node(nodej,8)>=0 59 | plot([xj sxj],[zj szj],'r') 60 | else 61 | plot([xj sxj],[zj szj],'b') 62 | end 63 | plot([sxi sxj],[szi szj],'k') 64 | end 65 | %plot nodes 66 | for i=1:length(node(:,1)) 67 | if node(i,8)>=0 68 | plot(node(i,2),node(i,3),'r.','markersize',12) 69 | hold on 70 | else 71 | plot(node(i,2),node(i,3),'b.','markersize',12) 72 | hold on 73 | end 74 | end 75 | 76 | hold off 77 | -------------------------------------------------------------------------------- /plotters/warppic.m: -------------------------------------------------------------------------------- 1 | function []=warppic(node,elem,scale,Xs,Ys,w,axesnum) 2 | %Badri Hiriyur 3 | %2002 4 | %node: [node# x z dofx dofz dofy dofrot stress] nnodes x 8; 5 | %elem: [elem# nodei nodej t] nelems x 4; 6 | %axes(axesnum) 7 | [A,xcg,zcg,Ixx,Izz,Ixz,thetap,I11,I22]=grosprop(node,elem); 8 | cla 9 | % 10 | maxwarp=max(abs(w(1,:))); 11 | warp=[node(:,1) w/maxwarp]; 12 | maxoffset=scale*1/10*max(max(abs(node(:,2:3)))); 13 | for i=1:length(warp(:,1)) 14 | warpcoord(i,1:3)=[node(i,1) node(i,2)+maxoffset*warp(i,2)... 15 | node(i,3)-maxoffset*warp(i,2)]; 16 | end 17 | % 18 | % 19 | % 20 | axis('equal') 21 | axis('off') 22 | %title('Warping function Distribution') 23 | hold on 24 | for i=1:length(elem(:,1)) 25 | nodei = elem(i,2); 26 | nodej = elem(i,3); 27 | xi = node(find(node(:,1)==nodei),2); 28 | zi = node(find(node(:,1)==nodei),3); 29 | xj = node(find(node(:,1)==nodej),2); 30 | zj = node(find(node(:,1)==nodej),3); 31 | % 32 | theta = atan2((zj-zi),(xj-xi)); 33 | t=elem(i,4); 34 | %plot the cross-section with appropriate thickness shown 35 | xpatch=[ 36 | ([xi xj]+[-1 -1]*sin(theta)*t/2)', 37 | ([xj xi]+[1 1]*sin(theta)*t/2)'];%, 38 | zpatch=[ 39 | ([zi zj]+[1 1]*cos(theta)*t/2)', 40 | ([zj zi]+[-1 -1]*cos(theta)*t/2)'];%, 41 | patch(xpatch,zpatch,'y') 42 | hold on 43 | %plot([xi xj],[zi zj],'b.'); 44 | % 45 | snodei = elem(i,2); 46 | snodej = elem(i,3); 47 | sxi = warpcoord(find(node(:,1)==nodei),2); 48 | szi = warpcoord(find(node(:,1)==nodei),3); 49 | sxj = warpcoord(find(node(:,1)==nodej),2); 50 | szj = warpcoord(find(node(:,1)==nodej),3); 51 | plot([xi xj],[zi zj],'k',[sxi sxj],[szi szj],'r',... 52 | [xi sxi],[zi szi],'r',[xj sxj],[zj szj],'r') 53 | end 54 | 55 | for i=1:length(node(:,1)) 56 | if w(i)>=0 57 | plot(node(i,2),node(i,3),'r.','markersize',12) 58 | hold on 59 | else 60 | plot(node(i,2),node(i,3),'b.','markersize',12) 61 | hold on 62 | end 63 | end 64 | 65 | 66 | x0=Xs;%+xcg; 67 | y0=Ys;%+zcg; 68 | plot(x0,y0,'m+'); 69 | text(x0-0.1*(max(node(:,2))-min(node(:,2))),y0,'S'); 70 | 71 | plot(0,0,'w.') 72 | text(0,0,' O') 73 | plot([0 min(1/4*max(node(:,3)),1/4*max(node(:,2)))],[0 0],'w:') 74 | plot([0 0],[0 min(1/4*max(node(:,3)),1/4*max(node(:,2)))],'w:') 75 | 76 | 77 | plot([0 x0],[0 0],'g:') 78 | plot([x0 x0],[0 y0],'g:') 79 | plot(x0,0,'x'); 80 | text(x0/2,0,'X_s'); 81 | text(x0,y0/2,'Z_s'); 82 | 83 | title('Warping Function \omega'); 84 | hold off 85 | -------------------------------------------------------------------------------- /test.m: -------------------------------------------------------------------------------- 1 | %test 2 | clear all 3 | close all force 4 | % Create a figure 5 | fig = figure; 6 | 7 | numControls=10; 8 | 9 | % Disable rendering temporarily 10 | hold off; 11 | 12 | % Create uicontrols without rendering 13 | for i = 1:numControls 14 | hControls(i) = uicontrol('Style', 'pushbutton', 'String', ['Button ' num2str(i)], 'Position', [10 10+30*(i-1) 80 25]); 15 | end 16 | 17 | % Enable rendering 18 | hold on; 19 | 20 | % Force a manual update 21 | drawnow; --------------------------------------------------------------------------------