# program to numerically integrate

Discussion in 'C++' started by rockwell, Sep 24, 2004.

1. ### rockwellGuest

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.

Bye

rockwell, Sep 24, 2004

2. ### John HarrisonGuest

"rockwell" <> wrote in message
news:...
> 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.
>
> Bye

to do your homework for you, you would not learn anything that way so it
wouldn't be good for anyone.

john

John Harrison, Sep 24, 2004

3. ### Gernot FrischGuest

"rockwell" <> schrieb im Newsbeitrag
news:...
> 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.
>
> 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

Gernot Frisch, Sep 24, 2004
4. ### JKopGuest

Gernot Frisch posted:

>
> "rockwell" <> schrieb im

Newsbeitrag
> news:...
>> Hi groups i want to write a program ro numerically

integrate an
>> equation using the rectangle method,i know a little bit

>> 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.
>>
>> 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

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

JKop, Sep 24, 2004
5. ### Gernot FrischGuest

"JKop" <> schrieb im Newsbeitrag
news:NuQ4d.31901\$...
> Gernot Frisch posted:
>
>>
>> "rockwell" <> schrieb im

> Newsbeitrag
>> news:...
>>> Hi groups i want to write a program ro numerically

> integrate an
>>> equation using the rectangle method,i know a little bit

>>> 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.
>>>
>>> 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

>
> 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.

Gernot Frisch, Sep 24, 2004
6. ### JKopGuest

Gernot Frisch posted:

>
> "JKop" <> schrieb im Newsbeitrag
> news:NuQ4d.31901\$...
>> Gernot Frisch posted:
>>
>>>
>>> "rockwell" <> schrieb im

Newsbeitrag
>>> news:...
>>>> Hi groups i want to write a program ro numerically

integrate an
>>>> equation using the rectangle method,i know a little

>>>> 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*Π*&#

952 ,the
>>>> integration is from 0 to 1000.
>>>>
>>>> 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

>>
>> 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,

>> 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.
>

I suppose...

-JKop

JKop, Sep 24, 2004
7. ### SmithGuest

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.

"JKop" <> Ð´ÈëÓÊ¼þ
news:x6R4d.31913\$...
> Gernot Frisch posted:
>
> >
> > "JKop" <> schrieb im Newsbeitrag
> > news:NuQ4d.31901\$...
> >> Gernot Frisch posted:
> >>
> >>>
> >>> "rockwell" <> schrieb im

> Newsbeitrag
> >>> news:...
> >>>> Hi groups i want to write a program ro numerically

> integrate an
> >>>> equation using the rectangle method,i know a little

> >>>> 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*Π*&#

> 952 ,the
> >>>> integration is from 0 to 1000.
> >>>>
> >>>> 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
> >>
> >> 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,

> >> 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.
> >

>
>
>
> I suppose...
>
>
> -JKop

Smith, Sep 25, 2004
8. ### JKopGuest

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