Octave. Getting Started Arithmetic is as usual: – What would (a-V)(V-1)V be for a=0.1 and V=-56? – Multiplication is *, division is /

Slides:



Advertisements
Similar presentations
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Advertisements

Introduction to MATLAB The language of Technical Computing.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Yuval Hart, Weizmann 2010 © 1 Introduction to Matlab & Data Analysis Tutorial 2 and 3: Variables and Matrix Manipulation.
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Eilon Sharon, Weizmann 2008 © 1 Introduction to Matlab & Data Analysis Tutorial 2: Variables and Matrix Manipulation.
Introduction to MATLAB 7 for Engineers
Introduction to MATLAB MECH 300H Spring Starting of MATLAB.
Intro to Matrices Don’t be scared….
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Decimal Division You must learn the rules. Dividing a decimal by a whole number 1.2 ÷ 2 Divisor = 2 Dividend = 1.2 Step 1: move the decimal in the dividend.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
Algebraic Properties Learning Goal: The student will be able to summarize properties and make connections between real number operations.
Matlab tutorial course Lesson 2: Arrays and data types
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
Nonparametric Econometrics1 Intro to Matlab for Data Analysis and Statistical Modeling.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
1 Chapter 1 MATLAB Primer This introductory chapter is relatively short and has as its main objective the introduction of MATLAB ® to the reader. This.
1 Lab of COMP 406 Teaching Assistant: Pei-Yuan Zhou Contact: Lab 1: 12 Sep., 2014 Introduction of Matlab (I)
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
Variables Tutorial 3c variable A variable is any symbol that can be replaced with a number to solve a math problem. An open sentence has at least one.
COMP 116: Introduction to Scientific Programming Lecture 6: Scripts and publishing, Creating matrices.
Matlab Workshop 1/10/07 Lesson 1: Matlab as a graphing calculator.
MATLAB Tutorial EE 327 Signals and Systems 1. What is MATLAB? MATLAB – Matrix Laboratory The premier number-crunching software Extremely useful for signal.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Rational Expressions.
R7 Rational Expressions. Rational Expressions An expression that can be written in the form P/Q, where P and Q are polynomials and Q is not equal to zero.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Inverses. Additive Inverse Inverses are related to the properties of real numbers. The additive inverse is the same number with the opposite sign – it.
Introduction to MATLAB ENGR 1181 MATLAB 1. Opening MATLAB  Students, please open MATLAB now.  CLICK on the shortcut icon → Alternatively, select… start/All.
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
Warm up #2 Ch 1: SIMPLIFY if possible Try These
(The Transpose Operator) 1 >> C=[ ; ; ] C = >> D=C' D =
Multiplication and Division of Exponents Notes
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Lesson 7. Literal Equations  I can identify literal equations.  I can rewrite and use literal equations Objectives.
One step equations Add Subtract Multiply Divide  When we solve an equation, our goal is to isolate our variable by using our inverse operations.  What.
Basics Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
INTRODUCTION TO MATLAB DAVID COOPER SUMMER Course Layout SundayMondayTuesdayWednesdayThursdayFridaySaturday 67 Intro 89 Scripts 1011 Work
The properties of real numbers help us simplify math expressions and help us better understand the concepts of algebra.
ECE 351 M ATLAB I NTRODUCTION ( BY T EACHING A SSISTANTS )
MATLAB Lecture 1 염익준. Introduction MATLAB (MATrix LABoratory) a special purpose computer program optimized to perform engineering and scientific calculations.
CSE 455 : Computer Vision MATLAB 101 Getting Started with MATLAB.
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Objective The student will be able to: solve equations using multiplication and division. Designed by Skip Tyler, Edited by Mr. Nealey.
Manipulating MATLAB Vector, Matrices 1. Variables and Arrays What are variables? You name the variables (as the programmer) and assign them numerical.
Finishing up Chapter 5. Will this code enter the if statement? G=[30,55,10] if G
CS100A, Fall 1998, Lecture 201 CS100A, Fall 1998 Lecture 20, Tuesday Nov 10 More Matlab Concepts: plotting (cont.) 2-D arrays Control structures: while,
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
NoViC, Dept. of Mechanical Eng Acoustics Lab., NoViC 1. Download Matlab 2.
Chapter 1 Review. Examples: Write the numeric expression 1.) Eight more than a number n 2.) The difference of six and a number 3.) The product of three.
 Commutative Property of Addition  When adding two or more numbers or terms together, order is NOT important.  a + b = b + a  =
Multiply to find the number of pictures in all.
Real Numbers Terms: Natural numbers: 1,2,3,4,…
Use of Mathematics using Technology (Maltlab)
Net 222: Communications and networks fundamentals (Practical Part)
Rules for Multiplication and Division
Matlab Basics Tutorial
Multiply and divide Expressions
Exponents with Multiplication and Division
Multiplying and Dividing Decimals
Presentation transcript:

Octave

Getting Started Arithmetic is as usual: – What would (a-V)(V-1)V be for a=0.1 and V=-56? – Multiplication is *, division is /

Variables Variables are as usual and assignment is as usual:

Arrays Arrays are the basic data type – Semi-colons separate rows – Commas separate individual numbers in a row

Addressing array elements

Array exercises Array operations are what they should be – Define any array and the identity, and multiply them – Divide the identity by an array, assigning to a variable (this should be the array inverse) – Multiply the array and its inverse

Array operations But there are also element-wise operations – + is always element-wise –.* is element-wise multiplication

Useful built-in arrays Try these: i=1:1:10 i=1:2:10 ones(10) zeros(1,10) eye(10) eye(5,10)

Adding to vectors

Plotting Uses gnuplot The command “plot(x, y)” lets you plot values of a vector x against values of a vector y

Plotting exercises Plot x against sin(x) for x=pi/16, 2*pi/16, …, 2*pi Plot cos(x) against sin(x) for the same values

Functions function = ( ) … endfunction

Fitzhugh-Nagumo ∂V/∂t = (a-V)(V-1)V – v ∂v/∂t = ϵ(βV-γv-δ)

Before more functions… editing addpath( ) – = “/Users/User/octave” Edit and save functions in a separate window – Pick your favorite text editor (don’t use Word) Octave will search its path for functions you use

Exercises Write functions to compute: ∂V/∂t = (a-V)(V-1)V – v ∂v/∂t = ϵ(βV-γv-δ)

Parameter values a=0.1 b=0.5 g=1 d=0 e=0.01

Numerical integration f(t+Δt) = f(t) + dt*∂f/∂t Given V(0) =0 and v(0) = 0, let’s plot (t, V(t)) and (t,v(t)) –

Loops

A simple version of expression is a vector; var takes on each value in the vector in turn.

Numerical Integration V(t+Δt) = V(t) + Δt(∂V/∂t) = V(t) + Δt((a-V)(V-1)V – v) v(t+Δt) = v(t) + Δt(∂v/∂t) = v(t) + Δt(ϵ(βV-γv-δ)) V = V + dt*(V*(a-V)*(V-1.0)-v) v = v + dt*(eps*(beta*V-gamma*v-delta))

Exercise Write a function to compute vectors of values for V and v, from time 0 to time 200. Plot them against time t. Plot them against each other. Provide a stimulus at some point plot the result