diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/c/differential_calculus/includes/ode.h | 9 | ||||
-rw-r--r-- | src/c/differential_calculus/interfaces/int_ode.h | 9 | ||||
-rw-r--r-- | src/c/differential_calculus/ode/ode.c | 26 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitand.h | 2 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitcmp.h | 2 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitget.h | 2 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitor.h | 2 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitset.h | 2 | ||||
-rw-r--r-- | src/c/elementaryFunctions/includes/bitxor.h | 2 | ||||
-rw-r--r-- | src/c/scilab-arduino/default_files/setup_arduino.h | 1 |
10 files changed, 51 insertions, 6 deletions
diff --git a/src/c/differential_calculus/includes/ode.h b/src/c/differential_calculus/includes/ode.h new file mode 100644 index 0000000..46220a8 --- /dev/null +++ b/src/c/differential_calculus/includes/ode.h @@ -0,0 +1,9 @@ +// FOSSEE IIT Bombay +#ifdef __INT_ODE_H__ +#define __INT_ODE_H__ + +double ODE(double initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel \ + double step_size) + +#endif /*__INT_ODE_H__*/
\ No newline at end of file diff --git a/src/c/differential_calculus/interfaces/int_ode.h b/src/c/differential_calculus/interfaces/int_ode.h new file mode 100644 index 0000000..5000ed5 --- /dev/null +++ b/src/c/differential_calculus/interfaces/int_ode.h @@ -0,0 +1,9 @@ +// FOSSEE IIT Bombay + +#ifdef __INT_ODE_H__ +#define __INT_ODE_H__ + +#define d0d0d0g2ODEd0(in1, in2, in3, in4) ODE(in1, in2, in3, in4, 1, 1.0e-2,\ + 1.0e-2, 1.0e-6) + +#endif /*__INT_ODE_H__*/
\ No newline at end of file diff --git a/src/c/differential_calculus/ode/ode.c b/src/c/differential_calculus/ode/ode.c new file mode 100644 index 0000000..b815e36 --- /dev/null +++ b/src/c/differential_calculus/ode/ode.c @@ -0,0 +1,26 @@ +// FOSSEE IIT Bombay + +#include "ODE.h" +#include "types.h" + + +double ODE(double initial_value, double start_time, double end_time, \ + char *ode_function, double nequs, double eps_abs, double eps_rel \ + double step_size) +{ + double out = 0; + int status; + //Setup ODE related parameters + gsl_odeiv2_system sys = {ode_function, NULL, 2, NULL}; + + gsl_odeiv2_step *s = gsl_odeiv2_step_alloc (gsl_odeiv2_step_rkf45, nequs); + gsl_odeiv2_control *c = gsl_odeiv2_control_y_new (eps_abs, eps_rel); + gsl_odeiv2_evolve *e = gsl_odeiv2_evolve_alloc (nequs); + + status = gsl_odeiv2_evolve_apply_fixed_step (e, c, s, &sys, &t, stepsize, x_dot); + + if (status == GSL_SUCCESS) { + return out; + } + else return 0; +} diff --git a/src/c/elementaryFunctions/includes/bitand.h b/src/c/elementaryFunctions/includes/bitand.h index b7f5151..f411e05 100644 --- a/src/c/elementaryFunctions/includes/bitand.h +++ b/src/c/elementaryFunctions/includes/bitand.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif /* bitand returns the logical AND operation diff --git a/src/c/elementaryFunctions/includes/bitcmp.h b/src/c/elementaryFunctions/includes/bitcmp.h index 8176681..aa18265 100644 --- a/src/c/elementaryFunctions/includes/bitcmp.h +++ b/src/c/elementaryFunctions/includes/bitcmp.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif /* bitcmp returns the complement diff --git a/src/c/elementaryFunctions/includes/bitget.h b/src/c/elementaryFunctions/includes/bitget.h index 0eaf57e..4719155 100644 --- a/src/c/elementaryFunctions/includes/bitget.h +++ b/src/c/elementaryFunctions/includes/bitget.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif diff --git a/src/c/elementaryFunctions/includes/bitor.h b/src/c/elementaryFunctions/includes/bitor.h index 16a6a3d..d915ffa 100644 --- a/src/c/elementaryFunctions/includes/bitor.h +++ b/src/c/elementaryFunctions/includes/bitor.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif /* bitor returns the logical OR operation diff --git a/src/c/elementaryFunctions/includes/bitset.h b/src/c/elementaryFunctions/includes/bitset.h index 862a4c8..52f9f2c 100644 --- a/src/c/elementaryFunctions/includes/bitset.h +++ b/src/c/elementaryFunctions/includes/bitset.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif diff --git a/src/c/elementaryFunctions/includes/bitxor.h b/src/c/elementaryFunctions/includes/bitxor.h index 4e27635..3bc77a2 100644 --- a/src/c/elementaryFunctions/includes/bitxor.h +++ b/src/c/elementaryFunctions/includes/bitxor.h @@ -8,7 +8,7 @@ #include "dynlib_elementaryfunctions.h" #include "types.h" -#ifdef __cpluscplus +#ifdef __cplusplus extern "C" { #endif /* bitxor returns the logical OR operation diff --git a/src/c/scilab-arduino/default_files/setup_arduino.h b/src/c/scilab-arduino/default_files/setup_arduino.h index 9eb0ed4..acbf8e2 100644 --- a/src/c/scilab-arduino/default_files/setup_arduino.h +++ b/src/c/scilab-arduino/default_files/setup_arduino.h @@ -24,6 +24,7 @@ ** --- SCI2C Includes. --- ** ----------------------- */ +#include "Arduino.h" #include "sci2clib.h" /* ** --------------------------- |