SlideShare una empresa de Scribd logo
1 de 7
Descargar para leer sin conexión
All-In-One Scientific Research With SageTEX

                                      Hsin-Yu Ko
                                 National Taiwan University


                                     June 9, 2012




                                                              1/
Hsin-Yu Ko   kosinyj@gmail.com        PyCon Taiwan 2012          7
                                                               1/7
Concept of WEB
                             1
WEB is Not WWW




    • Coding And Documenting
      Simultaneously
    • CWEB, CWEAVE,
      FortranWEB. . .
    • Generate foo.o and foo.dvi. . .
    • Text/TeX + C/Fortran. . .




        1
             Knuth, Donald E. (1992). Literate Programming.   2/
Hsin-Yu Ko    kosinyj@gmail.com           PyCon Taiwan 2012      7
                                                               2/7
Why Do We Need WEB?
    Famous proverb goes,
      “Read The Friendly Manual!!”
                                             – Anonymous Hacker
    It is much easier to have manual in hand before jumping into
    source codes, and so does SCIENCE. Here’s an example

     Listing 1: bad_example.py
    d e f I n t e r f e r e n c e ( w1 , w2 ) :
          i m p o r t numpy a s np ;
          x=np . a r a n g e ( 0 , 2 ∗ np . p i , 0 . 1 ) ;
          p s i=np . e x p (−x ) ;
          p s i ∗=(np . s i n ( w1∗ x)+np . s i n ( w2∗ x ) ) ;
          return psi ;

    print ( Interference (1.2 ,3.0))




                                                                   3/
Hsin-Yu Ko   kosinyj@gmail.com               PyCon Taiwan 2012        7
                                                                    3/7
Better Example
    • Commenting, a fairly good solution to simple cases

     Listing 2: good_example.py
   d e f I n t e r f e r e n c e ( w1 , w2 ) :
         """
         This code i s w r i t e n to i n v e s t i g a t e
         t h e i n t e r f e r e n c e o f s i n e waves w i t h
         a n g u l a r f r e q u e n c y w1 and w2 .
         Attanuating with unit length
         """
         i m p o r t numpy a s np ;
         # A look at the region [0 ,2∗ pi ]
         x=np . a r a n g e ( 0 , 2 ∗ np . p i , 0 . 1 ) ;
         # Wave a t t a n u a t i o n
         p s i=np . e x p (−x ) ;
         # Wave s u p e r p o s i t i o n p r i n c e p l e
         p s i ∗=(np . s i n ( w1∗ x)+np . s i n ( w2∗ x ) ) ;
         return psi ;
   # An e x a m p l e on s i n ( 1 . 2 x ) and s i n ( 3 x )
   print ( Interference (1.2 ,3.0))

                                                                   4/
Hsin-Yu Ko   kosinyj@gmail.com             PyCon Taiwan 2012          7
                                                                    4/7
Scientist Want Further Type-Setting
                                 A
What About Using Type Setting of LTEX?

                A
     Listing 3: LTEX_example.py
     documentclass { a r t i c l e }
     usepackage { sagetex }
     b e g i n { document }
    We u s e $ e ^ x $ a s a t t a n u a t i o n o f waves .
     begin { sageblock }
        i m p o r t numpy a s np
        y=np . a r a n g e ( 0 , 2 ∗ p i , 0 . 2 )
        f ( x)= e x p (−x ) ∗ ( s i n ( 1 . 2 ∗ x)+ s i n ( 3 ∗ x ) )
     end { s a g e b l o c k }
    I n t e r f e r e n c e mapping i s  [  s a g e { f } .  ]
    And R e c e i v i n g
     [ f ( y )= s a g e { [ r o u n d ( f ( i ) , 2 ) f o r i i n y ] }  ]
    D i r e c t p l o t i n g t h e r e s u l t 
     sageplot { plot ( f ,(0 ,2∗ pi ))}
     end { document }

    Switch to see result at here

                                                                                5/
Hsin-Yu Ko   kosinyj@gmail.com                   PyCon Taiwan 2012                 7
                                                                                 5/7
What Is/Why Sage??
    • Python-Based/Compatible
    • Integrated Math and Scientific Interface
    • Free and Powerful
       ◦ Numpy and Scipy
       ◦ Maxima
       ◦ R
       ◦ Jmol
       ◦ GAP
       ◦ Singular
       ◦ Axiom
       ◦ GP
    • LTEXCompatible
      A

    • Demos


                                                     6/
Hsin-Yu Ko   kosinyj@gmail.com   PyCon Taiwan 2012      7
                                                      6/7
Acknowledgements
    • PyCon Taiwan
        http://tw.pycon.org/2012/




    • Sage
        http://www.sagemath.org/




    • Platin
    • You

                                                     7/
Hsin-Yu Ko   kosinyj@gmail.com   PyCon Taiwan 2012      7
                                                      7/7

Más contenido relacionado

Destacado

Matrix Structure Navigating & Making It Work
Matrix Structure   Navigating & Making It WorkMatrix Structure   Navigating & Making It Work
Matrix Structure Navigating & Making It Workngaungsan
 
BSC - Introduction, Architecture, Strategy Formulation Guide & Templates
BSC - Introduction, Architecture, Strategy Formulation Guide & TemplatesBSC - Introduction, Architecture, Strategy Formulation Guide & Templates
BSC - Introduction, Architecture, Strategy Formulation Guide & Templatesngaungsan
 
โครงงานกล้วยแขก
โครงงานกล้วยแขก โครงงานกล้วยแขก
โครงงานกล้วยแขก Rut' Np
 
ใบงานที่11
ใบงานที่11ใบงานที่11
ใบงานที่11Rut' Np
 
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆ
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆประโยชน์ใกล้ตัวจากเรื่องกล้วยๆ
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆRut' Np
 
ใบงานที่ 6
ใบงานที่ 6ใบงานที่ 6
ใบงานที่ 6Rut' Np
 
ใบงานที่ 7
ใบงานที่ 7ใบงานที่ 7
ใบงานที่ 7Rut' Np
 
ใบงานที่ 5 การพัฒนาเครื่องมือ
ใบงานที่ 5  การพัฒนาเครื่องมือใบงานที่ 5  การพัฒนาเครื่องมือ
ใบงานที่ 5 การพัฒนาเครื่องมือRut' Np
 

Destacado (9)

Matrix Structure Navigating & Making It Work
Matrix Structure   Navigating & Making It WorkMatrix Structure   Navigating & Making It Work
Matrix Structure Navigating & Making It Work
 
BSC - Introduction, Architecture, Strategy Formulation Guide & Templates
BSC - Introduction, Architecture, Strategy Formulation Guide & TemplatesBSC - Introduction, Architecture, Strategy Formulation Guide & Templates
BSC - Introduction, Architecture, Strategy Formulation Guide & Templates
 
โครงงานกล้วยแขก
โครงงานกล้วยแขก โครงงานกล้วยแขก
โครงงานกล้วยแขก
 
01 e
01 e01 e
01 e
 
ใบงานที่11
ใบงานที่11ใบงานที่11
ใบงานที่11
 
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆ
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆประโยชน์ใกล้ตัวจากเรื่องกล้วยๆ
ประโยชน์ใกล้ตัวจากเรื่องกล้วยๆ
 
ใบงานที่ 6
ใบงานที่ 6ใบงานที่ 6
ใบงานที่ 6
 
ใบงานที่ 7
ใบงานที่ 7ใบงานที่ 7
ใบงานที่ 7
 
ใบงานที่ 5 การพัฒนาเครื่องมือ
ใบงานที่ 5  การพัฒนาเครื่องมือใบงานที่ 5  การพัฒนาเครื่องมือ
ใบงานที่ 5 การพัฒนาเครื่องมือ
 

Similar a Main

Neural Processes Family
Neural Processes FamilyNeural Processes Family
Neural Processes FamilyKota Matsui
 
An optimal and progressive algorithm for skyline queries slide
An optimal and progressive algorithm for skyline queries slideAn optimal and progressive algorithm for skyline queries slide
An optimal and progressive algorithm for skyline queries slideWooSung Choi
 
About testing the hypothesis of equality of two bernoulli
About testing the hypothesis of equality of two bernoulliAbout testing the hypothesis of equality of two bernoulli
About testing the hypothesis of equality of two bernoulliAlexander Decker
 
Graph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesGraph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesTwo Sigma
 
Crash-course in Natural Language Processing
Crash-course in Natural Language ProcessingCrash-course in Natural Language Processing
Crash-course in Natural Language ProcessingVsevolod Dyomkin
 
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. OW2
 
Smoothed Particle Galerkin Method Formulation.pdf
Smoothed Particle Galerkin Method Formulation.pdfSmoothed Particle Galerkin Method Formulation.pdf
Smoothed Particle Galerkin Method Formulation.pdfkeansheng
 
Fixed point and common fixed point theorems in complete metric spaces
Fixed point and common fixed point theorems in complete metric spacesFixed point and common fixed point theorems in complete metric spaces
Fixed point and common fixed point theorems in complete metric spacesAlexander Decker
 
Mining Scientific Diagrams for facts
Mining Scientific Diagrams for facts Mining Scientific Diagrams for facts
Mining Scientific Diagrams for facts TheContentMine
 
Mining Scientific Diagrams for facts
Mining Scientific Diagrams for factsMining Scientific Diagrams for facts
Mining Scientific Diagrams for factspetermurrayrust
 
Lecture14 xing fei-fei
Lecture14 xing fei-feiLecture14 xing fei-fei
Lecture14 xing fei-feiTianlu Wang
 
[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural ProcessesDeep Learning JP
 
Conditional neural processes
Conditional neural processesConditional neural processes
Conditional neural processesKazuki Fujikawa
 
Pso kota baru parahyangan 2017
Pso kota baru parahyangan 2017Pso kota baru parahyangan 2017
Pso kota baru parahyangan 2017Iwan Sofana
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMLinaro
 
A genetic algorithm for a university weekly courses timetabling problem
A genetic algorithm for a university weekly courses timetabling problemA genetic algorithm for a university weekly courses timetabling problem
A genetic algorithm for a university weekly courses timetabling problemMotasem Smadi
 

Similar a Main (20)

Neural Processes Family
Neural Processes FamilyNeural Processes Family
Neural Processes Family
 
An optimal and progressive algorithm for skyline queries slide
An optimal and progressive algorithm for skyline queries slideAn optimal and progressive algorithm for skyline queries slide
An optimal and progressive algorithm for skyline queries slide
 
About testing the hypothesis of equality of two bernoulli
About testing the hypothesis of equality of two bernoulliAbout testing the hypothesis of equality of two bernoulli
About testing the hypothesis of equality of two bernoulli
 
Graph Summarization with Quality Guarantees
Graph Summarization with Quality GuaranteesGraph Summarization with Quality Guarantees
Graph Summarization with Quality Guarantees
 
Infrastructures et recommandations pour les Humanités Numériques - Big Data e...
Infrastructures et recommandations pour les Humanités Numériques - Big Data e...Infrastructures et recommandations pour les Humanités Numériques - Big Data e...
Infrastructures et recommandations pour les Humanités Numériques - Big Data e...
 
D0111720
D0111720D0111720
D0111720
 
Crash-course in Natural Language Processing
Crash-course in Natural Language ProcessingCrash-course in Natural Language Processing
Crash-course in Natural Language Processing
 
Basic data structures part I
Basic data structures part IBasic data structures part I
Basic data structures part I
 
Interactive High-Dimensional Visualization of Social Graphs
Interactive High-Dimensional Visualization of Social GraphsInteractive High-Dimensional Visualization of Social Graphs
Interactive High-Dimensional Visualization of Social Graphs
 
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
 
Smoothed Particle Galerkin Method Formulation.pdf
Smoothed Particle Galerkin Method Formulation.pdfSmoothed Particle Galerkin Method Formulation.pdf
Smoothed Particle Galerkin Method Formulation.pdf
 
Fixed point and common fixed point theorems in complete metric spaces
Fixed point and common fixed point theorems in complete metric spacesFixed point and common fixed point theorems in complete metric spaces
Fixed point and common fixed point theorems in complete metric spaces
 
Mining Scientific Diagrams for facts
Mining Scientific Diagrams for facts Mining Scientific Diagrams for facts
Mining Scientific Diagrams for facts
 
Mining Scientific Diagrams for facts
Mining Scientific Diagrams for factsMining Scientific Diagrams for facts
Mining Scientific Diagrams for facts
 
Lecture14 xing fei-fei
Lecture14 xing fei-feiLecture14 xing fei-fei
Lecture14 xing fei-fei
 
[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes[DL輪読会]Conditional Neural Processes
[DL輪読会]Conditional Neural Processes
 
Conditional neural processes
Conditional neural processesConditional neural processes
Conditional neural processes
 
Pso kota baru parahyangan 2017
Pso kota baru parahyangan 2017Pso kota baru parahyangan 2017
Pso kota baru parahyangan 2017
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
 
A genetic algorithm for a university weekly courses timetabling problem
A genetic algorithm for a university weekly courses timetabling problemA genetic algorithm for a university weekly courses timetabling problem
A genetic algorithm for a university weekly courses timetabling problem
 

Último

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Último (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Main

  • 1. All-In-One Scientific Research With SageTEX Hsin-Yu Ko National Taiwan University June 9, 2012 1/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 1/7
  • 2. Concept of WEB 1 WEB is Not WWW • Coding And Documenting Simultaneously • CWEB, CWEAVE, FortranWEB. . . • Generate foo.o and foo.dvi. . . • Text/TeX + C/Fortran. . . 1 Knuth, Donald E. (1992). Literate Programming. 2/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 2/7
  • 3. Why Do We Need WEB? Famous proverb goes, “Read The Friendly Manual!!” – Anonymous Hacker It is much easier to have manual in hand before jumping into source codes, and so does SCIENCE. Here’s an example Listing 1: bad_example.py d e f I n t e r f e r e n c e ( w1 , w2 ) : i m p o r t numpy a s np ; x=np . a r a n g e ( 0 , 2 ∗ np . p i , 0 . 1 ) ; p s i=np . e x p (−x ) ; p s i ∗=(np . s i n ( w1∗ x)+np . s i n ( w2∗ x ) ) ; return psi ; print ( Interference (1.2 ,3.0)) 3/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 3/7
  • 4. Better Example • Commenting, a fairly good solution to simple cases Listing 2: good_example.py d e f I n t e r f e r e n c e ( w1 , w2 ) : """ This code i s w r i t e n to i n v e s t i g a t e t h e i n t e r f e r e n c e o f s i n e waves w i t h a n g u l a r f r e q u e n c y w1 and w2 . Attanuating with unit length """ i m p o r t numpy a s np ; # A look at the region [0 ,2∗ pi ] x=np . a r a n g e ( 0 , 2 ∗ np . p i , 0 . 1 ) ; # Wave a t t a n u a t i o n p s i=np . e x p (−x ) ; # Wave s u p e r p o s i t i o n p r i n c e p l e p s i ∗=(np . s i n ( w1∗ x)+np . s i n ( w2∗ x ) ) ; return psi ; # An e x a m p l e on s i n ( 1 . 2 x ) and s i n ( 3 x ) print ( Interference (1.2 ,3.0)) 4/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 4/7
  • 5. Scientist Want Further Type-Setting A What About Using Type Setting of LTEX? A Listing 3: LTEX_example.py documentclass { a r t i c l e } usepackage { sagetex } b e g i n { document } We u s e $ e ^ x $ a s a t t a n u a t i o n o f waves . begin { sageblock } i m p o r t numpy a s np y=np . a r a n g e ( 0 , 2 ∗ p i , 0 . 2 ) f ( x)= e x p (−x ) ∗ ( s i n ( 1 . 2 ∗ x)+ s i n ( 3 ∗ x ) ) end { s a g e b l o c k } I n t e r f e r e n c e mapping i s [ s a g e { f } . ] And R e c e i v i n g [ f ( y )= s a g e { [ r o u n d ( f ( i ) , 2 ) f o r i i n y ] } ] D i r e c t p l o t i n g t h e r e s u l t sageplot { plot ( f ,(0 ,2∗ pi ))} end { document } Switch to see result at here 5/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 5/7
  • 6. What Is/Why Sage?? • Python-Based/Compatible • Integrated Math and Scientific Interface • Free and Powerful ◦ Numpy and Scipy ◦ Maxima ◦ R ◦ Jmol ◦ GAP ◦ Singular ◦ Axiom ◦ GP • LTEXCompatible A • Demos 6/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 6/7
  • 7. Acknowledgements • PyCon Taiwan http://tw.pycon.org/2012/ • Sage http://www.sagemath.org/ • Platin • You 7/ Hsin-Yu Ko kosinyj@gmail.com PyCon Taiwan 2012 7 7/7