File:NumInt-MC.png
De Wikimedia Commons
Salta a la navegació
Salta a la cerca
![File:NumInt-MC.png](https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/NumInt-MC.png/800px-NumInt-MC.png?20060413151358)
Mida d'aquesta previsualització: 800 × 600 píxels. Altres resolucions: 320 × 240 píxels | 640 × 480 píxels | 1.024 × 768 píxels | 1.200 × 900 píxels.
Fitxer original (1.200 × 900 píxels, mida del fitxer: 16 Ko, tipus MIME: image/png)
Informació del fitxer
Dades estructurades
Llegendes
Llegendes
Afegeix una explicació d'una línia del que representa aquest fitxer
Resum
[modifica]DescripcióNumInt-MC.png |
English: numerical intergration with monte carlo. new points are dark blue (navy), old points are skyblue. points/nodes are uniform distributed over the integration interval. the value of the integral tends to 3,32. |
Data | |
Font | created with the help of GNU R, see source below |
Autor | Thomas Steiner |
Permís (Com reutilitzar aquest fitxer) |
Thomas Steiner put it under the GFDL |
Source code
[modifica]R-source code:
a=0.5
b=2
cs=c("red","skyblue","navy","darkgrey")
f<-function(x) {
return( 0.9*sin(9*x^0.6+0.3)+x+0.9 )
}
mc_plot<-function(n,new=1) {
set.seed(6911)
x=seq(a*0.6,b*1.05,length=700)
if (n>0) {
xi=sort((b-a)*runif(n)+a)
} else {
xi=NA
}
Xi=sort((b-a)*runif(new)+a)
pts=sort(c(a,xi,Xi,b))
plot(x,f(x),type="n",ylim=range(f(x),0),xlab="",ylab="")
polygon(c(pts,b,a),c(f(pts),0,0),col=cs[4], border=cs[2],lwd=2)
for (i in xi) {
segments(i,0,i,f(i),col=cs[2],lwd=3)
}
for (i in Xi) {
segments(i,0,i,f(i),col=cs[3],lwd=3)
}
lines(x,f(x),col=cs[1],lwd=3)
##calcualte area (integral)
area=0
for (p in 1:(length(pts)-1) ) {
area <- area + (pts[p+1]-pts[p]) * (f(pts[p+1])+f(pts[p])) / 2
}
text(x=0.45,y=3.2, labels=substitute(integral(f(x)*dx, A, B)%~~% AREA,list(A=a,B=b,AREA=format(area,digits=3))),cex=1.5,col=cs[4],pos=4)
}
png(filename = "NumInt-MC.png", width=1200, height=900, pointsize = 12)
par(bg="grey90",mfrow=c(2,2), oma=c(0,0,3,0), cex.axis=0.85)
mc_plot(n=0)
mc_plot(n=1)
mc_plot(n=2)
mc_plot(n=3,new=5)
title(main="Numerische Integration mit Monte Carlo (Trapezmethode)", outer=TRUE,cex.main=1.9)
dev.off()
![]() |
S'autoritza la còpia, la distribució i la modificació d'aquest document sota els termes de la llicència de documentació lliure GNU versió 1.2 o qualsevol altra versió posterior que publiqui la Free Software Foundation; sense seccions invariants, ni textos de portada, ni textos de contraportada. S'inclou una còpia d'aquesta llicència en la secció titulada GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
![]() ![]() ![]() |
Aquest fitxer està subjecte a la llicència de Creative Commons Reconeixement i Compartir Igual 3.0 No adaptada. | |
| ||
Aquest avís de llicència s'ha afegit a aquest fitxer d'acord amb l'actualització de la llicència GFDL.http://creativecommons.org/licenses/by-sa/3.0/CC BY-SA 3.0Creative Commons Attribution-Share Alike 3.0truetrue |
![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/R_logo.svg/29px-R_logo.svg.png)
Aquesta PNG imatge rasteritzada ha estat creada amb R.
Historial del fitxer
Cliqueu una data/hora per veure el fitxer tal com era aleshores.
Data/hora | Miniatura | Dimensions | Usuari/a | Comentari | |
---|---|---|---|---|---|
actual | 15:13, 13 abr 2006 | ![]() | 1.200 × 900 (16 Ko) | Thire (discussió | contribucions) | {{Information| |Description = numerical intergration with monte carlo. new points are dark blue (navy), old points are skyblue |Source = created with the help of GNU R, see source below |Date = 13 Apr. 2006 |Author = Thomas Steiner |
No podeu sobreescriure aquest fitxer.
Ús del fitxer
No hi ha pàgines que utilitzin aquest fitxer.
Ús global del fitxer
Utilització d'aquest fitxer en altres wikis:
- Utilització a ca.wikipedia.org
- Utilització a de.wikipedia.org
- Utilització a de.wikibooks.org
- Utilització a el.wikipedia.org
- Utilització a es.wikipedia.org
- Utilització a eu.wikipedia.org