generate_gaussian_quad_points <-
function(quad.n = 10) {
if (quad.n == 10) {
gherm <-
structure(list(
nodes = c(
-3.43615911883774,-2.53273167423279,-1.75668364929988,-1.03661082978951,-0.342901327223705, 0.342901327223705,
1.03661082978951, 1.75668364929988,
2.53273167423279, 3.43615911883774
),
weights = c(
7.64043285523267e-06, 0.00134364574678123,
0.0338743944554811, 0.240138611082315,
0.610862633735326, 0.610862633735326,
0.240138611082315, 0.0338743944554811,
0.00134364574678123, 7.64043285523262e-06
)
),
.Names = c("nodes", "weights"))
}
else if (quad.n == 20) {
gherm <- structure(list(
nodes = c(
-5.38748089001124,-4.60368244955074,-3.94476404011562,-3.34785456738321,-2.78880605842813,-2.25497400208927,-1.73853771211659,-1.23407621539532,-0.737473728545395,-0.245340708300901,0.245340708300901, 0.737473728545395, 1.23407621539532, 1.73853771211659,2.25497400208927, 2.78880605842813, 3.34785456738321, 3.94476404011562,4.60368244955074, 5.38748089001124
),
weights = c(
2.22939364553406e-13,
4.39934099227314e-10, 1.08606937076928e-07, 7.80255647853211e-06,
0.000228338636016354, 0.00324377334223786, 0.0248105208874636,
0.109017206020023, 0.286675505362834, 0.46224366960061, 0.46224366960061,
0.286675505362834, 0.109017206020023, 0.0248105208874636, 0.00324377334223786,
0.000228338636016356, 7.80255647853206e-06, 1.08606937076928e-07,
4.39934099227317e-10, 2.22939364553411e-13
)
), .Names = c("nodes","weights"))
}
else {
cat("quad.n should better be 10 or 20 considering the computing burden. Use 10 instead.\n")
gherm <- generate_gaussian_quad_points(quad.n = 10)
}
return(gherm)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.