Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#201 2013-08-04 06:53:31

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Theoretically, Romberg should be much better than Simpson's.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#202 2013-08-04 07:28:19

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

But, it is more complicated to program, though.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#203 2013-08-04 07:44:23

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

You only need one column and the the formula generates all the rest.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#204 2013-08-04 07:46:44

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

But, how do I know how many values to get for the first column?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#205 2013-08-04 07:50:11

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

You do not. But like a difference table how far you go horizontally depends on how tall the first column is. Each column is more and more accurate, so pick a number n and go from there.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#206 2013-09-01 05:26:27

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

Hi,

Can anyone tell how to find the value of the following integral upto four significant digits with the help of a computer but not a readymade CAS?

J simulation:

load 'trig'            NB. required for cos
samp =: 1000000        NB. the number of samples
avg =: +/%#            NB. the average function
f =: ?samp$0           NB. random numbers in range (0,1)
fn =: cos f*pi%4       NB. get the list of cosines after scaling into range (0,pi/4)
fn100 =: fn^100        NB. get the 100th power
avg fn100*pi%4         NB. Take the average after multiplying (pi/4-0)

≈ 0.125139

which is close enough!


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#207 2013-09-01 06:14:45

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Isn't o. used for trig functions as well?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#208 2013-09-01 15:18:29

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

trig functions must be loaded.
o.n is pi times n.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#209 2013-09-01 20:21:55

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Only when monadic. As dyadic, it represents circle functions: http://www.jsoftware.com/help/dictionary/dodot.htm


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#210 2013-09-02 17:56:44

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

Okay, thanks, did not see that before!


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#211 2013-09-02 20:59:30

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

You're welcome.

The functions are hard to remember.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#212 2013-09-02 21:37:48

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

Indeed, they are hard to remember and understand.
Anyway, it's good and quick once we get a hang of it. Their documentation is good, but scattered. They need to reorganize that.
E.g. I had to search for quite a long time to find how to change the array values


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#213 2013-09-02 21:44:31

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

I agree. Fortunately, the tutorials I found on that site are great!

How good are you with tacit expressions?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#214 2013-09-02 22:03:00

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

Yes, and there are essays in that site with very useful programs!

I'm still learning. Are you too trying out J?


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#215 2013-09-03 05:44:07

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Yes, I've seen them. They are fantastic.

I have learned a bit about it, I was amazed by how simple and complex it looks at the same time. Also, the tacit programming part of J caught my eye. I haven't done much in it though.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#216 2013-09-03 05:55:15

gAr
Member
Registered: 2011-01-09
Posts: 3,482

Re: An Integral and the Computer

Okay, tacit programming is the best part of the language.

But needs much practice to know the rules and use it efficiently.


"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense"  - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

#217 2013-09-03 06:00:26

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Yes, that is pretty much the reason why I could never do much in it.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#218 2014-05-21 19:48:31

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: An Integral and the Computer

How do I evaluate this?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

#219 2014-05-21 19:52:29

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

What have you tried and although you have posted this in Computer math, I have to ask what method do you want?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#220 2014-05-21 20:03:01

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Hi Agnishom

You can use this fact:

I would not recommend it, though.

Last edited by anonimnystefy (2014-05-21 20:04:36)


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#221 2014-05-21 20:21:16

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Here is an answer that uses Gaussian integration and has an error of approximately 10^-48


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#222 2014-05-22 00:49:36

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

And the exact answer, given by M is:

Last edited by anonimnystefy (2014-05-22 00:49:51)


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#223 2014-05-22 01:47:33

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

Hi;

Unless he wants an numerical integration method.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#224 2014-05-22 02:11:14

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: An Integral and the Computer

Well, it is the exact answer even if he doesn't want it.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#225 2014-05-22 02:13:22

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: An Integral and the Computer

But he has M so why would he not do that himself?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

Board footer

Powered by FluxBB