Академический Документы
Профессиональный Документы
Культура Документы
Introduction to numerical
methods and matlab programming for engineers
Referencia:
@article{young2014introduction,
title={Introduction to numerical methods and matlab programming
for engineers},
author={Young, Todd and Mohlenkamp, Martin J},
journal={Department of Mathematics, Ohio University},
year={2014}
}
Página 35
Solución en Matlab
>> M = [1,3,-1,6;2,4,0,-1;0,-2,3,-1;-1,2,-5,1]
M =
1 3 -1 6
2 4 0 -1
0 -2 3 -1
-1 2 -5 1
N =
-1 -3 3
2 -1 6
1 4 -1
2 -1 2
>> M*N
ans =
16 -16 34
4 -9 28
-3 15 -17
2 -20 16
>> N*M
Error using *
Inner matrix dimensions must agree.
No se puede
Referencia:
@book{gilat2006matlab,
title={Matlab: Una introducci{\'o}n con ejemplos pr{\'a}cticos},
author={Gilat, Amos},
year={2006},
publisher={Revert{\'e}}
}
Página 103
Página 154
function f=f(x)
f=(0.9)*x.^4-12*x.^4-5*x;
return
>> f(-3)
ans =
-884.1000
>> f(5)
ans =
-6.9625e+03
%Ejercicio4
clc;
clear;
x=-4:0.1:4;
y=(0.9)*x.^4-12*x.^2-5*x;
plot(x,y)
xlabel('Eje x')
ylabel('Eje y')
title('y(x)=0,9x^4 - 12x^2 - 5x')
3. Learning to program with MATLAB: building GUI tools
Referencia:
@article{lent2013learning,
title={Learning to program with MATLAB: building GUI tools},
author={Lent, Craig S},
year={2013},
publisher={John Wiley \& Sons}
}
Página 30
4) Raíces cuadráticas2. Escriba un programa, quadroots2.m, para solicitar al
usuario que ingrese a su vez a, b, y c, y luego calcule las raíces de la ecuación
cuadrática. Algo como esto:
***********************************
Quadratic Solver for axˆ2+bx+c=0
Please enter a: xx
Please enter b: xx
Please enter c: xx
The roots are:
Z1=xxxxx
Z2=xxxxx
Solución en Matlab
%Ejercicio 3
%Ecuación cuadrática ax^2 +bx+c==0
clc;
clear;
a=input('Ingresar el valor de a: ');
b=input('Ingresar el valor de b: ');
c=input('Ingresar el valor de c: ');
d=b^2-4*a*c; %d=discriminante
if d>0
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
disp('discriminante mayor que 0, hay dos raices reales y diferentes')
elseif d==0
x1=-b/(2*a);
x2=-b/(2*a);
disp('discriminante igual a 0, una sola raiz')
else
x1=(-b+i*sqrt(-d))/(2*a);
x2=(-b-i*sqrt(-d))/(2*a);
disp('discriminante menor que 0, hay dos raices complejas y diferentes')
end
disp('valores de la ecuación de segundo grado:');
x1 , x2
Ingresar el valor de a: 1
Ingresar el valor de b: 1
Ingresar el valor de c: 1
discriminante menor que 0, hay dos raices complejas y diferentes
valores de la ecuación de segundo grado:
x1 =
-0.5000 + 0.8660i
x2 =
-0.5000 - 0.8660i
4. Introduction to numerical
methods and matlab programming for engineers
Referencia:
@article{young2014introduction,
title={Introduction to numerical methods and matlab programming
for engineers},
author={Young, Todd and Mohlenkamp, Martin J},
journal={Department of Mathematics, Ohio University},
year={2014}
}
Página 11
5) Enter: format long. Use mynewton on the function f(x) = 𝑥 5 − 7, with x0 = 2. By trial
and error, what is the lowest value of n for which the program converges (stops
changing). Compute the error, which is how close the program’s answer is to the true
value. Compute the residual, which is the program’s answer plugged into f. (See the
next section for discussion.) Are the error and residual zero?
Referencia:
@book{gilat2006matlab,
title={Matlab: Una introducci{\'o}n con ejemplos pr{\'a}cticos},
author={Gilat, Amos},
year={2006},
publisher={Revert{\'e}}
}
Página 72
Página 73
Página 74
Página 132
Página 225
12) Un depósito cilíndrico de aceite, fabricado con acero inoxidable, tiene un diámetro
exterior de 40cm y una longitud de 70cm. Calcule el grosor x del depósito cuya masa
es de 18kg. La densidad del acero inoxidable es de 7920 kg/𝑚3 .
Página 247
13) La posición en función del tiempo de una partícula en movimiento viene dada
por
Página 248
Página 267
4 cos(2𝑥) − 𝑒 0.5𝑥 + 5 = 0
Página 268
16) Utilice Matlab para calcular la siguiente integral:
Página 311
17) Calcule la solución a la siguiente ecuación diferencial que satisface las condiciones
iniciales dadas:
Referencia:
@article{lent2013learning,
title={Learning to program with MATLAB: building GUI tools},
author={Lent, Craig S},
year={2013},
publisher={John Wiley \& Sons}
}
Página 74
18) Intersection of two lines. Consider two lines given by the following two equations.
Solve for the intersection of the two lines by constructing a matrix equation and solving
the linear system with MATLAB. Plot the two lines on the domain x ∈ [0, 5] and plot the
calculated interception point as a red circle.
Intersección de dos líneas. Considera dos líneas dadas por las siguientes dos
ecuaciones.
Página 74
The commutator (square brackets) and anticommutator (curly brackets) of two matrices
are defined by:
Matrices de Pauli. Las matrices de Pauli se definen de la siguiente manera:
Página 130
20) Write a program named test2.m that uses the function c2f, from Problem 2, and a for loop
to produce a tabular output of temperatures in Celsius and Fahrenheit for Tc from 32◦ to
44◦ in steps of 2◦Celsius. Output should look like this:
Escriba un programa llamado test2.m que use la función c2f, del Problema 2,
y una para bucle para producir una salida tabular de temperaturas en grados
Celsius y Fahrenheit para Tc de 32◦ a 44◦ en pasos de 2◦ Celsius. La salida
debería verse así: