Math Is Fun Forum

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

You are not logged in.

#1 2012-08-23 12:11:42

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

A custom Maxima Riemann sum function

integraten(f,a,b,n):=sum(ev(f,x=a+i*(b-a)/n)*(b-a)/n,i,0,n-1);

Last edited by anonimnystefy (2013-04-18 12:13:46)


“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

#2 2012-08-24 09:00:01

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

Re: A custom Maxima Riemann sum function

Hi;

What does ev do?


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

#3 2012-08-24 09:02:56

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

Re: A custom Maxima Riemann sum function

ev(expresson in x, x=value) evaluates the expression at a specified value of the variable x (or any variable which the expression is given with).


“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

#4 2012-08-24 19:33:46

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

Re: A custom Maxima Riemann sum function

Hi anonimnystefy;

Nice, but please correct this line in your function:

s:s+ev(f,x=i)*(a-b)/n,

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

#5 2012-08-24 22:09:12

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

Re: A custom Maxima Riemann sum function

Oh yeah. It should be b-a there.


“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

#6 2012-08-24 22:23:56

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

Re: A custom Maxima Riemann sum function

Hi;

That is exactly right.


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