The purpose of my project is to apply function names as parameters in other functions. For that purpose we consider a function F which takes three real-valued arguments and returns a three-dimensional vector [p, q, r]. So, F is a mapping from R3 into R3, that is [p, q, r] = F(x, y, z).
All what i need is a place to start on it.....I'll appreciate it if anyone helps me with any tip,site,idea that i can searh to solve my problem
Thanks.
Below are the complete description of my project:
--------------------------------------------------
This Programming Project represents 15% of your overal grade. The purpose of this project is to apply function names as parameters in other functions. For that purpose we consider a function F which takes three real-valued arguments and returns a three-dimensional vector [p, q, r]. So, F is a mapping from R3 into R3, that is [p, q, r] = F(x, y, z).
The function F can be represented obviously by three separate functions, f, g, h, each of which takes three real-valued arguments and returns a real value. So, the vector equation [p, q, r] = F(x, y, z) can be written as three separate equations,
p = f(x,y,z)
q = g(x,y,z)
r = h(x,y,z)
Now, the function F may or may not have a fixed point by which we mean a vector [a, b, c] such that [a, b, c] = F(a, b, c).
A possible attempt at finding such a fixed point is to start with some initial values, x = x0 , y = y0 , and z = z0 , and repeat the following computations
x = f(x,y,z);
y = g(x,y,z);
z = h(x,y,z);
If the functions are nice and the initial values are well-chosen then this iteration will eventually converge to a three-dimensional fixed point, [a, b, c], that remains unchanged under the mapping F, i.e.
[a, b, c] = [ f(a, b, c), g(a, b, c), h(a, b, c)]
Now, this iteration should be performed by a method called fixer which is actually a higher-order function that takes six parameters namely, the three function names f, g, and h, and three real values for the initial values of x, y, and z.
For an example, apply the fixer method to the following fuctions,
double f1(double x, double y, double z)
{return ((7-2*y*y)/5+x)/2; }
double g1(double x, double y, double z)
{return (((10-(2*x+3)*x*x)/3)+2*z -x)/3; }
double h1(double x, double y, double z)
{return (x+y)/2; }
using the initial values, x = 0, y = 1, z = 2. Limit the number of iterations to 200. Also, your fixer should print out the current values of x, y, and z at every step of the iteration so that you may see the progress of the computation.
Then
you should also use the exact same fixer method for solving simultaneous linear equations of the form
a1,1 x + a1,2 y + a1,3 z = b1
a2,1 x + a2,2 y + a2,3 z = b2
a3,1 x + a3,2 y + a3,3 z = b3
where the coefficients, a1,1 , a2,2 , and a3,3 are nonzero, so that the equations can be brought to the explicit form
x = (b1 - a1,2 y - a1,3 z) / a1,1 , etc.
Your program should read the coefficient matrix A and the right-hand side vector B from an input file where the input data are represented as floating point numbers. Your program, of course, should also include the definitions of the three linear functions obtained from the above linear equations. Write this program in
Java where you cannot pass function names directly as parameters to other functions, but you can make use of interfaces or abstract functions.