Hi, that's my problem:
I have to define a function f=f(x) that is the result of some work on
a function h=h(x,y) (e.g: the integration of h(x,y) respect to y)
How can I define the function h(x,y) as a FUNCTION depending only from
y?
In Matlab I solved this problem declaring w as global variable in both
the function routine f(x) and h(x,y). So, each time I assign a value
to x in f, this x is given to h as a fixed value x=x0 and h becomes a
function of y only, h=h(y)=h(xo,y) and I can integrate it using the
routines (that require that the function to integrate is a one
variable function, F=F(X)). For a better comprehension below is my
idea:
FUNCTION f(x)
real, intent(in):: x
real :: f,h
f= integral of h respect to y, where h depends on both x and y
END FUNCTION
FUNCTION h(y)
real, intent(in) :: y
real :: h
h=(x*y)*(y**2) <---- here I need something to make the program
understand that it must use the x declared as
input in f(x)
END FUNCTION
thanks for your help and your attention.
cheers,
celevic
|