Math 15 Lecture 7 University of California, Merced Scilab A “Very” Short Introduction.

Slides:



Advertisements
Similar presentations
MATLAB MATLAB is a high-level technical computing language and
Advertisements

CSE 123 Symbolic Processing. Declaring Symbolic Variables and Constants To enable symbolic processing, the variables and constants involved must first.
Exponential Functions Logarithmic Functions
MATLAB ME1107 Y Yan Reference: MATLAB for Engineers by Holly Moore (Pearson Prentice Hall)
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
EGR 105 Foundations of Engineering I Session 3 Excel – Basics through Graphing Fall 2008.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
1 MATLAB 基礎. 2 MATLAB  Workspace: environment (address space) where all variables reside  After carrying out a calculation, MATLAB assigns the result.
An Introduction to Scilab Tsing Nam Kiu 丁南僑 Department of Mathematics The University of Hong Kong 2009 January 7.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
Math 15 Introduction to Scientific Data Analysis Lecture 6 Interactive Excel University of California, Merced.
Python  By: Ben Blake, Andrew Dzambo, Paul Flanagan.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN
THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
Math 15 Lecture 12 University of California, Merced Scilab Programming – No. 3.
Math 15 Introduction to Scientific Data Analysis Lecture 5 Association Statistics & Regression Analysis University of California, Merced.
Lecture 2 Math 15 – Introduction to Scientific Data Analysis Introduction to spreadsheet February 4, 2008.
Lecture 2 Math 15 – Introduction to Scientific Data Analysis Introduction to spreadsheet February 4, 2008.
Data, graphics, and programming in R 28.1, 30.1, Daily:10:00-12:45 & 13:45-16:30 EXCEPT WED 4 th 9:00-11:45 & 12:45-15:30 Teacher: Anna Kuparinen.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Math 15 Lecture 10 University of California, Merced Scilab Programming – No. 1.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2010.
Welcome to Math 15 Introduction to Scientific Data Analysis January 25, 2008 University of California, Merced.
Math 15 Introduction to Scientific Data Analysis Lecture 3 Working With Charts and Graphics.
Introduction to Engineering MATLAB – 2 Introduction to MATLAB - 2 Agenda Defining Variables MATLAB Windows.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Scientific Computing Introduction to Matlab Programming.
Matlab 14.html Cost: $100 Available in labs on Windows and Unix machines.
ME6104: CAD. Module 4. ME6104: CAD. Module 4. Systems Realization Laboratory Module 4 Matlab ME 6104 – Fundamentals of Computer-Aided Design.
Math 15 Lecture 9 University of California, Merced Scilab A Short Introduction – No. 3 Today – Quiz #4.
1 Week 1: Variables, assignment, expressions READING: 1.2 – 1.4.
Math 15 Introduction to Scientific Data Analysis Lecture 9 Python Programming – #3 University of California, Merced.
MA/CS 375 Fall 2002 Lecture 3. Example 2 A is a matrix with 3 rows and 2 columns.
Team #6 Date:03/02/2010. TEAM Haritha Rani Jadcherla Vikram Sriram Saloti Annapurna Venkat Narasimha MENTORS Dr. Yue Kwon Mr. Ravi Ganta.
CS 170 – INTRO TO SCIENTIFIC AND ENGINEERING PROGRAMMING.
Introduction to MATLAB 7 MATLAB Programming for Engineer Hassan Migdadi Spring 2013.
MA/CS 375 Fall 2002 Lecture Summary Week 1  Week 7.
Engineering Analysis – Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Interduction to MATLAB Manal Alotaibi Mathematics department College of science King saud university.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2012.
Today we will learn MATLAB Click Start  All programm  Class Software  Matlab This command window will be seen with a prompt sign >> Any command can.
MA/CS 375 Fall 2003 Lecture 3. .* Multiplication We can use the.* operator to perform multiplication entry by entry of two matrices:
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
1 Faculty Name Prof. A. A. Saati. 2 MATLAB Fundamentals 3 1.Reading home works ( Applied Numerical Methods )  CHAPTER 2: MATLAB Fundamentals (p.24)
MATLAB Constants, Variables & Expression Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
전자장 1 실험 - Matlab 사용법 - Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U.
ENGINEERING 2304 Computer Programming for Engineers ENGR Spring 2015 Week 2.
Jake Blanchard University of Wisconsin Spring 2006.
Pinellas County Schools
ECE 1304 Introduction to Electrical and Computer Engineering
Lecture: MATLAB Chapter 1 Introduction
INTRODUCTION TO BASIC MATLAB
MATLAB DENC 2533 ECADD LAB 9.
Communication and Coding Theory Lab(CS491)
Introduction to Matlab
Arrays in Matlab UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
Presentation transcript:

Math 15 Lecture 7 University of California, Merced Scilab A “Very” Short Introduction

Project #1 – Due 3pm on April 4 th, 2008 UC Merced 2 Projects can be performed individually or in groups of three, with following rules: Teams turn in one project report and get the same grade. A team consists of at most 3 people—no copying between teams! Team project report must include a title page, where a team describe each team member’s contribution. 10% bonus for projects done individually Individual projects must not be copied from anyone else No late project will be accepted! No late project will be accepted! Project #1 has been posted at UCMCROP. 2

UC Merced 3 Any Questions?

Course Lecture Schedule WeekDateConceptsProject Due 1 2January 28Introduction to the data analysis 3February 4Excel #1 – General Techniques 4February 11Excel #2 – Plotting Graphs/ChartsQuiz #1 5February 18Holiday 6February 25Excel #3 – Statistical AnalysisQuiz #2 7March 3Excel #4 – Regression Analysis 8March 10Excel #5 – Interactive ProgrammingQuiz #3 9March 17Introduction to Computer Programming - Part - I March 24Spring Recesses 10March 31Introduction to Computer Programming - Part - II(4/4) Project #1 11April 7Programming – #1Quiz #4 12April 14Programming – #2 13April 21Programming – #3Quiz #5 14April 28Programming – #4 15May 5Programming - #5Quiz #6 16May 12Movies / EvaluationsProject #2 FinalMay ???Final Examination

Outline 1. Scilab 2. Getting Started 3. Simple Operations with Scilab 4. Simple Plots with Scilab 5

What is Scilab? Scilab is a numerical, programming and graphics environment available for free from the French Government’s INRIA (National Institute for Informatics and Automation Research). It is similar in operation to MATLAB. It is available for free from the Scilab website

What is Scilab? Scilab is a software for numerical mathematics and scientific visualization. It is capable of interactive calculations as well as automation of computations through programming. It provides all basic operations on matrices through built-in functions so that the trouble of developing and testing code for basic operations are completely Scilab can help you understand all intermediate steps in solving even complicated problems, as easily as using a calculator.

What Scilab can do:

9

UCM Computer Labs

Scilab Environment The user enters Scilab commands at the prompt (-->). Scilab can be used as a simple calculator to perform numerical calculations. It also has the ability to define variables and store values in them so that they can be used later.

Simple Calculator -->2+3 ans = 5. -->2/3 ans = >2^3 ans = 8. Evaluate -->s=0.5 s = >log(s^2-2*s*cos(s*%pi/2)+1) ans = >

Loading a Value Into a Variable --> a = 2 a = 2. -->b = 3. b = 3. -->c = a+b c = 5. --> a = 2 Variable assignment Value 2 is assigned to the variable, a.

Variables in Excel UC Merced - Math Cell names, such as B1, D1 etc., are variables in Excel. = (B1 – D3*B4)/(A1+B2^3) 3 is assigned to Cell B2.

Mathematical Operations Few examples of operations Arithmetic Operations Trigonometric Operations sin(), cos(), tan(), asin(), acos(), atan(), sinh, cosh etc. Exponential and logarithmic operations log(), log10(), exp() etc. +Addition -Subtraction *Multiplication /Division ^Exponentiation 15

Examples sqrt(3^5-2)/exp(2) atan(3)/asin(0.6)

UC Merced 17 Let’s program! But be careful! --> x = 3 --> y = 3x > x = 3 --> y = 3x - 3 Missing Operator error >>> --> x = 3 --> y = 3*x - 3 y = 6.

Special Constants SCILAB has a number of special constants: %i unit imaginary number %pi ratio of circumference to diameter %e the base of the natural logarithms %inf the infinity %nan not-a-number %f boolean constant ’false’ %t boolean constant ’true’ Etc. 18

Examples sqrt(3^5-2)/exp(2*%pi) tan(2*%pi/3)/cos(3/%pi) - (sqrt(5)-1)^

Comments Comments in SCILAB begin with a double forward slash (//) a = 2.5 // redefining a 20

Creating Arrays Array You can think as a variable carries series of data i.e. x = 1, 2, 3, 4, 5 How to define arrays in SCILAB. V = [1, 2, 3, 4,5] V = V = [1:5] // array runs from 1 to 5 by 1. V = V = 1:2:10 or [1:2:10] // array runs from 1 to 10 by 2. V = V = linspace(0,10,5) // array has 5 evenly spaced points between 0 and 10. V=

Array Operation Row array with starting value, increment, ending value x = -10: 0.1: 10; Applying a function to the array y = sin(x*%pi/10); Plotting the function plot(x,y) 22

Working with Arrys X = [1 2 3] Y = [2;1;5] b = 2*x c = 2*y Row array (vector) Column array (vector)

Working with Arrays –cont. z = [2 1 0]; a = x + z b = x + y c = x.* z You will get an error. You cannot add (or subtract) a row vector to a column vector You can multiply (or divide) the elements of two same-size arrays (vectors) term by term with the array operator.* (or./)

Creating Simple Plots Let’s plot with Scilab. First define  as an array theta = linspace(0,2*%pi,100); Create a linearly spaced 100 elements between 0 and 2 . Then, calculate y = sin(theta); Then, plot the graph plot(theta,y)

More on plotting Let’s plot the following functions on the same graph. theta = linspace(0,2*%pi,100); x = sin(theta); y = cos(theta); plot(theta,x,theta,y,'--') 26

Teaching Philosophy UC Merced - Math “I hear and I forget. I see and I remember. I do and I understand.” Confucius 500 B.C. No Pain! No Gain!

Next Lecture By using Scilab, we can effortlessly solve systems of equations, such as