-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
3,389 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include <stdlib.h> | ||
|
||
|
||
/*Decay solves for time to get a lot of fe | ||
Amanda Morrow October 6, 2002*/ | ||
|
||
double new_ni(double ni, double t) | ||
{ | ||
return(ni*(1-(t/8.8))); | ||
} | ||
double new_co(double co, double ni, double t) | ||
{ | ||
return(co*(1-(t/111))+(ni*(t/8.8))); | ||
} | ||
double new_fe(double co, double ni) | ||
{ | ||
return(1-ni-co); | ||
} | ||
|
||
int main() | ||
{ | ||
double ni, co, fe, dt; | ||
int t; | ||
t=0; | ||
ni=1.0; | ||
co=0.0; | ||
fe=0.0; | ||
while(fe<.99) | ||
{ | ||
ni=fabs(new_ni(ni,t)); | ||
co=new_co(co,ni,t); | ||
fe=new_fe(co,ni); | ||
t=t+1; | ||
|
||
} | ||
printf("ni= %f\t co= %f\t fe= %f\t the time elapsed is %d days\n",ni, co, fe, t); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include <stdlib.h> | ||
|
||
|
||
/*Decay solves for time to get a lot of fe | ||
Amanda Martin October 6, 2002*/ | ||
|
||
void func( double (*new_i)(double i, double j, double k), | ||
double (*new_j)(double i, double j, double k), | ||
double (*new_k)(double i, double j, double k), | ||
double *i, double *j, double *k, double p) | ||
{ | ||
while(p<50) | ||
{ | ||
int o,m,l; | ||
o=(int)i; | ||
m=(int)j; | ||
l=(int)k; | ||
*i=new_i(*i,*j,*k); | ||
*j=new_j(*i,*j,*k); | ||
*k=new_k(*i,*j,*k); | ||
p=p+1; | ||
if(l%1==0, m%1==0, o%1==0) | ||
{ | ||
printf("i= %d\t j= %d\t k=%d\t p=%d\n",*i,*j,*k, p); | ||
} | ||
} | ||
} | ||
|
||
double new_i(double i, double j, double k) | ||
{ | ||
i=sqrt(fabs(k*k-j*j)); | ||
return(i); | ||
} | ||
|
||
double new_j(double i,double j, double k) | ||
{ | ||
j=sqrt(fabs(k*k-i*i)); | ||
return(j); | ||
} | ||
|
||
double new_k(double i, double j, double k) | ||
{ | ||
k=sqrt(fabs(i*i+j*j)); | ||
return(k); | ||
} | ||
int main() | ||
{ | ||
double i, j, k; | ||
int t, p; | ||
t=1; | ||
p=0.0; | ||
i=1.0; | ||
j=1.0; | ||
k=1.0; | ||
func(&new_i, &new_j,&new_k,&i,&j,&k,p); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include <stdlib.h> | ||
#include "philsp.h" | ||
|
||
//Amanda Martin | ||
|
||
|
||
void func( double (*first)(double R, double F, double dt), | ||
double (*second)(double R, double F, double dt), | ||
double *R, double *F, double dt, double *i) | ||
{ | ||
while(*i<10000) | ||
{ | ||
*R=*R+first(*R, *F, dt); | ||
*F=*F+second(*R, *F, dt); | ||
*i=*i+dt; | ||
putpoint_plot(*R,*F,2,1,8,2.0,0); | ||
flush_plot(); | ||
delay_plot(1); | ||
} | ||
} | ||
|
||
double first(double R, double F, double dt) | ||
{ | ||
double a,b; | ||
a=0.2; | ||
b=.01; | ||
R=(a*R-b*R*F)*dt; | ||
return(R); | ||
} | ||
double second( double R, double F,double dt) | ||
{ | ||
double c,d; | ||
c=.001; | ||
d=.1; | ||
F=(c*F*R-d*F)*dt; | ||
return(F); | ||
} | ||
|
||
int main() | ||
{ | ||
double Rmin, Rmax, Fmin, Fmax, dt, R, F, i; | ||
int j,u,k; | ||
open_plot("800x800"); | ||
Rmin=0; | ||
Rmax=300; | ||
Fmin=0; | ||
Fmax=50; | ||
dt=0.1; | ||
R=200.0; | ||
F=20.0; | ||
i=0.0; | ||
box_plot(Rmin, Rmax, Fmin, Fmax,1.5, 1,"x","t","",""); | ||
func(&first,&second, &R, &F, dt, &i); | ||
return(0); | ||
} |
Oops, something went wrong.