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

interacts for high school level education #9623

Closed
haraldschilly opened this issue Jul 28, 2010 · 63 comments
Closed

interacts for high school level education #9623

haraldschilly opened this issue Jul 28, 2010 · 63 comments

Comments

@haraldschilly
Copy link
Member

Include the interacts listed here in $SAGE/devel/sage-main/sage/interacts/...

Apply:

  1. attachment: trac_9623-rebase-v3.patch
  2. attachment: 9623_copyright_v2.patch

CC: @kcrisman @sagetrac-mhampton @robert-marik @rbeezer @sagetrac-jthurber

Component: interact

Author: Lauri Ruotsalainen, Harald Schilly, Robert Mařík, Marshall Hampton

Reviewer: Jason Grout, Karl-Dieter Crisman, John Thurber, Marshall Hampton

Merged: sage-4.7.1.alpha0

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

@haraldschilly
Copy link
Member Author

comment:3

Finished porting most of the examples to the sage library. There are some remaining issues:

  • practice_differentiating_polynomials - mixups with the states happen
  • trigonometric_properties_triangle and
  • special_points - drawing the items doesn't always work as it should.

If there is somebody who sees the bug, please correct it ;)

Apart from that, they are now conveniently accessible via interacts.calculus.[TAB], interacts.geometry.[TAB] and interacts.statistics.[TAB]. Maybe I implement some additional ones from the wiki, too... (and it probably doesn't hurt to add a h2 header and some introduction text to each example)

@haraldschilly
Copy link
Member Author

comment:4

the "from the wiki" patch is meant to be applied on top of the "high school" patch to keep things separate for now.

@haraldschilly
Copy link
Member Author

Attachment: 9623-interacts-high-school.patch.gz

@haraldschilly
Copy link
Member Author

Attachment: 9623-from-the-wiki.patch.gz

@haraldschilly
Copy link
Member Author

comment:5

I know that practice_differentiating_polynomials is buggy and that a few more comments in the generated output of each example to explain what it is all about won't hurt, but I call it finished for now and I will not add more examples. Maybe a reviewer finds the bug or donates some additional words?

@haraldschilly haraldschilly changed the title interacts for high school level interacts for high school level education Jul 30, 2010
@haraldschilly
Copy link
Member Author

Attachment: 9623-interact-examples.patch.gz

@haraldschilly
Copy link
Member Author

comment:6

I've added a short introduction and a pointer to these interacts in the reference manual. 9623-interact-examples.patch combines both patches and the other ones can be removed.

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Aug 16, 2010

comment:9

Thanks for nice patch, I'll look at it. First ideas: practice_differentiating_polynomials does not work as expected, so I think that it could be removed.

I think that it is better to enter limits from keyboard for trapezoidal and Simpson integration rather than input from slider. I also think that it is better to use html.table in Newton method and it is worth to include option which puts computation fot trapezoidal and Simposon integration in a table. Also newton_method and secant method should have similar input forms (presicion is negative power of ten in one of the interacts and positive in the other).

In the integrals, dx should be TeX-ed as \mathrm{d}x

I am collecting these ideas and include then in a reviewer patch which comes (hope) in few days.

@haraldschilly
Copy link
Member Author

comment:10

Replying to @robert-marik:

practice_differentiating_polynomials does not work as expected

I know, it's something odd about the state transitions and I just did not have enough patience ...

I think that it is better to enter limits from keyboard for trapezoidal and Simpson integration rather than input from slider.

Ok, well, I like the range slider better. It's a matter of taste but the reason for that is that I tried to make it as intuitive as possible and that includes using mouse handles than having to type in numbers.

I'm fine with your other comments.

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Aug 17, 2010

comment:11

Replying to @haraldschilly:

Ok, well, I like the range slider better.

On the other hand, with sliders you cannot integrate from 0 to 1. I changed the interacts for trapezoidal and simpson rule and they accept both input from slider and keyboard. I hope, this is intuitive enough.

I tested all interacts and give a positive review (removed practice_differentiating_polynomials which does not work as expected)

Added interact for bisection, since it is close to secant method and newton method.

Added interact for definition of Riemann integral, which is close to trapezoidal rule and Simpson formula, removed.

Fixed one deprecation warning. Added titles to (most) of the interacts. Added tables for computation related to Simpson and trapezoidal rule.

Positive review for 9623-interact-examples.patch! Thank you for the patch. I wonder if the layout parameter in interact can be used also with library_interact.

I included reviewer patch in 9623-interact-examples2.patch. Could you or someone else review my changes?

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Aug 17, 2010

apply after 9623-interact-examples.patch

@robert-marik
Copy link
Mannequin

robert-marik mannequin commented Aug 17, 2010

comment:12

Attachment: 9623-interact-examples2.patch.gz

Btw: The interact for riemann integral is a part of work which has been supported by the grant 131/2010 of the FRVŠ

Known problem for trapezoidal and simpson integration: bad rendering of the computation if we integrate negative function: minus sign follows dot or plus sign.

@jasongrout
Copy link
Member

comment:13

Some comments:

  • several typos and nicer latex symbols---see patch
  • interacts.library.cube_hemisphere() -- the cube corners do not touch the hemisphere, so I'm confused what the picture is supposed to be.
  • interacts.library.coin() -- Again, I'm confused about what the picture should be. The code looks like it is plotting [(i,k/i) for i in num_points random numbers]. I'm not sure what the y-axis is supposed to represent, given that there is no documentation.
  • function_tool -- you can have a button selected in each row, which looks really weird. This is a problem with interacts, and should be another ticket.

@jasongrout
Copy link
Member

comment:14

Try again:

Some comments:

  • several typos and nicer latex symbols---see patch

  • interacts.library.cube_hemisphere() -- the cube corners do not touch the hemisphere, as the docs indicate that they should

  • interacts.library.coin() -- Again, I'm confused about what the picture should be. The code looks like it is plotting [(i,k/i) for i in num_points random numbers]. I'm not sure what the y-axis is supposed to represent, given that there is no documentation. I think the fix is to add documentation

  • (for another ticket) function_tool -- you can have a button selected in each row, which looks really weird. This is a problem with interacts, and should be another ticket.

@jasongrout
Copy link
Member

apply on top of previous patches

@jasongrout
Copy link
Member

comment:15

Attachment: 9623-reviewer2.patch.gz

Robert's changes look good. Can someone comment on points 2 and 3 in my list above?

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 12, 2011

Rebases all previous patches against 4.6.1 and makes minor import changes

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 12, 2011

Reviewer: Jason Grout

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 12, 2011

Author: Harald Schilly, Robert Marik, Marshall Hampton

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 12, 2011

comment:16

Attachment: trac_9623_rebase_and_import_change.patch.gz

Rather than let this bit-rot I would like to see it go in soon. There are endless tweaks and improvements that can be made to these but it would be nice to have this much included.

I removed the init.py and replaced it with an all.py that avoids importing everything in the library.py file, which leaves the autocompletion options of interacts much less cluttered.

@jdemeyer
Copy link

comment:39

Attachment: 9623_copyright.patch.gz

@kcrisman
Copy link
Member

comment:40

This is an example of the kind of not-really-necessary thing that really delays tickets. When it was written, it was 2010!

But now that you did it, I will have to say 'needs work'. Although Harald put it in writing, since Lauri Ruotsalainen is the one who came up with many of these in her thesis, it seems inappropriate to not put her in the author listing at the top where you added Harald. So at least something like based on work by ... should be added there.

@jdemeyer
Copy link

comment:41

Replying to @kcrisman:

This is an example of the kind of not-really-necessary thing that really delays tickets. When it was written, it was 2010!

Note that changing the year was only a trivial change, I made the headers compliant with the developers manual http://sagemath.org/doc/developer/conventions.html#headings-of-sage-library-code-files

@jdemeyer
Copy link

comment:42

Anyone wants to fix this????

@jdemeyer jdemeyer modified the milestones: sage-4.7, sage-4.7.1 Apr 25, 2011
@kcrisman
Copy link
Member

comment:43

Yes, but it's just tedious enough (for me, because I'm very non-automated and still am a novice with queues) that it isn't as high a priority. Is there any way you can just merge the previous material and move the copyright patch, with the request to add Ruotsalainen, on another ticket? I feel like that would be much more productive, and actually rather easier for me (or someone else) to fix easily.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Apr 26, 2011

Added "partially based on work by Lauri Ruotsalainen"

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Apr 26, 2011

comment:44

Attachment: 9623_copyright_v2.patch.gz

I updated the copyright patch to reflect the contributions of Lauri Ruotsalainen. I can change it if someone objects.

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member

comment:45

This seems reasonable enough; Harald did do the actual turning into a Sage file. Thanks, Marshall.

I assume that is positive review of Jeroen's changes, and I don't think such a trivial change (in terms of code) that Marshall just made needs other review. They aren't in the reference manual yet, so nothing needed there. Passes tests. Positive review!

@jdemeyer
Copy link

jdemeyer commented May 3, 2011

Merged: sage-4.7.1.alpha0

@jhpalmieri
Copy link
Member

comment:47

A question for anyone who contributed to this ticket: the file library_cython.pyx has this code in it:

cpdef cellular(rule, int N):
    '''
    Cythonized helper function for the callular_automata fractal.
    Yields a matrix showing the evolution of a Wolfram's cellular automaton.
    Based on work by Pablo Angulo.
    http://wiki.sagemath.org/interact/misc#CellularAutomata
    
    INPUT:

        - `rule` -- determines how a cell's value is updated, depending on its neighbors
        - `N` -- number of iterations

    TESTS::

        sage: from sage.interacts.library_cython import cellular
        sage: rule = [1, 0, 1, 0, 0, 1, 1, 0]
        sage: N = 3
        sage: print cellular(rule, 3)

    '''

Note that the output from the last line of the doctest is missing. Since the docstring is enclosed in triple single quotes instead of triple double quotes, doctesting skipped this altogether. At #8708, there is a patch which will now run doctests within triple single quotes, in which case this file has one failure.

So the question is: what is the output supposed to be? When I run this command, I get

        sage: print cellular(rule, 3)
        [[0 0 0 1 0 0 0]
         [0 0 0 1 0 0 0]
         [0 1 0 1 0 1 0]]

Is this right? I don't know what the mathematics here is trying to do, so I really have no idea...

@kcrisman
Copy link
Member

comment:48

There's also a typo - "callular" isn't an adjective I'm familiar with in Wolfram's work :) And N is not actually used in the rule.

See this MathWorld site for the descriptions. The rule is given by binary, so this rule is 2+4+32+128=166. It looks like there is in fact an error; I'm having a lot of trouble getting the rules to do what they should with things like rules 1 or 2.

Here's the problem:

        for k in range(N-j, N+j+1):

instead of

 for k in range(0,2*N):

as on the wiki. Someone thought they'd be smart and only update the cells that "need" updating... but that totally screws it up, as ALL cells might need updating if e.g. the rule has the final binary digit = 1.

I'm opening a ticket for this. Thanks a lot for catching this, John.

@kcrisman
Copy link
Member

comment:49

This is now #11871. John, if you want that ticket to "fix" the quoting issue as well, you can put that there; if it doesn't matter because of #8708, then no matter.

@fchapoton
Copy link
Contributor

Changed author from Lauri Ruotsalainen, Harald Schilly, Robert Marik, Marshall Hampton to Lauri Ruotsalainen, Harald Schilly, Robert Mařík, Marshall Hampton

@jdemeyer
Copy link

comment:51

Replying to @kcrisman:

  • Polar prime spiral plot point issue.

See #22665 for a follow-up on this.

@jdemeyer
Copy link

comment:52

Replying to @kcrisman:

  • Figuring out how to truly doctest them. For instance, there could at least be a search for deprecation warnings, or even random input typed... but at least more than just checking that an html block is formed.

See #22644 for some real tests using Jupyter.

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

6 participants