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

Login

Username

Password

Not registered yet?

#1 2012-08-24 10:11:42

anonimnystefy
Real Member

Online

A custom Maxima Riemann sum function

Code:

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-19 10:13:46)


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“A secret's worth depends on the people from whom it must be kept.” ― Carlos Ruiz Zafón

#2 2012-08-25 07:00:01

bobbym
Administrator

Offline

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.
Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means.
90% of mathematicians do not understand 90% of currently published mathematics.

#3 2012-08-25 07:02:56

anonimnystefy
Real Member

Online

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


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“A secret's worth depends on the people from whom it must be kept.” ― Carlos Ruiz Zafón

#4 2012-08-25 17:33:46

bobbym
Administrator

Offline

Re: A custom Maxima Riemann sum function

Hi anonimnystefy;

Nice, but please correct this line in your function:

Code:

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

In mathematics, you don't understand things. You just get used to them.
Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means.
90% of mathematicians do not understand 90% of currently published mathematics.

#5 2012-08-25 20:09:12

anonimnystefy
Real Member

Online

Re: A custom Maxima Riemann sum function

Oh yeah. It should be b-a there.


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“A secret's worth depends on the people from whom it must be kept.” ― Carlos Ruiz Zafón

#6 2012-08-25 20:23:56

bobbym
Administrator

Offline

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.
Probability is the most important concept in modern science, especially as nobody has the slightest notion what it means.
90% of mathematicians do not understand 90% of currently published mathematics.

Board footer

Powered by FluxBB