Anda di halaman 1dari 8

KUIS KOMPUTASI PROSES

Nama : Muhammad Hadiid Fadhlillah

Kelas : 7 KIA

NPM : 061640421625

Dosen : Dr. Ir. Muhammad Yerizam, M.T.

1. Gambar dibawah ini menunjukan plat datar persegi dengan sisi – sisinya mempuntai suhu yg
konstan. Temukan suhu setiap titik x1, x2, x3 jika suhu pada setiap titik diasumsikan sebagai
suhu rata-rata dari node yang berdekatan dengan program matlab.
Persamaan dari gambar tersebut yaitu :
30+15+𝑋2+𝑋3
a. X1 = 4
4X1 - X2 - X3 = 45

𝑋1+𝑋4+15+20
b. X2 = 4
4X2 – X1 – X4 = 35

30+𝑋1+𝑋4+25
c. X3 =
4
4X3 – X1 – X4 = 55

𝑋3+𝑋2+20+25
d. X4 = 4
4X4 – X3 – X2 = 45

Penyelesaian Menggunakan Matlab


>> A=[4 -1 -1 0;-1 4 0 -1;-1 0 4 -1;0 -1 -1 4]

A=

4 -1 -1 0
-1 4 0 -1
-1 0 4 -1
0 -1 -1 4

>> B=[45;35;55;45]

B=

45
35
55
45

>> C=A\B
C=

22.5000
20.0000
25.0000
22.5000

Jadi nilai :
X1 = 22,5
X2 = 20
X3 = 25
X4 = 22,5

2. Diketahui system dua persamaan dengan dua variabel


2a – 3b = e -2a
-a – 4b = 2e-b
Tentukan nilai a dan b dengan nilai tebakan awal xo=[-3,-2]. Buat program matlabnya.
Menuliskan persamaan kembali dalam bentuk F(x)
2a – 3b - e-2a = 0
-a + 4b -2 e-b = 0

Membuat fungsi sistem di m-file


function F = myfun(x)

F = [2*x(1)-3*x(2)-exp(-2*x(1));

-x(1)+ 4*x(2)-2*exp(-x(2))];
Membuat program pengeksekusi menggunakan fsolve pada m-file
x0 =[-3; -2]; %tebakan awal untuk penyelesaian

options= optimset('Display','iter');%pilihan untuk menampilkan output dan iterasi

[x, fval]=fsolve(@myfun,x0,options) %memanggil penyelesaian

Kemudian muncul hasil di command window

>> myfun2

Norm of First-order Trust-region

Iteration Func-count f(x) step optimality radius

0 3 163146 3.26e+05 1

1 6 22395.2 1 4.45e+04 1

2 9 3182.26 0.998853 6.11e+03 1

3 12 466.168 0.631478 841 1

4 15 69.4644 0.576267 116 1

5 18 10.0772 0.630879 17.3 1

6 21 0.967954 0.65873 2.9 1


7 24 0.0159275 0.42311 0.357 1.65

8 27 3.7276e-06 0.0713848 0.00515 1.65

9 30 2.04006e-13 0.00114656 1.17e-06 1.65

10 33 5.42764e-28 2.70247e-07 6.29e-14 1.65

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

0.8607

0.5142

fval =

1.0e-13 *

-0.2326

-0.0133
3. Tentukan nilai x dan y dari system persamaan tak liner dibawah ini:
F (x,y) = x3 – 3x2y = 0,5
√5
F (x,y) = 3xy2 – y3 = 3
Selesaikan dengan program matlab.
Penyelesaian :
 Buat fungsi system pers non linear dalam m-file
function f = sistem(x)
f=[x(1)^3-3*x(1)*x(2)^2-0.5
3*x(1)^2*x(2)-x(2)^3-sqrt(5)/2];

 Setelah program run, kemudian masuk ke command window


>> [x,fval]=fsolve('sistem',[1 2])

Equation solved.

fsolve completed because the vector of function values is near zero


as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.

<stopping criteria details>


x=

1.5032 0.4273

fval =

1.0e-13 *

0.2665
-0.0244
Maka, didapatkan hasil = 1.0e-13 *
X= 0.2665
Y= -0.0244

Anda mungkin juga menyukai