Electricity functions.
More...
|
int | zsl_phy_elcty_current (zsl_real_t q, zsl_real_t t, zsl_real_t *i) |
| Calculates the electric current based on the charge (q) that crosses a transversal area during a period of time (t). More...
|
|
int | zsl_phy_elcty_res_series (struct zsl_vec *v, zsl_real_t *r) |
| Calculates the equivalent resistance of a set of resistors in series. More...
|
|
int | zsl_phy_elcty_res_parallel (struct zsl_vec *v, zsl_real_t *r) |
| Calculates the equivalent resistance of a set of resistors in parallel. More...
|
|
int | zsl_phy_elcty_cap_series (struct zsl_vec *v, zsl_real_t *c) |
| Calculates the equivalent capacitance of a set of capacitors in series. More...
|
|
int | zsl_phy_elcty_cap_parallel (struct zsl_vec *v, zsl_real_t *c) |
| Calculates the equivalent capacitance of a set of capacitors in parallels. More...
|
|
int | zsl_phy_elcty_resistivity (zsl_real_t r, zsl_real_t a, zsl_real_t l, zsl_real_t *rty) |
| Calculates the resistivity of a uniform piece of material of area section 'a', length 'l' and resistance 'r'. More...
|
|
int | zsl_phy_elcty_ohm_law (zsl_real_t i, zsl_real_t r, zsl_real_t *v) |
| Calculates the voltage between two points in an electrical circiut based on the electric current (i) and resistance (r) using Ohm's law. More...
|
|
int | zsl_phy_elcty_power_vi (zsl_real_t v, zsl_real_t i, zsl_real_t *p) |
| Calculates the electric power based on the voltage (v) and electric current (i). More...
|
|
int | zsl_phy_elcty_power_ir (zsl_real_t i, zsl_real_t r, zsl_real_t *p) |
| Calculates the electric power based on the electric current (i) and the resistance (r). More...
|
|
int | zsl_phy_elcty_power_vr (zsl_real_t v, zsl_real_t r, zsl_real_t *p) |
| Calculates the electric power based on the voltage (v) and the resistance (r). More...
|
|
Electricity functions.
◆ zsl_phy_elcty_cap_parallel()
Calculates the equivalent capacitance of a set of capacitors in parallels.
- Parameters
-
v | Vector whose coefficients are the capacitances in farads of the capacitors in parallel. |
c | Pointer to the equivalent capacitance in farads. Will be set to NAN if any of the input capacitances is negative. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_cap_series()
Calculates the equivalent capacitance of a set of capacitors in series.
- Parameters
-
v | Vector whose coefficients are the capacitances in farads of the capacitors in series. |
c | Pointer to the equivalent capacitance in farads. Will be set to NAN if any of the input capacitances is negative or zero. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_current()
Calculates the electric current based on the charge (q) that crosses a transversal area during a period of time (t).
- Parameters
-
q | Charge in coulombs. |
t | Time in seconds. |
i | Pointer to the calculated electric current in amperes. Will be set to NAN if the time is negative ir zero. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_ohm_law()
Calculates the voltage between two points in an electrical circiut based on the electric current (i) and resistance (r) using Ohm's law.
- Parameters
-
i | Electric current in amperes. |
r | Resistance in ohms. |
v | Pointer to the calculated voltage in volts. Will be set to NAN if the resistance is negative. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_power_ir()
Calculates the electric power based on the electric current (i) and the resistance (r).
- Parameters
-
i | Electric current in amperes. |
r | Resistance in ohms. |
p | Pointer to the output electric power in watts. Will be set to NAN if the resistance is negative. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_power_vi()
Calculates the electric power based on the voltage (v) and electric current (i).
- Parameters
-
v | Voltage in volts. |
i | Electric current in amperes. |
p | Pointer to the output electric power in watts. |
- Returns
- 0 if everything executed correctly, otherwise an appropriate error code.
◆ zsl_phy_elcty_power_vr()
Calculates the electric power based on the voltage (v) and the resistance (r).
- Parameters
-
v | Voltage in volts. |
r | Resistance in ohms. |
p | Pointer to the output electric power in watts. Will be set to NAN if the resistance is negative or zero. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_res_parallel()
Calculates the equivalent resistance of a set of resistors in parallel.
- Parameters
-
v | Vector whose coefficients are the resistances in Ohms of the resistors in parallel. |
r | Pointer to the equivalent resistance in Ohms. Will be set to NAN if any of the input resistances is negative or zero. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_res_series()
Calculates the equivalent resistance of a set of resistors in series.
- Parameters
-
v | Vector whose coefficients are the resistances in Ohms of the resistors in series. |
r | Pointer to the equivalent resistance in Ohms. Will be set to NAN if any of the input resistances is negative. |
- Returns
- 0 on success, and non-zero error code on failure.
◆ zsl_phy_elcty_resistivity()
Calculates the resistivity of a uniform piece of material of area section 'a', length 'l' and resistance 'r'.
- Parameters
-
r | Resistance of the material in ohms. |
a | Area section in square meters. |
l | Length in meters. |
rty | Pointer to the resistivity in ohms times meters. Will be set to NAN if the area section, length or resistance are negative, or if l = 0. |
- Returns
- 0 on success, and non-zero error code on failure.