Turunan dan Perbedaan
ditulis dalam notasi r yang benar, disebelah kiri menunjukkan adalah ekspresi matematika, sedangkan kanan adalah ekspresi terhadap variabel yang akan di ambil turunannya.
ouput yang dihasilkan adalah sebuah fungsi, yang dimana fungsi tersebut mencatumkan argumen semua variabel yang terdapat dalam ekspresi input. untuk menemukan nilai funsi turnan dapat ditemukan dari argumne numerik tertentu.
RUMUS DAN PERBEDAAN NUMERIK
ketika ekspresif relatif sederhana dan terdiri dari fungsi matematika dasar akan sering mengembalikan funngsi yang berisi rumus matematika
examples:
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
##
## Attaching package: 'mosaicCalc'
## The following object is masked from 'package:stats':
##
## D
h <- D(sin(abs(x - 3) ) ~ x)
h
## function (x)
## {
## .e1 <- x - 3
## cos(abs(.e1)) * sign(.e1)
## }
SIMBOL PARAMETER
library(mosaicCalc)
s2 <- D(A * sin(2 * pi * t / P) + C ~ t)
s2( t=3, A=2, P=10, C=4 )
## [1] -0.3883222
fungsi yang dibuat akan berfungsi tetapi pelu di tentukan nilai numerik parameter simbolik saat mengevaluasi fungsi
slice_plot(s2(t, A=2, P=10, C=4) ~ t,
domain(t=range(0,20)))
Derivatif Parsial
Turunan yang dihitung dengan D( ) adalah turunan parsial. Artinya, mereka adalah turunan di mana variabel di sisi kanan ~ diubah dan semua variabel lainnya tetap konstan.
Derivatif kedua
turunan kedua adalan turunan dari turunan. anda dapat menggunakan operator D()
df <- D(sin(x) ~ x)
ddf <- D(df(x) ~ x)
another.ddf <- D(sin(x) ~ x & x)