Zephyr Scientific Library (zscilib)
energy.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_ENERGY_H_
23 #define ZEPHYR_INCLUDE_ZSL_ENERGY_H_
24 
25 #include <zsl/zsl.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
43 
57 
71 
72 
85 
96 int zsl_phy_ener_power(zsl_real_t ener, zsl_real_t time, zsl_real_t *power);
97 
110 
127  zsl_real_t ue, zsl_real_t *me);
128 
148  zsl_real_t ei4, zsl_real_t ef1, zsl_real_t ef2,
149  zsl_real_t ef3, zsl_real_t *ef4);
150 
162 
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif /* ZEPHYR_INCLUDE_ZSL_ENERGY_H_ */
180  /* End of energy group */
zsl_phy_ener_photon
int zsl_phy_ener_photon(zsl_real_t f, zsl_real_t *e)
Calculates the energy in electron volts of a photon based on it's frequency in hertz.
zsl_phy_ener_elas_pot
int zsl_phy_ener_elas_pot(zsl_real_t k, zsl_real_t dist, zsl_real_t *ue)
Calculates the elastic potential energy of a spring based on the distance it has been compressed/expa...
zsl_phy_ener_kin
int zsl_phy_ener_kin(zsl_real_t v, zsl_real_t m, zsl_real_t *ke)
Calculates the kinetic energy of a moving object based on its mass (m) and velocity (v).
zsl_phy_ener_grav_pot
int zsl_phy_ener_grav_pot(zsl_real_t m, zsl_real_t h, zsl_real_t *ug)
Calculates the gravitational potential energy in joules of an object based on its mass (m) and its he...
zsl_phy_ener_photon2
int zsl_phy_ener_photon2(zsl_real_t lambda, zsl_real_t *e)
Calculates the energy in electron volts of a photon based on it's wavelength in ??...
zsl_phy_ener_mec
int zsl_phy_ener_mec(zsl_real_t ke, zsl_real_t rke, zsl_real_t ug, zsl_real_t ue, zsl_real_t *me)
Calculates the total mechanical energy of a system by adding kinetic energy (linear and angular) and ...
zsl_phy_ener_fric
int zsl_phy_ener_fric(zsl_real_t fric, zsl_real_t dist, zsl_real_t *e)
Calculates the energy lost due to a friction force based on the distance the object experiencing the ...
zsl_phy_ener_power
int zsl_phy_ener_power(zsl_real_t ener, zsl_real_t time, zsl_real_t *power)
Calculates the power by dividing energy or work by time.
zsl.h
API header file for zscilib.
zsl_phy_ener_final
int zsl_phy_ener_final(zsl_real_t ei1, zsl_real_t ei2, zsl_real_t ei3, zsl_real_t ei4, zsl_real_t ef1, zsl_real_t ef2, zsl_real_t ef3, zsl_real_t *ef4)
Given the initial values of the two kinetic (linear and rotational) and the two potential (gravitatio...
zsl_real_t
double zsl_real_t
Definition: zsl.h:51
zsl_phy_ener_rot
int zsl_phy_ener_rot(zsl_real_t omega, zsl_real_t i, zsl_real_t *rke)
Calculates the angular kinetic energy of a rotating object based on its angular velocity (omega) and ...