Sunteți pe pagina 1din 30

UNIVERSITY OF JORDAN Electrical Engineering Dept.

Instructor: Ziad R. Al-Khatib

The Language of Technical Computing

There are 10 types of


people in the world.
Z.R.K

Those who understand binary and those who dont.


1

Are we unique ?! ....! WHAT IS A COMPUTER


A COMPUTER is a device capable of performing computations and making logical decisions at speeds millions (even billions) of times faster than human beings can. For examples: ... Can be divided into two main parts: Hardware. Software and can be add a Firmware. Z.R.K

Computer, Simplified Block Diagram

Z.R.K

Z.R.K

Z.R.K

Z.R.K

COMPUTER HARDWARE
Motherboard (mainboard)
Central Processing unit CPU & ALU. Controller chip set. BIOS (Basic Input and Output System) (Firmware). Memory: - RAM. ROM. Cache. Interfacing Buses: -ISA. - EISA. - PCI. - AGP. - USB. - LPT. - SP. - PS2. - SCSI. - IDE. Math Co-processor.

Case & Cooling Fans Power Supply:- +3.3V. - 5.0 V. - 12.0 V. Hard Disk Drive & CD-ROM / DVD. Floppy Drive & Zip Drives. Keyboard & Mouse & Tablet, Monitor (Display). Z.R.K

Operating Systems.

COMPUTER SOFTWARE
Disk Operating System DOS. Windows: 1, 2, , win98, NT, WinMe, XP, Win Vista, UNIX, LINUX, OS2. Macintosh (Apple Computers).

Computer Languages.
Machine languages: any computer can directly
understand only its own machine language. Is generally reduced to 1s & 0s (High & Low). Assembly Languages: Its a low level languages but simple compared to machine language. High level Languages: - BASIC. FORTRAN. -COBOL. LOGO. PASCAL. C, C++, C#, - JAVA.

Computer Applications.
Word-processing. Spread sheets. Computer Aided Design CAD. Graphics. Games. Multi media. Eng. Packages, , MATLAB. MultiSIM. LabView...
Z.R.K 8

MATLAB is a high-performance language for technical

What Is MATLAB?

computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. MATLAB stands for MATrix LABoratory.
Typical uses include:

Math and computation. Algorithm development. Data acquisition. Modeling, simulation, and prototyping. Data analysis, exploration, and visualization. Scientific and engineering graphics. Application development, including graphical user Z.R.K interface building.

The MATLAB System Consists:


DesktopTools and Development Environment:
This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces (GUI). It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, a code analyzer and other reports, and browsers for viewing help, the workspace, files, and the search path.

The MATLAB Mathematical Function Library :


This is a vast collection of computational algorithms ranging from elementary functions, like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms. The MATLAB Language: This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create large and Z.R.K 10 complex application programs.

The MATLAB System Consists:


Graphics (visualization): MATLAB has extensive
facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for two-dimensional and threedimensional data visualization, image processing, animation, and presentation graphics. It also includes lowlevel functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications.

The MATLAB External Interfaces/Application Program Interface (API): This is a library that allows
you to write C and Fortran programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MATfiles.
Z.R.K 11

ABOUT SIMULINK
Simulink, a companion program to MATLAB, is
an interactive system for simulating nonlinear dynamic systems. It is a graphical mouse-driven program that allows you to model a system by drawing a block diagram on the screen and manipulating it dynamically. It can work with linear, nonlinear, continuous-time, discrete-time, multivariable, and multirate systems. Blocksets are add-ins to Simulink that provide additional libraries of blocks for specialized applications like communications, signal processing, and power systems. Real-time Workshop is a program that allows you to generate C code from your block diagrams and to run it on a variety of real-time systems.
Z.R.K

12

Strengths of MATLAB
MATLAB is relatively easy to learn. Easy to do very rapid prototyping. MATLAB code is optimized to be relatively quick when performing matrix operations. MATLAB may behave like a calculator or as a programming language. MATLAB is interpreted, errors are easier to fix. Excellent display capabilities. Widely used for teaching and research in universities and industry. Although primarily procedural, MATLAB does have some object-oriented elements.
Z.R.K 13

Weaknesses of MATLAB
MATLAB is NOT a general purpose programming language MATLAB is an interpreted language (making it for the most part slower than a compiled language such as C++) MATLAB is designed for scientific computation and is not suitable for some things (such as parsing text) Not designed for large-scale system development. Slow for some kinds of processes.
Z.R.K 14

Z.R.K

15

Matrices and Magic Squares:


16 5 9 4 3 10 6 15 2 11 7 14 13 8 12 1

The German Albrecht Durer is credited with showing the first magic square in print. This magic square appeared in an engraving and was a 4X4 square with all rows, columns and diagonals summing to 34. In the bottom row the
year that the engraving was made was worked into these numbers. Can you guess the year of the engraving? Z.R.K 16

Magic Squares
M = magic(n) returns an n-by-n matrix constructed from the integers 1 through n^2 with equal row, column and diagonal sums. The order n must be a scalar greater than or equal to 3. >>M = magic(3) Can you see additional properties in addition to the usual magic square properties? M = Hint: In 4x4 magic square add the corners, or 8 1 6 the center squares, or the slanting squares (2, 3 5 7 8, 9, 15, for example). 4 9 2 This is called a magic square because the sum of the elements in each row, column and diagonal was the same, and equal to 15. The value of the characteristic sum for a magic square of order n is: sum(1:n^2)/n.
Z.R.K 17

History of Magic Squares


Further reading

Three cultures are known to have created magic squares, the Chinese, the Indian, and the Arabic. The first magic squares of 5 and 6 appear in an encyclopedia in Baghdad about 983 AD by Ikhw'n al-Saf', though several earlier Arab Muslim mathematicians also wrote about magic squares. How it came to pass that the Arabs acquired knowledge of magic squares is unknown. It is not known if they invented them separately or if they were introduced to them by another culture.
Z.R.K 18

History of Magic Squares

(continue )

Al-Buni was an Arab Muslim mathematician that worked on magic squares and also believed in the mystical properties of magic squares, though no details on this number mysticism are available. Al-Buni did his work on the squares about 1200 AD. Sources have also referred to the Arabs using magic squares in making astrological calculations and predictions, again no details are given. The association of the squares with astrology and the heavens appears to be original with the Arabs.
Z.R.K

(continue )

19

History of Magic Squares

(continue )

Kieth Critchlow has a chapter on Magic Squares in Islam in his book Islamic Patterns. The following link has a picture of a page from one of Al-Buni's books with the caption given below:
http://www.vh.org/Welcome/UIHC/MedMuseum/ArtThatHeals/10Knowledge.html

21 Diagrams from the Book of Buni, the Geez translation of a version of the "Sun of Knowledge" (Shams al-Marif), a book attributed to Al-Buni, an Egyptian author of the thirteenth century. Each diagram containing figures or letters is accompanied by its method of use. Book of Buni, eighteenth century to nineteenth century, parchment, 27.5 x 24 cm.
Z.R.K

(continue )

20

History of Magic Squares

(continue )

According to the Theory of Balance attributed to 8th century Muslim alchemist Jabir ibn Hayyan (based on 3rd century works by Zosimos and others), the Cosmos and everything in it is made from the numbers 1, 3, 5, 8, 17 and 28; they are the foundation of all matter, of every science, and even of any possible language. The first four numbers were assigned by the Jabirian alchemists to the elements, 1=fire, 3=earth, 5=water, 8=air. The sum of these is 17, which is the fifth number. The Gnomon, which gives the larger square, sums to 4+9+2+7+6 = 28, the sixth number, the second Perfect Number.
Z.R.K

(continue )

21

History of Magic Squares

(continue )

An alpha-magic square, invented by Lee Sallows, is a magic square so that not do when the numbers spelled out in words form a magic square, but the numbers of letters of the words also form a magic square. For example,

gives rise to two magic squares: The first magic square comes from the numbers represented by the words in the alphamagic square, and the second magic square comes from the numbers of letters in the words of the alphamagic square.
Z.R.K 22

Pascal's Triangle Further reading


Pascal's triangle was first introduced by the Chinese mathematician Yang Hui, but it got it's name from Blaise Pascal who 500 years later rediscovered it along with Omar Al-Khayyam. The triangle is used to look for the probability of any particular event to occur. There are many other things that can be found in the triangle. Listed below are a few of them and how to achieve them. How to make Pascal's Triangle? Row 0 is the first row, it will have a 1. Row 1 is actually the second row it will have 1 and 1, but not to be confused with 11. The next row is the numbers 1 and 2 and 1. Now how did we get these numbers? 1 is always going to be the first number in the row, but in order to make the triangle grow you add the two numbers above. Example: 1 + 2 = 3 and 2 + 1 = 3, so for the next line we will have 1 (always on the outside) and 3 and 3 and then 1 again. The next line gets even bigger, 1 (outside again) 1 + 3 = 4, and 3 + 3 = 6, and 3 + 1 = 4, and then that 1 again.
Z.R.K 23

Pascal's Triangle (continue )


1 1 1 1 1 1 1 6 5 15 4 10 20 3 6 10 15 2 3 4 5 6 1 1 1 1 1 1

>>pascal(6) POWER OF 11: The first 5 powers of 11 are in the top of the triangle.
110 = 1, 111 = 11, 112 = 121, 113 = 1331, and 114 = 14641. When these numbers are stacked in a pyramid it will form the top part of the triangle. ADDITION ANSWERS: If you start at any given 1 and go diagonally down and then make a one step left you will find the answer to the numbers that you just followed. For example: 1 + 2 + 3 + 4 + 5 = 15, or try any other number 1 + 8 + 36 + 120 + 330 = 495.
Z.R.K

(continue ) 24

Pascal's Triangle (continue )


SQUARED: Take any number next to one and make a triangle with the
number directly beside it and the one below the two, when this number is squared you will have the answer of the two additional numbers when they are added together. For example: 52 = 25, looking to the right of 5 is 10, now look at the number below the 5 and 10, should be 15, now 10 + 15 = 25. ADD THE ROWS: Any row starting with a 1 can be added straight across to find the sum of 2 to the power of that rows number. Example: 20 = 1, 21 = the addition of the next row (1 + 1) = 2, 22 = (1 + 2 + 1) = 4, 23 = (1 + 3 + 3 + 1) = 8, what about the 10th row? 1 + 9 + 36 + 84 + 126 + 126 + 84 + 36 + 9 + 1 = 512, which is 29. WOW!! FIBONACCI NUMBERS: The sum of the numbers in a diagonal line downward are the first numbers of the Fibonnacci Sequence. Example: 1 is alone so = 1, then the next would also be 1 = to 1, then 1 + 1 = 2, 2 + 1 = 3, 1 + 3 + 1 = 5, 3 + 4 + 1 = 8, 1 + 6 + 5 + 1 = 13, this can be done all the way down the triangle (as the triangle gets bigger it gets a little confusing, so make sure you color out the numbers you have already used). Now take the = numbers like this: 1 + 1= the next number 2. 1 + 2 = the next number 3, 2+3 = the next number 5, 3 + 5 = the next number 8, so forth and so on. By the way Fibonacci's sequence were used to describe a curve found in many string instruments.
Z.R.K 25

MATLAB Installation
Available on 2 CD-ROMs or one DVD. Typical Installation includes:
- Product: MATLAB, Toolboxes, Simulink, Blocksets. - Documentation ( Help).

System requirements (For version 7):


- Operating system: 2000, XP, Windows Vista. - Processors: Pentium III , IV. - Disk Space: 345 MB with Help. - RAM: 256 MB (minimum) , 512 MB (recommended).

Now MATLAB R2006b, Ver. 7.3. Is Av.


Z.R.K 26

Examples Computational Fluid Dynamics

Z.R.K

27

On a Boeing 707 Aircraft using pMatlab (Parallel Matlab Toolbox)


Goals
Matlab speedup through transparent parallelism Near-real-time rapid prototyping High Performance Matlab Applications
DoD Sensor Processing DoD Decision Support Scientific Simulation Commercial Applications

Matlab*P PVL

User Interface

Parallel Matlab Toolbox


MatlabMPI Hardware Interface

Lab-Wide Usage
Ballistic Missile Defense Laser Propagation Simulation Hyperspectral Imaging Passive Sonar Airborne Ground Moving Target Indicator Z.R.K Airborne Synthetic Aperture Radar (SAR)

Parallel Computing Hardware


28

On a Boeing 707 Aircraft using pMatlab


28 CPU Bladed Cluster Running pMatlab
RAID Disk Recorder

Analyst Workstation Running Matlab

Data Files

SAR GMTI (new)

Streaming Sensor Data

Z.R.K

29

Z.R.J.K

Z.R.K

30

S-ar putea să vă placă și