Notices


Reply
Thread Tools
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#11
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).


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


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


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


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



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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-01-16 at 04:23. Reason: Labels on axes problem on Maemo 5 is cited
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#12
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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2012-02-05 at 14:03. Reason: Promoted to extras-testing repository
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#13
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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following User Says Thank You to rcolistete For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#14
See the end of the 1st post of this topic for voting to promote SymPy to extras repository.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#15
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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2012-02-22 at 17:25.
 
Posts: 9 | Thanked: 0 times | Joined on Feb 2012
#16
It's great to have Matlab-like capabilities on smartphone! Any new development on MeeGo Harmattan?
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#17
Originally Posted by stalhein View Post
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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2012-03-01 at 18:23.
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#18
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
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 
Posts: 6 | Thanked: 8 times | Joined on Oct 2010
#19
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
 
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#20
Originally Posted by dschwertb View Post
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 ?
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.
 

The Following User Says Thank You to rcolistete For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 03:21.