(Ca...
|
|
- Thomasine Snow
- 5 years ago
- Views:
Transcription
1 1 of 8 9/7/18, 1:59 PM
2 Getting started with 228 computational exercises Many physics problems lend themselves to solution methods that are best implemented (or essentially can only be implemented) with a computer. Solving integrals that don't have exact solutions, analyzing data, and creating virtual experiments (simulations) are just a few examples you'll experience. Here in the physics 228 lab, you'll have the chance to produce and use some computer simulations implemented with python run through a jupyter notebook (more on these below). In other parts of the course you may use Mathematica. These are just 2 of a wide space of possible tools for doing computational physics. You may have the chance to use both again, as well as other tools throughout the physics major. The physics 231 class provides some comparative information about the various tools available for doing computational physics, and much more information about the field. For today, we'll just go for it with python and jupyter. What is Jupyter? Answer: A notebook front-end for running python code. You can write notes as well as do computations all in one place and produce a clean, readable, modifiable, solution to a physics problem. As such, it's becoming popular among physicists. If you're familiar with Mathematica, the notebook environment is pretty similar. If you've coded with python before pretty much everything you know should work here. You can also cut and past the code into any other editor your want and it should work. However, you should use the jupyter notebook for your work here. It will provide uniformity across the class and give you exposure to a new tool that's becoming popular for coding in physics. You can be a great resource for peers that have less experience, but be careful to give them time and space to learn. Don't take over. If you've never met python before it's ok. This exercise will tell you all you need to know to get started. You can also google around and learn more about the history and functionality of python, and if you want more from a CS perspective, it's currently used in the intro CS course (CS111) at Carleton. In a nut shell, python is a general purpose programming language that can be used to implement algorithms on a computer. Getting started with Jupyter Opening the notebook If you're looking at this, you've probably figured out how to access and start jupyter notebook. However, just in case you're looking at a printed copy of this, or you're not sure how this was opened on your computer, here's the info. 1. Work at a computer where Jupyter is installed. It's on physics department macs and can be installed on any operating system following the instructions at ( The "Anaconda" installation available there makes it easiest. Python and jupyter are both free. jupyter notebook 2. Type at a command prompt to start Jupyter. It will then open the interface in a browser. 3. In the Home tab, click on the file you want to open, or click new -> notebooks -> Python. Jupyter notebooks have the file extension ".ipynb". 4. Begin working in the notebook you've opened. Basic instructions for running Jupyter can also be found on the wiki /carl/physics+jupyter+workshop ( Cells Everything you do in a notebook goes in a cell. There are 2 cell types we'll use extensively, "Markdown cells" and "Code cells". 2 of 8 9/7/18, 1:59 PM
3 Python by itself is a fairly basic computer language, but there are extra libraries that extend its capabilities to allow interesting things like plotting equations, data manipulation, and 3D objects. The libraries you will need for these exercises are Numpy, Scipy, and MatPlotLib, which are often known collectively as pylab. Googling can tell you more about these. In our first code cell below, we'll import them into our notebook. You'll usually want to do this since many built in functions that are useful for computational physics live here. When you activate the cell (click on it and shift-enter), it may take a while and give some irrelevant feedback if you have not previously loaded pylab. That's ok. Note also that a comment in python follows a # sign. This code cell just sets up the tools we want, nothing else happens here. from pylab import * %matplotlib inline #this second line is nice in jupyter notebooks since it puts plots you make into the notebook. Basic coding concepts In the cells to follow, you will: 1. meet some basic coding concepts, 2. learn the syntax for implementing them in python, 3. and build some skills in developing algorithms using them. Note that these are 3 separate things to learn! Loops One of the things computers are good at is doing the same procedure over and over in a fast and accurate way. Loops are what tell the computer to do this. There are 2 basic kinds of loops, While loops, which continue until a condition is met and For loops which do things a specified number of times. While loop example: First let's look at a straightforward example, the kind that shows the basic idea but does not really take advantage of the tool. Activate the code (click in the cell and press shift-enter). i=0 while i<3: print(i) i=i+1 print("we're done, woohoo!") If you're a purist mathematician and have not done computer programming before, the last line might be jarring for you since it's not valid math. The meaning here is different. It means, replace i with it's current value plus 1 -- that is, increment i by 1. There is quite a bit to see here. The loop is executed until the condition (i<3) fails. Once it fails, (when i=3), the computer immediately breaks out of the loop (does not do the loop with i=3). Note that the indented text is a part of the loop, while the unindented text is not. Now lets do an example that illustrates when "while" is helpful vs. "for". The Fibonacci numbers go 1,1,2,3,5,8,... That is, the next Fibonacci number is the sum of the previous two. Find the largest Fibonacci number less than 178. (activate the code below to find the answer) 3 of 8 9/7/18, 1:59 PM
4 maxfib=178 #I intruduced a variable for where I want to stop fiba=1 #a storage spot for a fib number fibb=1 #a storage spot for the next fib number while fibb < maxfib: fib = fibb+fiba #get the next fib number fiba=fibb #store the last 2 fib numbers fibb=fib print("the largest Fibonacci number less than") print(maxfib) print("is") print(fiba) Well, you should have gotten a number, but there are a lot of interesting points here. Let's do some exercises to get at some of them: 1. How do you know the number generated is right? You might try the same code on a case where you know the answer. Replace 178 with 8, a case were you know the answer is 5 and make sure it works. You usually always want to do checks like this. 2. Talk though the code with your group. Make sure you all understand what each line does. You might find it helpful to "play computer" and try to do what you think the computer is being told to do. Note the use of while. We loop over the code contained until we break the condition fibb < maxfib then we move on to the print statement. We don't care how many loops we do, we just want to keep going until we meet the condition. 3. If things had not worked at step 1, the mistake would have fallen into one of 2 basic classes: "logic errors" and "syntax errors". If you make a logic error, the code may run, but not give the correct answer. In other words the computer will do what you told it to do, but your instructions were not the right ones to achieve your goal. If you make a syntax error, the code may not run. To try the latter, change the 'w' in while to a 'W' and see what happens when you activate the code. Note also that when while is capitalized it turns black, which means it's not a known word to python. When you write while loops, you want to be sure that the condition will at some point fail. Otherwise, the computer will work for a long time. Finally, note the copious comments that tell others and your future self what various parts of the code do. This is good practice. For loop examples: Lets again start with a straightforward example so you can see what the issues are. (activate the code) for i in range(1,4): print(i) Note that the loop is executed with i starting at the first number in the range, but not for the last number in the range. Hence the code in the loop is executed 3 times in this example. For a more interesting example, find the 50th Fibonacci number. This code contains a logic error and a syntax error. Activate the code, then find and fix the bugs, then get the answer to the question. Compare your fix for the logic error with another group. There are a variety of ways to change the code such that it succeeds in answering the question correctly. 4 of 8 9/7/18, 1:59 PM
5 number=50 fiba=1 fibb=1 For i in range(1,number+1): fib=fibb+fiba fiba=fibb fibb=fib print("element number", number, "of the Fibonocci sequence is", fibb) If statements Another thing a computer is good at is making comparisons. This is the job of an if statement. Here is a silly example. Activate the code. t=1 while t < 10: t=t+1 if t**2 > 10: print(t**2) else: print("too small") Let's do some exercises to explore this one too. 1. Talk through the code and describe what each line does. 2. What does ** do? Do some experiments. Change the '2' to a '3' or a '4'. 3. The else part is optional. Copy the code into a cell below and try it without the else. That is, delete the else and the instruction that follows. Arrays and Plots One can give a whole set of objects a name, and manipulate it as a set. This is called an array in python (actually part of the numpy library). Plotting is also something you'll want to do a lot of as you deal with physics problems. This example illustrates both arrays and plotting. Activate the code. Then we'll take a look at the parts. t = linspace(0, 10*pi, 1000) z = sin(t)*exp(-t/10) plot(t,z,'b-') title("cool! It works!") xlabel("time") ylabel("displacement") show() The first line creates an array of 1000 numbers linearly spaced between 0 and. You can access any of the elements individually as follows. Note that the first element in an array is stored in a slot numbered 0 so the 1000th element is in slot number 999. Activate the cells below to check this. 10π t[0] t[999] 5 of 8 9/7/18, 1:59 PM
6 10π In the following cell, I check that this ending value is really. 10*pi The second line creates another array stored in. That is, the equation is applied individually to each element of the array to make the corresponding element in. z z t The 3rd line makes a plot with the values contained in on the horizontal axis and the values contained in t on the vertical axis. The 'b-' is an option that makes the plot with a blue line. Try changing it to 'g-', then try changing it to 'b.' with 100 points instead of Predict how to make red dots. The rest of the lines except show() are optional commands to format the plot. The last line show() is to make the plot appear. One can also add elements to an array one at a time. Activate the following code and see if you can figure out how it works. z number=10 fib = [1,1] for i in range(3,number+1): fib=append(fib,fib[i-2]+fib[i-3]) print(fib) Why do we need fib i-2 and i-3 instead of i-1 and i-2? Functions A function is a chunk of code that does a particular job and can be called elsewhere in your program. Things you've used like sin(x) are actually built in functions in python or its libraries. You can write your own. If you do, it will be known to the kernal throughout the rest of your jupyter session, or if you develop code outside of jupyter throughout your program. Functions are helpful in many ways. They are handy if the same job needs to be done in a number of different places within the code, they allow larger projects to be spread across people, they can organize the code into subtasks, etc. Functions are key for software developers that work on large projects. For the smaller one-time-use codes that physicists sometimes write, they my be less crucial. As a pointed example of the usefulness of functions, imagine you are programming a maze game, and the language only has a built in "turn right function". The only way to turn left would be to program 3 turn right functions in a row. It won't take long before you wanted to make your own function called "turn left" that consisted of the 3 turn rights. Here is a silly example of how to construct a function. First we'll define the function, which in this case will be a mathematical function, then we'll use (call) in the next cell. This could all be done in one cell, it's up to you. def silly(x): y = sqrt(x**2 + 9) return y 6 of 8 9/7/18, 1:59 PM
7 t = linspace(0, 10, 1000) plot(t,silly(t),'b-') title("cool! It works!") xlabel("time (s)") ylabel("silly (sillies)") show() Talk through what each line in the above cells does. Concluding remarks There is much much more one can learn about python, programming, and computational physics, but this will get you started. Some extras If you're done with the above and your lab's not over, check out the following. Symbolics At the start we said that python is quite expandable via its many libraries. As a final note about this in the current introduction, we'll look at one more really cool library for doing physics called sympy. It will also give us a chance to look at another way to load a library. Sympy does symbolic manipulation with functionality that's becoming competitive with Mathematica. If you're working in a new python session, you can load sympy just like we did with pylab in our first code cell. If you want to use sympy along with pylab, conflicts will arise if you take this approach. This is because pylab contains a function cos() that eats arrays and sympy contains a function cos() that eats generic mathematical variables called symbols. To avoid this, we'll load sympy as in the cell below. When libraries are loaded this way, all of their functions need to be called with a sym. (or any set of letters you put following 'as') in front of them. So pylab's cos() remains cos() and sympy's is now available as sym.cos(). So we have both functions available to us. We can then do cool things like analytical derivatives. Check it out by activating the code below. If you want to know more about sympy, a full tutorial can be found at ( import sympy as sym x, y, z = sym.symbols('x y z') sym.diff(sym.cos(x),x) An exercise challenge If you want more practice exercises like the ones you looked at in this notebook, you should check out the Project Euler challenges at ( You might have fun with them on your own, challenge a friend to a competition as weekend fun, or your instructor may ask you to create an account and solve some of them now. Some sections adapted from ( by E. Ayars. 7 of 8 9/7/18, 1:59 PM
8 8 of 8 9/7/18, 1:59 PM
CircuitPython with Jupyter Notebooks
CircuitPython with Jupyter Notebooks Created by Brent Rubell Last updated on 2018-08-22 04:08:47 PM UTC Guide Contents Guide Contents Overview What's a Jupyter Notebook? The Jupyter Notebook is an open-source
More informationGLY Geostatistics Fall Lecture 2 Introduction to the Basics of MATLAB. Command Window & Environment
GLY 6932 - Geostatistics Fall 2011 Lecture 2 Introduction to the Basics of MATLAB MATLAB is a contraction of Matrix Laboratory, and as you'll soon see, matrices are fundamental to everything in the MATLAB
More informationWeek - 01 Lecture - 04 Downloading and installing Python
Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and
More informationCME 193: Introduction to Scientific Python Lecture 1: Introduction
CME 193: Introduction to Scientific Python Lecture 1: Introduction Nolan Skochdopole stanford.edu/class/cme193 1: Introduction 1-1 Contents Administration Introduction Basics Variables Control statements
More informationMITOCW watch?v=0jljzrnhwoi
MITOCW watch?v=0jljzrnhwoi The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To
More informationME30_Lab1_18JUL18. August 29, ME 30 Lab 1 - Introduction to Anaconda, JupyterLab, and Python
ME30_Lab1_18JUL18 August 29, 2018 1 ME 30 Lab 1 - Introduction to Anaconda, JupyterLab, and Python ME 30 ReDev Team 2018-07-18 Description and Summary: This lab introduces Anaconda, JupyterLab, and Python.
More informationData Acquisition and Processing
Data Acquisition and Processing Adisak Sukul, Ph.D., Lecturer,, adisak@iastate.edu http://web.cs.iastate.edu/~adisak/bigdata/ Topics http://web.cs.iastate.edu/~adisak/bigdata/ Data Acquisition Data Processing
More informationMath Day 2 Programming: How to make computers do math for you
Math Day 2 Programming: How to make computers do math for you Matt Coles February 10, 2015 1 Intro to Python (15min) Python is an example of a programming language. There are many programming languages.
More informationMolecular Statistics Exercise 1. As was shown to you this morning, the interactive python shell can add, subtract, multiply and divide numbers.
Molecular Statistics Exercise 1 Introduction This is the first exercise in the course Molecular Statistics. The exercises in this course are split in two parts. The first part of each exercise is a general
More informationIntroduction to Python Part 2
Introduction to Python Part 2 v0.2 Brian Gregor Research Computing Services Information Services & Technology Tutorial Outline Part 2 Functions Tuples and dictionaries Modules numpy and matplotlib modules
More informationActivity A 1-D Free-Fall with v i = 0
Physics 151 Practical 3 Python Programming Freefall Kinematics Department of Physics 60 St. George St. NOTE: Today's activities must be done in teams of one or two. There are now twice as many computers
More informationMonday. A few notes on homework I want ONE spreadsheet with TWO tabs
CS 1251 Page 1 Monday Sunday, September 14, 2014 2:38 PM A few notes on homework I want ONE spreadsheet with TWO tabs What has passed before We ended last class with you creating a function called givemeseven()
More informationSkill 1: Multiplying Polynomials
CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need
More informationEpisode 1 Using the Interpreter
Episode 1 Using the Interpreter Anaconda We recommend, but do not require, the Anaconda distribution from Continuum Analytics (www.continuum.io). An overview is available at https://docs.continuum.io/anaconda.
More informationLOOPS. Repetition using the while statement
1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while
More informationAn Introduction to Maple This lab is adapted from a lab created by Bob Milnikel.
Some quick tips for getting started with Maple: An Introduction to Maple This lab is adapted from a lab created by Bob Milnikel. [Even before we start, take note of the distinction between Tet mode and
More informationPart 1 Your First Function
California State University, Sacramento College of Engineering and Computer Science and Snarky Professors Computer Science 10517: Super Mega Crazy Accelerated Intro to Programming Logic Spring 2016 Activity
More informationDSC 201: Data Analysis & Visualization
DSC 201: Data Analysis & Visualization Python and Notebooks Dr. David Koop Computer-based visualization systems provide visual representations of datasets designed to help people carry out tasks more effectively.
More informationSemester 2, 2018: Lab 1
Semester 2, 2018: Lab 1 S2 2018 Lab 1 This lab has two parts. Part A is intended to help you familiarise yourself with the computing environment found on the CSIT lab computers which you will be using
More informationEXCEL BASICS: MICROSOFT OFFICE 2007
EXCEL BASICS: MICROSOFT OFFICE 2007 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes
More informationExcel for Gen Chem General Chemistry Laboratory September 15, 2014
Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel is a ubiquitous data analysis software. Mastery of Excel can help you succeed in a first job and in your further studies with expertise
More informationBEGINNER PHP Table of Contents
Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing
More informationIntro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming
Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals
More informationScientific computing platforms at PGI / JCNS
Member of the Helmholtz Association Scientific computing platforms at PGI / JCNS PGI-1 / IAS-1 Scientific Visualization Workshop Josef Heinen Outline Introduction Python distributions The SciPy stack Julia
More informationIntro To Excel Spreadsheet for use in Introductory Sciences
INTRO TO EXCEL SPREADSHEET (World Population) Objectives: Become familiar with the Excel spreadsheet environment. (Parts 1-5) Learn to create and save a worksheet. (Part 1) Perform simple calculations,
More informationLesson 6: Manipulating Equations
Lesson 6: Manipulating Equations Manipulating equations is probably one of the most important skills to master in a high school physics course. Although it is based on familiar (and fairly simple) math
More informationDOING MORE WITH EXCEL: MICROSOFT OFFICE 2013
DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Basic Formulas Filling Data
More informationComputer and Programming: Lab 1
01204111 Computer and Programming: Lab 1 Name ID Section Goals To get familiar with Wing IDE and learn common mistakes with programming in Python To practice using Python interactively through Python Shell
More information1. BASICS OF PYTHON. JHU Physics & Astronomy Python Workshop Lecturer: Mubdi Rahman
1. BASICS OF PYTHON JHU Physics & Astronomy Python Workshop 2017 Lecturer: Mubdi Rahman HOW IS THIS WORKSHOP GOING TO WORK? We will be going over all the basics you need to get started and get productive
More informationOnce you define a new command, you can try it out by entering the command in IDLE:
1 DEFINING NEW COMMANDS In the last chapter, we explored one of the most useful features of the Python programming language: the use of the interpreter in interactive mode to do on-the-fly programming.
More informationLab 1: Setup 12:00 PM, Sep 10, 2017
CS17 Integrated Introduction to Computer Science Hughes Lab 1: Setup 12:00 PM, Sep 10, 2017 Contents 1 Your friendly lab TAs 1 2 Pair programming 1 3 Welcome to lab 2 4 The file system 2 5 Intro to terminal
More information(Python) Chapter 3: Repetition
(Python) Chapter 3: Repetition 3.1 while loop Motivation Using our current set of tools, repeating a simple statement many times is tedious. The only item we can currently repeat easily is printing the
More informationQuadratic Equations Group Acitivity 3 Business Project Week #5
MLC at Boise State 013 Quadratic Equations Group Acitivity 3 Business Project Week #5 In this activity we are going to further explore quadratic equations. We are going to analyze different parts of the
More informationWHAT IS GOOGLE+ AND WHY SHOULD I USE IT?
CHAPTER ONE WHAT IS GOOGLE+ AND WHY SHOULD I USE IT? In this chapter: + Discovering Why Google+ Is So Great + What Is the Difference between Google+ and Other Social Networks? + Does It Cost Money to Use
More informationMITOCW watch?v=flgjisf3l78
MITOCW watch?v=flgjisf3l78 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To
More informationProgramming for Non-Programmers
Programming for Non-Programmers Python Chapter 2 Source: Dilbert Agenda 6:00pm Lesson Begins 6:15pm First Pillow example up and running 6:30pm First class built 6:45pm Food & Challenge Problem 7:15pm Wrap
More informationHow to Set up a Budget Advanced Excel Part B
How to Set up a Budget Advanced Excel Part B A budget is probably the most important spreadsheet you can create. A good budget will keep you focused on your ultimate financial goal and help you avoid spending
More informationCS 1110, LAB 3: MODULES AND TESTING First Name: Last Name: NetID:
CS 1110, LAB 3: MODULES AND TESTING http://www.cs.cornell.edu/courses/cs11102013fa/labs/lab03.pdf First Name: Last Name: NetID: The purpose of this lab is to help you better understand functions, and to
More informationCertified Data Science with Python Professional VS-1442
Certified Data Science with Python Professional VS-1442 Certified Data Science with Python Professional Certified Data Science with Python Professional Certification Code VS-1442 Data science has become
More informationScientific Computing: Lecture 1
Scientific Computing: Lecture 1 Introduction to course, syllabus, software Getting started Enthought Canopy, TextWrangler editor, python environment, ipython, unix shell Data structures in Python Integers,
More informationEXCEL BASICS: MICROSOFT OFFICE 2010
EXCEL BASICS: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes
More information= 3 + (5*4) + (1/2)*(4/2)^2.
Physics 100 Lab 1: Use of a Spreadsheet to Analyze Data by Kenneth Hahn and Michael Goggin In this lab you will learn how to enter data into a spreadsheet and to manipulate the data in meaningful ways.
More informationCS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG
CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG 1 Notice Class Website http://www.cs.umb.edu/~jane/cs114/ Reading Assignment Chapter 1: Introduction to Java Programming
More informationArduino IDE Friday, 26 October 2018
Arduino IDE Friday, 26 October 2018 12:38 PM Looking Under The Hood Of The Arduino IDE FIND THE ARDUINO IDE DOWNLOAD First, jump on the internet with your favorite browser, and navigate to www.arduino.cc.
More informationThe Justin Guide to Matlab for MATH 241 Part 1.
Table of Contents Running Matlab... 1 Okay, I'm running Matlab, now what?... 1 Precalculus... 2 Calculus 1... 5 Calculus 2... 6 Calculus 3... 7 The basic format of this guide is that you will sit down
More informationJava Programming Constructs Java Programming 2 Lesson 1
Java Programming Constructs Java Programming 2 Lesson 1 Course Objectives Welcome to OST's Java 2 course! In this course, you'll learn more in-depth concepts and syntax of the Java Programming language.
More informationPhysics REU Unix Tutorial
Physics REU Unix Tutorial What is unix? Unix is an operating system. In simple terms, its the set of programs that makes a computer work. It can be broken down into three parts. (1) kernel: The component
More informationProfessor Stephen Sekula
Monte Carlo Techniques Professor Stephen Sekula Guest Lecture PHYS 4321/7305 What are Monte Carlo Techniques? Computational algorithms that rely on repeated random sampling in order to obtain numerical
More informationExcel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller
Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing
More informationIntroduction to Python and NumPy I
Introduction to Python and NumPy I This tutorial is continued in part two: Introduction to Python and NumPy II Table of contents Overview Launching Canopy Getting started in Python Getting help Python
More informationGold Hw8 Problem 3: TT Securities, Incorporated
Gold Hw8 Problem 3: TT Securities, Incorporated Copied from: https://www.cs.hmc.edu/twiki/bin/view/cs5/ttsecuritiesgold on 3/29/2017 [25 points; individual or pair] Filename: hw8pr3.py Using your own loops...
More informationEarthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way
Introduction Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way Getting to know you Earthwork has inherited its layout from its ancestors, Sitework 98 and Edge.
More informationExsys RuleBook Selector Tutorial. Copyright 2004 EXSYS Inc. All right reserved. Printed in the United States of America.
Exsys RuleBook Selector Tutorial Copyright 2004 EXSYS Inc. All right reserved. Printed in the United States of America. This documentation, as well as the software described in it, is furnished under license
More informationERTH3021 Exploration and Mining Geophysics
ERTH3021 Exploration and Mining Geophysics Practical 1: Introduction to Scientific Programming using Python Purposes To introduce simple programming skills using the popular Python language. To provide
More informationMITOCW ocw f99-lec12_300k
MITOCW ocw-18.06-f99-lec12_300k This is lecture twelve. OK. We've reached twelve lectures. And this one is more than the others about applications of linear algebra. And I'll confess. When I'm giving you
More informationUnit II Graphing Functions and Data
Unit II Graphing Functions and Data These Materials were developed for use at and neither nor the author, Mark Schneider, assume any responsibility for their suitability or completeness for use elsewhere
More informationMITOCW watch?v=se4p7ivcune
MITOCW watch?v=se4p7ivcune The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To
More informationERTH2020 Introduction to Geophysics
ERTH2020 Practical:: Introduction to Python Page 1 ERTH2020 Introduction to Geophysics 2018 Practical 1: Introduction to scientific programming using Python, and revision of basic mathematics Purposes
More informationLab 5 - Repetition. September 26, 2018
Lab 5 - Repetition September 26, 2018 1 ME 30 Lab 5 - Repetition ME 30 ReDev Team Description and Summary: This lab introduces the programming concept of repetition, also called looping, where some operations
More informationRuby on Rails Welcome. Using the exercise files
Ruby on Rails Welcome Welcome to Ruby on Rails Essential Training. In this course, we're going to learn the popular open source web development framework. We will walk through each part of the framework,
More informationAn introduction to plotting data
An introduction to plotting data Eric D. Black California Institute of Technology February 25, 2014 1 Introduction Plotting data is one of the essential skills every scientist must have. We use it on a
More informationQUICK EXCEL TUTORIAL. The Very Basics
QUICK EXCEL TUTORIAL The Very Basics You Are Here. Titles & Column Headers Merging Cells Text Alignment When we work on spread sheets we often need to have a title and/or header clearly visible. Merge
More informationPHY224 Practical Physics I. Lecture 2
PHY224 Practical Physics I Python Review Lecture 2 Sept. 19 20 20, 2013 Summary Functions and Modules Graphs (plotting with Pylab) Scipy packages References M H. Goldwasser, D. Letscher: Object oriented
More informationWeek 1: Introduction to R, part 1
Week 1: Introduction to R, part 1 Goals Learning how to start with R and RStudio Use the command line Use functions in R Learning the Tools What is R? What is RStudio? Getting started R is a computer program
More informationThis lesson is part 5 of 5 in a series. You can go to Invoice, Part 1: Free Shipping if you'd like to start from the beginning.
Excel Formulas Invoice, Part 5: Data Validation "Oh, hey. Um we noticed an issue with that new VLOOKUP function you added for the shipping options. If we don't type the exact name of the shipping option,
More informationHere are all the comments that your Udacity Code Reviewer had about your code...
Here are all the comments that your Udacity Code Reviewer had about your code... Line 4 in udacity_portfolio_project.py is Critical file_p=raw_input("pleaseenterthenetworklocationoftheportfolio file:")
More informationProfessor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors
First Python Program Professor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An Introduction to Computer Science, 2 nd edition, by
More informationCS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014
CS2112 Fall 2014 Assignment 4 Parsing and Fault Injection Due: March 18, 2014 Overview draft due: March 14, 2014 Compilers and bug-finding systems operate on source code to produce compiled code and lists
More informationtutorial.txt Introduction
-- Introduction Programming is a form of expression in which you describe structure and operations on that structure. Practically, and within the context of this workshop, much of programming in genomics
More informationLab 1 (fall, 2017) Introduction to R and R Studio
Lab 1 (fall, 201) Introduction to R and R Studio Introduction: Today we will use R, as presented in the R Studio environment (or front end), in an introductory setting. We will make some calculations,
More information: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics
Assignment 1: Turtle Graphics Page 1 600.112: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Peter H. Fröhlich phf@cs.jhu.edu Joanne Selinski joanne@cs.jhu.edu Due Date: Wednesdays
More informationIntroduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15
1 LECTURE 1: INTRO Introduction to Scientific Python, CME 193 Jan. 9, 2014 web.stanford.edu/~ermartin/teaching/cme193-winter15 Eileen Martin Some slides are from Sven Schmit s Fall 14 slides 2 Course Details
More informationIn our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.
Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts
More informationThe first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.
Graphing in Excel featuring Excel 2007 1 A spreadsheet can be a powerful tool for analyzing and graphing data, but it works completely differently from the graphing calculator that you re used to. If you
More informationWe ve been playing The Game of Life for several weeks now. You have had lots of practice making budgets, and managing income and expenses and savings.
We ve been playing The Game of Life for several weeks now. You have had lots of practice making budgets, and managing income and expenses and savings. It is sometimes a challenge to manage a lot of data
More informationObjectives. 1 Basic Calculations. 2 Matrix Algebra. Physical Sciences 12a Lab 0 Spring 2016
Physical Sciences 12a Lab 0 Spring 2016 Objectives This lab is a tutorial designed to a very quick overview of some of the numerical skills that you ll need to get started in this class. It is meant to
More informationCmpt 101 Lab 1 - Outline
Cmpt 101 Lab 1 - Outline Instructions: Work through this outline completely once directed to by your Lab Instructor and fill in the Lab 1 Worksheet as indicated. Contents PART 1: GETTING STARTED... 2 PART
More informationAPPM 2460 PLOTTING IN MATLAB
APPM 2460 PLOTTING IN MATLAB. Introduction Matlab is great at crunching numbers, and one of the fundamental ways that we understand the output of this number-crunching is through visualization, or plots.
More informationWelcome to Introduction to Microsoft Excel 2010
Welcome to Introduction to Microsoft Excel 2010 2 Introduction to Excel 2010 What is Microsoft Office Excel 2010? Microsoft Office Excel is a powerful and easy-to-use spreadsheet application. If you are
More informationMITOCW watch?v=w_-sx4vr53m
MITOCW watch?v=w_-sx4vr53m The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To
More informationWednesday. Wednesday, September 17, CS 1251 Page 1
CS 1251 Page 1 Wednesday Wednesday, September 17, 2014 8:20 AM Here's another good JavaScript practice site This site approaches things from yet another point of view it will be awhile before we cover
More informationScience One CS : Getting Started
Science One CS 2018-2019: Getting Started Note: if you are having trouble with any of the steps here, do not panic! Ask on Piazza! We will resolve them this Friday when we meet from 10am-noon. You can
More informationAbout the Tutorial. Audience. Prerequisites. Copyright & Disclaimer
i About the Tutorial Project is a comprehensive software suite for interactive computing, that includes various packages such as Notebook, QtConsole, nbviewer, Lab. This tutorial gives you an exhaustive
More informationIntroduction to Python Practical 1
Introduction to Python Practical 1 Daniel Carrera & Brian Thorsbro October 2017 1 Introduction I believe that the best way to learn programming is hands on, and I tried to design this practical that way.
More informationFoundations, Reasoning About Algorithms, and Design By Contract CMPSC 122
Foundations, Reasoning About Algorithms, and Design By Contract CMPSC 122 I. Logic 101 In logic, a statement or proposition is a sentence that can either be true or false. A predicate is a sentence in
More information6.001 Notes: Section 15.1
6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define
More informationECE-205 Lab 1. Introduction to Simulink and Matlab
ECE-205 Lab 1 Introduction to Simulink and Matlab Throughout this lab we will focus on determining the behavior of a first order system written in the standard form dy( t) y( t) Kx( t) dt where xt () is
More informationIf Statements, For Loops, Functions
Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements
More information1 Lecture 5: Advanced Data Structures
L5 June 14, 2017 1 Lecture 5: Advanced Data Structures CSCI 1360E: Foundations for Informatics and Analytics 1.1 Overview and Objectives We ve covered list, tuples, sets, and dictionaries. These are the
More informationEE 301 Signals & Systems I MATLAB Tutorial with Questions
EE 301 Signals & Systems I MATLAB Tutorial with Questions Under the content of the course EE-301, this semester, some MATLAB questions will be assigned in addition to the usual theoretical questions. This
More informationVBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide
VBA Visual Basic for Applications Learner Guide 1 Table of Contents SECTION 1 WORKING WITH MACROS...5 WORKING WITH MACROS...6 About Excel macros...6 Opening Excel (using Windows 7 or 10)...6 Recognizing
More informationTracking changes in Word 2007 Table of Contents
Tracking changes in Word 2007 Table of Contents TRACK CHANGES: OVERVIEW... 2 UNDERSTANDING THE TRACK CHANGES FEATURE... 2 HOW DID THOSE TRACKED CHANGES AND COMMENTS GET THERE?... 2 WHY MICROSOFT OFFICE
More informationScientific Python. 1 of 10 23/11/ :00
Scientific Python Neelofer Banglawala Kevin Stratford nbanglaw@epcc.ed.ac.uk kevin@epcc.ed.ac.uk Original course authors: Andy Turner Arno Proeme 1 of 10 23/11/2015 00:00 www.archer.ac.uk support@archer.ac.uk
More informationLab # 2. For today s lab:
1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you
More informationINTRODUCTION TO MICROSOFT EXCEL: DATA ENTRY AND FORMULAS
P a g e 1 INTRODUCTION TO MICROSOFT EXCEL: DATA ENTRY AND FORMULAS MARGERT E HEGGAN FREE PUBLIC LIBRARY SECTION ONE: WHAT IS MICROSOFT EXCEL MICROSOFT EXCEL is a SPREADSHEET program used for organizing
More informationGetting Started with AnyBook
Getting Started with AnyBook Where Everything Starts: The Main Invoice Screen When you first start the program, the Main Invoice Screen appears. AnyBook has many different functions, but since invoicing
More informationCS354 gdb Tutorial Written by Chris Feilbach
CS354 gdb Tutorial Written by Chris Feilbach Purpose This tutorial aims to show you the basics of using gdb to debug C programs. gdb is the GNU debugger, and is provided on systems that
More informationroboturtle Documentation
roboturtle Documentation Release 0.1 Nicholas A. Del Grosso November 28, 2016 Contents 1 Micro-Workshop 1: Introduction to Python with Turtle Graphics 3 1.1 Workshop Description..........................................
More informationThe Stack, Free Store, and Global Namespace
Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information
More informationMicrosoft Excel 2007
Learning computers is Show ezy Microsoft Excel 2007 301 Excel screen, toolbars, views, sheets, and uses for Excel 2005-8 Steve Slisar 2005-8 COPYRIGHT: The copyright for this publication is owned by Steve
More information