program to numerically integrate

R

rockwell

Hi groups i want to write a program ro numerically integrate an
equation using the rectangle method,i know a little bit about the
rectangle method but never used it abd dont quite really know how to
program it.if you guys know how to do it, can you help me out.
the equation looks like

eq = ∫ sin(θ*Π) / cos(2*Π*θ) ,the
integration is from 0 to 1000.

Thanks in advance,
Bye
 
J

John Harrison

rockwell said:
Hi groups i want to write a program ro numerically integrate an
equation using the rectangle method,i know a little bit about the
rectangle method but never used it abd dont quite really know how to
program it.if you guys know how to do it, can you help me out.
the equation looks like

eq = ∫ sin(θ*Π) / cos(2*Π*θ) ,the
integration is from 0 to 1000.

Thanks in advance,
Bye

Post the effort you made, and someone will help you with it. No-one is going
to do your homework for you, you would not learn anything that way so it
wouldn't be good for anyone.

john
 
G

Gernot Frisch

rockwell said:
Hi groups i want to write a program ro numerically integrate an
equation using the rectangle method,i know a little bit about the
rectangle method but never used it abd dont quite really know how to
program it.if you guys know how to do it, can you help me out.
the equation looks like

eq = ∫ sin(θ*Π) / cos(2*Π*θ) ,the
integration is from 0 to 1000.

Thanks in advance,
Bye

eq = x^2
integration from 0 to 100
So, basically you make smal stips of let's say 0.01 width and
calculate the area of this strip.

di = (value_left + value_right) / 2 * detla_width;

Then you only sum it up.

HTH,
Gernot
 
J

JKop

Gernot Frisch posted:
eq = x^2
integration from 0 to 100
So, basically you make smal stips of let's say 0.01 width and
calculate the area of this strip.

di = (value_left + value_right) / 2 * detla_width;

Then you only sum it up.

HTH,
Gernot

Gernot, I'd prefer if you wouldn't fully answers people's
questions like that when they've shown no effort at all,
especially when it looks like a homework question.

Rockwell, if you want me to do your homework for you, head
to rentacoder.com and I'll do it for a nominal fee.

But if you want some help with C++, make an effort and I'll
be more than willing to share what I know (and can do).


-JKop
 
G

Gernot Frisch

JKop said:
Gernot Frisch posted:


Gernot, I'd prefer if you wouldn't fully answers people's
questions like that when they've shown no effort at all,
especially when it looks like a homework question.

Rockwell, if you want me to do your homework for you, head
to rentacoder.com and I'll do it for a nominal fee.

But if you want some help with C++, make an effort and I'll
be more than willing to share what I know (and can do).

I just explained how to do it. I didn't post any line of code. I think
it's fair to explain _how_ things work for a homework. Because
understanding how it works is the aim of a homework.
 
J

JKop

Gernot Frisch posted:
I just explained how to do it. I didn't post any line of code. I think
it's fair to explain _how_ things work for a homework. Because
understanding how it works is the aim of a homework.



I suppose...


-JKop
 
S

Smith

JKOP,
go back to your java group. we don't need java cop jkop jgop or whatever,
things like you are not appropriate in comp.lang.c++ group. especially for
bagging money. back to your NULL land.

Gernot is right.
 
J

JKop

Smith posted:
JKOP,
go back to your java group. we don't need java cop jkop jgop or
whatever, things like you are not appropriate in comp.lang.c++ group.
especially for bagging money. back to your NULL land.

Gernot is right.


Disgusting grammar.

Really Smith, I'd love to help you here on this one, but I don't know Java,
nor can I comprehend how a person could possibly be not appropriate in a
newsgroup. "NULL land" doesn't exist, that's just where Mammy tells you
Daddy's gone.


-JKop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top