Strategies for solving scientific problems using computers.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Configuration management
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
Inpainting Assigment – Tips and Hints Outline how to design a good test plan selection of dimensions to test along selection of values for each dimension.
Are You Right-Brained or Left-Brained? Your learning style is influenced by whether you are right-brained or left- brained.
Version Control System (Sub)Version Control (SVN).
CPIT 102 CPIT 102 CHAPTER 1 COLLABORATING on DOCUMENTS.
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Chapter Chapter 4. Think back to any very difficult quantitative problem that you had to solve in some science class How long did it take? How many times.
Tailoring Needs Chapter 3. Contents This presentation covers the following: – Design considerations for tailored data-entry screens – Design considerations.
Chapter 8 and 9 Review: Logical Functions and Control Structures Introduction to MATLAB 7 Engineering 161.
Two main requirements: 1. Implementation Inspection policies (scheduling algorithms) that will extand the current AutoSched software : Taking to account.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Introduction to Computers and Programming Lecture 4: Mathematical Operators New York University.
Week 6 - Programming I So far, we’ve looked at simple programming via “scripts” = programs of sequentially evaluated commands Today, extend features to:
CSCD 555 Research Methods for Computer Science
Outline Java program structure Basic program elements
How NOT to Have a Successful PhD on Middleware Research The Ten Commandments (to carefully avoid) Paolo Costa Vrije Universiteit Amsterdam
Guide To UNIX Using Linux Third Edition
Chapter 1 Program Design
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
Software Development Unit 6.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Adding Automated Functionality to Office Applications.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Section 2: Science as a Process
Matlab tutorial course Lesson 2: Arrays and data types
THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Pseudo Code Possibly one of the hardest skills to get to grips with in learning a programming language is developing the ability to take a problem and.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
CSE 219 Computer Science III Program Design Principles.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
CMPS 1371 Introduction to Computing for Engineers MatLab.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Different approaches an analysis might use when investigating a system including: – Questionnaires – Interviews – Document gathering and analysis.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
How to Satisfy Reviewer B and Other Thoughts on the Publication Process: Reviewers’ Perspectives Don Roy Past Editor, Marketing Management Journal.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
Lesson Overview Lesson Overview What Is Science? Lesson Overview 1.1 What Is Science?
THE ESSAY From the French ‘essai’ - attempt English ‘assay’ – ‘try’ or ‘to weigh’
I Power Higher Computing Software Development Development Languages and Environments.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
A (VERY) SHORT INTRODUCTION TO MATLAB J.A. MARR George Mason University School of Physics, Astronomy and Computational Sciences.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
SCRIPTS AND FUNCTIONS DAVID COOPER SUMMER Extensions MATLAB has two main extension types.m for functions and scripts and.mat for variable save files.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Batch Files Flow of Control to Strengthen Copyright © by Curt Hill.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Microsoft Word 2016 Lesson 6 Part 1.
Spreadsheet Engineering
DATA INPUT AND OUTPUT.
Other Kinds of Arrays Chapter 11
Scripts & Functions Scripts and functions are contained in .m-files
MATLAB DENC 2533 ECADD LAB 9.
Prepared by Kimberly Sayre and Jinbo Bi
Lab 1 Introductions to R Sean Potter.
T. Jumana Abu Shmais – AOU - Riyadh
funCTIONs and Data Import/Export
Introduction To MATLAB
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Strategies for solving scientific problems using computers

Outline Motivation A standard framework Which tool to use? Critical considerations Aftermath

Motivation Most (all?) problems in modern geoscience benefit strongly from computer methods A good hypothesis warrants a clear analytical approach Make large problems more tractable Avoid a posteriori rationalizations as much as possible Encourage predictions rather than diagnoses Our scientific thought process must be defensible, and so should our methodology

Overarching framework for a scientific problem Formulate a hypothesis Collect new data Process this data Interpretation Review existing research Evaluate and present your hypothesis Where will most of your time/energy be spent?

A sub-framework for computer-based problems Format this data Process this data Visualize results Scientific interpretation Load data within chosen work environment

What relevant tools exist? Many options are free or free-ish Overlapping functionality Many are user-extendable

Finding the best tool for the job Are you already familiar with it? Can it already do what you need it to do, or is it conceivable that it could do so after some effort? Is it easy (enough) to learn? Is it intuitive? Is it fast enough? Does it support the command line, a GUI or both? Can you understand what it’s doing, or is it a black box? Does it have sufficient mathematical functionality? Does it have sufficient mapping functionality? Can it easily generate reproducible output? Is it popular within your field? Can its output be shared easily? Is it affordable and accessible?

Which tool to use for geoscience? MATLAB, Python, GMT and ArcGIS are the best current options

Intuitive/explicit processing and data visualization

Every platform is vulnerable but some more so

A sub-framework for computer-based problems Format this data Process this data Visualize results Scientific interpretation Load data within chosen work environment

A directory structure for computer-based problems current_project data (raw) mat (formatted) fig (useful not pretty) research/code/ old (no need to delete) your code

Incidentally, a similar manuscript structure current_paper draft (versioned) revised (basically inevitable) fig (pretty) research/manuscript/ final (proofs, published) master document

Loading data Load all necessary data first This step can be (but is rarely actually) a deal-breaker If someone or something generated it, you can almost certainly read it A question that will keep coming up: How often will you need to do this? The answer is almost always: Much more often than you think A valuable habit: Spend the time to record data loading (i.e., not just ad hoc in the command line) and sourcing Save the MATLAB/etc.-formatted data before processing

How often will you need to do this? Only once, I swear: –command line and save –import data using GUI and save Every time I want to do this analysis: –Write it down and comment Often and with lots of data: –Time to consider how to make it faster So often that other people will have to do it for me: –Consider writing a GUI, which enforces standardization

Format data Data structures to use in descending order of preference: –scalar –vector –matrix –structure/object –cell

Numeric vs. logical vs. string Several different data types to consider –numeric (MATLAB defaults to double precision signed) –string –logical (true/false)

Most (all?) data are imperfect NaN: Not a Number

Poor variable names data index constant var test temp i, j any name identical to or confusingly similar to an existing function name do not abuse case sensitivity names that are not descriptive: you will forget what “A” means

Processing data Document what not how even you think it’s just for you, because you are your own worst enemy Re-use shamelessly, but avoid copy/paste Is this a function or a script? Will you re-use it often? The other kind of MATLAB cell

Visualizing data Physically separate visualization code Visualize as you’re writing, but not as you’re running Again, use cells

MATLAB is trying to help you (similar to Word) Code could be better Code is wrong

Whitespace and indentation Choose a style and stick with it NoBetter

Order of operations Forget it exists and use parentheses instead NeverBetter

Functions warrant error checking

Aftermath In the long term, do not keep failed/commented code in a working function/script Getting complicated and/or popular? Consider a versioning scheme or repository, e.g., Github or RunMyCode