text:
4.2: Light and Material in OpenGL 1.1

In this section, we will see how to use light and material in OpenGL. The use of light and material must be enabled by calling glEnable(GL_LIGHTING). When lighting is disabled, the color of a vertex is simply the current color as set by glColor*. When lighting is enabled, the color of a vertex is computed using a mathematical formula that takes into account the lighting of the scene and the material properties that have been assigned to the vertex, as discussed in the previous section. Now it’s time to learn about the OpenGL commands that are used to configure lighting and to assign materials to objects.

It is common for lighting to be turned on for rendering some parts of a scene, but turned off for other parts. We will say that some objects are “lit” while others aren’t. For example, wireframe objects are usually drawn with lighting disabled, even if they are part of a scene in which solid objects are lit. But note that it is illegal to call glEnable or glDisable between calls to glBegin and glEnd, so it is not possible for part of a primitive to be lit while another part of the same primitive is unlit. (I should note that when lighting is enabled, it is applied to point and line primitives as well as to polygons, even though it rarely makes sense to do so.) Lighting can be enabled and disabled by calling glEnable and glDisable with parameter GL_LIGHTING. Light and material settings don’t have to be changed when lighting is turned off, since they are simply ignored when lighting is disabled.

To light a scene, in addition to enabling GL_LIGHTING, you must configure at least one source of light. For very basic lighting, it often suffices to call

glEnable(GL_LIGHT0);

This command turns on a directional light that shines from the direction of the viewer into the scene. (Note that the last character in GL_LIGHT0 is a zero.) Since it shines from the direction of the viewer, it will illuminate everything that the user can see. The light is white, with no specular component; that is, you will see the diffuse color of objects, without any specular highlights. We will see later in this section how to change the characteristics of this light source and how to configure additional sources. But first, we will consider materials and normal vectors.

Working with Material

Material properties are vertex attributes in that same way that color is a vertex attribute. That is, the OpenGL state includes a current value for each of the material properties. When a vertex is generated by a call to one of the glVertex* functions, a copy of each of the current material properties is stored, along with the vertex coordinates. When a primitive that contains the vertex is rendered, the material properties that are associated with the vertex are used, along with information about lighting, to compute a color for the vertex.

This is complicated by the fact that polygons are two-sided, and the front face and back face of a polygon can have different materials. This means that, in fact, two sets of material property values are stored for each vertex: the front material and the back material. (The back material isn’t actually used unless you turn on two-sided lighting, which will be discussed below.)

With all that in mind, we will look at functions for setting the current values of material properties. For setting the ambient, diffuse, specular, and emission material colors, the function is

void glMaterialfv( int side, int property, float* valueArray )

The first parameter can be GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK. It tells whether you are setting a material property value for the front face, the back face, or both. The second parameter tells which material property is being set. It can be GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, or GL_AMBIENT_AND_DIFFUSE. Note that it is possible to set the ambient and diffuse colors to the same value with one call to glMaterialfv by using GL_AMBIENT_AND_DIFFUSE as the property name. The last parameter to glMaterialfv is an array containing four float numbers. The numbers give the RGBA color components as values in the range from 0.0 to 1.0; values outside this range are actually allowed, and will be used in lighting computations, but such values are unusual. Note that an alpha component is required, but it is used only in the case of diffuse color: When the ver- tex color is computed, its alpha component is set equal to the alpha component of the diffuse material color.

The shininess material property is a single number rather than an array, and there is a different function for setting its value (without the “v” at the end of the name):

void glMaterialf( int side, int property, float value )

Again, the side can be GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK. The property must be GL_SHININESS. And the value is a float in the range 0.0 to 128.0.

Compared to the large number of versions of glColor* and glVertex*, the options for setting material are limited. In particular, it is not possible to set a material color without defining an array to contain the color component values. Suppose for example that we want to set the ambient and diffuse colors to a bluish green. In C, that might be done with

float bgcolor[4] = { 0.0, 0.7, 0.5, 1.0 }; glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, bgcolor );

With my JavaScript simulator for OpenGL, this would look like

var bgcolor = [ 0.0, 0.7, 0.5, 1.0 ]; glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, bgcolor );

And in the JOGL API for Java, where where methods with array parameters have an additional parameter to give the starting index of the data in the array, it becomes

float[] bgcolor = { 0.0F, 0.7F, 0.5F, 1.0F }; gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE, bgcolor, 0);

In C, the third parameter is actually a pointer to float, which allows the flexabilty of storing the values for several material properties in one array. Suppose, for example, that we have a C array

float gold[13] = { 0.24725, 0.1995, 0.0745, 1.0,      /* ambient */
0.75164, 0.60648, 0.22648, 1.0,    /* diffuse */
0.628281, 0.555802, 0.366065, 1.0, /* specular */
50.0                               /* shininess */
};

where the first four numbers in the array specify an ambient color; the next four, a diffuse color; the next four, a specular color; and the last number, a shininess exponent. This array can be used to set all the material properties:

glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, gold );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, &gold[4] );
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, &gold[8] );
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, gold[12] );

Note that the last function is glMaterialf rather than glMaterialfv, and that its third parameter is a number rather than a pointer. Something similar can be done in Java with

float[] gold = { 0.24725F, 0.1995F, 0.0745F, 1.0F,      /* ambient */
0.75164F, 0.60648F, 0.22648F, 1.0F,    /* diffuse */
0.628281F, 0.555802F, 0.366065F, 1.0F, /* specular */
50.0F                                  /* shininess */
};
gl.glMaterialfv( GL2.GL_FRONT_AND_BACK, GL2.GL_AMBIENT, gold, 0 );
gl.glMaterialfv( GL2.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, gold, 4 );
gl.glMaterialfv( GL2.GL_FRONT_AND_BACK, GL2.GL_SPECULAR, gold, 8 );
gl.glMaterialf( GL2.GL_FRONT_AND_BACK, GL2.GL_SHININESS, gold[12] );

The functions glMaterialfv and glMaterialf can be called at any time, including between calls to glBegin and glEnd. This means that different vertices of a primitive can have different material properties.

So, maybe you like glColor* better than glMaterialfv? If so, you can use it to work with material as well as regular color. If you call

glEnable( GL_COLOR_MATERIAL );

then some of the material color properties will track the color. By default, setting the color will also set the current front and back, ambient and diffuse material properties. That is, for example, calling

glColor3f( 1, 0, 0,);

will, if lighting is enabled, have the same effect as calling

glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, array );

where array contains the values 1, 0, 0, 1. You can change the material property that tracks the color using

void glColorMaterial( side, property );

where side can be GL_FRONT_AND_BACK, GL_FRONT, or GL_BACK, and property can be
GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, or GL_AMBIENT_AND_DIFFUSE. Neither glEnable nor glColorMaterial can be called between calls to glBegin and glEnd, so all
of the vertices of a primitive must use the same setting.

Recall that when glDrawArrays or glDrawElements is used to draw a primitive, the color values for the vertices of the primitive can be taken from a color array, as specified using glColorPointer. (See Subsection 3.4.2.) There are no similar arrays for material properties. However, if a color array is used while lighting is enabled, and if GL_COLOR_MATERIAL is also enabled, then the color array will be used as the source for the values of the material properties that are tracking the color.

Defining Normal Vectors

Normal vectors are essential to lighting calculations. (See Subsection 4.1.3.) Like color and material, normal vectors are attributes of vertices. The OpenGL state includes a current normal vector, which is set using functions in the family glNormal*. When a vertex is specified with glVertex*, a copy of the current normal vector is saved as an attribute of the vertex, and it is used as the normal vector for that vertex when the color of the vertex is computed by the lighting equation. Note that the normal vector for a vertex must be specified before glVertex* is called for that vertex.

Functions in the family glNormal* include glNormal3f, glNormal3d, glNormal3fv, and glNormal3dv. As usual, a “v” means that the values are in an array, “f” means that the values are floats, and “d” means that the values are doubles. (All normal vectors have three components). Some examples:

glNormal3f( 0, 0, 1 );  // (This is the default value.)
glNormal3d( 0.707, 0.707, 0.0 );
float normalArray[3] = { 0.577, 0.577, 0.577 };
glNormal3fv( normalArray );

For a polygon that is supposed to look flat, the same normal vector is used for all of the vertices of the polygon. For example, to draw one side of a cube, say the “top” side, facing in the direction of the positive y-axis:

glNormal3f( 0, 1, 0 ); // Points along positive y-axis
glVertex3fv(1,1,1);
glVertex3fv(1,1,-1);
glVertex3fv(-1,1,-1);
glVertex3fv(-1,1,1);
glEnd();

Remember that the normal vector should point out of the front face of the polygon, and that the front face is determined by the order in which the vertices are generated. (You might think that the front face should be determined by the direction in which the normal vector points, but that is not how its done. If a normal vector for a vertex points in the wrong direction, then lighting calculations will not give the correct color for that vertex.)

When modeling a smooth surface, normal vectors should be chosen perpendicular to the surface, rather than to the polygons that approximate the surface. (See Subsection 4.1.3.) Suppose that we want to draw the side of a cylinder with radius 1 and height 2, where the center of the cylinder is at (0,0,0) and the axis lies along the z-axis. We can approximate the surface using a single triangle strip. The top and bottom edges of the side of a cylinder are circles. Vertices along the top edge will have coordinates $$(\cos(a), \sin(a), 1)$$ and vertices along the bottom edge will have coordinates $$(\cos(a), \sin(a), -1)$$, where a is some angle. The normal vector points in the same direction as the radius, but its z-coordinate is zero since it points directly out from the side of the cylinder. So, the normal vector to the side of the cylinder at both of these points will be $$(\cos(a), \sin(a), 0)$$. Looking down the z-axis at the top of the cylinder, it looks like this:

When we draw the side of the cylinder as a triangle strip, we have to generate pairs of vertices on alternating edges. The normal vector is the same for the two vertices in the pair, but it is different for different pairs. Here is the code:

glBegin(GL_TRIANGLE_STRIP);
for (i = 0; i <= 16; i++) {
double angle = 2*3.14159/16 * i; // i 16-ths of a full circle
double x = cos(angle);
double y = sin(angle);
glNormal3f( x, y, 0 ); // Normal for both vertices at this angle.
glVertex3f( x, y, 1 ); // Vertex on the top edge.
glVertex3f( x, y, -1 ); // Vertex on the bottom edge.
}
glEnd();

When we draw the top and bottom of the cylinder, on the other hand, we want a flat polygon, with the normal vector pointing in the direction (0,0,1) for the top and in the direction (0,0,−1) for the bottom:

glNormal3f( 0, 0, 1);
glBegin(GL_TRIANGLE_FAN); // Draw the top, in the plane z = 1.
for (i = 0; i <= 16; i++) {
double angle = 2*3.14159/16 * i;
double x = cos(angle);
double y = sin(angle);
glVertex3f( x, y, 1 );
}
glEnd();

glNormal3f( 0, 0, 1 );
glBegin(GL_TRIANGLE_FAN); // Draw the bottom, in the plane z = -1
for (i = 16; i >= 0; i--) {
double angle = 2*3.14159/16 * i;
double x = cos(angle);
double y = sin(angle);
glVertex3f( x, y, -1 );
}
glEnd();

Note that the vertices for the bottom are generated in the opposite order from the vertices for the top, to account for the fact that the top and bottom face in opposite directions. As always, vertices need to be enumerated in counterclockwise order, as seen from the front.

When drawing a primitive with glDrawArrays or glDrawElements, it is possible to provide a different normal for each vertex by using a normal array to hold the normal vectors. The normal array works in the same way as the color array and the vertex array. To use one, you need to enable the use of a normal array by calling

glEnableClientState(GL_NORMAL_ARRAY);

The coordinates for the normal vectors must be stored in an array (or in an nio buffer for JOGL), and the location of the data must be specified by calling

glNormalPointer( type, stride, data );

The type specifies the type of values in the array. It can be GL_INT, GL_FLOAT, or GL_DOUBLE. The stride is an integer, which is usually 0, meaning that there is no extra data in the array between the normal vectors. And data is the array (or buffer) that holds the normal vectors, with three numbers for each normal.

With this setup, when glDrawArrays or glDrawElements is used to draw a primitive, the nor- mal vectors for the primitive will be pulled from the array. Note that if GL_NORMAL_ARRAY is not enabled, then all of the normal vectors for the primitive will be the same, and will be equal to the current normal vector as set by glNormal*.

The lighting equation assumes that normal vectors are unit normals, that is, that they have length equal to one. The default in OpenGL is to use normal vectors as provided, even if they don’t have length one, which will give incorrect results. However, if you call

glEnable(GL_NORMALIZE);

then OpenGL will automatically convert every normal vector into a unit normal that points in the same direction.

Note that when a geometric transform is applied, normal vectors are transformed along with vertices; this is necessary because a transformation can change the direction in which a surface is facing. A scaling transformation can change the length of a normal vector, so even if you provided unit normal vectors, they will not be unit normals after a scaling transformation. However, if you have enabled GL_NORMALIZE, the transformed normals will automatically be converted back to unit normals. My recommendation is to always enable GL_NORMALIZE as part of your OpenGL initialization. The only exception would be if all of the normal vectors that you provide are of length one and you do not apply any scaling transformations.

Working with Lights

OpenGL 1.1 supports at least eight light sources, which are identified by the constants GL_LIGHT0, GL_LIGHT1, . . . , GL_LIGHT7. (An OpenGL implementation might allow additional lights.) Each light source can be configured to be either a directional light or a point light, and each light can have its own diffuse, specular, and ambient intensities. (See Subsection 4.1.2.)

By default, all of the light sources are disabled. To enable a light, call glEnable(light), where light is one of the constants GL_LIGHT0, GL_LIGHT1, . . . . However, just enabling a light does not give any illumination, except in the case of GL_LIGHT0, since all light intensities are zero by default, with the single exception of the diffuse color of light number 0. To get any light from the other light sources, you need to change some of their properties. Light properties can be set using the functions

void glLightfv( int light, int property, float* valueArray );

The first parameter is one of the constants GL_LIGHT0, GL_LIGHT1, . . . , GL_LIGHT7. It specifies which light is being configured. The second parameter says which property of the light is being set. It can be GL_DIFFUSE, GL_SPECULAR, GL_AMBIENT, or GL_POSITION. The last parameter is an array that contains at least four float numbers, giving the value of the property.

For the color properties, the four numbers in the array specify the red, green, blue, and alpha components of the color. (The alpha component is not actually used for anything.) The values generally lie in the range 0.0 to 1.0, but can lie outside that range; in fact, values larger than 1.0 are occasionally useful. Remember that the diffuse and specular colors of a light tell how the light interacts with the diffuse and specular material colors, and the ambient color is simply added to the global ambient light when the light is enabled. For example, to set up light zero as a bluish light, with blue specular highlights, that adds a bit of blue to the ambient light when it is turned on, you might use:

float blue1[4] = { 0.4, 0.4, 0.6, 1 };
float blue2[4] = { 0.0, 0, 0.8, 1 };
float blue3[4] = { 0.0, 0, 0.15, 1 };
glLightfv( GL_LIGHT1, GL_DIFFUSE, blue1 );
glLightfv( GL_LIGHT1, GL_SPECULAR, blue2 );
glLightfv( GL_LIGHT1, GL_AMBIENT, blue3 );

It would likely take some experimentation to figure out exactly what values to use in the arrays to get the effect that you want.

The GL_POSITION property of a light is quite a bit different. It is used both to set whether the light is a point light or a directional light, and to set its position or direction. The property value for GL_POSITION is an array of four numbers (x,y,z,w), of which at least one must be non-zero. When the fourth number, w, is zero, then the light is directional and the point (x,y,z) specifies the direction of the light: The light rays shine in the direction of the line from the point (x,y,z) towards the origin. This is related to homogeneous coordinates: The source of the light can be considered to be a point at infinity in the direction of (x,y,z).

On the other hand, if the fourth number, w, is non-zero, then the light is a point light, and it is located at the point $$(x/w, y/w, z/w)$$. Usually, w is 1. The value (x,y,z,1) gives a point light at (x,y,z). Again, this is really homogeneous coordinates.

The default position for all lights is (0,0,1,0), representing a directional light shining from the positive direction of the z-axis, towards the negative direction of the z-axis.

One important and potentially confusing fact about lights is that the position that is specified for a light is transformed by the modelview transformation that is in effect at the time the position is set using glLightfv. Another way of saying this is that the position is set in eye coordinates, not in world coordinates. Calling glLightfv with the property set to GL_POSITION is very much like calling glVertex*. The light position is transformed in the same way that the vertex coordinates would be transformed. For example,

float position[4] = { 1,2,3,1 }

glLightfv(GL_LIGHT1, GL_POSITION, position);

puts the light in the same place as

glTranslatef(1,2,3);

float position[4] = { 0,0,0,1 }

glLightfv(GL_LIGHT1, GL_POSITION, position);

For a directional light, the direction of the light is transformed by the rotational part of the modelview transformation.

There are three basic ways to use light position. It is easiest to think in terms of potentially animated scenes.

First, if the position is set before any modelview transformation is applied, then the light is fixed with respect to the viewer. For example, the default light position is effectively set to (0,0,1,0) while the modelview transform is the identity. This means that it shines in the direction of the negative z-axis, in the coordinate system of the viewer, where the negative z-axis points into the screen. Another way of saying this is that the light always shines from the direction of the viewer into the scene. It’s like the light is attached to the viewer. If the viewer moves about in the world, the light moves with the viewer.

Second, if the position is set after the viewing transform has been applied and before any modeling transform is applied, then the position of the light is fixed in world coordinates. It will not move with the viewer, and it will not move with objects in the scene. It’s like the light is attached to the world.

Third, if the position is set after a modeling transform has been applied, then the light is subject to that modeling transformation. This can be used to make a light that moves around in the scene as the modeling transformation changes. If the light is subject to the same modeling transformation as an object, then the light will move around with that object, as if it is attached to the object.

The sample program glut/four-lights.c or jogl/FourLights.java uses multiple moving, colored lights and lets you turn them on and off to see the effect. The image below is taken from the program. There is also a live demo version on-line. The program lets you see how light from various sources combines to produce the visible color of an object. The source code provides examples of configuring lights and using material properties.

Global Lighting Properties

In addition to the properties of individual light sources, the OpenGL lighting system uses several global properties. There are only three such properties in OpenGL 1.1. One of them is the global ambient light, which is ambient light that doesn’t come from the ambient color property of any light source. Global ambient light will be present in the environment even if all of GL_LIGHT0, GL_LIGHT1, . . . are disabled. By default, the global ambient light is black (that is, its RGB components are all zero). The value can be changed using the function

void glLightModelfv( int property, float* value )

where the property must be GL_LIGHT_MODEL_AMBIENT and the value is an array containing four numbers giving the RGBA color components of the global ambient light as numbers in the range 0.0 to 1.0. In general, the global ambient light level should be quite low. For example, in C:

float ambientLevel[] = { 0.15, 0.15, 0.15, 1 };

glLightModelfv( GL_LIGHT_MODEL_AMBIENT, ambientLevel );

The alpha component of the color is usually set to 1, but it is not used for anything. For JOGL, as usual, there is an extra parameter to specify the starting index of the data in the array, and the example becomes:

float[] ambientLevel = { 0.15F, 0.15F, 0.15F, 0 };

gl.glLightModelfv( GL2.GL_LIGHT_MODEL_AMBIENT, ambientLevel, 0 );

The other two light model properties are options that can be either off or on. The properties are GL_LIGHT_MODEL_TWO_SIDE and GL_LIGHT_MODEL_LOCAL_VIEWER. They can be set using the function

void glLightModeli( int property, int value )

with a value equal to 0 or 1 to indicate whether the option should be off or on. You can use the symbolic constants GL_FALSE and GL_TRUE for the value, but these are just names for 0 and 1.

GL_LIGHT_MODEL_TWO_SIDE is used to turn on two-sided lighting. Recall that a polygon can have two sets of material properties, a front material and a back material. When two-sided lighting is off, which is the default, only the front material is used; it is used for both the front face and the back face of the polygon. Furthermore, the same normal vector is used for both faces. Since those vectors point—or at least are supposed to point—out of the front face, they don’t give the correct result for the back face. In effect, the back face looks like it is illuminated by light sources that lie in front of the polygon, but the back face should be illuminated by the lights that lie behind the polygon.

On the other hand, when two-sided lighting is on, the back material is used on the back face and the direction of the normal vector is reversed when it is used in lighting calculations for the back face.

You should use two-sided lighting whenever there are back faces that might be visible in your scene. (This will not be the case when your scene consists of “solid” objects, where the back faces are hidden inside the solid.) With two-sided lighting, you have the option of using the same material on both faces or specifying different materials for the two faces. For example, to put a shiny purple material on front faces and a duller yellow material on back faces:

glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, 1 ); // Turn on two-sided lighting.

float purple[] = { 0.6, 0, 0.6, 1 };
float yellow[] = { 0.6, 0.6, 0, 1 };
float white[] = { 0.4, 0.4, 0.4, 1 }; // For specular highlights.
float black[] = { 0, 0, 0, 1 };

glMaterialfv( GL_FRONT,GL_AMBIENT_AND_DIFFUSE,purple); //front material
glMaterialfv( GL_FRONT, GL_SPECULAR, white );
glMaterialf( GL_FRONT, GL_SHININESS, 64 );

glMaterialfv( GL_BACK,GL_AMBIENT_AND_DIFFUSE, yellow); //back material
glMaterialfv( GL_BACK, GL_SPECULAR, black ); // no specular highlights

This picture shows what these materials look like on a cylinder that has no top, so that you can see the back faces on the inside surface:

The third material property, GL_LIGHT_MODEL_LOCAL_VIEWER, is much less important. It has to do with the direction from a surface to the viewer in the lighting equation. By default, this direction is always taken to point directly out of the screen, which is true for an orthographic projection but is not for not accurate for a perspective projection. If you turn on the local viewer option, the true direction to the viewer is used. In practice, the difference is usually not very noticeable.


text:
## 305 -Fields (5)

February 27, 2009

At the end of last lecture we stated a theorem giving an easy characterization of subfields of a given field ${\mathbb F}.$ We begin by proving this result.

Theorem 18. Suppose ${\mathbb F}$ is a field and $S\subseteq{\mathbb F}.$ If $S$ satisfies the following 5 conditions, then $S$ s a subfield of ${\mathbb F}:$

1. $S$ is closed under addition.
2. $S$ is closed under multiplication.
3. $-a\in S$ whenever $a\in S.$
4. $a^{-1}\in S$ whenever $a\in S$ and $a\ne0.$
5. $S$ has at least two elements.

format: plain


text:
Debugging a kernel can be challenging. Sometimes a straightforward approach to debugging works: you can add log_printf() statements to the kernel, or console_printf() statements to user-level code, to print state and see how it evolves. Unfortunately, sometimes these techniques don’t work. For example, your kernel might be so messed up during early boot that the kernel cannot properly initialize the console used by log_printf(). In this scenario, you might at least be able to see whether the kernel is reaching a certain point by intentionally inserting an infinite loop into your kernel code—if your kernel hangs, the line of code representing the infinite loop was reached, but if your kernel crashes, the line was not reached.
In these situations, debugging Chickadee with gdb might be helpful. For example, suppose that you want to debug Chickadee as it runs p-testzombie.cc. From a terminal window in your Linux VM, do make run-gdb-testzombie; this will compile Chickadee and launch qemu as well as gdb. The qemu window will initially be paused. In your terminal window, you’ll see the gdb command line. From that command line, you can set breakpoints in both Chickadee code and user-level code like p-testzombie.cc. For example, you can set a breakpoint in p-testzombie.cc by typing break p-testzombie.cc:SOME_LINE_NUMBER into the gdb command line. Then, if you type continue, this will tell gdb to allow qemu to proceed with executing Chickadee. Later, when one of your breakpoints is hit, control will return to gdb. At this point, you can then type things like print SOME_VAR_NAME to see the value for a C++-level variable. You can also do info registers to print all of the register values. If you only want to print one register value, you can do something like print \$rsp to just print %rsp.
gdb is very powerful. A variety of tutorials on the Internet discuss how to use gdb. For example, see this page for an overview of the most useful gdb commands.


text:
Jubeen A.

# number of kgs. for each ingredients to use in order to minimize the total cost for 10000 kgs

Bill and Bro’s chemical ltd. must produce 10,000 kgs. of a special mixture for a customer. The
mix consists of ingredients A, B and C. The costs of ingredients are $8 per kg for A,$ 10 per
kg for B and \$11 per kg for C. No more than 35,000 kgs of A can be used and at least 1500
kgs of B must be used. Also at least 2000 kgs of C is required. Calculate the number of kgs.
for each ingredients to use in order to minimize the total cost for 10000 kgs.

By:

Tutor
5 (51)

Ivy League educated tutor for Math, History, English and Test Prep

## Still looking for help? Get the right answer, fast.

Get a free answer to a quick problem.
Most questions answered within 4 hours.

#### OR

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.


text:
Poles of products of Gamma functions

+ 2 like - 0 dislike
126 views

I want to know if there can be a general statement about the poles (Laurent expansion) of such products of Gamma functions as a function of $p \in \mathbb{R}$ in the limit $\epsilon \rightarrow 0$,

$\Gamma[ \frac{(-1-2p)}{2} - \epsilon ]\Gamma[\frac{-1+p}{2} + \epsilon]\Gamma[\frac{(5+p)}{2} + \epsilon]$

For any given $p$ such that the $p$ dependent part of the argument is a negative integer one can do the usual Laurent expansion of the Gamma function in $\epsilon$ for each of the 3 factors and then multiply. But what can be said about the Laurent expansion in general as a function of $p$?

I wish one could write down the Laurent expansion in $\epsilon$ as a function of $p$!

One sees that there are these special cases like if $p$ is such that there are two integers $N$ and $M$ satisfying, $p= 1-2N^2 = -5 -2M^2$ then the later two Gamma function can have poles simultaneously. (like $N=2, M =1, p= -7$) Existence of such special $p$ naively seems to make things more tricky.

This post imported from StackExchange MathOverflow at 2014-08-29 08:16 (UCT), posted by SE-user Anirbit
retagged Aug 29, 2014
Are you missing a square root in the definition of your product? Otherwise I can't imagine why it should matter that the argument of $\Gamma$ is near a square.

This post imported from StackExchange MathOverflow at 2014-08-29 08:16 (UCT), posted by SE-user Greg Martin
@Greg Martin Are you referring to the fact that I have written $N^2$ and $M^2$? That I did so that, $(p-1)/2 = - N^2$ is a negative definite integer and hence the second Gamma function has a pole. Similarly, $(5+p)/2 = -M^2$ is again a negative definite integer and hence the 3rd Gamma function has a pole. It would be great if you can help with the question.

This post imported from StackExchange MathOverflow at 2014-08-29 08:16 (UCT), posted by SE-user Anirbit
Anirbit: the Gamma function has poles for every non-positive integer argument. Squares do not seem to enter the picture anywhere.

This post imported from StackExchange MathOverflow at 2014-08-29 08:16 (UCT), posted by SE-user S. Carnahan
@S.Carnahan As you can see in my comment above to Greg, I have explained why I parametrized using squares - to ensure negative definiteness.

This post imported from StackExchange MathOverflow at 2014-08-29 08:16 (UCT), posted by SE-user Anirbit

Forget the $p$'s and consider a product $\Gamma(x-\epsilon)\Gamma(y-\epsilon)\ldots\Gamma(z-\epsilon)$. If one of $x,y,\ldots,z$ is not a negative integer, it is regular, and you can put $\epsilon=0$ in the factor. So it is enough to consider the case where all of $x,y,\ldots,z$ are negative integers. In this case, if there are $k$ factors,  $\epsilon^k\Gamma(x-\epsilon)\Gamma(y-\epsilon)\ldots\Gamma(z-\epsilon)$ is analytic at $\epsilon=0$.
Therefore you can expand it into a power series using the power series for  $\epsilon\Gamma(x-\epsilon)$ etc. to order $k$ or higher. At the end substitute for $x,y,\ldots,z$ your expressions in $p$,
 Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead. To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL. Please consult the FAQ for as to how to format your post. This is the answer box; if you want to write a comment instead, please use the 'add comment' button. Live preview (may slow down editor)   Preview Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:p$\hbar$ysicsOver$\varnothing$lowThen drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds). To avoid this verification in future, please log in or register.


text:
Posts

The importance of "intuition" in geometry

Hii everyone! Today I will be discussing a few geometry problems in which once you "guess" or "claim" the important things, then the problem can easily be finished using not-so-fancy techniques (e.g. angle chasing, power-of-point etc. Sometimes you would want to use inversion or projective geometry but once you have figured out that some particular synthetic property should hold, the finish shouldn't be that non trivial) This post stresses more about intuition rather than being rigorous. When I did these problems myself, I used freehand diagrams (not geogebra or ruler/compass) because I feel that gives a lot more freedom to you. By freedom, I mean, the power to guess. To elaborate on this - Suppose you drew a perfect  diagram on paper using ruler and compass, then you would be too rigid on what is true in the diagram which you drew. But sometimes that might just be a coincidence. e.g. Let's say a question says $D$ is a random point on segment $BC$, so maybe
Recent posts

LMAO Revenge

Continuing the tradition of past years, our seniors at the Indian IMO camp(an unofficial one happened this year) once again conducted LMAO, essentially ELMO but Indian. Sadly, only those who were in the unofficial IMOTC conducted by Pranav, Atul, Sunaina, Gunjan and others could participate in that. We all were super excited for the problems but I ended up not really trying the problems because of school things and stuff yet I solved problem 1 or so did I think. Problem 1:  There is a   grid of real numbers. In a move, you can pick any real number  ,  and any row or column and replace every entry   in it with  .  Is it possible to reach any grid from any other by a finite sequence of such moves? It turned out that I fakesolved and oh my god I was so disgusted, no way this proof could be false and then when I was asked Atul, it turns out that even my answer was wrong and he didn't even read the proof, this made me even more angry and guess what? I was not alone, Krutarth too fakesol


text:
# A function that checks for duplicate elements in an array

Is there a simpler way to implement this function?

function has_duplicates(arr) {
var myObject = {};

for (var key in arr) {
if (myObject[arr[key]])
return true;
else
myObject[arr[key]] = true;
}
return false;
}

console.log(has_duplicates(["foo", "bar", "baz", "quux", "foo"]));

function has_duplicates(arr) {

In JS, function names are usually in camelCase. So this should be hasDuplicates.

for (var key in arr) {

Don't use for-in with arrays. for-in loops will run through properties, including prototype properties. Use a regular for loop with counters. A forEach would also work, but you can't bail out in the middle of the array.

So far, iirc, a loop and hash is favorable in this scenario since it's just O(n) and you can bail out in the middle of the operation.

Another way to do it is the following. The concept is that when a value appears twice, indexOf and lastIndexOf will not be the same, thus adding the entry to the array created by filter.

function hasDuplicates(arr){
return !!arr.filter(fuction(value){
return arr.indexOf(value) !== arr.lastIndexOf(value);
}).length;
}

Another way to do it is by using ES6's Set. The concept is that sets only hold unique values. When you try to add a duplicate, it won't be added to the set. If there is a mismatch in the array length and set size, you jumped over a duplicate somewhere, thus revealing the existence of the duplicate.

function hasDuplicates(arr){
var set = new Set();
return set.size !== arr.length;
}

Going with @PeterCordes's suggestion, you can use Set and check on each iteration the size mismatch. We can assume false until a mismatch happens.

function hasDuplicates(arr){
var set = new Set();
for(var i = 0; i < arr.length; i++){
if(set.size !== i + 1) return true;
}
return false;
}

• Yes, use a hash-based Set to get an O(n) duplicate check. Checking indexOf == lastIndexOf is not great: if there are repeats between element 5 and element 10, for example, you're still scanning the entire array for elements 0 to 4. You're repeating even more work than is needed with an O(n^2) time solution that doesn't use any temporary storage. A very similar question came up on SO, where I went into detail about different ways to use indexOf: stackoverflow.com/a/32523601/224132. – Peter Cordes Sep 18 '15 at 2:50
• @PeterCordes Yeah. Hash is better. But if performance isn't a concern, readability and maintainability is always the next in line. Who wouldn't want a 3-liner duplicate detection? :D – Joseph Sep 18 '15 at 12:09
• I was talking about the 3-line implementation using ES6's Set, which the docs say must use a hash table under the hood, or something else that is at least sub-linear time per insert / lookup (so a binary tree of some sort is allowed, but not linear searches). people.mozilla.org/~jorendorff/es6-draft.html#sec-set-objects. Also, if you expect to find a duplicate early in a long list, check set.size after every add. (This is probably faster than checking membership and then adding, which probably hashes the input twice.) – Peter Cordes Sep 18 '15 at 14:34
• That last code example you added does not work. set.size increases as the loop continues, but arr.length remains the same throughout the loop. – gilly3 Sep 18 '15 at 20:34

Don't use for..in to iterate an array, because for..in is for enumerating objects and will enumerate over properties, including prototype properties. To iterate, use a normal for loop with a counter.

## ES5

ES5 introduced some array iteration methods. Array.some() is the logical choice for this case, since it terminates the loop as soon as you've found an element that matches your condition.

function hasDuplicates(arr) {
var valueHash = {};
return arr.some(function(item) {
var exists = valueHash[item];
valueHash[item] = true;
return exists;
});
}

document.write(hasDuplicates(["foo", "bar", "baz", "quux", "foo"]));

## ES6

If you can use ES6, you have the new Set object available, which is optimized for this kind of work. The constructor takes an iterable (such as an array) as an argument. So, you can just create a Set, and compare it's size to the array's length:

function hasDuplicates(arr) {
return new Set(arr).size < arr.length;
}

document.write(hasDuplicates(["foo", "bar", "baz", "quux", "foo"]));

Now, I don't know, but it's conceivable that this could be slow on a large array. If your array is large, and there could be many duplicates, it might be faster to loop through and add items to the Set one at a time. Use the JS5 function from above, but use a Set instead of an Object:

function hasDuplicates(arr){
var set = new Set();
return arr.some(function(item) {
var exists = set.has(item);
return exists;
});
}

document.write(hasDuplicates(["foo", "bar", "baz", "quux", "foo"]));

It has been suggested that checking Set.has() followed by Set.add() could require the hash being computed twice, and thus be slower. If that's the case, it may perform better by checking Set.size instead of using Set.has().

function hasDuplicates(arr){
var set = new Set();
return arr.some(function(item, i) {
return set.add(item).size == i; // while the array is distinct, set.size is i + 1
});
}

document.write(hasDuplicates(["foo", "bar", "baz", "quux", "foo"]));


text:
So last post, I mentioned about the installation of the new battery charger, which is fed from 240V mains. Over the last few days this charger has held the batteries at a rock-solid 14.4V. Not once did the batteries drop below that voltage setpoint.

So good in fact, the solar charger does no work at all.

By the way, this is what the install looks like. I promised pictures last post.

That’s the DC end … and the nasty AC end is all sealed up…

I will eventually move this to a spot on the back of the rack, but it can sit here for now.

Ultimately, the proper fix to this will be to have the mains-powered charger power off when the sun is up. On the DC output connector, the two rightmost screw terminals go to an opto-isolator that, when powered, shuts off the charger, putting it into stand-by mode. This was one of the reasons I bought this particular unit. The other was the wide range of voltage adjustment.

The question is when to turn on, and when to go to stand-by. Basically if the following expression is true, then turn off the mains:

$(V_{batt} > 12.8) \\wedge (V_{solar} > 15)$

We do not want solar if the battery is very low, as there’s a possibility that the solar output will not be sufficient.  Likewise, if the sun’s out, we need the mains to keep the battery topped up.

The solar output is nearly always above 15V when the sun is up, so there’s our first clue.  We can safely get to 12.8V before things start going pear shaped on the cluster, so we can use that as our low-voltage safety net.  If both of these conditions are met, then it’s safe to turn off the mains power and rely on solar only.

We need a +5V signal when both these conditions are met.  This very much sounds like the job of a dual-comparator with diode-OR outputs pulling on a 5V pull-up.  Maybe a wee bit of hysteresis on those to prevent flapping, and we should be good.

Unfortunately, to do that, I need to unscrew terminals to feed some wires in.  I don’t feel like doing that just now… we’re packing up to go away for a while, and I think this sort of job can wait until we return.

In the meantime, I’ve done something of a hack.  I mentioned the PSU is adjustable.  I wound Vfloat back to 12V… thus Vboost has gone to 12.8V.  Right now, the mains PSU is showing a green LED, meaning it is in floating mode.

We have good sun right now, and the solar controller is currently boosting the battery.  When the battery gets low, the charging circuitry of the mains PSU should kick in, and bring the battery voltage up, holding it at 12.8V until the sun comes up.  I’ll leave it for now and see how this hack goes.

On other news… I might need to re-consider my NTP server arrangements.  I’m not sure if it’s a quirk of OpenBSD, or of the network here, but it seems OpenNTPD struggles to keep good time.  Never tried using the Advantech PC as a NTP server until now, and I’m also experimenting with using my VPS at Vultr as a NTP server.

http://www.pool.ntp.org/user/Redhatter

Both are drifting like crazy.  I have a GPS module lying around that I might consider hooking up to the TS-7670… perhaps make it a Stratum 1 NTP server on the NTP server pool, then the Advantech can sync to that.

This won’t help the VPS though, and I’m at a loss to explain why a Geode LX800 running on an ADSL link in my laundry, outperforms a VPS in a nicely climate-controlled data centre with gigabit Internet.

But at least now that’s one less job for my aging server.  I’ve also moved mail server duties off the old box onto a VM, so I’ll be looking at the BIOS settings there to see if I can get the box to wake up some time in the evening, let cron run the back-up jobs, then power the whole lot back down again, save some juice.

OpenNebula is running now… I ended up re-loading my VM with Ubuntu Linux and throwing OpenNebula on that.  That works… and I can debug the issue with Gentoo later.

I still have to figure out corosync/heartbeat for two VMs, the one running OpenNebula, and the core router.  For now, the VMs are only set up to run on one node, but I can configure them on the other too… it’s then a matter of configuring libvirt to not start the instances at boot, and setting up the Linux-HA tools to figure out which node gets to fire up which VM.

The VM hosts are still running Gentoo however, and so far I’ve managed to get them to behave with OpenNebula.  A big part was disabling the authentication in libvirt, otherwise polkit generally made a mess of things from OpenNebula’s point of view.

That, and firewalld had to be told to open up ports for VNC/spice… I allocated 5900-6900… I doubt I’ll have that many VMs.

Last weekend I replaced the border router… previously this was a function of my aging web server, but now I have an ex-RAAF-base Advantech UNO-1150G industrial PC which is performing the routing function.  I tried to set it up with Gentoo, and while it worked, I found it wasn’t particularly stable due to limited memory (it only has 256MB RAM).  In the end, I managed to get OpenBSD 6.1/i386 running sweetly, so for now, it’s staying that way.

While the AMD Geode LX800 is no speed demon, a nice feature of this machine is it’s happy with any voltage between 9 and 32V.

The border router was also given the responsibility of managing the domain: I did this by installing ISC BIND9 from ports and copying across the config from Linux.  This seemed to be working, and so I left it.  Big mistake, turns out bind9 didn’t think it was authoritative, and so refused to handle AXFRs with my slaves.

I was using two different slave DNS providers, puck.nether.net and Roller Network, both at the time of subscription being freebies.  Turns out, when your DNS goes offline, puck.nether.net responds by disabling your domain then emailing you about it.  I received that email Friday morning… and so I wound up in a mad rush trying to figure out why BIND9 didn’t consider itself authoritative.

Since I was in a rush, I decided to tell the border router to just port-forward to the old server, which got things going until I could look into it properly.  It took a bit of tinkering with pf.conf, but eventually got that going, and the crisis was averted.  Re-enabling the domains on puck.nether.net worked, and they stayed enabled.

It was at that time I discovered that Roller Network had decided to make their slave DNS a paid offering.  Fair enough, these things do cost money… At first I thought, well, I’ll just pay for an account with them, until I realised their personal plans were US\$5/month.  My workplace uses Vultr for hosting instances of their WideSky platform for customers… and aside from the odd hiccup, they’ve been fine.  US\$5/month VPS which can run almost anything trumps US\$5/month that only does secondary DNS, so out came the debit card for a new instance in their Sydney data centre.

Later I might use it to act as a caching front-end and as a secondary mail exchanger… but for now, it’s a DIY secondary DNS.  I used their ISO library to install an OpenBSD 6.1 server, and managed to nut out nsd to act as a secondary name server.

Getting that going this morning, I was able to figure out my DNS woes on the border router and got that running, so after removing the port forward entries, I was able to trigger my secondary DNS at Vultr to re-transfer the domain and debug it until I got it working.

With most of the physical stuff worked out, it was time to turn my attention to getting virtual instances working.  Up until now, everything running on the VM was through hand-crafted VMs using libvirt directly.  This is painful and tedious… but for whatever reason, OpenNebula was not successfully deploying VMs.  It’d get part way, then barf trying to set up 802.1Q network interfaces.

In the end, I knew OpenNebula worked fine with bridges that were already defined… but I didn’t want to have to hand-configure each VLAN… so I turned to another automation tool in my toolkit… Ansible:

```- hosts: compute
- name: Configure networking
template: src=compute-net.j2 dest=/etc/conf.d/net
# …
- hosts: compute
# …
with_sequence: start=128 end=193
with_sequence: start=128 end=193
# …
- name: Make services start at boot (instance VLAN bridges)
with_sequence: start=128 end=193
```

That’s a snippet of the playbook… and it basically creates symbolic links from Gentoo’s net.lo for all the VLAN ports and bridges, then sets them up to start at boot.

In the compute-net.j2 file referenced above, I put in the following to enumerate all the configuration bits.

```# Instance VLANs
{% for vlan in range(128,193) %}
config_vlan{{vlan}}="null"
config_bond0_{{vlan}}="null"
rc_net_vlan{{vlan}}_need="net.bond0.{{vlan}}"
{% endfor %}
# …
vlans_bond0="5 8 10{% for vlan in range(128,193) %} {{vlan}} {% endfor %}248 249 250 251 252"
vlans_bond1="253"
# …
# Instance VLANs
{% for vlan in range(128,193) %}
bridge_vlan{{vlan}}="bond0.{{vlan}}"
{% endfor %}
```

The start and end ranges are a little off, but it saved a lot of work.

This naturally took a while for OpenRC to bring up… but it worked. Going back to OpenNebula, I told it what bridges to use, and before long I had my first instance… an OpenBSD router to link my personal VLAN to the DMZ.

I spent a bit of time re-working my routing tables after that… in fact, my network is getting big enough now I have to write some details down.  I spent a few hours documenting the effort:

That’s page 1 of about 15… yes my hand is sore… but at least now should I get run over by a bus, others have a fighting chance doing anything with the network without my technical input.


text:
# SQL - TRAVERSE

Traverse is a special command that retrieves the connected records crossing the relationships. This command works not only with graph API but at document level. This means you can traverse relationships between invoice and customers without the need to model the domain using the Graph API.

To know more look at Java-Traverse page.

## Syntax

TRAVERSE <[class.]field>|*|any()|all()
[FROM <target>]
[LET <Assignment>*]
WHILE <condition>
[LIMIT <max-records>]
[STRATEGY <strategy>]

• fields are the list of fields you want to traverse
• target can be a class, one or more clusters, a single RID, a set of RIDs or another command like another TRAVERSE (as recursion) or a SELECT
• LET is the part that bind context variables to be used in projections, conditions or sub-queries
• while condition to continue the traversing while it's true. Usually it's used to limit the traversing depth by using $depth where x is the maximum level of depth you want to reach.$depth is the first context variable that reports the depth level during traversal. NOTE: the old 'where' keyword is deprecated
• max-records sets the maximum result the command can return
• strategy, to specify how to traverse the graph

### Fields

Are the list of fields you want to traverse. If *, any() or all() are specified then all the fields are traversed. This could be costly so to optimize the traverse use the pertinent fields. You can also specify fields at class level. Polymorphism is supported, so by specifying Person.city and Customer class extends Person, you will traverse Customer instances too.

Field names are case-sensitive, classes not.

### Target

Target can be:

• Class is the class name to browse all the record to be traversed. You can avoid to specify class: as prefix
• Cluster with the prefix 'cluster:' is the cluster name where to execute the query
• A set of RIDs inside square brackets to specify one or a small set of records. This is useful to navigate graphs starting from some root nodes
• A root record specifying its RID

### Context

Traverse command uses the following variables in the context:

• $parent, to access to the parent's context if any. This is useful when the Traverse is called in a sub-query •$current, current record iterated. To access to the upper level record in nested queries use $parent.$current
• $depth, as the current depth of nesting •$depth, as the current depth of nesting
• $path, as the string representation of the current path. Example #6:0.in.#5:0#.out. You can also display it with -> select$path from (traverse ** from V)
• $stack, as the List of operation in the stack. Use it to access to the history of the traversal. It's a List> where process implementations are: • OTraverseRecordSetProcess, usually the first one it's the base target of traverse • OTraverseRecordProcess, represent a traversed record • OTraverseFieldProcess, represent a traversal through a record's field • OTraverseMultiValueProcess, use on fields that are multivalue: arrays, collections and maps •$history, as the set of all the records traversed as a Set<ORID>.

## Examples

### Traverse all the fields of a root record

Assuming #10:1234 is the RID of the record to start traversing:

traverse * from #10:1234

### Social Network domain

In a social-network-like domain a profile is linked to all the friends. Below some commands.

#### Specify fields and depth level

Assuming #10:1234 is the RID of the record to start traversing get all the friends up to the third level of depth using the BREADTH_FIRST strategy:

traverse friends from #10:1234 while $depth <= 3 strategy BREADTH_FIRST  In case you want to filter per minimum depth create a predicate in the select. Example like before but excluding the first target vertex (#10:1234): select from ( traverse friends from #10:1234 while$depth <= 3 ) where $depth >= 1  NOTE: You can also define the maximum depth in the SELECT clause but it's much more efficient to set it at the inner TRAVESE statement because the returning record sets are already filtered by depth #### Mix with select to have more power Traverse command can be combined with SQL SELECT statement to filter the result set. Below the same example above but filtering by Rome as city: select from ( traverse friends from #10:1234 while$depth <= 3 ) where city = 'Rome'

Another example to extract all the movies of actors that have worked, at least once, in any movie produced by J.J. Abrams:

select from (
traverse Movie.actors, Actor.movies from (
select from Movie where producer = "J.J. Abrams"
) while $depth <= 3 ) where @class = 'Movie'  ### Display the current path To return or use the current path in traversal refer to the$path variable:

select $path from ( traverse out from V while$depth <= 10 )

## Using TRAVERSE with Graph model and API

Even if the TRAVERSE command can be used with any domain model, the place where is more used is the Graph-Database model.

Following this model all is based on the concepts of the Vertex (or Node) as the class "V" and the Edge (or Arc, Connection, Link, etc.) as the class "E". So if you want to traverse in a direction you have to use the class name when declare the traversing fields. Below the directions:

• OUTGOING, use V.out, E.in because vertices are connected with the "out" field but the edge exits as "in" field.
• INCOMING, use V.in, E.out because vertices are connected with the "in" field but the edge enters as "out" field.

Example of traversing all the outgoing vertices found starting from the vertex with id #10:3434:

traverse V.out, E.in from #10:3434

So in a mailing-like domain to find all the messages sent in 1/1/2012 from the user 'Luca' assuming it's stored in the 'User' Vertex class and that messages are contained in the 'Message' Vertex class. Sent messages are stored as "out" connections of Edge class 'SentMessage':

select from (
traverse V.out, E.in from (
select from User where name = 'Luca'
) while $depth <= 2 and (@class = 'Message' || ( @class = 'SentMessage' and sentOn = '01/01/2012') ) ) where @class = 'Message'  ## Operator TRAVERSE Before the introducing of TRAVERSE command OrientDB has the TRAVERSE operator but worked in the opposite way and it was applied in the WHERE condition. TRAVERSE operator is deprecated. Please use the TRAVERSE command together with SELECT command to have much more power! The syntax of the old TRAVERSE operator was: SELECT FROM <target> WHERE <field> TRAVERSE[(<minDeep> [,<maxDeep> [,<fields>]])] (<conditions>)  Where: • target can be one of listed above • field can be: • out, as the outgoing edges • in, as the incoming edges • any attribute of the vertex • any(), means any of the field considering also in and out • all(), means all the fields considering also in and out • minDeep is the minimum deep level to start to apply the conditions. Usually is 0 for the root vertex or 1 for the just-outgoing vertexes • maxDeep, optionally limits the maximum deep level to reach. -1 means infinite. Default is -1 • fields, optionally tells the field list to traverse. Default is any() • conditions are the conditions to check for any traversed vertex. To know more about the query syntax see SQL syntax ### Examples Example of a query that returns all the vertices that have at least one friend (connected with out), up to the 3rd degree, that lives in Rome: select from Profile where any() traverse(0,3) (city = 'Rome')  This can be rewritten using the most power TRAVERSE command: select from Profile let$temp = (
select from (
traverse * from $current while$depth <= 3
)
where city = 'Rome'
)
where $temp.size() > 0  ### Examples Of Graph Query. Vertex edge Vertex User----->Friends----->User Label='f' #### Query to Find the first level friends of User Whose record Id is #10:11 select distinct(in.lid) as lid,distinct(in.fid) as fid from (traverse V.out, E.in from #10:11 while$depth <=1) where @class='Friends'

#### 2nd level friends of a user, to find that we have to just change the depth to 3

select distinct(in.lid) as lid,distinct(in.fid) as fid   from (traverse V.out, E.in from #10:11 while \$depth <=3) where @class='Friends'

To know more about other SQL commands look at SQL commands.


text:
### 20.27 The Dirichlet Distribution

— Function: void gsl_ran_dirichlet (const gsl_rng * r, size_t K, const double alpha[], double theta[])

This function returns an array of K random variates from a Dirichlet distribution of order K-1. The distribution function is

          p(\theta_1, ..., \theta_K) d\theta_1 ... d\theta_K =
(1/Z) \prod_{i=1}^K \theta_i^{\alpha_i - 1} \delta(1 -\sum_{i=1}^K \theta_i) d\theta_1 ... d\theta_K

for theta_i >= 0 and alpha_i > 0. The delta function ensures that \sum \theta_i = 1. The normalization factor Z is

          Z = {\prod_{i=1}^K \Gamma(\alpha_i)} / {\Gamma( \sum_{i=1}^K \alpha_i)}

The random variates are generated by sampling K values from gamma distributions with parameters a=alpha_i, b=1, and renormalizing. See A.M. Law, W.D. Kelton, Simulation Modeling and Analysis (1991).

— Function: double gsl_ran_dirichlet_pdf (size_t K, const double alpha[], const double theta[])

This function computes the probability density p(\theta_1, ... , \theta_K) at theta[K] for a Dirichlet distribution with parameters alpha[K], using the formula given above.

— Function: double gsl_ran_dirichlet_lnpdf (size_t K, const double alpha[], const double theta[])

This function computes the logarithm of the probability density p(\theta_1, ... , \theta_K) for a Dirichlet distribution with parameters alpha[K].

The GNU Scientific Library - a free numerical library licensed under the GNU GPL
Back to the GNU Scientific Library Homepage


text:
Introduction

The digital temperature and humidity sensor DHT11 inside contains a chip that does analog to digital conversion and spits out a digital signal with the temperature and humidity, compatible with any MCUs, ideal for those who want some basic data logging stuffs. It’s very popular for electronics hobbyists because it is very cheap but still providing great performance.

In this lesson, we will first go into a little background about humidity, then we will explain how the DHT11 measures humidity. After that, we will show you how to connect the DHT11 to the micro bit and give you some example code so you can use the DHT11 in your own projects.

Parts Needed You will need the following parts:

• 1x micro:bit
• 1x Micro B USB Cable
• 1x micro:bit Breakout (with Headers)
• 5x Jumper Wires
• 1x  DHT11 Module

The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data.

Only three pins are available for use: VCC, GND, and DATA. The communication process begins with the DATA line sending start signals to DHT11, and DHT11 receives the signals and returns an answer signal. Then the host receives the answer signal and begins to receive 40-bit humiture data (8-bit humidity integer + 8-bit humidity decimal + 8-bit temperature integer + 8-bit temperature decimal + 8-bit checksum).

WHAT IS RELATIVE HUMIDITY?

The DHT11 measures relative humidity. Relative humidity is the amount of water vapor in air vs. the saturation point of water vapor in air. At the saturation point, water vapor starts to condense and accumulate on surfaces forming dew.

The saturation point changes with air temperature. Cold air can hold less water vapor before it becomes saturated, and hot air can hold more water vapor before it becomes saturated.

The formula to calculate relative humidity is:

$RH = (\frac{\rho_{w}}{\rho_{s}}) \ x \ 100 \% \\ \\ RH: \ Relative \ Humidity \\ \rho_{w}: \ Density \ of \ water \ vapor\\ \rho_{s}: \ Density \ of \ water \ vapor \ at \ saturation$

Relative humidity is expressed as a percentage. At 100% RH, condensation occurs, and at 0% RH, the air is completely dry.

HOW THE DHT11 MEASURES HUMIDITY AND TEMPERATURE

The DHT11 detects water vapor by measuring the electrical resistance between two electrodes. The humidity sensing component is a moisture holding substrate with electrodes applied to the surface. When water vapor is absorbed by the substrate, ions are released by the substrate which increases the conductivity between the electrodes. The change in resistance between the two electrodes is proportional to the relative humidity. Higher relative humidity decreases the resistance between the electrodes, while lower relative humidity increases the resistance between the electrodes.

The DHT11 measures temperature with a surface mounted NTC temperature sensor (thermistor) built into the unit.

With the plastic housing removed, you can see the electrodes applied to the substrate, an IC mounted on the back of the unit converts the resistance measurement to relative humidity. It also stores the calibration coefficients, and controls the data signal transmission between the DHT11 and the Arduino:

WIRING

 Micro bit DHT11 sensor 3.3v VCC P0 DATA GND Ground


text:
# Question #19f91

Jul 20, 2016

1 mole $A {l}_{2} {O}_{3}$

#### Explanation:

Its a bit difficult to answer your question precisely. However lets look at the chemical reaction between Aluminium and oxygen. As you know Aluminium is a metal and oxygen is gaseous. If we write the balanced chemical reaction we have

$4 A l + 3 {O}_{2} \to 2 A {l}_{2} {O}_{3}$

If 1.5 mole Oxygen gas reacts then from the above balanced reaction we can infer that 1 mole of Aluminium oxide will be produced in a complete reaction.


text:
Finding the roots of a function with a parameter

I am using a differential equation method for finding the roots of a function. My function is much more complicated but I can illustrate my problem with a trivial example. The problem occurs when roots coincide and change direction. I use a differential equation method. The example equation is

eq = s^2 + 2 a s + 1;

where a is a parameter (0 < a) and I wish to find the roots as the parameter is varied. To form the differential equation I take two derivatives and put them together as follows

deq = {D[eq, s], D[eq, a]} /. s -> s[a];
de = deq[[1]] s'[a] + deq[[2]] == 0
(* 2 s[a]+(2 a+2 s[a]) (s^\[Prime])[a]\[Equal]0 *)

I set up the differential equation so that I can solve with different initial conditions and over different ranges of the parameter a

ClearAll[sol];
sol[ic_, ae_] := s /. First[NDSolve[{de, s[0] == ic}, s, {a, 0, ae}]]

I have initial conditions from

ic = s /. Solve[eq == 0 /. a -> 0]
(* {-\[ImaginaryI],\[ImaginaryI]} *)

First case is fine

a1 = 0.999;
rts = sol[#, a1] & /@ ic;
ParametricPlot[Evaluate[{Re[#[a]], Im[#[a]]} & /@ rts], {a, 0, 0.999}]

Second case attempts to go further

a1 = 2;
rts = sol[#, a1] & /@ ic;

NDSolve gets stuck as it attempts to go "round the corner" at -1. Is there a way to get NDSolve to go round the corner? Can I get both solutions going round the corner and choosing opposite directions? (One solution should go towards the origin the other towards infinity.) Thanks for help and suggestions.

-

RootLocusPlot[s^2 + 2 a s + 1, {a, 0, 2}]


text:
# $H(\kappa)$-absoluteness of a formula

Let $\varphi(x,y)$ be an $\in$-formula which is absolute between transitive models of ZF minus powerset axiom. Then $\exists x\, \varphi(x,y)$ is $H(\kappa)$-absolute, where $H(\kappa)$ is the set $\{x\, |\, card(TC(\{x\}))<\kappa\}$. $\kappa$ is uncountable regular.

This is a homework question and I would prefer a hint instead of a solution.

• Precisely what does "$\psi(y)$ is $H(\kappa)$-absolute" mean? – Andrés E. Caicedo Jul 20 '13 at 2:49
• This means that, for any $y\in H(\kappa)$, $\psi(y)$ holds in V iff it holds in $H(\kappa)$. So in this case the task is to show that $x$ can be chosen in $H(\kappa)$ if such a x exists in V. – user35359 Jul 20 '13 at 2:52
• Are you assuming that $\kappa$ is regular? – Andrés E. Caicedo Jul 20 '13 at 3:08
• No, $\kappa$ is arbitrary. – user35359 Jul 20 '13 at 3:59
• I just realized I made a mistake in the question. $\varphi$ should be absolute between models of ZF minus powerset (which includes $H(\kappa)$ for uncountable $\kappa$). Also, $\kappa$ should indeed be uncountable regular. Sorry for all that. – user35359 Jul 20 '13 at 4:03

Assuming ZFC in $V$. Since $\kappa$ is uncountable regular, $H(\kappa)$ models all axioms of ZFC except powerset. (*)

The relativization of $\exists x \, \varphi(x,y)$ to $H(\kappa)$ is $\exists x\in H(\kappa) \,\varphi(x,y)$, $\varphi$ is absolute between $V$ and $H(\kappa)$ because of (*). So it needs to be shown that, if for some $y\in H(\kappa)$ there is $x\in V$ with $\varphi(x,y)$, then there is $x\in H(\kappa)$ with $\varphi(x,y)$.

For $y\in H(\kappa)$, let $T_y:=TC(\{y\})\subseteq H(\kappa)$ with $|T_y|<\kappa$. Let $\kappa'\geq \kappa$ regular be so that if there is $x\in V$ with $\varphi(x,y)$, there is $x\in H(\kappa')$ with $\varphi(x,y)$. Let $S_y$ be a Skolem hull of $T_y$ in $H(\kappa')$ and let $M_y$ be the transitive collapse of $S_y$, with $\pi:S_y\to M_y$ being a $\in\!\!-\!\!\in$ isomorphism. $|S_y|<\kappa$ and $|M_y|<\kappa$.

Assume there is a $x'\in V$ with $\varphi(x',y)$. Then there is $x\in S_y$ with $\varphi(x,y)$. Since $S_y$ is an elementary substructure of $H(\kappa')$, it is a model of ZF without powerset axiom and $\varphi^{S_y}(x,y)$ holds, because $\varphi$ is absolute. Because $\pi$ is a isomorphism and its restriction to the transitive set $T_y$ is the identity, $\varphi^{M_y}(\pi(x),y)$ holds. Because $M_y$ is isomorphic to $S_y$, ZF without powerset is true in $M_y$ and therefore $\varphi(\pi(x),y)$.

Now $TC(\{M_y\})=\{M_y\}\cup M_y$ has cardinality less than $\kappa$, so $M_y\in H(\kappa)$. Because $H(\kappa)$ is transitive and $\pi(x)\in M_y$, $\pi(x)\in H(\kappa)$.

• This is "morally correct" but not quite formal. There are several problems. The first is that in $\mathsf{ZFC}$ we cannot really form elementary substructures of the whole universe, so $S_y$ may not be defined. The second is that there may be many $x$ such that $\varphi(x,y)$, so you cannot simply conclude that $x\in S_y$. Besides the mathematical problems, a notational advice: Purely for clarity's sake, avoid using $H_y$, as $H(\kappa)$ already means something else. – Andrés E. Caicedo Jul 20 '13 at 6:11
• All this can be fixed easily: Assume $\exists x\,\varphi(x,y)$. First, pick an $H(\lambda)$ with $\lambda>\kappa$ regular, large enough so there is some $x\in H(\lambda)$ with $\varphi(x,y)$ and therefore $\varphi^{H(\lambda)}(x,y)$. Now use this instead of $V$ when defining $S_y$. Note that $H(\lambda)$ satisfies $\exists t\,\varphi(t,y)$, so the same holds in its elementary substructure $S_y$. This means that in $S_y$ there is an $\hat x$ such that $\varphi^{S_y}(\hat x,y)$, etc. That $\hat x$ may be different from the $x$ we began with is irrelevant. – Andrés E. Caicedo Jul 20 '13 at 6:17
• I have a question regarding "cannot form elementary substructure of V", if you don't mind. Trying to form a Skolem hull for a set $X$, if there is $x\in V$ with $\varphi(x,y_1,..,y_k)$ for $y_i\in X$, choose $\alpha$ so that x is in $V_{\alpha}$. Since X is a set, there is $\alpha$ so that this works for all $\varphi$ and parameters in $X$ at the same time. Then wellorder $V_{\alpha}$ and choose the smallest element for each such $\varphi$, $y_i$. Take $X_1$ as the set of those elements. Repeat this, get sets $X_i\subset X_{i+1}$, the union ($i<\omega$) should be an elem. substructure of V. – user35359 Jul 20 '13 at 6:45
• I see this shouldn't work because it would let ZFC prove its consistency, but I don't see the mistake in the argument at the moment. – user35359 Jul 20 '13 at 6:56
• This is a subtle issue. To formalize it, you need to define a satisfaction predicate, but this is not possible (say, because of Tarski's undefinability of truth theorem). This is discussed in Chapter 12 of Jech's Set theory, or see Kunen's The foundations of mathematics. – Andrés E. Caicedo Jul 20 '13 at 14:31


text:
GENERAL

My Workshop

Storage

Component Trays

Organisation! Component trays are the shiz. When you want a component, they are right there and waiting. It is like walking into a shop, but without the cost (or course you have to fill them up, but you forget about the purchasing after a while). I use component trays for through hole resistors, through-hole capacitors, diodes, transistors, MOSFETs, and common ICs (555’s, max232’s, etc). I have smaller containers for the surface mount equivalents.

 These trays are awesome for storing through-hole components. 20 of them in total.

Storage Boxes

No, I didn’t eat all that ice cream myself. But they are all 2L ice-cream containers, eaten by my family over the last 8 years. They make really good stackable containers for holding components and anything else that is too big or not used enough for the component trays.

For storing SMD components such as resistors, capacitors, and ferrite beads, I use these modular storage containers from DealExtreme. They are great because a) cheap, b) small, c) modular, d) have flip-top lids which spring open. I use a labeller to create small labels for each one, describing the component.

Tools

Power Supply

A variable voltage-limited or current-limited power supply is a must for any serious electronic work. The current-limiting especially, as it prevent circuits from blowing up when prototyping.

I brought a cheap 0-30V, 0-5A power supply from AliExpress. It is the YH-305D, as shown below. It set me back about NZ$130, including shipping. I also have a high-power DC-DC buck converter that I use when I need high current. It is a 12A, 4.5-30V in, 0.8-28V out (adjustable) buck converter that is rated to 100W without a fan and up to 200W with active cooling. It was about NZ$13 (US$9) on AliExpress. Here is a link to the product. Oscilloscope Hitachi V-1050F 100MHz Oscilloscope - This thing is an ancient beast. I picked it up for NZ$300 on TradeMe in about 2004. It is a analogue (CRT) oscilloscope that looks like it was first built in the 1980’s. It has four channels (with two of them being fully customisable), and the ability to go down to 20ns resolution. The annoying thing about it is that is that being analogue, the trace quickly disappears from the screen with slow signals (since it works by repeatedly moving an electron beam across the screen), making it hard to do some measurements or get a full idea of the signal shape.

 Old-skurl oscilloscope. Testing with the oscilloscope.

As of 2012 I got a new oscilloscope, a Rigol ADS 1102CAL. It has a 100MHz bandwidth. Brought it for NZ$400 from AliExpress. Newer oscilloscopes like this one usually have USB ports for saving captures of waveforms to. You can usually select from a range of file formats such as an image (.png, .jpeg), comma-separated values (.csv), or a proprietary binary format such as .wfm. I have found .csv files to be to most useful, since it gives you all of the raw data. I’m pretty sure the .wfm files also store all of the data, but for some reason I have had trouble trying to extract the timing information from them. I have used the .csv files to display graphs via Google visualizations on various pages on this site. My GitHub repo eng-graphs-js has all the graph data as well as the rendering code. Logic Analyser Logic analysers are great tools for looking a digital circuits! Most oscilloscopes are great for looking at analogue waveforms, but have serious limitations when looking at digital waveforms (except fancy versions, which have digital analysers built in, or offer a hardware extension). Logic analysers usually have 8 or more inputs. They record the 1’s and 0’s on the inputs, and often have advanced features like comm protocol decode support. This means they can decode the information sent across common communication protocols, making debugging easier as you no longer have to look at each individual bit and work out what was sent. They commonly support protocols such as UARTSPI, and I2C, and less commonly LIN and CAN. The particular SaleaeLogic” logic analyser below uses a PSoC microcontroller. UART-To-RS-232 Converter One of these is essential for debugging embedded designs. My favourite is the TTL-232RG-VIP-WE “USB to TTL Serial Cable - 1.8m Wire End Version” made by FTDI chip. All of the electronics is enclosed in the USB cable, which has loose colour coded wires at the other end. It is the external-voltage version, which means that instead of the cable supplying Vcc for the UART, it’s provided by the external circuitry. This means the cable can work of a number of voltages, and no level converter is needed! USB-To-RS-485 Converter Plenty of industrial, hard-wearing and/or long-distance electrical equipment uses the RS-485 interface for communicating. The DT-5019 is a great USB-to-RS-485 converter for talking to devices uses this protocol with a computer. I got this from DealExtreme, part number 54289, for US$19.70 in Jan 2013 (inc. shipping to NZ). It is made by Dtech.

This particular converter comes with standard DB9 connector and also a breakout board with terminal blocks, perfect for most prototyping situations. It supports both the RS-422 (full-duplex) and RS-485 (half-duplex) protocols, over a maximum of 1200m! The drivers are already present on Windows 7/Windows 8 machines, and a driver CD is supplied. It had 600W surge protection and 15kV ESD protection. LED’s on the device show the current status (which is great for debugging).

Supported transmission speeds are:

DistanceTransmission Speed
300m921600bps
600m38400bps
1200m9600bps

Components

Capacitors

Large capacitors are a geeks version of a flash car or a huge plasma screen. Except better.

These pics below are of my largest capacitors, 20 1800uF, 500V monstrosities. I got these for a total of NZ$40 from TradeMe of someone who didn’t know they actual worth (possibly NZ$1000’s!, I don’t even think they knew they were capacitors). I have yet to use them for anything but shorting out pieces of wire (and with only two in parallel). A coil gun HAS to be made from these soon.

 They are big, and they are powerful. Capacitor size comparison. The collection of large capacitors.

My ‘monster’ cap bank. Me and a mate made this in 2005 for a coil gun. Each capacitor is from a disposable camera. They are 7 rows with 20 capacitors in each, and they are all connected in parallel The voltage is 330V and the capacitance of each ranges from 80-120µF. The total approximate capacitance is 14,000µF. But the poor camera cap charging circuits just couldn’t handle the jandle. So it never got used. Unfortunately as of Jan 2011 it is broken (I think a car ran into it, long story). I might get around to fixing this sometime…

 The bank from above. Made with disposable camera caps. Damaged caps. Width comparison. Damaged tracks! I think someone ran over it.

PCB’s

PCBs are useful when developing a circuit past the quick prototype stage. I have both blank copper PCB sheets as well as protoboard (copper tracks running parallel with each other), and variations on proto-board designed to make it easier to hook up ICs and other chips.

Laser

3kV HeNe Laser - I picked this laser up from TradeMe in 2005 for NZ\$40. The tube is about 400mm long and 80mm in diameter. The power supply is a separate PCB which runs of 12V. So far I have never managed to get the laser running continuously, only turning on intermittently every few seconds. It seems there is a problem with the power supply and it cannot supply the required current to keep the laser on. It also emits quite a annoying squeal when running (I’m guessing it’s the switching frequency). I am unsure of it’s output power…

Software

Altium

Altium is a CAD package for designing circuit boards. It is a very expensive (like most high-end CAD packages) piece of software, that I do not own personally. Luckily, the company I work for has commercial licenses, which I use when designing PCBs. If you want to know more about it, go to the Altium page.

Console Calculator

I can happily say that console calculator is the best software-based calculator in the world. It is an open-source, cross-platform calculator with powerful features in a tidy and easy to use interface. It kind of looks like a command prompt window (or console window for you ‘nix’ fans), that accepts maths commands. Console Calculator supports many built in functions, the ability to create your own, quick conversion between units, the ability to add your own units, customizable rounding/display modes, ridiculous 269 digit floating point precision (many other calculators are only 64-bit), decimal, hexadecimal and binary number system support, and more!


text:
RUS  ENG JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB
 General information Latest issue Archive Impact factor Search papers Search references RSS Latest issue Current issues Archive issues What is RSS

 SIGMA: Year: Volume: Issue: Page: Find

 SIGMA, 2012, Volume 8, 056, 10 pages (Mi sigma733)

Monodromy of an inhomogeneous Picard–Fuchs equation

Guillaume Laportea, Johannes Walcherab

a Department of Physics, McGill University, Montréal, Québec, Canada
b Department of Mathematics and Statistics, McGill University, Montréal, Québec, Canada

Abstract: The global behaviour of the normal function associated with van Geemen's family of lines on the mirror quintic is studied. Based on the associated inhomogeneous Picard–Fuchs equation, the series expansions around large complex structure, conifold, and around the open string discriminant are obtained. The monodromies are explicitly calculated from this data and checked to be integral. The limiting value of the normal function at large complex structure is an irrational number expressible in terms of the di-logarithm.

Keywords: algebraic cycles, mirror symmetry, quintic threefold.

DOI: https://doi.org/10.3842/SIGMA.2012.056

Full text: PDF file (289 kB)
Full text: http://emis.mi.ras.ru/.../056
References: PDF file   HTML file

Bibliographic databases:

ArXiv: 1206.1787
MSC: 14C25; 14J33
Received: June 8, 2012; in final form August 20, 2012; Published online August 22, 2012
Language:

Citation: Guillaume Laporte, Johannes Walcher, “Monodromy of an inhomogeneous Picard–Fuchs equation”, SIGMA, 8 (2012), 056, 10 pp.

Citation in format AMSBIB
\Bibitem{LapWal12} \by Guillaume Laporte, Johannes Walcher \paper Monodromy of an inhomogeneous Picard--Fuchs equation \jour SIGMA \yr 2012 \vol 8 \papernumber 056 \totalpages 10 \mathnet{http://mi.mathnet.ru/sigma733} \crossref{https://doi.org/10.3842/SIGMA.2012.056} \mathscinet{http://www.ams.org/mathscinet-getitem?mr=2970772} \isi{http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&DestLinkType=FullRecord&DestApp=ALL_WOS&KeyUT=000307830000001} \scopus{http://www.scopus.com/record/display.url?origin=inward&eid=2-s2.0-84865813571}

• http://mi.mathnet.ru/eng/sigma733
• http://mi.mathnet.ru/eng/sigma/v8/p56

 SHARE:

Citing articles on Google Scholar: Russian citations, English citations
Related articles on Google Scholar: Russian articles, English articles

This publication is cited in the following articles:
1. Adams L., Bogner Ch., Weinzierl S., “The Two-Loop Sunrise Graph with Arbitrary Masses”, J. Math. Phys., 54:5 (2013), 052303
2. Jefferson R.A., Walcher J., “Monodromy of Inhomogeneous Picard-Fuchs Equations”, Commun. Number Theory Phys., 8:1 (2014), 1–40
3. Doran Ch.F., Kerr M., “Algebraic Cycles and Local Quantum Cohomology”, Commun. Number Theory Phys., 8:4 (2014), 703–727
4. Kerr, M., “Algebraic and arithmetic properties of period maps”, Fields Institute Monographs, 34 (2015), 173-208
5. Zou H., Yang F.-Zh., “Effective superpotentials of Type II D-brane/F-theory on compact complete intersection Calabi–Yau threefolds”, Mod. Phys. Lett. A, 31:15 (2016), 1050094
6. Honma Y., Manabe M., “Open mirror symmetry for higher dimensional Calabi-Yau hypersurfaces”, J. High Energy Phys., 2016, no. 3, 160
•  Number of views: This page: 257 Full text: 23 References: 22


text:
Courses

# Important Properties of Definite Integrals Commerce Notes | EduRev

## Commerce : Important Properties of Definite Integrals Commerce Notes | EduRev

The document Important Properties of Definite Integrals Commerce Notes | EduRev is a part of Commerce category.
All you need of Commerce at this link: Commerce

Can u told me about integral and it's properties?

Definite integration is an important component of integral calculus which generally fetches a good number of questions in various competitive exams. Both indefinite and definite integration are interrelated and indefinite integration lays the groundwork for definite integral. Students are advised to learn all the important formulae as they aid in answering the questions easily and accurately. We shall discuss here some of the important properties of definite integrals and then throw some light on their applications as well:

## Important Properties of Definite Integrals

Some of the basic yet important properties which prove fruitful while attempting questions on definite integral are listed below. These results can be proved easily, but the derivations are not very important. Students must remember all the results as the questions can’t be solved unless you know these results.

1.

2.

3.

4. Change of variable of integration is immaterial as long as the limits of integration remain the same, i.e.

5. If the limits are interchanged, i.e. the upper limit becomes the lower limit and vice versa, then

6. If f is a piecewise continuous function, then the integral is broken at the points of discontinuity or at the points where the definition of f changes, i.e.

7.

8.

Another result that can be derived from this property is

9.

10.

where f(T + x) = f(x), m ∈ I.

11.

12.

where f(x) is periodic with period ‘T’ and n ∈ I.

13.

where f(x) is periodic with period a.

14.

15. If f(x) ≥ 0 on the interval [a, b], then

16. Let f(x) and g(x) be two functions defined and continuous on [a, b], then

Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

,

;