Zephyr Scientific Library (zscilib)
eleccomp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020 Kevin Townsend (KTOWN)
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
22 #ifndef ZEPHYR_INCLUDE_ZSL_ELEC_COMPS_H_
23 #define ZEPHYR_INCLUDE_ZSL_ELEC_COMPS_H_
24 
25 #include <zsl/zsl.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
42 
60 
72 
84 
98 int zsl_phy_ecmp_trans(uint8_t t1, zsl_real_t v1, uint8_t t2, zsl_real_t *v2);
99 
112  zsl_real_t *v);
113 
129  zsl_real_t i0, zsl_real_t *i);
130 
146  zsl_real_t q0, zsl_real_t *q);
147 
163  zsl_real_t i0, zsl_real_t *i);
164 
180  zsl_real_t q0, zsl_real_t *q);
181 
196  zsl_real_t i0, zsl_real_t *i);
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif /* ZEPHYR_INCLUDE_ZSL_ELEC_COMPS_H_ */
203  /* End of electrical components group */
zsl_phy_ecmp_rlc_volt
int zsl_phy_ecmp_rlc_volt(zsl_real_t vr, zsl_real_t vl, zsl_real_t vc, zsl_real_t *v)
Calculates the total voltage of a RCL circuit based on the voltage in the resistance (vr),...
zsl_phy_ecmp_rc_charg_q
int zsl_phy_ecmp_rc_charg_q(zsl_real_t r, zsl_real_t c, zsl_real_t t, zsl_real_t q0, zsl_real_t *q)
Calculates the electric charge in coulombs of a capacitor in a RC circuit during its charging phase.
zsl_phy_ecmp_capac_ad
int zsl_phy_ecmp_capac_ad(zsl_real_t a, zsl_real_t d, zsl_real_t *c)
Calculates capacitance in farads based on the permitivity of freespace multiplied by area (a) and div...
zsl_phy_ecmp_trans
int zsl_phy_ecmp_trans(uint8_t t1, zsl_real_t v1, uint8_t t2, zsl_real_t *v2)
Calculates the output voltage in volts in a two-coil based transformer given the number of turns on e...
zsl_phy_ecmp_rc_discharg_i
int zsl_phy_ecmp_rc_discharg_i(zsl_real_t r, zsl_real_t c, zsl_real_t t, zsl_real_t i0, zsl_real_t *i)
Calculates the electric current of a capacitor in a RC circuit during its discharging phase.
zsl_phy_ecmp_rl_current
int zsl_phy_ecmp_rl_current(zsl_real_t r, zsl_real_t l, zsl_real_t t, zsl_real_t i0, zsl_real_t *i)
Calculates the electric current in amperes of a RL circuit in time.
zsl_phy_ecmp_rc_discharg_q
int zsl_phy_ecmp_rc_discharg_q(zsl_real_t r, zsl_real_t c, zsl_real_t t, zsl_real_t q0, zsl_real_t *q)
Calculates the electric charge in coulombs of a capacitor in a RC circuit during its discharging phas...
zsl_phy_ecmp_ener_induc
int zsl_phy_ecmp_ener_induc(zsl_real_t l, zsl_real_t i, zsl_real_t *u)
Calculates the energy in joules of an inductor of inductance 'l' and electric current 'i'.
zsl_phy_ecmp_rc_charg_i
int zsl_phy_ecmp_rc_charg_i(zsl_real_t r, zsl_real_t c, zsl_real_t t, zsl_real_t i0, zsl_real_t *i)
Calculates the electric current of a capacitor in a RC circuit during its charging phase.
zsl_phy_ecmp_ener_capac
int zsl_phy_ecmp_ener_capac(zsl_real_t c, zsl_real_t v, zsl_real_t *u)
Calculates the energy in joules of a capacitor of capacitance 'c' and voltage 'v'.
zsl.h
API header file for zscilib.
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
zsl_phy_ecmp_capac_cpv
int zsl_phy_ecmp_capac_cpv(zsl_real_t q, zsl_real_t v, zsl_real_t *c)
Calculates capacitance in farads based on charge (q) and voltage (v).