summaryrefslogtreecommitdiff
path: root/force.c
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-02-06 11:26:44 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-02-06 11:26:44 -0500
commit97a693d996c79fb2a008b19750d8bb45512e01a2 (patch)
tree6df17bfe7de7c59f7b1083828d71a91e61fae9fa /force.c
downloadengr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.tar.gz
engr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.tar.bz2
engr0016-97a693d996c79fb2a008b19750d8bb45512e01a2.zip
Inital commitHEADmaster
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;
+}