Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang
Fakultas : Sains dan Teknologi
Jurusan : Teknik Informatika
Kelas : (B) Calculus
NIM : 230605110046
library(mosaicCalc)
## Loading required package: mosaic
## Registered S3 method overwritten by 'mosaic':
## method from
## fortify.SpatialPolygonsDataFrame ggplot2
##
## The 'mosaic' package masks several functions from core packages in order to add
## additional features. The original behavior of these functions should not be affected by this.
##
## Attaching package: 'mosaic'
## The following objects are masked from 'package:dplyr':
##
## count, do, tally
## The following object is masked from 'package:Matrix':
##
## mean
## The following object is masked from 'package:ggplot2':
##
## stat
## The following objects are masked from 'package:stats':
##
## binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test,
## quantile, sd, t.test, var
## The following objects are masked from 'package:base':
##
## max, mean, min, prod, range, sample, sum
## Loading required package: mosaicCore
##
## Attaching package: 'mosaicCore'
## The following objects are masked from 'package:dplyr':
##
## count, tally
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
## (status 2 uses the sf package in place of rgdal)
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
g <- makeFun(-5*sin(x^2)+3 ~ x)
slice_plot(g(x) ~ x, domain(x = -3:3)) %>%
gf_hline(yintercept = 0, color = "purple") %>%
gf_vline(xintercept = 0, color = "purple")
Bahwa nilax x pada nol adalah…
library(mosaic)
findZeros(g(x) ~ x, xlim = range(-2, 2))
## x
## 1 -1.5805
## 2 -0.8022
## 3 0.8022
## 4 1.5805
library(mosaicCalc)
slice_plot(g(x) ~ x, domain(x=1:50)) %>%
gf_hline(yintercept = 0, color = "red")
library(mosaicCalc)
g <- makeFun(sin(x)~ x)
slice_plot(g(x) ~ x, domain(x = -3:3)) %>%
gf_hline(yintercept = 0, color = "purple") %>%
gf_vline(xintercept = 0, color = "purple")
library(mosaic)
findZeros( 6*x^5-7*x^4 -2*x^3 - 4*x^2 - 3*x - 10 ~ x, xlim=c(-10,10))
## x
## 1 1.8012
library(mosaicCalc)
findZeros( sin(x) - 0.35 ~ x, xlim=range(-20,30) )
## x
## 1 -12.2088
## 2 -9.7823
## 3 -5.9256
## 4 -3.4991
## 5 0.3576
## 6 2.7840
## 7 6.6407
## 8 9.0672
## 9 12.9239
## 10 15.3504
library(mosaicCalc)
findZeros(g(x) ~ x, xlim = range(-1000, 1000))
## x
## 1 -12.5664
## 2 -9.4248
## 3 -6.2832
## 4 -3.1416
## 5 0.0000
## 6 3.1416
## 7 6.2832
## 8 9.4248
## 9 12.5664
library(mosaicCalc)
g <- makeFun(6 + exp(k*t) - 2^(b*t) ~ b, k=0.00035, t=1)
findZeros( g(b) ~ b , xlim=range(-1000, 1000) )
## b
## 1 2.8074
daftar pustaka: https://dtkaplan.github.io/MC2/Modeling/06-operations.html#zero-finding