Zephyr Scientific Library (zscilib)
electricity.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020 Kevin Townsend (KTOWN)
3  * Copyright (c) 2021 Marti Riba Pons
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
23 #ifndef ZEPHYR_INCLUDE_ZSL_ELECTRICITY_H_
24 #define ZEPHYR_INCLUDE_ZSL_ELECTRICITY_H_
25 
26 #include <zsl/zsl.h>
27 #include <zsl/vectors.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
45 
57 
70 
83 
96 
111  zsl_real_t *rty);
112 
125 
138 
151 
164 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif /* ZEPHYR_INCLUDE_ZSL_ELECTRICITY_H_ */
170  /* End of electricity group */
zsl_phy_elcty_resistivity
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 resista...
zsl_phy_elcty_res_series
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.
zsl_phy_elcty_current
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 peri...
zsl_phy_elcty_power_vi
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).
zsl_phy_elcty_ohm_law
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) ...
zsl_phy_elcty_cap_parallel
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.
zsl_phy_elcty_cap_series
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.
vectors.h
API header file for vectors in zscilib.
zsl_phy_elcty_power_vr
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).
zsl.h
API header file for zscilib.
zsl_vec
Represents a vector.
Definition: vectors.h:40
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
zsl_phy_elcty_power_ir
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).
zsl_phy_elcty_res_parallel
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.