RESOLUCI N PROBLEMAS LIBRO MOORE
Problema 1.
a) La función para el problema quedaría:
function result=num_grains(n)
%Esta función calcula número de granos en una area de una pulgada
cuadrada
%a 100x de un cristal.
N=2^(n-1);
result=N;
ejecutando en la ventana de comandos:
>> num_grains(2)
ans =
2
>> num_grains(4)
ans =
8
>> num_grains(11)
ans =
1024
b) Para encontrar de n=10 hastan=100, hacemos un script que sería:
N=[];
for n=10:1:100
N=[N num_grains(n)];
end
N
plot([10:1:100],N)
grid on;
y nos arroja los resultados:
N=
1.0e+029 *
Columns 1 through 9
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 10 through 18
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 19 through 27
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.00000.0000 0.0000
Columns 28 through 36
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 37 through 45
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 46 through 54
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 55 through 63
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Columns 64 through 72
0.0000 0.0000 0.0000 0.00000.0000 0.0000 0.0000 0.0000 0.0000
Columns 73 through 81
0.0000 0.0000 0.0001 0.0002 0.0004 0.0008 0.0015 0.0031 0.0062
Columns 82 through 90
0.0124 0.0248 0.0495 0.0990 0.1981 0.3961 0.7923 1.5846 3.1691
Column 91
6.3383
Y la gráfica:
X=11, Y=1024 , nos indica que los resultados con correctos.
Problema2.
a) La función energy:
function result=energy(m)
E=m.*(2.9979*10^8)^2;
E=doublé(E);result=E;
evaluando en la ventana de comandos:
>> energy(0.20)
ans =
1.7975e+016
>> energy(0.11)
ans =
9.8861e+015
b) Graficando
>> m=[0 10 100 1000 10000 100000 1000000];
>> E=energy(m);
>> plot(m,E);xlabel('Masa');ylabel('Energia')
>> grid on
Problema 3.
a) La función quedaría:
function result=nmoles(x,y)
n=x./y;
result=n;
b) Según los datos, y para efecto de la división miembro a miembrodefinimos para las
masas(1g hasta 10g) y las masas molares de los elementos(Benceno, Alcohol,
tetrafluoreaetano):
>> m=meshgrid([1:1:10],[1:1:3])
m=
1
2
3
4
5
6
7
8
9 10
1
1
2
2
3
3
4
4
5
5
6
6
7
7
8
8
9 10
9 10
>> m=m'
m=
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
>> mw=meshgrid([78.115 46.07 102.3],[1:1:10])
mw =
1.0e+002 *
0.7811500000000000.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000
>> nmoles(m,mw)
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
0.460700000000000
1.023000000000000
1.023000000000000
1.0230000000000001.023000000000000
1.023000000000000
1.023000000000000
1.023000000000000
1.023000000000000
1.023000000000000
1.023000000000000
ans =
0.012801638609742
0.025603277219484
0.038404915829226
0.051206554438968
0.064008193048710
0.076809831658452
0.089611470268194
0.102413108877936
0.115214747487678
0.128016386097420
0.021706099413935
0.043412198827871
0.065118298241806
0.0868243976557410.108530497069677
0.130236596483612
0.151942695897547
0.173648795311483
0.195354894725418
0.217060994139353
0.009775171065494
0.019550342130987
0.029325513196481
0.039100684261975
0.048875855327468
0.058651026392962
0.068426197458456
0.078201368523949
0.087976539589443
0.097751710654936
Problema 4.
a) La función quedaría:
function result=mass(n,mw)
m=n.*mw;
result=m;
b) Poniendo a prueba la función paran=1:10, y con los datos de masa molares del
problema anterior, tenemos.
>> n=meshgrid([1:1:10],[1:1:3])
n=
1
1
1
2
2
2
3
3
3
>> n=n'
n=
1
2
1
2
1
2
4
4
4
5
5
5
6
6
6
7
7
7
8
8
8
9 10
9 10
9 10
3
4
5
6
7
8
9
10
3
4
5
6
7
8
9
10
3
4
5
6
7
8
9
10
>> mw=meshgrid([78.115 46.07 102.3],[1:1:10])
mw =
1.0e+002 *
0.781150000000000
0.781150000000000
0.781150000000000
0.781150000000000...
Regístrate para leer el documento completo.