Uploaded by yosephtls7

fdokumen.com komputasi-prosesdocx

advertisement
Quiz Komputasi Proses
Kelompok IV Ganjil
Anggota : 1. David Makmur (090405043)
2. M. Fauzy Ramadhan Tarigan (110405091)
3. Rizka Rinda Pramasti (110405063)
4. Rio Agung Prakoso (110405015)
5. Rismadhani Elita (120405013)
6. Nisaul Fadilah (120405101)
7. Marfuah Lubis (120405103)
8. Lara Indra Ranita (120405009)
9. Alvian (120405031)
10. Andhika Setiawan (120405015)
1.
Buat program matlab untuk menentukan nilai-nilai x1, x2, dan x3 dari sistem persamaan
liniear berikut:
3𝑥1 − 𝑥2 + 3𝑥3 = 2
5𝑥1 + 3𝑥2 + 𝑥3 = 6
𝑥1 + 2𝑥2 − 𝑥3 = 2
Jawab :
3 −1 3 𝑥1
2
𝑥
[5 3
1 ] [ 2 ] = [6]
1 2 −1 𝑥3
2
A
x
b
Menggunakan matlab:
clear; clc
A = [3 -1 3; 5 3 1; 1 2 -1];
b = [2; 6; 2];
x = A\b
x=
0.1429
1.4286
1.0000
2. Buat program matlab untuk menentukan nilai x yang menyebabkan nilai fungsi f(x)=0
𝑓(𝑥) = 𝑥 4 − 10 𝑥 3 + 35𝑥 2 − 50𝑥 + 24
Jawab:
clear; clc
p = [1 -10 35 -50 24];
x = roots(p)
x=
4.0000
3.0000
2.0000
1.0000
3. Buat program matlab untuk menentukan nilai x1 dan x2 dari sistem persamaan berikut:
−3𝑥12 + 2 𝑥1 + 4𝑥2 = 5
2𝑥12 + 3 𝑥22 = 7
Jawab:
clear; clc
F = @(x)[-3*x(1).^2 + 2*x(1) + 4*x(2) -5; 2*x(1).^2 + 3*x(2).^2 – 7];
x0 = [2 1];
options = optimset(‘Display’,’iter’);
[x, fval] = fsolve(F,x0,options)
FuncIteration count
0
3
1
6
2
9
3
10
4
13
5
14
6
15
7
18
8
21
Norm of
step
First-order
f(x)
optimality
202
855
16.655
0.919161
68
1.85289 0.587748
6.05
1.85289 0.8122
6.05
1.23404 0.20305
1.52
1.23404 0.20305
1.52
1.23404 0.0507625
1.52
1.22069 0.0126906
0.747
1.2161
0.0126906
0.741
Trust-region
radius
1
1
2.3
2.3
0.203
0.203
0.0508
0.0127
0.0127
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
22
25
28
31
34
37
40
43
46
49
52
55
58
59
62
65
68
71
74
77
78
81
84
85
88
91
94
97
100
103
106
109
112
115
118
121
124
127
128
131
1.2161
1.21302
1.21239
1.21194
1.2115
1.2112
1.21087
1.21067
1.21043
1.2103
1.21011
1.21004
1.20989
1.20989
1.2095
1.20934
1.20924
1.20904
1.20892
1.20886
1.20886
1.20884
1.20884
1.20884
1.20883
1.20883
1.20883
1.20883
1.20883
1.20883
1.20883
1.20883
1.20883
1.20883
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
0.0126906
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.00317266
0.000793164
0.000793164
0.000793164
0.00198291
0.00198291
0.00198291
0.00198291
0.000495728
0.000495728
0.000495728
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
0.000123932
3.0983e-005
0.741
0.0127
0.177
0.00317
0.265
0.00317
0.297
0.00317
0.288
0.00317
0.309
0.00317
0.302
0.00317
0.317
0.00317
0.311
0.00317
0.323
0.00317
0.318
0.00317
0.327
0.00317
0.322
0.00317
0.322
0.00317
0.151
0.000793
0.0662
0.000793
0.0595
0.000793
0.0423
0.00198
0.0628
0.00198
0.0681
0.00198
0.0681
0.00198
0.0357
0.000496
0.0411
0.000496
0.0411
0.000496
0.0153
0.000124
0.00887
0.000124
0.013
0.000124
0.0112
0.000124
0.0129
0.000124
0.0119
0.000124
0.0129
0.000124
0.0122
0.000124
0.013
0.000124
0.0125
0.000124
0.0131
0.000124
0.0127
0.000124
0.0132
0.000124
0.0128
0.000124
0.0128
0.000124
0.00626
3.1e-005
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
134
137
140
143
144
147
150
151
154
157
160
163
166
169
172
175
178
181
184
187
190
193
196
199
202
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
1.20882
3.0983e-005
3.0983e-005
7.74575e-005
7.74575e-005
7.74575e-005
1.93644e-005
1.93644e-005
1.93644e-005
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
4.84109e-006
0.00211
0.00183
0.0023
0.00293
0.00293
0.00112
0.00162
0.00162
0.000623
0.000401
0.000336
0.000352
0.000423
0.000412
0.000456
0.000442
0.000477
0.000463
0.00049
0.000477
0.000499
0.000487
0.000505
0.000494
0.000509
3.1e-005
3.1e-005
7.75e-005
7.75e-005
7.75e-005
1.94e-005
1.94e-005
1.94e-005
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
4.84e-006
x=
0.2578
0.9193
fval =
-1.0065
0.4426
4. Buat program matlab untuk menyelesaikan integrasi berikut ini:
0.4
∫ 𝑥𝑒 −𝑥 𝑑𝑥
0
Jawab:
clear; clc
F = @(x)x.*exp(-x);
Qs=quad(F,0,0.4)
Ql=quadl(F,0,0.4)
Qs =
0.0616
Ql =
0.0616
5. Buat program matlab untuk menentukan nilai y(1) dari persamaan diferensial biasa
berikut:
𝑑𝑦 3𝑥
−
+ 2𝑥𝑦 = 0
𝑑𝑥 𝑦
dimana 𝑦(0) = 1.0
Jawab:
𝑑𝑦 3𝑥
=
− 2𝑥𝑦 = 0
𝑑𝑥
𝑦
Menggunakan Matlab
clear; clc
xs=[0 10];
y0=1;
F=@(x,y)(3*x/y-2*x*y);
[X,Y]=ode45(F,xs,y0);
plot(X,Y(:,1),’-o’)
X=
0
0.0849
0.1698
𝑦(0) = 1,0
0.2547
0.3396
0.4245
0.5094
0.5943
0.6792
0.7774
0.8757
0.9739
1.0721
1.1704
1.2686
1.3669
1.4651
1.5503
1.6354
1.7206
1.8057
1.8958
1.9859
2.0760
2.1661
2.2654
2.3647
2.4640
2.5632
2.6303
2.6974
2.7644
2.8315
2.8985
2.9656
3.0327
3.0997
3.1749
3.2501
3.3253
3.4004
3.4519
3.5033
3.5548
3.6062
3.6577
3.7091
3.7605
3.8120
3.8715
3.9311
3.9906
4.0501
4.0976
4.1451
4.1926
4.2401
4.2876
4.3351
4.3827
4.4302
4.4800
4.5298
4.5796
4.6295
4.6766
4.7236
4.7707
4.8178
4.8584
4.8990
4.9396
4.9802
5.0167
5.0532
5.0897
5.1262
5.1637
5.2011
5.2386
5.2761
5.3172
5.3583
5.3994
5.4405
5.4824
5.5243
5.5661
5.6080
5.6453
5.6825
5.7197
5.7570
5.7890
5.8211
5.8531
5.8851
5.9162
5.9472
5.9783
6.0093
6.0436
6.0779
6.1122
6.1464
6.1839
6.2213
6.2588
6.2962
6.3318
6.3673
6.4028
6.4383
6.4685
6.4986
6.5287
6.5589
6.5860
6.6131
6.6403
6.6674
6.6962
6.7250
6.7538
6.7827
6.8155
6.8484
6.8813
6.9142
6.9481
6.9821
7.0160
7.0500
7.0797
7.1095
7.1392
7.1689
7.1941
7.2193
7.2445
7.2697
7.2945
7.3192
7.3440
7.3688
7.3971
7.4254
7.4537
7.4820
7.5136
7.5453
7.5769
7.6086
7.6384
7.6682
7.6981
7.7279
7.7527
7.7775
7.8023
7.8271
7.8494
7.8717
7.8939
7.9162
7.9404
7.9646
7.9888
8.0130
8.0414
8.0698
8.0982
8.1266
8.1561
8.1856
8.2151
8.2446
8.2701
8.2955
8.3209
8.3463
8.3676
8.3888
8.4100
8.4313
8.4524
8.4735
8.4945
8.5156
8.5403
8.5650
8.5897
8.6144
8.6425
8.6705
8.6985
8.7266
8.7529
8.7792
8.8055
8.8318
8.8533
8.8747
8.8962
8.9177
8.9369
8.9561
8.9753
8.9945
9.0158
9.0371
9.0583
9.0796
9.1050
9.1304
9.1557
9.1811
9.2077
9.2342
9.2607
9.2872
9.3098
9.3324
9.3549
9.3775
9.3962
9.4148
9.4334
9.4521
9.4707
9.4893
9.5080
9.5266
9.5488
9.5709
9.5931
9.6153
9.6408
9.6662
9.6917
9.7172
9.7410
9.7648
9.7886
9.8124
9.8316
9.8508
9.8700
9.8892
9.9063
9.9235
9.9406
9.9577
9.9683
9.9788
9.9894
10.0000
Y=
1.0000
1.0036
1.0139
1.0300
1.0502
1.0730
1.0965
1.1195
1.1407
1.1624
1.1802
1.1938
1.2039
1.2120
1.2174
1.2198
1.2212
1.2228
1.2238
1.2240
1.2241
1.2246
1.2249
1.2246
1.2245
1.2251
1.2254
1.2245
1.2241
1.2246
1.2249
1.2246
1.2244
1.2248
1.2249
1.2247
1.2245
1.2252
1.2254
1.2245
1.2240
1.2246
1.2249
1.2246
1.2244
1.2248
1.2249
1.2247
1.2245
1.2250
1.2252
1.2246
1.2243
1.2248
1.2250
1.2246
1.2244
1.2249
1.2250
1.2247
1.2244
1.2251
1.2253
1.2246
1.2241
1.2252
1.2256
1.2245
1.2238
1.2249
1.2253
1.2245
1.2240
1.2247
1.2250
1.2246
1.2244
1.2248
1.2250
1.2247
1.2245
1.2250
1.2251
1.2246
1.2243
1.2252
1.2255
1.2245
1.2239
1.2251
1.2256
1.2245
1.2238
1.2247
1.2251
1.2246
1.2242
1.2247
1.2249
1.2247
1.2245
1.2249
1.2250
1.2247
1.2245
1.2251
1.2253
1.2246
1.2242
1.2253
1.2257
1.2245
1.2237
1.2249
1.2253
1.2245
1.2240
1.2246
1.2249
1.2246
1.2244
1.2248
1.2249
1.2247
1.2245
1.2250
1.2251
1.2246
1.2244
1.2253
1.2256
1.2245
1.2239
1.2252
1.2256
1.2245
1.2237
1.2246
1.2250
1.2246
1.2243
1.2247
1.2249
1.2247
1.2245
1.2248
1.2250
1.2247
1.2245
1.2251
1.2253
1.2246
1.2241
1.2254
1.2258
1.2244
1.2236
1.2248
1.2253
1.2245
1.2240
1.2246
1.2249
1.2246
1.2244
1.2248
1.2249
1.2247
1.2245
1.2250
1.2251
1.2246
1.2244
1.2254
1.2257
1.2245
1.2238
1.2252
1.2257
1.2245
1.2237
1.2246
1.2250
1.2246
1.2243
1.2247
1.2248
1.2247
1.2245
1.2248
1.2250
1.2247
1.2245
1.2252
1.2254
1.2246
1.2241
1.2255
1.2259
1.2244
1.2235
1.2248
1.2253
1.2245
1.2240
1.2246
1.2248
1.2246
1.2245
1.2248
1.2249
1.2247
1.2246
1.2250
1.2251
1.2246
1.2244
1.2254
1.2258
1.2245
1.2237
1.2252
1.2258
1.2244
1.2236
1.2245
1.2249
1.2246
1.2243
1.2247
1.2248
1.2247
1.2246
1.2248
1.2249
1.2247
1.2245
1.2252
1.2254
1.2246
1.2241
1.2255
1.2260
1.2244
1.2234
1.2247
1.2253
1.2245
1.2240
1.2245
1.2248
1.2246
1.2245
1.2246
1.2246
1.2247
1.2247
6. Buat program matlab untuk menentukan nilai-nilai y1, y2, dan y3 pada t= 1000 dari
sistem persamaan diferensial biasa berikut:
dy1
 77.27 ( y 2  y1 y 2  y1  8.375  10 6 y12 )
dt
dy2
 ( y 3  y 2  y1 y 2 ) / 77.27
dt
dy3
 0.1610 ( y1  y 3 )
dt
dimana y1(0) = 4.0, y2(0) = 1.1, dan y3(0) = 4.0
Jawab:
ts = [0 1000];
y0 = [4 1.1 4];
F=@(t,y)[77.27*(y(2)-y(1)*y(2)+y(1)-8.375*10^(-6)*y(1)^2;(y(3)-y(2)y(1)*y(2))/77.27;0.1610*(y(1)-y(3)];
[t,y]=ode45(F,ts,y0)
figure(1)
plot(t,y(:,1),’-o’)
figure(2)
plot(t,y(:,2),’-o’)
figure(3)
plot(t,y(:,3),’-o’)
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1177
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000 0.0143 0.1176
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
Dst
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.0143
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
0.1176
Download