Document

Transcripción

Document
ITCH-DEPI
30/10/2014
1
ITCH-DEPI
30/10/2014
2
ITCH-DEPI
30/10/2014
3
ITCH-DEPI
30/10/2014
1. Introducción
2. Operaciones Aritméticas
3. Variables
4. Funciones Matemáticas
5. Números Complejos
6. Vectores
7. Matrices
8. Programación
9. Gráficas
10.Resolución de Ecuaciones
11.Cálculo
4
INTRODUCCIÓN
ITCH-DEPI
30/10/2014
DESCRIPCIÓN
Lenguaje de alto nivel y ambiente interactivo para
computación numérica, visualización y
programación.
 Se puede analizar datos, desarrollar algoritmos y
crear modelos y aplicaciones.
 Aplicaciones de procesamiento de señales y
comunicaciones, procesamiento de imágenes y
video, sistemas de control, pruebas y mediciones,
computación financiera, biología computacional.

6
ITCH-DEPI
30/10/2014
http://www.mathworks.com/help/index.html
7
ITCH-DEPI
30/10/2014
Interfaz de Escritorio
8
ITCH-DEPI
30/10/2014
9
ITCH-DEPI
30/10/2014
https://play.google.com/store
MATLAB Mobile
MATLAB Tutorial
MATLAB Quick Reference
MATLAB Graphing
Calculator
10
ITCH-DEPI
30/10/2014
Graphing Calculator by Mathlab
https://play.google.com/store/apps/d
etails?id=us.mathlab.android&hl=en
11
ITCH-DEPI
30/10/2014
Comandos de Entrada
ans
clc
diary
format
home
iskeyword
more
diary
diary('filename')
diary off
diary on
diary filename
Most recent answer
Clear Command Window
Save Command Window text to file
Set Command Window output display format
Send cursor home
Determine whether input is MATLAB keyword
Control paged output for Command Window
format style
format
more on
more off
more(n)
A = more(state)
12
Formato
Style
short (default)
long
shortE
longE
shortG
longG
shortEng
longEng
+
bank
hex
rat
ITCH-DEPI
Result
Short, fixed-decimal format with 4 digits after the
decimal point.
Long, fixed-decimal format with 15 digits after the
decimal point for double values, and 7 digits after
the decimal point for single values.
Short scientific notation with 4 digits after the
decimal point.
Long scientific notation with 15 digits after the
decimal point for double values, and 7 digits after
the decimal point for single values.
short or shortE, whichever is more compact.
long or longE, whichever is more compact.
Short engineering notation (exponent is a multiple
of 3) with 4 digits after the decimal point.
Long engineering notation (exponent is a multiple of
3) with 15 significant digits.
Positive/Negative format with +, -, and blank
characters displayed for positive, negative, and zero
elements.
Currency format with 2 digits after the decimal
point.
Hexadecimal representation of a binary doubleprecision number.
Ratio of small integers.
30/10/2014
Example
3.1416
3.141592653589793
3.1416e+00
3.141592653589793e+00
3.1416
3.14159265358979
3.1416e+000
3.14159265358979e+000
+
3.14
400921fb54442d18
355/113
13
ITCH-DEPI
30/10/2014
Style
Result
Example
compact
Suppress excess blank lines to
show more output on a single
screen.
theta = pi/2
theta =
1.5708
loose
Add blank lines to make output
more readable.
theta = pi/2
theta =
1.5708
14
ITCH-DEPI
30/10/2014
15
ITCH-DEPI
30/10/2014
16
ITCH-DEPI
30/10/2014
17
ITCH-DEPI
30/10/2014
18
OPERACIONES ARITMÉTICAS
ITCH-DEPI
30/10/2014
20
a = 10;
b = 20;
c=a+b
d=a-b
e=a*b
f=a/b
g=a\b
x = 7;
y = 3;
z=x^y
c=
30
d=
-10
e=
200
f=
0.5000
g=
2
z=
343
ITCH-DEPI
30/10/2014
21
ITCH-DEPI
30/10/2014
Aritmética
plus
uplus
minus
uminus
times
rdivide
ldivide
power
mtimes
mrdivide
mldivide
mpower
Addition
Unary plus
Subtraction
Unary minus
Element-wise multiplication
Right array division
Left array division
Element-wise power
Matrix Multiplication
Solve systems of linear equations xA = B for x
Solve systems of linear equations Ax = B for x
Matrix power
cumprod
cumsum
diff
prod
sum
Cumulative product
Cumulative sum
Differences and Approximate Derivatives
Product of array elements
Sum of array elements
22
ITCH-DEPI
ceil
fix
floor
idivide
mod
rem
round
30/10/2014
Round toward positive infinity
Round toward zero
Round toward negative infinity
Integer division with rounding option
Remainder after division (modulo operation)
Remainder after division
Round to nearest decimal or integer
Operaciones Relacionales
Relational Operators
eq
ge
gt
le
lt
ne
isequal
isequaln
Relational operations
Determine equality
Determine greater than or equal to
Determine greater than
Determine less than or equal to
Determine less than
Determine inequality
Determine array equality
Determine array equality, treating NaN values as equal
23
ITCH-DEPI
30/10/2014
Operaciones Lógicas
Logical Operators: Short-circuit
Logical operations with short-circuiting
and
not
or
xor
Find logical AND
Find logical NOT
Find logical OR
Logical exclusive-OR
all
any
false
find
islogical
logical
true
Determine if all array elements are nonzero or true
Determine if any array elements are nonzero
Logical 0 (false)
Find indices and values of nonzero elements
Determine if input is logical array
Convert numeric values to logicals
Logical 1 (true)
24
ITCH-DEPI
30/10/2014
Operaciones de Conjuntos
intersect
ismember
issorted
setdiff
setxor
union
unique
Set intersection of two arrays
Array elements that are members of set array
Determine whether set elements are in sorted order
Set difference of two arrays
Set exclusive OR of two arrays
Set union of two arrays
Unique values in array
join
innerjoin
outerjoin
Merge two tables by matching up rows using key variables
Inner join between two tables
Outer join between two tables
25
ITCH-DEPI
30/10/2014
26
ITCH-DEPI
30/10/2014
Ley de los gases ideales
La ecuación que describe normalmente la
relación entre la presión, el volumen, la
temperatura y la cantidad (en moles) de un gas
ideal es:
Donde:
𝑃𝑃 𝑉𝑉 = 𝑛𝑛 𝑅𝑅 𝑇𝑇
𝑃𝑃 = Presión absoluta
𝑉𝑉 = Volumen
𝑛𝑛 = Moles de gas
𝑅𝑅 = Constante universal de los gases ideales
𝑇𝑇 = Temperatura absoluta
𝑛𝑛 = 𝑚𝑚/𝑀𝑀𝑀𝑀
Donde:
𝑚𝑚 = masa en Kg
𝑀𝑀𝑀𝑀 = masa molar en kg/mol
27
ITCH-DEPI
30/10/2014
Suponga que:
𝑉𝑉 = 1000 𝑚𝑚3
𝑇𝑇 = 300𝐾𝐾
𝑃𝑃 = 100𝑘𝑘𝑘𝑘𝑘𝑘
𝑀𝑀𝑀𝑀 = 29 𝑘𝑘𝑘𝑘/𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘
𝑅𝑅 = 8.314 𝑘𝑘𝑘𝑘𝑘𝑘 𝑚𝑚3 /𝑘𝑘𝑘𝑘𝑘𝑘𝑘𝑘 𝐾𝐾
𝑚𝑚=?
28
VARIABLES
ITCH-DEPI
30/10/2014
30
ITCH-DEPI
30/10/2014
31
ITCH-DEPI
30/10/2014
32
ITCH-DEPI
30/10/2014
33
ITCH-DEPI
30/10/2014
34
ITCH-DEPI
30/10/2014
35
ITCH-DEPI
30/10/2014
36
ITCH-DEPI
30/10/2014
37
ITCH-DEPI
30/10/2014
38
ITCH-DEPI
v
R1
L
i1
i2
C
R2
{𝑣𝑣 = (𝑧𝑧1 ∗ 𝑖𝑖1 + 𝑧𝑧3 ∗ 𝑖𝑖1 ) − (𝑧𝑧3 ∗ 𝑖𝑖2 )
{0 = (𝑧𝑧2 ∗ 𝑖𝑖2 + 𝑧𝑧3 ∗ 𝑖𝑖2 + 𝑧𝑧4 ∗ 𝑖𝑖2 ) − (𝑧𝑧3 ∗ 𝑖𝑖1 )
30/10/2014
𝜔𝜔 = 2𝜋𝜋𝜋𝜋
𝑣𝑣 = 10 sin 𝜔𝜔𝜔𝜔 + 𝜑𝜑
𝜑𝜑 = 0 → 𝑣𝑣 = 10
𝑧𝑧1 = 𝑅𝑅
𝑧𝑧2 = 𝜔𝜔𝜔𝜔𝜔𝜔
1
𝑗𝑗
𝑧𝑧3 =
𝜔𝜔𝜔𝜔
𝑧𝑧4 = 𝑅𝑅2 = 2
39
VECTORES
ITCH-DEPI
30/10/2014
41
ITCH-DEPI
30/10/2014
42
ITCH-DEPI
30/10/2014
43
ITCH-DEPI
30/10/2014
44
ITCH-DEPI
30/10/2014
45
ITCH-DEPI
30/10/2014
46
ITCH-DEPI
30/10/2014
ECUACION CLAUSIUS–CLAPEYRON
Una ecuación empleada por los meteorólogos es la ecuación ClausiusClapeyron, la cual se emplea para determinar la relación entre la presión de
saturación con la temperatura. La ecuación es la siguiente:
𝑃𝑃0
∆𝐻𝐻𝑣𝑣
1
1
𝑙𝑙𝑙𝑙
=
∗
−
6.11
𝑅𝑅𝑎𝑎𝑎𝑎𝑎𝑎
273 𝑇𝑇
Donde:
𝑃𝑃0 = presión de saturación
∆𝐻𝐻𝐻𝐻 = calor latente de vaporización, 2.453(106) J/kg
𝑅𝑅𝑅𝑅𝑅𝑅𝑅𝑅 = constante 461 J/kg
𝑇𝑇 = temperatura en grados kelvin
La conversión de Fahrenheit a Kelvin:
𝑇𝑇𝐾𝐾 =
𝑇𝑇𝑓𝑓 + 459.6
1.8
Despejando la presión de saturación del vapor:
𝑃𝑃0
= 6.11 × 𝑒𝑒
∆𝐻𝐻𝑣𝑣
1
1
×
−
𝑅𝑅𝑎𝑎𝑎𝑎𝑎𝑎
273 𝑇𝑇
47
ITCH-DEPI
30/10/2014
Ya que el número de
valores de
temperatura no es
especificado,
elegimos recalcular
cada 10 grados.
48
MATRICES
ITCH-DEPI
30/10/2014
50
ITCH-DEPI
30/10/2014
51
ITCH-DEPI
30/10/2014
52
ITCH-DEPI
30/10/2014
53
ITCH-DEPI
30/10/2014
54
ITCH-DEPI
30/10/2014
55
ITCH-DEPI
30/10/2014
56
ITCH-DEPI
30/10/2014
57
ITCH-DEPI
30/10/2014
Análisis de Circuitos
Utilice el método de mallas para encontrar las corriente de malla que pasa por el
resistor de 5 ohms y la potencia para una fuente de voltaje de 10 voltios.
10 ohms
10v
i1
i2
15 ohms
5 ohms
30 ohms
i3
30 ohms
58
ITCH-DEPI
30/10/2014
59
PROGRAMACIÓN
ITCH-DEPI
30/10/2014
61
ITCH-DEPI
30/10/2014
62
ITCH-DEPI
30/10/2014
63
ITCH-DEPI
30/10/2014
64
ITCH-DEPI
30/10/2014
65
ITCH-DEPI
30/10/2014
66
ITCH-DEPI
30/10/2014
67
ITCH-DEPI
30/10/2014
68
ITCH-DEPI
30/10/2014
69
ITCH-DEPI
30/10/2014
70
ITCH-DEPI
30/10/2014
71
ITCH-DEPI
30/10/2014
72
GRAFICAS
ITCH-DEPI
30/10/2014
74
ITCH-DEPI
30/10/2014
75
ITCH-DEPI
30/10/2014
76
ITCH-DEPI
30/10/2014
77
ITCH-DEPI
30/10/2014
78
ITCH-DEPI
30/10/2014
79
ITCH-DEPI
30/10/2014
80
ITCH-DEPI
30/10/2014
81
ITCH-DEPI
30/10/2014
82
ITCH-DEPI
30/10/2014
83
RESOLUCIÓN DE ECUACIONES
ITCH-DEPI
𝑝𝑝 𝑥𝑥 = 2𝑥𝑥 − 3 = 0
5𝑥𝑥 2 + 3𝑥𝑥 − 4 = 0
30/10/2014
2𝑥𝑥 5 − 3𝑥𝑥 4 − 5𝑥𝑥 3 + 𝑥𝑥 2 − 1 = 0
85
ITCH-DEPI
30/10/2014
𝑥𝑥 − 3𝑦𝑦 = 5
4x + 6y = 3
1 −3 𝑥𝑥
5
=
4 6 𝑦𝑦
3
𝑎𝑎𝑎𝑎 + 𝑏𝑏 = 0
𝑎𝑎𝑥𝑥 2 + 𝑏𝑏𝑏𝑏 + 𝑐𝑐 = 0
86
ITCH-DEPI
30/10/2014
𝑒𝑒 𝑥𝑥 = sin(𝑥𝑥)
𝑎𝑎𝑎𝑎 − 𝑏𝑏𝑏𝑏 = 𝑐𝑐
2𝑎𝑎𝑎𝑎 + 𝑏𝑏 = 9𝑐𝑐
87
ITCH-DEPI
30/10/2014
𝑥𝑥 3 − 𝑥𝑥𝑥𝑥 = −3
𝑥𝑥 2 − 2𝑦𝑦 2 = 5
88
CÁLCULO
ITCH-DEPI
𝑑𝑑
𝑑𝑑𝑑𝑑
𝑓𝑓 𝑥𝑥 = 2𝑥𝑥 3 − 5
𝑑𝑑
2 − 4 sin 𝜋𝜋𝑦𝑦
𝑑𝑑𝑑𝑑
= −4𝜋𝜋cos(𝜋𝜋𝜋𝜋)
30/10/2014
𝑓𝑓 𝑥𝑥 = 6𝑥𝑥 2
90
ITCH-DEPI
4
� 𝑔𝑔 𝑦𝑦 𝑑𝑑𝑑𝑑 = 2𝑦𝑦 + cos(𝜋𝜋𝜋𝜋)
𝜋𝜋
2
30/10/2014
� 𝑔𝑔 𝑦𝑦 𝑑𝑑𝑑𝑑 =
1
2(𝜋𝜋 + 4)
𝜋𝜋
91
sin 𝑥𝑥
lim
𝑥𝑥→0 𝑥𝑥
ITCH-DEPI
lim
𝑥𝑥→∞
2𝑥𝑥 3
30/10/2014
− 3𝑥𝑥 2 + 𝑥𝑥 + 5
4𝑥𝑥 3 − 7
92
ITCH-DEPI
𝑛𝑛
� 𝑖𝑖 =
𝑖𝑖=1
𝑛𝑛(𝑛𝑛 + 1)
2
30/10/2014
𝑑𝑑𝑑𝑑
= 𝑥𝑥 + 𝑦𝑦,
𝑑𝑑𝑑𝑑
𝑦𝑦 0 = 1
93

Documentos relacionados