Linux and Open Source Software Jnu

24
Linux and Open Source Software Linux and Open Source Software B y D r. S a n ja y A s s tt. P r o f. (P h y d r s k c h a u h a n @ , 9 9 9 0 R e fr e s h e r A c a d e m ic S J a n u a r y 3 1 , 2 0 at

Transcript of Linux and Open Source Software Jnu

Page 1: Linux and Open Source Software Jnu

Linux and Open Source SoftwareLinux and Open Source Software

B y D r . S a n j a y K u m a r C h a u h a n

A s s t t . P r o f . ( P h y s i c s ) , H i n d u C o l l e g e , D . U .d r s k c h a u h a n @ g m a i l . c o m, 9 9 9 0 2 7 2 4 7 1

R e f r e s h e r C o u r s e i n P h y s i c sA c a d e m i c S t a f f C o l l e g e , J N U

J a n u a r y 3 1 , 2 0 1 1 t o F e b r u a r y 2 5 , 2 0 1 1

at

Page 2: Linux and Open Source Software Jnu
Page 3: Linux and Open Source Software Jnu

Why Gnu/Linux, FOSS➢Saves us money in commercial license fees.

➢Fosters values of freedom and the community sharing of knowledge in our citizens.

➢No need to pay for antiviruses and their upgrades.

➢A complete transparency in software development and use.

➢Everyone is the owner of linux.

➢Better use of public money.

Allows us to infuse new life in old computers to be used for specialised

purposes and thus helping in E-WASTE Management.

One can create a super-computer using old computers by configuring a linux

cluster for load balancing and/or parallel programming/distributed computing

Page 4: Linux and Open Source Software Jnu

security No Viruses Stability Drivers Freedom Update Repositories

Desktops Support Games Pre-Customised

Full Source Code

Hardware Detection Save Money

Flexibility

Portability Not resourcedemanding

Clustering Supercomputing Compilers & IDEs

Page 5: Linux and Open Source Software Jnu

Knoppix 6.2

1) Overview of vastness, elegance, foss-freedom and ease of use.

2) 4-Desktops with 3-D effect, double tab, man & info pages, xman document

folders in /usr/share/doc, inbuilt help systems of all packages

3) Synaptic Manager, Overview of Available Packages, Specially see

Mathematics, graphics, Science and development sections.

4) Cheese, Media Players, usb-drive, tux paint, tux typing, gparted

5) Package Installer: Synaptic, Kpackage, gdbi-gtk,, apt-get install, dpkg, rpm

6) Best Data Recovery tools, man testdisk.

7) Kalzium, gperiodic, ghemical, man mpqc

8) Compatibility with old hardware.

9) Live DVD/CD + HDD/USB FLASH DRIVE options very useful for DEMO.

10) Vrms – list of non free & contributed software.

11) Clamscan -r --remove, freshclam, man genisoimage, man flashrom

12) Wine, playonlinux, acroread

Page 6: Linux and Open Source Software Jnu

Elegant Compilersknoppix@Microknoppix:/media/sda5/home$ gpc prime1.pasknoppix@Microknoppix:/media/sda5/home$ gfortran quad.fknoppix@Microknoppix:/media/sda5/home$ gcc hello.cknoppix@Microknoppix:/media/sda5/home$ g++ wellcome.c

For detailed list of compilers and IDEs see the other presentation titled:

“Linux_for_everyone.odp”At /media/sda5/Removable Disk (G)/MY_PRESENTATIONS/

Compiz Fusion Special Effects

<Alt-Tab>,tab...<Ctrl><Alt>-Tab, tab...

<Shift><Alt>-Up<Ctrl><Alt>- Left / Right

<Ctrl><Alt> and pressing the Down key.<Ctrl><Alt>Left Mouse Mouse pad

Page 7: Linux and Open Source Software Jnu

GNUPLOTGnuplot is a command-driven interactive function and data plotting program. If files are given, gnuplot loads each file with the load command, in the order specified. Gnuplot exits after the last file is processed.

Features of GNUPLOT

1)Plots any number of functions, built up of C operators, C library functions, and

some things C doesn't have like **, sgn(), etc. Also

2)support for plotting data files, to compare actual data to theoretical curves.

3)User-defined X and Y ranges (optional auto-ranging), smart axes scaling, smart tic

marks.

4)Labelling of X and Y axes.

5)User-defined constants and functions.

6)Support for many output devices and file formats

7)Shell escapes and command line substitution.

8)Load and save capability.

9)Output redirection.

10)All computations performed in the complex domain. Just the real part is plotted by

default, but functions like imag() and abs() and arg() are available to override this.

Page 8: Linux and Open Source Software Jnu

knoppix@Microknoppix:~$ gnuplot

G N U P L O TVersion 4.2 patchlevel 6 last modified Sep 2009System: Linux 2.6.32.6

Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009Thomas Williams, Colin Kelley and many others

Type `help` to access the on-line reference manual.The gnuplot FAQ is available from http://www.gnuplot.info/faq/

Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>

Terminal type set to 'wxt'gnuplot> set contourgnuplot> set hidden3dgnuplot> splot x*x*exp(-x*x)*y*y*exp(-y*y) output shown in fig1

gnuplot> set isosamples 60,60gnuplot> set ticslevel 0gnuplot> replotOutput shown in fig2

fig1

fig2

Page 9: Linux and Open Source Software Jnu

gnuplot> set xlabel "X"gnuplot> set ylabel "Y"gnuplot> set zlabel " F(x,y)"gnuplot> replotOutput is shown in fig3

fig3

gnuplot> set pm3dgnuplot> replotOutput is shown in fig4

fig4

gnuplot> set palette model RGB rgbformulae 22,23,24gnuplot> replotOutput is shown in fig5

fig5

gnuplot> show palette rgbformulae

Page 10: Linux and Open Source Software Jnu

Fig6

Y11

2

gnuplot> set angle degreegnuplot> set urange [0:360]gnuplot> set vrange [-90:90]gnuplot> set isosamples 60,60gnuplot> set ticslevel 0gnuplot> set size 0.65,1.0gnuplot> a=3.0/(8*pi)gnuplot> fx(u,v)=cos(u)*cos(v)gnuplot> fy(u,v)=sin(u)*cos(v)gnuplot> fz(v)=sin(v)gnuplot> g(v)=cos(v)*cos(v)gnuplot> splot a*g(v)*fx(u,v),a*g(v)*fy(u,v),a*g(v)*fz(v)Output is shown in fig6

gnuplot> a=5.0/(16*pi)gnuplot> g(v)=(3*sin(v)*sin(v)-1)**2gnuplot> set out '7.jpg'gnuplot> replotOutput is shown in fig7

Fig7

Y20

2

fig6

Y11

2

Spherical Harmonics

Page 11: Linux and Open Source Software Jnu

gnuplot> a=15.0/(8*pi)gnuplot> g(v)=(sin(v)*cos(v))**2gnuplot> replotOutput is shown in fig8

Fig8

Y21

2Fig8

Y21

2

Fig9

Y21

2

gnuplot> set pm3dgnuplot> set isosamples 80,80gnuplot> replotOutput is shown in fig9

Page 12: Linux and Open Source Software Jnu

gnuplot> set xrange [-1.5:0.5]gnuplot> set yrange [-1:1]gnuplot> set logscale zgnuplot> set isosample 50gnuplot> set hidden3dgnuplot> set contourgnuplot> complex(x,y)=x*{1,0}+y*{0,1} gnuplot> mandel(x,y,z,n)=(abs(z)>2.0||n>=1000)? n:mandel(x,y,z*z+complex(x,y),n+1)gnuplot> set pm3dgnuplot> set isosamples 60,60gnuplot> splot mandel(x,y,{0,0},0) notitle

Plotting Fractals

This fig. Is very complex.Run xaos to see the magnified view of such fractals.

Page 13: Linux and Open Source Software Jnu

p=(p+pi/10.0)set parametricsplot sin (p-u),sin(p-v),sin(u)*cos(v)pause 0.01if (p<6.0*pi) reread

Suppose a file animation3 contains the following script:

From within gnuplot issue the following commands and see the resultgnuplot> set pm3dgnuplot> set isosamples 60,60gnuplot> set hidden3dgnuplot> p=0gnuplot> load "animation3"

To save file do following:

gnuplot> set term gif transparent animategnuplot> set out 'animation4.gif'gnuplot> p=0gnuplot> load "animation3"

ANIMATION

Page 14: Linux and Open Source Software Jnu

set term postscript eps enhanced color solidset output "gauss.eps"set size 0.6,0.6set border 1set xlabel ""set xrange [ 0 : 20 ]set ylabel ""set yrange [ 0 : 0.4 ]set title "Gaussian distribution" font "Times-Roman,24"a = 5b = 10c = 7g = 2g1(x)=exp(-(x-a)*(x-a)/g/g/2.0)/sqrt(pi)/gg2(x)=exp(-(x-b)*(x-b)/g/g/2.0)/sqrt(pi)/gp1=g1(c)p2=g2(c)p3= (p1>p2) ? p1 : p2set style line 1 lt 1 lw 3set style line 2 lt 1 lw 1set style line 3 lt 2 lw 3set style line 4 lt 3 lw 3set arrow from a,0.35 to a,0.0 nohead linestyle 1set arrow from b,0.35 to b,0.0 nohead linestyle 1 set arrow from c,p3 to c,0.0 nohead linestyle 1set arrow from c,p1 to 14,p1 linestyle 2set arrow from c,p2 to 14,p2 linestyle 2set label "contribution from A" at 14,p1set label "contribution from B" at 14,p2set xtics nomirror ("E_A" a, "E_x" c, "E_B" b)set ytics nomirror ("" 0)set multiplotplot g1(x) notitle with lines linestyle 3plot g2(x) notitle with lines linestyle 4unset multiplot

Plotting many graphs with different Labels

Page 15: Linux and Open Source Software Jnu

Contents of quad.fknoppix@Microknoppix:~$ vi quad.f

real f,pi,x,y,a,b,c integer n,n1,i,j open(1,file='3D.dat') a=3.5 b=4.5 c=2.5 n=10 x=0.014 format(e12.5,2x,e12.5) do 4 i=0,n x=x+float(i)/float(n) f=a*x*x+b*x+c write(1,14) x,f4 continue stop end

Generate a data file for plotting and curve fitting

Run the following commands at terminal:knoppix@Microknoppix:~$ gfortran quad.fknoppix@Microknoppix:~$ ./a.outknoppix@Microknoppix:~$ vi 3D.dat

0.00000E+00 0.25000E+01 0.10000E+00 0.29850E+01 0.30000E+00 0.41650E+01 0.60000E+00 0.64600E+01 0.10000E+01 0.10500E+02 0.15000E+01 0.17125E+02 0.21000E+01 0.27385E+02 0.28000E+01 0.42540E+02 0.36000E+01 0.64060E+02 0.45000E+01 0.93625E+02 0.55000E+01 0.13312E+03

Page 16: Linux and Open Source Software Jnu

Plotting a data file and Curve Fittinggnuplot> a=3gnuplot> b=4gnuplot> c=2gnuplot> f(x)=a*x*x+b*x+cgnuplot> fit f(x) '3D.dat' via a,b,c

After 5 iterations the fit converged.final sum of squares of residuals : 5.89237e-06rel. change during last iteration : -1.44442e-11

degrees of freedom (FIT_NDF) : 8rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : 0.000858223variance of residuals (reduced chisquare) = WSSR/ndf : 7.36546e-07

Final set of parameters Asymptotic Standard Error======================= ==========================

a = 3.49968 +/- 9.575e-05 (0.002736%)b = 4.50114 +/- 0.0005105 (0.01134%)c = 2.49957 +/- 0.0004828 (0.01932%)correlation matrix of the fit parameters: a b c a 1.000 b -0.959 1.000 c 0.597 -0.741 1.000

Page 17: Linux and Open Source Software Jnu

Tex , LaTex and LyX Late 1970s -> 1989: TeX by Don Knuth

Decent typesetting by the authors! Same output now as in the future Low level, but powerful Frozen development

Starting early 1980s: LaTeX by Leslie Lamport High level language (macros, really) for TeX Easy to use! Current version is Latex2e

Matthias Ettrich (1995) shareware Lyrix in 1995, renamed to LyX under GPL

Page 18: Linux and Open Source Software Jnu

Why LaTeX, not Word?● Professional result, Just Elegant and Open Source● Portable i.e. Platform, version independent (Unix, Windows…)● Pre-set standard formats and Layouts (for paper, thesis…)● Bibliography, cross refrences, math equations management ● Latex encourages authors to write well structured texts.

● Freely available---0$ including all taxes● The commands are easy to learn ● Never crash, never lose your file ● Can compile very big books (unless your document is more than

70,000 pages!)● De facto standard for scientific publishing● Can run even on 386 PC and free add on packages are available

● complex structures such as footnotes, references, table of contents, index, list of figures and tables can be generated easily

Page 19: Linux and Open Source Software Jnu

LYXWhat you see is what you mean !?

WYSIWYG WYSIWYM LaTex

www.lyx.org

For class and style files see/usr/share/texmf-texlive/tex/latex

Tex --- Latex ------- Lyx

Page 20: Linux and Open Source Software Jnu

Why not MS Word?

Page 21: Linux and Open Source Software Jnu

The platform for numerical computation

?>demos>graphics>npendulum>view code

Page 22: Linux and Open Source Software Jnu

The reasons of the success

• Use cost very cheap

• Reliable and good quality product

• Reliable software publisher: Consortium, INRIA and dedicated team

• Open Source

Scilab

Matlab• Non specialized computation

• Graphics

• Language, interpretor • Simulink

• Specialized computation

• Tests, measures

• Real time, embedded

Scicos

Scilab today = replacing Matlab/Simulink for non specialized scientific computation

Page 23: Linux and Open Source Software Jnu

Other Extremely Powerful FOSS Softwares for Computational Science:

➔Wxmaxima------just see the capacities and forget matlab

➔labplot-----------just see the capacities and forget Origin.

➔playonlinux-----see windows applications running on linux

➔qliss3D----------Lissajous figures

➔clamscan -r --remove ~/ -----see how efficiently clam AV works

➔freshclam-----How easy to update antivirus database.

➔gparted-------play with partitions and formattings.

➔cheese-------web camera vedeo an snapsd

➔Virtualbox, qemulator----virtual machines

➔Monodevelop, eclipse, gambas-----example IDEs

➔Xaralx, hwinfo,

➔Virtualisation and clustering

➔Customised linux distros.

➔Pelican HPC---Instant Supercomputer.

Page 24: Linux and Open Source Software Jnu