Surface of graph

Started by
4 comments, last by Dave007 23 years, 6 months ago
Hi, I need to solve one problem. I have for eg. fx(x, y)=sin(x+y) defined on x=<-pi, pi>, y=<-pi, pi> and I need to compute surface of it. Anyone can help me??? Dave007 dave007@volny.cz
--------Dave[ Math Studio ] A Computer Algebra System
Advertisement
You'll need to integrate S(sin(x+y)dx) interval [-pi,pi]

The algorithm is something like this:
2i
I = 1/2(Ii+(b-a)/(2e(i-1))* E( f(a+j*(b-a)/2ej)) i=1(1)infinite
(i+1) i=1(2)

a=lower frontier
b=upper frontier
I=Iteration
j,i current iteration
E...sum
f...function
f(x)...value of f(x)

Numerical integration is not an easy thing to do.
Maybe you get it to work.



Edited by - cruz on October 17, 2000 5:15:56 PM
In one word: Integrate

This is the only function I can find at the moment:
    y = sin(ax + b)
    y''= a cos(ax + b)




I know I need to integrate, but
if I''m integrating f(x, y) only over
x....I don''t think it''s right.

Because what can I do when I have

x defined on [-pi, pi] and y on [-2pi, pi]??

so what''s now???

Dave007
[mail]dave007@volny.cz[/mail]
--------Dave[ Math Studio ] A Computer Algebra System
Since you''re going to integrate quantitatively, not analytically, anyway, why don''t you do a nested
loop of two integrations?

Something like this:

S_outer=0
Loop y from -pi to pi with step 0.001 ;or whatever
S_inner=0

Loop x from -pi to pi with step 0.001
S_inner=S_inner+my_cool_func(x,y)
End inner loop

S_outer=S_outer+S_inner
End outer loop
Oops, almost forgotten:

I''m not sure what you mean by
''I want to compute surface'',
but if it''s the area that you want to
compute, then, in the previous one, function

my_cool_func(x,y)

should actually calculate the area of a square
patch on the surface with dimensions like:
upper left: [x,y,fx(x,y)], where fx(x,y) is your original function
lower right: [x1,y1,fx(x1,y1)], where
x1=x+step (0.001 in our case)
y1=y+step

assuming the patch is small enough to be flat.

This topic is closed to new replies.

Advertisement