Engee documentation

The first steps. Introduction to Engee Technical Calculations

If you are just starting out with technical calculations, then Engee is a great place. The platform is specially designed to help engineers and programmers create complex technical systems and algorithms in a simple, intuitive and convenient way.

The interactive script development environment Engee supports several programming languages: Julia, Python, MATLAB, C/C++, etc., but the main one is Julia is a modern, fast and user—friendly language for engineering and scientific tasks.

If you have not yet chosen a language to study or are looking for alternatives, then here are the advantages that Julia offers:

Advantage Description

Simplicity

The syntax is similar to Python — it is easy to read and quickly mastered.

High performance

It works at almost the same speed as C, but without the complexities of C/C++.

Powerful math

Julia supports vectors, matrices, and numerical data out of the box.

Extensibility

It’s easy to connect third-party libraries and work with other languages.

Versatility

Julia is suitable for both simple tasks and for building complex algorithms, simulations, and data analysis.

In addition to all these advantages, Engee provides a complete and regularly updated Julia documentation in Russian, which will be useful for engineers and programmers with any experience. And if you want inspiration or examples from practice — take a look at Engee Community, where users share their projects, scripts, and ideas.

If you are just starting your journey with Julia, then we recommend that you familiarize yourself with the course Welcome to Engee, which will help you quickly get used to the Engee environment.

For those who already have experience in technical calculations, in link:/helpcenter/stable/en/interactive-scripts/language_basics.htmlThe examples also show various Julia usage scenarios that will help you gain a deeper understanding of the language’s capabilities.

Getting started

Engee has everything you need to work with the code.:

  • File Browser file browser 7 — a file manager for working with scripts and projects.

  • Command line img 41 1 2 — Command line for advanced users and advanced tasks.

  • Script editor interactive script icon — script editor with syntax highlighting and auto-completion.

  • Variable Window variables article 2 1 — variable panel for analysis and debugging.

Now let’s take a closer look at exactly how the code is written and run in Engee. For this purpose, the following are used Script Editor interactive script icon — a convenient tool for step-by-step work with code, visualizations and comments, or Command Window img 41 1 2 — a more familiar environment for experienced users.

To work with the code in Engee even faster and more conveniently, use keyboard shortcuts. They allow you to manage scripts, run calculations, navigate through the interface, and save time. The full list of combinations is available in the article. Engee hotkeys or by calling help directly in Engee (combination Shift+?).

Script Editor

Interactive scripts are a special document format in which code, text, and graphics are combined into a single working structure. You can open the script editor directly from interface Engee — just click on the icon interactive script icon in the toolbar. To create a script, click + in the script editor and select the desired format.:

40%img36c 1 en

You can also click on the File Browser file browser 7 and select CreateScript:

script creation fb en

By default, Engee scripts have the ngscript format, but you can also work with the jl and ipynb formats.:

  • 'jl` is a script format in the Julia language. The script editor supports refactoring and running scripts in this format.;

  • ipynb is a universal script writing format in Python. The script editor supports all available functionality at the ngscript level.

The interactive script consists of cells — separate blocks that can be run independently. There are two types of cells:

script editor 1 en

  • Code — designed to work with code. Such cells can be run one at a time, execute only the selected fragment, or execute the entire code.

    img52 en

  • Text — for explanations, formulas and visual design. Markdown, LaTeX, and HTML are supported.

    img44 en

To run the script, just click Save in the launcher. In this case, all code cells are executed in order. You can also run individual cells or even just a dedicated section of code.:

img 49 1 en

The execution results appear directly under the code and are saved until the restart. If necessary, the output can be minimized, cleared, or hidden with the Limit Output button. colapse button:

in long hide 1 en

To structure a script, it is convenient to use headings that form paragraphs. Paragraphs can be collapsed and navigated through the panel. Contents content button 1:

in scripts par en

In addition, code cell masks can be used in scripts. masks script pool 1 — Special interactive controls such as sliders, drop-down lists or input fields. They allow you to change the code parameters without having to rewrite the code itself.

Working with code cell masks is discussed in detail in the example. Masking code cells of interactive scripts.

The command line

If you are used to working in a terminal, then Command Window img 41 1 2 Engee is an excellent solution. Command Window It allows you not only to execute code, but also to use shell commands, manage packages, edit files, work with Git and access help — all from one window!

The Engee command line supports multiple operating modes, each suitable for different tasks.:

  • Normal Mode is the main interface in which commands are executed interactively and displayed immediately.

  • Help Mode — allows you to quickly get information about functions and modules. It is called using a question mark. ?.

  • Shell mode is used to execute operating system commands. It is called using the symbol ;.

  • Package Manager Mode — allows you to manage Julia packages and dependencies. It is called using the symbol ].

  • Search Modes — Provide a command history search. They are called using keyboard shortcuts Ctrl+R for reverse and Ctrl+S for direct (forward) search.

  • Text Editor modes — allow you to edit files directly from the command line. They are called from shell mode using the commands vi, vim and `nano'.

Read more about each mode in the article. Command line.

If you work with Git projects, clone repositories, make edits, and commit, the command line in Engee provides all the necessary tools. Read more about this in a separate series of articles. Working with Git.

Moreover, in Engee you can combine both approaches: write code in the script editor, and run individual commands or utilities from the command line. This hybrid approach allows you to effectively solve both small tasks and work on large projects.

Working with Julia

The Julia language is designed to be both simple, readable and very fast. It is great for engineering and scientific tasks, but at the same time its syntax is intuitive, especially for those who are familiar with Python or MATLAB. Here is an example of simple code on Julia:

println("Hello, world!")

'println' is a built—in function for outputting text to the console. You can run this code directly on the command line or in the script editor.

Julia immediately supports working with numbers, strings, arrays, loops, conditions, and functions. For example:

  • The sum of the array elements:

    arr = [1, 2, 3, 4, 5]
    println(sum(arr))
  • Custom Function:

    f(x) = x^2 + 2x + 1
    println(f(3))

You can start with basic constructions, gradually connect packages and use additional language features as needed. For more information, see below.

Julia Packages

Julia is a language with an active community that develops many useful packages. In Engee, you can easily connect and use Julia packages, extending the functionality to suit your needs. For more information about working with packages, see the article Working with Julia packages.

Data visualization

Do you need visualization of your calculations? In Engee, you can create and customize graphs directly in the code using the Plots package. For more information, see Plotting graphs.

Software simulation management

In Engee, you can create and manage models programmatically using built-in methods and commands. This allows you to automate the process of creating models: add blocks, connect them with signal lines, configure parameters and properties, and perform other operations. You can learn more about software modeling management in the article Software control of modelling.

Julia’s Basic Designs

Julia is as user-friendly as possible, but at the same time provides access to the entire productive component of the language. Next, we will analyze its basic features and designs.

Variables and data types

Julia is a dynamically typed language: variables can be declared without specifying a type. Consider an example:

a = 3           # without semicolon, the result is output to the console.
b = 4;          # with a semicolon, the result is not output.
c = a + b       # the sum of two variables
println("The amount: ", c)  # explicit text and meaning output

m = n = a ÷ b   # integer division and multiple assignment

Integer division (÷') returns only the integer part of the result without remainder. For example, `7-3' will return `2.

To enter `÷', use:

  • On Windows/Linux — key Alt and type 0247 on the numeric keypad.;

  • On macOS — click Option (⌥) + /.

Or write \div in the command prompt and press Tab. Other frequently used special characters will also be useful.:

  • pi\pi + Tab (the number of Pi);

  • \sqrt + `Tab' (square root);

  • \sum + `Tab' (summation);

  • \rightarrow + `Tab' (arrow).

In the code above, variables were not given types, but despite dynamic typing, Julia is a language for computing, which means that performance plays a key role. To use Julia as effectively as possible, it is highly recommended to explicitly specify the types. For example:

x::Int64 = 42
y::Float64 = 3.14

This allows Julia to perform precise optimizations and avoid unnecessary type conversions during code execution. We recommend that you familiarize yourself with the main types of Julia in the following table:

Type (English) Type (Russian) Example

Int

An integer

a = 5

Float64

Fractional number

b = 3.14

Bool

Logical value

is_valid = true

Char

Symbol (one character)

letter = 'A'

String

A line of text

name = "Julia"

Vector

Vector (homogeneous list)

numbers = [1, 2, 3]

Tuple

Tuple (immutable set of values)

data = (1, "hello", true)

Vector contains elements of the same type (usually numbers), and Tuple contains values of different types and cannot be changed after creation.

Functions

Functions allow you to structure your code and use repetitive logic. Here is an example of a regular function:

function add(a, b)
    return a + b
end

Here we define the add function, which takes two arguments and returns their sum. You can write the same function in a shorter form.:

add2(a, b) = a + b

And here’s how to trigger it:

result = add(5, 7)
println("The amount: ", result)

For more information about the functions, see the article Functions.

Conditions and cycles

To execute code under certain conditions or repeat actions, control constructs are used: if, for, `while'.

Conditional operator:

x = -1

if x > 0
    println("A positive number")
elseif x == 0
    println("Zero")
else
    println("A negative number")
end

The for loop performs an action for each value in the range:

for i in 1:5
    println("Iteration ", i)
end

The 'while` loop is executed while the condition is true:

n = 3
while n > 0
    println("Left: ", n)
    n -= 1
end

For more information, see the article Basic constructions.

Arrays and vectors

Arrays allow you to store sequences of data, for example, measurement results or parameters.

v = [1, 2, 3, 4]
println(v[2])    # access to the second element
v[3] = 10        # changing the index value

For more information, see the article Arrays, vectors and matrices in Engee.

Vectorization and indexing

Julia allows you to apply operations to the entire array at once, without explicit loops — this is called vectorization. It is not only convenient, but also fast.

v = [1, 2, 3, 4]
v_squared = v .^ 2         # squaring each element
positive = v .> 2          # Logical comparison: more than 2
filtered = v[positive]     # selecting elements by condition

For more information, see the article Vectorisation and logical indexing.

Useful examples

When you have already learned how to work with variables, functions, and conditions, it’s time to move on to interacting with external data: files, tables, and structures. Below are some useful examples that you can easily encounter in different work situations.

Reading and writing files

Sometimes you need to save data to a file or, conversely, download it from it.

open("output.txt", "w") do f # Writing a line to a file
    write(f, "Hello, file!")
end

Here:

  • "output.txt " is the file name;

  • "w" — write mode;

  • `do f …​ end' is a special form that automatically closes the file after recording.

Now let’s read the same file.:

content = read("output.txt", String) # Reading file contents
println("Read it: ", content)

The read(filename, String) function loads the entire content as a string.

Working with JSON

The JSON (JavaScript Object Notation) format is one of the most popular ways to store and exchange data between programs. Julia uses the JSON library to work with it.

using JSON

data = Dict("name" => "Alice", "age" => 30) # Creating a dictionary

json_str = JSON.json(data) # Converting the dictionary to a string in JSON
println(json_str)

parsed = JSON.parse(json_str) # Parsing the JSON back into
the println structure(parsed["name"])

Here:

  • Dict is a dictionary (key-value structure);

  • JSON.json(…​) — turns a dictionary or other data into a string in JSON format so that data can be saved or transmitted;

  • JSON.parse(…​) — converts the string back to the dictionary.

Working with tables (CSV and DataFrame)

Tables are one of the most convenient formats for working with data. Julia has a DataFrames package for this.:

using DataFrames, CSV

df = DataFrame(Name=["Alice", "Bob"], Age=[30, 25]) # Creating a table

CSV.write("people.csv", df) # Save it to a CSV file

df2 = CSV.read("people.csv", DataFrame) # Uploading it back from the file
println(df2)

Here:

  • DataFrame(…​) — creates a table from columns;

  • CSV.write(…​) — saves the table to the people.csv file;

  • CSV.read(…​) — loads the data from the file back to the table.