Overview - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Overview

Description:

ceil(1.289766) = 2. floor(5.6799 3.42554i) = 5 3i. fix(5.6799 3.42554i) = 5 3i ... ceil(-5.8766); -5 floor(-1.234 7.098*I); - 2 7 I round(2.3654); 2 ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 30
Provided by: mknIt
Category:
Tags: ceil | overview

less

Transcript and Presenter's Notes

Title: Overview


1
Numerical and Symbolic Calculation
  • Overview
  • Octave
  • MuPAD

2
Overview Symbolic and Numerical Computation
description and functions
  • A tool for numerical calculations
  • A kind of complete and advance calculator
  • ?Simple Arithmetical calculations (, x, -, /)
  • ?Mathematical operations (roots, exponentiation
    etc.)
  • ?Geometrical operations (cos, sin, arctan, sinh
    etc)
  • ?Matrix operations (transpose, inversion etc.)
  • ?Data analysis (max, min etc.)
  • ?Polynomial analysis
  • ?Integration/differentiations
  • ?Programmable (loops etc.)
  • ?Graphic options (data plotting etc.)

3
For practice, make a telnet connection from the
run window from the start menu For this, type
telenet 160.75.90.10 For user name and
password, use one of the following couple user
name bilisim1 bilisim2bilisim50 password bilg
i1 bilgi2bilgi50 In order to activate the
related program, type the program name mupad,
octave or gnuplot, etc. Then, you can enter your
request to the line interpreter (for graphical
applications, need to use Exceed or similar
programs).
4
Octave
5
MuPAD
6
Octave History
  • originally written (in about 1988) by
  • James B. Rawlings (University of
    Wisconsin-Madison) and
  • John G. Ekerdt (the University of Texas) for
    educational
  • purposes for undergraduate students on chemical
    reactor.
  • Later, improved by building more flexible tools
    to the original
  • software structure.

7
Octave
  • GNU Octave
  • freely redistributable software
  • a high-level language,
  • provides a convenient command line interface
  • mostly compatible with Matlab
  • has also a batch-oriented language
  • has own language, however, possible to use
    dynamically loaded modules written in C, C,
    Fortran, or other languages.

8
Octave
  • Primarily
  • intended for numerical computations.
  • linear and nonlinear problems
  • common numerical linear algebra problems
  • finding the roots of nonlinear equations
  • integrating ordinary functions
  • manipulating polynomials
  • integrating ordinary differential and
    differential-algebraic equations
  • easily extensible and customizable via
    user-defined functions

9
Octave Examples, Simple Arithmetical Operations
Input
Output
x12 x23 x3x1x2 printf("2 3 d\n", x3)
printf("2 3 d\n", 23) quit
x2 3 x3 5 2 3 5 2 3 5
printf function was barrowed from C
languagesSyntax It is used for printing out of
the result on the screen. d integer, c
character, f floating numbers, s string \n
next line
10
Octave Examples, Simple Arithmetical Operations
Input
Output
x135 x23.5 printf("3 5 d\n", x1)
printf("3 . 5 d\n", x2) x123/7 x223./7
printf("23 / 7 d\n", x1) printf("23 ./ 7
d\n", x2) quit
x1 8 x2 8 3 5 8 3 . 5 8 x1
3.2857 x2 3.2857 23 / 7 3 23 ./ 7 3
, - , , or / used in the matrix operations .
, .- , . , and ./ used in the scalar calculations
11
Octave Examples, Simple Arithmetical Operations
Output
Input
x23 printf("23 d\n", x) x2.3
printf("2.3 d\n", x) x23 printf("23
d\n", x) x2.3 printf("2.3 d\n",
x) x23.7 printf("23.7 20.15f\n", x) quit
x 8 23 8 x 8 2.3 8 x 8 23 8
x 8 2.3 8 x 12.996 23.7
12.996038341699769
12
Octave Examples Data Analysis
Input
xceil(1.289766) printf("ceil(1.289766)
d\n", x) zfloor(5.67993.42554i)
printf("floor(5.67993.42554i) d
di\n",real(z),imag(z)) zfix(5.67993.42554i)
printf("fix(5.67993.42554i) d
di\n",real(z),imag(z)) quit
ceil(1.289766) 2 floor(5.67993.42554i) 5
3i fix(5.67993.42554i) 5 3i
Output
Semicolon, , used not to display the operation
on the screen
13
Octave Examples Data Analysis
Output
Input
xgcd(12,18,48,210) printf("gcd(12,18,48,210)
d\n", x) xlcm(12,18,48,210)
printf("lcm(12,18,48,210) d\n", x) quit
gcd(12,18,48,210) 6 lcm(12,18,48,210) 5040
gcd greatest common divisor lcd least common
multiple
14
Octave Examples Logarithmic Functions
Output
Input
xexp(-100.000) printf("exp(-100.000)
20.16f\n", x) xlog2(10) printf("log2(10)
20.16f\n", x) xlog(e) printf("log(e)
20.16f\n", x) xlog10(e) printf("log10(e)
20.16f\n", x) quit
exp(-100.000) 0.0000000000000000 log2(10)
3.3219280948873626 log(e) 1.0000000000000000
log10(e) 0.4342944819032518
15
Octave Examples Geometrical Operations
Input
Output
xsin(pi/2) printf("sin(pi/2) 20.16f\n",
x) xtan(pi/4) printf("tan(pi/4) 20.16f\n",
x) xcsc(pi/4) printf("csc(pi/4)
20.16f\n", x) xasin(0.500000)
printf("asin(0.500000) 20.16f\n", x)
zasec(-3.000000) printf("asec(-3.000000)
20.16f 20.16fi\n", real(z), imag(z)) quit
sin(pi/2) 1.0000000000000000 tan(pi/4)
0.9999999999999999 csc(pi/4)
1.4142135623730951 asin(0.500000)
0.5235987755982989 acot(-3.000000)
2.8198420991931510 0.0000000000000000i
16
Octave Examples, Matrix Operations
Input
Output
The matrix A 1 2 3 4 5 6 The matrix B 1
4 5 8 9 10 The matrix C A B 2 6
8 12 14 16 The matrix D A - B 0 -2 -2
-4 -4 -4
A1,2,34,5,6 B1,4,58,9,10 CAB
DA-B disp("The matrix A \n") disp(A)
disp("") disp("The matrix B \n") disp(B)
disp("") disp("The matrix C A B \n")
disp(C) disp("") disp("The matrix D A - B
\n") disp(D) disp("") quit
17
Octave Examples, Loops
Input
Output
m1 n100 sum1sum2sum30 for i mn sum1
sum1 i sum2 sum2 i.2 sum3 sum3
i.3 endfor printf("The sum of the integers
from d to d d\n",m,n,sum1) printf("The
square sum of the integers from d to d
d\n",m,n,sum2) printf("The cube sum of the
integers from d to d d\n",m,n,sum3) quit
The sum of the integers from 1 to 100 5050 The
square sum of the integers from 1 to 100 338350
The cube sum of the integers from 1 to 100
25502500
18
  • Use help command for the syntax and parameters of
  • the command you are interested in.
  • Visit http//www.octave.org/ for more
    information
  • For practice, use the interface at
    http//www2.be.itu.edu.tr/Octave/ internet site
    of the Informatics institute prepared for
    Bil101E.

19
MuPAD Description
  • developed in Germany
  • its free versions available for academic and
    educational use.
  • similar programming language to Pascal,
  • an alternative to Mathematica
  • quite parallel to Maple
  • available for various platforms Unix, Linux,
    Windows.
  • an interactive user interfaces
  • provides user-friendly and powerful mathematical
    programming environment

20
MuPAD History
1998 - MuPAD 1.4 released 1996 - MuPAD 1.3
released - MuPAD is completely redesigned for
Windows 95/NT. 1995 - MuPAD goes Windows 3.1
(a very first prototype) - MuPAD 1.2 2
released 1994 - MuPAD 1.2 is published (and
became object-oriented ...) - MacMuPAD is
born - The concept of Dynamic Modules is
developed - Cooperation agreement with the
Ukrainian Academy of Science - MuPAD is awarded
the European Academic Software Award 1993 -
MuPAD is available for Linux. 1992 - MuPAD
release 1.0 1989  -The development starts ...
21
MuPAD Structure
22
MuPAD Structure
MuPAD kernel the arithmetic, handling numbers
of arbitrary lengths.   the parser, reading
and checking the user's input. the evaluator,
evaluating and simplifying input data.   the
memory management MAMMUT (Memory Allocation
Management Unit), handling all data of the
system MAMMUT uses a (weak) unique data
representation and serves as an interface
between the hardware and the MuPAD kernel. Apart
from the graphical user interface MAMMUT is the
only platform dependent part of the MuPAD
system.   built-in functions, These are user
accessible functions which are implemented in
the kernel for speed and efficiency, e.g., often
needed functions for manipulating arithmetical
expressions or polynomials.
23
MuPAD Structure
Dynamic Modules allow to extend the MuPAD kernel
or integrate software packages within
MuPAD Vcam, graphics tool to display two- or
three-dimensional plot (a "scene") with the
MuPAD MuPAD help tool, includes the list of
available functions, the index or content of the
on-line manuals and MuPAD documentation
Source-Code Debugger for debugging user-defined
procedures.
24
MuPAD Examples, Simple Arithmetical Operations
Output
Input
gtgt 912 912 Addition
21 gtgt 4-17 4-17 //
Subtraction
-13 gtgt 783 783
234 gtgt 19/3 19/3 19/3 gtgt quit
912 912 Addition 4-17 4-17 //
Subtraction 783 783 19/3 19/3 quit
/ ./, and // commands barrowed from C
syntax to make explanations in the command line,
does not display the result on the screen
but
25
MuPAD Examples,
Output
Input
abs(-32.456) abs(2PII) 14 div 7
binomial(2.7, 14I) fact(20) quit
gtgt abs(-32.456)
32.456 gtgt abs(2PII)
2 PI 14 div 7
2 gtgt
binomial(2.7, 14I)
693.8742165 708.3599627 I gtgt
fact(20)
2432902008176640000
abs absolute value, div integer division giving
the integer part of the result, binomial(m,n)
m!/(n!(m-n)!) mgtn, fact factorial
26
MuPAD Examples, Data Analysis
Output
Input
gtgt ceil(-5.8766) -5
gtgt floor(-1.2347.098I)
- 2 7 I
gtgt round(2.3654) 2 gtgt
trunc(-5.8766) -5
gtgt frac(-1.2347.098I)

0.766 0.098 I gtgt quit
ceil(-5.8766) floor(-1.2347.098I)
round(2.3654) trunc(-5.8766)
frac(-1.2347.098I) quit
27
MuPAD Examples, Data Analysis
Output
Input
denom(13/14) numer(13/14) normal(13/14)
gcd(18,24,6) igcd(18,24,6) lcm(18,24,6)
ilcm(18,24,6) quit
gtgt denom(13/14)
14 gtgt numer(13/14)
13 gtgt normal(13/14)
13/14 gtgt gcd(18,24,6)
6 gtgt igcd(18,24,6)
6 gtgt lcm(18,24,6)
72 gtgt ilcm(18,24,6)
72 gtgt quit
28
MuPAD Examples,
Output
Input
gtgt p11 1 gtgt p2xp1-6 x - 6 gtgt
p3xp211 x (x - 6) 11 gtgt p4xp3-6
x (x (x - 6) 11) - 6 gtgt expand(p4) 2
3 11 x - 6 x x - 6 gtgt factor(p4) 1, x -
3, 1, x - 1, 1, x - 2, 1 gtgt Factor(p4) (x
- 1) (x - 2) (x - 3) gtgtquit
p11 p2xp1-6 p3xp211 p4xp3-6
expand(p4) factor(p4) Factor(p4) quit
29
  • Use help command for the syntax and parameters of
  • the command you are interested in.
  • Visit http//www.mupad.de/
  • http//www.mupad.com/ for more information
  • For practice, use the interface at
    http//www2.be.itu.edu.tr/Mupad/  internet site
    of the Informatics institute prepared for
    Bil101.
Write a Comment
User Comments (0)
About PowerShow.com