once manual spec 043

Upload: rodneyholland

Post on 07-Aug-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/21/2019 Once Manual Spec 043

    1/232

    Version 0.4.3 (beta) - August 10, 2014 - page 1

    ON-C-E BETA

    OPENCALCULATION ENVIRONMENT FORSTRUCTURAL CALCULATIONS AND DOCUMENTS

    USER MANUAL and SPECIFICATION

    Program and template database: http://on-c-e.orgSimplified program for testing: http://on-c-e.usGitHub source code and docs: http://on-c-e.github.io

    Trello roadmap:Structural scripts forum:

    http://on-c-e.infohttp://open-scripts.net

    Contact rod holland: [email protected]

    LOOSE TE XT IN PUT

    PYTH ON R AN G E AN D DE PTH

    LATE X CLAR ITY

    E QUATION AN D TABLEFOR MATTIN G

    http://on-c-e.org/http://on-c-e.us/http://on-c-e.github.io/http://on-c-e.info/http://open-scripts.net/http://c/Users/rhh/Dropbox/StructureLabs/outils/manual/[email protected]://c/Users/rhh/Dropbox/StructureLabs/outils/manual/[email protected]://open-scripts.net/http://on-c-e.info/http://on-c-e.github.io/http://on-c-e.us/http://on-c-e.org/
  • 8/21/2019 Once Manual Spec 043

    2/232

    Version 0.4.3 (beta) - August 10, 2014 - page 2

    on-c-eis an open source project started byStructureLabs.The project was initiated tostimulate design variety and creativity in research and practice by simplifying the

    composition, modification, review and sharing of structural engineering calculations.

    Features- implements a simple, readable, natural markup language- produces clear, explicit, organized calculation documents

    - facilitates sharing and reuse through web databases- runs on workstations, web platforms and mobile devices

    - uses Python engineering and scientific libraries- integrates with other structural engineering programs

    Model

    Database

    IDE or Browser

    Interface

    Workstation,

    Web or Mobile

    Python Platform

    Simplicity is the ultimate sophistication.Leonardo da Vinci

    Structural

    Model

    http://www.structurelabs.com/http://www.structurelabs.com/http://www.structurelabs.com/
  • 8/21/2019 Once Manual Spec 043

    3/232

    Version 0.4.3 (beta) - August 10, 2014 - page 3

    CONTENTS

    1. INTRODUCTION ............................................................................................................. 5

    2. ADD A SIMPLE TEMPLATE TO ONCE-DB ........................................................... 6

    3. GENERATE A CALC FROM A TEMPLATE ............................................................ 7

    4. ON-C-E OVERVIEW ....................................................................................................... 8

    5. FILES AND PATHS .......................................................................................................... 9

    6. MODEL OPERATIONS ................................................................................................ 11

    7. PROJECT OPERATIONS .............................................................................................. 11

    8. WEB RESOURCES .......................................................................................................... 13

    9. INTERACTIVE ANALYSIS .......................................................................................... 15

    APPENDIX AEXAMPLE MODEL AND CALC ......................................................... 17

    APPENDIX B OPERATIONS............................................................................................ 23

    APPENDIX CKOMODO EDIT ....................................................................................... 30

    APPENDIX DLINUX, WINDOWS, MAC, IOS, ANDROID .................................... 32

    APPENDIX EWAKARI, PYTHONANYWHERE ....................................................... 36

    APPENDIX FMINIMUM PROGRAMS AND LIBRARIES ....................................... 38

    APPENDIX GLICENSES ................................................................................................... 39

    APPENDIX HSECURITY AND NAMESPACES ........................................................ 41

    APPENDIX IEXAMPLES .................................................................................................. 42

    INDEX ......................................................................................................................................... 43

  • 8/21/2019 Once Manual Spec 043

    4/232

    Version 0.4.3 (beta) - August 10, 2014 - page 4

    Figures

    Figure 1. Program and interface structure .......................................................................... 5Figure 2. Basic environment components .......................................................................... 9Figure 3. Model, calc and project content......................................................................... 13Figure 4. Screenshots of equation history in IPython terminal and QT shells..... 16Figure 5. Example PDF calc ................................................................................................. 20Figure 6. Example PDF calc (continued)......................................................................... 21Figure 7. Example PDF calc (continued)......................................................................... 22Figure 8. Komodo interface ................................................................................................... 30Figure 9. Notesy screenshot of onceutf calc running on iPhone.............................. 33

    Figure 10. DroidEdit screenshot of onceutf calc running on Android tablet.......... 35Figure 11. Wakariterminal and editor in split windows............................................ 36Figure 12.PythonAnywhereside by side browser windows..................................... 37Figure 13. http://opensource.org/licenses/MIT.......................................................... 39Figure 14. http://creativecommons.org/publicdomain/zero/1.0/.......................... 40

    Tables

    Table 1. Open source components (See Appendices D, E for details)............................. 8Table 2. File and folder structure......................................................................................... 10Table 3. Operations summary .............................................................................................. 12Table 4. Minimum required versions of programs and libraries................................ 38

    http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008058http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008058http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008058http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008058http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008060http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008060http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008060http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008061http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008061http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008061http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008062http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008062http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008062http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008062http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008061http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008060http://c/Users/rhh/Dropbox/StructureLabs/once-utils/manual/once-manual-spec-041_x.docx%23_Toc395008058
  • 8/21/2019 Once Manual Spec 043

    5/232

    Version 0.4.3 (beta) - August 10, 2014 - page 5

    1.Introduction

    on-c-e(pronounced once) implements a readable, sequentially organized markup language for writingand publishing structural engineering calculations. Calculations are stored in text files called modelsortemplatesthat describe structural behavior using equations, text, tables and figures. It has advantages

    relative to Mathematica , Mathcad or MATLAB - it is much easier to generate calculationdocuments, files will never be incompatible, and the program can be modified and freely shared.

    Models generate design or analysis calculations. Templates are shareable models, with public domainlicenses, that do not represent specific designs. A model generates two types of formatted calculationdocuments referred to as calcs (see Appendices A and H for examples). A UTF calc is used foriterative design and study and is generated instantly using UTF-8characters. A PDF calctakes a fewseconds to generate and includes graphics and LaTeX math. It is used for formal reports orconstruction documents. Models can interact with other models, files and external structuralengineering programs to produce calcs and input to IPython notebooks for interactive analysis.

    Typical models are less than a few hundred lines. Because they are text they can be searched and stored

    in many types of databases. From a software point of view, models are instructions given in a structuralcalculation markup language to Python scientific and engineering librariesand external programs.

    Calcs may be standalone PDF or UTF-8 documents, or combined into a single PDF project calc.Typical calcs are less than one or two dozen pages but project calcs can be as large as needed. A projectcalc is defined in a project file that specifies organization, numbering, title blocks and table of contents.From a software point of view, calcs are produced by wrapping the numpyand sympylibraries in astructural document formatting language.PDF andproject calcsare produced by processing the calcthrough reStructuredText, docutils, LaTeXand PyPDF2libraries.

    on-c-eruns on workstations, web, and mobile platforms (UTF calcs) on top of Python (Section 4).

    On workstations the interface is an Interactive Development Environment(Appendix C),onwebplatform a browser (Appendix E),andon mobile platforms anApp (Appendix D).

    Figure 1. Program and interface structure

    Workstation

    Web platform

  • 8/21/2019 Once Manual Spec 043

    6/232

    Version 0.4.3 (beta) - August 10, 2014 - page 6

    2.Add a simple template to once-db

    This page describes the simplest approach to adding a template to the once-dbdatabase. The purposeof the exercise is to gain an initial familiarity with the process.

    We will use the template 0001.simple.txtand modify it to make a new template. Everything will bedone in a browserno installation is needed.

    Step 1. Go tohttp://on-c-e.org. Click on [Download Model Templates] at the top of the page.

    Step 2. Scroll down to search once-db, click on the descriptiondropdown box and select contains.Enter the search term simple example. Click on the Searchbutton. One or more results shouldappear at the bottom of the page. If you search only on example you will see a number of templates.

    Step 3. Look for the template name 0001.simple.txt and the associated calc namescal0001.simple.txtand cal0001.simple.pdf.Click on the links that begin with calto view the twodifferent calc formats in a browser window.

    Step 4. Select the window forcal0001.simple.txt.Press the keys CTRL-A or select all of the templatetext by dragging the mouse. Press CTRL-C or right click in the browser window and select copy tocopy the text to the clipboard.

    Step 5. Click on [Upload Model Templates] at the top of the page. Scroll down to the box labeledTemplate Text and enlarge it by left clicking on the handle in the lower right corner and dragging it.Click in the box and press CTRL-V or right click and select paste. You should now have a copy of thetemplate in the box.

    Step 5. Read over the template and edit the text, terms, and equations to representyour own idea. Maybe you want to change it to a calculation of calories or driving timeto work. The only rules you need to follow are to leave the tags and vertical bars inplace and just edit the text between them or delete the whole line with the tag. Section6 provides an overview and Appendix B describes what each tag does in more detail.

    When you finish editing the template, type a brief template summary in theTemplateSummary Descriptionbox above. Include the phrase learning templatein thedescription. Delete all of the words example from the template and description(so it doesnt showup in a search). Dont worry about the template contents; thelearning templates will be removed from the database every few days.

    Step 6. Click on the Submit button. You should receive a confirmation message thatthe template was submitted.

    Thats it! Thanks for learning how to contribute.

    (note: typically the template file will be prepared on your computer and uploaded)

    Upload

    Template

    EditTemplate

    http://on-c-e.org/http://on-c-e.org/http://on-c-e.org/http://structurelabs.knackhq.com/oncedb#home/http://structurelabs.knackhq.com/oncedb#home/http://structurelabs.knackhq.com/oncedb#upload-model/http://structurelabs.knackhq.com/oncedb#upload-model/http://structurelabs.knackhq.com/oncedb#upload-model/http://structurelabs.knackhq.com/oncedb#home/http://on-c-e.org/
  • 8/21/2019 Once Manual Spec 043

    7/232

    Version 0.4.3 (beta) - August 10, 2014 - page 7

    3.Use a template to generate a calc

    This page describes the simplest approach to running an example template. It uses a web platform thatdoes not require program installation.

    on-c-eis designed to run on workstations with Python installed, but it can alsorun in the cloud on Python web platforms like Wakari andPythonAnywhere.They provide an in-browser editorand shell terminal interface. WakariandPythonAnywhereare discussed in the manual but other Python web platformscan be used. Appendix E provides additional details for web execution. AppendixD discusses installation of the program on a computer or mobile device.

    For this exercise a simple example model is run on a Python web platform using the programonceutfnnn.py. You can preview and download other models athttp://on-c-e.org. Printed examplemodels and calc output are provided in Appendix I.onceutf.pyis a single file subset of on-c-e thatdoes not include project options, PDF calcs, or unit overrides. It was written to simplify programtesting and implementation on web and mobile platforms.

    1. Sign up for a free Wakari account athttp://continuum.io/or

    PythonAnywhereat https://www.pythonanywhere.com/

    2. Download onceutfnnn.pyand 0101.simple.txtor0101.template.txtfrom http://on-c-e.us

    3. Upload the program and template files to a folder on your Wakari orPythonAnywhere account. Choose a bash shell terminal from the drop-down list and open it (Appendix E). At the shell command line check that

    both files are in the folder you selected (type lsor dir). Enter thecommand

    python onceutfnnn.py 0001.simple.txt -e

    where nnn is the program version number (i.e. 040).

    The model will write several files to the directory (Table 2) and echo the log file and calc,cal0101.simple.txt, to the screen. You can open the calc using the browser editor provided by theweb platform. The switches following the model name echo the calc to the console (e)or browser(b). The browser option works when run on local computer.

    Congratulation on running your first model!

    (note: refer to Appendix D for on-c-einstallation instructions)

    I C O N K E Y

    Web Document

    Exercise

    Summary

    Run

    template

    http://on-c-e.org/http://on-c-e.org/http://continuum.io/https://www.pythonanywhere.com/%E2%80%8Ehttp://on-c-e.us/http://on-c-e.us/http://on-c-e.us/https://www.pythonanywhere.com/%E2%80%8Ehttp://continuum.io/http://on-c-e.org/
  • 8/21/2019 Once Manual Spec 043

    8/232

    Version 0.4.3 (beta) - August 10, 2014 - page 8

    4.on-c-e Overview

    TheOpeN Calculation Environmentis defined by on-c-e components and components from the OpenSource community:

    - oncepya Python package- onceutf.pya single file subset ofoncepy that produces UTF calcs. It simplifies testing and

    implementation in web and mobile environments. Installation is a simple file copy to a folder.- onceipy.pya module that updates the IPythonhistory database with on-c-eequations- once-db - an online database for sharing template files accessible through browser- xxyymodel.txta model file that produces a calculation

    - Komodo Edit - a multilanguage IDE for Windows, Linux, OSX (other IDEs may be used)- Anaconda 1.9.2 - a scientific Python distribution for Windows, Linux, OSX (other may be used)- Wakaria web based scientific Python distribution with browser interface (others may be used)- Pythonista - a Python platform for iOS- QPython - a Python platform for Android

    oncepy is writtenfor Python 2 or 3. Python is a dynamic, high-level, general-purpose languagewidely used for engineering and scientific scripting and programs. For comparisons with othernumerical computing environments, such as MATLAB,see for example:

    http://www.stat.washington.edu/~hoytak/blog/whypython.html

    https://sites.google.com/site/pythonforscientists/python-vs-matlab

    Table 1. Open source components (See Appendices D, E for details)

    MATLAB

    vs

    P thon

    Komodo EditIDE

    AnacondaPythonPlatform

    WakariWebPlatform

    oncepy once-dbonceutf.py

    Links activestate.com anaconda wakari.io on-c-e.org oncedb

    OS Windows, Linux and OSX

    DetailsFull featured open

    source IDE for multiplelanguages

    Enterprise-ready distribution forscientific computing

    Python package andsingle file subset for

    structural calculations

    Online templatedatabase with web

    interface

    Sponsor Active StateCanada ContinuumUSA StructureLabsUSA

    LicenseMozilla Public

    LicenseVarious Open Source Licenses

    Program: MIT LicenseModels: CCO1.0 Public Domain

    http://www.stat.washington.edu/~hoytak/blog/whypython.htmlhttps://sites.google.com/site/pythonforscientists/python-vs-matlabhttp://www.activestate.com/komodo-edit/downloadshttps://store.continuum.io/cshop/anacondahttps://wakari.io/https://wakari.io/http://on-c-e.org/http://on-c-e.org/http://structurelabs.knackhq.com/oncedb#home/http://structurelabs.knackhq.com/oncedb#home/http://on-c-e.org/http://on-c-e.org/https://wakari.io/https://store.continuum.io/cshop/anacondahttp://www.activestate.com/komodo-edit/downloadshttps://sites.google.com/site/pythonforscientists/python-vs-matlabhttp://www.stat.washington.edu/~hoytak/blog/whypython.html
  • 8/21/2019 Once Manual Spec 043

    9/232

    Version 0.4.3 (beta) - August 10, 2014 - page 9

    5.Files and Paths

    The fundamental environment component is a model file xxyy.model.txt, where modelis a user-created file name and xxyyis a four digit model designation. The first two digits refer to the divisionnumber and the last two to the model number. The designation is used for calc and project organization

    and must be unique. Models are stored in division folders and which in turn are stored in a projectfolder (one level deep). When a model is run it produces the following output files (Figure 2, Table 2):

    - UTF-8 calc calxxyy.model.txt.

    - calc description file sumxxyy.model.txt(can be pasted in the once-dbdescription)

    - IPython input file _onceeq.pyfor interactive analysis.

    - execution log file_modelog.txt, also (partially) echoed to screen.

    - optional PDF calc calxxyy.model.pdf and supporting files(.rst, .tex, .log, .out, fls, fdb_latexmksee Appendix D for intermediate file handling).

    - optional project calc project.pdfassembled from a specified set of division folders.

    Models are grouped in division folders and may include references to other models, externalfunctions, data, and batch or script control files. External files are generally located in the modeldivision folder and are identified by file name only. The program recreates the full path nameinternally, which allows division folders to be moved without changing models. The exceptionsinclude files manipulated by the disk operation options r(read) and e(edit) which require a fullpath name, and comodels imported with option iwhich require the division folder name (seeoperation [d]with optionsi, r, ein Appendix B).

    A division folder has the name xxdivision_namewhere xxis the unique division number. Eachdivision or project folder may contain up to 100 models or divisions respectively. The project

    folder contains the optional project definition file and may contain unit and PDF style definitionfiles (unitc.py, once.sty) that override program defaults. Definition files in a division file overrideall other definition files.

    Figure 2. Basic environment components

  • 8/21/2019 Once Manual Spec 043

    10/232

    Version 0.4.3 (beta) - August 10, 2014 - page 10

    Table 2. File and folder structure

    Project Files Project / Division Folder Structure Division Files

    xxyy.model.txt

    Model

    (project.txt)

    Project file(unitc.py)

    Custom units

    (background.pdf)

    Calc background

    (unitc.py)

    Custom units

    (once.sty)

    Custom PDF style

    (once.sty)

    Custom PDF style

    calxxyy.model.txt

    UTF-8 calc

    sumxxyy.model.txt

    Model description

    (project.pdf)

    Project calc

    _onceeq.py

    IPython file

    (project.log.txt)

    Project execution log

    _log.txt

    Model execution log

    (calxxyy.model.pdf)

    PDF calc

    Notes:

    1. Input files are in blue; output in green

    2. Optional files are in parenthesis

    3. PDF calc auxillary files are erased by default (Appendix D)

    To keep auxillary files use noclean command line option

  • 8/21/2019 Once Manual Spec 043

    11/232

    Version 0.4.3 (beta) - August 10, 2014 - page 11

    6.Model Operations

    Models are composed of a dozen operations. Operations include sections, terms, equations

    checks, arrays, functions, and format(see Figure 3, Table 3, and Appendix B). When operationsare processed the calc sections and equations are sequentially numbered. Equations are firstformatted symbolically and then with numerical substitutions. The degree of printed detail iscontrolled by formatting statements. Tables are created from arrays and vectors. Units anddecimal places are reduced and formatted (see unitc.pyfile). PDF calcs start a new page at everysection and figures are inserted.

    Operations are identified by bracketed tagsand may occur in any order or frequency as long aseach term or variable is defined before use. Operations are executed sequentially, in the order theyare entered. Nesting is not permitted. Parameters and options associated with tags are providedon the same line, separated by vertical bars (|). Parameters with defaults or empty parameters maybe omitted but the bar delimiters (with at least one space in between) must be provided. Arraysdo not include unit processing. Operations may extend over single or multiple lines. Tags forsingle line operations include [d],[o],[t].Tags for multi-line operations include [c],[a],[f],[e],[s]. Multi-line operations are terminated with a blank line.

    The disk operation[d] performs several file functions depending on the option selected.Options are designated by s, t, o, w, f, i, r, e. The option sreads external Pythonfiles that can define functions available to the function tag [f].The option iimports a comodelinto the main model. A comodel is a model that does not import other models (only one level ofmodel recursion is permitted). Other options import figures and text, and execute read, write, editand run operations on external files and programs.

    Tags may be indented to improve model readability (4 spaces is standard). Any text in the modelnot associated with an operation tag is passed through to the output unchanged, includingreStructuredText markup. For example, surrounding text with **double asterisks** will printbold, *single asterisks* will print italicsand a vertical bar in the first column will force a new linein PDF calcs. See thereST quick referencefor further documentation.

    7.Project Operations

    Projectoperations are identified with tags [p]and [#] pformat. The operation writes a projectcalc with the name project.pdf to the project folder, overwriting an existing file. The projectoperation is divided into a project data definition section and a division (folder) inclusion list

    (Table 3 and Appendix B). Each division designation includes the option to override the projectdefaults on a calc by calc basis. Project data is defined by a dictionary of keyword-data pairs thatcan easily be incorporated into databases. The project format operation defines the page printlocation, if any, for a specific piece of project data.

    Project calcs produced from the project operation are ordered assemblies of PDF calcs with a titlepage, table of contents, title blocks and navigational links.

    http://docutils.sourceforge.net/docs/user/rst/quickref.htmlhttp://docutils.sourceforge.net/docs/user/rst/quickref.htmlhttp://docutils.sourceforge.net/docs/user/rst/quickref.htmlhttp://docutils.sourceforge.net/docs/user/rst/quickref.html
  • 8/21/2019 Once Manual Spec 043

    12/232

    Version 0.4.3 (beta) - August 10, 2014 - page 12

    Table 3. Operations summary

    Tags Operations (optional parameters) Notes

    [d]

    Disk file[d] folder/file | option | (var1) | (var2) | (var3)

    option is one ofs,t,o,w,f,i,r,e

    [o]

    Symbolic representation[o] sympy symbolic expression

    Expression is

    printed but notevaluated.

    [t] Term[t] description | var = value

    [c]

    Check expression against limit[c] decimal | description | ok

    expression | op | limit

    [a]

    Array table[a] format_number | table description

    range variablesvar = expression

    For format referencenumbers see formatoperation.

    [f]

    Function[f] var | function description

    function_name()

    Functions aredefined in externalfiles and importedwith [d] | s|

    [e] Equation[e] format_number | equation description

    var = expression

    [s]

    Section[s] section heading

    section description

    [ ]

    format

    break

    stop

    Format or comment

    [#] format | (deci, deci) | (out type)format_number | (deci, deci) | (units) | (label/prnt code)

    [#] break[#] stop[#] comment line

    [#]followed by

    format, break orstop are specialcases. stopterminates modelprocessing.

    [p]

    Project data (requires once33py)[p] (pdf size) | (background.pdf)keyword = data | (format_number)keyword = data |01_divisionfolder | (division title)model_name1 | (pdf size) | (background1.pdf)keyword = format_number | keyword = format_number | | |

    model_name2 | |keyword = format_number | | | |

    02_divisionfolder03_divisionfolder

    Model files arefirst processed toPDF.

    [ ]

    pformat

    Project formats (requires oncepy)

    [#] pformat | format_numberkeyword | x location | y locationkeyword | x location | y location

    [#]followed byformat is a specialcase. Terminate withblank line

  • 8/21/2019 Once Manual Spec 043

    13/232

    Version 0.4.3 (beta) - August 10, 2014 - page 13

    Figure 3. Model, calc and project files

    Calc SetLaTeX-PDF File

    Model File

    EQUATION

    TERM TERM

    SECTION

    FUNCTIONS

    EQUATIONS

    SECTION SECTION

    Model File Contains

    ASCII INPUTS OUTPUTS

    ProjectFile

    Contains

    Single Calc FileLaTeX-PDF

    or UTF-8

    Calc Document

    file list andformatting

    instructions

    projectinformation

    Calc Document

    Calc Document

    Model File

    calc templatefile name

    Table of Contents

    TEXT AND

    FIGURES

  • 8/21/2019 Once Manual Spec 043

    14/232

    Version 0.4.3 (beta) - August 10, 2014 - page 14

    8. Web Resources

    Download Models

    http://on-c-e.org

    Upload Models

    http://on-c-e.org/upload-model

    Download and installAnaconda 1.9.2. Usingpip, install Unum, tabulateandPyPDF2. InstallTex Live2014. Download and install Komodo Edit (seeAppendices D and F).

    Although any text editor is adequate for composing and running models, the most effective tool is aninteractive development environment (IDE). It provides project and file management, fontmanagement, code navigation, templates, custom toolbars and macros, syntax coloring, window layoutcontrols and remote file access. Komodo Editis an open source workstation IDE which can managePython, TCL, Rubyand other programing languages applicable to structural engineering work. SeveralKomodo specific tools are provided for on-c-eand described in Appendix C. Although Komodo isdiscussed in this manual other IDEs may be used.

    About on-c-e.org

    User manual http://on-c-e.us/Komodo Edit http://activestate.com/komodo-editDejaVu Fonts http://dejavu-fonts.org/wiki/Main_PageWorkstation (Anaconda 1.9.2) http://repo.continuum.io/archive/index.html Web Platform (Wakari) https://wakari.io/onceutf http://on-c-e.usoncepy http://on-c-e.org/programs/model database http://on-c-e.org/TeX Live

    https://www.tug.org/texlive/

    Code and docs http://on-c-e.github.io/Road map http://on-c-e.info/

    Share

    models

    Run

    locally

    Find

    http://on-c-e.org/http://on-c-e.org/http://on-c-e.org/upload-modelhttp://on-c-e.org/http://on-c-e.org/http://on-c-e.us/http://on-c-e.us/http://activestate.com/komodo-edithttp://activestate.com/komodo-edithttp://dejavu-fonts.org/wiki/Main_Pagehttp://dejavu-fonts.org/wiki/Main_Pagehttp://repo.continuum.io/archive/index.htmlhttp://repo.continuum.io/archive/index.htmlhttps://wakari.io/https://wakari.io/http://on-c-e.us/http://on-c-e.us/http://on-c-e.org/programs/http://on-c-e.org/programs/http://structurelabs.knackhq.com/oncedb#home/https://www.tug.org/texlive/https://www.tug.org/texlive/http://on-c-e.github.io/http://on-c-e.info/http://on-c-e.info/http://on-c-e.info/http://on-c-e.github.io/https://www.tug.org/texlive/http://structurelabs.knackhq.com/oncedb#home/http://on-c-e.org/programs/http://on-c-e.us/https://wakari.io/http://repo.continuum.io/archive/index.htmlhttp://dejavu-fonts.org/wiki/Main_Pagehttp://activestate.com/komodo-edithttp://on-c-e.us/http://on-c-e.org/http://on-c-e.org/upload-modelhttp://on-c-e.org/
  • 8/21/2019 Once Manual Spec 043

    15/232

    Version 0.4.3 (beta) - August 10, 2014 - page 15

    9. Interactive Analysis

    In some cases equation level interactive analysis and design is preferred over completemodel runs. An import equation file, _onceeq.py,is written when on-c-eis run andmay be used for interactive analysis. Three interactive interfaces are available:

    o Komodo IDE(commercial version): Cut and paste the entire onceeq.pyfile into the interactive shell for access to equations and terms.

    o IPython Notebook: http://ipython.org/notebook.html Cut and paste theentire onceeq.pyfile into a notebook cell for interactive access to equationsand terms.

    o IPython Terminal andQt shell: http://ipython.org/

    Equations from_onceeq.pyare loaded into a shell in two steps:

    1. Copy onceipy.py to the Python /lib/site-packages directory. The scriptonceipy.py updates the IPython history.sqliltedatabase with the equations.

    2. _onceeq.pyis loaded into Ipython using the run command.

    Both steps are executed by the IPymacro button on the Komodo on-c-etoolbar (seeAppendix C). Run this macro after running the model and when the model or calc hasfocus. Prior to using the button, modify the command "run_onceipy" (at the end ofthe tool list in the Komodo toolbox) by adding the location of the history.sqlite directoryto the command line entry (do not type brackets), i.e.

    python -m onceipy.py [C:\Users\rhh\.ipython\profile_default]

    When onceipyis run, the equations are read from the _onceeq.pyfile generated by on-c-e. They are assigned the next session number in the history.sqlitedatabase andadded to the end of the file. A backup copy of the file is made before the new equationrecords are added.

    If the history.sqlite file becomes too large or corrupted it may be deleted and reinitializedsimply by running IPython from the command line.

    Equations and terms are available in the shell through command history scrolling (up or

    down arrows) or using the %rep refcommand, where ref is the equation historyreference.

    http://ipython.org/notebook.htmlhttp://ipython.org/notebook.htmlhttp://ipython.org/http://ipython.org/http://ipython.org/http://ipython.org/notebook.html
  • 8/21/2019 Once Manual Spec 043

    16/232

    Version 0.4.3 (beta) - August 10, 2014 - page 16

    Figure 4. Screenshots of equation history in IPython terminal and QT shells

  • 8/21/2019 Once Manual Spec 043

    17/232

    Version 0.4.3 (beta) - August 10, 2014 - page 17

    Appendix AExample Model and Calc

    Example Template / Model

    [s] Example 0101 - basic model template

    This example template calculates the mid-span beam momentunder uniformly distributed (UDL) floor loads. It demonstrates**section [s], term [t] equation [e] and [#] format operations**.reStructuredText inline markup is also used.

    [d] beam.png | f | Simply supported beam | 70 |

    [s] Beam Loads and geometryDead and live load contributions to beam UDL and beam layoutconfiguration

    **Dead loads** from permanent weights[t] joists | jst_DL = 3.8*PSF[t] plywood | ply_DL = 2.1*PSF

    [t] partitions | part_DL = 10.0*PSF[t] fixed machinery | equip_DL = 0.5*KLF

    **Live loads** from people and moveable items[t] ASCE7-O5 | live_LL = 40*PSF

    **Beam tributary width and span**[t] distance between beams | trib_width = 2*FT[t] beam span | span = 14*FT

    [s] Maximum bending momentCalculate factored UDL loads and bending moment at mid-span of beam

    [e] 010122 | Total UDL factored dead loadDL_D = 1.4 * (trib_width *(jst_DL + ply_DL + part_DL) + equip_DL)

    [e] 010122 | Total UDL factored live loadLL_D = 1.7 * trib_width * live_LL

    [e] 010122 | factored UDLomega_1 = DL_D + LL_D

    [e] 010123 | Bending moment at mid-spanM_0 = omega_1 * span**2 / 8

    [#] format | 3,3 | pdf010122 | 2,2 | KLF | 2

    010123 | 2,1 | KIP*FT | 3

    [#] This file contains a generic on-c-e model template (the template).[#] It is distributed under the CCO 1.0 Public Domain Dedication at[#] http://creativecommons.org/publicdomain/zero/1.0/[#] The template is not a structural design calculation and[#] must be modified by the user prior to use.[#] The template user assumes sole and complete responsibility for[#] all existing or modified inputs and the computed model results.

  • 8/21/2019 Once Manual Spec 043

    18/232

    Version 0.4.3 (beta) - August 10, 2014 - page 18

    UTF calc

    UTF calccontinued next page

    07/19/14 21:04:30

    ==========================================================================================[1] Example 0101 - basic model template [0101]==========================================================================================

    This example model calculates the mid-span beam momentunder uniformly distributed (UDL) floor loads. It demonstrates**section [s], term [t] equation [e] and [#] format operations**.reStructuredText inline markup is also used.

    Figure 1. Simply supported beam

    ==========================================================================================[2] Beam Loads and geometry [0101]==========================================================================================

    Dead and live load contributions to beam UDL and beam layout configuration

    **Dead loads** from permanent weightsjoists | jst_DL = 3.8 [psf]plywood | ply_DL = 2.1 [psf]partitions | part_DL = 10.0 [psf]fixed machinery | equip_DL = 0.5 [kips/ft]

    **Live loads** from people and moveable itemsASCE7-O5 | live_LL = 40 [psf]

    **Beam tributary width and span**distance between beams | trib_width = 2 [ft]

    beam span | span = 14 [ft]

  • 8/21/2019 Once Manual Spec 043

    19/232

    Version 0.4.3 (beta) - August 10, 2014 - page 19

    ==========================================================================================[3] Maximum bending moment [0101]==========================================================================================

    Calculate factored UDL loads and bending moment at mid-span of beam

    -----------------------------------------------------------------------------------------

    DL_D | Total UDL factored dead load [3.1]

    1.4equip_DL + 1.4trib_width(jst_DL + part_DL + ply_DL)

    DL_D = 0.74 [kips/ft]-----------------------------------------------------------------------------------------

    -----------------------------------------------------------------------------------------LL_D | Total UDL factored live load [3.2]

    1.7live_LLtrib_width

    LL_D = 0.14 [kips/ft]

    -----------------------------------------------------------------------------------------

    -----------------------------------------------------------------------------------------omega_1 | factored UDL [3.3]

    DL_D + LL_D

    omega_1 = 0.88 [kips/ft]-----------------------------------------------------------------------------------------

    -----------------------------------------------------------------------------------------M_0 | Bending moment at mid-span [3.4]

    2

    span

    8

    2

    0.88 [kips/ft]14.00 [ft]

    8

    M_0 = 21.6 [ft.kip]-----------------------------------------------------------------------------------------

    ____________________________________________________________________________

    This calc (the calc) is generated from a generic on-c-e model template.The calc is distributed under the CCO 1.0 Public Domain Dedicationhttp://creativecommons.org/publicdomain/zero/1.0/The calc is not a structural design calculation and the template must bemodified by the user prior to use. The calc user assumes sole and completeresponsibility for all existing inputs and results.____________________________________________________________________________

    [end of calc]

  • 8/21/2019 Once Manual Spec 043

    20/232

    Version 0.4.3 (beta) - August 10, 2014 - page 20

    Figure 5. Example PDF calc

  • 8/21/2019 Once Manual Spec 043

    21/232

    Version 0.4.3 (beta) - August 10, 2014 - page 21

    Figure 6. Example PDF calc (continued)

  • 8/21/2019 Once Manual Spec 043

    22/232

    Version 0.4.3 (beta) - August 10, 2014 - page 22

    Figure 7. Example PDF calc (continued)

  • 8/21/2019 Once Manual Spec 043

    23/232

    Version 0.4.3 (beta) - August 10, 2014 - page 23

    Appendix BOperations

    Calcs are composed of nine model operations: three operations are single lines with thetags [d], [o], [t], and six operations are multiline with tags [c], [a], [f], [e], [s],and [#] format. Project calcs are built with a multiline operation using the [p]and

    [#] formattags. All multiline operations are terminated with a blank line.

    [d] (path)/filename | s,t,o,w,f,i,r,e | (v1) | (v2) | (v3)

    The disk operationprocesses external disk files according to single letter options.Files for the first 5 options are located in the model folder and are specified by file nameonly. The model folder and name are used for the ioperation. Full file paths are usedfor the rand eoptions. This approach makes a model as portable as possible acrossdifferent folder organizations.

    filename:file name used in disk operation. See details for each parameter type.v1-v3:variables specific to the disk operation option. See details.s:execute Python file in model. Typically used to process external functions.t:add text file boilerplate to output (no operations are processed).o:run an operating system batch or script file. Typically runs a program.w:write values of variable to CSV file. Overwrites existing files. w+appends files.f:insert image from file into calc (jpg, png etc.)i:insert and process a comodel file. Integrates sections and equation numbering.r:read CSV file data into array variable.e:edit line of existing text file and save in copy of file.

    s:execute an external Python script in model namespace.

    Executes an external Python script and includes the methods (functions) andvariables in the model namespace.

    t:inset text file contents into output (no operations are processed).

    Inserts the text file contents at the operation location. The varparameteroptionally specifies the line range to be inserted for lines n1:n2inclusive.

    o:run an operating system command or executable file.

    w:write array values to file.

    Write contents of array v1to the file specified by filename. Each line or row iswritten using the numpy.tofilemethod. To append data to an existing file usethe option w+. v2 specifies the separation character (comma is default, for aspace character use *). v3 is the data type (default is character format %s).

  • 8/21/2019 Once Manual Spec 043

    24/232

    Version 0.4.3 (beta) - August 10, 2014 - page 24

    f:insert figure from file into calc (jpg, png etc.).

    Insert figure from file with caption v1. Figure labels are automatically addedand incremented.v2specifies the image width in percent of document width.The figure is centered and the aspect ratio is maintained. v3specifies a side by

    side arrangement for a second consecutive figure using the keywordadjacent

    .For UTF-8 output the following text is inserted:Figure n: caption - file: filename

    i:insert and process a comodel file.division_folder/file:model folder and file name

    Merge a comodel file into the main model file at the operation location. Thecomodel cannot include a comodel. Sections and equation numbers areintegrated into the main model sequence. Format numbers must be unique inthe two models (see format operation for suggested format numbering schemes).

    r:read file data into variablepath/file:absolute path name

    Read CSV contents ofpath/filenameinto variable v1and store as array usingthe numpy.genfromtext method. v2 specifies the separation character(comma is default, for space character use *). v3 specifies the number of linesto skip before reading the data (default is 0).

    e:edit text filepath/file:absolute path name

    Edit an external file at run time. Lines immediately following the edit operationhave the form:

    n | replacement text for line n

    where nis the line number to be replaced with the specified replacement text.The v1parameter is appended to the file name before it is saved with edits i.e. ifv1is copyand the filename is file.tclthe edited file is saved as filecopy.tcl.

    Template variables may be used in the replacement line. A template variable is

    created by appending a % in front of the variable name used in the model.

  • 8/21/2019 Once Manual Spec 043

    25/232

    Version 0.4.3 (beta) - August 10, 2014 - page 25

    [o]Python or sympy expression

    The symbolic operationformats a sympy symbolic expression without evaluatingthe terms.

    [t

    ]var = value | (description)

    The term operationis used to assign values to terms used in equations. It evaluatesexpressions that multiply by constants or units.

    var = value:define termdescription:term description

    [ ] The hash operationis used for non-printing comments. If the comment isformatthe format operation is subsequently processed. If the comment is breakarestructured page break is inserted in the calc. If the comment is stopthe programprocesses the model to that point, along with any formats in the model. This can beuseful for developing and debugging a model.

    [ ] format |(default dec, default dec) | (calc output type)

    format number |(deci, deci) | (units/label)` | (prt code/label)format number |(deci, deci) | (units/label) | (prt code/label)

    The format operationcontrols printed detail, decimals, units and labels forequations and arrays. Use print detail code 0, 1 or 2 for equations that return vectors.2D arrays do not use a print detail code.

    default deci:number of printed decimal places in equation and result (default 3, 3)calc output type:txt, rst orpdf (default is txt). Not read when running onceutf.Set the command line option tonoclean to retain rstfile. See Appendix D.format number:Unique five digit equation or array format number between 1 and99999. Typically the first four digits are the model number and the fifth digit is thesection number. This pattern facilities organization and guarantees uniqueness.deci, deci:override umber of printed decimal places in equation and resultunits/row label:unum unit for dependent variable or label for first range variableprint code/column label:For equations provide print code (default is 3) where:

    0- evaluate but do not print result1- print result2- print symbolic expansion and result3- print full result: symbolic expansion, substitution and result

    For arrays, provide row and column labels in place of units and print codes.

  • 8/21/2019 Once Manual Spec 043

    26/232

    Version 0.4.3 (beta) - August 10, 2014 - page 26

    [c] decimal, decimal | description | okexpression | operation | limit

    The check operationchecks an expression value (no variable assignment) against alimit for a given operation.

    decimal:number of printed decimal places in equation, result (default 3, 3)description:description of comparisonexpression:expression to evaluatetypically a ratiooperation:Python expression with comparison operator (, =, =)limit:value or expression to evaluate that sets upper or lower limitok:phrase that prints if compare evaluates to True. If expression evaluates to False theword not isprepended. May be blank.

    [a] format ref | array descriptionvector variable1(vector variable2 for 2D arrays)

    var = expression

    The array operationinput is similar to the equation operation but outputs the resultsof vector equations in tables 1D or 2D table with column and row labels. Rangevariables and expressions must be unitless. If they have units the program attempts toremove them before processing. If only one range variable is provided a single row tableis output. The variable name may be a previously defined vector. Note that the numberof printed decimals corresponds to the first entry in the integer pair.

    variable1:a range statement or variable containing vector or array values.variable2:a range statement for 2D tables.var = expression:unitless equation using Python syntax

    [f]var | function descriptionfunction_name(args)

    The function operationexecutes a function and assigns the return value to variable

    var. The function is defined in a Python file and imported using the [d]operation withthe soption. Describe the function using the function doc strings which are importedinto the model. Printed decimals should be controlled by the function itself.

    var :one line description of functionfunction description :short description of functionfunction_name(args):name of function and arguments to be executed

  • 8/21/2019 Once Manual Spec 043

    27/232

    Version 0.4.3 (beta) - August 10, 2014 - page 27

    [e]format number | (description)var = expression

    The equation operationevaluates a Python math statement and optionally prints

    the symbolic representation, equation with substituted values and solution. The formatoperation ([#] format) controls the level of printing detail, decimals and units.Equation input may extend over a maximum of three lines. Terminate the operationwith a blank line. Indenting equations, terms, functions and arrays may help legibility.

    format ref:integer between 1 and 999999 that references a formatting operation.description:equation description and building code referencesvar = expression: equation using Python syntax

    [s]

    section heading(description)

    The section operationprovides organization to the calculation. Sections areautomatically numbered and labeled with the associated model. The source modeldesignation number is added to the section heading and right justified. Equationnumbers are generated within sections as s . ewhere erestarts at 1 in each section.

    heading:left justified headingdescription:up to 10 lines of text (no blank lines) describing the section. Terminate

    with blank line.

  • 8/21/2019 Once Manual Spec 043

    28/232

    Version 0.4.3 (beta) - August 10, 2014 - page 28

    .

    [p](project default size) | (default background.pdf)(keyword = data) | (format_number)

    (keyword = data) |(keyword = data) |

    .

    .

    01(_divisionfolder) | (division title)

    01yy.model.txt| size| background2.pdf

    keyword = data | keyword = data | | |

    02 | (division title)

    02yy.model.pdf| size| nobackground

    03 | (division title)

    03yy.model.txt| size| background2.pdf

    keyword = -1| kewyword = -1| | |04 | (division title)

    04yy.model.pdf| | omit

    | | | |

    04yy.model.pdf| size |

    05 | (division title)

    The project operationis specified in the project file and provides project calcinformation. Project files are located in the project folder which in turn contain divisionfolders as subfolders.

    size:size and orientation settings of PDF pages.

    portrait_letter (default)

    landscape_letter

    landscape_tableau (11x17)

    portrait_A4

    landscape_A4

    background.pdf:user file name for the calc background (default: none)

    keyword = data:keyword-data pairs to be added to the project dictionary. Any key

    word may be defined except for key words reserved for project calc printing. Theyinclude:

    ptitle, pname, padd1, padd2, pstate, pzip, powner, pnumber, eng,date, rev, stamp1, stamp2

  • 8/21/2019 Once Manual Spec 043

    29/232

    Version 0.4.3 (beta) - August 10, 2014 - page 29

    xx(_divisionfolder):by default include calcs from this folder in the project calcs.If _divisionfolder is provided as part of the folder name it is used for the divisionname in the project calcs (i.e. table of contents). If division title is provided it isused instead.

    For each model in the folder, if a PDF calc is available, it is used. Otherwise the modelis run to produce the PDF calc.

    Project settings may be overridden for a specified calc or model. If defaultbackground.pdfis set, then set the value to nobackgroundto suppress the defaulttemplate and all keywords for a particular calc. To omit a calc from the project set useomit for the template value. A keyword datamay be redefined for a specific calc.To suppress writing the keyword value to a calc set its value to -1. To write onlykeyword data without a template specify the keyword data on the keywordoverride line.

    The project or division folder may also include the file once.stywhich defines the

    LaTeX PDF style settings, and the unitc.pyfile which defines calc units. They willoverride the default settings in the oncepypackage directorydivision folder filesoverride project folder files.

    [ ] pformat | format_number

    The project format operationdescribes the print location on a calc sheet of

    keyword data defined in the project operation. Terminate format numberdefinitions with a blank line.

    keyword | x location | y location

    keyword | x location | y location

    keyword | x location | y location

    .

    .

    keyword: project keywordx location:x location of keyword value on page in points from upper left corner.y location:y location of keyword value on page in points from upper left corner.

  • 8/21/2019 Once Manual Spec 043

    30/232

    Version 0.4.3 (beta) - August 10, 2014 - page 30

    Appendix CKomodo Edit

    Figure 8. Komodo interface

    UTF 8 calc output

    echo of log output

    f

    e

    m

    model or template input

    on c e toolbar

    operation tools

  • 8/21/2019 Once Manual Spec 043

    31/232

    Version 0.4.3 (beta) - August 10, 2014 - page 31

    Template files can be prepared using any text editor however Komodo Edit provides additionaluseful capabilities and tools. on-c-esyntax coloring and operation tools are provided to improvereadability and efficiency. A on-c-etoolbar is provided to simplify program execution.

    Install on-c-e utilities and fonts in Komodo

    1. Download and install DejaVu fonts from

    http://dejavu-fonts.org/wiki/Main_Page

    A point size of 9 and line width of 90 is suggest.

    The toolbar operates on the model or calc that has focus

    2. Download and unzip oncetoolsnnn.zip

    3. Install the on-c-e tools folderby - right clicking in tool box paneimport folderselect on-c-e_tools folder from the unzipped file. Tools include a tool bar,documentation menu and code snippetsthat can be inserted into models bydouble clicking.

    4. Close and reopen Komodo to complete installation. Edit a tool by right clicking on itin the tool pane and selecting Properties. Pane arrangement can be controlled by the

    user.

    5. Install the syntax coloring pluginonce-0.3.1-ko.xpi using the menu - ToolsAdd On. Select the xpi file from the unzipped oncetoolsnnnfolder. To see oncesyntax coloring in your file set the language for the .txtfile type to type onceusingthe right click context Properties and Settings when the file is open.

    6. After running a model the UTF calc is automatically opened in the input pane. Theassociated PDF calc is opened in the default PDF viewer. The macros that controlthe running of PDF calcs have timers that may need to be adjusted, depending onthe computer speed.

    7. The suggested model line length is 90 characters using mono-spaced 9pt font.Indents should be spaces, not tab characters. UTF calcs are formatted to a 90character width.

    8. PDF calcsrequire installation ofTexLive. See Appendix D and F

    openonce-db

    run modelin oncepy

    insert date

    run modelin onceutf

    reloadfile

    close allfiles

    open PDF calcfrom UTF calc run model

    in IPy

    http://dejavu-fonts.org/wiki/Main_Pagehttp://dejavu-fonts.org/wiki/Main_Pagehttp://dejavu-fonts.org/wiki/Main_Page
  • 8/21/2019 Once Manual Spec 043

    32/232

    Version 0.4.3 (beta) - August 10, 2014 - page 32

    Appendix DLinux, Windows, Mac, iOS, Android

    Install local copy of onceutf.py on Linux, Windows, Mac:Install a scientific Python distribution. Copy onceutfnnn.pyand the model file into the

    same folder, open a console window in the folder and type:

    python onceutfnnn.py modfile.m.txt (-e or b) (-noclean)

    where nnnis the program version number (i.e. 040), nnnn.modfile.txtis the file nameof the input model, -eorb are options to echo calculation results to the console orterminal or browser andnoclean retains the auxiliary PDF files (erased by default).

    To open a terminal window in in Windows 7 or 8, navigate to the folder with the model,hold the shift key, right click in the folder and click on 'open command window here'.Change the browser encoding settings if needed:

    Chrometype chrome:settings/fonts in url bar - scroll to the bottom of thedialog box to make the change.

    Firefox - options - content - advanced - UTF-8

    Internet Explorer - right click in window - encoding - UTF-8

    For UTF font symbols install font package fromhttp://dejavu-fonts.org/wiki/Main_Page

    Install local site-packagescopy of onceutf on Linux, Windows, Mac:Install a scientific Python distribution. Copy the onceutfnnn.pyfile into thePython/Lib/site-packages/ folder and rename to onceutf.py.Run from any directory

    with the command

    python m onceutf nnnn.modfile.txt

    Install a complete oncepy environment on Linux, Windows, Mac:1. Install Anaconda 1.9.22. Install unum and tabulate modules (using pip install)3. Install TexLive4. Install DejaVu Fonts (and set to Mono in IDE)5. Install Komodo Edit6. Install on-c-e tools for Komodo

    7. Unzip and copy the oncepyfolder into the Python/Lib/site-packages/8. Run from any folder containing the model file with the command:python m oncepy nnnn.modfile.txt

    See Section 8 for program links

    http://dejavu-fonts.org/wiki/Main_Pagehttp://dejavu-fonts.org/wiki/Main_Pagehttp://dejavu-fonts.org/wiki/Main_Page
  • 8/21/2019 Once Manual Spec 043

    33/232

    Version 0.4.3 (beta) - August 10, 2014 - page 33

    Install onceutf on iOS:

    onceutf runs in the iOSPythonistaAppenvironment which includes numpy, sympyand matplotlib libraries. Copy the onceutf.pyfile to the site-packagesfolder and amodel file to a division folder.

    Without Dropbox integration files will need to be moved by creating new empty files inPythonista and using copy and paste (script for downloading Dropbox files toPythonistahttps://omz-forums.appspot.com/pythonista/post/4995757044137984).

    Open the onceutf.py program in Pythonista and create an action(wrench menu) for it,leaving the argument blank. Open a model or template. Run it by invoking the action.The calc will be echoed to the screen. The following script makes it convenient to iteratea model by editing in Pythonista and viewing with the Notesy App(UTF-8 fonts).

    notesy.py script (http://on-c-e.us)"""open Pythonista calc in Notesy

    1. Copy this script to Pythonista and set it as an action.2. Set the fixed width font in Notesy to DejaVu Sans Mono."""import editorimport webbrowserimport clipboardbase = 'notesy://x-callback-url/append?name=calc_tmp.txt'text = editor.get_text()url = clipboard.set(text)webbrowser.open(base)

    Figure 9. Notesy screenshot of onceutf calc running on iPhone

    https://omz-forums.appspot.com/pythonista/post/4995757044137984https://omz-forums.appspot.com/pythonista/post/4995757044137984https://omz-forums.appspot.com/pythonista/post/4995757044137984http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/https://omz-forums.appspot.com/pythonista/post/4995757044137984
  • 8/21/2019 Once Manual Spec 043

    34/232

    Version 0.4.3 (beta) - August 10, 2014 - page 34

    Install onceutf on Android:

    onceutf runs in the QPythonApp(Python 2) environment on Android. Copy the

    compiled numpy and sympy libraries into the site-packages folder at

    /mnt/sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages .

    The compiled libraries are available through QPython sites and also athttp://on-c-e.us.Matplotlib libraries are not yet available.

    The following file arrangement and script makes it convenient to iterate and review amodel. It uses the DroidEdit Appto edit the model and view the calc. The HackersKeyboard Appis efficient for writing models.

    once.py script (http://on-c-e.us)

    #qpy:console"""once.py script runs a onceutf model on Android using QPython

    1. Copy onceutf.py to the scriptsfolder (see prog path below)2. Create a division folder for the models (see model path below)3. Copy the model and this script into the division folder4. Open this script in QEdit (which is part of QPython)5. Modify folder and model names below, as needed, and save.6. Edit models and review calcs in DroidEdit (or similar editor).7. Set the editor font to DejaVu Sans Mono for calc math symbols.8. Run this script in QEdit to execute program.

    """

    import os, sys

    prog ='/mnt/sdcard/com.hipipal.qpyplus/scripts/onceutf.py'model ='/mnt/sdcard/com.hipipal.qpyplus/models/0301.deflection.txt'os.system(sys.executable + + prog + + model)

    http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/http://on-c-e.us/
  • 8/21/2019 Once Manual Spec 043

    35/232

    Version 0.4.3 (beta) - August 10, 2014 - page 35

    Figure 10. DroidEdit screenshot of onceutf calc running on Android tablet

  • 8/21/2019 Once Manual Spec 043

    36/232

    Version 0.4.3 (beta) - August 10, 2014 - page 36

    Appendix EWakari, PythonAnywhere

    Onceutf.pyruns on desktop and web platforms. Both environments are discussed inthis section.

    Wakariis a Python-Linux web platform that runs in the browser. Uploadonceutfnnn.pyand mode.01.txtto your Wakari account. Open a bash shellwindow(not Ipython) and type

    python onceutfnnn.py 0101.simple.txt c

    at the command prompt, where nnn is the version number (i.e. 040). The program willoutput a model summary followed by the calc output (thec option echoes the outputto stdout; useb to echo output to the browser when using the program locally). Use the

    browser file editor to review and modify the files.

    Figure 11. Wakariterminal and editor in split windows

    This is a calc opened

    in a Wakari editor.

    Double click the file

    name in the file

    dashboard to the left.

    This is a calc log in the

    terminal window after

    running the model from

    the terminal window

    command line.

    Use Anaconda 1.8 or 1.9 for shell

  • 8/21/2019 Once Manual Spec 043

    37/232

    Version 0.4.3 (beta) - August 10, 2014 - page 37

    PythonAnywhereis a Python-Linux web platform that runs in the browser. Uploadonceutfnnn.pyand mode.001.txtto your PythonAnywhereaccount. Open a bashshellwindow (not Ipython or Python) and type

    python onceutfnnn.py 0101.simple.txt c

    at the command prompt, where nnn is the version number (i.e. 040). The program willoutput a model summary followed by the calc output (thec option echoes the outputto stdout). Edit files in the file editor.

    Figure 12.PythonAnywhereside by side browser windows

    This is the file dashboard.

    Click the icon adjacent to

    the model or calc file name

    to open in an editor.

    This is a calc log in the

    terminal window after

    running the model from

    the terminal window

    command line.

  • 8/21/2019 Once Manual Spec 043

    38/232

    Version 0.4.3 (beta) - August 10, 2014 - page 38

    Appendix FMinimum Programs and Libraries

    Note: If the standard scientific distribution does not include a library use the pip installmethod or in the case of Anaconda use conda. Other installed scientific librariesincluding SciPy, pandas, rpy etc. may be installed by the distribution or installedseparately and will be available to on-c-ethrough functions and script operations (seedisk operations, Appendix B).

    Program Python 2 Python 3 Notes

    onceutf 0.4.0 0.4.0Python 2.7.x and above 3.4 and above Python PlatformNumpy 1.7.x and above 1.8 and above Python LibrarySymPy 0.7.x and above 0.7.5 and above Python LibraryMatplotlib 1.2.x and above 1.3.1 and above Python LibraryDejaVu fonts(note: Unumandtabulateare built-inclasses of onceutf

    2.3.4 and above 2.3.4 and above UTF math fonts (externalprogram)

    oncepyin addition to above

    0.4.0 0.4.0

    Unum 4.1.x and above 4.1.x and above Install with pipTabulate 0.7.x and above 0.7.x and above Install with piponce.sty 0.4.0 0.4.0 Customize PDF stylesunitc.py 0.4.0 0.4.0 Customize units

    oncepy with PDFin addition to above

    0.4.0 0.4.0

    TeX Live 2013 and above 2013 and above Network install (externalprogram)

    PyPDF2 1.1x and above 1.1x and above Install with pip

    Table 4. Minimum required versions of programs and libraries

  • 8/21/2019 Once Manual Spec 043

    39/232

    Version 0.4.3 (beta) - August 10, 2014 - page 39

    Appendix GLicenses

    oncepy, onceutf andon-c-e Komodo tools are distributed under the MITor compatiblelicense. Copyright is retained by the code author.

    Figure 13.http://opensource.org/licenses/MIT

    http://opensource.org/licenses/MIThttp://opensource.org/licenses/MIThttp://opensource.org/licenses/MIThttp://opensource.org/licenses/MIT
  • 8/21/2019 Once Manual Spec 043

    40/232

    Version 0.4.3 (beta) - August 10, 2014 - page 40

    Figure 14. http://creativecommons.org/publicdomain/zero/1.0/

    Template files uploaded to once-dbare made available to others under the CCO 1.0 PublicDomain Dedication. A Komodosnippet is provided for inserting license text in a template file:

    [#] This file contains a generic on-c-e model template (the template).

    [#] The template is distributed under the CCO 1.0 Public Domain Dedication[#] http://creativecommons.org/publicdomain/zero/1.0/[#] The template is not a structural design calculation and[#] must be modified by the user prior to use.[#] The template user assumes sole and complete responsibility for[#] all existing or modified inputs and the computed model results.

    If the license is in the template a similar license is appended to the calc.

  • 8/21/2019 Once Manual Spec 043

    41/232

    Version 0.4.3 (beta) - August 10, 2014 - page 41

    Appendix HSecurity and Namespaces

    on-c-eis designed to be a flexible and efficient tool for structural analysis and design. Itis also designed to facilitate program verification by keeping the source code relativelycompact. onceutf.pyand oncepyare each about 1500 lines of source code (about 3000lines with comments). Programming tradeoffs occur in pursuing these objectives.

    The programs use Python execand eval statements because it is the simple,straightforward way to process the model operations. It is possible to send input to execand eval that does unexpected or undesirable things. However the chances of thishappening can be controlled or eliminated with relatively little effort. Sensible model fileinput is tightly constrained and under the control of engineers and designers who arerunning the models. Appropriate inputs, in the form of structural analysis equations,arrays and functions are well known and easily recognized by the engineers using thetool. Because unsafe code in the model would appear very different from these wellunderstood structural forms it is straightforward to spot and delete suspicious orproblematic model code before it is run. Model security checks may be added in thefuture but the only way to ensure proper operation of the program is to check the input.

    The programs also import numpy, sympyand other libraries in their entirety into themodel namespace. This approach improves readability and streamlines equation inputbut may introduce potential problems with naming collisions. Some variable namingrules have been developed and more will be added as experience is gained using theprogram. The programs currently includes some tools and methods for checking

    collisions between model variable names and more will be added.

    In summary, to make on-c-emore readable, useful and flexible, the design philosophychosen is code simplicity and transparency, along with the obviousness of appropriateinput as opposed to verbose and restrictive input and processing policies.

  • 8/21/2019 Once Manual Spec 043

    42/232

    Version 0.4.3 (beta) - August 10, 2014 - page 42

    Appendix IExamples

    This appendix includes the PDF calc output for each example. The PDF calcs are followed

    by inputs and outputs for each example, in order: (1)model (2)UTF calc (3) IPython file(4) function file (5)summary file (6)log file. Download example files athttp://on-c-e.org.

    00_Simple: 0001.simple.txt

    Demonstrates: sections, terms and equations

    01_Template: 0101.template.txt

    Sections, terms, equations and inline reStructuredText

    02_Bearing:0201.bearing.txt

    Figures, complex equations, limit checks

    03_Deflection: 0301.deflection.txt

    Figures, arrays, equation expansion options

    04_Seismic:

    0401.bldg_info.txt term lists, inline reStructuredText

    0402.seismic.txt built-in math functions

    0403.seismic.txt comodels, symbolic expressions

    0404.frame.txt sections, arrays

    0405.brace.txt limit checks

    05_Eigenvector: 0501.eigenvector.txt

    External functions, plotting and linear algebra library.

    06_OpenSees: 0601.truss.txt

    Read, edit and disk operations for external programs and data

    07_Matrix: 0701.stiffness.txt

    External functions, plotting and linear algebra library

    http://on-c-e.org/http://on-c-e.org/http://on-c-e.org/http://on-c-e.org/
  • 8/21/2019 Once Manual Spec 043

    43/232

    Version 0.4.3 (beta) - August 10, 2014 - page 43

    Index

    0101.template.txt, 7, 42

    Android, 8, 32, 34, 35

    arrays, 11, 25, 26, 27, 41, 42

    ASCII, 9

    calc, 6, 7, 9, 10, 11, 23, 24, 28, 29, 31, 36,

    37, 42

    calculation, 5, 7, 8, 9, 27, 32

    DejaVu, 14, 31, 38Download, 7, 14, 31

    equations, 12, 25, 27fonts, 14, 31, 32

    Fonts, 14

    format, 11, 12, 23, 24, 25, 26, 27, 28, 29

    functions, 23, 42

    IDE, 8, 14

    install, 14, 38

    interactive analysis, 5, 8, 9, 15

    iOS, 8, 32, 33

    IPython, 4, 5, 8, 9, 15, 16, 42

    Komodo Edit, 14LaTeX, 29

    Linux, 8, 32, 36, 37

    MATLAB, 8

    model, 7, 8, 9, 10, 11, 14, 23, 24, 25, 28,

    31, 32, 36, 37, 40

    on-c-e , 2, 5, 7, 8, 14, 31, 38, 39

    once-db, 8, 40

    onceutf, 8, 14, 25, 32, 33, 34, 38, 41

    OpenSees, 42

    OSX, 8

    PDF, 10, 12, 38project, 4, 5, 7, 9, 10, 11, 14, 28, 29

    Python, 7, 8, 10, 14, 23, 26, 27, 36, 37, 38

    PythonAnywhere, 7, 36, 37

    Pythonista, 8, 33

    QPython, 8, 34

    sections, 11, 23, 27, 42

    sqlilte, 15

    template, 6, 7, 8, 24, 29, 31, 40

    terms, 25, 27

    TexLive, 31

    Upload, 7, 14, 36, 37

    UTF, 5, 10, 24, 31, 32, 38, 42

    UTF-8, 5, 10, 24, 32

    Wakari, 7, 8, 36

    Windows, 8, 32

    StructureLabs15 Blanca Drive

    Novato, CA 94947Phone 415.314.8453 [email protected]

  • 8/21/2019 Once Manual Spec 043

    44/232

  • 8/21/2019 Once Manual Spec 043

    45/232

  • 8/21/2019 Once Manual Spec 043

    46/232

  • 8/21/2019 Once Manual Spec 043

    47/232

  • 8/21/2019 Once Manual Spec 043

    48/232

  • 8/21/2019 Once Manual Spec 043

    49/232

  • 8/21/2019 Once Manual Spec 043

    50/232

  • 8/21/2019 Once Manual Spec 043

    51/232

  • 8/21/2019 Once Manual Spec 043

    52/232

  • 8/21/2019 Once Manual Spec 043

    53/232

  • 8/21/2019 Once Manual Spec 043

    54/232

  • 8/21/2019 Once Manual Spec 043

    55/232

  • 8/21/2019 Once Manual Spec 043

    56/232

  • 8/21/2019 Once Manual Spec 043

    57/232

  • 8/21/2019 Once Manual Spec 043

    58/232

  • 8/21/2019 Once Manual Spec 043

    59/232

  • 8/21/2019 Once Manual Spec 043

    60/232

  • 8/21/2019 Once Manual Spec 043

    61/232

  • 8/21/2019 Once Manual Spec 043

    62/232

  • 8/21/2019 Once Manual Spec 043

    63/232

  • 8/21/2019 Once Manual Spec 043

    64/232

  • 8/21/2019 Once Manual Spec 043

    65/232

  • 8/21/2019 Once Manual Spec 043

    66/232

  • 8/21/2019 Once Manual Spec 043

    67/232

  • 8/21/2019 Once Manual Spec 043

    68/232

  • 8/21/2019 Once Manual Spec 043

    69/232

  • 8/21/2019 Once Manual Spec 043

    70/232

  • 8/21/2019 Once Manual Spec 043

    71/232

  • 8/21/2019 Once Manual Spec 043

    72/232

  • 8/21/2019 Once Manual Spec 043

    73/232

  • 8/21/2019 Once Manual Spec 043

    74/232

  • 8/21/2019 Once Manual Spec 043

    75/232

  • 8/21/2019 Once Manual Spec 043

    76/232

  • 8/21/2019 Once Manual Spec 043

    77/232

  • 8/21/2019 Once Manual Spec 043

    78/232

  • 8/21/2019 Once Manual Spec 043

    79/232

  • 8/21/2019 Once Manual Spec 043

    80/232

  • 8/21/2019 Once Manual Spec 043

    81/232

  • 8/21/2019 Once Manual Spec 043

    82/232

  • 8/21/2019 Once Manual Spec 043

    83/232

  • 8/21/2019 Once Manual Spec 043

    84/232

  • 8/21/2019 Once Manual Spec 043

    85/232

  • 8/21/2019 Once Manual Spec 043

    86/232

  • 8/21/2019 Once Manual Spec 043

    87/232

  • 8/21/2019 Once Manual Spec 043

    88/232

  • 8/21/2019 Once Manual Spec 043

    89/232

  • 8/21/2019 Once Manual Spec 043

    90/232

  • 8/21/2019 Once Manual Spec 043

    91/232

  • 8/21/2019 Once Manual Spec 043

    92/232

  • 8/21/2019 Once Manual Spec 043

    93/232

  • 8/21/2019 Once Manual Spec 043

    94/232

  • 8/21/2019 Once Manual Spec 043

    95/232

  • 8/21/2019 Once Manual Spec 043

    96/232

  • 8/21/2019 Once Manual Spec 043

    97/232

  • 8/21/2019 Once Manual Spec 043

    98/232

  • 8/21/2019 Once Manual Spec 043

    99/232

  • 8/21/2019 Once Manual Spec 043

    100/232

  • 8/21/2019 Once Manual Spec 043

    101/232

  • 8/21/2019 Once Manual Spec 043

    102/232

  • 8/21/2019 Once Manual Spec 043

    103/232

  • 8/21/2019 Once Manual Spec 043

    104/232

  • 8/21/2019 Once Manual Spec 043

    105/232

  • 8/21/2019 Once Manual Spec 043

    106/232

  • 8/21/2019 Once Manual Spec 043

    107/232

  • 8/21/2019 Once Manual Spec 043

    108/232

    Page 1

    [1] Example 7 - Stiness Method [0701]

    Examples 3.4 and 3.5 from McQire and GallagherMatrix Structural Analysisare used to demonstrate

    applications of the numpy linear algebra library and unit manipulations.

    Figure 1.1: Frame geometry

    Figure 1.2: Loads

  • 8/21/2019 Once Manual Spec 043

    109/232

    Page 2

    [2] Dene geometry and material properties [0701]

    units: kN, mm

    Element Properties

    elastic modulus (kN/mm**2) | e_1 = 200.0

    cross section 1 (mm**2) | a_1 = 10000

    cross section 2 (mm**2) | a_2 = 15000

    Node coordinates[node number, x, y]

    n_0 = [0, 0.0, 0.0]

    n_1 = [1, 5000.0, 0.0]

    n_2 = [2, 5000.0, 8660.0]

    n_3 = [3, 10000.0, 8660.0]

    nodes | nodes [2.1]

    . nodes =

    . [[0, 0.0, 0.0],

    . [1, 5000.0, 0.0],

    . [2, 5000.0, 8660.0],

    . [3, 10000.0, 8660.0]]

    Element Connectivity[element number, node1, node2, area, modulus]

    elements | elements [2.7]

    . elements =

    . [[1, 0, 1, 10000, 200.0],

    . [2, 1, 3, 15000, 200.0],

    . [3, 2, 3, 10000, 200.0],

    . [4, 0, 2, 15000, 200.0],

    . [5, 1, 2, 15000, 200.0]]

    Forces and reactions

    react = [[0, 1, 1], [1, 0, 1]]

    forces = [[3, 283.0, -283.0]]

  • 8/21/2019 Once Manual Spec 043

    110/232

    Page 3

    [3] Analyze truss [0701]

    Intermediate results may be viewed in standard out by uncommenting print statements in the le

    func_sti.py.

    direct_sti | function [3.2]

    function description: Direct stiness analysisfunction call: direct_sti(nodes, elements, react, forces)

    function doc string:

    executes stiffness functions

    1. structure dictionaries : node_dict()

    2. global stiffness : assem_global()

    3. displacements and reacts : displace()

    4. element forces : axial_force()

    5. tables and plots : disp_tables(), force_tables()

    function returned:

    node x displacement

    0 0.0

    1 -0.408487297921

    2 9.81709263995

    3 10.9330799379

    node y displacement

    0 0.0

    1 0.0

    2 -2.231843653333 -7.80601753585

    node reaction

    0 x dir -283.0

    0 x dir -773.156

    1 x dir 1056.156

    element axial force

    1 -163.394919169

    2 -326.782648882

    3 446.394919169

    4 892.770196745

    5 -773.156

  • 8/21/2019 Once Manual Spec 043

    111/232

    Page 4

    Figure 3.1: Examples 3.4 and 3.5 from McQire and Gallagher

    Figure 3.2: Examples 3.4 and 3.5 from McQire and Gallagher

  • 8/21/2019 Once Manual Spec 043

    112/232

    Page 5

    Figure 3.3: Examples 3.4 and 3.5 from McQire and Gallagher

  • 8/21/2019 Once Manual Spec 043

    113/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple\0001.simple.txt Saturday, July 19, 2014 10:16 P

    [s] Example 0001 - a simple calculation *Numbers are fun whatever you do* *First comes one and then comes two!*

    [t] number of brothers | bros = 1 [t] number of sisters | siss = 1 [t] height of brother | bro_h = 6.0*FT [t] height of sister | sis_h = 5.8*FT

    How many siblings do I have?

    [e] 000010 | add up bros and siss sum = bros + siss

    What is their height difference in inches?

    [e] 000011 | subtract heights dif = bro_h - sis_h

    [#] format | 3 | pdf 000010 | 2,2 | FT | 000011 | 2,1 | IN |

    -1-

  • 8/21/2019 Once Manual Spec 043

    114/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple\cal0001.simple.txt Saturday, July 19, 2014 10:16 P

    7/18/2014 2:29:27 AM==========================================================================================[1] Example 0001 - a simple calculation [0001]========================================================================================== *Numbers are fun whatever you do* *First comes one and then comes two!*

    number of brothers | bros = 1 number of sisters | siss = 1

    height of brother | bro_h = 6.0*FT height of sister | sis_h = 5.8*FT

    How many siblings do I have?

    ----------------------------------------------------------------------------------------- sum | add up bros and siss [1.1]

    bros + siss

    sum = 2-----------------------------------------------------------------------------------------!

    What is their height difference in inches?

    ----------------------------------------------------------------------------------------- dif | subtract heights [1.2]

    bro_h - sis_h

    dif = 2.4 in-----------------------------------------------------------------------------------------!

    -1-

  • 8/21/2019 Once Manual Spec 043

    115/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple\0001.simple.py Saturday, July 19, 2014 10:16 P

    from __future__ import divisionfrom __future__ import print_functionimport sysimport oncepyfrom numpy import *from collections import OrderedDicttry:

    from unum import Unumexcept:print('unum module not found')

    sys.path.append('C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple')try:

    from unitc import *print('unitc imported from directory')

    except:try:

    from oncepy.unitc import *print('unitc import from oncepy')

    except:print ' 'print 'unitc not found'pass

    bros = 1

    siss = 1bro_h = 6.0*FTsis_h = 5.8*FTsum = bros + sissdif = bro_h - sis_h_md = {'siss': ['siss = 1', '1'], 'bro_h': ['bro_h = 6.0*FT', '6.0*FT'], 'dif': ['dif = bro_h -sis_h', 'bro_h - sis_h'], 'sis_h': ['sis_h = 5.8*FT', '5.8*FT'], 'bros': ['bros = 1', '1'], 'sum': ['sum = bros + siss', 'bros + siss']}

    -1-

  • 8/21/2019 Once Manual Spec 043

    116/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple\sum0001.simple.txt Saturday, July 19, 2014 10:16 P

    [1] Example 0001 - a simple calculation*Numbers are fun whatever you do**First comes one and then comes two!*

    add up bros and siss [1.1]subtract heights [1.2]

    -1-

  • 8/21/2019 Once Manual Spec 043

    117/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple\log0001.simple.txt Saturday, July 19, 2014 10:16 P

    Calculation Log ===============

    Files and paths --------------- model input : 0001.simple.txt calc output : cal0001.simple.txt py output file : 0001.simple.py summary file : sum0001.simple.txt

    units imported : built-in units model path : C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\00_Simple

    < built format dictionary 1 >

    < built model dictionary >

    Table of Model Variables=========== =============== ======= =======Variable Value or Type Units Model=========== =============== ======= =======| bros int - [0001]| siss int - [0001]| bro_h 6.0 ft [0001]

    | sis_h 5.8 ft [0001]| sum equation FT [0001]| dif equation IN [0001]=========== =============== ======= =======

    Files written: -------------- model file : cal0001.simple.txt python file : 0001.simple.py summary file : sum0001.simple.txt reST file : - tex file : - PDF file : -

    < calculation completed >

    -1-

  • 8/21/2019 Once Manual Spec 043

    118/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template\0101.template.txt Saturday, July 19, 2014 10:20 P

    [s] Example 0101 - basic model template This example model calculates the mid-span beam moment under uniformly distributed (UDL) floor loads. It demonstrates **section [s], term [t] equation [e] and [#] format operations**. reStructuredText inline markup is also used.

    [d] beam.png | f | Simply supported beam | 70 |

    [s] Beam Loads and geometry

    Dead and live load contributions to beam UDL and beam layout configuration

    **Dead loads** from permanent weights [t] joists | jst_DL = 3.8*PSF [t] plywood | ply_DL = 2.1*PSF [t] partitions | part_DL = 10.0*PSF [t] fixed machinery | equip_DL = 0.5*KLF

    **Live loads** from people and moveable items [t] ASCE7-O5 | live_LL = 40*PSF

    **Beam tributary width and span** [t] distance between beams | trib_width = 2*FT

    [t] beam span | span = 14*FT

    [s] Maximum bending moment Calculate factored UDL loads and bending moment at mid-span of beam

    [e] 010122 | Total UDL factored dead load DL_D = 1.4 * (trib_width *(jst_DL + ply_DL + part_DL) + equip_DL)

    [e] 010122 | Total UDL factored live load LL_D = 1.7 * trib_width * live_LL

    [e] 010122 | factored UDL omega_1 = DL_D + LL_D

    [e] 010123 | Bending moment at mid-span M_0 = omega_1 * span**2 / 8

    [#] format | 3,3 | pdf 010122 | 2,2 | KLF | 2 010123 | 2,1 | KIP*FT | 3

    [#] This file contains a generic on-c-e model template (the template).[#] It is distributed under the CCO 1.0 Public Domain Dedication at[#] http://creativecommons.org/publicdomain/zero/1.0/[#] The template is not a structural design calculation and[#] must be modified by the user prior to use.[#] The template user assumes sole and complete responsibility for

    [#] all existing or modified inputs and the computed model results.

    -1-

    http://creativecommons.org/publicdomain/zero/1.0/http://creativecommons.org/publicdomain/zero/1.0/
  • 8/21/2019 Once Manual Spec 043

    119/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template\cal0101.template.txt Saturday, July 19, 2014 10:20 P

    07/19/14 21:04:30==========================================================================================[1] Example 0101 - basic model template [0101]========================================================================================== This example model calculates the mid-span beam moment under uniformly distributed (UDL) floor loads. It demonstrates **section [s], term [t] equation [e] and [#] format operations**. reStructuredText inline markup is also used.

    Figure 1. Simply supported beam

    ==========================================================================================[2] Beam Loads and geometry [0101]========================================================================================== Dead and live load contributions to beam UDL and beam layout configuration

    **Dead loads** from permanent weights joists | jst_DL = 3.8 [psf] plywood | ply_DL = 2.1 [psf] partitions | part_DL = 10.0 [psf] fixed machinery | equip_DL = 0.5 [kips/ft]

    **Live loads** from people and moveable items ASCE7-O5 | live_LL = 40 [psf]

    **Beam tributary width and span** distance between beams | trib_width = 2 [ft] beam span | span = 14 [ft]

    ==========================================================================================[3] Maximum bending moment [0101]========================================================================================== Calculate factored UDL loads and bending moment at mid-span of beam

    ----------------------------------------------------------------------------------------- DL_D | Total UDL factored dead load [3.1]

    1.4!equip_DL + 1.4!trib_width!(jst_DL + part_DL + ply_DL)

    DL_D = 0.74 [kips/ft]-----------------------------------------------------------------------------------------"

    ----------------------------------------------------------------------------------------- LL_D | Total UDL factored live load [3.2]

    1.7!live_LL!trib_width

    LL_D = 0.14 [kips/ft]-----------------------------------------------------------------------------------------"

    ----------------------------------------------------------------------------------------- omega_1 | factored UDL [3.3]

    DL_D + LL_D

    omega_1 = 0.88 [kips/ft]-----------------------------------------------------------------------------------------"

    -1-

  • 8/21/2019 Once Manual Spec 043

    120/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template\cal0101.template.txt Saturday, July 19, 2014 10:20 P

    ----------------------------------------------------------------------------------------- M_0 | Bending moment at mid-span [3.4]

    2#$!span&&&&&&&& 8

    20.88 [kips/ft]!14.00 [ft] 8

    M_0 = 21.6 [ft.kip]-----------------------------------------------------------------------------------------"

    -2-

  • 8/21/2019 Once Manual Spec 043

    121/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template\0101.template.py Saturday, July 19, 2014 10:20 P

    from __future__ import divisionfrom __future__ import print_functionimport sysimport oncepyfrom numpy import *from collections import OrderedDicttry:

    from unum import Unumexcept:print('unum module not found')

    sys.path.append('C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template')try:

    from unitc import *print('unitc imported from directory')

    except:try:

    from oncepy.unitc import *print('unitc import from oncepy')

    except:print ' 'print 'unitc not found'pass

    jst_DL = 3.8*PSF

    ply_DL = 2.1*PSFpart_DL = 10.0*PSFequip_DL = 0.5*KLFlive_LL = 40*PSFtrib_width = 2*FTspan = 14*FTDL_D = 1.4 * (trib_width *(jst_DL + ply_DL + part_DL) + equip_DL)LL_D = 1.7 * trib_width * live_LLomega_1 = DL_D + LL_DM_0 = omega_1 * span**2 / 8_md = {'jst_DL': ['jst_DL = 3.8*PSF', '3.8*PSF'], 'equip_DL': ['equip_DL = 0.5*KLF','0.5*KLF'], 'live_LL': ['live_LL = 40*PSF', '40*PSF'], 'DL_D': ['DL_D = 1.4 * (trib_width *(jst_DL+ ply_DL + part_DL) + equip_DL)', '1.4 * (trib_width *(jst_DL + ply_DL + part_DL) + equip_DL)'],'ply_DL': ['ply_DL = 2.1*PSF', '2.1*PSF'], 'omega_1': ['omega_1 = DL_D + LL_D', 'DL_D + LL_D'],'LL_D': ['LL_D = 1.7 * trib_width * live_LL', '1.7 * trib_width * live_LL'], 'M_0': ['M_0 = omega_1

    * span**2 / 8', 'omega_1 * span**2 / 8'], 'part_DL': ['part_DL = 10.0*PSF', '10.0*PSF'],'trib_width': ['trib_width = 2*FT', '2*FT'], 'span': ['span = 14*FT', '14*FT']}

    -1-

  • 8/21/2019 Once Manual Spec 043

    122/232

    C:\Users\rhh\Dropbox\StructureLabs\_projects\once_examples\01_Template\sum0101.template.txt Saturday, July 19, 2014 10:20 P

    [1] Example 0101 - basic model templateThis example model calculates the mid-span beam momentunder uniformly distributed (UDL) floor loads. It demonstrates**section [s], term [t] equation [e] and [#] format operations**.reStructuredText inline markup is also used.

    [2] Beam Loads and geometryDead and live load contributions to beam UDL and beam layout configuration

    [3] Maximum bending moment

    Calculate