Nama : Sausan Shalihah Alfirdausi

NIM : 230605110064

Mata Kuliah : Kalkulus

Dosen Pengampu : Prof. Dr. Suhartono,M.Kom

Program Studi : Teknik Informatika

Universitas : Universitas Islam Negeri Malang

Pada artikel kali ini saya akan membahas tentang cara membuat grafik zero finding di RStudio.

library(mosaicCalc)
## Loading required package: mosaic
## Warning: package 'mosaic' was built under R version 4.3.2
## 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

slice_plot()untuk fungsi dari satu variabel. contour_plot()untuk fungsi dua variabel. interactive_plot()yang menghasilkan widget HTML untuk berinteraksi dengan fungsi dua variabel.

Berikut adalah contoh merencanakan fungsi garis lurus:

slice_plot(2*x-5 ~ x, domain(x = range(0, 10)), color='blue')

Pertama kita membuat plot potongan dari fungsi 3x - 5 terhadap x. Lalu domain(x = range(0, 10))` menentukan rentang x dari 0 hingga 10. Sedangkan color=blue memberikan warna biru pada plot.

Untuk gradien dapat dilihat sebagai berikut:

m = 5
b = 2
slice_plot(m * x + b ~ x, domain(x = range(0, 10)), color="green")

Mendefinisikan m sebagai 5 dan b sebagai 2. Membuat plot potongan dari fungsi mx + b terhadap x dengan m = 5 dan b = 2. Domain(x = range(0, 10))` menentukan rentang x dari 0 hingga 10. Color=green memberikan warna hijau pada plot.

A = 5
slice_plot( A * x ^ 2 ~ x,  domain(x = range(0, 3)),  color="pink" )

Membuat plot potongan dari fungsi Ax^2 terhadap x dengan A = 5. Domain (x = range(0, 3))` menentukan rentang x dari 0 hingga 3. Color=pink memberikan warna merah muda pada plot.

slice_plot( cos(t) ~ t, domain(t = range(0,5*pi) ), color='brown')

Membuat plot potongan dari fungsi kosinus cos(t) terhadap t. Domain(t = range(0, 5*pi)) menentukan rentang t dari 0 hingga 5pi. color=brown memberikan warna coklat pada plot.

Setiap baris kode menggunakan fungsi slice_plot dari paket mosaicCalc untuk membuat plot potongan dari berbagai fungsi matematika terhadap variabel tertentu, dan mengatur warna plot dengan parameter color.

Daftar Pustaka https://www.mosaic-web.org/MOSAIC-Calculus/Modeling/06-operations.html