Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riemann sums, added trapezoid option #10597

Open
sagetrac-gagansekhon mannequin opened this issue Jan 12, 2011 · 11 comments
Open

Riemann sums, added trapezoid option #10597

sagetrac-gagansekhon mannequin opened this issue Jan 12, 2011 · 11 comments

Comments

@sagetrac-gagansekhon
Copy link
Mannequin

sagetrac-gagansekhon mannequin commented Jan 12, 2011

For piecewise functions, added trapezoid option to riemann_sum and riemann_sum_integral_approximation to already existing option of left, right and midpoint.

Deprecated, trapezoid_integral_approximation and trapezoid

Component: calculus

Keywords: riemann sums, trapezoid

Author: Gagan Sekhon

Reviewer: Dmitrii Pasechnik, Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/10597

@sagetrac-gagansekhon sagetrac-gagansekhon mannequin added this to the sage-5.11 milestone Jan 12, 2011
@sagetrac-gagansekhon
Copy link
Mannequin Author

sagetrac-gagansekhon mannequin commented Jan 12, 2011

Attachment: riemann_sums.patch.gz

Attachment: trac_10597.patch.gz

@sagetrac-gagansekhon
Copy link
Mannequin Author

sagetrac-gagansekhon mannequin commented Jan 12, 2011

comment:1

changed file name and commit message to reflect trac number. Pleases use trac_10597.patch only.

@jdemeyer
Copy link

Reviewer: Dmitrii Pasechnik

@jdemeyer
Copy link

comment:6

There is a doctest failure:

sage -t  -force_lib devel/sage/doc/en/constructions/calculus.rst
**********************************************************************
File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2.alpha2/devel/sage-main/doc/en/constructions/calculus.rst", line 204:
    sage: f.trapezoid(4)
Expected:
    Piecewise defined function with 4 parts, [[(0, 1/2), 1/2*x],
    [(1/2, 1), 9/2*x - 2], [(1, 3/2), 1/2*x + 2],
    [(3/2, 2), -7/2*x + 8]]
Got:
    doctest:1: DeprecationWarning: _word_content is deprecated, use riemann_sum instead
    Piecewise defined function with 4 parts, [[(0, 1/2), 1/2*x], [(1/2, 1), 9/2*x - 2], [(1, 3/2), 1/2*x + 2], [(3/2, 2), -7/2*x + 8]]
**********************************************************************

@jdemeyer
Copy link

comment:7

A further small comment: in the docstrings, you should use OUTPUT: instead of Output:.

@jdemeyer
Copy link

Changed reviewer from Dmitrii Pasechnik to Dmitrii Pasechnik, Jeroen Demeyer

@sagetrac-gagansekhon
Copy link
Mannequin Author

sagetrac-gagansekhon mannequin commented Jan 23, 2011

comment:8

There is a discussion regarding this ticket on sage-devel.
http://groups.google.com/group/sage-devel/browse_thread/thread/c2c196ea37c753ae/bacb7b1fc3042d56?lnk=gst&q=gagan#bacb7b1fc3042d56

Until we come to a consensus, I think we should not merge it.

@dimpase
Copy link
Member

dimpase commented Jan 25, 2011

comment:9

Replying to @sagetrac-gagansekhon:

There is a discussion regarding this ticket on sage-devel.
http://groups.google.com/group/sage-devel/browse_thread/thread/c2c196ea37c753ae/bacb7b1fc3042d56?lnk=gst&q=gagan#bacb7b1fc3042d56

Until we come to a consensus, I think we should not merge it.

Do you refer to the objection that trapezoid rule is not a Riemann sum? IMHO it is moot.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-khalasz
Copy link
Mannequin

sagetrac-khalasz mannequin commented Dec 28, 2013

comment:11

While helping a high school Calculus student with basic integration I tried to use Sage to do some computational examples, and when it didn't work as I expected it to I came across this ticket. The student's textbook considered a trapezoidal sum to be a Riemann sum, so I think pushing this ticket through would be helpful from the standpoint of wanting Sage to be a useful educational tool.

It seems that only minor updates are needed to get this patch to a point where it would be acceptable. I would be willing to make these small changes. However, based on the discussion cited above, which didn't seem to come to any sort of conclusion, I am hesitant to do so. Any thoughts on whether this patch is worth cleaning up and adding to the Sage source? I vote yes, but of course I am no Sage guru.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe
Copy link
Member

mkoeppe commented Jun 25, 2016

comment:15

Patch is outdated after replacement of the piecewise implementation in #14801.

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Jun 25, 2016
@mkoeppe mkoeppe added this to the sage-7.3 milestone Jun 25, 2016
@davidlowryduda
Copy link
Contributor

comment:16

I was asked about this ticket recently by a beginner, since it has the beginner keyword. But after looking at the ticket, I think this is not a good beginner ticket, especially now that the underlying code has been completely rewritten since this was first proposed.

I'm removing the beginner tag. But I also suggest that this ticket be closed --- there are no longer any Riemann sums here, so the discussion as to whether a trapezoidal sum should be considered no longer applies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants