Support & Forums

## 4 approaches to engineering calculations in TechEditor

User Rating: 5 / 5

TechEditor is the environment for technical documentation development and mathematical calculations. But did you know that the same task can be solved in four different ways? Let's see it in the example of a beam calculation.

## Structure of the TechEditor project

I hope you've already installed TechEditor. If you haven't, please do it.

TechEditor doesn't have any modules to perform any specific actions (such as beam calculation). At the start, it's a tabula rasa — an empty environment waiting for user commands. However, despite this, the program allows you to implement any analytical calculation (simulation) and design it in the right style. There are 4 types of documents in TechEditor:

• Report
• Diagram
• Mathsheet
• Application

Each document has its purpose and features, although some functions are similar. There is no limit to the number of documents in a project, but you need at least one document (report, chart, mathsheet, or application) to work.

A TechEditor project looks like this when you start the program:

### How to choose the right document type

At the start, you should decide which type of document best suits your task.

A report is perfect for creating a classic text documents (printed or PDF). A diagram is suitable for developing and visualizing diagrams, algorithms, and design sheets. Mathematical sheets help you focus on calculations only (use them if you don't need to create a final report). Finally, the application is a program that executes in TechEditor and automates some actions.

Let's see how to implement an engineering task in all these formats.

## Scope of work

For example, let's see a common case — structural design of a simply supported beam by bending moment and deflection.

### Where can I get a pictures for report?

Let's start with the visual part. We need two images: a structural model and a cross-section.

In general, drawings are an engineer's headache, because almost every explanatory note requires some kind of images, diagrams, and visualizations. As a rule, there is no time and desire to search for them (much less create them in a graphic editor), so Dystlab creates Media Kits category in the catalog where you will find ready-made and high-quality technical images. I chose the following items:

### Calculation algorithm

1. Get the source data
2. Calculate the maximum bending moment
3. Calculate the moment resistance
4. ULS check
5. Calculate the maximum deflection
6. SLS check

### Source data

We will focus on the W460×89 rolled steel shape (Canada, CISC), but you can use data from other catalogs as well:

• beam length $$l = 2.5$$ (m);
• modulus of elasticity $$E = 200$$ (GPa);
• material bending strength $$R = 345$$ (MPa);
• cross-sectional moment of inertia $$J = 410 \times 10^6$$ (mm4);
• elastic section modulus $$S = 1770 \times 10^3$$ (mm3);
• load per 1 m2 $$q = 2.2$$ (kPa);
• tributary width $$b = 4$$ (m).

## Formulas for beam calculation

### Bending moment calculation & ULS check

The maximum bending moment is in the middle of the single-span beam:

$$M_{\max} = \frac{ w l^2 }{ 8 }$$, (1)

where the intensity of a uniformly distributed load is determined by the formula

$$w= q \times b$$. (2)

The moment resistance is determined by the formula:

$$M_r = S \times R$$. (3)

ULS check looks like this:

$$M_{\max} \leq M_r$$. (4)

### Finding beam deformations

When a beam is loaded with a uniformly distributed load, the maximum deflection in its middle is calculated by the formula

$$\Delta = \frac{ 5 w l^4 }{ 384 E J }$$. (5)

The resulting deflection must be compared with the maximum allowable displacement $$\Delta_{\lim}$$. As a rule, the permissible deflections of structures are specified in the building codes and depend on the purpose and size of these members. Thus, according to the Ontario Building Code 2012 (Canada), the maximum allowable deflection in certain cases should not exceed $$\frac{ l }{ 360 }$$, i.e. it should be within 1/360 of the beam length:

$$\Delta \leq \frac{ l }{ 360 }$$. (6)

Let's implement these formulas in the TechEditor environment.

## Interpreting in TechEditor

### Mathematical sheet

Let's start with a math sheet. This type of document was first introduced in TechEditor 3.0 and, as mentioned above, is primarily intended for quick calculations.

When you work with a math sheet, you don't need to focus on the formatting; it's not the main thing here. The main thing in this type of document is convenient data entry and quick visualization of the results. This type is also recommended for intermediate calculations (like an advanced calculator).

Let's add a math sheet to the project:

Let's move the block of initial data to the math sheet. All equations are typed in plain text:

L:=2.5 m E:=200 GPa R:=345 MPah:=463 mmJ:=410e6 mm^4S:=1770e3 mm^3 q:=2.2 kPa b:=4 m

Please note that units of measurement for physical quantities in TechEditor are added to a numeric value simply by separating them with a space. Multiplier $$\times 10^x$$ can be added to the number through the standard "e" symbol, as it was done for the moment of inertia (410e6) and the section modulus (1770e3).

After that, we can add formulas (1)-(3), (5):

w:=q*b Mmax:=w*L^2/8 Mr:=S*R

Δ:=5*w*L^4/(384*E*J)Δlim:=L/360

Here's the result in TechEditor:

The program calculates data in SI units. To change these units into the desired ones, add them to the expression through a period and curly brackets (the multiplication sign between the units is not indicated, but replaced by a space):

w:=q*b•{kN/m} Mmax:=w*L^2/8•{kN m} Mr:=S*R•{kN m}

Δ:=5*w*L^4/(384*E*J)•{mm} Δlim:=L/360•{mm}

### Diagram

Diagrams have much more powerful functionality for visualizing calculations than math sheets. The closest analogs of this type of document are Mathcad, SMath, Excel, Google Spreadsheet, etc.

Let's add a diagram to the project (don't close the math sheet yet, we'll need it later):

#### What is a diagram?

TechEditor diagrams should look familiar if you've worked with mathematical software before. If you haven't, here's a quick look at the basic features of this document type:

• we work on an infinite plane (diagram canvas);
• any blocks on the diagram can be edited, moved, rotated, etc;
• calculations are performed from the highest mathematical block to the lowest, from left to right (as in Mathcad, SMath);
• if you have entered a variable in the calculation, make sure that all expressions where it appears are below or at least to the right of it.

This document type is ideal for creating calculation sheets, which engineers usually create in Excel. Unlike spreadsheets, diagrams use a more understandable, traditional notation — their mathematical model is based on variables, functions, and equations (as is common in physics and mathematics), not on cell addresses, as in Excel. Secondly, the diagrams have much more space for "maneuvering": you can drag the blocks on the screen arbitrarily and aren't limited to a fixed cell size.

#### Insert images

Let's start working with our design sheet by inserting the images we downloaded earlier. Add images using the CTRL+C (copy file) and CTRL+V (paste image) shortcuts. I recommend making the images transparent (Totally Transparent command) and removing the border (No Border command):

Let's place the images on the diagram in accordance with the general concept: first, the diagram of the beam, and next to it, the cross-section.

#### Working with math blocks in TechEditor

Let's add the first math block to the diagram. Use the Blocks > Math Block command on the Diagram tab, or a similar command on the Insert tab:

In the Input Expression field, enter the first expression from the source data. You can copy it from the math sheet beforehand. After you click OK, click anywhere on the diagram and the math block will appear on the screen. This mechanism is called "take-and-drop": you first take a block of the diagram (not necessarily a math block) and then place it where you want it.

The block is created with default settings, so I recommend formatting it. I usually make it transparent (with the Totally Transparent command), remove the border (No Border), reduce the size and center it. Here's what it looks like in my case:

You can create the following math blocks using the same algorithm, but I recommend an easier way: COPY-PASTE. When you copy any block of the diagram, it will be copied formatting and it will save you a lot of time. After pasting, the block will appear in the same place as the base block (the new block will "cover" the copied one), so you need to move it to its place. To move blocks orthogonally, hold down CTRL.

TechEditor has a unique feature that allows you to place several expressions in one mathematical block. This distinguishes it from other software. Let's demonstrate using a load example.

Create a new math block or copy one of the previously created ones. Position the block above the load and double-click on it. In the dialog box that appears, in the Input Expression block, enter three expressions that describe the load on the beam (you can copy them from the math sheet). These expressions will be calculated by TechEditor first; each expression should occupy one line. In the Output Expression block, write the parameter "w" — it's what we want to see as the result of calculation. Click OK.

As you can see, the diagram looks quite canonical. Visually, it seems like these parameters just appeared on the sheet, without any extra movements. The idea should be clear: you can "hide" expressions that you consider unimportant in diagrams by simply writing them into the appropriate mathematical blocks. This method only works on diagrams.

The following figure shows the final design sheet in TechEditor:

We added text explanations to the math blocks. We also added two new blocks that were not on the previous math sheet: "ULS check" and "SLS check". These are the blocks that signal whether condition is met or not. Since all the necessary model parameters are described above, you need to place the expressions "Mmax/Mr", "Δ/Δlim" in the Output Expression fields.

### Report

This type of document is used to develop explanatory notes in a traditional format (e.g., A4). The most popular analogs are Word, Google Docs, etc.

The unique feature of a TechEditor report is the ability to add specialized mathematical inserts and automate calculations without losing quality. You don't have to sacrifice design for calculations, and vice versa. Your documentation should look high-quality, professional, and "bookish".

When you run TechEditor, the program automatically adds one blank report to the project. Let's use it and open it in the editor:

Let's create a report based on the previous diagram. Add to it the correspondent text part and the image (from the file):

As for element placement, reports are a bit behind diagrams; you can't move objects as freely as you like. But this is not a disadvantage, but rather a feature of text documents. That's why I recommend choosing images that contain all the labels you need for your reports.

Let's add a math object to the report. Use the Math Object command on the Insert > Mathematics & Calculus tab of the ribbon:

The object will be inserted at the cursor position. This object is almost exactly like a math block in a diagram (except that the Input Expression field cannot be multi-line). After inserting all the math objects, the report looks like these:

You can format math objects in your report just like regular text. For example, I've colored the lines with checks blue and bolded them. Also, pay attention to the specifics of formatting mathematical expressions in the report: if we entered data in both the Input Expression and Output Expression fields, the report combines them into one expression, using the "=" symbol.

By default, TechEditor performs calculations automatically. If you have disabled this option or need to update the data in a math sheet, diagram, or report for some reason, press F5.

### Application

This document type allows you to execute mini-programs directly in the TechEditor environment.

The application can run in the background or look like a traditional window with controls. This application is not a classic program, because it doesn't have a binary representation and won't run outside the environment. Rather, it is a TechEditor extension module or plugin. But while plugins usually require an external editor (IDE) to create, you can develop applications for TechEditor on the spot — the program already contains all the tools you need.

Applications can make your work much easier and automate complex or routine operations. We are talking not only about engineering calculations but also about the "daily" tasks of working with any data. For example, you may need to insert the order amount with percentages in certain places of the document — it is quite logical to arrange this in the form of a data entry window and synchronize it with the report. From this point of view, a TechEditor report is considered a container (template), and the data is received through the appropriate application(s).

#### How to interact with the TechEditor IDE

We work with applications in TechEditor using the IDE (Integrated Development Environment) tool. We will implement our task in a windowed application to demonstrate the full potential of this approach.

Let's add the application to our project. In the template manager, select the Windows Application type:

The current version of TechEditor 3.1 supports two programming languages — Pascal and Basic. Pascal is the main and recommended language, so we will focus on it.

After clicking OK, TechEditor will create a workpiece with two modules: Unit1, Unit2. You will see the following empty window on the screen:

This window is called a Form. A form is a container for various controls (buttons, text, checkboxes, etc.). It is the visual part of the application, which is what the user will see on the screen when the application is running.

Press F12 and switch to the code editing mode:

In this window, the logic of the application is specified. Of course, you need to have some programming skills, but with a little bit of practice, you can acquire necessary knowledge. Switch between the form editor and the code editor using the F12 key.

Despite the fact that our application is still empty, it is already fully functional. Run it by pressing F9 or using the Run command on the IDE > Execute tab of the ribbonr:

As you can see, a window with the title Form2 appeared on the screen, and in the Project Explorer, in the Applications > Executed section, our Application1 application appeared:

Stop the application using the Stop Process or Stop All command. Please note that closing the form in the traditional way (with a red cross) will hide form from the screen, but the application will continue running (see Applications > Executed). You can bring a closed application back to the screen by double-clicking it in Project Explorer.

#### Visual part of the application

Let's return to the form. Open two tool windows — Object Inspector and Tool Palette. Both are accessed from the ribbon, IDE > Form Design section. Object Inspector is used to set properties and events of controls (including the form itself). The Tool Palette contains a set of various controls.

Drag the white marks around the form and stretch it. In the Object Inspector, find the Caption property and change the value to "Beam Calculator" (if the Object Inspector is empty, click on the form to select it). Ensure that the form has changed its title:

Let's insert the image. Find the TImage component in the Additional section of the Tool Palette window. Click on it first (you're "taking" the component) and then on the form (you're "drop" the component). Make sure that the component is selected and the Object Inspector displays all its properties. Find the Picture property and double-click it. In the editor that appears, click the Load button and browse file that we prepared earlier. In the Object Inspector, find the AutoSize property and change the value from False to True. Make sure that the image is displayed correctly on the form:

Let's place the data entry components on the form. In the Standard section of the Tool Palette window, find the TEdit component and place it on the form. Change its Name property to "EditLoad" and its Text property to "2.2 kPa":

Next to this field, place the TLabel component (text label). Change its Caption property to "×". Add another TEdit with the following properties:

• Name: EditTributaryWidth
• Text: 4 m

The size and position of the components on the form can be edited as you like. The overall picture should look like this:

Place two more components on the form: TLabel and TButton.

TLabel properties:

• Caption: w = ?

TButton properties:

• Caption: Calculate

#### Programming the application logic

All the calculations must be done when the user clicks on the button. Select the button on the form and go to the Object Inspector, to the Events tab. Find the OnClick event, write "Calculate" in its value, and press Enter:

Double-click in the area labeled Calculate. The code editor will open:

In programming terms, the Calculate block is called a method. But in fact, it is just code that is executed when the Button1 button is pressed. Add the following script to the block:

procedure Calculate(Sender: TObject); begin  MathTranslator.Clear;  MathTranslator.Add('q:=' + EditLoad.Text);  MathTranslator.Add('b:=' + EditTributaryWidth.Text);  MathTranslator.Add('w:=q*b•{kN/m}');  LabelLoad.Caption := MathTranslator.CalculateStr('w');end;

Run the application by pressing the F9 key. Ensure that the load is calculated correctly after clicking the Calculate button. Try other input data, including units of measurement:

I won't describe the next steps in detail — they are similar to the ones we've already done. I will only give you the full text of the Calculate method:

procedure Calculate(Sender: TObject); var  ULS, SLS: Double;begin  ///  /// Calculate uniformly distributed load.  ///  MathTranslator.Clear;  MathTranslator.Add('q:=' + EditLoad.Text);  MathTranslator.Add('b:=' + EditTributaryWidth.Text);  MathTranslator.Add('w:=q*b•{kN/m}');  LabelLoad.Caption := MathTranslator.CalculateStr('w');   ///  /// Add beam properties.  ///  MathTranslator.Add('L:=' + EditLength.Text);  MathTranslator.Add('E:=' + EditMOE.Text);  MathTranslator.Add('R:=' + EditR.Text);  MathTranslator.Add('J:=' + EditJ.Text);  MathTranslator.Add('S:=' + EditS.Text);   ///   /// ULS check.  ///  MathTranslator.Add('Mmax:=w*L^2/8•{kN m}');  MathTranslator.Add('Mr:=S*R•{kN m}');  LabelMoment.Caption := 'M = ' + MathTranslator.CalculateStr('Mmax');   LabelResMoment.Caption := 'Mr = ' + MathTranslator.CalculateStr('Mr');   ULS := MathTranslator.Calculate('empiric(Mmax/Mr)');  if ULS <= 1.0 then     begin       LabelULS.Caption := 'SUCCESS';      LabelULS.Font.Color := clGreen;     end   else     begin      LabelULS.Caption := 'PROBLEM';      LabelULS.Font.Color := clRed;    end;   ///   /// SLS check.  ///  MathTranslator.Add('d:=5*w*L^4/(384*E*J)•{mm}');  MathTranslator.Add('dlim:=L/360•{mm}');  LabelDeflection.Caption := 'd = ' + MathTranslator.CalculateStrFmt('d', '%.3f');   LabelDeflectionLimit.Caption := 'dlim = ' + MathTranslator.CalculateStrFmt('dlim', '%.3f');   SLS := MathTranslator.Calculate('empiric(d/dlim)');  if SLS <= 1.0 then     begin       LabelSLS.Caption := 'SUCCESS';      LabelSLS.Font.Color := clGreen;    end   else    begin      LabelSLS.Caption := 'PROBLEM';      LabelSLS.Font.Color := clRed;    end; end;

The final design of the application may look like that:

Although this is a rather simple application, it does contain some "niceties". If the conditions is met (ULS/SLS checks), we get a green "SUCCESS" message. If the check fails, the message changes to "PROBLEM" in red:

In TechEditor, you can run several applications at the same time. This is useful when you need to analyze several tasks in parallel. Each running application is displayed in Project Explorer:

I'd also mention the benefits of apps in their security because all calculations are done in code, not in an open script like on mathsheets or diagrams. On the other hand, it requires some programming skills.

## Tips for effective work in TechEditor

I hope this article will help you understand TechEditor. Of course, this is not a complete list of the editor's features — we haven't yet touched on graphics (for example, how to draw the frames), formulas in LaTeX, synchronizing applications and reports, spreadsheets and other issues. The next blog posts will be about it.

You've probably noticed that all the documents we create are part of a common project and are stored in a single file. You can clone each document within the project and continue working with this copy. I recommend using this approach, for example, to control project versions, or for projects with a branched structure. You can always delete any document from the project.

I also recommend experimenting with different types of documents. You have already seen that each of them has its secrets and advantages. So I hope you will now be able to use TechEditor to its full potential..

Good luck!

#### Vitalii Artomov

CEO & Co-Founder Dystlab, PhD, ex-associate professor of the DNURT (Bridges Department), TechEditor Developer

#### Online market for engineers "Dystlab Store". Reports, diagrams, spreadsheets, media packs for TechEditor. Free and paid subscription plans.

WhatsApp (English or Ukrainian):
+38 095 812 2046

Dystlab Community Server (Discord)

TechEditor Community Server (Discord)

innot needed textfoanother not needed text@dystlabdummy text.store

Dystlab™ is a trademark registered in the State Register of Certificates of Ukraine for Goods and Services Marks 26.02.2018, certificate No. 238304. Owner: entepreneur Artomov V.E., EGRPOU/ITN: 3003314690.