summaryrefslogtreecommitdiff
path: root/force.c
diff options
context:
space:
mode:
Diffstat (limited to 'force.c')
-rw-r--r--force.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/force.c b/force.c
new file mode 100644
index 0000000..70d371b
--- /dev/null
+++ b/force.c
@@ -0,0 +1,26 @@
+/*File force.c
+Calculate the piecewise time force. The formula depends on wether time t is less or equal to 3 seconds */
+#include <stdio.h>
+#define M 3
+
+int main()
+{
+ int x = 0;
+ while(x<10)
+ {
+ double p,t;
+ printf("Useing time %i", x);
+ t= x;
+ if(t<=M)
+ {
+ p = 20;
+ }
+ else
+ {
+ p = 4*(t+2);
+ }
+ printf("Force p = %f (N)\n",p);
+ x++;
+ }
+ return 0;
+}