maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & MeeGo Harmattan & Sailfish (https://talk.maemo.org/showthread.php?t=78568)

rcolistete 2012-02-04 18:47

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
Good news for Maemo 5 users ! SymPy can now make graphics with the easy-to-use 'Plot()' function. And 'preview()' function also works (partially).

Maemo 5 users need to install the optional dependency "PyGlet", see how to install it in the 1st post of this topic.

The SymPy 'Plot' section of the SymPy for smartphones & tablets site has a lot of links, hints, tips and examples.

The new version of SymPy for Maemo 5 (see post below) shows after "?Plot" the following keyboard controls (stylus controls translation for 2D graphics and rotation for 3D graphics), where the 'SHIFT' modifier is used for smooth movements of 3D plots :

Code:

    Plot Window Keyboard Controls
    =============================
   
    Screen Rotation:
        X,Y axis      Arrow Keys, A,S,D,W, Numpad 4,6,8,2
        Z axis        Q,E, Numpad 7,9
   
    Model Rotation:
        Z axis        Z,C, Numpad 1,3
   
    Zoom:            R,F, PgUp,PgDn, Numpad +,-
   
    Reset Camera:    X, Numpad 5
   
    Camera Presets:
        XY            F1, G
        XZ            F2, H
        YZ            F3, J
        Perspective  F4, K
   
    Sensitivity Modifier: SHIFT
   
    Axes Toggle:
        Visible      F5, T
        Colors        F6, Y
   
    Close Window:    ESCAPE
    Screenshot:      F8, I
    =============================

On Maemo 5, labels on axes and axes tick marks don't work, so, don't use "axes='label_ticks=true; label_axes=true'" inside 'Plot()'.

Examples of SymPy 'Plot()' :

Function of 1 variable, y = f(x), a dumped harmonic oscillator :
In [1]: Plot(2.5*exp(-1.0*x/2)*cos(pi*x), [0,10,150], width=800, caption='Dumped harmonic oscillator')
Timing : 12s / 2s (repeated).
http://www.robertocolistete.net/Pyth...oscillator.png

2D parametric function of 1 variable, x = f(t), y = g(t), an explosion :
In [1]: Plot(t*sin(8*t)*cos(8*t)*cos(t), t*sin(8*t)*cos(8*t)*sin(t), [0,4*pi,1600], width=800, caption='Parametric Explosion', axes='stride=1.0')
Timing : 57s / 17s (repeated).
http://www.robertocolistete.net/Pyth...-explosion.png

3D parametric curve of 1 variable, x = f(t), y = g(t), z = h(t), a wire 3D curve :
In [1]: Plot((2+cos(16*t))*cos(t), (2+cos(16*t))*sin(t), sin(16*t), [800], axes='colored=true', width=800, caption='Wire 3D curve')
Timing : 51s / 9s (repeated).
http://www.robertocolistete.net/Pyth...wire-curve.png

3D surface in cartesian coordinates, z = f(x,y), a surface z colored :
In [1]: Plot(5*x*y*exp(-x**2-y**2), [-2,2,100], [-2,2,100], 'color=zfade4', axes='colored=true', width=800, caption='Surface z colored')
Timing : 36s / 30s (repeated).
http://www.robertocolistete.net/Pyth...-z-colored.png

3D surface in cylindrical coordinates, r = f(theta=t,z=h), a wormhole :
In [1]: Plot(z**2/4+1, [], [z,-3,3], 'mode=cylindrical; style=both; color=zfade4', axes='colored=true', width=800, caption='Wormhole surface')
Timing : 25s / 16s (repeated).
http://www.robertocolistete.net/Pyth...e-wormhole.png


The SymPy 'preview()' function partially works on Maemo 5. For example :
Code:

In [1]: preview(integrate(sin(x)**15,x),output='dvi',euler=False)
works on Nokia N900 with TeXLive and Evince installed. The PNG and PDF outputs don't work because there are no 'dvipng' and 'dvipdf' in Maemo 5 (but there is 'dvipdfm' and 'dvipdfmx' which can be manually used or a link can be created from one of them to '/usr/bin/dvipdf'). PS output is created but not show by Evince.

rcolistete 2012-02-04 22:34

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
For Maemo 5 users : to better control the graphics made by 'Plot()', I have released new versions of SymPy.

SymPy 0.7.1 Maemo5 and SymPy interactive shell 0.7.1 Fremantle2 (04/02/2012), available in extras-devel repository :
- 'Plot()' and 'preview()' work with the optional dependency 'python-pyglet' on Maemo 5, to install it, type 'apt-get install python-pyglet' as root;
- Nokia N900 extra keys to control plots made by the 'Plot()' command.

Then, more improvements and fixes in the same day :

SymPy 0.7.1 Maemo6 and SymPy interactive shell 0.7.1 Fremantle3 (04/02/2012), available in extras-testing and extras-devel repositories :
- 'Plot()' and 'preview()' work with the optional dependency 'python-pyglet' on Maemo 5, to install it, type 'apt-get install python-pyglet' as root;
- Nokia N900 extra keys to control plots made by the 'Plot()' command.
- increased sensitivity of keyboard and mouse/stylus control for 'Plot()' graphics;
- removed '.pyc' files from package because they are created during installation.

The 'SymPy interactive shell' will appear as an update on your Nokia N900, just confirm the installation.

rcolistete 2012-02-05 23:37

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
As cited above, I have made a "SymPy for smartphones & tablets" site :

http://www.robertocolistete.net/Python/SymPy/

Nokia N900 & Maemo 5 OS is clearly the best smartphone/tablet for SymPy/Python use. Nokia N8x0 & Maemo 4 OS and Nokia N9 & MeeGo Harmattan are also well ranked.

The above cite also summarizes how to install SymPy in mobile OS.

By the way, the Q4 2011 report from Canalys shows that 2011 was the year when smartphones shipped more than all the client PC's (pads, net/notebooks and desktops).

Maybe in 5 years timeframe Python (with SymPy, etc) will be more used in smartphonees & tablets than in PC's.

rcolistete 2012-02-07 22:00

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
See the end of the 1st post of this topic for voting to promote SymPy to extras repository.

rcolistete 2012-02-22 17:22

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
Good news for Maemo 4 users : "SymPy Interactive Shell" is released, so the installation and use of SymPy on Maemo 4 is now easier than before. See the "Install & use on Maemo 4" section of the 1st post of this topic.

IPython 0.10.2 for Maemo 4 & 5 was also released, so "SymPy Interactive Shell" became possible on Maemo 4.

stalhein 2012-02-29 19:38

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
It's great to have Matlab-like capabilities on smartphone! Any new development on MeeGo Harmattan?

rcolistete 2012-03-01 17:11

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
Quote:

Originally Posted by stalhein (Post 1172241)
It's great to have Matlab-like capabilities on smartphone! Any new development on MeeGo Harmattan?

For MeeGo Harmattan, look at MatPlotLib, which can be used with NumPy and SymPy on Nokia N9/N950.

Yes, I am working on MeeGo Harmattan development : SymPy with icon (for Nokia Store), Uncertainties (python module), Calculus (Limit+Integral+Derivative in PySide/QML), trying IPython 0.11/0.12 (and building its dependencies...), MatPlotLib 1.1, etc.

Last weeks were dedicated to Maemo 4/5 development and packaging : PyGlet and updated SymPy for Maemo 5, IPython 0.10.2 for Maemo 4 & 5, SymPy Interactived Shell for Maemo 4, Uncertainties for Maemo 4 & 5, Django for Maemo 4.

rcolistete 2012-03-10 14:57

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
Good news for Nokia :

- N8x0 users, "SymPy Interactive Shell" and its dependency "IPython" were promoted to extras repository;

- N900 users, "IPython" and "SymPy Interactive Shell" (which depends on "IPython") are now both on extras-testing repository waiting for votes to be promoted to extras. See the the end of 1st posts of the topics :
IPython for Maemo 4 & 5 & 6
SymPy (Computer Algebra System) for Maemo 4 & 5 & 6

dschwertb 2012-03-10 17:40

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
One thing I'm really missing on my N900:
a Python shell which has an integrated on-screen number block (for numbers and maybe a few other characters which are often needed for Python and for use as calculator).

Regards,

Dietmar

rcolistete 2012-03-10 17:55

Re: [Announce] SymPy (Computer Algebra System) for Maemo 4 & 5 & 6
 
Quote:

Originally Posted by dschwertb (Post 1177523)
One thing I'm really missing on my N900:
a Python shell which has an integrated on-screen number block (for numbers and maybe a few other characters which are often needed for Python and for use as calculator).

Regards,

Dietmar

Help me understand : what about double press on Fn (blue arrow above Shift) to obtain numbers and other symbols ?


All times are GMT. The time now is 19:02.

vBulletin® Version 3.8.8