# Control, structure and syntax.

This chapter provides information on the basic structure of a calculation (workbook and sheets). It explains how to control the calculation, how to enter input values, where and how to get help immediately, how to get a correct solution and what to avoid during the calculation. Some rules for work with the calculation workbooks and calculated data can be found at the end.

All the calculations are produced as workbooks in MS Excel. One calculation = one workbook. It is, therefore, good (however, not necessary) to have basic knowledge of MS Excel (or a similar table calculator) and how to work with this program. Knowledge of MS Excel enables you to more easily understand the method of control, entry of input data and a number of other standard operations such as saving, printing documents, formatting or sharing them with others.

## Structure of the calculation workbook.

Most calculation workbooks consist of the following sheets:

• Calculation - The most important sheet of each workbook. It contains algorithms, input fields of the calculation and the results of the solution. Everything is arranged in a logical structure in the direction of flow of the solution of the task. If it is used commonly, it should be the only sheet with which you will work.
• Materials- if some material data is necessary for the solved task, this sheet with tables of materials is available in the workbook.
• Tables - Data for calculation can be found in this sheet. Tables of values, lists of parameters, coefficients, etc.
• Options - Options for the language and other parameters, if they are necessary for setting the behavior of the calculation to meet your specific (company) conditions.
• DXF (DXF) - Parameters and definitions for the output of the drawing into a .DXF file or 2D CAD systems.
• Dictionary - Table of language equivalents, translation dictionaries.
• Data1,Data2... - Tables for plotting diagrams, tables of solutions.

If it is necessary for the algorithm and solution of the task, some sheets may be omitted in the workbook or, on the contrary, other sheets may be present with auxiliary inputs, auxiliary algorithms, etc.

## Start of calculation.

The calculation can be started in several ways. The description can be found in the chapter "Installation, HW and SW requirements, starting". After starting, a "Calculation" sheet is displayed in MS Excel. This sheet contains everything for the immediate solution of the problem.

## Description of the "Calculation" sheet.

The "Calculation" sheet is the most important sheet of the workbook. It contains formulas, input and output cells and usually includes the algorithm of the calculation as well.

### Sheet division.

The sheet is divided horizontally into two differently sized parts. The upper, narrower part is a header, which contains the name of the calculation and the basic control and information elements. The header is anchored and always visible, even if you roll the lower part of the sheet upwards. On the illustration below, the extent of the header is marked with the number [1].

The lower part of the sheet is divided into three chapters, while the division is based on the natural procedure of the solution of the majority of technical tasks.

• Chapter of input parameters (green) - This chapter is designed for specification of the task. Working conditions, loading, material options and other marginal conditions can be entered here. In this chapter, you can control the calculation itself.
• Chapter of results (yellow)- Each more complex and complicated calculation has a number of solutions that may be more or less useful. Sometimes it is necessary to make the price more favorable, other times the weight, sometimes the method of production or other parameters. All these parameters, allowing you to make a qualified decision, can be found in this chapter.
• Chapter of supplements (orange) - Includes a number of auxiliary calculations or solutions of partial problems that must often be carried out when finding input parameters and evaluating results.

Individual chapters consist of numbered paragraphs and rows. Each paragraph associates parameters that are connected logically or parameters of similar character (for example: power, dimension, strength, etc.) so that the structure of the task is well arranged and logical.

### Control elements.

Control elements are explained in the following illustration.

1. Header - The first row of the header shows (from left): The button for starting the "Integrated environment", the button for displaying "Help" and the name of the calculation. The right part of the row in some calculations includes the buttons that initiate the solution implemented in VBA language.
2. Header - The second row of the header is the state row. It displays the calculation state. If a result is outside of the recommended values, a list of problematic rows is displayed here.
3. Project - Help on the "Project" is given in a separate chapter.
4. Chapter - The row specifying the chapter. Pressing the "[+]/[ - ]"button in this row displays/hides all the rows in all the paragraphs of the given chapter.
5. Paragraph - The row specifying the paragraph. Enabling/disabling the check box displays/hides all the rows of the respective paragraph.
6. Comment - Comments can be displayed by positioning the cursor onto the cell marked by a small red triangle in the upper right corner. The comment contains important information on the respective row (instructions, recommended values).
7. Selection list - Clicking on the selection list rolls it up and the desired value or option can be set by selecting the respective row.
8. Input cell - Numerical values are entered into cells with a white background. The values are entered with the keyboard.
9. Automatic filling - If the check box is located next to the input cell, enabling it causes the input cell to be automatically filled with the recommended value. Enabling the check box also causes a change in color of the input cell to light blue. The recommended value is usually located next to the input cell, in a green cell.
10. Name of the sheet - The lower edge contains the names of the sheets included in the workbook. Clicking on the respective folder toggles between the sheets.

### Meaning of the color of cells.

• White cells - input fields (with preset ranges of input values)

• Green cells - recommended values, recommended ranges of values

• Blue cells (standard background) - output values, results

• Grey digit in the cell - the change of color means that the value has no meaning for the calculation at this moment.

• Red digit in the cell - the change of color from black means that the recommended value was exceeded. However, this does not mean that the solution is automatically insufficient. It is only a warning that it is necessary to consider all relationships, the causes leading to excess of the recommended values and the possible consequences.

• Red cell -A red background on the cell indicates a critical excess of the recommended values; this might cause a breakdown, make the assembly impossible or create a critical reduction in the service life or safety.

### Entering values.

Enter the numerical values from the keyboard into the respective white field and confirm them using the "ENTER" key. A majority of input fields are provided with preset ranges of valid values. If you try to enter a value outside the permitted range, a warning message is displayed. In such case, repeat the entry of a correct value. Ranges and recommended values can be found in the on-line help - in the commentary next to the row number.

## Types of calculations.

In view of the control, two basic types of calculations are distinguished.

### Automatic calculation.

These are the calculations, in which the algorithm of the solved task is written directly into the "Calculation" sheet using the formulas and functions of MS Excel. The calculation then behaves as a common table in MS Excel. After a change in any input value, the complete result displays immediately. (Example: Calculation of gearing, belt or chain transmissions, etc.).

### Calculation on request.

It is a type of calculation where it is necessary to perform a series of iterations and the algorithm of the task is written in VBA language. Enter and set all the input parameters in the calculation. Results are then displayed/refreshed after running through the calculation, which can be initiated by clicking on the button. The button is located on the upper anchored edge of the "Calculation" sheet so that it is easily available anytime.
(Example: Calculation of beams, shafts and profiles)

###### Note: The calculation on request is also usually solved using MS Excel formulas and functions. Therefore, certain parts (paragraphs) of the calculation reflect the changes in the entered values. However, the solution to the task MUST/b> always be started to recalculate it completely.

From the aspect of the bearing of the calculation, it is distinguished:

### Design calculation.

Design calculations are the calculations that provide a design of some part(s) of particular dimensions based on the input parameters.

##### Examples of a design calculation:
• Spur gear - Input: transmitted power, speed, loading specifications, safety, etc.; Result: dimensions of the gearing...

• Calculation of a spring - Input: forces, working lengths, loading specifications, safety, etc.; Result: wire diameter, spring dimensions, etc.

### Check calculation.

Check calculations are the calculations where the calculation finds deformations and the levels of safety of a particular loaded part.

##### Examples of a check calculation:
• Beam - Input: Loading, distance of supports, profile of the beam, etc.; Result: Deflection, stress, safety, etc.

• Shaft - Input: Loading, distance of supports, profile of the beam, etc.; Result: Deflection, stress, safety, etc.

## Calculation procedure.

Because it is difficult to give a uniform procedure that is generally valid for all types of calculations, this section gives a summary of rules, which, if followed, should lead to a suitable solution.

• Take the calculation as a sequence of pages in your block, which is filled step-by-step with formulas, entered values, checks of sub-results and searches of solutions to the task. The same procedure is also applied with the use of these calculations.

• Always proceed from the first paragraph of the first chapter downwards. Successively enter the input values and extreme conditions. If you are not sure about the desired value, recall the commentary (help) to the respective row or recall the complete help to the respective calculation.

• Each calculation is provided with an encapsulated sequence of the steps you should perform - "Calculation procedure". This encapsulated instruction is given with the first chapter "Chapter of input parameters" or in help.

• In the case of design calculations, the "Automatic design" process is usually available, which goes through all the possible solutions under the given extreme conditions and displays them in a well arranged table.

## Units and standards.

Calculation module - workbooks are designed according to particular standards, generally applicable procedures and the recommendations of producers, or a combination of these sources. These can be further used for a particular unit system, or it is possible to specify the units directly in the calculation.

Generally, you can encounter the following types of calculations and their characteristic features.

1. SI Calculations
- The icon of the module contains the letter "M" in a yellow square
- only in SI units (mm, N, kW)
- Orientation, above all, is towards the standards of ISO, DIN, JIS, BS, etc.

2. Imperial Calculations
- The icon of the module contains the letter "I" in a green square
- only in Imperial units (in, lbf, HP....)
- Orientation, above all, is towards the standards (associations) of ANSI, AGMA, ASME, etc.

3. Calculations for both unit systems
- Icon without any special marking
- Toggling between the units inside the module
- Selection of a standard or a calculation procedure inside the module
- Basic documents of particular producers

4. Calculations independent of the unit
- Icon without any special marking
- Independent of the unit
- Containing mostly various recommendations and tables

### Toggling between the units.

If the calculation - workbook supports both unit systems, toggling between the units can usually be found on the "Calculation" sheet in the first paragraph on the first row [1.1]

### Toggling between the standards (producers, procedures).

If the module - workbook supports calculations according to various standards or procedures, this option can usually be found on the "Settings" sheet or on a suitable place in the calculation.

## Recommended values.

Recommended values (or their minimums/maximums) are given for most of the input parameters in the calculation (comments) and in help. This data is based on common conditions and experience, and these values can be exceeded in special and reasonable cases. Recommended values can be found in green cells.

Excess of the recommended values is indicated by a change in color of the parameter to red. Substantial excess of the recommended values, which may cause a breakdown, make the unit impossible to assemble or create a critical decrease in the service life or level of safety, is indicated by a change in color of the field to red.

## Saving results.

After installation, the workbooks containing calculations are not protected against overwriting. You can set your own input values, save the calculation and, if you just start up, the calculation will contain your entered values. This procedure is suitable for setting the parameters common for most of your tasks.

If you solve various tasks or calculate more alternatives in one task, it is advisable to save such calculations under new names. This saves not only the task, but also the complete calculation, including all results. If the calculation is saved under a new name, you can use the "Information on the project" paragraph. For searching for a calculation, you can use the tool for "Retrieval of a calculation", which is delivered in the MITCalc package.