This file contains utility functions used by oscillations simulation to help in calculations.
More...
Go to the source code of this file.
|
| int | _valid_osc (double x, double y, double length, double mass, double gravity, double k, double time_limit, double step_size, double damping_coefficent, int number_of_files, double Fo) |
| | Validate on input entered to oscillation.
|
| |
| int | _min_int (int x, int y) |
| | get the minimum between x,y
|
| |
| int | _round (double x) |
| | round x value to the nearest int
|
| |
| double | _dx (double dx) |
| | calculate dx for elastic pendulum system
|
| |
| double | _dy (double dy) |
| | calculate dy for elastic pendulum system
|
| |
| double | _f1 (double x, double y, double dx, double tx, double ty, double k, double m, double b, double r) |
| | calculate first function to solve ode in elastic pendulum
|
| |
| double | _f2 (double x, double y, double dy, double tx, double ty, double k, double m, double b, double r, double g) |
| | calculate second function to solve ode in elastic pendulum
|
| |
|
void | printmemsizestream (char *str, unsigned long ramsize) |
| |
| int | printmemstream () |
| | this function prints memory details for the computer
|
| |
| int | cpu_inf_stream () |
| | this function prints the cpu info for the computer
|
| |
|
int | _mkdir (char *_dir_name) |
| |
This file contains utility functions used by oscillations simulation to help in calculations.
◆ _dx()
calculate dx for elastic pendulum system
- Parameters
-
- Returns
◆ _dy()
calculate dy for elastic pendulum system
- Parameters
-
- Returns
◆ _f1()
| double _f1 |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
dx, |
|
|
double |
tx, |
|
|
double |
ty, |
|
|
double |
k, |
|
|
double |
m, |
|
|
double |
b, |
|
|
double |
r |
|
) |
| |
calculate first function to solve ode in elastic pendulum
- Parameters
-
- Returns
◆ _f2()
| double _f2 |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
dy, |
|
|
double |
tx, |
|
|
double |
ty, |
|
|
double |
k, |
|
|
double |
m, |
|
|
double |
b, |
|
|
double |
r, |
|
|
double |
g |
|
) |
| |
calculate second function to solve ode in elastic pendulum
- Parameters
-
- Returns
◆ _min_int()
| int _min_int |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
get the minimum between x,y
- Parameters
-
- Returns
- min(x,y)
◆ _round()
round x value to the nearest int
- Parameters
-
- Returns
- rounded x
◆ _valid_osc()
| int _valid_osc |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
length, |
|
|
double |
mass, |
|
|
double |
gravity, |
|
|
double |
k, |
|
|
double |
time_limit, |
|
|
double |
step_size, |
|
|
double |
damping_coefficent, |
|
|
int |
number_of_files, |
|
|
double |
Fo |
|
) |
| |
Validate on input entered to oscillation.
- Parameters
-
| x | distance x |
| y | distance y |
| length | max length |
| mass | mass of bob |
| gravity | |
| k | stiffeness of spring |
| time_limit | how much time needed to simulate |
| step_size | how much time change per iteration |
| damping_coefficent | damping factor affecting on the system |
| number_of_files | |
| Fo | |
- Returns
- 1 if all are valid, 0 if [mass < 0 || k < 0 || time_limit <= 0 || step_size < 0 || length <= 0 || gravity <= 0 || damping_coefficent < 0], and -1 if max_length > length
◆ cpu_inf_stream()
this function prints the cpu info for the computer
- Returns
- int
◆ printmemstream()
this function prints memory details for the computer
- Returns
- int