text:
# Guidelines for the function gawdis

### Introduction

In this step-by-step guide we will look how the function gawdis() works and to apply it using simple data (either available in the FD package or made up below). The function gawdis(), designed by Pavel Fibich, is an extension of the classic function gowdis() in the package FD (Laliberté, Legendre and Shipley 2014). The function computes dissimilarity between units, usually species, based on multiple types of variables (e.g. quantitative, categorical etc.), usually species’ traits. Hence it can normally be applied to compute multi-trait dissimilarity between species in functional trait ecology studies, but it can be used in other applications as well. The dissimilarity obtained can be computed in order to attain a quasi-identical contribution of individual variables (e.g. traits) or group of associated variables (on variables reflecting similar information, e.g. multiple leaf traits). The dissimilarity is computed by either an analytical approach or through iterations. The function borrows several arguments from gowdis(), with additional ones described below. This includes the option to consider fuzzy and dummy variables (e.g. multiple columns defining a single trait).

We will now load the package gawdis, which you should have previously installed on your computer (it is available on standard CRAN repository). The gawdis package includes the function gawdis() and already loads other packages, such as FD and GA among others"

library(gawdis)
## Loading required package: FD
## Loading required package: ade4
## Loading required package: ape
## Loading required package: geometry
## Loading required package: vegan
## Loading required package: permute
## Loading required package: lattice
## This is vegan 2.5-6
## Loading required package: GA
## Loading required package: foreach
## Loading required package: iterators
## Package 'GA' version 3.2
## Type 'citation("GA")' for citing this R package in publications.
##
## Attaching package: 'GA'
## The following object is masked from 'package:utils':
##
##     de

### The Gower distance

We will start now by looking what the function does, overall. To do this let’s first look at the original function gawdis with the data dummy$trait, which includes invented data for few species and their traits, available in the FD package (gawdis sources the FD package). dummy$trait
##     num1 num2 fac1 fac2 ord1 ord2 bin1 bin2
## sp1  9.0  4.5    A    X    3    2    0    1
## sp2  8.1  6.0    A    Z <NA>    1    0    1
## sp3   NA  2.3    C    Y    5    3    1    1
## sp4  3.2  5.4    B    Z    1    7    0    0
## sp5  5.8  1.2    C    X    2    6   NA    0
## sp6  3.4  8.5    C    Y    2    1    1    1
## sp7  7.5  2.1    B    X    3    2    1    0
## sp8  4.3  6.5 <NA>    Z    1    3    0    1
ex1 <- gowdis(dummy$trait) round(ex1, 3)##just to see only 3 decimals, enough ## sp1 sp2 sp3 sp4 sp5 sp6 sp7 ## sp2 0.218 ## sp3 0.524 0.668 ## sp4 0.674 0.561 0.823 ## sp5 0.529 0.815 0.486 0.484 ## sp6 0.610 0.593 0.278 0.707 0.607 ## sp7 0.448 0.686 0.485 0.558 0.302 0.619 ## sp8 0.407 0.204 0.596 0.239 0.559 0.447 0.703 class(ex1) ## [1] "dist" The data dummy$trait include trait information for 8 species. Some traits are numerical (num1 and num2), some are categorical, i.e. factors (fac1 and fac2, nice names btw.), some semi-quantitative traits, i.e. ordinal traits (ord1 and ord2) and some binary traits (bin1 and bin2). Some traits have NA values. The function gawdis computes the dissimilarity between the 8 species in the dummy$trait, based on all traits available. The function returns a ‘triangular’ distance object, of class dist, which express the (multi-traits) dissimilarity between each pair of species. Value are a scaled between 0 (species are exactly the same) and 1 (species are completely different). Let’s make even a simpler example, by taking only two traits (num2 and bin2) without NA. Let’s see exactly what gawdis is doing. First a dissimilarity is computed for each trait. For the quantitative trait the differences in values between each pair of species are scaled to a maximum value 1, by dividing the dissimilarity values to the maximum possible difference for this trait. For example, when we looked at dummy$trait above, we would see that the sp6 had the highest value for num2 (i.e. 8.5) and sp7 had the lowest (i.e. 2.1). The difference between these two species will be equal to 1. For binary trait (e.g. if a species fly or not, 1 vs. 0), the maximum value is 1, so that there is no need to make such a standardization. Finally, the dissimilarity of the two traits is simply the average of the distances for each individual trait.

distance.num2<-dist(dummy$trait[, "num2", drop=F])/max(dist(dummy$trait$num2))#note the drop=F not to loose the species names in the process# round(distance.num2, 3) ## sp1 sp2 sp3 sp4 sp5 sp6 sp7 ## sp2 0.205 ## sp3 0.301 0.507 ## sp4 0.123 0.082 0.425 ## sp5 0.452 0.658 0.151 0.575 ## sp6 0.548 0.342 0.849 0.425 1.000 ## sp7 0.329 0.534 0.027 0.452 0.123 0.877 ## sp8 0.274 0.068 0.575 0.151 0.726 0.274 0.603 distance.bin2<-dist(dummy$trait$bin2) distance.bin2 ## 1 2 3 4 5 6 7 ## 2 0 ## 3 0 0 ## 4 1 1 1 ## 5 1 1 1 0 ## 6 0 0 0 1 1 ## 7 1 1 1 0 0 1 ## 8 0 0 0 1 1 0 1 distance.twotraits.byhand<-(distance.num2+distance.bin2)/2 distance.twotraits.gowdis<-gowdis(dummy$trait[, c("num2", "bin2")])
plot(distance.twotraits.gowdis, distance.twotraits.byhand)
abline(0, 1)

These simple steps show what the function gawdis does “automatically” for us. Notice that, for the categorical trait the process is similar as for the binary traits. If the species belong to the same category, then the dissimilarity=0, if they belong to different categories, then the dissimilarity=1. For example:

dummy$trait$fac2
## [1] X Z Y Z X Y X Z
## Levels: X Y Z
gowdis(dummy$trait[, "fac2", drop=F])#notice that gowdis wants a matrix, not a vector, here a simple solution to solve this and keep species names ## sp1 sp2 sp3 sp4 sp5 sp6 sp7 ## sp2 1 ## sp3 1 1 ## sp4 1 0 1 ## sp5 0 1 1 1 ## sp6 1 1 0 1 1 ## sp7 0 1 1 1 0 1 ## sp8 1 0 1 0 1 1 1 You can see that sp1 and sp2 have different categories (X and Z), so the dissimilarity is=1. ### Traits contribution and trait weight Let’s now see why we actually need the new function gawdis, in addition to the traditional gowdis. In the example above distance.twotraits.gowdis reflects the dissimilarity of both traits, i.e. multi-trait dissimilarity, while distance.num2 and distance.bin2 reflect the dissimilarity for individual traits. What is the contribution of each single trait to the multi-trait dissimilarity? how much each single trait contribute to the final multi-trait dissimilarity? to answer this we can do, for example, a correlation between the multi-trait dissimilarity with the individual trait dissimilarity: cor(distance.twotraits.gowdis, distance.num2) ## [1] 0.5167754 cor(distance.twotraits.gowdis, distance.bin2) ## [1] 0.8985725 This tells you how much the multi-trait dissimilarity reflects the information of each individual trait. If we look at this example we can see that the binary trait (bin2) is much more correlated to the multi-trait dissimilarity than the quantitative trait (num2), Pearson R=0.89 for the binary trait and R=0.51 for the quantitative. This means that the contribution of the binary trait is much much greater than of the quantitative trait. By the way, categorical/nominal traits will work similarly to binary traits, in general terms. Are we happy with this result? are we happy that when we combine different variables (traits in this case), the multivariable dissimilarity has a far greater contribution from some variables? We think it is rather fair to say that this is not an ideal solution. Luckily the gawdis has an useful argument w, or weight which we can use to modify the contribution of each trait. Remember that the multi-trait dissimilarity is, by default with gawdis, a simple average of the dissimilarity from individual traits. Instead of doing a simple average, we could do a weighted average, in which some traits could have bigger weights. For example, we could reduce to the weight of the binary trait, to reduce its contribution to the multi-trait dissimilarity, and increase the one for the quantitative trait. In the next lines we show how this can be done “by hand” or we could be using directly the argument w in gowdis (notice that we are trying, to start with, to give twice the weight to the binary trait, compared to the quantitative one). See both options below: distance.twotraits.byhand.weighted<-0.67*(distance.num2)+0.33*(distance.bin2) distance.twotraits.gowdis.weighted<-gowdis(dummy$trait[, c("num2", "bin2")], w=c(2, 1))
plot(distance.twotraits.byhand.weighted, distance.twotraits.gowdis.weighted)
abline(0, 1)

By doing this the new multi-trait dissimilarity will be more evenly affected by each trait.

cor(distance.twotraits.gowdis.weighted, distance.num2)
## [1] 0.7454126
cor(distance.twotraits.gowdis.weighted, distance.bin2)
## [1] 0.7300753

Specifically the Pearson correlation is R=0.74 for the binary trait and R=0.73 for the quantitative. This is quite even, good job! What we did is modifying the weight of each trait to modify their contribution to the multi-trait dissimilarity. Cool! But…how do we know which values we have to select for the argument w to allow all traits to have a similar weight? if we have only 2 traits maybe we can try various w values and hope to find some decent combination, and try until we find a decent combination. The thing gets more complicated if we have many traits. Moreover, as we show below there are also other cases more complicated cases.

### The function gawdis: basics

This is where the new function gowdis will get useful. The function looks for the best values for the w argument, to obtain an equal contribution of individual traits.

equalcont <- gawdis(dummy$trait[,c("num2", "bin2")]) ## [1] "Running w.type=analytic" equalcont ## sp1 sp2 sp3 sp4 sp5 sp6 ## sp2 0.13584757 ## sp3 0.19924310 0.33509067 ## sp4 0.42038371 0.39321419 0.61962681 ## sp5 0.63773982 0.77358739 0.43849672 0.38037319 ## sp6 0.36226018 0.22641261 0.56150328 0.61962681 1.00000000 ## sp7 0.55623127 0.69207884 0.35698817 0.29886465 0.08150854 0.91849146 ## sp8 0.18113009 0.04528252 0.38037319 0.43849672 0.81886991 0.18113009 ## sp7 ## sp2 ## sp3 ## sp4 ## sp5 ## sp6 ## sp7 ## sp8 0.73736137 attr(equalcont,"correls") ## num2 bin2 ## 0.7377916 0.7377916 attr(equalcont,"weights") ## num2 bin2 ## 0.6611248 0.3388752 In one step we have a computed a multi-trait dissimilarity in which the contribution of each trait (provided in output of the function, i.e. in “correls”) are basically identical. This was done by finding an ideal w value for each trait (provided in the output of the function, “weights”). Notice that the values are very close to the 2:1 ratio we ‘tried’ above with distance.twotraits.byhand.weighted and distance.twotraits.gowdis.weighted). Actually we ‘tried’ those values because we knew what was already the solution, but otherwise we would have spent some time really trying multiple combinations. Of course the function gawdis can also be used in the exact same way as the original gowdis. For example, if you recall the object ex1 created above with gowdis, and copied again below, now we can do the same with gowdis, just telling that we want to have a similar weight (and hence different contribution) for the different traits. This is the defauls in gowdis and in gawdis this is set by either using w.type =“equal” or by w.type =“user” and then saying W is the same for all traits. ex1 <- gowdis(dummy$trait)
ex1.gaw1 <- gawdis(dummy$trait, w.type ="equal") ## [1] "Running w.type=equal" ex1.gaw2 <- gawdis(dummy$trait, w.type ="user", W=rep(1, 8))
## [1] "Running w.type=user"
plot(ex1, ex1.gaw1)
abline(0, 1)

plot(ex1, ex1.gaw2)
abline(0, 1)

### The function gawdis: analytical vs. iterative approaches

Now that we verified that gawdis works fine, let’s see more more details about the function and its different applications. The solutions provided by the function can be obtained in two ways. The first one is by an analytical solution, using purely a mathematical formulas (see main paper and corresponding supplementary material). This is the approach used by default in the function, as we used to create the object equalcont above. In case of doubts, this approach can be set by using w.type=“analytic”. NOTE that unfortunately this solution cannot be used when there are missing values (NAs).

When there are NAs, even if you set the argument w.type =“analytic” the function will apply a second approach, based on iterations, i.e. it will keep trying several solutions until finding a good one (actually it is based on a fitness improving approach, which gradually improves the output of the results). This will take some time, as multiple alternatives are tested sequentially. It can be obtained by using w.type =“optimized”. The running time will depend, mostly, on the number of species and the number of iterations, which is set by the argument opti.maxiter, by default set to 300. Below we apply both approach to a subset of the dummy$trait data, without NAs analytical<-gawdis(dummy$trait[,c(2,4,6,8)], w.type ="analytic")# it is not needed to add the argument w.type, this is the approach used by default if not defined#
## [1] "Running w.type=analytic"
attr(analytical, "correls")
##      num2      fac2      ord2      bin2
## 0.5350139 0.5350139 0.5350139 0.5350139
attr(analytical, "weights")
##      num2      fac2      ord2      bin2
## 0.2422698 0.2467646 0.3575842 0.1533815
iterations<-gawdis(dummy$trait[,c(2,4,6,8)], w.type ="optimized", opti.maxiter=100)# here we used 'only' 100 iterations, to speed up the process and because with such few species this is likely more than enough# ## [1] "Running w.type=optimized" attr(iterations, "correls") ## num2 fac2 ord2 bin2 ## 0.5349318 0.5354745 0.5338472 0.5360195 attr(iterations, "weights") ## num2 fac2 ord2 bin2 ## 0.2421847 0.2470098 0.3568522 0.1539534 plot(analytical, iterations) Here you see some slight differences in the results, for example in terms of correlations between the dissimilarity of single traits and the multitrait (i.e. “correls”) and the weights finally used for each trait (“weights”). The final results, the dissimilarity values displayed in the plot, also vary just a tiny bit. This is because the iterations are just based on a trial-error approach, which improves with more iterations, but it might “miss” the perfect mathematical solution, and just approach very close to it. Otherwise we can be quite confident that the results using the iteration tend quite well to the ideal results. ### The function gawdis: grouping traits In some cases the datasets we are considering have multiple variables which reflect some partially overlapping or redundant information. For example, many plant trait databases include a lot of leaf traits. This is the case, for example, of the dataset tussock$trait, also available in the FD package. Let’s have a look:

dim(tussock$trait) ## [1] 53 16 head(tussock$trait)
##            growthform  height     LDMC leafN leafP leafS       SLA
## Achi_mill  Semi basal 0.09727 163.1264   3.4 0.310 0.210 15.637656
## Agro_capi  Semi basal 0.19100 302.7657   2.5 0.250 0.180 21.846627
## Anth_odor     Tussock 0.06350 280.2013   2.0 0.240 0.150 24.547661
## Apha_arve  Semi basal 0.04470 185.9606   1.7 0.290 0.180 18.587383
## Arre_elat     Tussock 0.56400 311.9551   2.6 0.256 0.174 20.777386
## Brac_bell Short basal 0.00338 223.5052   1.2 0.330 0.220  6.549107
##           nutrientuptake       raunkiaer          clonality  leafsize dispersal
## Achi_mill   Mycorrhizal      Chamaephyte Clonal belowground 313.51484      Wind
## Agro_capi   Mycorrhizal  Hemicryptophyte Clonal belowground 141.78019      Wind
## Anth_odor   Mycorrhizal  Hemicryptophyte               None 161.43904   Passive
## Apha_arve   Mycorrhizal       Therophyte               None  20.89516   Passive
## Arre_elat   Mycorrhizal  Hemicryptophyte Clonal belowground 805.42883   Passive
## Brac_bell   Mycorrhizal  Hemicryptophyte               None 216.33835      Wind
##           seedmass resprouting        pollination  lifespan
## Achi_mill   0.1600         Yes Hymenoptera (bees) Perennial
## Agro_capi   0.0580         Yes               Wind Perennial
## Anth_odor   0.5600         Yes               Wind Perennial
## Apha_arve   0.1590          No               Self    Annual
## Arre_elat   2.9000         Yes               Wind Perennial
## Brac_bell   0.0524         Yes Hymenoptera (bees) Perennial
head(tussock$trait[, 3:7]) ## LDMC leafN leafP leafS SLA ## Achi_mill 163.1264 3.4 0.310 0.210 15.637656 ## Agro_capi 302.7657 2.5 0.250 0.180 21.846627 ## Anth_odor 280.2013 2.0 0.240 0.150 24.547661 ## Apha_arve 185.9606 1.7 0.290 0.180 18.587383 ## Arre_elat 311.9551 2.6 0.256 0.174 20.777386 ## Brac_bell 223.5052 1.2 0.330 0.220 6.549107 cor(tussock$trait[, 3:7], use = "complete")
##             LDMC      leafN      leafP      leafS        SLA
## LDMC   1.0000000 -0.6848213 -0.6682552 -0.5366135 -0.6417381
## leafN -0.6848213  1.0000000  0.6052319  0.7546005  0.6384765
## leafP -0.6682552  0.6052319  1.0000000  0.7703387  0.6212733
## leafS -0.5366135  0.7546005  0.7703387  1.0000000  0.5966755
## SLA   -0.6417381  0.6384765  0.6212733  0.5966755  1.0000000

In the dataset there are 5 leaf traits, likely measured on the same leaves, and quite correlated between them. In this case we do suggest to create groups of traits, using the argument groups. Why it is so? the problem is that if many trait provide a similar information, actually all these leaf traits are very much correlated. So the information could become too prominent in the multi-trait dissimilarity. Let’s see all this, with a step-by-step approach. Basically the same test can be found in the de Bello et al. (2021, Methods in Ecology and Evolution, doi: https://doi.org/10.1111/2041-210X.13537 ). First we slightly reduce the number of traits, just for simplicity, and because the dataset included some very unbalanced categorical traits (with too few entries for a number of categories). Then we need to log-transform some of the quantitative traits, and previously we checked that height, seedmass and leafS were the one needing log-transformation. NOTE that, by the way, that if we do not use log-transformation is applied trait with abnormal trait distribution will have bigger contribution, simply because they have greater variance (see Pavoine et al. 2009 Oikos).

tussock.trait<-tussock$trait[, c("height", "LDMC", "leafN","leafS", "leafP", "SLA", "seedmass", "raunkiaer", "pollination", "clonality", "growthform")] tussock.trait.log<-tussock.trait#some traits needed log-tranformation, just creating a matrix to store the new data tussock.trait.log$height<-log(tussock.trait$height) tussock.trait.log$seedmass<-log(tussock.trait$seedmass) tussock.trait.log$leafS<-log(tussock.trait$leafS) colnames(tussock.trait.log) ## [1] "height" "LDMC" "leafN" "leafS" "leafP" ## [6] "SLA" "seedmass" "raunkiaer" "pollination" "clonality" ## [11] "growthform" Let’s first compute the simple Gower distance with gowdis. We we will also compute the dissimilarity only on leaf traits and correlate it to the multi-trait dissimilarity: #straightgowdis<-gowdis(tussock.trait.log) straightgowdis.2<-gawdis(tussock.trait.log, w.type = "equal", silent = T)#we compute 'normal' gower with the new function because it provides more results #plot(straightgowdis, straightgowdis.2)# if you want to check that the results are the same cors.gow<-attr(straightgowdis.2,"correls") cors.gow[12]<-mantel(straightgowdis.2, gowdis(tussock.trait.log[, 2:6]), na.rm=T)$statistic
names(cors.gow)[12]<-"leaves"
cors.gow
##      height        LDMC       leafN       leafS       leafP         SLA
##   0.2023004   0.5083692   0.4522899   0.4944064   0.4292520   0.3729605
##    seedmass   raunkiaer pollination   clonality  growthform      leaves
##   0.2604944   0.5941643   0.4528619   0.3237053   0.4668307   0.5889437

We can see that the heightest contribution (across the cors.gow values) were obtained for a categorical traits, raunkier life form and the combination of leaf traits (‘leaves’). This is simply because with w.type = “equal” the multi-trait dissimilarity is an average of the dissimilarity for single traits, so leaf traits are represented 5/11 times in this average, a disproportional effect with respect to other traits, right? We could say that, although there are differences between the leaf traits, they are the same TYPE of trait, counted 5 times, when combining the traits.

The problem is not solved by using PCoA analyses, as suggested by the current literature (with the idea to reduce the number of traits and synthesize correlated traits into some multivariate axis). Here is a clear example:

testpcoa<-dbFD(cailliez(straightgowdis.2), tussock$abun)###checking how many PCoA axes are retained ## FRic: Dimensionality reduction was required. The last 40 PCoA axes (out of 51 in total) were removed. ## FRic: Quality of the reduced-space representation = 0.6098694 ## CWM: When 'x' is a distance matrix, CWM cannot be calculated. pcoaaxes<-dudi.pco(cailliez(straightgowdis.2), scannf = FALSE, nf = 11) gowdis.PCoA<-dist(pcoaaxes$li)
sum(pcoaaxes$eig[1:11])/sum(pcoaaxes$eig)#how much variability the axes explain
## [1] 0.6098694
#contribution of traits on the combined dissimilarity, done by hand#
cors.pcoa<-vector()
for(i in 1:dim(tussock.trait.log)[2]){
cors.pcoa[i]<-mantel(gowdis.PCoA, gowdis(as.data.frame(tussock.trait.log[, i])), na.rm=T)$statistic } cors.pcoa[12]<-mantel(gowdis.PCoA, gowdis(tussock.trait.log[, 2:6]), na.rm=T)$statistic
names(cors.pcoa)<-c(colnames(tussock.trait.log), "leaves")#contributions of traits to the overall multi-trait dissimilarity
cors.pcoa
##      height        LDMC       leafN       leafS       leafP         SLA
##   0.2167067   0.4735296   0.4298086   0.4453686   0.3826323   0.3335101
##    seedmass   raunkiaer pollination   clonality  growthform      leaves
##   0.2993358   0.5685074   0.4333025   0.3334111   0.4647386   0.5419322

Let’s just, for simplicity, focus only on the final result of this part. If we look at the object cors.pcoa we can see very similar contribution of traits, as obtained with the previous approach cors.gow. So, in very simplified terms, the PCoA approach does not help very much to solve the case of many redundant/correlated traits, as the correlated traits still have, altogether, a superior contribution to the overall multi-trait dissimilarity.

The function gawdis could help, but only if we define groups. If we do not, let’s see what happen:

gaw.nogroups<-gawdis(tussock.trait.log, w.type = "optimized", opti.maxiter = 200)#there are NAs so the iteration approach is the only possible
## [1] "Running w.type=optimized"
cors.gaw<-attr(gaw.nogroups,"correls")
cors.gaw[12]<-mantel(gaw.nogroups, gowdis(as.data.frame(tussock.trait.log[, 2:6])), na.rm=T)\$statistic
names(cors.gaw)[12]<-"leaves"
cors.gaw
##      height        LDMC       leafN       leafS       leafP         SLA
##   0.4055155   0.4177844   0.4131561   0.4247188   0.3975590   0.4098910
##    seedmass   raunkiaer pollination   clonality  growthform      leaves
##   0.4100540   0.4199441   0.4120476   0.4178879   0.4102192   0.5518203

Now, if we look at the cors.gaw, we can see the function, apparently, successfully accomplished its mission to obtain a quasi-equal contribution of each single trait. But, the solution provided this is not a good solution neither, because leaves, altogether, have a much bigger contribution that other traits (0.54 while other traits are around ~0.41). Again, the function considered each leaf trait separately, so that altogether leaf traits will have a greater contribution.

A better solution can be obtained by saying that all leaf traits belong to a given group. Thus gawdis will first compute a dissimilarity for all leaf traits together and then try to get for this leaf-combined dissimilarity the same weight as for other traits. Let’s see it:

colnames(tussock.trait.log)
##  [1] "height"      "LDMC"        "leafN"       "leafS"       "leafP"
##  [6] "SLA"         "seedmass"    "raunkiaer"   "pollination" "clonality"
## [11] "growthform"
gaw.groups<-gawdis(tussock.trait.log, w.type = "optimized", opti.maxiter = 200, groups.weight=T, groups = c(1,2, 2, 2, 2, 2, 3, 4, 5, 6, 7))#there are NAs so the iteration approach is the only possible
## [1] "Running w.type=optimized on groups=c(1,2,2,2,2,2,3,4,5,6,7)"
## [1] "Traits inside the group were weighted - optimized."
cors.gaw.gr<-attr(gaw.groups,"correls")
cors.gaw.gr[12]<-attr(gaw.groups,"group.correls")[2]
names(cors.gaw.gr)[12]<-"leaves"
cors.gaw.gr
##      height        LDMC       leafN       leafS       leafP         SLA
##   0.4327884   0.3994160   0.3078365   0.3138122   0.2873285   0.2923132
##    seedmass   raunkiaer pollination   clonality  growthform      leaves
##   0.4292953   0.4455988   0.4449050   0.4584679   0.4434833   0.4408140

Now if we look at the cors.gaw.gr we can see single leaf traits have lower contribution than other traits, but in combination (leaves), they have a comparable contribution! Of course it will be difficult to decide when and in which case group of traits should be defined. But we think that if traits are measured in the same organ and provide, to a good extent, some overlapping information, then they should be considered as a group.

### The function gawdis: fuzzing coding and dummy variables

The function gawdis can be also useful in the case of traits coded as dummy variables or, as a specific case of this, as fuzzy variables. Let’s first create this new trait matrix, tall.

bodysize<-c(10, 20, 30, 40, 50, NA, 70)
carnivory<-c(1, 1, 0, 1, 0,1, 0)
red<-c(1, 0, 0.5, 0, 0.2, 0, 1)
yellow<-c(0, 1, 0, 0, 0.3, 1, 0)
blue<-c(0, 0, 0.5,1, 0.5, 0, 0)
colors.fuzzy<-cbind(red, yellow, blue)
names(bodysize)<-paste("sp", 1:7, sep="")
names(carnivory)<-paste("sp", 1:7, sep="")
rownames(colors.fuzzy)<-paste("sp", 1:7, sep="")
tall<-as.data.frame(cbind(bodysize, carnivory, colors.fuzzy))
tall
##     bodysize carnivory red yellow blue
## sp1       10         1 1.0    0.0  0.0
## sp2       20         1 0.0    1.0  0.0
## sp3       30         0 0.5    0.0  0.5
## sp4       40         1 0.0    0.0  1.0
## sp5       50         0 0.2    0.3  0.5
## sp6       NA         1 0.0    1.0  0.0
## sp7       70         0 1.0    0.0  0.0

The object tall includes 3 traits for 7 species, bodysize (quantitative), carnivory (binary/categorical) and color. The last one is represented by 3 columns, one for each basic color (yellow, red, blue). For example the first species (sp1), is red, so it gets 1 in the the ‘red’ column and 0 in the others. This type of variables, defined by multiple columns is called dummy variable, and in this specific case fuzzy coding, because the value in each column can be different from 0 and 1, with the sum over the 3 columns being equal to 1. For more information see (https://www.univie.ac.at/arctictraits/traitspublic_fuzzyCoding.php, https://stattrek.com/multiple-regression/dummy-variables.aspx).

We surely cannot apply gowdis() to this type of matrices, because the function will “think” there is a total of 5 traits, since the matrix contains 5 columns, and will treat each of the 3 columns for colors as independent traits, resulting in a higher contribution of this single trait. Moreover the function gets a bit ‘crazy’ with this type of variables. Let’s see why. We can use, to start with, the function only on the colors traits:

round(gowdis(tall[, 3:5]), 3)
##       sp1   sp2   sp3   sp4   sp5   sp6
## sp2 0.667
## sp3 0.333 0.667
## sp4 0.667 0.667 0.333
## sp5 0.533 0.467 0.200 0.333
## sp6 0.667 0.000 0.667 0.667 0.467
## sp7 0.000 0.667 0.333 0.667 0.533 0.667

We can appreciate that these results are not correct. Species 1 (sp1) was red, Species 2 was yellow. If for simplicity we think that each column means a completely different color, then we do expect the dissimilarity between these two species should be equal to 1. This was not the case. Similarly sp3 is half red and so the dissimilarity with sp1 should equal to 0.5. But this is not the case. What can we do to solve this? Do simply the following, i.e. divide the dissimilarity by the maximum dissimilarity value:

round(gowdis(tall[, 3:5])/max(gowdis(tall[, 3:5])), 3)
##     sp1 sp2 sp3 sp4 sp5 sp6
## sp2 1.0
## sp3 0.5 1.0
## sp4 1.0 1.0 0.5
## sp5 0.8 0.7 0.3 0.5
## sp6 1.0 0.0 1.0 1.0 0.7
## sp7 0.0 1.0 0.5 1.0 0.8 1.0

So if we want to combine this trait (color, defined by 3 columns in the tall), we need first to compute the dissimilarity for color this way, and then combine it with the other traits, for example with an average. For example, if we want a simple average of the dissimilarity for the 3 traits:

dissim.bodysize<-gowdis(tall[, "bodysize", drop=F])
dissim.carnivory<-gowdis(tall[, "carnivory", drop=F])
dissim.colour<-gowdis(tall[, 3:5])/max(gowdis(tall[, 3:5]))
dall<-list(as.matrix(dissim.bodysize), as.matrix(dissim.carnivory), as.matrix(dissim.colour))
mean.dissim.all<-as.dist(apply(simplify2array(dall), c(1, 2), mean, na.rm=T), 2)
round(mean.dissim.all, 3)
##       sp1   sp2   sp3   sp4   sp5   sp6   sp7
## sp1 0.000
## sp2 0.389 0.000
## sp3 0.611 0.722 0.000
## sp4 0.500 0.444 0.556 0.000
## sp5 0.822 0.733 0.211 0.556 0.000
## sp6 0.500 0.000 1.000 0.500 0.850 0.000
## sp7 0.667 0.944 0.389 0.833 0.378 1.000 0.000

This is all a bit time consuming to do it line by line. There is other function in the package ‘ade4’, i.e. the function dist.ktab() (together with the associated functions prep.fuzzy() and ktab.list.df()). However this solution is quite time consuming as well, as it requires a number steps and coding lines (you can surely try, just in case). Ideally we can thus also solve this problem with the function gawdis(), possibly in a simple way. The solution is obtained by defining all columns belonging to a given trait (like colors above) to a certain group, as we saw above and then setting the argument fuzzy=c(2) (fuzzy argument allows to specify which groups should be fuzzy coded, here these are only the last three columns in group 2). Let’s see this now.

gawdis(tall, w.type="equal", groups =c(1, 1, 2, 2, 2), fuzzy=c(2))
## [1] "Running w.type=equal on groups=c(1,1,2,2,2)"
## [1] "Running w.type=equal on groups=c(1,1)"
## [1] "Running w.type=equal on groups=c(2,2,2)"
##           sp1       sp2       sp3       sp4       sp5       sp6
## sp2 0.5416667
## sp3 0.5833333 0.7916667
## sp4 0.6250000 0.5833333 0.5416667
## sp5 0.8166667 0.7250000 0.2333333 0.5416667
## sp6 0.5000000 0.0000000 1.0000000 0.5000000 0.8500000
## sp7 0.5000000 0.9583333 0.4166667 0.8750000 0.4833333 1.0000000


text:
# Thread: JeffM! Your help needed in solving for 3 unknowns in a linear equation

1. ## JeffM! Your help needed in solving for 3 unknowns in a linear equation

I tried my best or may be I tried it the wrong way as linear algebra is not the topic I know

I need to solve for p, q, and r in the following linear equation, where each of these variables represents a probability measure whose sum is 1

$4p + 2q + r = 2.5$

$p + q + r = 1$

2. ## Re: JeffM! Your help needed in solving for 3 unknowns in a linear equation

In order to solve for three unknowns you need three equations...

3. ## Re: JeffM! Your help needed in solving for 3 unknowns in a linear equation

Agree! 3 variables , 3 equations.

4. ## Re: JeffM! Your help needed in solving for 3 unknowns in a linear equation

There are an infinite number of solutions. This can be shown by assuming that r is know and, since it is a probability, falls withing certain limits (in this particular case between 1/6 and 1/2 inclusive because p and q must be between 0 and 1 inclusive) and solve the equation for p and q in terms of r.

5. ## Re: JeffM! Your help needed in solving for 3 unknowns in a linear equation

You could, for example, solve for, say, p and q in terms of r. Multiply the second equation by 2 to get 2p+ 2q+ 2r= 2. Now subtract that from the first equation, eliminating q: 2p- r= 0.5 so that p= r/2+ 1/4.

format: plain


text:
Question

Analytical Chemistry

4. (2 pts.) Imagine that the following compounds were added as samples to your TLC plate. Evaluate their relative polarities as you did above and predict which of the two would have the lower Rf and which would have the higher Rf. Include an explanation in your response

Verified

### Question 43728

Analytical Chemistry

4.The formation of C2H;CI(g) is an exothermic reaction (AH° = –72.6 kJ/molpxn). Thefollowing two step reaction mechanism is proposed:
Step 1:C,H4(g) + HCI(g) → C,H;*(g) + C-(g)Slow step
Step 2: C,H;*(g) + Cl-(g) → C;H;CI(g)Fast step
A.) Write the rate law for the reaction that is consistent with the reaction mechanism above.
B.) Identify an intermediate in the reaction mechanism
above. Using the axes provided, draw a curve that shows energy changes that occur during the progress of the reaction. The curve should illustrate both proposed two-step mechanisms and the enthalpy change of the reaction.

### Question 43727

Analytical Chemistry

The two reaction diagrams here represent the same reaction: one without a catalyst an done with a catalyst. Estimate the activation energy for each process, and identify which one involves a catalyst.13.

### Question 43726

Analytical Chemistry

Consider the four reaction-energy diagrams below:
Identify the two diagrams that could represent a catalyzed and an un catalyzed reaction pathway for the same reaction. Indicate which of the two diagrams represents the catalyzed reaction pathway for the reaction.

### Question 43725

Analytical Chemistry

Nitrogen dioxide, NO2(g), is produced as a by-product of the combustion of fossil fuels ininternal combustion engines. At elevated temperatures NO2(g) decomposes according to theequation below.11.
2 \mathrm{NO}_{2}(g) \rightarrow 2 \mathrm{NO}(g)+\mathrm{O}_{2}(g)
The concentration of a sample of NO2(g) is monitored as it decomposes and is recorded onthe graph directly below. The two graphs that follow it are derived from the original data.
A.) What order is the following reaction?
B.) Write the rate law for the decomposition of NO2(g).
C.) Consider two possible mechanisms for the decomposition reaction.
i.) Is the rate law described by the mechanism I shown below consistent with therate law you wrote in part (b)? Justify your answer.
Step 1: NO2(g) + NO2(g) → NO(g) + NO3(g)slow
Step 2: NO3(g) → NO(g) + O2(g)fast
ii.) Is the rate law described by mechanism II shown below consistent with the rate law you wrote in part (b) ? Justify your answer.
Step 1:NO2(g) + NO2(g)N„O4(g)fast equilibrium
Step 2:N204(9) → 2 NO(g) + O2(g)slow

### Question 43724

Analytical Chemistry

What is the expected rate law for the overall reaction shown below?
Step 1:NO(g) + Br,(g) 2 NOBr2(g)(fast)
Step 2:NOBR,(g) + NO2 NO (g) + 2 Br(g)(slow)

### Question 43723

Analytical Chemistry

2NO2(g) + F2(g) →
NO, and F2 can react to produce NO,F as represented above. A proposed mechanism for this reaction has two elementary steps, as shown below.reaction that is consistent with the proposed mechanism.Write a rate law for the overall
NO, + F, → NO,F + F(slow)
NO2 + FNO,F(fast)

### Question 43722

Analytical Chemistry

What is the rate law for the overall reaction that is consistent with the proposed mechanism?
HOBR,(g) + HBr(g) –2 НОBr(q)(FAST)
HBr(g)+ O2(g)НОBr:(g)(SLOW)
2 HOBR(g) → H2O2(g) + Br2(g)(FAST)

### Question 43721

Analytical Chemistry

\mathrm{Na}_{2} \mathrm{C}_{37} \mathrm{H}_{34} \mathrm{~N}_{2} \mathrm{~S}_{3} \mathrm{O}_{9}+\mathrm{OCl}^{-} \rightarrow \text { products }
Blue food coloring can be oxidized by household bleach (which contains OCI-) to form colorless products, as represented by the equation above. A student used a spectrophotometer set at a wavelength of 635 nm to study the absorbance of the food coloring over time during the bleaching process. In the study, bleach is present in large excess so that the concentration of OCl- is essentially constant throughout the reaction.The students use data from the study to generate the graphs below.

### Question 43720

Analytical Chemistry

5. Hydrogen reacts with nitrogen monoxide to form dinitrogen monoxide (laughing gas)according to the equation:
\mathrm{H}_{2}(g)+2 \mathrm{NO}(g) \rightarrow \mathrm{N}_{2} \mathrm{O}(g)+\mathrm{H}_{2} \mathrm{O}(g)
Determine the rate law, the rate constant, and the orders with respect to each reactant from the following data:

### Question 43719

Analytical Chemistry

. Ozone in the upper atmosphere is depleted when it reacts with nitrogen oxides. The rates of the reactions of nitrogen oxides with ozone are important factors in deciding how significant these reactions are in the formation of the ozone hole over Antarctica. One such reaction is the combination of nitric oxide, NO, with ozone, O3:
\mathrm{NO}(g)+\mathrm{O}_{3}(g) \rightarrow \mathrm{NO}_{2}(g)+\mathrm{O}_{2}(g)
Use the data to determine the rate law and the rate constant for the reaction at 25°C.


text:
Krishna
0

Step 1: Note down the given values

Step 2: Set up the formula for arc length.

NOTE: The formula is arc length (s) = \frac{\theta}{360} *C

Where, s = Arc length

C = Circumference

\theta = Central Angle

Step 3: Plug the circumference of the circle into the formula.

Step 4: Plug the value of the arc’s central angle into the formula.

Step 5: Simplify the equation to find the arc length

NOTE: Use multiplication and division to simplify the equation.

EXAMPLE: arc length (s) = \frac{\theta}{360} *C

=  \frac{105}{360}*20

Arc\ lengths=5.8333


text:
# Re: [tlaplus] Using a Division Operator with TLAPS

I'm able to use the above operator with Z3. Thank you for your help.

Hans

On Wed, Dec 4, 2019 at 6:02 PM Saksham Chand <schand@xxxxxxxxxxxxxxxxx> wrote:
The following should work and invoke Z3:

divide_by_two(n) == n \div 2

On Wed, Dec 4, 2019 at 5:47 PM <hjh2bs@xxxxxx> wrote:
Hi,

I'm working on proving an algorithm using TLAPS that requires dividing integers by two. I understand there's no support for real numbers/division in the backend provers, so I am using an operator:

divide_by_two(n) == CHOOSE k \in Nat: n=2*k

The problem I'm running into is when trying to prove properties using the above operator with set expressions. The following example demonstrates this:

EXTENDS Integers, TLAPS, FiniteSetsdivide_by_two(n) == CHOOSE k \in Nat: n=2*kCONSTANTS NVARIABLES xInit == x = divide_by_two(N)PositiveInvariant == x >= 0ASSUME NumberAssumption == N \in {2,4,6,8,10}THEOREM PositiveDivisionProperty == Init => PositiveInvariant  <1> SUFFICES ASSUME Init               PROVE  PositiveInvariant    OBVIOUS  <1> QED    BY NumberAssumption DEF Init, PositiveInvariant, divide_by_two

The backend provers are unable to prove the above theorem. SMT specifically times out and increasing the timeout doesn't appear to help.

Changing the assumption to:

ASSUME NumberAssumption == N = 10

will successfully prove the theorem. Are the backend provers able to work with 'CHOOSE' _expression_ in conjunction with sets? Is there anything wrong with how I'm specifying the assumption? The actual algorithm will require using the division operator with a few 'min'/'max' operators, which may also complicate the proof process, so I'm wondering if TLAPS is able to prove these sort of algorithms that require arithmetic.

Best,
Hans

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.


text:
## FANDOM

1,861 Pages

Discount, tax, and tip word problems
Description
Exercise Name: Discount, tax, and tip word problems
Math Missions: 7th grade (U.S.) Math Mission, Arithmetic essentials Math Mission, Pre-algebra Math Mission, Mathematics I Math Mission
Types of Problems: 2

The Discount, tax, and tip word problems exercise appears under the 7th grade (U.S.) Math Mission, Arithmetic essentials Math Mission, Pre-algebra Math Mission and Mathematics I Math Mission. This exercise works word problems that include the concepts of markups and markdowns.

## Types of Problems

There are two types of problems in this exercise:

1. Marking up an amount: This problem provides a situation where an amount is being marked up by some percentage. The user is asked to find either the total or the amount of the mark up.
2. Marking down an amount: This problem provides a situation where an amount is being marked down by some percentage. The user is asked to find either the amount of mark down or the final amount.

## Strategies

Knowledge of using percentage in word problem is sufficient for being able to perform this exercise, especially for attaining accuracy badges and speed badges.

1. The mark up problems can ask for the amount of tax, the price with tax, the amount of mark up, or the price with mark up.
2. The mark down problems can ask for the amount of discount, or the final price after discount.
3. When performing mark up, multiply by ${1+r%}$ instead of multiplying by ${r%}$ and then adding on.
4. When performing mark down, multiply by ${1-r%}$ instead of multiplying by ${r%}$ and then subtracting off.

## Real-life Applications

1. Fractions, decimals, and percents are used in many sports such as basketball to determine how many field goals the player has made over how many they missed.
2. Decimals are very common in shopping. Price tags, food labels, and receipts all contain decimals.
3. At gas pumps, decimals are used to show how much gas is pumped and much it costs per gallon.


text:
This content will become publicly available on August 1, 2022

Coherent $$\mathrm{J}/\psi$$ and $${\uppsi '}$$ photoproduction at midrapidity in ultra-peripheral Pb–Pb  collisions at $$\sqrt{s_{\mathrm {NN}}}~=~5.02$$ TeV
Abstract The coherent photoproduction of $$\mathrm{J}/\psi$$ J / ψ and $${\uppsi '}$$ ψ ′ mesons was measured in ultra-peripheral Pb–Pb collisions at a center-of-mass energy $$\sqrt{s_{\mathrm {NN}}}~=~5.02$$ s NN = 5.02  TeV  with the ALICE detector. Charmonia are detected in the central rapidity region for events where the hadronic interactions are strongly suppressed. The $$\mathrm{J}/\psi$$ J / ψ is reconstructed using the dilepton ( $$l^{+} l^{-}$$ l + l - ) and proton–antiproton decay channels, while for the $${\uppsi '}$$ ψ ′   the dilepton and the $$l^{+} l^{-} \pi ^{+} \pi ^{-}$$ l + l - π + π - decay channels are studied. The analysis is based on an event sample corresponding to an integrated luminosity of about 233 $$\mu {\mathrm{b}}^{-1}$$ μ b - 1 . The results are compared with theoretical models for coherent $$\mathrm{J}/\psi$$ J / ψ and $${\uppsi '}$$ ψ ′ photoproduction. The coherent cross section is found to be in a good agreement with models incorporating moderate nuclear gluon shadowing of about 0.64 at a Bjorken- x of around $$6\times 10^{-4}$$ 6 × 10 - 4 , such as the EPS09 parametrization, however none of the models is able to fully more »
Authors:
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; more »
Award ID(s):
Publication Date:
NSF-PAR ID:
10313942
Journal Name:
The European Physical Journal C
Volume:
81
Issue:
8
ISSN:
1434-6044
1. A bstract The inclusive production of the J/ ψ and ψ (2S) charmonium states is studied as a function of centrality in p-Pb collisions at a centre-of-mass energy per nucleon pair $$\sqrt{s_{\mathrm{NN}}}$$ s NN = 8 . 16 TeV at the LHC. The measurement is performed in the dimuon decay channel with the ALICE apparatus in the centre-of-mass rapidity intervals − 4 . 46 < y cms < − 2 . 96 (Pb-going direction) and 2 . 03 < y cms < 3 . 53 (p-going direction), down to zero transverse momentum ( p T ). The J/more »
2. A bstract The inclusive J/ ψ elliptic ( v 2 ) and triangular ( v 3 ) flow coefficients measured at forward rapidity (2 . 5 < y < 4) and the v 2 measured at midrapidity (| y | < 0 . 9) in Pb-Pb collisions at $$\sqrt{s_{\mathrm{NN}}}$$ s NN = 5 . 02 TeV using the ALICE detector at the LHC are reported. The entire Pb-Pb data sample collected during Run 2 is employed, amounting to an integrated luminosity of 750 μ b − 1 at forward rapidity and 93 μ b − 1 at midrapidity.more »
3. A bstract Inclusive J /ψ yields and average transverse momenta in p-Pb collisions at a center-of-mass energy per nucleon pair $$\sqrt{s_{\mathrm{NN}}}$$ s NN = 8 . 16 TeV are measured as a function of the charged-particle pseudorapidity density with ALICE. The J /ψ mesons are reconstructed at forward (2 . 03 < y cms < 3 . 53) and backward ( − 4 . 46 < y cms < − 2 . 96) center-of-mass rapidity in their dimuon decay channel while the charged-particle pseudorapidity density is measured around midrapidity. The J /ψ yields at forward and backward rapiditymore »
4. Abstract The measurement of the azimuthal-correlation function of prompt D mesons with charged particles in pp collisions at $$\sqrt{s} =5.02\ \hbox {TeV}$$ s = 5.02 TeV and p–Pb collisions at $$\sqrt{s_{\mathrm{NN}}} = 5.02\ \hbox {TeV}$$ s NN = 5.02 TeV with the ALICE detector at the LHC is reported. The $$\mathrm{D}^{0}$$ D 0 , $$\mathrm{D}^{+}$$ D + , and $$\mathrm{D}^{*+}$$ D ∗ + mesons, together with their charge conjugates, were reconstructed at midrapidity in the transverse momentum interval $$3< p_\mathrm{T} < 24\ \hbox {GeV}/c$$ 3 < p T < 24 GeV / c and correlated with charged particlesmore »
5. Abstract The production of $$\phi$$ ϕ mesons has been studied in pp collisions at LHC energies with the ALICE detector via the dimuon decay channel in the rapidity region $$2.5< y < 4$$ 2.5 < y < 4 . Measurements of the differential cross section $$\mathrm{d}^2\sigma /\mathrm{d}y \mathrm{d}p_{\mathrm {T}}$$ d 2 σ / d y d p T are presented as a function of the transverse momentum ( $$p_{\mathrm {T}}$$ p T ) at the center-of-mass energies $$\sqrt{s}=5.02$$ s = 5.02 , 8 and 13 TeV and compared with the ALICE results at midrapidity. The differential cross sections at $$\sqrt{s}=5.02$$more »


text:
Algebra 1

$g=3.5$
$1.06g-3 = 0.71$ Add 3 to both sides. $1.06g = 3.71$ Multiply both sides by 100. $106g = 371$ Divide both sides by 106. $g = \frac{371}{106} = \frac{7}{2} = 3.5$


text:
Seminar
Speaker
Nava Gaddam (University of Utrecht, Netherlands)
Date & Time
Wed, 03 March 2021, 15:00 to 16:30
Venue
ICTS virtual seminar
Abstract

In this talk, I will show that there is a remarkable phase of quantum gravity (which we will call the 'black hole eikonal' phase in contrast to the flat space eikonal phase). It is defined by gravitational collisions near the horizon, and dominated by centre of mass energies E >> \gamma M_Pl, with \gamma = M_Pl/M_BH. This regime captures gravitational scattering with impact parameters smaller than the Schwarzschild radius. Scattering amplitudes are unitary suggesting a resolution of the information paradox; I will sketch the explicit derivation of the 2-2 amplitude for massless scalars, non-perturbatively in \gamma. Owing to the low energies of collisions, there are no firewalls experienced by infalling observers. A consequence of these results is that the information paradox is an emergent one at low energies and does not require detailed ultra-violet physics for a resolution.


text:
# Help: THERMOS Projects and Maps

The home page does not do very much; the important parts are

• The top bar, containing
• Settings, which will let you change how THERMOS shows your name, change your password, and select whether you want to receive emails from the system
• Help, which you are looking at right now
• Forum, which links to a discussion forum in which you can ask questions
• Logout which is self-explanatory
• A description of your user account level (in some cases), which shows how much of your limited server resources you have used up,
• The button to create a new project, and
• A list of projects underneath, each displayed as a box with a link in it.

## 2. Project pages

From the home page you can reach the project page for each project, which will look something like this:

Project pages always have a bar at the top, whose controls pertain to the project:

N User(s)
The users button lets you see and perhaps control who has access to the project. More on this below.
Delete
This will delete the project entirely.
Leave
This will remove you from the project, but not delete it. You will no longer be able to access the project. The button is only displayed if there are other users than you on the project.
Map +
This button lets you add a map. More on this below.
LIDAR
This lets you add LIDAR to the project, which will make better maps. More on this below too.

Some of these controls will not be shown if you do not have permission to change the project.

If you click on the users button on a project page you can change who can view a project. However you must be the project admin to do this. Whoever creates a project is an admin for that project, and any admin can make any other user an admin.

In the project participants box you can add, remove, promote and demote users on the project. The ↑ and ↓ buttons promote a user to or from being a project admin. The red cross button will remove a user, and the add button will add users whose usernames / email addresses are listed in the box on the left.

Finally at the bottom is a tickbox to make a project globally visible. If you tick this box, then you can share the URL for the project with anyone and they will be able to see the maps and networks it contains (whether or not they have a login on the THERMOS system).

People who don't know the URL will not be able to see the project, but URLs are not hard to guess as they contain sequentially generated numbers, so you should not rely on this to secure any important data.

## 4. Creating maps

You can create a map from OpenStreetMap data, or from your own GIS data.

Once a map is created, its contents are fixed and will not change.

You can modify things from the map within the network editor, but this change is only in the network problem you have created, not in the underlying map.

To start making a map click Map + on the project page. This will take you to a step-by-step process for map creation.

The first page is just for a name and description, but it's useful to show a picture as it illustrates something else:

### 4.1. Spatial data

After the name page you must acquire spatial data for the map. There are two options here:

1. Use OpenStreetMap (OSM)

### 4.2. Using OpenStreetMap

Using OSM is easiest, but you are restricted by how well mapped the area you're interested in is. Some OSM tags (the OSM term for data fields) are used when loading data:

• landuse building and amenity tags are used to populate THERMOS' category field
• the height and building:levels tags are used as inputs to the demand model, if LIDAR is not available
• the name field is used to populate THERMOS' name field. This is often a street or building name.

The application will only let you load a certain area from OSM at once. If the area you have selected is too large, you won't be able to continue to the next step.

### 4.3. Using GIS data

You can do this by dragging and dropping data in one of the supported formats into the dotted rectangle. When you do this a progress bar will be shown for each file as it is uploaded. Once they are uploaded and each row is green, you can continue. All the geometry GIS files you upload will be added into the map.

If the GIS files contain linestring or multilinestring data, these geometries will be used for potential pipe routes. All other geometries will be assumed to be buildings.

If you have no linestring or multilinestring data, the box to Also import roads from OpenStreetMap will be checked; in this case OSM is queried for roads and footpaths in the same area to use for pipe routes. Otherwise, the box will be unchecked, but you can check it yourself if you want to use OSM paths as well as what is in your GIS data.

### 4.4. Using fields in GIS data

Your GIS data may contain other fields than just geometry. Some of these may have special meaning that THERMOS could make use of, and you might also want to keep some to view in the network editor.

This is made possible on the next page after uploading GIS data, which will show a list of each field in each input GIS file, and allow you to instruct THERMOS about what the field means.

### 4.5. Field meanings

The meaning choices for buildings have these effects:

Annual heat demand (kWh/yr)
A value for annual demand will be used in preference to any other estimate. Otherwise, a benchmark estimate will be used if available, or the built-in regression model otherwise.
Max. heat demand (kWh/yr)
An upper bound to apply to the modelled annual heat demand. If the demand estimation model is used, and it produces an annual demand above this value, this value will be used instead.
Min. heat demand (kWh/yr)
A lower bound to apply to the modelled annual heat demand. If the demand estimation model is used, and it produces an annual demand below this value, this value will be used instead.
Annual cooling demand (kWh/yr)
A value for annual cooling demand will be used in preference to a cooling estimate.
Peak cooling demand (kW)
A value for peak cooling demand will be used in preference to an estimate.
Peak heat demand (kW)
A value for peak demand will be used in preference to any other estimate. Otherwise, the peak/base ratio will be applied to the demand if available, or the - build in regression model otherwise.
Building height (m)
A value for building height will be used in preference to any LIDAR data on the server.

Building height will improve the quality of any demand estimates produced from the built-in regression model.

Fallback building height (m)
A value for building height to be used if LIDAR data on the server and the building height field are missing.
Floor area (m2)
A value for floor area will be used in benchmark-based estimates. If no value is provided, a value will be estimated from the building geometry and height (if known).
Heat benchmark (kWh/yr)
A constant benchmark - this is used in combination with the variable benchmark term. If a building has associated benchmarks and no specified demand, demand will be estimated as this constant plus floor area times the variable benchmark.
Heat benchmark (kWh/m2/yr)
A variable benchmark per floor area.
Cooling benchmark (kWh/yr)
A constant benchmark - this is used in combination with the variable benchmark term. If a building has associated benchmarks and no specified demand, demand will be estimated as this constant plus floor area times the variable benchmark.
Cooling benchmark (kWh/m2/yr)
A variable benchmark per floor area.
Peak/base ratio
If present, and no peak demand value is known, the peak demand will be estimated as the annual demand (converted into kW) multiplied with this factor.

Otherwise, a built in regression will be used.

Connection count
The number of end-user connections the building contains. This affects only the application of diversity curves within the model.
Identity (text)
An identifier - these are stored on the buildings in the database and visible in downloaded GIS files.
User-defined field (any)
Any other field you want to keep, like a classification, address, etc.
Residential (logical)
A logical value, represented either as a boolean column, or the text values yes, no, true, false, 1 or 0. If available, this will improve the quality of built-in regression model results. Otherwise, this is assumed to be true.
Building group (any value)
Any buildings which have the same value in this field (except null or an empty string) will be grouped together. Buildings in a group must all be connected to a network at once, or not at all.

For paths the meanings are just for Identity and User-defined field.

The Guess button in the top right will give fields meanings based on the field name.

This is done by taking the field name, lowercasing it, replacing any series of non-alphanumeric characters with a single hyphen, and then using the following table to choose a meaning:

Normalized name Guessed meaning
annual-demand Annual heat demand (kWh/yr)
maximum-annual-demand Max. heat demand (kWh/yr)
minimum-annual-demand Min. heat demand (kWh/yr)
annual-cooling-demand Annual cooling demand (kWh/yr)
cooling-peak Peak cooling demand (kW)
peak-demand Peak heat demand (kW)
height Building height (m)
fallback-height Fallback building height (m)
floor-area Floor area (m2)
benchmark-c Heat benchmark (kWh/yr)
benchmark-m Heat benchmark (kWh/m2/yr)
cooling-benchmark-c Cooling benchmark (kWh/yr)
cooling-benchmark-m Cooling benchmark (kWh/m2/yr)
peak-base-ratio Peak/base ratio
connection-count Connection count
identity Identity (text)
residential Residential (logical)
group Building group (any value)

If you press the Guess button with the control key help down on the keyboard, every non-matched field will be passed through as a user-defined field.

### 4.6. Check LIDAR coverage

When creating a map from OSM or GIS data THERMOS will use any LIDAR information it has to try and determine building size. This will improve the quality of the model's heat demand estimates.

THERMOS takes LIDAR from two places

1. A list of LIDAR files associated with the project
2. A list of LIDAR files that are available for all projects

The map shows where the map is to cover in blue, any project-specific LIDAR areas in green, and any other LIDAR In pink.

At this stage if you have some LIDAR that covers the area you are mapping and it isn't already covered, uploading that LIDAR will help THERMOS' demand model with its estimates.

### 4.7. Other parameters

Once you have checked and uploaded any LIDAR, you're nearly there. You will see a section like the above, in which you can enter a heating degree days number to calibrate the demand model, and choose whether to set up some initial building groups.

#### 4.7.1. Heating degree days

The THERMOS demand model bases its predictions on building size and shape, but these need to be calibrated geographically using heating degree days (HDD) for the area. THERMOS will try and estimate an HDD value using data from Eurostat (more details here) if it can. Otherwise you will need to find your own value.

#### 4.7.2. Automatic building groups

The THERMOS network can put buildings into groups. Either every building in a group gets connected or none does. You can create and change groups yourself using the network editor.

The option here lets you set them up automatically in the map by the path they are connected to. You can either group by road segment, or (if using GIS data) any field that is on the paths. Grouping by road segment will make all buildings which get connected to the same segment of road belong to the same group. A segment of road is any section which does not have a junction in it with another road.

Grouping by another field simply groups together all buildings for which their connected road has the same value in the given field.

By clicking the LIDAR button on a project page, you reach the project's LIDAR management page. This is another way to manage the LIDAR data associated with a project, similar to the LIDAR screen in the map creation process.

Any LIDAR data you add on this page will be used when running demand estimates for newly created maps (old maps are not affected by adding new LIDAR).

## 6. Managing saves

Each time you save or run the model a new network problem is saved on the server. These problems do not replace one another, so old saves are still available.

Normally maps are displayed on the project page like this:

Each row shows the status of the most recent network problem that has a given name within this map. On the rows you can see a few indicators

• On the left the run status is shown.

A tick means that this specific save has been optimised, a spinning THERMOS icon shows it's running, and anything else indicates that save has not been run. If it contains a solution, the solution is from a previous save.

When the spinning icon is shown, you can click on it to cancel the job before it has finished.

• The Name is what is used to relate versions together


text:
Unfolding the mystery of proteins

Share this post:

U.S. Patent #8,423,339: Visual analysis of a protein folding process
Patent Issued: April 16, 2013
Inventors: Laxmi Parida, Ruhong Zhou

What is patent #8,423,339? By Laxmi Parida, Manager, IBM Computational Genomics Group.

Proteins do just about everything in our cells. And those functions, from hormones transport to muscle contraction and much more, are determined by the order and arrangement of protein building blocks, amino acids. Patent #8,423,339 gives scientists a way to break down that folding process – which happens in the fraction of a blink of an eye – to understand why proteins fold (and mis-fold) into certain shapes.

In nature, amino acids in a cell bind together and form a specifically shaped protein. How does this happen? We’re still trying to figure that out. It even has its own paradox, Levinthal’s Paradox, stating that the folding can’t be random (even though it seems that way) because it’s too complicated.

We know what proteins are made of, but since we can’t see how proteins fold in nature, we have to simulate them. And we’ve been simulating protein folding since before Blue Gene/L in 1999. Our patent uses the data from these simulations to find and understand the paths the amino acids take during the folding process.

The tough thing about finding patterns in the process of protein folding is that everything in the data could potentially be a pattern. So, we have to hunt for informative combinations of values that surface again and again – not necessarily in tandem, in the process of folding.

 Visualization of the varying landscape of patterns as a protein folds

These simulations that create 3D models generate massive amounts of data. But our pattern discovery technique works at the level of the simulator, from workstation to supercomputer. It efficiently combs the data to find these invariant combinatorial subsets, which could provide valuable insight into the folding process.

Knowing how proteins fold or why they mis-fold will help us understand how cells work and don’t work. Say, in the case of bovine spongiform encephalopathy (mad cow disease). By understanding the process that created the mis-shapen prion, we could possibly cure or eradicate it, or any other such disease.

IBM has led in total U.S. patents for 21 year in a row in 2013. Read more about patents like #8,423,339, here.

Previous Post

Next Post

More stories

A new supercomputing-powered weather model may ready us for Exascale

In the U.S. alone, extreme weather caused some 297 deaths and $53.5 billion in economic damage in 2016. Globally, natural disasters caused$175 billion in damage. It’s essential for governments, business and people to receive advance warning of wild weather in order to minimize its impact, yet today the information we get is limited. Current […]

Continue reading

DREAM Challenge results: Can machine learning help improve accuracy in breast cancer screening?

Breast Cancer is the most common cancer in women. It is estimated that one out of eight women will be diagnosed with breast cancer in their lifetime. The good news is that 99 percent of women whose breast cancer was detected early (stage 1 or 0) survive beyond five years after […]

Continue reading

Computational Neuroscience

New Issue of the IBM Journal of Research and Development   Understanding the brain’s dynamics is of central importance to neuroscience. Our ability to observe, model, and infer from neuroscientific data the principles and mechanisms of brain dynamics determines our ability to understand the brain’s unusual cognitive and behavioral capabilities. Our guest editors, James Kozloski, […]

Continue reading


text:
Can we simulate a actuator with a very strong torque with a PID controller

I use gazebo to simulate a robot arm. To control its joints, I use PID controllers. As you might know, PID are sometimes pretty hard to tune and this is the case for a robotic arm. To avoid any tuning, and because I don't need the PID values to be realistic, I set to zero the derivative and integral parameters, increase a lot the proportional gain and add a lot of damping in my joints. By doing this, I can get a well working arm but only if I disable the gravity.

My question is the following. Do you have an idea how I could simulate a very strong actuator with not necessarily realistic parameters?

EDIT 1: Setting the integral and derivative gain is stupid. The integral gain helps in correcting the effect of the gravity. The derivative gain counters the loss of stability and speed due to the integral gain.

This question somehow leads to another. Do you know what tuning do the robotic arm manufacturer (big arms for car industry for example). I guess that this arm use actuators with a very strong torque and a low maximum speed which reduces the need of tuning.

EDIT 2: More info on my setup. I use gazebo 6, with ODE. The robot description is in SDF. I control the robot with a model plugin. As a PID controler I use the PID class from the common library of gazebo and get directly the JointControler associated to the model.

Let say that I would like actuators very robust without any tuning needed. This way I could have a simulation WITH dynamics (by opposition to the SetPosition method). Do you think it is possible ?

• Would the offline programming techniques suit what you're after? For example: easy-rob.com/uploads/media/rds.pdf Mar 19 '16 at 0:17
• Your question does not make much sense. The gazebo motor simulation is likely a simulation of an ideal motor (a torque source only) unless you have intentionally added a more complex one in. Perhaps some more information on what you are trying to accomplish would help. Mar 19 '16 at 6:53
• @hauptmech: What gazebo motor simulation are you talking about. The only way to actuate a joint is to use PID Controller. And if you want it to work, you need to tune it. Mar 19 '16 at 18:10
• @SteveO: interesting paper, I'll check a deeper sight on it. The implementation of the realistic dynamic simulation looks however pretty hard. Mar 19 '16 at 18:44
• @debzsud There's a lot of ways to use gazebo. More info on what API's you are using or anything like that will get you a better answer. Mar 20 '16 at 8:59

What you're asking for cannot be accomplished with a PID controller. As I understand your question, you want to be able to choose PID gains that would always produce a "good" trajectory, without tuning. You said it's alright if the motor output is unrealistic, i.e. the motors are "very strong" therefore can produce unlimited torque. However, you cannot escape the fact the your system has inherent dynamics. The response of the joint will always be affected by its inertia and damping, so unless you set those values to zero your response will change as they change. Since a robotic arm with more than 1 joint is nonlinear, inertia and apparent damping due to centrifugal and Coriolis effects will be changing constantly.

More Explanation

First, you seem to have some misunderstanding of how a PID controller works. A really simplistic description would be, given you want to get to some position $$x_d$$ and speed $$v_d$$:

• the proportional term: the farther I am from $$x_d$$, the harder I push toward $$x_d$$
• the derivative term: the slower/faster I am than $$v_d$$, the harder I push to speed up/slow down
• the integral term: gee, all this pushing I've been doing hasn't gotten me much closer to $$x_d$$, I should push harder in that direction

Yes, the derivative term can help to reduce the oscillations introduced by the integral term, but that is not its purpose.

PID controllers are a great example of classical control, and are very useful because they can be tuned experimentally without knowing the exact mathematical model of the system you want to control. With some clever tuning you can make it so that the PID controller gives you a reasonable response for a small range of parameters, allowing them to work with nonlinear systems or linear time-variant systems, but there are two qualifying statements there: the parameter range has to be small and the controller has to be tuned. The parameter variation for multi degree of freedom robotic arms can be quite large (e.g. your inertia could double or halve in value) so achieving what you want without tuning at all is very difficult.

Possible Solutions

1. Turn off gravity and move your arm really slowly (i.e. large derivative gain relative to your proportional gain). The nonlinearities of robotic arms mostly come from dynamic coupling between joints, moving slowly should keep them really small.

2. Manually program the trajectories of each joint in the sim (fudging the dynamics). Let's say you're starting from angular position $$\theta_0$$ and you want to get to $$\theta_d$$. You could program the joints so that when they get a command to move to $$\theta_d$$ they follow a specific trajectory, for example $$\theta(t) = \theta_0 + (\theta_d - \theta_0)(1 - e^{-t/\tau})(1 + t/\tau))$$ will give you a smooth trajectory with no overshoot from the initial to the final position. Just adjust $$\tau$$ until it's as fast or slow as you like. The only problem with this method is that if you interrupt it during its motion it will look weird due to discontinuity.

Industrial robot controllers (and most "real" robot arm controllers) will have a feedforward term to remove the effect of gravity. Often called gravity compensation. You noticed how necessary this is when you disabled gravity...

Check your chain of libraries for an artificial limit being set on the joint effort (torque).

You might take a look at moveit! to see if it helps you. Otherwise you are going to have to take the time to learn a bit of robotics (and controls) math.

• Sometimes there's no shorter paths to the goal: you ought to read a book, debzsud ;) Jul 20 '16 at 18:57

I can get a well working arm but only if I disable the gravity.

It seems to me you are not using feedback linearizing approach with your PID controller. Remember PD and PID work only with linear models. If you have no uncertainties in your model which is what you are looking for by saying "an ideal motor", then PD works very well. Once you add uncertainties in your model then you need to utilize PID to overcome the steady state error.

• Well, good point. The integral gain actually prevents the arm to fall down. I still have problems to tune it, or the joints converge much to slow to their targets, or the arm stops before reaching the targets. My question is more: is there a way to mathematically/programmatically cheat (using unrealistic values or chunck of code) and be sure to get actuators that converge fast enough and precisely to their targets? Mar 19 '16 at 18:13
• I got your point CroCo, but I'd rather tone down your sentence "Remember PD and PID work only with linear models". That's not true: PID work great with nonlinear plants too. That has been their fortune in many applications. This happens because the high open-loop gain helps reduce the effects of nonlinearities and uncertainties in the closed-loop system, allowing even a linear compensator to deliver acceptable performance when applied to nonlinear plants. Just say that feedback linearization and/or I term will help PID work better. Jul 20 '16 at 18:51
• @Ugo, thanks for the info. I will double check it but it seems to me even though increasing gains will reduce errors, it is impractical due to saturation phenomenon. Jul 20 '16 at 22:51
• @CroCo you're definitely right about saturation, something that is always there 'cause purely linear plants do not exist in nature, actually. Further, high gains will drive the system more toward instability, of course. My argument was thus only very general to highlight that even though nature is nonlinear, a linear controller does its job pretty well - in the operative conditions we can profitably determine. Jul 21 '16 at 7:26


text:
# Ideal and Non- Ideal Solutions

## Ideal and Non- Ideal Solutions

Liquid-liquid solutions can be classified into ideal and non-ideal solutions on the basis of Raoult’s law

### Ideal solution

An ideal solution is a solution which always obeys Raoult’s law under all conditions of temperature and pressure.
Characteristics of ideal solution
1.Should obey Raoult’s law
i. e. $P_A = P_A^O \chi _A$ & $P_B = P_B^O \chi _B$
2. $\Delta H_{mix}=0$
3. $\Delta V_{mix}=0$

Characteristic Curve:

When a graph is plotted between V. P. & M. F. then a straight line is obtained for ideal solution

Condition:
Ideal solution is obtained when the intermolecular force existing between the particles of A, existing between the particles of B & existing between the particles of A & B are nearly the same.
Example
• Methanol + Ethanol
• Benzene + Toulene
• Heptane + Octane

Formula
When both A and B are volatile
$P_A = P_A^O \chi _A$
$P_B = P_B^O \chi _B$
$P_S = P_A + P_B$
So,
$P_S = P_A^O \chi _A + P_B^O \chi _B$
When A is volatile and B is non – volatile
$P_A = P_A^O \chi _A$
$P_B = 0$
$P_S = P_A + P_B$
$P_S = P_A^O \chi _A$

### Non -Ideal solution

Non - ideal solutions are those solutions which do not always obey Roault’s law.
Non - ideal solution are of two types:-
 Non - ideal solution showing ‘+’ Deviation from Roault’s law Non - ideal solution showing ‘-‘ Deviation on from Raoult’s law These are the solution in which the partial vapour pressure of a component ($P_A$) is more than the expected value ($P_A^O \chi _A$) Characteristic: (i) $\Delta H_{mix} > 0$ Such solution are endothermic i. e. they absorb heat from the surrounding & therefore they appear to be cool when mixed. (ii) $\Delta V_{mix} > 0$ Condition: It is observed when the force of attraction between A & B particles is less than the fore of attraction.existing between the particles of A and the particles of B. Eg: Ethanol + Cycbhexane In order to mix cyclohexane & Ethanol the hydrogen bonding in Ethanol needs to be broken. Breaking of hydrogen bonds require energy which is obtained from the surrounding. Thus, the mixture appears to be cool when mixed. The intermolecular force existing between Ethanol & Cyvbhexane is weaker than the hydrogen bonding in Ethanol. Due to decrease in the inter molecular force the inter particle distance increases & the volume is increased. Thus $\Delta V_{mix} > 0$ with increase in temperature the solubility increases. The partial vapour pressure of a component ($P_A$) is less than the expected value ($P_A^O \chi _A$) Characteristic: (i) $\Delta H_{mix} < 0$ Such solutions are endothermic and they lose heat to the surrounding thus they become hot when mixed. (ii) $\Delta V_{mix} < 0$ Condition: It is observed when the inter molecular force existing between the particles of A & B is greater than the force of attraction existing the particles of A or the particles of B. Eg: Chloroform + acetone When chloroform & acetone mixed then hydrogen is formed between them to formation of hydrogen bonding energy is lost to the surrounding the mixture appears hot. The intermolecular force existing between chloroform acetone is greater the intermolecular force exist in either chloroform molecules or acetone molecule. Due increases in the intermolecular force the interparticle –e decreases and hence volume also decreases. Thus $\Delta V_{mix} < 0$ with increase in temperature the solubility decreases

## ZEOTROPIC MIXTURE OR CONSTANT BOILING MIXTURE

• These are the mixtures which have same composition both in liquid state as well as in vapour state i.e. xA = yA & xB = yB
• These are the mixtures whose components boil at a fixed temperature. Thus, the components of Azeotropic mixture cannot be separated by the fractional distillation.
Types of Azeotropic mixture:-
 Minimum Boiling Azeotropic Maximum Boiling Azeotropic Those soln which show +ve deviation from Raoult’s law form minimum boiling Azeotrope   Eg: 95% Ethanol + 5% water Those soln which show -ve deviation from Roault’s law from maximum boiling Azeotropes. Eg: 68% HNO3 + 32% water.


text:
Loading....

Resistance

The property of substance by virtue of which it opposes the flow of current through it is known as the resistance.

Formula of resistance

For a conductor if l = length of a conductor A = area of cross-section of conductor, n = number of free electrons per unit volume in conductor, τ = relaxation time, then resistance of conductor,

where ρ = resistivity of the material of conductor.

Unit and dimension Its SI unit is V/A or (Ω). Also 1 ohm = 109 emu of resistance. Its dimension is [ML2 T–3A–2].

Dependence of resistance

The resistance of a conductor depends upon the following factors:
• Length of the conductor: Resistance of a conductor is directly proportional to its length, i.e., R  l and inversely proportional to its area of cross section, i.e., R  1/A.
• Temperature: For a conductor, Resistance  temperature
If R0 = resistance of conductor at 0°C
Rt = resistance of conductor at t°C
and α, β = temperature co-efficient of resistance
then Rt = R0 (1 + αt + βt2) for t > 300°C and Rt = R0 (1 + αt) for t ≤ 300°C or

If R1 and R2 are the resistances at t1°C and t2°C, respectively, then .

The value of α is different at different temperature. Temperature coefficient of resistance averaged over the temperature range t1°C to t2°C is given by which gives R2 = R1[1 + α (t2t1)]. This formula gives an approximate value.


text:
# directinput keyboard ?

This topic is 4095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi there, i cant seem to get the keyboard to work under directinput (i am using vb.net) Here is my code that i have already simplified, to try and isolate the problem. I get an error message on the setcooperativelevel line that says: ------------------------------------- An unhandled exception of type 'Microsoft.DirectX.DirectInput.InputException' occurred in microsoft.directx.directinput.dll Additional information: Error in the application. ------------------------------------- Imports Microsoft.DirectX.DirectInput Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Dim _device As Device Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() MyBase.Show() _device = New Device(SystemGuid.Keyboard) _device.SetCooperativeLevel(Me, CooperativeLevelFlags.Background Or CooperativeLevelFlags.NonExclusive) _device.SetDataFormat(DeviceDataFormat.Keyboard) 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container() Me.Text = "Form1" End Sub #End Region End Class [Edited by - chosendl on March 1, 2007 1:34:18 PM]

##### Share on other sites
Try calling Show() on the form before setting up the device. I seem to recall having a similar problem some time ago.

##### Share on other sites
Hi there thanx for the response, but it doesn't seem to have helped. I put in MyBase.show() directly before the create device.
I edited my original post so that you can see this.

Any other ideas... Anyone?

##### Share on other sites
I am not getting much response here, perhaps people dont like looking through alot of code, so here are just two lines:

_device = New Device(SystemGuid.Keyboard)
_device.SetCooperativeLevel(Me, CooperativeLevelFlags.Background Or CooperativeLevelFlags.NonExclusive)

The set cooperative line generates a directinput.dll exception and i dont know why! Can anyone help?

##### Share on other sites
Quote:
 Original post by chosendlHi there thanx for the response, but it doesn't seem to have helped. I put in MyBase.show() directly before the create device.I edited my original post so that you can see this.Any other ideas... Anyone?

Well, you called MyBase.Show, but you used Me as the top-level control in your call to SetCooperativeLevel. Try calling Show on your form.

##### Share on other sites
Tried that, still a problem. This problem is occuring with any input device that i try using directinput for. I found a complete direct input keyboard class written in c#, so converted it to vb, and it gave the error message, but the c# version worked!
However, i use vb and have no intention of starting c#, so this is completely useless.
Perhaps somebody could post a small class where they have successfully initialized direct input , so that i can compare it to my own code.

##### Share on other sites
can you do a try/catch around where the error occurred and get a more detailed error description?

i dont know about VB but C#:
try{//code}            catch (Direct3DXException ex)//or DirectXException{  MessageBox.Show(ex.Message);}

##### Share on other sites
error message = "Error in the application"
error string = "E_Handle" (whatever that means!)

##### Share on other sites
go to the DirectX Control panel (either in the windows Control Panel or in the start menu) and set it to use the Debug version of Direct3D...

also, in the "Managed" tab make sure that the DirectInput version that you are using is set to debug mode also...

if you're using managed (i guess you are) and Visual studio, go to the project properties and check the unmanaged debugging box...

run in debug mode and check the output window...

i would just fiddle around with the CoopLvlFlags you have set and find out if its that

• 12
• 9
• 13
• 41
• 15


text:
1. ## derivative!

for f(x)=x*[1-4/(x+3)]

what would be the easier way to solve this?
put x into each equation then find derivative?

2. Originally Posted by nuclear123
for f(x)=x*[1-4/(x+3)]

what would be the easier way to solve this?
put x into each equation then find derivative?
$f(x) = x\left(1 - \frac{4}{x + 3}\right)$

$= x\left[1 - 4(x + 3)^{-1}\right]$.

Now use the product rule.

$f'(x) = x\left[1 - 4(x + 3)^{-1}\right]' + \left[1 - 4(x + 3)^{-1}\right](x)'$

$= x \cdot 4(x + 3)^{-2} + \left[1 - 4(x + 3)^{-1}\right]\cdot 1$

$= \frac{4x}{(x + 3)^2} + 1 - \frac{4}{x + 3}$.


text:
# Hyperbolic space

Last updated

In mathematics, hyperbolic space of dimension n is the unique simply connected, n-dimensional Riemannian manifold of constant sectional curvature equal to -1. It is homogeneous, and satisfies the stronger property of being a symmetric space. There are many ways to construct it as an open subset of ${\displaystyle \mathbb {R} ^{n}}$ with an explicitly written Riemannian metric; such constructions are referred to as models. Hyperbolic 2-space, H2, which was the first instance studied, is also called the hyperbolic plane.

## Contents

It is also sometimes referred to as Lobachevsky space or Bolyai–Lobachevsky space after the names of the author who first published on the topic of hyperbolic geometry. Sometimes the qualificative "real" is added to differentiate it from complex hyperbolic spaces, quaternionic hyperbolic spaces and the octononic hyperbolic plane which are the other symmetric spaces of negative curvature.

Hyperbolic space serves as the prototype of a Gromov hyperbolic space which is a far-reaching notion including differential-geometric as well as more combinatorial spaces via a synthetic approach to negative curvature. Another generalisation is the notion of a CAT(-1) space.

## Formal definition and models

### Definition

The ${\displaystyle n}$-dimensional hyperbolic space or Hyperbolic ${\displaystyle n}$-space, usually denoted ${\displaystyle \mathbb {H} ^{n}}$, is the unique simply connected, ${\displaystyle n}$-dimensional complete Riemannian manifold with a constant negative sectional curvature equal to -1. The unicity means that any two Riemannian manifolds which satisfy these properties are isometric to each other. It is a consequence of the Killing–Hopf theorem.

### Models of hyperbolic space

To prove the existence of such a space as described above one can explicitly construct it, for example as an open subset of ${\displaystyle \mathbb {R} ^{n}}$ with a Riemannian metric given by a simple formula. There are many such constructions or models of hyperbolic space, each suited to different aspects of its study. They are isometric to each other according to the previous paragraph, and in each case an explicit isometry can be explicitly given. Here is a list of the better-known models which are described in more detail in their namesake articles:

• Poincaré half-plane model: this is the upper-half space ${\displaystyle \{(x_{1},\ldots ,x_{n})\in \mathbb {R} ^{n}:x_{n}>0\}}$ with the metric ${\displaystyle {\tfrac {dx_{1}^{2}+\cdots +dx_{n}^{2}}{x_{n}^{2}}}}$
• Poincaré disc model: this is the unit ball of ${\displaystyle \mathbb {R} ^{n}}$ with the metric ${\displaystyle 4{\tfrac {dx_{1}^{2}+\cdots +dx_{n}^{2}}{(1-(x_{1}^{2}+\cdots +x_{n}^{2}))^{2}}}}$. The isometry to the half-space model can be realised by a homography sending a point of the unit sphere to infinity.
• Hyperboloid model: In contrast with the previous two models this realises hyperbolic ${\displaystyle n}$-space as isometrically embedded inside the ${\displaystyle (n+1)}$-dimensional Minkowski space (which is not a Riemannian but rather a Lorentzian manifold). More precisely, looking at the quadratic form ${\displaystyle q(x)=x_{1}^{2}+\cdots +x_{n}^{2}-x_{n+1}^{2}}$ on ${\displaystyle \mathbb {R} ^{n+1}}$, its restriction to the tangent spaces of the upper sheet of the hyperboloid given by ${\displaystyle q(x)=-1}$ are definite positive, hence they endow it with a Riemannian metric which turns out to be of constant curvature -1. The isometry to the previous models can be realised by stereographic projection from the hyperboloid to the plane ${\displaystyle \{x_{n+1}=0\}}$, taking the vertex from which to project to be ${\displaystyle (0,\ldots ,0,1)}$ for the ball and a point at infinity in the cone ${\displaystyle q(x)=0}$ inside projective space for the half-space.
• Klein model: This is another model realised on the unit ball of ${\displaystyle \mathbb {R} ^{n}}$; rather than being given as an explicit metric it is usually presented as obtained by using stereographic projection from the hyperboloid model in Minkowski space to its horizontal tangent plane (that is, ${\displaystyle x_{n+1}=1}$) from the origin ${\displaystyle (0,\ldots ,0)}$.
• Symmetric space: Hyperbolic ${\displaystyle n}$-space can be realised as the symmetric space of the simple Lie group ${\displaystyle \mathrm {SO} (n,1)}$ (the group of isometries of the quadratic form ${\displaystyle q}$ with positive determinant); as a set the latter is the coset space ${\displaystyle \mathrm {SO} (n,1)/\mathrm {O} (n)}$. The isometry to the hyperboloid model is immediate through the action of the connected component of ${\displaystyle \mathrm {SO} (n,1)}$ on the hyperboloid.

## Geometric properties

### Parallel lines

Hyperbolic space, developed independently by Nikolai Lobachevsky, János Bolyai and Carl Friedrich Gauss, is a geometrical space analogous to Euclidean space, but such that Euclid's parallel postulate is no longer assumed to hold. Instead, the parallel postulate is replaced by the following alternative (in two dimensions):

• Given any line L and point P not on L, there are at least two distinct lines passing through P which do not intersect L.

It is then a theorem that there are infinitely many such lines through P. This axiom still does not uniquely characterize the hyperbolic plane up to isometry; there is an extra constant, the curvature K < 0, which must be specified. However, it does uniquely characterize it up to homothety, meaning up to bijections which only change the notion of distance by an overall constant. By choosing an appropriate length scale, one can thus assume, without loss of generality, that K = −1.

### Euclidean embeddings

The hyperbolic plane cannot be isometrically embedded into Euclidean 3-space by Hilbert's theorem. On the other hand the Nash embedding theorem implies that hyperbolic n-space can be isometrically embedded into some Euclidean space of larger dimension (4 for the hyperbolic plane).

When isometrically embedded to a Euclidean space every point of a hyperbolic space is a saddle point.

### Volume growth and isoperimetric inequality

The volume of balls in hyperbolic space increases exponentially with respect to the radius of the ball rather than polynomially as in Euclidean space. Namely, if ${\displaystyle B(r)}$ is any ball of radius ${\displaystyle r}$ in ${\displaystyle \mathbb {H} ^{n}}$ then:

${\displaystyle \mathrm {Vol} (B(r))=\mathrm {Vol} (S^{n-1})\int _{0}^{r}\sinh ^{n-1}(t)dt}$

where ${\displaystyle S^{n-1}}$ is the total volume of the Euclidean ${\displaystyle (n-1)}$-sphere of radius 1.

The hyperbolic space also satisfies a linear isoperimetric inequality, that is there exists a constant ${\displaystyle i}$ such that any embedded disk whose boundary has length ${\displaystyle r}$ has area at most ${\displaystyle i\cdot r}$. This is to be contrasted with Euclidean space where the isoperimetric inequality is quadratic.

### Other metric properties

There are many more metric properties of hyperbolic space which differentiate it from Euclidean space. Some can be generalised to the setting of Gromov-hyperbolic spaces which is a generalisation of the notion of negative curvature to general metric spaces using only the large-scale properties. A finer notion is that of a CAT(-1)-space.

## Hyperbolic manifolds

Every complete, connected, simply connected manifold of constant negative curvature 1 is isometric to the real hyperbolic space Hn. As a result, the universal cover of any closed manifold M of constant negative curvature 1, which is to say, a hyperbolic manifold, is Hn. Thus, every such M can be written as Hn/Γ where Γ is a torsion-free discrete group of isometries on Hn. That is, Γ is a lattice in SO+(n,1).

### Riemann surfaces

Two-dimensional hyperbolic surfaces can also be understood according to the language of Riemann surfaces. According to the uniformization theorem, every Riemann surface is either elliptic, parabolic or hyperbolic. Most hyperbolic surfaces have a non-trivial fundamental group π1=Γ; the groups that arise this way are known as Fuchsian groups. The quotient space H²/Γ of the upper half-plane modulo the fundamental group is known as the Fuchsian model of the hyperbolic surface. The Poincaré half plane is also hyperbolic, but is simply connected and noncompact. It is the universal cover of the other hyperbolic surfaces.

The analogous construction for three-dimensional hyperbolic surfaces is the Kleinian model.

## Related Research Articles

In differential geometry, a Riemannian manifold or Riemannian space(M, g), so called after the German mathematician Bernhard Riemann, is a real, smooth manifold M equipped with a positive-definite inner product gp on the tangent space TpM at each point p.

In mathematics, hyperbolic geometry is a non-Euclidean geometry. The parallel postulate of Euclidean geometry is replaced with:

In mathematics, an isometry is a distance-preserving transformation between metric spaces, usually assumed to be bijective. The word isometry is derived from the Ancient Greek: ἴσος isos meaning "equal", and μέτρον metron meaning "measure".

In Riemannian geometry, the sectional curvature is one of the ways to describe the curvature of Riemannian manifolds. The sectional curvature Kp) depends on a two-dimensional linear subspace σp of the tangent space at a point p of the manifold. It can be defined geometrically as the Gaussian curvature of the surface which has the plane σp as a tangent plane at p, obtained from geodesics which start at p in the directions of σp. The sectional curvature is a real-valued function on the 2-Grassmannian bundle over the manifold.

In mathematics, particularly in the theories of Lie groups, algebraic groups and topological groups, a homogeneous space for a group G is a non-empty manifold or topological space X on which G acts transitively. The elements of G are called the symmetries of X. A special case of this is when the group G in question is the automorphism group of the space X – here "automorphism group" can mean isometry group, diffeomorphism group, or homeomorphism group. In this case, X is homogeneous if intuitively X looks locally the same at each point, either in the sense of isometry, diffeomorphism, or homeomorphism (topology). Some authors insist that the action of G be faithful, although the present article does not. Thus there is a group action of G on X which can be thought of as preserving some "geometric structure" on X, and making X into a single G-orbit.

This is a glossary of some terms used in Riemannian geometry and metric geometry — it doesn't cover the terminology of differential topology.

In mathematics, a space form is a complete Riemannian manifold M of constant sectional curvature K. The three most fundamental examples are Euclidean n-space, the n-dimensional sphere, and hyperbolic space, although a space form need not be simply connected.

In mathematics, a hyperbolic manifold is a space where every point looks locally like hyperbolic space of some dimension. They are especially studied in dimensions 2 and 3, where they are called hyperbolic surfaces and hyperbolic 3-manifolds, respectively. In these dimensions, they are important because most manifolds can be made into a hyperbolic manifold by a homeomorphism. This is a consequence of the uniformization theorem for surfaces and the geometrization theorem for 3-manifolds proved by Perelman.

In mathematics, the Teichmüller space of a (real) topological surface , is a space that parametrizes complex structures on up to the action of homeomorphisms that are isotopic to the identity homeomorphism. Teichmüller spaces are named after Oswald Teichmüller.

In mathematics, Mostow's rigidity theorem, or strong rigidity theorem, or Mostow–Prasad rigidity theorem, essentially states that the geometry of a complete, finite-volume hyperbolic manifold of dimension greater than two is determined by the fundamental group and hence unique. The theorem was proven for closed manifolds by Mostow (1968) and extended to finite volume manifolds by Marden (1974) in 3 dimensions, and by Prasad (1973) in all dimensions at least 3. Gromov (1981) gave an alternate proof using the Gromov norm. Besson, Courtois & Gallot (1996) gave the simplest available proof.

In mathematics, constant curvature is a concept from differential geometry. Here, curvature refers to the sectional curvature of a space and is a single number determining its local geometry. The sectional curvature is said to be constant if it has the same value at every point and for every two-dimensional tangent plane at that point. For example, a sphere is a surface of constant positive curvature.

In geometry, the hyperboloid model, also known as the Minkowski model after Hermann Minkowski, is a model of n-dimensional hyperbolic geometry in which points are represented by points on the forward sheet S+ of a two-sheeted hyperboloid in (n+1)-dimensional Minkowski space or by the displacement vectors from the origin to those points, and m-planes are represented by the intersections of (m+1)-planes passing through the origin in Minkowski space with S+ or by wedge products of m vectors. Hyperbolic space is embedded isometrically in Minkowski space; that is, the hyperbolic distance function is inherited from Minkowski space, analogous to the way spherical distance is inherited from Euclidean distance when the n-sphere is embedded in (n+1)-dimensional Euclidean space.

In differential geometry, the Margulis lemma is a result about discrete subgroups of isometries of a non-positively curved Riemannian manifold. Roughly, it states that within a fixed radius, usually called the Margulis constant, the structure of the orbits of such a group cannot be too complicated. More precisely, within this radius around a point all points in its orbit are in fact in the orbit of a nilpotent subgroup.

In differential geometry, Hilbert's theorem (1901) states that there exists no complete regular surface of constant negative gaussian curvature immersed in . This theorem answers the question for the negative case of which surfaces in can be obtained by isometrically immersing complete manifolds with constant curvature.

In differential geometry, Pu's inequality, proved by Pao Ming Pu, relates the area of an arbitrary Riemannian surface homeomorphic to the real projective plane with the lengths of the closed curves contained in it.

In mathematics, a Riemannian manifold is said to be flat if its Riemann curvature tensor is everywhere zero. Intuitively, a flat manifold is one that "locally looks like" Euclidean space in terms of distances and angles, e.g. the interior angles of a triangle add up to 180°.

In mathematics, the differential geometry of surfaces deals with the differential geometry of smooth surfaces with various additional structures, most often, a Riemannian metric. Surfaces have been extensively studied from various perspectives: extrinsically, relating to their embedding in Euclidean space and intrinsically, reflecting their properties determined solely by the distance within the surface as measured along curves on the surface. One of the fundamental concepts investigated is the Gaussian curvature, first studied in depth by Carl Friedrich Gauss, who showed that curvature was an intrinsic property of a surface, independent of its isometric embedding in Euclidean space.

In the mathematical subject of geometric group theory, the Švarc–Milnor lemma is a statement which says that a group , equipped with a "nice" discrete isometric action on a metric space , is quasi-isometric to .

In mathematics, the Cartan–Ambrose–Hicks theorem is a theorem of Riemannian geometry, according to which the Riemannian metric is locally determined by the Riemann curvature tensor, or in other words, behavior of the curvature tensor under parallel translation determines the metric.

In mathematics, hyperbolic complex space is a Hermitian manifold which is the equivalent of the real hyperbolic space in the context of complex manifolds. The complex hyperbolic space is a Kähler manifold, and it is characterised by being the only simply connected Kähler manifold whose holomorphic sectional curvature is constant equal to -1. Its underlying Riemannian manifold has non-constant negative curvature, pinched between -1 and -1/4 : in particular, it is a CAT(-1/4) space.

## References

• Ratcliffe, John G., Foundations of hyperbolic manifolds, New York, Berlin. Springer-Verlag, 1994.
• Reynolds, William F. (1993) "Hyperbolic Geometry on a Hyperboloid", American Mathematical Monthly 100:442–455.
• Wolf, Joseph A. Spaces of constant curvature, 1967. See page 67.