You are on page 1of 4

R Console

R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Previously saved workspace restored]
> cat("FATKUROTIN
101810101007")
FATKUROTIN
101810101007> cat("TITIS MIRANTI 101810101012")
TITIS MIRANTI 101810101012> cat("YOGMA DWI M. 101810101027")
YOGMA DWI M. 101810101027> x<-seq(-13,13,0.005)
>
> fungsi<-function(x){
+
x^4+15*x^3+5*x^2+6*x
+ }
>
> diff1<-function(x){
+
4*x^3+45*x^2+10*x+6
+ }
>
>
> diff2<-function(x){
+
12*x^2+90*x+10
+ }
> delta<-8
> eps<-0.00001
> x0<-8
> it<-0
> while(delta>eps){
+ x1<-x0-diff1(x0)/diff2(x0)
+ it<-it+1
+ delta<-abs(x1-x0)
+ cat("\n iters=",it,"x1",x1,"|x1-x0|"=delta,"\n")
+ x0<-x1
+ }
iters= 1 x1 4.65287 3.34713
iters= 2 x1 2.576523 2.076348
iters= 3 x1 1.335924 1.240599
iters= 4 x1 0.6157942 0.7201295
iters= 5 x1 0.1848198 0.4309743
iters= 6 x1 -0.163157 0.3479769
iters= 7 x1 1.108174 1.271331
iters= 8 x1 0.4832351 0.6249387
iters= 9 x1 0.09612096 0.3871141
iters= 10 x1 -0.2972605 0.3933815

Page 1

R Console
iters= 11 x1 0.1423408 0.4396013
iters= 12 x1 -0.2197117 0.3620524
iters= 13 x1 0.4255196 0.6452313
iters= 14 x1 0.05477344 0.3707462
iters= 15 x1 -0.3918102 0.4465837
iters= 16 x1 -0.01823151 0.3735787
iters= 17 x1 -0.7156501 0.6974186
iters= 18 x1 -0.2924578 0.4231923
iters= 19 x1 0.1537249 0.4461827
iters= 20 x1 -0.2034729 0.3571979
iters= 21 x1 0.5379312 0.7414042
iters= 22 x1 0.1335828 0.4043484
iters= 23 x1 -0.2328565 0.3664393
iters= 24 x1 0.3552166 0.5880731
iters= 25 x1 0.0008420476 0.3543746
iters= 26 x1 -0.5954835 0.5963255
iters= 27 x1 -0.2101706 0.3853129
iters= 28 x1 0.4873464 0.697517
iters= 29 x1 0.09898879 0.3883577
iters= 30 x1 -0.2917653 0.3907541
iters= 31 x1 0.1554064 0.4471717
iters= 32 x1 -0.2011491 0.3565555
iters= 33 x1 0.5571579 0.758307
iters= 34 x1 0.146436 0.4107219
iters= 35 x1 -0.2137652 0.3602012
iters= 36 x1 0.4627854 0.6765506
iters= 37 x1 0.08171384 0.3810716
iters= 38 x1 -0.326663 0.4083768
iters= 39 x1 0.08151432 0.4081773
iters= 40 x1 -0.3270931 0.4086074
iters= 41 x1 0.08071945 0.4078125
iters= 42 x1 -0.3288133 0.4095328
iters= 43 x1 0.07756359 0.4063769
iters= 44 x1 -0.3357515 0.4133151
iters= 45 x1 0.06519964 0.4009511

Page 2

R Console
iters= 46 x1 -0.3647525 0.4299522
iters= 47 x1 0.01889805 0.3836506
iters= 48 x1 -0.511219 0.5301171
iters= 49 x1 -0.142719 0.3685
iters= 50 x1 1.963885 2.106604
iters= 51 x1 0.9790646 0.9848203
iters= 52 x1 0.4072623 0.5718023
iters= 53 x1 0.0412017 0.3660606
iters= 54 x1 -0.4314411 0.4726428
iters= 55 x1 -0.0651937 0.3662474
iters= 56 x1 -1.388995 1.323801
iters= 57 x1 -0.6464382 0.7425567
iters= 58 x1 -0.2465808 0.3998574
iters= 59 x1 0.2952064 0.5417872
iters= 60 x1 -0.04978378 0.3449901
iters= 61 x1 -1.061316 1.011533
iters= 62 x1 -0.4878213 0.5734952
iters= 63 x1 -0.1217439 0.3660774
iters= 64 x1 6.863704 6.985448
iters= 65 x1 3.940113 2.923591
iters= 66 x1 2.14547 1.794643
iters= 67 x1 1.084441 1.061029
iters= 68 x1 0.4693306 0.6151105
iters= 69 x1 0.08635176 0.3829788
iters= 70 x1 -0.3168499 0.4032017
iters= 71 x1 0.1003221 0.4171721
iters= 72 x1 -0.2892473 0.3895695
iters= 73 x1 0.1616096 0.4508569
iters= 74 x1 -0.1927301 0.3543397
iters= 75 x1 0.6356188 0.8283489
iters= 76 x1 0.197559 0.4380598
iters= 77 x1 -0.1480418 0.3456008
iters= 78 x1 1.646555 1.794597
iters= 79 x1 0.7954642 0.8510911
iters= 80 x1 0.2971474 0.4983168

Page 3

R Console
iters= 81 x1 -0.04805876 0.3452062
iters= 82 x1 -1.034113 0.9860542
iters= 83 x1 -0.473758 0.5603549
iters= 84 x1 -0.1085139 0.3652442
iters= 85 x1 -14.61211 14.5036
iters= 86 x1 -12.21643 2.39568
iters= 87 x1 -11.2283 0.9881313
iters= 88 x1 -11.04222 0.1860849
iters= 89 x1 -11.03579 0.006428669
iters= 90 x1 -11.03578 7.559745e-06
> cat("\n Kesimpulan, fs maks/min di X=", x1,"\n")
Kesimpulan, fs maks/min di X= -11.03578
>
> plot(x,fungsi(x),type='l')
>
>

Page 4