# Handy calculations

### Overview

The **Handy calculation** tool addresses numerous specific calculation cases in various fields of photonics. Indeed, **263** computation pages are proposed in many domains : diffraction, fiber optics, geometric optics, interference, laser, optoelectronics, polarization, radiometry/photometry.

A set of conversions page is also available. The calculation pages integrate informations to guide and help for an improved understanding and a better use.

### Find a calculation with the menus

The calculation pages are accessible from the drop-down menus displayed after clicking on the "handy calculations" link at the top left of each page. These drop-down menus correspond to the different fields of photonics. The related sub-menus are topics of the considered field.

After clicking on a submenu, a calculation page is displayed by default.

### Find a calculation with the "search" cell

An alternative way to find a calculation is to enter key words in the **search** cell located in the header. Indeed, the list of relevant calculations with all key words is displayed if the button **and** is validated. If the button **or** is validated, the list includes the calculations relevant with at least one of the keywords. In any case, for each relevant calculation, the list includes a link to the calculation, a short description and eventually a small explanatory scheme.

Note that it is also possible to access to a calculation page from the list displayed in the "sitemap" page.

### Calculation page overview

Each calculation page includes several blocks :

- a **list of links (1)** to calculation pages relevant to the topic (displayed on the left side),

- one or two **calculation table(s) (2)** depending on the calculation format,

- a link to a **tutorial ** and some **tooltips (3)** (displayed above the **calculation table(s)**),

- the **path (4)** up to the calculation page (displayed above the **tooltips** and **link to a tutorial**),

- an **explanatory scheme (5)** in most of the calculation pages that can be enlarged by clicking on it (at the top left of the page).

### List of links

By clarity, the list may be organized by sub topics. The user can access to the calculation of his choice by clicking on its title in the list. the title is then highlighted by appearing with a darker color. A padlock is represented to the left of each calculation title in three different ways:

- means that the calculation can be processed freely without any connection,

- means that the calculation can be processed if the user is connected and has a Student or a Premium license,

- means that the calculation can be processed if the user is connected and has a Premium license only.

More details on the accessibility of the calculations and features are provided in the features page.

### Calculation tables

Basically, each handy calculation page is used to perform a calculation from input data. Two formats are possible:

- ** first format** for which input data and output data are separated in two tables ( "input" table and "output" table),

- ** second format** for which only one table ("parameters" table) is displayed; one of the parameters (corresponding to the empty cell) is chosen to be the output. All the others are input data.

The input/output data units can be selected in the "unit" column. The calculation is realized and the results are displayed in the dedicated table after clicking on the button "calculate" or "table" (one of this button is necessarily displayed on the page). In some pages, the results can also be displayed in a graphic by using the "graphic" or "curve" buttons or any other custom button.

The input values can be entered either in numerical or scientific format using a maximum of **14** digits .

The output values are displayed in scientific format with a minimum of **2** decimal places and a maximum of **6** decimal places.

**variable input parameter**

Except for the conversion pages, it is possible to perform the calculation by varying a parameter in a range of values. The input parameter to be varied is then selected by the corresponding radio button in the "variable" column. Its minimum value **val _{min}** and maximum value

**val**are entered respectively in the corresponding "MIN" and "MAX" cells. Finally, the number of values +1 to be considered is entered in its "STEPS" cell. The calculations are realized for each value of the parameter

_{max}**val**+

_{min}**i**/

**STEPS***(

**val**-

_{max}**val**).

_{min}**i**varies from "0" to "STEPS".

the input values can be entered either in numerical or scientific format using a maximum of

**8**digits. The results are displayed in scientific format. Displayed input and output values use respectively

**6**and

**4**decimal places. The number of values ("STEPS" columns) is limited to

**200**.

The results can be either displayed in a table or in curves.

The results appear in a table after clicking on the "tableV" button. For each output, three columns are displayed. The first column labelled "cod.Er" corresponds to an error code which value is **0** if the calculation has been processed and **1** if it has not been processed because it is not possible or not accurate enough. The second column corresponds to the value of the variable input. The third column is the output value. The fixed input values are diplayed on the top of the table.

The results appear in curves after clicking on the "curveV" button. There are as many curves as output parameters to calculate. For each curve, the abscissa represents the variable parameter values and the ordinate represents the output values. The fixed input values are diplayed on the top of the curve.

**Caution**

In each page, input cells are filled by default to allow the calculation. These default values are first automatically loaded. In some cases, they lead to an error message because they are not relevant to the computation. This comes from the fact that they may be used in different pages and they cannot necessarily be appropriate to each of the calculations. Next, these default values can be replaced by values entered or computed by the user and can also lead to error messages in certain calculations. One solution would have been to choose different parameters for each calculation page but it was not adopted because it is sometimes useful to use input values or calculated values as input values in other pages without having to re-enter them.

In some pages, the message "not possible" may be displayed in the parameter(s) cell(s) to be calculated without any prior error message. This is because, some intermediate tests are performed during the calculation in order to avoid unrealistically or inaccurate values. Unlike preliminary tests like those preventing from divisions by zero, eventual issues arising from these tests can not be displayed as a full error message and therefore appear directly in the cell(s).

Some mismatchs can happen in the **second format** of calculations where any parameter can be calculated from all others. There are cases where the display accuracy is not sufficient and computation of an initial input using results from a previous calculation may lead to a different value than the original one. In general, the difference is small. However, there are cases where the difference can be large (for instance, the re-computation of the "dark current" in the "shot noise current" page with very different initial values for the "photocurrent" and "dark current"). Higher display accuracy would solve this issue but would cause other problems in the current display modes.

### tooltips

The **tooltips** and **tutorial** are available for a better understanding of the calculation. Here are their functions :

- **about** displays a tooltip explaining what the calculation does.

- **caution** displays a tooltip detailing the main precautions when entering the input data.

- **parameters** displays a tooltip giving the definition of each parameter involved in the calculation.

- **glossary** displays a tooltip giving the definition of some specific words used in the page or relevant to the calculation.

- **tutorial** is a link to a tutorial page about the calculation topic.

The tooltips appear when the user hover the mouse over its label. It is also possible to display a tooltip content in a separate page by clicking on its label.

### Using the glass catalog and choosing wavelengths

In some computation pages, the refraction index is an input parameter. Instead of enterring a number, the user can enter a glass reference
from the catalog page (**path : handy calculations/general/catalogs**).

If the wavelength is not an input parameter of the concerned page, the calculation uses the refraction index of the selected reference at the default wavelength defined in the wavelength page (**path : handy calculations/general/wavelengths**). Initially,
the default wavelength is 0.55 microns. However, it can be changed by clicking on the wavelength page and enterring a new value in the
"lam" cell.

When the wavelength is an input parameter of the computation page,
the calculation uses the refraction index at the enterred wavelength and this wavelength is also registered as the new default wavelength that can then be used in other calculations.

For chromatism calculations, instead of enterring the refraction indexes of a medium corresponding to the smallest and the largest wavelengths of the considered spectrum, the user can also enter a glass reference
from the catalogs defined in the catalogs link. By default, the smallest wavelength is 0.48613 microns and the largest wavelength is 0.65627 microns. However, these wavelengths can be changed in the
wavelength page by enterring new values in the "lam_{_min}" and "lam_{_max}" cells.

Note that It is necessary that "lam_{_min}" < "lam" < "lam_{_max}", otherwise an error message is displayed.