{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lab6 - Doug Rivas ME 218 Lab 6 M 5 7 6.1 include ...

This preview shows pages 1–4. Sign up to view the full content.

Doug Rivas ME 218 Lab 6 M 5- 7 6.1 # include <stdio.h> # include <math.h> # define Pi 3.141592654 double alpha; double beta; double Freudenval; double Freud; double Freudenstein(double alpha, double beta); int main (void) { printf("Alpha Beta Error\n"); alpha= 1.308996939; beta= 0; while(beta <=360) { alpha= 1.308996939; Freudenval= Freudenstein(alpha, beta); printf("%lf %lf %lf\n", alpha, beta, Freudenval); beta= beta + 18; } } double Freudenstein(double alpha, double beta) { int a= 6; int b= 18; int c= 15; float d= 15.5;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
double Freudenval; alpha= 1.308996939; Freudenval= pow(a,2)- pow(b,2)+ pow(c,2)-pow(d,2) - 2*a*c*sin(alpha)*sin(beta/180*Pi)- 2*a*c*cos(alpha)*cos(beta/180*Pi) - 2*a*d*cos(alpha) +2*c*d*cos(beta/180*Pi); return Freudenval; } 6.2 Initial Bracket Choice is based on output from part 1, we can clearly see that there is a root between beta=288 and beta= 306, so an initial lower bracket guess towards the bottom of this range will yield the root. Output:
Code: #include <stdio.h> #include <math.h> #define Pi 3.141592654 double Freudenstein(double , double ); int main(void) { double xlow; double xhi; double alpha= 1.308996939; double xm;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

lab6 - Doug Rivas ME 218 Lab 6 M 5 7 6.1 include ...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online