text:
PLUMED Masterclass 22.2: Analysis of Plumed output by Metadynminer
Date
February 14, 2022

# Aims

The aim of this Masterclass is to introduce users to the R package Metadynminer for analysis of results from metadynamics in Plumed.

# Objectives

Once this Masterclass is completed, users will be able to:

• Install R and its packages.
• Load metadynamics results (HILLS file) to Metadynminer.
• Calculate a free energy surface and plot it in a publication quality.
• Locate free energy minima and evaluate their relative free energies.
• Make an animation of the evolution of a free energy surface.
• Use data in Metadynminer objects to do advanced calculations (e.g., reweighting).

# Setting up the software

## Installation

We will use R installed from CRAN. Go to CRAN and follow the installation instructions for your operating system. R is Open Source. It is not necessary to use a graphical user interface but it is very useful, especially for making illustrations.

If you plan to use a graphical user interface, the best option is Rstudio. Desktop version of Rstudio is Open Source. Follow the installation instructions for your operating system.

To install metadynminer, open R (in commandline type R or open GUI by typing rstudio or using an icon) and type:

install.packages("metadynminer")

The output should contain: * DONE (metadynminer). If you have an output: installation of package metadynminer had non-zero exit status there was a problem with installation. You may try:

• On MS Windows install Rtools.
• If you have permission issues, you can try the commands Sys.getenv("R_HOME") and Sys.getenv("R_LIBS_USER") and check the permission of the printed directories. You may change installation directories by corresponding Sys.setenv(...) commands.

You may check whether Metadynminer was installed correctly by typing:

library(metadynminer)

This command should have no output. Installation is done only once (or can be repreated for version upgrades). Loading of the package by library command must be done in every R seance.

# Resources

The data needed for this Masterclass can be found on GitHub. You can clone this repository using the following command:

git clone https://github.com/plumed/masterclass-22-02.git

The repository contains hills and colvar files, respectively, from 10 or 1 ns metadynamics simulations of alanine dipeptide in water calculated in Plumed. Other input data are available from Zenodo but are not required in this tutorial. The repo contains:

• HILLS.cv12 and COLVAR.cv12 - hills and collective variable + bias report from metadynamics with phi and psi dihedral angles
• HILLS.cv1 and COLVAR.cv1 - hills and collective variable + bias report from metadynamics with phi dihedral angle
• HILLS.cv2 and COLVAR.cv2 - hills and collective variable + bias report from metadynamics with psi dihedral angle

This data are independent of Plumed version (for version >=2.0).

# Using R

R is a program and scrpting language predominantly developed for statistical data analysis. It is popular in statistics, economy, ecology, bioinformatics, and other fields. Let us quickly introduce R. Open R as described above and type:

1+1
2-1
3*3
5/2

This shows addition, subtraction, multiplication, and division. Numbers and other objects can be saved to variables. We advice users to avoid the names of variables that can be confused with existing functions in R. In this masterclass, we will use the prefix "my" (e.g., myhills) to avoid this. Variable names are case-sensitive. The operator used to save something to is an arrow <- (less than followed by minus sign). You may see R codes with a normal equal sign, but we will be puristic in this. Let us show the variables in R:

x <- 1+1
x

In the outputs above, there is an unexpected string [1]. This is the index of the first item on the line. This is useful when dealing with vectors. Vector can be created by implicitly typing its elements to the function c(), by : operator and other ways:

x <- c(1, 3, 2)
x
x <- 1:50
x
x <- 50:1
x

R can also work with 2D and multidimensional matrices. R can work with strings (written in quotes, e.g. "blue"), Booleans (TRUE and FALSE, or shortened as T and F).

R uses functions written as the name of function followed by its arguments in brackets:

exp(1)
cos(pi)

Functions can be applied element-wise:

x<-0:10
cos(x)

Functions with more variables use the specifications set by =, separated by ,:

x<-0:100/10
y<-cos(x)
plot(x, y)
plot(x, y, xlab="x axis", ylab="y axis", ylim=c(-2,2))

Important difference from many other programming environments is that R can freely change number types, e.g. 3/2 is evaluated as 1.5, unlike Pyhton, which gives 1, because 3 and 2 are integers, and not floats.

Another important difference is that R uses indexes of vector items starting with 1 (not 0 line in C/C++, Python etc.). For example:

x <- c("Carlo", "Gareth", "Giovanni", "Max")
x[2]

will return Gareth. In contrast, Python returns Giovanni:

x = ["Carlo", "Gareth", "Giovanni", "Max"]
x[2]

Finally, R can use other types of objects, including objects defined by a user. Their instances can be accessed by a string operator. For example, the function prcomp performs a principal component analysis. Its output is an object with multiple instances, for example, with a rotation matrix:

pcamodel <- prcomp(outer(1:3,1:2))
pcamodel
pcamodel$rotation  Finally, to quit R you can use the function q(). The program asks the user whether he/she wants to save the data (i.e., variables created in the previous course of the run). We advise users to NOT save data, i.e. choose the option "n" or function q(save="n"). ## Exercise 1: Calculation of the free energy surface from metadynamics hills Open R (in Rstudio or command line) and load Metadynminer: library(metadynminer)  Now load the file HILLS.cv12 into Metadynminer: myhills12 <- read.hills("HILLS.cv12", per=c(T, T))  At this point, it is necessary to set the periodicity of CVs. The free energy surface was calculated using torsion angles as CVs, which are periodic. It is necessary to set the periodicity to TRUE (or simplified as T) as a vector per. If you get an error message that the file was not found, it means that the home directory is not set properly. In Linux command line, the home is the directory where you start R by the command R. In Rstudio, you may navigate to the directory with the file using the File menu in the right bottom frame. Alternatively, you can use getwd() and setwd("/path/to/your/dir"). Hills can be also loaded from a HILLS file posted online by replacing the file name by an URL. To get help to any function in R, for example, read.hills, you can use either help(read.hills) or ?read.hills). If you type the name of the hills file variable myhills12 you get an information about the number of hills and CVs. The function summary (summary(myhills12)) returns the same information plus the ranges of CVs. A hills file can be plotted by the plot function, i.e., plot(myhills12). For a metadynamics with one CV it plots the evolution of the CV as a function of time. For a metadynamics with two CVs it plots a scatter plot with CV1 on the horizontal axis and CV2 on the vertical axis. The plot function applied on metadynamics hills file is an extension of the standard plot function in R. You may set parameters xlab, ylab, main, sub, xlim, ylim, pch, col, bg, cex, lwd and asp (see ?plot.hillsfile). It is possible to stack plots on top of each other by using the command plot(...), followed by a command points(...) or lines(...). For well-tempered metadynamics, it may be useful to check the evolution of heights of hills. This can be done by the command: plotheights(myhills12)  Hills files are often obtained from multiple metadynamics runs. This may cause that time collumn does not correspond to the real time. The option ignoretime=T used either in read.hills or in plotheights replaces time by the hill number. The main point is the calculation of the free energy surface from the hills file as an negatve image of the sum of Gaussian hills (scaled in well-tempered metadynamics, which is pre-scaled in the Plumed output). This may be time consuming with hundreds of thousands of hills. In metadynminer you can use two functions for this purpose, fes and fes2. The former is fast and approximative, the latter is slow and more accurate. The function fes uses a pre-computed Gaussian hill which is simply being shifted on the canvas of the CV space for each hill and the bias potential is summed. The function fes2 explicitly evaluates the Gaussian function. The function fes cannot be used in metadynamics with variable hills widths (the user would be warned). In our tutorial we can do: myfes12 <- fes(myhills12)  (or the same with fes2 for analyses, final illustations etc). Typing the name of the free energy surface variable myfes12 returns the number of CVs, number of bins (by default 256 for one CV, and 256x256 for two CVs), free energy maximum and minimum. It is possible to calculate the value of minimum and maximum of the free energy surface by functions min and max, respectively. You may add, subtract, multiply, and divide the free energy surface by a constant. For example, you can set the free energy minimum to zero by subtracting the minimum: myfes12 <- myfes12 - min(myfes12)  Similarly, to convert the free energy surface from kJ/mol to kcal/mol you may divide it by 4.18. It is also possible to sum and subtract two free energy surfaces. This will be demonstrated later. The important function of Metadynaminer is plotting of the free energy surface. You can use: plot(myfes12)  Again, you may use options xlim, ylim, zlim, main, sub, xlab, ylab, labcex and drawlabels (see ?plot.fes). You may control the type of the plot by the plottype. The option plottype="image" plots a heat map, plottype="contour" plots contours, and plottype="both" plots both. It is possible to switch on the free energy scale by: plot(myfes12, colscale=T)  You may change the title of the scale by colscalelab="your label". It is often necessary to control the levels of contours. For example, to plot the free energy surface with 20 contours by 10 kJ/mol type: myfes12 <- myfes12 - min(myfes12) plot(myfes12, zlim=c(0,200), nlevels=20)  You may also explicitly set levels as a vector by the parameter levels. The default color palette for a 2D free energy surface in Metadynminer is rainbow(135)[100:1] (i.e., rainbow without violet color). If you prefer your own color palette, you may set it as col paramtere. For example, this command plots the free energy surface in gray colors: plot(myfes12, col=gray.colors(50))  Metadynminer can identify minima on the free energy surface. This can be done by the function: myminima12 <- fesminima(myfes12) myminima12  The program should find approximately five free energy minima for alalnine dipeptide in water and print their idetifier (letters A, B, C, ... followed by AA, AB, AC, ...), location on the free energy surface (in bin ID and in CVs), and the free energy (for the final free energy surface). The function summary prints also populations (temperature and energy units can be controlled by temp and eunit, respectively). Some metadynamics simulations may result in rough free energy surfaces with hundreds of free energy minima. It is not useful to identify all of them. It is better to find a reasonable number of minima scattered on the whole free energy surface. The function fesminima splits the canvas of the free energy surface into a certain number of sections (by default 8x8 for 2D and 8 for 1D free energy surfaces, it may be controled by nbins). A global minimum is found in each section and then it is checked whether it is a local minimum of the entire free energy surface. If not, it is discarded. It may happen that the function fesminima cannot identify some minimum or it is necessary to add a reference point on a free energy surface, which is not a minimum. For this purpose, it is possible to make a minimum by oneminimum function and add it to the existing minima (by addition operation). The output of fesminima can be plotted by plot function. The plot is similar to the free energy surface and it contains additional letters in the points of minima. plot(myminima12)  Convergency of metadynamics can be assessed by the time profile of the differences between free energy minima. Stable difference between free energy minima indicates that the free energy surface is converged and thus accurate. It must be kept in mind that this is a necessary but not the only requirement of convergence. Please follow the PLUMED Masterclass 21.2: Statistical errors in MD for more details. The time profile of the differences between free energy minima can be caluclated and plotted as: myprof12 <- feprof(myminima12) plot(myprof12)  The program takes free energy minima (as identified by the function fesminima) and calculates the values of free energy in the same point in the CV space along the simulation. Typing the name of the time profile returns the same output as for minima. The function summary prints the same output as the summary of free energy minima together with minimal and maximal free energy relative to the global free energy minimum. The minimum A is always the global minimum and its relative free energy is 0 (also its minimum and maximum is zero). The column tail contains the relative free energy at the end of the simulation. It is possible to specify the time window in which the minimum and maximum are calculated, for example the second half of the simulation, by imind and imaxd. By default they are set to 1 and the number of hills, respectively, i.e. to whole simulation. Finally, metadynminer provides a function for the nudged elastic band: myneb<-neb(myminima12, min1="A", min2="D") myneb plot(myneb) plot(myminima12) linesonfes(myneb)  ## Exercise 2: Making high resolution plots and movies In Rstudio it is possible to save plotted figures in different vector and bitmap formats and it is possible to customize their resolution. As an alternative, it is possible to save figures by the functions png, bmp, jpeg, tiff, svg, pdf or eps. These functions use the file name as an argument and it switches the plotting environment, so that the file is plotted into the file and not on the screen. This option must be switched off by the function dev.off(). These functions work in the basic R (i.e., without Rstudio) and can be used for example at high-performance computing clusters, grids, and clouds without GUI. Our suggestion to make a nice publication quality figure in the size of 8x8 cm (typical half page) is: png("filename.png", height=8, width=8, units='cm', res=600, pointsize=6) plot(myfes12) dev.off()  The functions for image saving can be used with regular expressions. This is useful for making movies. A movie of free energy evolution can be simply made by: tfes<-fes(myhills12, imax=50) png("snap%04d.png") plot(tfes, zlim=c(-200,0)) for(i in 1:199) { tfes<-tfes+fes(myhills12, imin=50*i+1, imax=50*(i+1)) plot(tfes, zlim=c(-200,0)) } dev.off()  Functions imin and imax make it possible to restrict the summation to certain hill range. The first line calculates the sum of the first 50 hills. The second call of the fes function calculates the sum of hills 51 to 100 and adds it to the total free energy surface. The resulting 200 files named snap0001.png, snap0002.png, etc can be concatenated to a movie by means of some movie editing software. ## Exercise 3: Making a movie of flooding The first task in this tutorial is to calculate the free energy surface of alanine dipeptide calculated in the space of two collective variables phi and psi. This can be done by typing: library(metadynminer) myhills12 <- read.hills("HILLS.cv12", per=c(T, T)) myfes12 <- fes(myhills12) plot(myfes12)  The 2D free energy surface can be converted to 1D by conversion of the free energy to probability, integration of probabilities along one CV and conversion back to free energy. In metadynminer you can do this by the function fes2d21d: myfes12.1d <- fes2d21d(myhills12, remdim=2)  The option remdim sets which CV should be removed (remdim=2 removes psi). It is also possible to set the temperature and energy units by temp and eunit, respectively. Now we will use this free energy surface (calculated from 10 ns metadynamics) as the "ground truth" and we will try how this free energy surface was flooded by 1 ns metadynamics with a single CV, either phi or psi. Hills file from the other two simulations can be loaded by: myhills1 <- read.hills("HILLS.cv1", per=_FILL_) myhills2 <- read.hills("HILLS.cv2", per=_FILL_)  Replace _FILL_ by the correct expression. Next, for time 10 ps to 1 ns (hills 10 to 1000, with an increment of 10), calculate the free energy surface, convert it to a bias potential by multiplication by minus (biasfactor - 1)/biasfactor and add it to the ground truth free energy surface. The bias factor was 15 in this simulation. Plot the result (in black) together with the ground truth free energy surface in red: myfes12.1d <- myfes12.1d - min(myfes12.1d) flooded <- myfes12.1d flooded$hills <- c()
png("snap%04d.png")
plot(myfes12.1d, ylim=c(0,100), col="red")
for(i in _FILL_) {
plot(myfes12.1d, ylim=c(0,100), col="red")
myfes1 <- fes(myhills1, imin=_FILL_, imax=_FILL_)
flooded <- flooded + _FILL_*myfes1
lines(flooded)
}
dev.off()

Again, replace each _FILL_ by a suitable expression. Keep in mind that it is possible to compose the plot from multiple plots. The function plot creates the first plot and functions lines or points add to this plot.

The meaning of the line flooded$hills <- c() is following. Objects in R may contain different instances stored as variable$instance The object of the free energy surface contains the free energy surface, information about the axes and their periodicity and other information, but also the original hills from which the free energy surface was calculated. Something similar applies also to the object of free energy minima. The reason for this is that the function feprof needs hills data. Summation of free energy surfaces is equivalent to concatenation of hills, so the sum of two free energy surfaces contains concatenated hills as its $hills instance. However, in the line flooded <- flooded + _FILL_*myfes1 it is not possible to concatenate 1D and 2D hills. For this reason we erased hills from the variable flooded. If possible, make a movie or visually inspect the resulting files. Evaluate the flooding by the 1D potential in terms of convergence. ## Exercise 4: Reweighing It would be also interesting to see the performance of metadynamics with psi torsion as the only CV. Unfortunately, it is not possible to calculate the free energy surface in the space of phi torsion from this simulation simply by summing hills. This can be done by reweighing. This will also demonstrate the advanced features of metadynminer. Reweighing predicts what would have been the distribution of a CV or CVs in the biased simulation, if it had not been biased. Umbrella sampling reweighing weights the distribution of the states by exp(+bias/kT). This can be applied to metadynamics bias potential with a correction to the time-dependence of the bias potential. We will use the correction introduced by Tiwari and Parrinello. The main idea is the bias potential is divided into time-independent and the time-dependent component. The time-dependent component is calculated by the following procedure: library(metadynminer) bf <- 15 nframes <- 50 temp <- 300 myhills2 <- read.hills("HILLS.cv2", per=c(T)) s1<-rep(0, nframes) s2<-rep(0, nframes) for(i in 1:nframes) { step <- i*length(myhills2$time)/nframes
onefes <- fes(myhills2, imax=step)
s1[i] <- sum(exp(-1000*onefes$fes/8.314/temp)) s2[i] <- sum(exp(-1000*onefes$fes/8.314/temp/bf))
}
ebetac <- s1/s2

The variable bf contains the bias factor. The R function rep generates a vector by repeating an element. Here it generates a vector with nframes (50) elements equal to zero. The variable step is equal to the number of hills divided by 50 in the first step, twice as many in the second step, etc. The free energy surface is calculated for this number of hills. Next, exp(-G/kT) and exp(-G/kDeltaT) is calculated and stored in vectors s1 and s2, respectively. Finally, s1 and s2 are divided elementwise and stored to ebetac.

Next, we open the colvar file and calculate the probabilities of the phi torsion. This can be done by:

mycolvar2 <- read.table("COLVAR.cv2")
cv1 <- floor(32*(mycolvar2[,2]+pi)/pi) + 1
bias <- 1000*mycolvar2[,4]
probs <- rep(0, 64)
for(i in 1:nrow(mycolvar2)) {
step <- (i-1)*nframes/nrow(mycolvar2)+1
probs[cv1[i]] <- probs[cv1[i]] + exp(bias[i]/temp/8.314)/ebetac[step]
}
fes <- -8.314*temp*log(probs)/1000
fes <- fes - min(fes)
fes[fes>100] <- 100
myfes <- fes(myhills2, npoints=64, imax=1)
myfes\$fes <- fes
plot(myfes, ylim=c(0,60))

The function read.table is a standard function of R for reading tabular data. The first CV is extracted from the table and converted to bin number (with 64 bins). Next, the probability vector prob is generated. The program then runs across all lines of the colvar file and adds exp(bias[i]/temp/8.314)/ebetac[step] to the probability in the bin of phi angle in i-th line. The resulting probabilities are converted to free energy and the free energy of unsampled bins is converted to 100 kJ/mol (instead of infinity, for better handling). Finally, a free energy surface with 64 bins is calculated from the first hill and the free energy surface object is replaced by our fes. This free energy surface is plotted. Compare free energy surfaces calculated with phi CV and psi CV.


text:
# SSAT Middle Level Math : How to find a proportion

## Example Questions

← Previous 1 3 4 5 6 7 8

### Example Question #1 : How To Find A Proportion

Give the value of  that makes this proportion statement correct:

Explanation:

Cross-multiply, then solve for :

### Example Question #1 : How To Find A Proportion

Give the value of  that makes this proportion statement correct:

Explanation:

Cross-multiply, then solve for :

### Example Question #1 : How To Find A Proportion

Give the value of  that makes this proportion statement correct:

Explanation:

Multiply both sides by 80 and solve for :

### Example Question #4 : How To Find A Proportion

Give the value of  that makes this proportion statement correct:

Explanation:

Multiply both sides by 75 and solve for :

### Example Question #5 : How To Find A Proportion

Read this problem, but do not solve it.

4 out of every 5 dentists surveyed recommend Triton sugarless gum to patients who chew gum. If 2,100 dentists were surveyed, how many dentists recommended Triton?

If we let  be the number of dentists who recommended Triton, what proportion statement could be used to solve this problem?

Explanation:

The ratios that are set equal to each other in a proportion statement must compare the same quantities in the same order.

In each ratio, we can put number of dentists who recommended Triton in the numerator, and number of dentists who were surveyed in the denominator.

One ratio is 4 dentists recommending Triton to 5 dentists surveyed (the general ratio): this is .

The other ratio is  dentists recommending Triton to 2,100 dentists surveyed (the actual number); this is .

The proportion statement sets these equal:

which is the correct choice.

### Example Question #1 : How To Find A Proportion

If Jason eats one-third of half a dozen donuts, how many donuts has he eaten?

donuts

donuts

donuts

donuts

donuts

donuts

Explanation:

Half a dozen donuts is equal to 6 donuts, given that there are 12 items per dozen.

One-third of 6 is 2. Therefore, 2 donuts is the correct answer.

### Example Question #124 : Numbers And Operations

Kenny is having a party, and he is experimenting with different mixtures of soda to come up with something original. He particularly likes a mixture of four ounces of lemon lime soda and three ounces of cream soda. He has two and a half liters of lemon lime soda and wants to use it all; how much cream soda does he need?

None of the other responses gives the correct answer.

Explanation:

The ratio of ounces of lemon lime soda to ounces of cream soda in the initial mixture can be expressed as . This ratio must remain the same for the mixture Ken will make for the party. Let  be the number of liters of cream soda. Then the ratio is . Set the two ratios equal to each other and solve for :

Set the cross-products equal to each other:

Ken will use   liters of cream soda in the final mixture.

### Example Question #8 : How To Find A Proportion

What is the value of  in the proportion?

Explanation:

Simplify  by dividing both the numerator and denominator by 8 so that it simplifies to .  Now it should be obvious that  in order for both sides of the equation to be equal.

### Example Question #22 : Ratio And Proportion

For every $3 I earn at work, I donate$1 to charity. How much money will I donate if I make \$27.00/week.

Explanation:

To find the amount of the donation, divide 27 by 3.

### Example Question #10 : How To Find A Proportion

A Spanish class has  seniors and  juniors. What proportion of the class is juniors?

format: plain


text:
### R FAQ How can I read binary data into R?

The code needed to read binary data into R is relatively easy.  However, reading the data in correctly requires that you are either already familiar with your data or possess a comprehensive description of the data structure.

In the binary data file, information is stored in groups of binary digits. Each binary digit is a zero or one and eight binary digits grouped together is a byte. In order to successfully read binary data, you must know how pieces of information have been parsed into binary.  For example, if your data consists of integers, how may bytes should you interpret as representative of one integer in your data?  Or if your data contains both positive and negative numbers, how can you distinguish the two?  How many pieces of information do you expect to find in the binary data?

Ideally, you know the answers to these questions before starting to read in the binary file.  If you do not, you can explore the read in options in R. To get started, we establish a connection to a file and indicate that we will be using the connection to read in binary data.  We do this with the file command, providing first the pathname, and the "rb" for "reading binary".  For more details, see help(file) in R.

to.read = file("http://www.ats.ucla.edu/stat/r/faq/bintest.dat", "rb")

Next, we use the readBin command to begin. If we think the file contains integers, we can start by reading in the first integer and hoping that the size of the integer does not require further specifications. Different platforms store binary data in different ways, and which end of a string of binary values represents the greatest values or smallest values is a difference that can yield very different results from the same set of binary values.  This characteristic is called the "endian". The binary files in the examples on this page were written using a PC, which suggests they are little-endian.  When reading in binary data that may or may not have been written on a different platform, indicating an endian can be crucial.  For example, without adding endian = "little" to the command below while running R on a Mac, the command reads the first integer as 16777216.

readBin(to.read, integer(), endian = "little")
[1] 1

Thus, it looks like the first integer in the file is 1. As we repeatedly use readBin commands, we will work our way through the binary file until we hit the end. We can read in multiple integers at once by adding an n= option to our command. If the n you specify is greater than the number of integers you specified, readBin will read and display as much as is available, so there is no danger of guessing too large an n. Since we have already read in the first integer, this command will begin at the second.

[1] 2 3 4 5

If you know have additional information about what is in your file, you should incorporate that into the readBin command.  For example, if you know that you wish to read in integers stored on 4 bytes each, you can indicate this with the size option:

[1] 6 7

Similarly, if you know that your file contains characters, complex numbers, or some other type of information, you would adjust the readBin command accordingly, changing integer() to character() or complex(). See help(readBin) in R for more details.

Since you will likely want to do more than just look at what is contained in the binary file, you will need some strategies for formatting data as you read it in.  For example, suppose you are given a binary file with the following description: three numeric variables collected from 200 subjects, the three variable names appear first in the file, the numeric values are integers store on two bytes each, and all of the values for the first variables are followed by all the values for the second and then all of the values for the third (as if they have be read in as columns, not rows). First, open a connection to the data.

newdata = file("http://www.ats.ucla.edu/stat/r/faq/bindata.dat", "rb")

Next, let's read in the variable names and save them to a vector in R.

varnames = readBin(newdata, character(), n=3)
varnames
[1] "read"  "write" "math"

To read in the integer values, we can opt to read all 300 onto one vector, and then separate it out into the three variables.

datavals = readBin(newdata, integer(), size = 4, n = 600, endian = "little")
writevals = datavals[201:400]
mathvals = datavals[401:600]

Or we can read in each variable's values with a separate readBin command.

readvals = readBin(newdata, integer(), size = 4, n = 200, endian = "little")
writevals = readBin(newdata, integer(), size = 4, n = 200, endian = "little")
mathvals = readBin(newdata, integer(), size = 4, n = 200, endian = "little")

Then, we can combine our three value vectors into one data frame with the variable names as our column names.

rdata = cbind(readvals, writevals, mathvals)
colnames(rdata) = varnames
rdata[1:5,]

[1,]   57    52   41
[2,]   68    59   53
[3,]   44    33   54
[4,]   63    44   47
[5,]   47    52   57

Lastly, since we have finished reading data from the binary file, we can close the connection.

close(newdata)

If you wish to write a binary file from R, see R FAQ: How can I write a binary data file in R?

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.


text:
# How can I preserve a high framerate while using at least 1280x720 resolution on 2 USB cameras on the same computer?

To expand on this, I have a down-facing camera using the whycon ROS node on Ubuntu 16.04 Kinetic on a quad-core computer with 640x480@60fps MJPG video. I'm also using the usb_cam node to publish the image_raw. I've noticed that the overall CPU consumption would already be above 90% for all 4 cores whenever I try to run just these 2 nodes.

But I also want to add a secondary front-facing USB camera that will only be for streaming video to another computer. This secondary camera ideally should have a 1280x720 resolution. I tried to run both cameras at the same time, but the 1280x720 one is only at 10-12fps, which is too slow for my purposes. Additionally, it would be great if I can also have the whycon node to be using 1280x720, but I think the framerate should have a higher priority.

I realize that I can lower both resolutions to 640x480 and that should help with the framerate issue, but is that really the only way to ensure a smoother video?

I also have a single USB 3.0 port and 2 USB 2.0 ports on my computer and I have plugged in the front-facing camera into the USB 3.0 port. I've also already ran v4l2-ctl --list-formats-ext on my cameras (they are exactly the same) and they both are only capable of 60fps up to 1920x1080.

EDIT: A follow-up question I have is if it would be better to switch to a different computer with a better processor? What I'm currently using has the Intel Cherry Trail 1.8 Ghz Quadcore.

EDIT2: @kaliatech If I run the front camera at 1280x720, I can get up to 34fps with 1 CPU core maxing out at 100% at a time and the rest at more or less 25%. If I run just the down-facing camera at 640x480, I can get up to 60fps with CPU usage around 55% for 1 core while the rest are less than 20%. If I have both the down-facing cam and the whycon node running, I still have 60fps from usb_cam but CPU usage maxes out at 100% and 70% for 2 cores. Finally, if I run all three, the down-facing cam remains the same in terms of framerate but the front-facing has around 12 fps and at least 2 cores max out with the rest at above 60%. At this point, I'm not currently transferring the videos through the network. I'm still conducting some tests on the local computer, but you would be right that it will be much worse on a slower network. I will try to use a different camera driver like cv_camera but I think I skipped it since it seemed older than usb_camera and even less supported

EDIT3: I tried using cv_camera but the resulting framerate seemed about the same, if not worse.

• At which point in your setup are you observing the frame rate for the 1280x720 at ~10-12fps? – kaliatech Feb 16 '19 at 15:46
• I get that framerate when I have both cameras running with usb_cam + whycon node. – trixr4kdz Feb 19 '19 at 20:23

Here are a few things to consider:

• First, do you know where the actual bottleneck(s) are? Some possibilities: the usb camera driver or usb_cam and related settings (especially if having to compress/uncompress/transpose the video format without hardware support), cpu processing (perhaps whycon is overloading), network bandwidth/latency/processing (what type and speed network are you using?), or the final video decoding/display. Any one of those could be affecting the frame rates.

• If you are trying to transfer HD resolutions over a slower network in MJPG, then that could explain the lower frame rate. And depending on your hardware, some network interfaces require use of main CPU, would could also be adding to the overall CPU load.

• MJPG is not very good for capturing and streaming at higher resolutions & rates over a network, compared to something like H264 or other stream based encoders. You mention publishing image_raw, which would require significantly even more bandwidth, though it's unclear to me where in your ROS node network you are doing this.

• Some cameras have onboard hardware based encoders, which can significantly lighten the main CPU load. It requires support on both sides though (camera and driver). I'm not sure if usb_cam supports on camera encoding (I don't think it does, but not positive.) It might be worth try something like libuvc_camera, or cv_camera, and experimenting with settings and formats to see if you can get lower CPU and better frame rates.

I would also suggest testing, if you haven't already, what kind of cpu and framerates you can get from the front camera at 1280x720 without simultaneously running the primary camera and without running whycon. Based on what you find from doing that, you can probably add more info to your question, or start a new question, to get better answers.


text:
X
Natural SUSY at LHC with right-sneutrino LSP
Juhi Dutta, Santosh Rai Kumar
Published in
2018
Volume: 2018

Issue: 6
Abstract
We study an extension of the minimal supersymmetric standard model (MSSM) with additional right-handed singlet neutrino superfields. While such an extension incorporates a mechanism for the neutrino mass, it also opens up the possibility of having the right-sneutrinos ($\nu$˜ ) as the lightest supersymmetric particle (LSP). In this work, we focus on the viability of rather small (≲500 GeV) higgsino mass parameter ($\mu$), an important ingredient for “naturalness”, in the presence of such a LSP. For simplicity, we assume that the bino and wino mass parameters are much heavier; thus we only consider (almost) pure and compressed higgsino-like states, with small O(10−2) gaugino admixture which nevertheless still affect the decay of the low-lying higgsino-like states, thus significantly affecting the proposed signatures at colliders. Considering only prompt decays of the higgino-like states, especially the lightest chargino, we discuss the importance of leptonic channels consisting of up to two leptons with large missing transverse energy to probe this scenario at the Large Hadron Collider (LHC). In addition we also comment on the dark matter predictions for the studied scenario.


text:
# 2.10.3 Quadratic Equations, SPM Practice (Paper 2)

2.10.3 Quadratic Equations, SPM Practice (Paper 2)

Question 5:
Given 3t and (t – 7) are the roots of the quadratic equation 4x2 – 4x + m = 0 where m is a constant.
(a)  Find the values of t and m.
(b)  Hence, form the quadratic equation with roots 4t and 2t + 6.

Solutions:
(a)
Given 3t and (t – 7) are the roots of the quadratic equation 4x2 – 4x + m = 0
a = 4, b = – 4, c = m
Sum of roots = $-\frac{b}{a}$
3t + (t– 7) = $-\frac{-4}{4}$
3t + t– 7 = 1
4t = 8
t = 2

Product of roots = $\frac{c}{a}$
3t (t– 7) = $\frac{m}{4}$
4 [3(2) (2 – 7)] = m ← (substitute t = 2)
4 [3(2) (2 – 7)] = m
4 (–30) = m
m = –120

(b)
t = 2
4t = 4(2) = 8
2t + 6 = 2(2) + 6 = 10

Sum of roots = 8 + 10 = 18
Product of roots = 8(10) = 80

Using the formula, x2– (sum of roots)x + product of roots = 0
Thus, the quadratic equation is,
x2 – 18x + 80 = 0


text:
# Looking for a system of structural writing

## 2022/01/19

Categories: Emacs Latex Tags: Structural editing

I mentioned in the previous post that writing is hard and that I don’t have any tips that can make it easier. That is mostly true, but I also mentioned that I’m starting to write using topic sentences, which is useful writing strategy for me.

I didn’t mention in the last post that I like to think about computer tools that help users complete tasks, and I think structural writing is where our computers generally fall short. By structural writing, I mean writing in an environment that hints toward good organization.

Let me explain1

When you sit down to write a research paper, your job is to convey your complex thoughts to the reader in a manner that requires the reader to exert as little effort as possible. Some topics are genuinely hard to convey, like academic research. At a high level, the best we can do to make things easy on the reader is to

1. Write simply and clearly; and
2. Organize our ideas.

I read somewhere that if you are thinking without writing then you aren’t really thinking at all, and that quote occurs to me when I consider organizational strategies because you can only organize thoughts on a page, not in your head.

Now we usually use something like Word or Emacs to write our thoughts, and these programs are so tremendous, that I’m way more productive using these over using a piece of paper and a pencil.

However, when it comes to organization, they are not much better than a piece of paper. There are no guardrails to guide organization, other than the fact that the Word document probably should be read from beginning to end.

It’s great not to have guardrails: Most of the time you don’t need or want them. I do not want them when I jot notes, a blog post, a journal entry, or most other things. So there’s nothing wrong with MS Word.

What I want is some writing system like Emacs’s Org-mode or LateX, but with gentle pushes towards well structured arguments when I need it, like when I’m doing technical writing.

## Example implementation

An efficient method is to first create an outline of your paper. Each bullet point is a topic sentence, a complete sentence that contains the main idea of each paragraph.

We can easily have one document that has these bullet point topic sentences, and another document of our actual notes, but that’s terrible, because the main document and the topic sentence document get out of sync. We need a way to keep them in sync.

My proposal is something like a latex macro, but it should be easy to use. In a text editor or MS word, we should be able to toggle between the main document and the topic sentence document with a key binding. This way, the topic sentences never get out of sync with the main document, because they are part of the main document, just perhaps with a tag.

The system could look something like this. I use LateX syntax, but it could be another system.

Topic sentence mode:

...

\ts{Here is a topic sentence.}

\ts{Here is another topic sentence with a difference main idea.}

...

Rest of document, in easy to parse topic-sentence-mode

A keybinding brings us to the main paper:

...

Here is a topic sentence. Here is the rest of the paragraph. And now I present all of my supporting evidence to the topic sentence.

Here is another topic sentence with a difference main idea. And the paragraph continues. Here is some more evidence and arguments.

...

Rest of document in "main document mode", the outline is hidden for writing convenience, like MS Word.

We could even take this a step further.

1. Level one: topic sentences. Main ideas only.
2. Level two: briefing level. Topic sentences with light evidence. Details in Backup slides
3. Level three: Full detail mode.

Depending on the level of detail, the document renders differently. We could render in topic sentence mode for a meeting with colleagues, and in main document mode for submission to the sponsor or a journal.

## Possibilities

I see two avenues.

One version of this system is as a set of latex macros. So the system could just be a latex package that is added to any existing paper. I would definitely like this.

Another option would be to use org-mode in Emacs. Orgmode is a powerful tool for outlining, but the outline is still separate from the content, and it would be better if there was a way to weave them together. Also org-mode is hard to transplant from Emacs, so that’s bad for portability. Markdown is another option.

I think in either case an advanced editor is required to easily switch between “topic sentence mode” and “main document mode”.

Perhaps there are writing systems that professionals – such as screen play writers etc – use to organize their thoughts, and seamlessly toggle between outline and main document?

1. NB: this blog post is not a good example of structural writing.↩


text:
## Seminars and Colloquia by Series

Wednesday, November 30, 2011 - 12:05 , Location: Skiles 005. , Farbod Shokrieh , Georgia Tech. , Organizer:
I will discuss the theory of chip-firing games, focusing on the interplay between chip-firing games and potential theory on graphs. To motivate the discussion, I will give a new proof of "the pentagon game". I will discuss the concept of reduced divisors and various related algorithmic aspects of the theory. If time permits I will also give some applications, including an "efficient bijective" proof of Kirchhoff's matrix-tree theorem.
Wednesday, November 16, 2011 - 12:05 , Location: Skiles 005. , Manwah Lilian Wong , Georgia Tech , Organizer:
We will discuss the discrete Schroedinger problem on the integer line and on graphs. Starting from the definition of the discrete Laplacian on the integer line, I will explain why the problem is interesting, how the discrete case relates to the continuous case, and what the open problems are. Recent results by the speaker (joint with Evans Harrell) will be presented.The talk will be accessible to anyone who knows arithmetic and matrix multiplications.
Wednesday, November 9, 2011 - 12:05 , Location: Skiles 005. , Andrzej Swiech , Georgia Tech. , Organizer:
I will give a brief introduction to the theory ofviscosity solutions of second order PDE. In particular, I will discussHamilton-Jacobi-Bellman-Isaacs equations and their connections withstochastic optimal control and stochastic differentialgames problems. I will also present extensions of viscositysolutions to integro-PDE.
Wednesday, November 2, 2011 - 12:05 , Location: Skiles 005 , Evans Harrell , School of Mathematics, Georgia Tech , Organizer:
Eigenvalues of linear operators often correspond to physical observables; for example they determine the energy levels in quantum mechanics and the frequencies of vibration in acoustics. Properties such as the shape of a system are encoded in the the set of eigenvalues, known as the "spectrum," but in subtle ways. I'll talk about some classic theorems about how geometry and topology show up in the spectrum of differential operators, and then I'll present some recent work, with connections to physical models such as quantum waveguides, wires, and graphs.
Wednesday, October 26, 2011 - 12:05 , Location: Skiles 005 , Silas Alben , School of Mathematics, Georgia Tech , Organizer:
Vortex methods are an efficient and versatile way to simulate high Reynolds number flows. We have developed vortex sheet methods for a variety of flows past deforming bodies, many of which are biologically inspired. In this talk we will present simulations and asymptotic analysis of selected problems. The first is a study of oscillated and freely-swimming flexible foils. We analyze the damped resonances that determine propulsive performance. The second problem involves multiple passive flapping flags" which interact through their vortex wakes. The third problem is a study of flexible falling sheets. Here the flag-flapping instability helps us determine the terminal falling speeds.
Wednesday, October 12, 2011 - 12:05 , Location: Skiles 005 , Greg Blekherman , Georgia Tech , Organizer:
A multivariate real polynomial p(x) is nonnegative if p(x) is at least 0 for all x in R^n. I will review the history and motivation behind the problem of representing nonnegative polynomials as sums of squares. Such representations are of interest for both theoretical and practical computational reasons, with many applications some of which I will present. I will explain how the problem of describing nonnegative polynomials fits into convex algebraic geometry: the study of convex sets with underlying algebraic structure, that brings together ideas of optimization, convex geometry and algebraic geometry. I will end by presenting current research problems in this area.
Wednesday, September 21, 2011 - 12:05 , Location: Skiles 005 , Amit Einav , Georgia Tech , Organizer:
Sharp trace inequalities play a major role in the world of Mathematics. Not only do they give a connection between 'boundary values' of the trace and 'interior values' of the function, but also the truest form of it, many times with a complete classification of when equality is attained. The result presented here, motivated by such inequality proved by Jose' Escobar, is a new trace inequality, connecting between the fractional laplacian of a function and its restriction to the intersection of the hyperplanes x_(n)=0, x_(n-1)=0, ..., x_(n-j+1)=0 where 1<=j<=n. We will show that the inequality is sharp and discussed the natural space for it, along with the functions who attain equality in it. The above result is based on a joint work with Prof. Michael Loss.
Wednesday, September 14, 2011 - 12:05 , Location: Skiles 005. , Rafael De La Llave , Georgia Tech. , Organizer:
Starting in the 30's Physicists were concerned with the problem of motion of dislocations or the problem of deposition of materials over a periodic structure. This leads naturally to a variational problem (minimizing the energy). One wants to know very delicate properties of the minimizers, which was a problem that Morse was studying at the same time. The systematic mathematical study of these problems started in the 80's with the work of Aubry and Mather who developed the basis to deal with very subtle problems. The mathematics that have become useful include dynamical systems, partial differential equations, calculus of variations and numerical analysis. Physical intuition also helps. I plan to explain some of the basic questions and, perhaps illustrate some of the results.
Wednesday, April 20, 2011 - 12:00 , Location: Skiles 006 , , School of Mathematics - Georgia Institute of Technology , Organizer:

Hosts: Amey Kaloti and Ricardo Restrepo

Fourier series provide a way of writing almost any signal as a superposition of pure tones, or musical notes.  But this representation is not local, and does not reflect the way that music is actually generated by instruments playing individual notes at different times.  We will discuss time-frequency representations, which are a type of local Fourier representation of signals.  This gives us a mathematical model for representing music.  While the model is crude for music, it is in fact apowerful mathematical representation that has appeared widely throughout mathematics (e.g., partial differential equations), physics (e.g., quantum mechanics), and engineering (e.g., time-varying filtering).  We ask one very basic question: are the notes in this representation linearly independent?  This seemingly trivial question leads to surprising mathematical difficulties.
Wednesday, April 13, 2011 - 12:05 , Location: Skiles 005 , Maria Westdickenberg , Georgia Tech , Organizer:
Hot fluid expands.  Expansion makes a fluid parcel'' lighter, causing it to rise.  Cold, dense patches of fluid sink.  And there we have the thermally induced motion of a fluid sitting on a hot plate...  A longstanding open problem in applied analysis is the scaling of the Nusselt number (with respect to the Rayleigh number or, equivalently, system height) in thermal convection.  The goal is a fundamental understanding of the effect of buoyancy-induced convection on heat transport in chaotic systems.  The commonly held belief that the Nusselt number scales like (Ra)^(1/3) has eluded analytical proof for decades.  We will describe the nature of the questions involved, the way that they can be framed (and reframed) mathematically, and the partial successes so far, including a recent preprint by Otto and Seis and a work in progress by the same authors


text:
# What do atoms when they share electron pairs

###### Question:

What do atoms when they share electron pairs

### In guinea pigs, short hair is dominant over long hair. If a short haired SS guinea pig is crossed with a long haired SS guinea pig, all of the resulting offspring will have ________ hair. a. short b. long

In guinea pigs, short hair is dominant over long hair. If a short haired SS guinea pig is crossed with a long haired SS guinea pig, all of the resulting offspring will have ________ hair. a. short b. long...

### Alyssa wants to know the gas mileage of her new car. She kept track of the number of miles she traveled and the number of gallons she used. Which method and reasoning can Alyssa use to calculate the gas mileage in miles per gallon?

Alyssa wants to know the gas mileage of her new car. She kept track of the number of miles she traveled and the number of gallons she used. Which method and reasoning can Alyssa use to calculate the gas mileage in miles per gallon?...

### What is a statement that is true about home pay

What is a statement that is true about home pay...

### Help. will give brainliest

help. will give brainliest...

### A car traveling 100 miles in 2 hours has a unit rate of _miles per hour ?

a car traveling 100 miles in 2 hours has a unit rate of _miles per hour ?...

### Potential results from changes in global phytoplankton populations are?

Potential results from changes in global phytoplankton populations are?...

### The length of a lap on a running track depends on the lane. Greg runs one lap in lane 4, one lap in lane 5, and one lap in lane 6. What is the total distance Greg runs?

The length of a lap on a running track depends on the lane. Greg runs one lap in lane 4, one lap in lane 5, and one lap in lane 6. What is the total distance Greg runs?...

### This alkene can be prepared via Wittig reaction. Draw structural formulas for the aldehyde and the Wittig reagent.

This alkene can be prepared via Wittig reaction. Draw structural formulas for the aldehyde and the Wittig reagent....

### Complétez Complete each sentence with the correct form of the adjective in parentheses. 1. Christophe et Tiffany sont (agréable). 2. Henri et moi, nous sommes (français). 3. Les étudiantes sont très (occupé). 4. La littérature est (intéressant). 5. Les actrices japonaises sont (réservé).

Complétez Complete each sentence with the correct form of the adjective in parentheses. 1. Christophe et Tiffany sont (agréable). 2. Henri et moi, nous sommes (français). 3. Les étudiantes sont très (occupé). 4. La littérature est (intéressant). 5. Les actrices japonaises sont (réservé)....

### Combine these simple sentences using parallel structure. The convict tried to plead with the guards. The convict shouted at the guards. The convict ended by threatening the guards.

Combine these simple sentences using parallel structure. The convict tried to plead with the guards. The convict shouted at the guards. The convict ended by threatening the guards....

###  __________ compositions, such as picasso's bottle of suze, use a technique known as __________ to emphasize the form of the object and its construction rather than its disintegration.

 __________ compositions, such as picasso's bottle of suze, use a technique known as __________ to emphasize the form of the object and its construction rather than its disintegration....

### Find the surface area of the prism. Can you show the work please?

Find the surface area of the prism. Can you show the work please?...

### What was the opening price of Dow Jones Industrial Average on May 22, 2017 in the format of XXXXX.XX?

What was the opening price of Dow Jones Industrial Average on May 22, 2017 in the format of XXXXX.XX?...

### Use these wallpapers lol use me as your wallpaper and i give you brainlist also show me proof

use these wallpapers lol use me as your wallpaper and i give you brainlist also show me proof...

### There are 47 people attending a play at an outdoor theater they are 11 groups of people sitting in groups of three or five how many groups of each size are there

There are 47 people attending a play at an outdoor theater they are 11 groups of people sitting in groups of three or five how many groups of each size are there...

### Brainiest for whoever solves this for me, Thank you!

Brainiest for whoever solves this for me, Thank you!...

### Mrs Low has some money to buy plates and bowls for her new house.If she buys p plates at $12 each, she will have$3 left.If she buys (p + 4) bowls at $7 each, she will have$5 left.(i) Find the value of p.(ii) How much money does Mrs Low have to buy plates and bowls?(iii) Mrs Low decides to buy 5 plates.She uses the remaining money to buy bowls.How many bowls can she buy?

Mrs Low has some money to buy plates and bowls for her new house.If she buys p plates at $12 each, she will have$3 left.If she buys (p + 4) bowls at $7 each, she will have$5 left.(i) Find the value of p.(ii) How much money does Mrs Low have to buy plates and bowls?(iii) Mrs Low decides to buy 5 pl...

### If you get a chance to set up a garden at your school, what kind of a garden will you set up? Why?

If you get a chance to set up a garden at your school, what kind of a garden will you set up? Why?...


text:
# Could a bank simply eliminate a loan from its books?

Assume a bank gives a loan to Mr X. for, say 100. The bank's assets (account "loans") increases by 100, and its liability (account "deposits") also go up by 100 (which is the extra 100 added to the current account of that who asked for the loan).

Say Mr. X does not want to pay the loan+interest. The bank is, by law, entitled to them, so it can perfectly use the law to reclaim the money and interest back (maybe possessing some material wealth like a house or other collateral used to secure the loan in the first place). However, can a bank, in theory, simply erase the loan and deposit? Can it simply eliminate the 100 from both assets and liabilities? Would not this way the bank be exactly the same as in the beginning?

PS: sorry I am asking many questions. I am study economics and banking and cannot understand everything very well. It is great to have a place here to improve my knowledge

• The deposit will usually be long gone, though, won't it? Mr. X borrowed the money to use it, not save it. – 410 gone Nov 20 '17 at 15:27
• @EnergyNumbers Im confused. So, when Mr X uses the 100 to pay the money, it still owes 100 to the bank, which is recorded in the bank assets. Which is the counterpart to this asset then? – user928172 Nov 20 '17 at 16:04
• Say Mr. X spent his 100 at shop Y which banks at bank Z. When the payment clears, X's bank now has a liability to bank Z – 410 gone Nov 20 '17 at 16:53
• @EnergyNumbers If X cashes all the money, and buy something at a store, which deposites in Bank Z, how does Bank X knows about Bank Z? What is the account that the liability takes in Bank X, in your example? Is it still as deposits (but in other banks?) Sounds VERY strange. – user928172 Nov 20 '17 at 20:48

If Mr. X hasn't used the money, so it's all still in a deposit account at the same bank, then the bank may be able to cancel the loan. Whether they can or not, will depend on the exact contract attached to the loan.

If Mr. X has withdrawn the money as cash, then that transaction represented a drop in the bank's liability to Mr. X of 100, and a drop in the bank's assets of cash-at-hand of 100.

If Mr. X has used the money in a digital transaction, then they can no longer cancel both at the same time, as the asset of the loan is with Mr. X, but its matching liability will be with another party.

In either of the last two cases, the bank can cancel the loan, reducing its assets by 100. The balancing transaction will be a reduction in the bank's equity of 100 - i.e. the bank records a net loss on the loan of 100, and the shareholders make a loss of 100 on the transaction as a result.

(because assets = liabilities + equity)

• With which party? In what form is it recorded in the balance sheet? Take the example of cash that I gave in the comments. Neither Mick nor your answer has dealt with this issue, which is interesting to me. THanks! – user928172 Nov 21 '17 at 12:02
• @user928172 I've updated the answer - does that clear up the cash issue? – 410 gone Nov 21 '17 at 12:47
• Let me see if I understand. when the loan is aproved, credit account in asset goes up by 100, and bank deposits in liabilities go up by 100. If I get cash out, deposit fall by 100, and cash (asset) falls by 100. If bank were to erase the loan, it would eliminate 100 in the credit account, and then 100 as losses in equity? – user928172 Nov 21 '17 at 12:54
• @user928172 correct – 410 gone Nov 21 '17 at 13:00
• This is the thing I don't understand. When granting the loan, the bank creates the money Ex Nihilo. So when the loan does not get redeemed, the bank just loses something it created 5mn ago, I don't really understand how this can be considered a "real" loss. – Elouan Keryell-Even Nov 15 '20 at 10:58

Yes, it can eliminate a loan (an asset), but assets have to equal liabilities, so it would also need to eliminate a liability.

It can't just eliminate any liability. It couldn't eliminate any deposit liabilities, for example, because it still owes money to depositors. This doesn't change just because a loan is written down.

If the loan is worth 100, it would have to eliminate 100 from shareholder equity (a liability). Shareholders would take a loss as a result of the bank writing down the loan.

The end result wouldn't be the same as how the bank started out. In the most simple case the bank started out with:

Start: 100 shareholder equity (Liabilities) and 100 cash (Assets).

It made the loan from cash: 100 shareholder equity (Liabilities) and 100 loan (Assets).

After writing down the loan: 0 shareholder equity (Liabilities) 0 loan (Assets).

The bank blew 100 in cash, which ultimately came out of the shareholders' pockets.

If Mr X has not spent the money yet and has not taken it out of the bank in the form of cash then in theory a bank cancelling both the assets and liabilities would bring it back to how it was before the loan took place.

If Mr X spent the money, buying something from person Y the situation can no longer be undone by simply cancelling assets/liabilities because the liabilities are now liabilities to Y.

• But how does the bank of Mr X knows where person Y deposits the money? If the shop is done by cash, they cannot know! Unless they trace the phisical money, which is very odd. What if Y keeps the money as cash? – user928172 Nov 20 '17 at 20:50
• If the purchase was made with cash then step one is that X withdraws the cash - which already makes the loan non-undoable. – Mick Nov 20 '17 at 23:27
• Ok, so once the withdrawal occurs, what is recorded in the Bank accounts? How are liabilities and assets matched? – user928172 Nov 21 '17 at 12:01
• After the withdrawal the bank has paid out its liability to X and so has no further liability, i.e. its liabilities to X have gone to zero. The bank's capital has now been reduced by \$100. The bank still has the asset of the loan, i.e. it has a document that compels X to pay it \$100. – Mick Nov 21 '17 at 12:20
• Capital?? Really? So every time I withdraw money from a bank I am depleting its capital? But if money was created out of nothing. How can capital be decreasing? How sure are you about this? Do you know of a book covering this? – user928172 Nov 21 '17 at 12:38


text:
## Economics of Weblogging...

Mickey Kaus writes:

Mickey Kaus: I had been making in the mid-90s, and then I had to take a pay cut.... I’m fortunate to make any money as a blogger. There are some who make more. Most of them work for The Atlantic...

Mickey Kaus has written 54 posts in the past ten weeks--that's an average of 5.4 posts for each week in which he makes $1,800, or$333 a weblog post. This seems to me to be way out of line--suggesting some major source of labor-market monopoly is preventing Slate from rationalizing its labor costs.

For example:

• Ta-Nehisi Coates has produced 53 posts in the past 14 days--which, by my calculations, makes me think that the Atlantic really ought to be paying him $720,000 a year if it were to pay on the Slate scale. • Ezra Klein--whose existence appears to torment Mickey Kaus every waking and sleeping moment--has put up 77 high quality posts[1] in the past week, for a Kaus-scale equivalent warranted salary of$1,140,000 a year...

• And Matthew Yglesias's home page at the moment has 25 posts all of which have been written in the past 60 hours--that's 0.417 posts per hour in which he makes $2.46, or$5.90 per post. Matthew Yglesias is thus 56 times more productive in a cost-per-post metric--plus there is, I believe, an enormous quality differential. Pay-for-performance would, I think, require that the Center for American Progress ought to be paying him \$8,000,000 a year.

[1] Compare:

Ezra Klein: The public option: Very alive or totally dead? The public option letter in the Senate has more than 40 signatories now. That would seem to push it well beyond the point of viability. But with Nancy Pelosi saying that the Senate doesn't have the votes and "it's not in the reconciliation," it's not exhibiting many signs of life. As far as I can tell, the story of the public option's resurgence has been a mixture of smart organizing and Senate cowardice. Few senators wanted to stand against the thing. But nor did they want to bring it back into play. So a number of them signed the letter under pressure, waiting and hoping that someone else -- maybe the leadership or the White House -- would figure this out for them. The White House and Pelosi have attempted a version of that. They're not coming out against the public option push; they're just saying the votes don't exist. And maybe they don't. The letter has 41 senators signed on, which is still fewer than 50. But the proper way to decide this is with a vote. Sen. Bernard Sanders has promised to bring the public option up in an amendment to the reconciliation package. Good. And if it passes, then Republicans can take a good, long look in the mirror and ask themselves if forcing the Democrats to use a reconciliation strategy rather than compromising to make the bill friendlier to conservative insights was really such a good idea. I don't think it would be the worst thing in the world if relentless obstruction imposed policy costs on Republicans.

Mickey Kaus: Unions vs. Liberalism, Part XXIII: Obama's compromise health care plan is out, and "the impact on the politics will be tremendous," gushes WaPo's health care cheerleader Ezra Klein. "The release of this plan marks the end of the Scott Brown election and the resumption of the health-care process." It enables the Democrats to "take back control of the media's narrative," just as they did when they waited out the Tea Parties last August, then "used the president's big speech to pivot to the release and subsequent passage of the Senate Finance Committee's bill."... Remember the stunning success of the president's speech? It's right here on this graph--if you squint hard you can see the temporary pause in the seemingly ineluctable rise in public opposition to Obama's health care reform right around the beginning of September. It lasted a couple of weeks. Then opposition started rising again. Now it's over 50%, with support ten points lower.... The Dems must have lost "control of the media's narrative"! Does Klein really believe this stuff? I don't know which answer would be more embarrassing.... P.S.: It would be one thing if Klein was relaying the White House spin with an implausibly straight face, but relaying it as White House spin (saying, for example, 'Obama aides believe the plan will mark the end of the Scott Brown election, letting them take back control of the media's narrative'). Then he'd be Marc Ambinder.... Update--It's a Chait Accompli! Megan McArdle provides a useful antidote to the premature anti-gloating of Klein's fellow JournoLister Jon Chait. ...See also Barone and Hennessy. ... P.S.: Is the double-secret JournoList cocoon encouraging this misjudgment? Even reported Journolister Paul Krugman's "guardedly optimistic." I don't think he should be...

UPDATE: An Anonymous Coward emails;

According to Alexa, Kaus ranks 376,526 as compared to, say, Atrios's 59,744 and Kos's 3,665. I'm not sure these are accurate data, but it would be irresponsible not to consider them.... Once Alexa goes down beyond the big sites, the noise starts to overwhelm the signal. Kaus could be considerably above or below the 376,000 rank. But then that is the point--if you are down among the tiddlers, you're down among the tiddlers...


text:
### Forced Second Order Differential Equations

#### Definition

A forced second order ordinary differential equation with constant coefficients is a differential equation in the form

$a\frac{\mathrm{d}^2y}{\mathrm{d} x^2} + b\frac{\mathrm{d} y}{\mathrm{d} x} + cy = f(x),$

where $a$, $b$ and $c$ are real numbers and $f(x)$ is a function of $x$. The function $f(x)$ is known as the forcing term or forcing function. The right-hand side can be any function; this page covers the three most common categories: polynomials, trigonometric and exponential.

Note: This form of differential equation is similar to the homogeneous second order differential equation, where $0$ appears on the right-hand side:

$a\frac{\mathrm{d}^2y}{\mathrm{d} x^2} + b\frac{\mathrm{d} y}{\mathrm{d} x} + cy = 0.$

To solve forced differential equations it is necessary to be familiar with the method for solving homogeneous equations.

#### Solving Forced Differential Equations

The difficulty in solving this type of problem is trying to find a function which, when put through the differential equation, correctly gives the right-hand side. This is not always straightforward and often comes down to guessing a general form of a solution, and then substituting it into the differential equation to find a solution that fits. This function is known as the particular solution, $y_p$. There are some general rules to follow when dealing with the three categories of function given above.

The particular solution is not enough to fully solve the problem as it will not have any arbitrary constants which would satisfy the boundary conditions. However, a general solution to the homogeneous form of the same equation can be used to satisfy the boundary conditions. Since this second solution is reduced to zero by the differential equation it will not affect the particular solution's ability to give the correct right-hand side. The function that solves the homogeneous equation is known as the complementary function, $y_c$. The general solution to the differential equation is given by adding the particular and homogeneous parts together:

$y = y_c + y_p.$

The following examples demonstrate this method for each of the types of function most commonly found on the right-hand side.

#### Worked Examples

###### Example 1

Find the solution to the equation:

$\frac{\mathrm{d}^2y}{\mathrm{d} x^2} + \frac{\mathrm{d} y}{\mathrm{d} x} - 2y = x^2,$

subject to boundary conditions $y(0) = 0$ and $y'(0) = 0$.

###### Solution

Start by finding the particular solution. As an $x^2$ appears on the right-hand side it is sensible to assume that the particular solution is a quadratic polynomial. Guess that the particular solution is of the form:

$y_p = Ax^2 + Bx + C.$

To find $A$, $B$ and $C$, substitute this solution into the differential equation. The first and second derivatives of $y_p$ are:

\begin{align} y'_p &= 2Ax + B, \\ y''_p &= 2A. \end{align}

Substituting these into the differential equation gives:

$2A + 2Ax + B - 2(Ax^2 + Bx + C) = x^2.$

Multiplying out the left-hand side and collecting powers of $x$ gives:

$-2Ax^2 + (2A-2B)x + 2A + B - 2C = x^2.$

Equating coefficients of the powers of $x$ on both sides of the equal sign gives a system of simultaneous equations for $A$, $B$ and $C$:

\begin{align} -2A &= 1, \\ 2A - 2B &= 0, \\ 2A + B - 2C &= 0. \end{align}

From the first equation, $A = -\frac{1}{2}$. Substituting that into the second equation gives $B = -\frac{1}{2}$. Substituting these values for $A$ and $B$ into the third equation gives $C = -\frac{3}{4}$.

The particular solution is therefore:

$y_p = -\frac{1}{2}x^2 - \frac{1}{2}x - \frac{3}{4}.$

This solution produces a single $x^2$ when substituted into the differential equation, however does not give a solution that satisfies the boundary conditions. To satisfy the boundary conditions it is necessary to solve the homogeneous equation:

$\frac{\mathrm{d}^2y_c}{\mathrm{d} x^2} + \frac{\mathrm{d} y_c}{\mathrm{d} x} - 2y_c = 0,$

where the subscript $c$ indicates that this is the complementary function. The auxiliary equation is:

$\lambda^2 + \lambda - 2 = 0,$

giving $\lambda_1 = 1$ and $\lambda_2 = -2$. The complementary function is therefore:

$y_c = \hat{A} e^x + \hat{B} e^{-2x},$

where $\hat{A}$ and $\hat{B}$ are arbitrary constants. The hat notation has been introduced to emphasise that these are not the same $A$ and $B$ that appeared when finding the particular solution.

Note: To find the values of $\hat{A}$ and $\hat{B}$ that satisfy the given problem it is necessary to apply the boundary conditions to the full solution and not just the complementary function. The full general solution must be formed before solving for $\hat{A}$ and $\hat{B}$.

Recall that the full general solution is the sum of the particular solution and the complementary function:

$y(x) = y_c + y_p.$

The general solution for the given equation is therefore:

$y(x)= \hat{A} e^x + \hat{B} e^{-2x} - \frac{1}{2}x^2 - \frac{1}{2}x - \frac{3}{4}.$

To solve the second boundary condition we will also need the first derivative of $y$:

$y'(x) = \hat{A} e^x - 2\hat{B} e^{-2x} - x - \frac{1}{2}.$

Applying the boundary conditions gives::

\begin{align} y(0) &= \hat{A} + \hat{B} - \frac{3}{4} = 0, \\ y'(0) &= \hat{A} - 2\hat{B} - \frac{1}{2} = 0. \end{align}

Rearranging the first equation gives $\hat{A} = \frac{3}{4} - \hat{B}$. Substituting this into the second equation gives $\frac{1}{4} - 3\hat{B} = 0$, so $\hat{B} = \frac{1}{12}$ and $\hat{A} = \frac{2}{3}$.

Substituting these values of $\hat{A}$ and $\hat{B}$ into the general solution gives the solution that satisfies the given boundary conditions:

$y = \frac{2}{3} e^x - \frac{1}{12} e^{-2x} - \frac{1}{2}x^2 - \frac{1}{2}x - \frac{3}{4}.$

###### Video Example 1

Newcastle University Maths-Aid solves the differential equation $\displaystyle \frac{\mathrm{d}^2y}{\mathrm{d} x^2}+\frac{\mathrm{d} y}{\mathrm{d} x}-2y=x^2$ subject to the boundary conditions $y(0)=0$ and $y'(0)=0$.

###### Example 2

Find the general solution to:

$\frac{\mathrm{d}^2y}{\mathrm{d} x^2} + 4y = e^{3x}.$

###### Solution

Start by finding the particular solution. The only function that can differentiate to give a term containing $e^{3x}$ is $Ae^{3x}$, so guess that the particular solution is:

$y_p=A e^{3x}.$

Substituting this into the differential equation gives:

$9A e^{3x} + 4A e^{3x} = e^{3x}.$

The terms on the left-hand side can be collected:

$13A e^{3x} = e^{3x}.$

Solving for $A$ gives $A = \frac{1}{13}$ and the particular solution is therefore:

$y_p = \frac{1}{13} e^{3x}.$

Once again, this solution does not include arbitrary constants so the complementary function is necessary for a complete solution to the equation. Recall that the complementary function is found by solving the homogeneous form of the equation:

$\frac{d^2y_c}{dx^2} + 4y_c = 0.$

The auxiliary equation is:

$\lambda^2 + 4 = 0.$

The roots of this are purely complex, $\lambda = \pm 2i$, thus the complementary function is given by:

$y_c = B\cos(2x) + C\sin(2x).$

Having not been given any boundary conditions, this cannot be solved for the arbitrary constants $B$ and $C$, so it is sufficient to give the full general solution:

\begin{align} y &= y_c + y_p \\ &= B\cos(2x) + C\sin(2x) + \frac{1}{13} e^{3x}. \end{align}

###### Video Example 2

Newcastle University Maths-Aid finds the general solution to the differential equation $\displaystyle \frac{\mathrm{d}^2y}{\mathrm{d} x^2}+4y= e^{3x}$.

###### Example 3

Find the general solution to:

$\frac{\mathrm{d}^2y}{\mathrm{d} x^2} + \frac{\mathrm{d} y}{\mathrm{d} x} - 2y = \sin{x}.$

###### Solution

Start by finding the particular solution. Since the function on the right-hand side is a trigonometric function, it is sensible to assume that the particular solution is also trigonometric. Guess that the particular solution is of the form:

$y_p = A\sin{x} + B\cos{x}.$

Note: A common mistake is to only include one of the trigonometric functions in the guess for the particular solution. Since the differential equation includes both the first and second derivatives of $y$, both $\sin{x}$ and $\cos{x}$ must be included in the guess for $y_p$ to ensure that terms involving $\sin{x}$ and $\cos{x}$ will also appear in the terms $y_p''$ and $y_p'$.

To find $A$ and $B$, substitute the guess for the particular solution $y_p$ into the differential equation. The first and second derivatives of $y_p$ are:

\begin{align} y'_p &= A\cos{x} - B\sin{x}, \\ y''_p &= -A\sin{x} - B\cos{x}. \end{align}

Substituting this into the differential equation gives:

$(-A\sin{x} - B\cos{x}) + (A\cos{x} - B\sin{x}) - 2(A\sin{x} + B\cos{x}) = \sin{x}.$

First collect the coefficients of the $\sin{x}$ and $\cos{x}$ terms:

$(-A-B-2A)\sin{x} + (-B+A-2B)\cos{x} = \sin{x}.$

The coefficients of each term can be equated with the coefficient of the corresponding term on the right-hand side:

\begin{align} -3A-B &= 1, \\ A-3B &= 0. \end{align}

Solving these simultaneously gives:

$A = -\frac{3}{10}, \quad B = -\frac{1}{10}.$

Thus the particular solution is:

$y_p = - \frac{3}{10}\sin{x} - \frac{1}{10}\cos{x}.$

This solution does not contain any arbitrary constants. The solution to a second order differential equation should include two arbitrary constants. The complementary function, which contains two arbitrary constants, must be found to complete the solution.

Recall that the complementary function is found by solving the homogeneous equation:

$\frac{\mathrm{d}^2y_c}{\mathrm{d} x^2} + \frac{\mathrm{d} y_c}{\mathrm{d} x} - 2y_c = 0.$

The auxiliary equation is:

$\lambda^2 + \lambda - 2 = 0.$

The solutions to the auxiliary equation are $\lambda_1 = -2$ and $\lambda_2 = 1$, giving the complementary function:

$y_c = \hat{A} e^{-2x} + \hat{B} e^x,$

where $\hat{A}$ and $\hat{B}$ are arbitrary constants.

Hence the full general solution is:

\begin{align} y(x) &= y_c +y_p, \\ y(x) &= \hat{A} e^{-2x} + \hat{B} e^x - \frac{3}{10}\sin{x} - \frac{1}{10}\cos{x}. \end{align}

###### Video Example 3

Newcastle University Maths-Aid finds the general solution to the differential equation $\displaystyle \frac{\mathrm{d}^2y}{\mathrm{d} x^2}+\frac{\mathrm{d} y}{\mathrm{d} x}-2y=\sin{x}.$

###### Example 1

Find the general solution to:

$\frac{\mathrm{d}^2y}{\mathrm{d} x^2} - 4\frac{\mathrm{d} y}{\mathrm{d} x} + 3y = 4x + 3 e^{2x}.$

###### Solution

Note that the right-hand side of this equation includes both an exponential and a linear term; the particular solution is therefore likely to contain both an exponential term and a linear term. Guess that the particular solution is of the form:

$y_p = A e^{2x} + Bx + C$

To find $A$ and $B$, substitute this solution into the differential equation. The first and second derivatives of $y_p$ are:

\begin{align} y_p' &= 2A e^{2x}+B, \\ y_p'' &= 4A e^{2x}. \end{align}

Substituting these into the differential equation gives:

$4A e^{2x} - 4(2A e^{2x} + B) + 3(A e^{2x} + Bx + C) = 4x + 32^{2x}.$

Expanding the brackets and collecting the $e^{2x}$ terms, the $x$ terms and the constants gives:

$-A e^{2x} + 3Bx - 4B + 3C = 4x + 3 e^{2x}.$

Equating coefficients on both sides gives a set of three simultaneous equations for $A$, $B$ and $C$:

\begin{align} -A &= 3, \\ 3B &= 4, \\ -4B + 3C &= 0. \end{align}

Solving these gives $A = -3$, $B = \frac{4}{3}$ and $C = \frac{16}{9}$, so the particular solution is:

$y_p = -3 e^{2x} + \frac{4x}{3} + \frac{16}{9}.$

To complete the solution the complementary function $y_c$ must be found by solving the homogeneous equation:

$\frac{\mathrm{d}^2y_c}{\mathrm{d} x^2} - 4\frac{\mathrm{d} y_c}{\mathrm{d} x} + 3y_c = 0.$

The auxiliary equation is:

$\lambda^2 - 4\lambda + 3 = 0.$

The solutions to the auxiliary equation are $\lambda_1 = 1$ and $\lambda_2 = 3$, giving the complementary function:

$y_c = \hat{A} e^x + \hat{B} e^{3x}$

where $\hat{A}$ and $\hat{B}$ are arbitrary constants.

Hence the general solution to the differential equation is:

\begin{align} y(x) &= y_c+y_p \\ y(x) &= \hat{A} e^x + \hat{B} e^{3x} -3 e^{2x} + \frac{4x}{3} + \frac{16}{9}. \end{align}

###### Video Example 4

Newcastle University Maths-Aid finds the general solution to the differential equation $\displaystyle \frac{\mathrm{d}^2y}{\mathrm{d} x^2}-4\frac{\mathrm{d} y}{\mathrm{d} x}+3y=4x+3 e^{2x}.$


text:
# How do you solve and find the extraneous solutions for 2\sqrt{4-3x}+3=0?

Nov 23, 2014

$2 \sqrt{4 - 3 x} + 3 = 0$

by subtracting $3$,

$\implies 2 \sqrt{4 - 3 x} = - 3$

by dividing by $2$,

$\implies \sqrt{4 - 3 x} = - \frac{3}{2}$

(Notice that it is now clear that this equation has no real solution since the left-hand side cannot be negative.)

by squaring,

$\implies 4 - 3 x = \frac{9}{4}$

by subtracting $4$,

$\implies - 3 x = - \frac{7}{4}$

by dividing by $- 3$,

$\implies x = \frac{7}{12}$,

which is its extraneous solution.

I hope that this was helpful.


text:
# simnibs.Msh¶

class simnibs.Msh(nodes=None, elements=None, fn=None)

class to handle the meshes. Gatters Nodes, Elements and Data

Parameters
• nodes ((optional) simnibs.msh.Nodes) – Nodes structure

• elements ((optional) simnibs.msh.Elements()) – Elements structure

• fn (str (optional)) – Name of “.msh” file to be read. Overides nodes and elements

nodes

a Nodes field

Type

simnibs.msh.Nodes

elm

A Elements field

Type

simnibs.msh.Elements

nodedata

list of NodeData filds

Type

simnibs.msh.NodeData

elmdata

list of ElementData fields

Type

simnibs.msh.ElementData

fn

name of file

Type

str

binary

wheather or not the mesh was in binary format

Type

bool

__init__(nodes=None, elements=None, fn=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

 __init__([nodes, elements, fn]) Initialize self. add_element_field(field, field_name) Adds field defined in the elements add_node_field(field, field_name) Adds field defined in the nodes calc_matsimnibs(center, pos_ydir, distance) Calculate the matsimnibs matrix for TMS simulations compact_ordering(node_number) Changes the node and element ordering so that it goes from 1 to nr_nodes crop_mesh([tags, elm_type, nodes, elements]) Crops the specified tags from the mesh Generates a new mesh, with only the specified tags The nodes are also reordered elements_baricenters() Calculates the baricenter of the elements elements_volumes_and_areas() Calculates the volumes of tetrahedra and areas of triangles elm2node_matrix([elm_indices]) Calculates a sparse matrix to tranform from ElementData to NodeData Uses Superconvergent patch recovery for volumetric data. elm_node_coords([elm_nr, tag, elm_type]) Returns the position of each of the element’s nodes fields_summary([roi, fields, percentiles, …]) Creates a text summaty of the field find_closest_element(querry_points[, …]) Finds the closest node to each point in p find_corresponding_tetrahedra() Finds the tetrahedra corresponding to each triangle find_shared_nodes(tags) Finds the nodes which are shared by all given tags find_tetrahedron_with_points(points[, …]) Finds the tetrahedron that contains each of the described points using a stochastic walk algorithm fix_surface_labels() Fixels labels of surfaces fix_th_node_ordering() Fixes the node ordering of tetrahedra in-place fix_thin_tetrahedra([n_iter, step_length]) Optimize the locations of the points by moving them towards the center of their patch. fix_tr_node_ordering() Fixes the node ordering of the triangles in-place gaussian_curvature() Calculates the Gaussian curvature at each node intercept_ray(near, far) Finds the triangle (if any) that intercepts a line segment interp_matrix(pos[, out_fill, th_indices, …]) Calculates a matrix to perform interpolation y = M.dot(x) join_mesh(other) Join the current mesh with another nodes_areas() Areas for all nodes in a surface nodes_normals([smooth]) Normals for all nodes in a surface nodes_volumes_or_areas() Return the volume (volume mesh) if area (surface mesh) of all nodes Only works for ordered values of mesh and node indices open_in_gmsh() Opens the mesh in gmsh prepare_surface_tags() read_hdf5(hdf5_fn[, path, load_data]) Reads mesh information from an hdf5 file reconstruct_surfaces([tags]) Reconstruct the mhes surfaces for each label/connected component individually This function acts in-place, and will keep any surfaces already present in the mesh remove_from_mesh([tags, elm_type, nodes, …]) Removes the specified tags from the mesh Generates a new mesh, with the specified tags removed The nodes are also reordered test_inside_volume(points) Tests if points are iside the volume using the Möller–Trumbore intersection algorithm tetrahedra_quality() calculates the quality measures of the tetrahedra triangle_angles() Calculates minimum angle of the mesh triangles triangle_normals([smooth]) Calculates the normals of triangles view([visible_tags, visible_fields]) Visualize mesh in Gmsh write(out_fn) Writes out the mesh as a “.msh” file write_hdf5(hdf5_fn[, path, compression]) Writes a HDF5 file with mesh information

Attributes

 field Dictionary of fields indexed by their name


text:
Summer is Coming! Join the Game of Timers Competition to Win Epic Prizes. Registration is Open. Game starts Mon July 1st.

 It is currently 16 Jul 2019, 14:17

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track
Your Progress

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# What is y in terms of x ?

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
TAGS:

### Hide Tags

Manager
Joined: 22 Jun 2017
Posts: 71
Location: Brazil
GMAT 1: 600 Q48 V25
GPA: 3.5
WE: Engineering (Energy and Utilities)
What is y in terms of x ?  [#permalink]

### Show Tags

08 May 2018, 15:54
2
2
00:00

Difficulty:

5% (low)

Question Stats:

88% (01:30) correct 13% (02:31) wrong based on 80 sessions

### HideShow timer Statistics

If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

A) x

B) x – 6

C) x – 3

D) 2x + 3

E) 2x + 6
RC Moderator
Joined: 24 Aug 2016
Posts: 802
Location: Canada
Concentration: Entrepreneurship, Operations
GMAT 1: 630 Q48 V28
GMAT 2: 540 Q49 V16
Re: What is y in terms of x ?  [#permalink]

### Show Tags

08 May 2018, 16:15
1
1
FillFM wrote:
If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

A) x

B) x – 6

C) x – 3

D) 2x + 3

E) 2x + 6

$$5^x$$ – 5^(x–3) = (124)$$(5^y)$$
or $$5^x$$ – $$\frac{5^x}{5^3}$$ = $$(125-1)$$$$(5^y)$$
or $$\frac{(5^x*5^3-5^x)}{5^3}$$ = $$(5^3-1)$$$$(5^y)$$
or $$5^x*(5^3-1)$$ = $$(5^3-1)$$$$(5^y)(5^3)$$
or $$5^x$$ = 5^(y+3)
==> $$x=y+3$$
==>$$y=x-3$$ ..................Thus the answer is option C.
_________________
Please let me know if I am going in wrong direction.
Thanks in appreciation.
Manager
Joined: 03 Oct 2016
Posts: 124
Re: What is y in terms of x ?  [#permalink]

### Show Tags

08 May 2018, 18:58
1
FillFM wrote:
If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

A) x
B) x – 6
C) x – 3
D) 2x + 3
E) 2x + 6

$$5^x$$ – 5^(x-3) = (124)$$(5^y)$$
$$5^x$$ * (1 - 5^-3) = (124)$$(5^y)$$ ---- Take out $$5^x$$ common.
$$5^x$$ * $$\frac{(125 - 1)}{125}$$ = (124)$$(5^y)$$
$$5^x$$ * $$\frac{124}{125}$$ = (124)$$(5^y)$$
$$5^x$$ * $$\frac{1}{125}$$ = $$(5^y)$$ --- Striking out 124.
$$5^x$$ = 5^(y+3)

x=y+3 -> y= x- 3

Answer: (C).
_________________
Non-Allergic To Kudos
Senior Manager
Joined: 29 Dec 2017
Posts: 383
Location: United States
Concentration: Marketing, Technology
GMAT 1: 630 Q44 V33
GMAT 2: 690 Q47 V37
GMAT 3: 710 Q50 V37
GPA: 3.25
WE: Marketing (Telecommunications)
Re: What is y in terms of x ?  [#permalink]

### Show Tags

08 May 2018, 19:39
1
FillFM wrote:
If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

The shortest way is to substitute a real number for x. Let's say x =3, then $$5^3$$ – 5^(3–3) = (124)$$(5^y)$$
and it gives us that y = 0

A) x = 3
B) x – 6 = 3-6=-3
C) x – 3 = 0 - correct
D) 2x + 3 = 9
E) 2x + 6 = 12

Answer (C)
VP
Joined: 09 Mar 2016
Posts: 1273
Re: What is y in terms of x ?  [#permalink]

### Show Tags

29 May 2018, 12:50
seed wrote:
FillFM wrote:
If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

A) x
B) x – 6
C) x – 3
D) 2x + 3
E) 2x + 6

$$5^x$$ – 5^(x-3) = (124)$$(5^y)$$
$$5^x$$ * (1 - 5^-3) = (124)$$(5^y)$$ ---- Take out $$5^x$$ common.
$$5^x$$ * $$\frac{(125 - 1)}{125}$$ = (124)$$(5^y)$$
$$5^x$$ * $$\frac{124}{125}$$ = (124)$$(5^y)$$
$$5^x$$ * $$\frac{1}{125}$$ = $$(5^y)$$ --- Striking out 124.
$$5^x$$ = 5^(y+3)

x=y+3 -> y= x- 3

Answer: (C).

Hi pushpitkc

cab you expain based on which rule do we take out $$5^x$$ common

i mean if it were like this (2x+7x) i understand we take out common x --> x(2+7)

but in this case $$5^x$$ – $$5^{x-3}$$ = $$(124)$$$$(5^y)$$ how can we take common $$5^x$$ it is not even in the brackets and there is only only one $$5^x$$

Also how after this $$5^x$$ * $$\frac{1}{125}$$ = $$(5^y)$$ --- Striking out 124.

we get this $$5^x$$ = 5^(y+3)

thanks for your great help
Senior PS Moderator
Joined: 26 Feb 2016
Posts: 3360
Location: India
GPA: 3.12
What is y in terms of x ?  [#permalink]

### Show Tags

29 May 2018, 13:36
1
dave13 wrote:

Hi pushpitkc

cab you expain based on which rule do we take out $$5^x$$ common

i mean if it were like this (2x+7x) i understand we take out common x --> x(2+7)

but in this case $$5^x$$ – $$5^{x-3}$$ = $$(124)$$$$(5^y)$$ how can we take common $$5^x$$ it is not even in the brackets and there is only only one $$5^x$$

Also how after this $$5^x$$ * $$\frac{1}{125}$$ = $$(5^y)$$ --- Striking out 124.

we get this $$5^x$$ = 5^(y+3)

thanks for your great help

Hey dave13

The first step is to understand what happens to $$5^{x-3}$$.

$$5^{x+(-3)} = 5^{x}*5^{-3} = 5^{x}*\frac{1}{5^3} = 5^{x}*\frac{1}{125}$$

Now, $$5^x - 5^{x-3}$$ = $$5^x – 5^{x}*\frac{1}{125}$$ = $$5^x(1 - \frac{1}{125}) = \frac{124}{125} * 5^x$$

Now, since we have $$124$$ on both sides, we will finally get $$5^x = 5^y*125 = 5^y*5^3 = 5^{y+3}$$

Hope this helps you.
_________________
You've got what it takes, but it will take everything you've got
Target Test Prep Representative
Status: Head GMAT Instructor
Affiliations: Target Test Prep
Joined: 04 Mar 2011
Posts: 2823
Re: What is y in terms of x ?  [#permalink]

### Show Tags

14 Jul 2018, 19:13
FillFM wrote:
If $$5^x$$ – 5^(x–3) = (124)$$(5^y)$$, what is y in terms of x ?

A) x

B) x – 6

C) x – 3

D) 2x + 3

E) 2x + 6

5^x - 5^(x - 3) = (124)(5^y)

We see that 5^(x - 3) is common to both terms on the left side of the equation, so we factor it out:

5^(x - 3)(5^3 - 1) = (124)(5^y)

5^(x - 3)(124) = (124)(5^y)

5^(x - 3) = 5^y

Recall that when the bases are equal, we can equate the exponents:

x - 3 = y

Answer: C
_________________

# Jeffrey Miller

Head of GMAT Instruction

Jeff@TargetTestPrep.com
122 Reviews

5-star rated online GMAT quant
self study course

See why Target Test Prep is the top rated GMAT quant course on GMAT Club. Read Our Reviews

If you find one of my posts helpful, please take a moment to click on the "Kudos" button.

Re: What is y in terms of x ?   [#permalink] 14 Jul 2018, 19:13
Display posts from previous: Sort by

# What is y in terms of x ?

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne


text:
# Tag Info

2

GradientBoostClassifier is slower but more precise. In your case, it could be finding a better model without suffering from overfitting. Here are some of the main differences you are looking for. XGBClassifier was designed to be faster. However, XGBClassifier takes a few shortcuts in order to run faster. For example, to save time, XGBClassifier will use an ...

2

I am working almost on the same problem these days: I have tried two options using XGB Regression with different objective functions including: Using a linear regression objectiive function ("reg:linear" or "reg:squarederror") and transformed the target to the log space Using the gamma objective function ("reg:gamma"), which is useful for a skewed target ...

2

The amount of data you need depends on the problem (see this great article on learning curves), but in general xgboost is very data efficient like random forests and has found a lot of use where data is expensive to produce as in medicine. Try it out on your data and plot a learning curve - if it is under-fitting, you need more data.

2

These are several things you can try: Use quartic error, $(y - \hat{y})^4$, instead of quadratic error. This is going to penalize a lot big errors, way more than MSE. The issue is that this is not implemented in xgboost, and you would need to develop a custom loss. If your target is always positive, you can use the target as training weights. This will give ...

1

What you were told is a worst case scenario. With 5 labels, 20.01% is the lowest possible value that a model would need to choose one class over the other. If the probability for each of the 5 classes are almost equal then the probabilities for each would be approximately 20%. In this case, the model would be having trouble deciding which class is correct. ...

1

No. Xgboost is more like traditional ML algorithm. It doesn't need too much data and it also perform better than almost all ML algorithm

1

If you mean "how many times the same feature can appear in an [individual] tree", then you can use max_depth to indirectly limit the number of features included in a single tree, even down to one feature. Since XGBoost is designed to use weak learners, having a lower depth value is ok. model = XGBClassifier(max_depth=n) However, I think the ...

1

With Success already being the larger class, you probably shouldn't be using a scale_pos_weight larger than one: you want to scale the positive class's contribution to the loss function down rather than up. I suspect that's what's happening in the first case. With scale_pos_weight=75, the model ends up basically only caring about the positive class, ...

1

Performance of a model can be judged along several dimensions: Accuracy - Is the train-test validation performing well? Overfitting - Is the difference between training score and the validation score minimal? Efficiency - Is the model light-weight, does it compute and calculate fast? Complexity - Is the model easy to explain, does it use minimal ...

1

You can find a good explanation and example on creating a custom objective function here: https://xgboost.readthedocs.io/en/latest/tutorials/custom_metric_obj.html https://github.com/dmlc/xgboost/blob/master/demo/guide-python/custom_objective.py https://github.com/dmlc/xgboost/blob/master/demo/guide-python/custom_rmsle.py Original XGB code repo is here, you ...

1

I would try two different approaches: interpolate the missing values on a user level. work with the sunset of rows for which we actually have the glucose level. Then, I would compare the test accuracy of the model built with both methods. Remember that your test set has to be composed of rows for which you have the glucose level - you cannot build it with ...

1

Writing a custom loss function could be handy, but it may be simpler to just try to treat this as a class balance problem for your regression model. For starters, just try undersampling all of the higher and medium grades until they're close to balanced with your failing students. Given your number of data points and features you can probably still just ...

1

Try writing a custom loss function for a regression model! Keras' neural networks support this, for example. See https://stackoverflow.com/q/43818584/745868 (But many other libraries give support for this as well) The only special thing about your custom loss function is that it doesn't add up the error of a datapoint if min(pred_y, actual_y) >= THRESHOLD

1

The first question about missing data is always why is it missing? Have you checked or know why the data is missing and whether it is MAR, MCAR or not missing at random? If your data is MCAR imputation is generally fine and your lower test metric might simply indicate a suboptimal imputation strategy. In this case you could try MICE or similar more advanced ...

1

First you should define a metric that suits the problem $R^2$ in your case. Do a correct cross-validation and train test splits. And then choose in the cross validation which option has the best results for your model (imputing missing or xgboost no imputing). This way you are doing an empirical experiment and selecting the best result. Probably you want to ...

1

Flier values/skewed predictors will have a high influence on the regression model. If you want to counteract that, you have a few choices. 1) If your target is always non-zero, and if you expect the regression to be close to linear, you can try to use a log(), sqrt() or even boxcox() conversion transform on the target variable. This will help keep the large ...

Only top voted, non community-wiki answers of a minimum length are eligible