Upload
rike-marjulisa
View
225
Download
0
Embed Size (px)
Citation preview
7/25/2019 soal no 5
1/6
5. Kerjakan soal 20.3 di buku text.
Jawaban
a. Program untuk x = chebfun(x)
>>x = chebfun ('x');>> f = 1./(1+25*x.^2);
>> clf, chebpolyplo(f), !"#$ on, ax#%(& 1e1 1)
#pe"oleh ha%#l
1. kerjakan soal 16.1 di buku text
Jawaban
a. Program untuk eror norm tak hingga dan norm 2
Program untuk error tak hingga dan norm 2 n= 100
f = abs(x-0.8);
tic !best = reme"(f#00); toc
ho$d off !$ot(f-!best%r%)
tic !cheb = chebfun(f#0#); toc
ho$d on !$ot(f-!cheb)
axis(&-# # -.008 .008') grid on
7/25/2019 soal no 5
2/6
tit$e(%est a!!roximation s. *heb+she inter!o$ation%)
errcheb = norm(f-!chebinf)
errbest = norm(f-!bestinf)
diperoleh ukuran waktu dan error,$a!sed time is .0#0/ seconds.
,$a!sed time is 0.#1/ seconds.
errcheb =
0.000
errbest =
0.00#1
ntuk norm 2
errcheb2 = norm(f-!cheb2)
errbest2 = norm(f-!best2)
diperoleh hasil
errcheb2 =
.///1e-00
errbest2 =
0.00#1
!erta plot
Program untuk error tak hingga n= 200
f = abs(x-0.8);
7/25/2019 soal no 5
3/6
tic !best = reme"(f200); toc
ho$d off !$ot(f-!best%r%)
tic !cheb = chebfun(f#0#); toc
ho$d on !$ot(f-!cheb)axis(&-# # -.008 .008') grid on
tit$e(%est a!!roximation s. *heb+she inter!o$ation%)
errcheb = norm(f-!chebinf)
errbest = norm(f-!bestinf)
diperoleh ukuran waktu dan error
,$a!sed time is .20// seconds.
,$a!sed time is 0.0 seconds.
errcheb = 0.000
errbest = 8.#2/e-00
ntuk norm 2
errcheb2 = norm(f-!cheb2)
errbest2 = norm(f-!best2)
diperoleh hasil
errcheb2 = .///1e-00
errbest2 = 8.##e-00
!erta plot
Program untuk error tak hingga n= 300
f = abs(x-0.8);
7/25/2019 soal no 5
4/6
tic !best = reme"(f/00); toc
ho$d off !$ot(f-!best%r%)
tic !cheb = chebfun(f#0#); toc
ho$d on !$ot(f-!cheb)axis(&-# # -.008 .008') grid on
tit$e(%est a!!roximation s. *heb+she inter!o$ation%)
errcheb = norm(f-!chebinf)
errbest = norm(f-!bestinf)
diperoleh ukuran waktu dan error
,$a!sed time is /.10 seconds.
,$a!sed time is 0.0280 seconds.
errcheb = 0.000
errbest = ./2e-00
ntuk norm 2
errcheb2 = norm(f-!cheb2)
errbest2 = norm(f-!best2)
diperoleh hasil
errcheb2 = .///1e-00
errbest2 = .//8e-00
!erta plot
Program untuk error tak hingga n= 1000
f = abs(x-0.8);
7/25/2019 soal no 5
5/6
tic !best = reme"(f#000); toc
ho$d off !$ot(f-!best%r%)
tic !cheb = chebfun(f#0#); toc
ho$d on !$ot(f-!cheb)axis(&-# # -.008 .008') grid on
tit$e(%est a!!roximation s. *heb+she inter!o$ation%)
errcheb = norm(f-!chebinf)
errbest = norm(f-!bestinf)
diperoleh ukuran waktu dan error
,$a!sed time is 2#./28 seconds.
,$a!sed time is 0.0# seconds.
errcheb = 0.000
errbest = #.82e-00
ntuk norm 2
errcheb2 = norm(f-!cheb2)
errbest2 = norm(f-!best2)
diperoleh hasil
errcheb2 = .///1e-00
errbest2 = #.82e-00
!erta plot
7/25/2019 soal no 5
6/6
Komentar
3ari eror +ang dihasi$kan ketiga !rogram ter$ihat a!roksimasi terbaik $ebih baik di norm tak
hingga dari!ada a!roksimasi cheb+she seba$ikan+a a!roksimasi cheb+she $ebih baik di
norm dua dari!ada a!!roksimasi terbaik.
3. Kerjakan soal 1".1 di buku text