text:
# Reduce multivariate polynomial coefficients to 1

Hi all,

I'm new to Python and SAGE and would like to ask a question: I have a multivariate polynomial, of a degree 3, i.e:

g.<x1,x2,x3>=x1^2 + 2x1x2 + x2^2 + 2x1x3 + 2x2x3 + x3^2 + 2x1 + 2x2 + 2*x3 + 1 Its type is <type 'sage.rings.polynomial.multi_polynomial_libsingular.mpolynomial_libsingu\="" lar'="">

The question is how can I reduce all its leading coefficients to 1, i.e. transform ig to:

g.<x1,x2,x3>=x1^2 + x1x2 + x2^2 + x1x3 + x2x3 + x3^2 + *x1 + *x2 + *x3 + 1

I tried to get the coefficients of the polynomial (which is a list), iterate through its items, and set the values of the items to 1, i.e.

for s in g.coefficients(): if s==2: s=1

I think that the problem is that list items can't be cast to integer (TypeError).

How could I solve this? Is there a more efficient way to do this? Thank you for your responses! Regards, Natassa

edit retag close merge delete

If speed matters, see compared timings in my answer.

( 2016-12-22 07:29:26 -0500 )edit

To display blocks of code, separate them by a blank line from the rest of the text, and either indent them with 4 spaces, or select the corresponding lines and click the "code" button (the icon with '101 010').

Can you edit your question to do that?

( 2016-12-22 07:33:04 -0500 )edit

Sort by » oldest newest most voted

The shortest way i could think of is to sum its nonzero monomials:

Setup:

sage: R = PolynomialRing(ZZ,'x',4)
sage: R.inject_variables()
Defining x0, x1, x2, x3
sage: g = x1^2 + 2*x1*x2 + x2^2 + 2*x1*x3 + 2*x2*x3 + x3^2 + 2*x1 + 2*x2 + 2*x3 + 1
sage: g
x1^2 + 2*x1*x2 + x2^2 + 2*x1*x3 + 2*x2*x3 + x3^2 + 2*x1 + 2*x2 + 2*x3 + 1

Then:

sage: sum(g.monomials())
x1^2 + x1*x2 + x2^2 + x1*x3 + x2*x3 + x3^2 + x1 + x2 + x3 + 1

more

## Reducing coefficients to one for multivariate polynomials

Taking the sum of monomials as suggested in the other answers works fine.

It is however faster to map all coefficients to one using map_coefficients.

### Context

sage: R.<x1, x2, x3> = QQbar[]
sage: P = x1^2 + 2*x1*x2 + x2^2 + 2*x1*x3 + 2*x2*x3 + x3^2 + 2*x1 + 2*x2 + 2*x3 + 1

### First approach: summing monomials

Summing monomials using the monomials method:

sage: sum(P.monomials())
x1^2 + x1*x2 + x2^2 + x1*x3 + x2*x3 + x3^2 + x1 + x2 + x3 + 1

Summing monomials iterating through the polynomial's coefficients and monomials:

sage: sum(m for c, m in P)
x1^2 + x1*x2 + x2^2 + x1*x3 + x2*x3 + x3^2 + x1 + x2 + x3 + 1

### Second approach: applying a map to coefficients

Using map_coefficients and plain 1:

sage: P.map_coefficients(lambda _: 1)
x1^2 + x1*x2 + x2^2 + x1*x3 + x2*x3 + x3^2 + x1 + x2 + x3 + 1

Using map_coefficients and QQbar's version of 1.

sage: QQbar_one = QQbar.one()
sage: to_QQbar_one = lambda _: QQbar_one
sage: P.map_coefficients(to_QQbar_one)
x1^2 + x1*x2 + x2^2 + x1*x3 + x2*x3 + x3^2 + x1 + x2 + x3 + 1

### Timings

Summing the monomials one way or another takes on the order of 700 µs.

sage: timeit('sum(P.monomials())')
625 loops, best of 3: 678 µs per loop

sage: timeit('sum(m for c, m in P)')
625 loops, best of 3: 682 µs per loop

Using map_coefficients is roughly ten times faster.

sage: QQbar_one = QQbar.one()
sage: to_QQbar_one = lambda _: QQbar_one
sage: timeit('P.map_coefficients(to_QQbar_one)')
625 loops, best of 3: 68.1 µs per loop

Note that the more naïve version wastes time since 1 gets converted to QQbar's 1 for each coefficient.

sage: timeit('P.map_coefficients(lambda _: 1)')
625 loops, best of 3: 139 µs per loop

### Further remarks

Depending on how the reduced polynomials are used later on, it might make more sense to change their base ring to some version of the boolean ring.

more

The code you provide is not valid, so I don't think this is what you have... The example below show the definition of a polynomial ring, a random polynomial from this ring, and then the polynomial with all coefficients replaced by $1$. The idea is to get the list of monomials, and then simply sum this list.

sage: R.<x1, x2, x3> = QQ[] # polynomial ring over QQ
sage: g = R.random_element(10) # random polynomial of degree 10
sage: g
3*x1^4*x2^5*x3 - 4*x1^7*x2*x3 + 8*x1*x2^7*x3 + 1/3*x1^4*x3^5 - 5*x1^6*x3
sage: g.monomials() # the monomials of g
[x1^4*x2^5*x3, x1^7*x2*x3, x1*x2^7*x3, x1^4*x3^5, x1^6*x3]
sage: sum(g.monomials()) # their sum
x1^4*x2^5*x3 + x1^7*x2*x3 + x1*x2^7*x3 + x1^4*x3^5 + x1^6*x3

Note that the use of sum(...) is equivalent to the following:

sage: g0 = R.zero() # the polynomial equal to zero
sage: for m in g.monomials():
....:     g0 += m

more

Thank you all,

Indeed, considering sum of all monomials does the trick! As a reference, a slightly tweaked solution below that worked for me:

g # the polynomial
list(g) # convert polynomial to list
g1=sum(mon for coeff, mon in g) # get the sum of all monomials

more

format: plain


text:
Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Integral Points Inside Triangle
Medium Accuracy: 0.0% Submissions: 0 Points: 4

Given three non-collinear points whose co-ordinates are P(p1, p2), Q(q1, q2) and R(r1, r2) in the X-Y plane. Find the number of integral / lattice points strictly inside the triangle formed by these points.
Note - A point in X-Y plane is said to be integral / lattice point if both its co-ordinates are integral.

Example 1:

Input:
p = (0,0)
q = (0,5)
r = (5,0)
Output: 6
Explanation:
There are 6 integral points in the
triangle formed by p, q and r.

Example 2:

Input:
p = (62,-3)
q = (5,-45)
r = (-19,-23)
Output: 1129
Explanation:
There are 1129 integral points in the
triangle formed by p, q and r.

You don't need to read input or print anything. Your task is to complete the function InternalCount() which takes the three points p, q and r as input parameters and returns the number of integral points contained within the triangle formed by p, q and r.

Expected Time Complexity: O(Log2109)
Expected Auxillary Space: O(1)

Constraints:
-10≤ x-coordinate, y-coordinate ≤ 109


text:
# AIAA class ignoring tocdepth settings

I'm trying to hide subsubsections in my report using \setcounter{tocdepth}{1}. However, I've found that in documents using the AIAA.cls available here, the tocdepth setting seems to be ignored.

You can test this yourself by going to this ShareLaTeX example file, changing the class to AIAA, and trying to use the tocdepth setting. It works fine using the article class, but not using AIAA.

My guess is something in the .cls is overriding my settings. Any help would be appreciated

• (1) welcome, (2) people generally do not like having to go yo other sites or to download files in order to see the mwe. So it might be better to post the code here. It may very well be that the class will not let you change this kind of thing (for example a journal class might not let you are it would be against the journal style). – daleif Feb 7 '17 at 21:58
• is the class the same as the one on ctan ctan.org/tex-archive/macros/latex/contrib/aiaa?lang=en – David Carlisle Feb 7 '17 at 22:24

Besides getting an error

! LaTeX Error: \RequirePackage or \LoadClass in Options Section.

when compiling the document coming with the class, which I downloaded from the AIAA site, after adding \tableofcontents I see nothing particular in the .toc file. However, the class defines

\def\l@section{%
\l@@sections{}{section}% Implicit #3#4
}%
\def\l@f@section{%
%\bf
}%
\def\l@subsection{%
\l@@sections{section}{subsection}% Implicit #3#4
}%
\def\l@subsubsection{%
\l@@sections{subsection}{subsubsection}% Implicit #3#4
}%
\def\l@paragraph#1#2{}%
\def\l@subparagraph#1#2{}%

and \l@@sections is a command from the base revtex4-1 class which completely ignores the tocdepth counter.

So, no: you have no way for removing subsections (and subsubsections) from the table of contents, unless you go with a sledghehammer:

\documentclass{AIAA}

\makeatletter
\def\l@subsection#1#2#3{}
\def\l@subsubsection#1#2#3{}
\makeatother

\begin{document}

I believe the copy editors will not be happy at all with this code, which might cause rejection of the manuscript.


text:
Permutations of Elements in Multisets with Infinite Repetition Numbers

# Permutations of Elements in Multisets with Infinite Repetition Numbers

Recall that a multiset is a collection of elements allowing the repetition of elements and that the repetition number of an element in a multiset is the number of times that element appears in the multiset.

We first consider counting the number of $k$-permutations of a multiset containing $n$ distinct elements $x_1, x_2, ..., x_n$ and all of whose repetition numbers are $\infty$. Such a multiset $A$ is of the following form:

(1)
\begin{align} \quad A = \{ \infty \cdot x_1, \infty \cdot x_2, ..., \infty \cdot x_n \} \end{align}

Now suppose that we want to determine how many $k$-permutations of the elements from the multiset $A$ are possible. For the first position in our $k$-permutation we can select any of the elements in $A$ and there are $n$ distinct elements to choose from. For the second position, we can also select any of the $n$ distinct elements in $A$ and there is no restriction to choosing any of them since each distinct element appears an infinite number of times in $A$. In fact, for each position in our $k$-permutation, we have a choice between $n$ distinct elements to choose from. Therefore by the multiplication principle we have that:

(2)
\begin{align} \quad \mathrm{number \: of \:} k-\mathrm{permutations} = \underbrace{n \cdot n \cdot ... \cdot n}_{k} = n^k \end{align}

As a simple example, suppose that we want to construct a $3$-letter password out of the letters in the alphabet. In a sense, our "multiset" is the alphabet for which there is no restriction on which of the $26$ letters we can choose from. For the first character of our password, we can choose any of the $26$ letters. The same goes for the second and third characters of our password and so the total number of passwords we can have, i.e., the total number of $3$-permutations from a multiset with $26$ distinct elements and whose repetition numbers are $\infty$ is $26^3 = 17576$.

For another example, consider a bag of $3$ balls that are coloured red, yellow, and blue. Suppose that we select three balls, one ball at a time, and return the ball every time we draw one. How many different ways are there to select the three balls? Once again, we can imagine the bag of balls for which we return each drawn ball as a multiset, and our problem becomes finding the number of $3$-permutations of coloured balls that are possible. We can select either the red, yellow, or blue for all three of the drawings and so by the multiplication principle we have that there will be $3^3 = 27$ different ways for three balls to be drawn. They are given in the following table:

 $(R, R, R )$ $(R, R, Y )$ $(R, R, B )$ $(R, Y, R )$ $(R, Y, B )$ $(R, B, R )$ $(R, B, Y )$ $(R, Y, Y )$ $(R, B, B )$ $(Y, Y, Y )$ $(Y, Y, R )$ $(Y, Y, B )$ $(Y, R, Y )$ $(Y, R, B)$ $(Y, B, Y )$ $(Y, B, R )$ $(Y, R, R )$ $(Y, B, B )$ $(B, B, B )$ $(B, B, Y )$ $(B, B, R )$ $(B, Y, B )$ $(B, Y, R )$ $(B, R, B )$ $(B, R, Y )$ $(B, Y, Y )$ $(B, R, R )$


text:
Two forces

Two forces with magnitudes of 25 and 30 pounds act on an object at angles of 10° and 100° respectively. Find the direction and magnitude of the resultant force. Round to two decimal places in all intermediate steps and in your final answer.

Result

α =  60.19 °
m =  19.41

Solution:

$F= F_1 + F_2 \ \\ x = F_{x1} + F_{x2} \ \\ y = F_{y1} + F_{y2} \ \\ \ \\ x = 25 \sin(10^\circ )+30\sin(100^\circ ) = 19.41 \ \\ y = 25\cos(10^\circ )+30\cos(100^\circ ) = 33.89 \ \\ \alpha = \arctan \dfrac{y}{x} = 60.19 ^\circ \ \\$
$r = \sqrt{x^2 + y^2 } = 19.41$

Leave us a comment of this math problem and its solution (i.e. if it is still somewhat unclear...):

Be the first to comment!

Following knowledge from mathematics are needed to solve this word math problem:

Two vectors given by its magnitudes and by included angle can be added by our vector sum calculator. Pythagorean theorem is the base for the right triangle calculator. See also our trigonometric triangle calculator.

Next similar math problems:

1. Find the 5
Find the equation with center at (1,20) which touches the line 8x+5y-19=0
2. Rectangle 39
Find the perimeter and area of the rectangular with vertices (-1, 4), (0,4), (0, -1), and (-4, 4)
3. Circle
Circle is given by centre on S[-7; 10] and maximum chord 13 long. How many intersect points have circle with the coordinate axes?
4. Triangle
Triangle KLM is given by plane coordinates of vertices: K[11, -10] L[10, 12] M[1, 3]. Calculate its area and itsinterior angles.
5. Equilateral cylinder
Equilateral cylinder (height = base diameter; h = 2r) has a volume of V = 199 cm3 . Calculate the surface area of the cylinder.
6. Vectors
Vector a has coordinates (8; 10) and vector b has coordinates (0; 17). If the vector c = b - a, what is the magnitude of the vector c?
7. Angle between vectors
Find the angle between the given vectors to the nearest tenth of a degree. u = (-22, 11) and v = (16, 20)
An airplane leaves an airport and flies to west 120 miles and then 150 miles in the direction S 44.1°W. How far is the plane from the airport (round to the nearest mile)?
9. Square
Points A[-9,7] and B[-4,-5] are adjacent vertices of the square ABCD. Calculate the area of the square ABCD.
The rectangular crossroads comes passenger car and an ambulance, the ambulance left. Passenger car is at 43 km/h and ambulance 52 km/h. Calculate such a relative speed of the ambulance moves to the car.
11. Vector
Calculate length of the vector v⃗ = (9.75, 6.75, -6.5, -3.75, 2).
12. Unit vector 2D
Determine coordinates of unit vector to vector AB if A[-6; 8], B[-18; 10].
13. 3d vector component
The vector u = (3.9, u3) and the length of the vector u is 12. What is is u3?
14. Cylinders
Area of the side of two cylinders is same rectangle of 33 mm × 18 mm. Which cylinder has a larger volume and by how much?
15. Speed of Slovakian trains
Rudolf decided to take the train from the station 'Trnava' to 'Zemianske Kostoľany'. In the train timetables found train R 725 Remata : km0Bratislava hl.st.12:574Bratislava-Vinohrady13:0113:0219Pezinok13:1213:1346Trnava13:3013:3263Leopoldov13:4514:0168H
16. Segments
Which of the pairs of numbers on the number line encloses the longest segment: ?
17. Line
Line p passing through A[-10, 6] and has direction vector v=(3, 2). Is point B[7, 30] on the line p?


text:
# A chemistry problem by George Snow

Chemistry Level 2

What is the approximate molecular weight of a 20 pound tire?

×


text:
Classification of the compactifications of $\mathbb{R}$

Do you know if there exists a classification of the compactifications of $\mathbb{R}$?

From here, we can deduce that there exist only two compactifications with finite remainder: $[0,1]$ and $\mathbb{S}^1$; and from here, you can show that there doesn't exist a compactication with a countable remainder (but an example is given for a compactification with a remainder of cardinality $\mathfrak{c}$). On the other hand, the biggest compactification of $\mathbb{R}$ is $\beta \mathbb{R}$ with a remainder of cardinality $2^{\mathfrak{c}}$.

Can we deduce a complete classification of the compactifications of $\mathbb{R}$?

-
Compact subsets of $\beta \mathbb{R}$ containing $\mathbb{R}$, almost by definition. Whether this counts as a classification, of course, depends on what you mean by "classification." –  Qiaochu Yuan Nov 17 '12 at 9:15
A very nice answer would be a set of explicit topological spaces (as the examples given above), but it depends on how nice are the compactifications of $\mathbb{R}$. –  Seirios Nov 17 '12 at 9:37
@Qiaochu: That’s some but not all: just as $\omega+1$ isn’t a subspace of $\beta\omega$, $S^1$ isn’t a subspace of $\beta\Bbb R$. What is true is that if $c\Bbb R$ is a compactification of $\Bbb R$, there is a continuous surjection $f:\beta\Bbb R\to c\Bbb R$ whose restriction to $\Bbb R$ is the identity. –  Brian M. Scott Nov 17 '12 at 9:38
@Brian: my apologies, I got confused about the direction of the universal property. –  Qiaochu Yuan Nov 17 '12 at 9:41
@Qiaochu: No problem; life would be simpler in many ways if it did go the other way. (Though Anatole Beck would have denied this strenuously when I was in grad school, pointing out that mathematics would then be inconsistent!) –  Brian M. Scott Nov 17 '12 at 9:44

Since there’s a nice bijection between compactifications of $\Bbb R$ and algebras $\mathscr{A}\subseteq C^*(\Bbb R)$ that separate points and closed sets and are closed in the sup norm, you can turn the problem into one of classifying these algebras; more might be known from that point of view.
This paper mentions a classification of a large subset of the compactifications that is also algebraic in nature, but a bit easier to git a grip on: in Section 8.4 that the lattice of all topological group compactifications of $\Bbb R$ is isomorphic to the lattice of subgroups of $\Bbb R_d$, the discretization of $\Bbb R$, ordered by $\subseteq$. For something more topological, this paper isn’t an attempt at a large-scale classification, but it does construct a class of compactifications of $\Bbb R$ that includes some that (unlike $\beta\Bbb R$) can be visualized, if not quite so easily as the one- and two-point compactifications.
In some sense, you answered my question; the compactifications of $\mathbb{R}$ are not as nice as I expected. –  Seirios Nov 24 '12 at 11:07


text:
Time: 2017.11.14, 15:15–17:00
Location: Seminarraum 9, Oskar-Morgenstern-Platz 1, 2.Stock
Title: "On the diameter problem for finite simple groups."
Speaker: Arindam Biswas (Universität Wien)
Abstract: If $$G$$ is a non-abelian finite simple group and $$S$$ an arbitrary symmetric generating set, it is conjectured that its Cayley graph $$C(G; S)$$ will have a diameter bound of $$(\log |G|)^{O(1)}$$. The talk will highlight some of the recent progress in this direction and show a non-trivial upper bound when $$G$$ is a finite simple Lie group of large rank. Specifically we shall show that if $$G$$ has rank $$n$$, and its base field has bounded size, then the diameter of $$C(G; S)$$ would be bounded by $$\exp(O(n(\log n)^3))$$.


text:
# zbMATH — the first resource for mathematics

A modification of the Nevanlinna theory. (English) Zbl 1207.30047
This paper presents a modification of the Nevanlinna theory by making use of the full generality of the Poisson–Jensen formula instead of using a special case of the formula, the Jensen formula, that had been used to deduce the “classical” Nevanlina theory. More precisely, let $$\alpha$$ be a point in the disk $$|z|<R_{0}\leq\infty$$ and suppose that $$f(\alpha )\neq\infty$$ for a given meromorphic function $$f$$. Then for $$\alpha <r<R_{0}$$, define the modified Nevanlinna functions as $m_{\alpha}(r,f)=\frac{1}{2\pi}\int_{0}^{2\pi}\log^{+}|f(re^{it})| Re \frac{re^{it}+\alpha}{re^{it}-\alpha}dt,$
$N_{\alpha}(r,f)=\sum_{|b_{k}|<r}\log \left| \frac{r^{2}-\overline{b_{k}}\alpha}{r(\alpha -b_{k})}\right|,$
$T_{\alpha}(r,f)=m_{\alpha}(r,f)+N_{\alpha}(r,f),$ where the $$b_{k}$$ stand for the poles of $$f$$. Then, several standard Nevanlinna theory results follow in terms of these modified functions, including the first and second main theorems, the Cartan formula, and a variant of the logarithmic derivative lemma. The proofs are, in fact, natural modifications of the corresponding “classical” results. As pointed out by the author, these modified functions have been applied previously by Nevanlinna himself, see [R. Nevanlinna, Analytic functions. Translated from the second German edition by Phillip Emig. Die Grundlehren der mathematischen Wissenschaften. 162. Berlin-Heidelberg-New York: Springer-Verlag. VIII, 373 p. (1970; Zbl 0199.12501)], who used them to study meromorphic functions of bounded type. Somewhat surprisingly, the present modified theory has not been completely appeared before, although similar developments are due to H. Cartan [Annales Ecole norm. (3) 45, 255–346 (1928; JFM 54.0357.06)] and D. Drasin [Acta Math., 122, 231–263 (1969; Zbl 0176.02802)]. As an example of possible applications, the author proves an estimate for the modified proximity function of certain differential polynomials, see W. Doeringer [Pac. J. Math., 98, 55–62 (1982; Zbl 0445.30025)] for a corresponding “classical” result. The author also proposes to treat differential-difference polynomials in terms of the modified theory, to appear in a forth-coming paper. The reviewer is confident of the importance of the present paper, to be applied for a number of applications in the field of value distribution theory.

##### MSC:
 30D35 Value distribution of meromorphic functions of one complex variable, Nevanlinna theory 30D45 Normal functions of one complex variable, normal families
Full Text:
##### References:
 [1] W. Bergweiler, Bloch’s principle, Comput. Methods Funct. Theory 6 (2006), 77–108. · Zbl 1101.30034 [2] H. Cartan, Sur les systèmes de fonctions holomorphes a variétés linéaires lacunaires et leurs applications, Ann. École Norm. Sup. (3) 45 (1928), 255–346. · JFM 54.0357.06 [3] W. Döringer, Exceptional values of differential polynomials, Pacific J. Math. 98 (1982), 55–62 · Zbl 0469.30023 [4] D. Drasin, Normal families and the Nevanlinna theory, Acta Math. 122 (1969), 231–263. · Zbl 0176.02802 [5] J. Grahl, Some applications of Cartan’s theorem to normality and semiduality of gap power series, J. Anal. Math. 82 (2000), 207–220. · Zbl 0970.30003 [6] J. Grahl, Hayman’s alternative and normal families of nonvanishing meromorphic functions, Comput. Methods Funct. Theory 2 (2002), 481–508. · Zbl 1062.30033 [7] –, Differential polynomials with dilations in the argument and normal families, preprint. · Zbl 1221.30077 [8] W. K. Hayman, Meromorphic Functions, Oxford University Press, London, 1964. [9] G. Jank and L. Volkmann, Einführung in die Theorie der ganzen und meromorphen Funktionen mit Anwendungen auf Differentialgleichungen, Birkhäuser, Basel Boston Stuttgart, 1985. · Zbl 0682.30001 [10] R. Nevanlinna, Analytic Functions, Springer, Berlin, 1970. · Zbl 0199.12501 [11] X. Pang, Bloch’s principle and normal criterion, Sci. Sinica 32 no.7 (1989), 782–791. · Zbl 0687.30023 [12] X. Pang, On normal criterion of meromorphic functions, Sci. Sinica 33 no.5 (1990), 521–527 · Zbl 0706.30024 [13] St. Ruscheweyh and L. Salinas, On some cases of Bloch’s principle, Scientia Ser. A, Math. Sciences 1 (1988), 97–100. · Zbl 0685.30026 [14] St. Ruscheweyh and K.-J. Wirths, Normal families of gap power series, Results in Math. 10 (1986), 147–151. · Zbl 0623.30044 [15] J. Schiff, Normal Families, Springer, New York, 1993. [16] W. Schwick, Normality criteria for families of meromorphic functions, J. Anal. Math. 52 (1989), 241–289. · Zbl 0667.30028 [17] W. Schwick, An estimation of the proximity function of the logarithmic derivative for families of meromorphic functions, Compl. Var. 15 (1990), 149–154. · Zbl 0728.30024 [18] L. Yang, Value Distribution Theory, Springer, Berlin Heidelberg, 1993. · Zbl 0790.30018 [19] L. Zalcman, A heuristic principle in complex function theory, Amer. Math. Monthly 82 (1975), 813–817. · Zbl 0315.30036 [20] L. Zalcman, Normal families: new perspectives, Bull. Amer. Math. Soc. 35 (1998), 215–230. Jürgen Grahl · Zbl 1037.30021
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# American Institute of Mathematical Sciences

December 2018, 8(4): 461-479. doi: 10.3934/naco.2018029

## Weighted vertices optimizer (WVO): A novel metaheuristic optimization algorithm

 Department of electrical and computer engineering, University of Tabriz, Tabriz, Iran

Received  August 2017 Revised  March 2018 Published  September 2018

This paper introduces a novel optimization algorithm that is based on the basic idea underlying the bisection root-finding method in mathematics. The bisection method is modified for use as an optimizer by weighting each agent or vertex, and the algorithm developed from this process is called the weighted vertices optimizer (WVO). For exploitation and exploration, both swarm intelligence and evolution strategy are used to improve the accuracy and speed of WVO, which is then compared with six other popular optimization algorithms. Results confirm the superiority of WVO in most of the test functions.

Citation: Soheil Dolatabadi. Weighted vertices optimizer (WVO): A novel metaheuristic optimization algorithm. Numerical Algebra, Control & Optimization, 2018, 8 (4) : 461-479. doi: 10.3934/naco.2018029
##### References:
 [1] M. Z. Ali, N. H. Awad, P. N. Suganthan and R. G. Reynolds, A modified cultural algorithm with a balanced performance for the differential evolution frameworks, Knowledge-Based Systems, 111 (2016), 73-86. doi: 10.1016/j.knosys.2016.08.005. [2] E. Atashpaz-Gargari and C. Lucas, Imperialist Competitive Algorithm: An algorithm for optimization inspired by imperialistic competition, IEEE Congress on Evolutionary Computation, Singapore, 2007. doi: 10.1109/CEC.2007.4425083. [3] R. L. Burden and J. D. Faires, Numerical Analysis, 3rd edition, Prindle, Weber and Schmidt, 1985. [4] M. Dorigo, V. Maniezzo and A. Colorni, Ant system: optimization by a colony of cooperating agents, IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 26 (1996), 29-41. doi: 10.1109/3477.484436. [5] R. Eberhart and J. Kennedy, A new optimizer using particle swarm theory, the Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, 1995. doi: 10.1109/MHS.1995.494215. [6] L. J. Fogel, A. J. Owens and M. J. Walsh, Artificial Intelligence through Simulated Evolution, John Wiley and Sons, 1966. doi: 10.1109/9780470544600.ch7. [7] D. E. Goldberg and J. H. Holland, Genetic algorithms and machine learning, Machine Learning, 3 (1988), 95-99. [8] Z.-L. Gaing, A particle swarm optimization approach for optimum design of PID controller in AVR system, IEEE Transactions on Energy Conversion, 19 (2004), 384-391. doi: 10.1109/TEC.2003.821821. [9] Z. W. Geem, J. H. Kim and G. Loganathan, A New Heuristic Optimization Algorithm: Harmony Search, Simulation, 76 (2001), 60-68. [10] D. Karaboga and B. Basturk, Artificial Bee Colony (ABC) Optimization Algorithm for Solving Constrained Optimization Problems, International Fuzzy Systems Association World Congress, 2007. doi: 10.1007/s10898-007-9149-x. [11] E.-H. Kenane, F. Djahli and C. Dumond, A novel Modified Invasive Weeds Optimization for linear array antennas nulls control, 4th International Conference on Electrical Engineering (ICEE), Boumerdes, Algeria, 2015. doi: 10.1109/INTEE.2015.7416784. [12] J. Liang, P. Suganthan and K. Deb, Novel composition test functions for numerical global optimization, Swarm Intelligence Symposium, Pasadena, CA, USA, 2005. doi: 10.1109/SIS.2005.1501604. [13] A. Mehrabian and C. Lucas, A novel numerical optimization algorithm inspired from weed colonization, Ecological Informatics, 1 (2006), 355-366. doi: 10.1016/B978-0-12-416743-8.00001-4. [14] R. G. Reynolds, An Introduction to Cultural Algorithms, 3rd Annual Conference on Evolutionary Programming, 1994. [15] W. Xiang, M. An, Y. Li, R. He and J. Zhang, An improved global-best harmony search algorithm for faster optimization, Expert Systems with Applications, 41 (2014), 788-803. doi: 10.1016/j.eswa.2014.03.016. [16] X.-S. Yang, Nature-Inspired Metaheuristic Algorithms: Second Edition, Luniver press, 2010. [17] A. E. M. Zavala, A. H. Aguirre and E. R. V. Diharce, Constrained optimization via particle evolutionary swarm optimization algorithm (PESO), 7th annual conference on Genetic and evolutionary computation, Washington DC, USA, 2005.

show all references

##### References:
 [1] M. Z. Ali, N. H. Awad, P. N. Suganthan and R. G. Reynolds, A modified cultural algorithm with a balanced performance for the differential evolution frameworks, Knowledge-Based Systems, 111 (2016), 73-86. doi: 10.1016/j.knosys.2016.08.005. [2] E. Atashpaz-Gargari and C. Lucas, Imperialist Competitive Algorithm: An algorithm for optimization inspired by imperialistic competition, IEEE Congress on Evolutionary Computation, Singapore, 2007. doi: 10.1109/CEC.2007.4425083. [3] R. L. Burden and J. D. Faires, Numerical Analysis, 3rd edition, Prindle, Weber and Schmidt, 1985. [4] M. Dorigo, V. Maniezzo and A. Colorni, Ant system: optimization by a colony of cooperating agents, IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 26 (1996), 29-41. doi: 10.1109/3477.484436. [5] R. Eberhart and J. Kennedy, A new optimizer using particle swarm theory, the Sixth International Symposium on Micro Machine and Human Science, Nagoya, Japan, 1995. doi: 10.1109/MHS.1995.494215. [6] L. J. Fogel, A. J. Owens and M. J. Walsh, Artificial Intelligence through Simulated Evolution, John Wiley and Sons, 1966. doi: 10.1109/9780470544600.ch7. [7] D. E. Goldberg and J. H. Holland, Genetic algorithms and machine learning, Machine Learning, 3 (1988), 95-99. [8] Z.-L. Gaing, A particle swarm optimization approach for optimum design of PID controller in AVR system, IEEE Transactions on Energy Conversion, 19 (2004), 384-391. doi: 10.1109/TEC.2003.821821. [9] Z. W. Geem, J. H. Kim and G. Loganathan, A New Heuristic Optimization Algorithm: Harmony Search, Simulation, 76 (2001), 60-68. [10] D. Karaboga and B. Basturk, Artificial Bee Colony (ABC) Optimization Algorithm for Solving Constrained Optimization Problems, International Fuzzy Systems Association World Congress, 2007. doi: 10.1007/s10898-007-9149-x. [11] E.-H. Kenane, F. Djahli and C. Dumond, A novel Modified Invasive Weeds Optimization for linear array antennas nulls control, 4th International Conference on Electrical Engineering (ICEE), Boumerdes, Algeria, 2015. doi: 10.1109/INTEE.2015.7416784. [12] J. Liang, P. Suganthan and K. Deb, Novel composition test functions for numerical global optimization, Swarm Intelligence Symposium, Pasadena, CA, USA, 2005. doi: 10.1109/SIS.2005.1501604. [13] A. Mehrabian and C. Lucas, A novel numerical optimization algorithm inspired from weed colonization, Ecological Informatics, 1 (2006), 355-366. doi: 10.1016/B978-0-12-416743-8.00001-4. [14] R. G. Reynolds, An Introduction to Cultural Algorithms, 3rd Annual Conference on Evolutionary Programming, 1994. [15] W. Xiang, M. An, Y. Li, R. He and J. Zhang, An improved global-best harmony search algorithm for faster optimization, Expert Systems with Applications, 41 (2014), 788-803. doi: 10.1016/j.eswa.2014.03.016. [16] X.-S. Yang, Nature-Inspired Metaheuristic Algorithms: Second Edition, Luniver press, 2010. [17] A. E. M. Zavala, A. H. Aguirre and E. R. V. Diharce, Constrained optimization via particle evolutionary swarm optimization algorithm (PESO), 7th annual conference on Genetic and evolutionary computation, Washington DC, USA, 2005.
a) the bisection method b) the raw concept of WVO algorithm using two vertices
the graphical description of proposed method for five vertices mode
the flowchart of WVO algorithm
2D plot of test functions
3D sketch of Shurb's function (F1)
the positions of WVO vertices in first iteration
A) the positions of vertices in second iteration B)the positions of vertices in 5th iteration C)the positions of vertices in 9th iteration D)the positions of vertices in 13th iteration
the cost value versus iteration
cost value of F2 function in each iteration
cost value of F3 function in each iteration
cost value of F4 function in each iteration
cost value of F5 function in each iteration
cost value of F6 function in each iteration
block diagram of AVR along with PID controller [17]
cost value of each method for AVR's PID
the step response of without PID controller and with optimized gains
the logarithmic plot of cost function versus iteration for F5 function and different N${}_{V}$
the logarithmic plot of cost function versus iteration for F6 function and different N${}_{V}$
parameters of WVO
 C${}_{F}$ C${}_{B}$ C${}_{G}$ N${}_{V}$ V${}_{Speed}$ W${}_{GB}$ W${}_{GW}$ 0.6 0.3 0.085 2 0.6 10 1
 C${}_{F}$ C${}_{B}$ C${}_{G}$ N${}_{V}$ V${}_{Speed}$ W${}_{GB}$ W${}_{GW}$ 0.6 0.3 0.085 2 0.6 10 1
benchmark optimization functions
 ID Name Function Bound Global Min F1 Shubert $(\sum^5_{i=1}{icos(\left(i+1\right)x_1+1)})$ $(\sum^5_{i=1}{icos(\left(i+1\right)x_2+1)})$ ${\left[\text{-2.12.2.12}\right]}^{\text{2}}$ -186.7309 F2 Six-hump camel back $\left(4-2.1x^2_1+\frac{x^4_1}{3}\right)x^2_1 $$+x_1x_2+(-4+4x^2_2)x^2_2 {\left[\text{-5.5}\right]}^{\text{2}} -1.0316285 F3 Sphere \sqrt{\sum^D_{i=1}{x^2_i}} {\left[\text{-32.32}\right]}^{\text{10}} 0 F4 Ackley -A\times exp\left(-0.02\sqrt{\frac{\sum^D_{i=1}{x^2_i}}{D}}\right) -{\text{exp} \left(\frac{\sum^D_{i=1}{{\text{cos} \left(2\pi x_i\right)\ }}}{D}\right)\ }+A\ ;A=20 {\left[\text{-100.100}\right]}^{\text{10}} 0 F5 Griewank 1+\frac{1}{4000}\sum^D_{i=1}{x^2_i-\prod^D_{i=1}{\text{cos}\text{}(\frac{x_i}{\sqrt{i}})}} {\left[\text{-600.600}\right]}^{\text{10}} 0 F6 Rastrigin 10D+\sum^D_{i=1}{(x^2_i-10\text{cos}\text{}(2\pi x_i))} {\left[\text{-5.12.5.12}\right]}^{\text{10}} 0  ID Name Function Bound Global Min F1 Shubert (\sum^5_{i=1}{icos(\left(i+1\right)x_1+1)}) (\sum^5_{i=1}{icos(\left(i+1\right)x_2+1)}) {\left[\text{-2.12.2.12}\right]}^{\text{2}} -186.7309 F2 Six-hump camel back \left(4-2.1x^2_1+\frac{x^4_1}{3}\right)x^2_1$$+x_1x_2+(-4+4x^2_2)x^2_2$ ${\left[\text{-5.5}\right]}^{\text{2}}$ -1.0316285 F3 Sphere $\sqrt{\sum^D_{i=1}{x^2_i}}$ ${\left[\text{-32.32}\right]}^{\text{10}}$ 0 F4 Ackley $-A\times exp\left(-0.02\sqrt{\frac{\sum^D_{i=1}{x^2_i}}{D}}\right)$ $-{\text{exp} \left(\frac{\sum^D_{i=1}{{\text{cos} \left(2\pi x_i\right)\ }}}{D}\right)\ }+A\ ;A=20$ ${\left[\text{-100.100}\right]}^{\text{10}}$ 0 F5 Griewank $1+\frac{1}{4000}\sum^D_{i=1}{x^2_i-\prod^D_{i=1}{\text{cos}\text{}(\frac{x_i}{\sqrt{i}})}}$ ${\left[\text{-600.600}\right]}^{\text{10}}$ 0 F6 Rastrigin $10D+\sum^D_{i=1}{(x^2_i-10\text{cos}\text{}(2\pi x_i))}$ ${\left[\text{-5.12.5.12}\right]}^{\text{10}}$ 0
cost value of each optimization algorithm in 78th iteration
 Method Cost value WVO 1.78 E-15 PSO 7.36 E-4 GA 9.17 E-5 IWO 2.157 HS 2.56E-3 CA 5.93E-6 mIWO 1.23 E-5 mHS 8.69 E-9 mCA 5.12 E-10
 Method Cost value WVO 1.78 E-15 PSO 7.36 E-4 GA 9.17 E-5 IWO 2.157 HS 2.56E-3 CA 5.93E-6 mIWO 1.23 E-5 mHS 8.69 E-9 mCA 5.12 E-10
the performance of each optimization method
 WVO PSO GA IWO HS CA mIWO mHS mCA F1 N1 13 45 27 184 88 47 132 44 23 B2 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 R3 1 5 3 9 7 6 8 4 2 F2 N 19 50 24 54 60 24 39 45 20 B -1.03163 -1.03163 -1.03163 -1.03162 -1.03162 -1.03162 -1.03162 -1.03162 -1.03162 R 1 7 3 8 9 3 5 6 2 F3 N 77 1158 1500 1498 1501 1500 1382 1500 1500 B 1.71 E-58 0 7.64 E-128 2.43 E-6 2 E-10 1.89 E-143 1.13 E-12 3.12E-8 0 R 5 1 4 9 7 3 6 8 2 F4 N 67 233 199 198 1501 1336 173 1500 1363 B 8.88 E-16 4.44 E-15 20 20 6.2 E-5 20.29 6.13 E-3 2.52 E-8 1.23 E-4 R 1 2 7 8 4 9 6 3 5 F5 N 41 116 251 744 1501 468 632 432 321 B 0 0.09747 0 0.90271 1.52 E-8 20.25 2.38 E-3 1.58 E-32 9.78 E-2 R 1 7 2 8 4 9 5 3 6 F6 N 30 119 418 200 1501 1130 123 1245 1351 B 0 5.9697 0 8.9552 4.06 E-10 22.94947 3.25 E-9 3.15 E-21 4.65 E-3 R 1 7 2 8 4 9 5 3 6 $\boldsymbol{\mathit{\boldsymbol{\sum}}}$ R 1 5 2 9 6 8 6 4 3 1N:Number of iteration - 2B:Best cost value - 3R:Rank
 WVO PSO GA IWO HS CA mIWO mHS mCA F1 N1 13 45 27 184 88 47 132 44 23 B2 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 -176.7309 R3 1 5 3 9 7 6 8 4 2 F2 N 19 50 24 54 60 24 39 45 20 B -1.03163 -1.03163 -1.03163 -1.03162 -1.03162 -1.03162 -1.03162 -1.03162 -1.03162 R 1 7 3 8 9 3 5 6 2 F3 N 77 1158 1500 1498 1501 1500 1382 1500 1500 B 1.71 E-58 0 7.64 E-128 2.43 E-6 2 E-10 1.89 E-143 1.13 E-12 3.12E-8 0 R 5 1 4 9 7 3 6 8 2 F4 N 67 233 199 198 1501 1336 173 1500 1363 B 8.88 E-16 4.44 E-15 20 20 6.2 E-5 20.29 6.13 E-3 2.52 E-8 1.23 E-4 R 1 2 7 8 4 9 6 3 5 F5 N 41 116 251 744 1501 468 632 432 321 B 0 0.09747 0 0.90271 1.52 E-8 20.25 2.38 E-3 1.58 E-32 9.78 E-2 R 1 7 2 8 4 9 5 3 6 F6 N 30 119 418 200 1501 1130 123 1245 1351 B 0 5.9697 0 8.9552 4.06 E-10 22.94947 3.25 E-9 3.15 E-21 4.65 E-3 R 1 7 2 8 4 9 5 3 6 $\boldsymbol{\mathit{\boldsymbol{\sum}}}$ R 1 5 2 9 6 8 6 4 3 1N:Number of iteration - 2B:Best cost value - 3R:Rank
the understudy composition functions [12]
 CF1 CF2 CF3 $f_1, f_2, \dots , f_{10}=F5$ $f_{1-2}\left(x\right)=F4$$f_{3-4}\left(x\right)=F6$$f_{5-6}\left(x\right)=F7$$f_{7-8}\left(x\right)=F5$$f_{9-10}\left(x\right)=F3$ $f_{1-2}\left(x\right)=F6$$f_{3-4}\left(x\right)=F7$$f_{5-6}\left(x\right)=F5$$f_{7-8}\left(x\right)=F4$$f_{9-10}\left(x\right)=F3$
 CF1 CF2 CF3 $f_1, f_2, \dots , f_{10}=F5$ $f_{1-2}\left(x\right)=F4$$f_{3-4}\left(x\right)=F6$$f_{5-6}\left(x\right)=F7$$f_{7-8}\left(x\right)=F5$$f_{9-10}\left(x\right)=F3$ $f_{1-2}\left(x\right)=F6$$f_{3-4}\left(x\right)=F7$$f_{5-6}\left(x\right)=F5$$f_{7-8}\left(x\right)=F4$$f_{9-10}\left(x\right)=F3$
results of optimization algorithms for three CFs
 PSO [12] DE [12] GA WVO CF1 Mean 1.7203 E2 1.4441 E2 1.3451 E2 1.1121 E2 Std. deviation 3.2869 E1 1.9401 E1 1.9142 E1 1.4232 E1 CF2 Mean 3.1430 E2 3.2486 E2 3.2314 E2 3.0021 E2 Std. deviation 2.0006 E1 1.4784 E1 1.8154 E1 1.6823 E1 CF3 Mean 8.3450 E1 1.0789 E1 7.5421 E1 3.8124 E1 Std. deviation 1.0111 E2 2.6040 E0 1.0512 E1 8.5412 E1
 PSO [12] DE [12] GA WVO CF1 Mean 1.7203 E2 1.4441 E2 1.3451 E2 1.1121 E2 Std. deviation 3.2869 E1 1.9401 E1 1.9142 E1 1.4232 E1 CF2 Mean 3.1430 E2 3.2486 E2 3.2314 E2 3.0021 E2 Std. deviation 2.0006 E1 1.4784 E1 1.8154 E1 1.6823 E1 CF3 Mean 8.3450 E1 1.0789 E1 7.5421 E1 3.8124 E1 Std. deviation 1.0111 E2 2.6040 E0 1.0512 E1 8.5412 E1
value of AVR's parameters [17]
 Parameter value K${}_{A}$ 10 ${\tau _A}$ 0.1 K${}_{E}$ 1 ${\tau _E}$ 0.4 K${}_{G}$ 1 ${\tau _G}$ 1 K${}_{R}$ 1 ${\tau _R}$ 0.01
 Parameter value K${}_{A}$ 10 ${\tau _A}$ 0.1 K${}_{E}$ 1 ${\tau _E}$ 0.4 K${}_{G}$ 1 ${\tau _G}$ 1 K${}_{R}$ 1 ${\tau _R}$ 0.01
obtained values and the result for each optimization method
 KP KI KD RT ST(sec) OS(%) Final error (%) Cost value WVO 0.600518 0.41376 0.20136 0.3101 0.5013 0.0003 0 3.11706 PSO 0.600532 0.41386 0.20137 0.3141 0.5013 0.0017 0 3.11752 GA 0.610065 0.42965 0.20784 0.3226 0.5005 0.1522 0.018 3.17785
 KP KI KD RT ST(sec) OS(%) Final error (%) Cost value WVO 0.600518 0.41376 0.20136 0.3101 0.5013 0.0003 0 3.11706 PSO 0.600532 0.41386 0.20137 0.3141 0.5013 0.0017 0 3.11752 GA 0.610065 0.42965 0.20784 0.3226 0.5005 0.1522 0.018 3.17785
effect of C${}_{F}$, C${}_{B}$, C${}_{G}$, W${}_{GB}$ and W${}_{GW}$ on performance of WVO
 Function C${}_{F}$ The best cost Iteration C${}_{B}$ The best cost Iteration C${}_{G}$ The best cost Iteration W${}_{GB}$ The best cost Iteration W${}_{GW}$ The best cost Iteration F5 0.2 3.12E-12 46 0.2 0 43 0.02 0 73 2 0 47 2 0 41 0.4 2.02E-19 42 0.4 0 41 0.04 0 45 5 0 43 5 0 45 0.6 0 42 0.6 0 42 0.06 0 45 10 0 42 10 0 47 0.8 0 42 0.8 2.31E-26 43 0.08 0 41 15 0 42 15 0 47 1 3.12E-30 44 1 8.64E-23 45 0.1 0 53 20 0 43 20 0 48 F6 0.2 2.31E-6 45 0.2 0 41 0.02 2.31E-26 45 2 0 45 2 0 43 0.4 0 42 0.4 0 42 0.04 0 43 5 0 43 5 0 43 0.6 0 42 0.6 1.12E-28 45 0.06 0 43 10 0 43 10 0 43 0.8 0 45 0.8 6.78E-25 49 0.08 0 41 15 0 44 15 0 45 1 0 45 1 1.32E-24 51 0.1 0 44 20 0 44 20 0 48
 Function C${}_{F}$ The best cost Iteration C${}_{B}$ The best cost Iteration C${}_{G}$ The best cost Iteration W${}_{GB}$ The best cost Iteration W${}_{GW}$ The best cost Iteration F5 0.2 3.12E-12 46 0.2 0 43 0.02 0 73 2 0 47 2 0 41 0.4 2.02E-19 42 0.4 0 41 0.04 0 45 5 0 43 5 0 45 0.6 0 42 0.6 0 42 0.06 0 45 10 0 42 10 0 47 0.8 0 42 0.8 2.31E-26 43 0.08 0 41 15 0 42 15 0 47 1 3.12E-30 44 1 8.64E-23 45 0.1 0 53 20 0 43 20 0 48 F6 0.2 2.31E-6 45 0.2 0 41 0.02 2.31E-26 45 2 0 45 2 0 43 0.4 0 42 0.4 0 42 0.04 0 43 5 0 43 5 0 43 0.6 0 42 0.6 1.12E-28 45 0.06 0 43 10 0 43 10 0 43 0.8 0 45 0.8 6.78E-25 49 0.08 0 41 15 0 44 15 0 45 1 0 45 1 1.32E-24 51 0.1 0 44 20 0 44 20 0 48
the effect of N${}_{V}$ value on speed of algorithm
 Function N${}_{V}$ The best cost Iteration F5 2 0 47 3 0 43 4 0 42 5 0 41 10 0 43 15 4.55E-8 116 F5 2 0 45 3 0 43 4 0 43 5 0 44 10 0 44 15 0.406497 116
 Function N${}_{V}$ The best cost Iteration F5 2 0 47 3 0 43 4 0 42 5 0 41 10 0 43 15 4.55E-8 116 F5 2 0 45 3 0 43 4 0 43 5 0 44 10 0 44 15 0.406497 116
 [1] Xiangyu Gao, Yong Sun. A new heuristic algorithm for laser antimissile strategy optimization. Journal of Industrial & Management Optimization, 2012, 8 (2) : 457-468. doi: 10.3934/jimo.2012.8.457 [2] Miao Yu. A solution of TSP based on the ant colony algorithm improved by particle swarm optimization. Discrete & Continuous Dynamical Systems - S, 2018, 0 (0) : 979-987. doi: 10.3934/dcdss.2019066 [3] Santanu Sarkar, Subhamoy Maitra. Some applications of lattice based root finding techniques. Advances in Mathematics of Communications, 2010, 4 (4) : 519-531. doi: 10.3934/amc.2010.4.519 [4] Mingyong Lai, Xiaojiao Tong. A metaheuristic method for vehicle routing problem based on improved ant colony optimization and Tabu search. Journal of Industrial & Management Optimization, 2012, 8 (2) : 469-484. doi: 10.3934/jimo.2012.8.469 [5] Mohamed A. Tawhid, Kevin B. Dsouza. Hybrid binary dragonfly enhanced particle swarm optimization algorithm for solving feature selection problems. Mathematical Foundations of Computing, 2018, 1 (2) : 181-200. doi: 10.3934/mfc.2018009 [6] Min Zhang, Gang Li. Multi-objective optimization algorithm based on improved particle swarm in cloud computing environment. Discrete & Continuous Dynamical Systems - S, 2018, 0 (0) : 1413-1426. doi: 10.3934/dcdss.2019097 [7] Wenxing Zhu, Yanpo Liu, Geng Lin. Speeding up a memetic algorithm for the max-bisection problem. Numerical Algebra, Control & Optimization, 2015, 5 (2) : 151-168. doi: 10.3934/naco.2015.5.151 [8] Roya Soltani, Seyed Jafar Sadjadi, Mona Rahnama. Artificial intelligence combined with nonlinear optimization techniques and their application for yield curve optimization. Journal of Industrial & Management Optimization, 2017, 13 (4) : 1701-1721. doi: 10.3934/jimo.2017014 [9] Yunmei Chen, Xiaojing Ye, Feng Huang. A novel method and fast algorithm for MR image reconstruction with significantly under-sampled data. Inverse Problems & Imaging, 2010, 4 (2) : 223-240. doi: 10.3934/ipi.2010.4.223 [10] Tao Zhang, Yue-Jie Zhang, Qipeng P. Zheng, P. M. Pardalos. A hybrid particle swarm optimization and tabu search algorithm for order planning problems of steel factories based on the Make-To-Stock and Make-To-Order management architecture. Journal of Industrial & Management Optimization, 2011, 7 (1) : 31-51. doi: 10.3934/jimo.2011.7.31 [11] Qiang Long, Changzhi Wu. A hybrid method combining genetic algorithm and Hooke-Jeeves method for constrained global optimization. Journal of Industrial & Management Optimization, 2014, 10 (4) : 1279-1296. doi: 10.3934/jimo.2014.10.1279 [12] Ahmet Sahiner, Nurullah Yilmaz, Gulden Kapusuz. A novel modeling and smoothing technique in global optimization. Journal of Industrial & Management Optimization, 2019, 15 (1) : 113-130. doi: 10.3934/jimo.2018035 [13] Junyuan Lin, Timothy A. Lucas. A particle swarm optimization model of emergency airplane evacuations with emotion. Networks & Heterogeneous Media, 2015, 10 (3) : 631-646. doi: 10.3934/nhm.2015.10.631 [14] Jinyuan Zhang, Aimin Zhou, Guixu Zhang, Hu Zhang. A clustering based mate selection for evolutionary optimization. Big Data & Information Analytics, 2017, 2 (1) : 77-85. doi: 10.3934/bdia.2017010 [15] Barbara Kaltenbacher, Jonas Offtermatt. A refinement and coarsening indicator algorithm for finding sparse solutions of inverse problems. Inverse Problems & Imaging, 2011, 5 (2) : 391-406. doi: 10.3934/ipi.2011.5.391 [16] Yang Chen, Xiaoguang Xu, Yong Wang. Wireless sensor network energy efficient coverage method based on intelligent optimization algorithm. Discrete & Continuous Dynamical Systems - S, 2018, 0 (0) : 887-900. doi: 10.3934/dcdss.2019059 [17] Lixing Han. An unconstrained optimization approach for finding real eigenvalues of even order symmetric tensors. Numerical Algebra, Control & Optimization, 2013, 3 (3) : 583-599. doi: 10.3934/naco.2013.3.583 [18] Qifeng Cheng, Xue Han, Tingting Zhao, V S Sarma Yadavalli. Improved particle swarm optimization and neighborhood field optimization by introducing the re-sampling step of particle filter. Journal of Industrial & Management Optimization, 2019, 15 (1) : 177-198. doi: 10.3934/jimo.2018038 [19] Masaru Ikehata. On finding an obstacle with the Leontovich boundary condition via the time domain enclosure method. Inverse Problems & Imaging, 2017, 11 (1) : 99-123. doi: 10.3934/ipi.2017006 [20] Masaru Ikehata, Mishio Kawashita. On finding a buried obstacle in a layered medium via the time domain enclosure method. Inverse Problems & Imaging, 2018, 12 (5) : 1173-1198. doi: 10.3934/ipi.2018049

Impact Factor:


text:
# Using \scalebox from graphicx with double dollar math mode

I'm making a beamer presentation and I'd need to scale a specific equation. The slide is built using double dollars math environments which allows me to easily align the left and right columns. Problem is one specifically long equation doesn't fit in the slide, so I wanted to shrink it. Using single dollar math mode does work but it breaks the alignment.

\documentclass[mathserif]{beamer}
\usepackage{physics}
\usepackage{graphicx}
\begin{document}
\begin{frame}
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\centering
Osservabile: $N$

Stati: $\ket{\psi_1}, \ket{\psi_2}, \dots \ket{\psi _N}$

Misure: $a_1, a_2, \dots a_N$
\vspace{5mm}

Super-posizione
$$N: \ket{\Psi} = c_1 \ket{\psi_1} + c_2 \ket{\psi_2} \dots c_N \ket{\psi_N}$$%this is the equation I would like to shrink

Collasso della funzione d'onda
$$p(a = a_N) = |c_N|^2 \qquad \ket{\Psi} = \ket{\psi_N}$$
\end{column}
\begin{column}{0.48\textwidth}
\centering
Osservabile: $Gatto$

Stati: $\ket{\omega}, \ket{\xi}$

Misure: $vivo, morto$
\vspace{5mm}

Super-posizione
$$Gatto: \ket{\Gamma} = c_V \ket{\omega} + c_M \ket{\xi}$$

Collasso della funzione d'onda
$$p(a = vivo) = |c_V|^2 \qquad \ket{\Gamma} = \ket{\omega}$$
\end{column}
\end{columns}
\end{frame}
\end{document}

Using

\scalebox{0.8}{$$N: \ket{\Psi} = c_1 \ket{\psi_1} + c_2 \ket{\psi_2} \dots c_N \ket{\psi_N}$$}

Breaks the entire slide and using single dollar math mode works, but breaks the alignment.

I unfortunately cannot make more slides since I have a very strict number of slides limit.

• Start with never using $$ May 28, 2021 at 10:22 • why not \small why do you want to scale? May 28, 2021 at 10:27 • Welcome to TeX.SE! May 28, 2021 at 10:38 • @egreg Why not use $$?
– hola
May 28, 2021 at 13:05

I would consider both comments below question, use nccmath package for \medmath environment for the longest equation and change a width of columns:

\documentclass[mathserif]{beamer}
\usepackage{physics}
\usepackage{graphicx}
\usepackage{nccmath}

\begin{document}
\begin{frame}
\small
\begin{columns}[T]
\begin{column}{0.5\textwidth}
Osservabile: $N$

Stati: $\ket{\psi_1}, \ket{\psi_2}, \dots \ket{\psi _N}$

Misure: $a_1, a_2, \dots a_N$

Super-posizione
$\medmath N\colon\ket{\Psi} = c_1 \ket{\psi_1} + c_2 \ket{\psi_2} \dots c_N \ket{\psi_N}$%this is the equation I would like to shrink
Collasso della funzione d'onda
$p(a = a_N) = |c_N|^2 \quad \ket{\Psi} = \ket{\psi_N}$
\end{column}
\begin{column}{0.45\textwidth}
Osservabile: \textit{Gatto}

Stati: $\ket{\omega}, \ket{\xi}$

Misure: \textit{vivo, morto}

Super-posizione
$\mathit{Gatto:}\ \ket{\Gamma} = c_V \ket{\omega} + c_M \ket{\xi}$
Collasso della funzione d'onda
$p(a = \mathit{vivo}) = |c_V|^2 \quad \ket{\Gamma} = \ket{\omega}$
\end{column}
\end{columns}
\end{frame}
\end{document}

Personal I prefer left aligned contents in columns.

You might use \resizebox:

  $\resizebox{\displaywidth}{!}{% N: \ket{\Psi} = c_1 \ket{\psi_1} + c_2 \ket{\psi_2} + \dots + c_N \ket{\psi_N}% }  As you see, the resizing takes place inside display math mode. On the other hand, you can use a summation, which is shorter and clearer. All you need is to add a phantom in the corresponding column to balance the size. \documentclass[mathserif]{beamer} \usepackage{braket} \usepackage{graphicx} \begin{document} \begin{frame} \begin{columns}[T] \begin{column}{0.48\textwidth} \centering Osservabile: N Stati: \ket{\psi_1}, \ket{\psi_2}, \dots, \ket{\psi _N} Misure: a_1, a_2, \dots, a_N \medskip Super-posizione \[ % \resizebox{\displaywidth}{!}{% % N: \ket{\Psi} = c_1 \ket{\psi_1} + c_2 \ket{\psi_2} + \dots + c_N \ket{\psi_N}% % } \textstyle N: \ket{\Psi} = \sum\limits_{i=1}^n c_i\ket{\psi_i}$

Collasso della funzione d'onda
$p(a = a_N) = |c_N|^2 \quad \ket{\Psi} = \ket{\psi_N}$
\end{column}

\begin{column}{0.48\textwidth}
\centering

Osservabile: $\mathit{Gatto}$

Stati: $\ket{\omega}, \ket{\xi}$

Misure: $\mathit{vivo}, \mathit{morto}$

\medskip

Super-posizione
$\mathit{Gatto}: \ket{\Gamma} = c_V \ket{\omega} + c_M \ket{\xi} \vphantom{\textstyle\sum\limits_{i=1}^n}$
Collasso della funzione d'onda
$p(a = \mathit{vivo}) = |c_V|^2 \quad \ket{\Gamma} = \ket{\omega}$
\end{column}

\end{columns}

\end{frame}

\end{document}

Note the changes I made: \mathit{Gatto} and not just Gatto; you're missing commas and operation signs around the dots.

Never use $$ with LaTeX. See Why is $...$ preferable to$$ ... ?

About physics and braket, I chose to use the latter, because I find the former awkward and that it forces bad typesetting decisions.

Here are the pictures for the two versions, first with the summation and the phantom. I have no doubt which one I prefer (the first one, of course).


text:
# Physics307L F09:People/Ierides/

## Planck's Constant

In this lab we were to achieve a measured value for Planck's Constant $h\,\!$ using an h/e apparatus combined with a mercury light source shining beams of different colored light through the filters as seen in my lab report. From our observations we were to confirm the independence of the energy stored in light from the light's intensity and the dependence of the light's energy on it's frequency. The main overview and summary of the procedure and lab is provided by this link:

Prof. Gold's Lab Manual
The following link leads to my Planck's Constant Lab entry that includes the data, procedure, and observations that were made:
Planck's Constant Lab Notebook Entry

### Data Summary

• Derivations & Calculations (from lab notebook): [1]
The total maximum energy of the electrons leaving the cathode is:
$E =h \nu= KE_{max} + W_0 \,\!$
$KE_{max}=\frac{1}{2}m_ev^2$
where $E=h\nu\,\!$ is the initial energy of the photon and $E=KE_{max}+W_0\,\!$ is the resulting energy containing the final kinetic energy of the electron plus the energy loss due to the electron overcoming the work function; :$m_e\,\!$ is the rest mass of the electron and $v\,\!$ is its final velocity.
The negative potential, $V_s\,\!$, needed to stop the flow of electrons is derived by equating the potential barrier, :$eV_s\,\!$, to the electron's kinetic energy where $e\,\!$ is the charge of an electron and:
$eV_s=KE_{max}\,\!$
So
$E=eV_s+W_0=h\nu\,\!$
$eV_s=h\nu-W_0\,\!$
$V_s=\frac{h\nu-W_0}{e}\,\!$
From this equation we can see that there is a linear relation between the stopping potential $V_s\,\!$ and the frequency :$\nu\,\!$ with slope $\frac{h}{e}\,\!$.
Using the slope from our best-fit line and the electron's charge, $e\,\!$, we can approximate the value of Planck's constant:
$e=1.602\times {10^{-19}} C\,\!$
$h=me\,\!$
where $m\,\!$ is the slope of our line. So,
$m_{first order}=4 \pm 0.001\times 10^{-15} Vs\,\!$
$h_{measured, first order}=me=(4\pm 0.001\times 10^{-15} Vs)(1.602\times {10^{-19}} C)\,\!$
$\simeq 6.408\pm 0.0016\times 10^{-34} Js\,\!$
$m_{second order}=3\pm 0.001\times 10^{-15} Vs\,\!$
$h_{measured, second order}=me=(3\pm 0.001\times 10^{-15} Vs)(1.602\times {10^{-19}} C)\,\!$
$\simeq 4.806\pm 0.0016\times 10^{-34} Js\,\!$
Also, using the y-intercept from our graph we can find the work function, $W_0\,\!$:
$y=mx+b\,\!$
$y_{intercept}=\frac{W_0}{e}\,\!$
$W_0=ey_{intercept}\,\!$
$y_{first order}=(4\pm 0.001\times 10^{-15})x-1.5483\pm 0.001\,\!$
$y_{intercept, first order}=-1.5483\pm 0.001\,\!$
$W_{0measured, first order}=(-1.5483\pm 0.001 V)(1.602\times {10^{-19}} C)\,\!$
$\simeq -2.48\pm 0.0016\times 10^{-19} J\,\!$
$y_{second order}=(3\pm 0.001\times 10^{-15})x-0.94\pm 0.001\,\!$
$y_{intercept, second order}=-0.94\pm 0.001\,\!$
$W_{0measured, second order}=(-0.94\pm 0.001 V)(1.602\times {10^{-19}} C)\,\!$
$\simeq -1.506\pm 0.0016\times 10^{-19} J\,\!$

• Error Claculations:
Percent error from accepted value
$\% error=\frac{h_{accepted}-h_{measured}}{h_{accepted}}$
$h_{accepted}=6.62606896(33)\times10^{-34} Js$
$\% error_{first order}=\frac{6.62606896(33)\times10^{-34} Js-6.408\times 10^{-34} Js}{6.62606896(33)\times10^{-34} Js}$
$\simeq 3.29 \%\,\!$
$\% error_{second order}=\frac{6.62606896(33)\times10^{-34} Js-4.806\times 10^{-34} Js}{6.62606896(33)\times10^{-34} Js}$
$\simeq 27.47 \%\,\!$

### Conclusion

From our results we find that our values for our second order maxima may have been wrong. The error estimated for our measured Planck's constant was very large. I'm not particularly sure for why that is. From our table, our values for the stopping potential was significantly different for the green spectra between first and second order. We were not able to figure out why that is either. For our first order measurement of Planck's Constant we found that we managed to get quite close to the current accepted value. Although the transmission narrowed the intensity per part by 20 %, our measured stopping potential only varied by a small amount for each time measured. We found that the energy stored in light is independent of intensity but depends on the incident frequency. Also, due to our error estimation, I find that the measurement for the first order stopping potential should be more correct and hence see that it only takes about 1.5 eV for the electrons to leave the cathode inside the h/e apparatus. Overall this lab was informative and exciting in the sense that we were able to understand one way in which constants--Planck's to be exact--are determined. Of course it takes more trials to conclude the actual value, but we had some problems with our equipment (check our uncertainty notes in lab notebook). [2]


text:
# Subresultant algorithm taking a lot of time for higher degree univariate polynomials with coefficients from fraction fields

I have to compute the gcd of univariate polynomials over the fraction field of $\mathbb{Z}[x,y]$. I wanted to use the subresultant algorithm already implemented for UFDs. I copied the same function to fraction_field.py. The subresultant algorithm calls the psuedo division algorithm which has the following step : R = dR - cB.shift(diffdeg) - this hangs when we consider random polynomials of degree >6 in $Frac(\mathbb{Z}[x,y])[z]$.

(Note: In the current version of sage it uses the regular Euclidean algorithm implemented in rings.py for computing gcd in this case. It is much slower than the subresultant algorithm (hangs for degrees >4) which is why I thought the subresultant algorithm will improve things.)

Sample input: sage: A.<x,y>=ZZ[]

sage: B= Frac(A)

sage: C.<z> = B[]

sage: p = C.random_element(6)

sage: q = C.random_element(6)

sage: gcd(p,q)

The following function is what I copied into fraction_field.py from unique_factorisation_domain.py.

def _gcd_univariate_polynomial(self, f, g):

    if f.degree() < g.degree():
A,B = g, f
else:
A,B = f, g

if B.is_zero():
return A

a = b = self.zero()
for c in A.coefficients():
a = a.gcd(c)
if a.is_one():
break
for c in B.coefficients():
b = b.gcd(c)
if b.is_one():
break

d = a.gcd(b)

#d=1
A = A // a
B = B // b
g = h = 1

delta = A.degree()-B.degree()
_,R = A.pseudo_quo_rem(B)

while R.degree() > 0:
A = B
B = R // (g*h**delta)
h = h*g**delta // h**delta
delta = A.degree() - B.degree()
_, R = A.pseudo_quo_rem(B)
# print("i am here")

if R.is_zero():
b = self.zero()
for c in B.coefficients():
b = b.gcd(c)
if b.is_one():
break

return d*B // b

return d

This calls the following pseudo quo remainder function in polynomial_element.pyx. It is in this function I was able to see that it hangs at R = dR - cB.shift(diffdeg).

def pseudo_quo_rem(self,other):

    if other.is_zero():
raise ZeroDivisionError("Pseudo-division by zero is not possible")

# if other is a constant, then R = 0 and Q = self * other^(deg(self))
if other in self.parent().base_ring():
return (self * other**(self.degree()), self._parent.zero())

R = self
B = other
Q = self._parent.zero()
e = self.degree() - other.degree() + 1

while not R.degree() < B.degree():

diffdeg = R.degree() - B.degree()

Q = d*Q + self.parent()(c).shift(diffdeg)

R = d*R - c*B.shift(diffdeg)

e -= 1

q = d**e
return (q*Q,q*R)

edit retag close merge delete

It is really hard to reconstruct the error. (Without also copying the obvious same function to fraction_field, and guessing the code that builds the fraction fields, and knowing the meaning of d,R, cB, shift, diffdeg after an fgrep of potential modules, and searching / finding an explicit example that reproduces the same problem.) It would be simpler for a potential helper if the question already isolates a minimal example with simple polynomials also leading to the same error, and the code would be welcome...

( 2017-05-23 11:48:27 -0600 )edit

yes I understand that. I will edit the question with more details.

( 2017-05-23 15:54:17 -0600 )edit

I am the author of these lines. I don't have time to have a careful look right now, but I'll do that next week.

( 2017-05-24 03:32:54 -0600 )edit

thank you! that will be great!

( 2017-05-24 03:38:26 -0600 )edit

Sort by » oldest newest most voted

I looked into the issue. You correctly identified the place where it hangs. Actually, in the line R = d*R - c*B.shift(diffdeg), the long time is taken by the two multiplications.

The problem is that d and the coefficients of R are very large rational fractions: I stopped the computation at some point when it hanged, and stored the values of R and d there: The degrees in each variable is around 50 for both d and the coefficients of R, and their number of terms is around 2500 each. Already computing the product of d with one coefficient of R takes around 2s on the machine I use.

Looking more into details, the problem is SageMath's multiplication of bivariate polynomials which is quite slow. To sum up: I think there is (unfortunately) no bug, simply the objects are too large for the current capabilities of SageMath.

As a further comment, the value of d and the coefficients of R are all polynomials in $\mathbb Z[x,y]$ (they are rational fractions, but with denominator $1$). Putting them in the ring A (that represents $\mathbb Z[x,y]$ in your example) does not change anything on the computation time. On the other hand, using as a base ring $\mathbb Z[y][x]$ improves the performance of the multiplication (the computation is approx. 20 times faster). One solution may then be to modify pseudo_quo_rem for your needs, using a recursive univariate polynomial ring (U = ZZ['y']['x']) as base ring instead of a multivariate polynomial ring.

P.S.: Though this website is devoted to SageMath, I think that the (free, of course) Computer Algebra System Nemo, written is Julia, is particularly efficient for such kind of computations. You may have a look to it.

more

thank you so much for the reply. We are building some packages for sagemath and this gcd is getting called in them. Can you probably explain what you mean by the limitations of sage math - is it for example because of the limitations of singular (Since in the multiplication function it calls the gcd function in multi_polynomial_libsingular.pyx and always hangs there since the number of monomials is big) ? or is it something else in the architecture? The reason I was asking is because I was wondering if it can be rectified" if we spend more time on it? or would it be a complete overhaul of the code?

( 2017-06-01 13:48:25 -0600 )edit

Also when i tried adding a dummy variable in the polynomial ring and type casting the polynomials p and q as multivariate polynomials it was computed very fast. Any reason for why it happens differently when it is a multivariate polynomial over a fraction field versus a univariate polynomial over a fraction field?

( 2017-06-02 10:12:39 -0600 )edit

Multivariate polynomials are handled by Singular while univariate polynomials are handled by Flint or NTL. This explains that computation times may vary a lot between univariate and multivariate implementations since different libraries are doing the actual work behind the scene. One would need to delve further to fully understand the differences in the computation times between univariate and multivariate polynomials. Note that you do not need to add a dummy variable to use the multivariate implementation. You can define your polynomial ring as R.<x> = PolynomialRing(A, 1) to get a multivariate polynomial ring in one variable.

( 2017-06-06 04:04:05 -0600 )edit


text:
# Using Centroid decomposition instead of SVD

This paper says centroid decomposition (CD) is an approximation to singular value decomposition (SVD). First I do not understand CD yet, since code is available I just want to try it out how it works but I cannot figure out how to use it, it looks preety much different than SVD. Given a CD how do I get left/right singular vectors and singular values which I can use in my code?

• Here is another paper on the CD. The main idea seems to be to maximize $x^\top A^\top A x$ not for all possible vectors, but only for $x \in \{0,1\}^n$. – cfh Apr 3 '15 at 17:27
• doi.org/10.1137/S0895479800382555 useful paper. I plan to come back to this question later this summer. – Anton Menshov Jun 9 at 18:11


text:
# 2018 Putnam Problem A2 Exploration in R

Problem A2 of the 2018 Putnam Competition states:

Let $$S_1, S_2, \dots, S_{2^n-1}$$ be the nonempty subsets of $$\{1,2,\dots,n\}$$ in some order, and let $$M$$ be the $$(2^n-1) \times (2^n-1)$$ matrix whose $$(i,j)$$ entry is $m_{ij} = \begin{cases} 0 & \mbox{if }S_i \cap S_j = \emptyset; \\ 1 & \mbox{otherwise.} \end{cases}$ Calculate the determinant of $$M$$.

First thing to note is that we can generate all nonempty subsets of $$\{1, 2, \ldots, n\}$$ by converting each integer from $$1$$ to $$2^{n} - 1$$ to binary. We can then compute set intersection with a bitwise AND.

In R we can accomplish this with the function:

intersects <- function(x, y) as.integer(!all((intToBits(x) & intToBits(y)) == intToBits(0)))

# 5 corresponds to {3, 1}, 1 corresponds to {1}
intersects(5, 1)
## [1] 1
 # 4 corresponds to {3}, 3 corresponds to {2, 1}
intersects(4, 3)
## [1] 0

So for some $$n$$ we create the matrix $$M$$. The function outer creates a matrix by applying a specified function to each pair for entries in the first two arguments. (Note that the function must be vectorized. See ?outer for help.)

n <- 3
N <- 2^n - 1

(X <- outer(1:N, 1:N, Vectorize(intersects)))
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7]
## [1,]    1    0    1    0    1    0    1
## [2,]    0    1    1    0    0    1    1
## [3,]    1    1    1    0    1    1    1
## [4,]    0    0    0    1    1    1    1
## [5,]    1    0    1    1    1    1    1
## [6,]    0    1    1    1    1    1    1
## [7,]    1    1    1    1    1    1    1
det(X)
## [1] -1

Let’s wrap this up in a function

m_det <- function(n) {
intersects <- function(x, y) as.integer(!all((intToBits(x) & intToBits(y)) == intToBits(0)))

N <- 2^n - 1
X <- outer(1:N, 1:N, Vectorize(intersects))
det(X)
}

m_det(3)
## [1] -1

Now we can apply it to a sequence of numbers:

vapply(1:7, m_det, numeric(1))
## [1]  1 -1 -1 -1 -1 -1 -1

So the solution is probably $$-1$$ for all $$n > 1$$. The proof is left to the reader of course.


text:
# Tagless Final For Writing Compilers¶

Writing a compiler could consist of numerous steps.

Therefore, a solution to allow compiler writers to - merely focus on only one step of the whole compilation at one time, - keep away from awaring other dependent steps, and - able to composite the separate steps into a big one,

could be beneficial(better for collaborations as well?).

Tagless Final can be an approach for this demand, due to one of its useful feature: “interpreting one term from various perspectives”.

## Problem¶

Given a BNF grammar(hereafter as Lamu0),

expr ::= let | lam | app
let  ::= 'let' ID '=' expr 'in' expr
lam  ::= 'fn' ID '=>' expr
app  ::= atomexpr
|   app atomexpr
atomexpr ::= INT | STRING | FLOAT | '(' expr ')'

To compile the language Lamu0 to a lower representation(like C), there’re quite a lot of phases we have to go through, even though we don’t take GC or optimizations into consideration here:

• To generate low level code, we shall

• check validity of program: type inference

• eliminate high level language constructs like:

• lambda

• name shadowing(let binding)

• closure(free variables)

• To perform type inference

we’re supposed to correctly identify different occurrences for a symbol, and assign the same type to the symbol’s occurrences.

• To eliminate name shadowings

we’re supposed to rename duplicate symbols to make all of them unique.

• To eliminate closures, we do closure conversions

we’re supposed to find free variables for each lambda, and do some extra code generation such as creating closure data structures.

note, we’re supposed to design the data structures to represent closures, and different free variables might be stored using different low level representations. So we need type inference.

type inference < closure conversion

• To eliminate lambdas

we’re supposed to recursively lift lambdas to global functions, but any free variable shall be rejected here, thus this phase should start after closure conversions.

closure conversion < eliminating lambdas

Distinguishing scoped symbols from each other, detecting free variables, both of them are involved in the analysis for Scopes, or name resolution, thus

name resolution < type inference

name resolution < eliminating name shadowing

name resolution < closure conversion

Next, we can make a order for compiler phases, from source code to low level code:

name resolution(1)    < type infer(2)
name resolution(1)    < eliminating name shadowing(3)
name resolution(1)    < closure conversion(4)
type infer(2)         < closure conversion(4)
closure conversion(4) < eliminating lambdas(5)

One solution for these compiler phases is

1. name resolution(1)     <
2. type infer(2)          <
3. closure conversion(4)  <
4. elim lambdas(5)        <
5. elim name shadowing(3)

Recall our goals: 1. allow compiler writers to focus on only one phase, and no need to care about the dependent phases(e.g., when writing type inference, no need to care about name resolution) 2. the separately implemented compiler phases can be composited into a big one

We can use an example to illustrate the obstacles. Check following inference rule:

LET:
A |- e: \sigma  A_x \cup {x : \sigma} |- e' : \tau
----------------------------------------------------
A |- (let x = e in e') : \tau

In this case, I’d ask, what’s the form of the type environment A?

This might be considered trivial in many cases, but is crucial in my concerns.

Of course, we can maintain a map from string to type, and push and pop string-type pairs when inferencing.

However, it’d be beneficial if we have already transformed the symbols (like x in let x = e in e') into unique ones, which will then make A_x \cup {x: \sigma} unnecessary, and the inference becomes:

LET:
A |- e: \sigma  A |- e' : \tau
---------------------------------------
A |- (let x = e in e') : \tau

In this way, the overlap between name resolution and type inference gets eliminated. Further, operations like pushing and popping names are already done during name resolution, we don’t have to repeat it. We do dependent phases separately, things get decoupled.

However, the problem comes: How can we make sure the separately implemented compiler phases can get composited?

## Tagless Final For Compiler Phases¶

### Quick Start for Tagless Final¶

module type SYM = sig
type repr
val zero: repr
val succ: repr -> repr
end

(* we want: pass in a module, get a new interpretation *)

module SYMSelf = struct
type repr = {e : 'a. (module SYM with type repr = 'a) -> 'a}
let zero = {e = fun (type a) (module M: SYM with type repr=a) -> M.zero}
let succ {e} = {e = fun (type a) ((module M: SYM with type repr=a) as m)-> M.succ (e m)}
end

let run (type a) ((module M: SYM with type repr=a) as m) (SYMSelf.({e})) = e m

let term = let open SYMSelf in succ @@ succ @@ zero

What is the term in the last line?

module SYMShow = struct
type repr = string
let zero = "0"
let succ x = "succ(" ^ x ^ ")"
end

module SYMList = struct
type repr = {f: 'a. 'a -> 'a list}
let zero = {f = fun _ -> []}
let succ {f=x} = {f=fun a -> a::x a}
end

module SYMNat = struct
type repr = int
let zero = 0
let succ x = x + 1
end

run (module SYMShow) term
-- succ(succ(zero))
let (SYMList.{f}) = run (module SYMList) term in f 1
-- [1; 1]
run (module SYMList) term
-- 2

This is neat!

Think that we implement each compiler phase, just like SYMShow, SYMList, SYMNat?

### “Grammar”¶

Tagless Final firstly requires a grammar for the DSL, and it corresponds to our BNF gramamr.

We now give the structure of interpretion(incidentally, it’s called “grammar”) for aforementioned BNF grammar:

type litype = IntT | FloatT | StringT

module type SYM = sig
type repr
val letl : string -> repr -> repr -> repr
val lam  : string -> repr -> repr
val app  : repr -> repr -> repr
val lit  : litype -> string -> repr
val var  : string -> repr
end

See the implementation of parser:

expr:
LET n=ID ASSIGN bound=expr IN body=expr {SYMSelf.letl n bound body}
| FN n=ID ARROW body=expr {SYMSelf.lam n body}
| ...
;

Then we got something that can be interpreted in various ways, instead of an AST!

### Expanding Representation¶

The compiler phases are usually dependent.

Type inference requires name resolution, so how can we - implement them separately, and - finally composite them by using Tagless Final?

Guess we have implemented these phases, for type infer and name resolution, we shall have

(* name resolution *)
module SYMScope = struct
type repr = scope
..
end

(* type infer*)
module SYMType = struct
type repr = typ (* your type representation *)
let letl : string -> typ -> typ -> typ = ..
..
end

Alas, we cannot use the information from SYMScope in SYMType!

So.. how could we address this problem?

Recall the order of phases,

1. name resolution(1)     <
2. type infer(2)  <
3. closure conversion(4)  <
4. elim lambdas(5)        <
5. elim name shadowing(3)

I guess, the repr is expanding bigger and bigger when passing the phases in order?

type repr = scope ->
type repr = scope * typ ->
type repr = scope * typ * closureinfo ->
type repr = scope * typ * closureinfo * lambdainfo ->
type repr = scope * typ * closureinfo * lambdainfo * unique_name ->
...

### Problems of Decoupling and Compositing¶

However, if we implement a SYM with type repr = scope * typ,

• Repetition, loss of decoupling: we have to repeat ourselves for writing code for SYM with type repr = scope. It seems impossible to reuse SYM with type repr = scope in SYM with type repr = scope * typ.

• Inflexibility, loss of compositing: and further, the most severe thing is, the order of phases gets fixed, and if we misdesign the order of phases, we cannot compose things in a flexible style.

To avoid above losses, just figure out a new abstraction on SYM, called FSYM.

### FSYM¶

module type FSYM = sig
type o
type c
type r
val combine : o -> c -> r
val project : r -> o

val letl : o -> string -> r -> r -> c
val lam  : o -> string -> r -> c
val app  : o -> r -> r -> c
val lit  : o -> litype -> string -> c
val var  : o -> string -> c
end

module Grow (Base: SYM) (Incr: FSYM with type o = Base.repr): SYM with type repr = Incr.r = struct
type repr = Incr.r

let lam n r =
let o = Base.lam n @@ Incr.project r in
let c = Incr.lam o n r in
Incr.combine o c
..
end

We can use FSYM to decouple and composite dependent compiler phases, which is demonstrated in Lamu0 by FSYM.

Besides, the functor Grow also has a function form taking advantage of the first class modules:

let grow = fun
(type o c r')
(module Base: SYM with type r = o)
(module Incr: FSYM with type r = r' and type c = c and type o = o) ->
(module struct
..
end: SYM with type r = r')

### Laziness, for Mutual Dependencies¶

Given 2 compiler phases A and B, there might be such a case:

• A depends on a semi-complete B,

• total-completion of B depends on a whole A, and

• B’s semi-completion can be done independently.

module AB = Grow(A)(B)

(* including semi-completion of B *)
let (repr_a, repr_b) = run (module AB) parsed_term

Assume repr_a and repr_b are both lazy, we can finish the semi-completion of B when calling run, and then

let repr_a = Lazy.force repr_a (* total completion of A *)
let repr_b = Lazy.force repr_b (* total completion of B *)

## Example¶

A cleaner implementation of Tagless Final compiler is Lamu1 instead of Lamu0.

Lamu1 extends lamu0 with principal types.

You can try type inference of Lamu1 in a REPL, by following the simple guideline at here.


text:
# How well can we in principle determine $T_{\textrm{eff}}$ of a star?

This is a question about the basics of astronomy, which I have never happened to see a good discussion for. It is about how well would we be able to measure effective temperature of a star, if we had any arbitrarily perfect measurement devices.

Here is some context. Canonical definition of $T_{\textrm{eff}}$ of a star is based on its bolometric luminosity $L$ (total electromagnetic energy radiated by the star per unit time) and its photospheric radius R (radius, at which the optical depth at a given wavelength is equal to unity). This way, the definition specifies $T_{\textrm{eff}}$ through $L=4\pi \sigma R^2 T_{\textrm{eff}}^4$, where $\sigma$ is Stefan-Boltzmann constant.

The definition clearly alludes to black-body law. Many stars, including our own Sun, have a spectrum that does not follow it. For this reason, one often talks about another effective temperature, which is the temperature of stellar material at photospheric radius, and which can be determined by examining stellar spectrum. There are a few more complications to that, but let's put them aside.

Determining $T_{\textrm{eff}}$ is extremely important in characterising stars, therefore there exists a variety of methods of measuring it, and naturally researchers strive for obtaining the best possible precision.

Hence, the question: How well can one in principle measure $T_{\textrm{eff}}$, if one could have arbitrarily perfect instruments?

Edit: I would like to see a quantitative estimate in your answer. Is the best possible precision for $T_{\textrm{eff}}$ of order $10\textrm{K}$, or is it $1\textrm{K}$, or some $10^{-4}\textrm{K}$, or can we measure it arbitrarily well?

Here are just a few sources of uncertainty/arbitrariness: convection in stars, dependence of photospheric radius on wavelength, limb darkening, stellar variability, to name a few.

I would encourage the answers to be in the format "Source of uncertainty" - "Simple derivation" - "Estimate of the effect". If there are more than a few estimates, I will add a summary of them in the question or in a separate reply. Please, also feel free to edit the question if you might like to.

The question is compromised by saying that you allow arbitrarily perfect measurements.

If we have a bolometer that can measure the amount of flux from a star, at a distance that is known to arbitrary accuracy, with arbitrarily good spatial resolution, then what we do is measure the bolometric luminosity from a 1 m$^2$ area at the centre of the stellar disk. This flux is $\sigma T_{eff}^4$.

Now of course, stars do not have homogeneous atmospheres (spots, granulation, meridional flows, non-sphericity due to rotation...), so the result you would get would depend on exactly what 1 m$^2$ bit of atmosphere you were looking at. So, with my arbitrarily accurate instruments I would have to measure the luminosity from every 1 m$^2$ patch over the entire surface of the star. Each one would give me another estimate of $T_{eff}^4$; each would be somewhat different. That would be difficult, but the form of your question allows me to ignore those problems.

At this level of precision, the utility of a single $T_{eff}$ for the whole star is questionable, but if you wanted one then it would be the flux-weighted mean of all the above measurements, and as far as I can see one can instantaneously determine it to whatever accuracy you desire. Of course it will then vary if you have a variable star, and it will vary from point to point with time due to granulation; so the accuracy of the $T_{eff}$ could depend on how quickly and by how much it varies compared with how long it takes you to do your arbitrarily accurate measurements.

I think to get a better answer, you do need to specify some realistic observational constraints - such as (a) you cannot resolve the star at all, or (b) that you can resolve it, but observations can only take place from an earth-bound observatory (thus not allowing you to take flux measurements from the whole surface at once).

One thing occurs, is that in unresolved observations, even with an absolutely accurately measured luminosity (assuming isotropic radiation) there is still the issue of what radius to use. The radius at which the radiation escapes the star (at optical depth $\sim 2/3$) is ill-defined and wavelength dependent. An error bar of maybe tens of km is appropriate here, since atmospheres are 100-200 km "thick". For a solar-type star this would limit $T_{eff}$ accuracy to $\sim 0.1 K$ !

• Dear Rob, I completely agree with your point, it is not possible to give one unique value for the stellar temperature, for indeed there are various kinds of imperfections going on: inhomogenieties, non-LTE, temperature variation over the photosphere, stellar variability, you name it. However, with the present spectroscopy/stellar models the precision is such that these problems above may be typically omitted as non-significant. The question I am asking then is relatively well defined: until what precision in temperature measurements is it still meaningful to talk about stellar temperature. Oct 18 '15 at 17:21
• And more precisely, I would ideally like to know the number. Is 1K precision meaningless, or is it meaningless to talk about Teff already at precision of 100K, or... ? Oct 18 '15 at 17:22
• @AlexeyBobrick Teff is completely defined, whatever the complications of the atmosphere, so a number could always be errived at. I don't agree that current models are so inaccurate that inhomogeneities and 3D effects don't matter. They may be large and they may be systematic. e.g. I believe that extensive spots on M-dwarfs mean that their Teff is very significantly lower than estimated from colours/spectroscopy. The limiting uncertainty in Teff will come from a definition of the radius at which the radiation escapes. Edit in progress. Oct 18 '15 at 18:02
• Yes, it is a very good point, that there also important systematic contributions. Still, again, the question really is about the magnitudes of the most relevant perturbing effects. Ideally, I would like to see a statement of the kind (this is made up): "For solar-like stars it doesn't make sense to talk about Teff up to precision better than 50K, because the convection causes a variability in the recovered Teff on the scales of a few hours." Oct 18 '15 at 18:17
• @AlexeyBobrick We may be able to discuss in person. I will be at Lund on 30th Oct. Oct 18 '15 at 19:26

It is quite easy. In fact you do not need a bolometer. You just need to perform Intensity measurements in several parts of the spectrum, and then fit these to a theoretical black body spectrum. Three uses to be enough if it does not happen that you are measuring on a spike or valley in the spectrum caused by an emission or absorption line. The black body spectrum that best fits your measurements will give you $$T_{eff}$$.

• First off, part of the uncertainty of the temperature will come from the goodness of the fit (what will it be?). Secondly, do you mean spectrum over the whole disk, or just in the center? If it is the disc, you are measuring T of rather different layers, of it is the center, you are more subject to irregularities (by how much?). Finally, remember about stellar varibility, sunspots, etc. Given all this, no, it is not quite easy. There is a set of phenomena, which limit foundamentally the robustness of the definition of $T$. Main point of my question is - to what degree? Nov 24 '13 at 13:50
• It is quite easy, since for most stars out there we can not distinguish disc and atmosphere. All we see is a Airy disc of the whole of the star light. Nov 24 '13 at 20:01
• Perhaps, I should have stressed in the question, but I really mean that we are looking at the star with arbitrarily perfect instruments: with perfect resolution, sensitivity etc. When talking about the disc, because of limb darkening different parts of the disc correspond to different temperatures. Nov 24 '13 at 20:14
• With perfect instruments you would simply measure R with a perfect telescope and L with a perfect bolometer and apply the formula. No trouble in that. Nov 25 '13 at 2:16
• And how do you 'simply' measure R with a perfect telescope? Let me remind you that R is dependent on $\lambda$, and that the stars are not spheres, nor are they isotropic and contant in time. You can argue, that these are all small effects, but it is the value of the errors from them that I am looking for. Whether the definition of $T_{eff}$ is model dependent up to $10 \textrm{K}$, or whether it is $1\textrm{K}$, or some $10^{-4} \textrm{K}$. Nov 25 '13 at 10:55


text:
# Elliptic curve $Y^2=X^3+X$

Let $$p$$ be prime s.t. $$p=a^2+4b^2, a\equiv 1\,mod\,4$$.

Then, for $$f=X^3+X$$, $$a_E(p)=2a$$?

(Here, $$a_E(p):=p+1-\#\{(x,y)\in\{0,...p-1\}^2|x^3+x\equiv y^2\,mod\,p\}$$)

• What is the context ? The number of points on $y^2=x^3+x\bmod p$ is studied in the theory of elliptic curves with complex multiplication (here by $\Bbb{Z}[i]$) – reuns Jun 11 at 20:33
• Consult OEIS sequence A138515. – Somos Jun 11 at 21:25
• @reuns - this is an exercise in lecture note for undergraduate number theory course (without hint, not hw) and was skipped in class, so the professor probably tried not to use things like Z[i]. I do not know the original reference.. – C.Park Jun 12 at 6:12
• @Somos - I see the sequence, but I don't see how they got that sequence. Is there any way to obtain that? – C.Park Jun 12 at 6:13


text:
# Viability of Heat Pipe technology in Internal Combustion Engine Cooling

1. Dec 2, 2009

### gazza23

Hi there, my first post on this forum and I hope its in the right place !

My question is this, in an exisitng air-cooled motorcycle engine what is the viability of using heat pipe technology to cool exhaust gas temperature? Using heat pipes to remove heat from exhaust valve areas to external heat sinks in order to reduce exhaust gas temperature to improve both emissions levels and engine performance?

Are heat pipes able to remove engine heat fast enough to make this possible?

2. Dec 2, 2009

### Mech_Engineer

I'm not sure cooling the area around the exhaust valves would increase engine performance, but heat pipes are very effective at transferring heat and could theoretically be used for this function.

The problem would be that air is still be used to cool the engine, so to achieve a higher rate of cooling on the engine (heat pipes or no) you need to increase the number/surface area of the heatsinks being used. This increases the size and weight of the engine.

3. Dec 2, 2009

### gazza23

Have a look at this pic, the debate is if this heat pipe technology is being used on this concept motorcycle at all, I'd like to think yes - I'd love to hear from anyone who could either argue for or against it

Apologies for the size of the images but I cant seem to edit the size anywhere. What you see on both bikes are what appear to be heat sinks connected to the cylinder heads via a tube which I assume is a heat pipe. ???

#### Attached Files:

• ###### heatsink.jpg
File size:
108.8 KB
Views:
396
Last edited: Dec 2, 2009
4. Dec 2, 2009

### Danger

I really can't say without taking the thing apart. Truth be told, that looks more like an electrical conduit to me.

5. Dec 2, 2009

### Mech_Engineer

It doesn't look like a heat pipe to me, nor does it seem to be attached to a radiator. Like Danger mentioned it looks more like an electrical conduit, perhaps holding the spark plug wire.

6. Dec 2, 2009

### Topher925

If that is a heat pipe (and I don't think it is), its a poorly designed one. Heat pipes, unlike heat sinks or cooling fins, do not conduct heat. Instead, they transport it using using a working fluid. When this fluid condenses at the condenser of the pipe, it must return to the evaporator via its self generator capillary pressure. Because of this, heat pipes can only be made in small lengths while still being effective. This makes them a good choice cooling things like microprocessors but bad for cooling larger things like engines.

The only exception to this is oscillating heat pipes which contain no porous material and work by the oscillation of the working fluid alone. However, these can only be made using micro-sized tubes and aren't very applicable to engines either.

7. Dec 2, 2009

### Staff: Mentor

....also useful in places where you have a height difference that enhances for natural convection, such as in a horizontally mounted air conditioning unit coil.

I could see a heat pipe being used on a boiler, to preheat incoming air while cooling exhaust. But usually, they use air-to-air heat exchangers.

8. Dec 3, 2009

### Ranger Mike

why would you want to cool the exhaust pipe ( header)..it will only HURT performance...you want the exhaust HOT to keep up velocity and better savange the spent fuel air mixture. in fact the trend in racing is to go to stainless steel tubing to do this..other options are powder coating and thermal tape wrapped around the exhaust pipe to hold in heat. The vavle seat should be just fine as long as you do not lean out the fuel to air ratio..

9. Dec 4, 2009

### gazza23

I am told that exhaust gas temperatures are linked to emissions. That by cooling exhaust gases that you can lower emissions (Please feel free to correct me if I'm wrong).With the latest tightening of EU legislation on emissions controls, this apparently limits engine horse power (so I am told and from what you have just posted above). The theory or rather thinking behind cooling the exhaust valve area is to lower emssions after increasing the engine's horse power and in the process finding a happy medium between the two.

So, by using flexible heat pipe tech to cool exhaust valve areas will lead to a drop in performance. However, if an existing engine design were to be "tuned" to push out a lot more HP, then cooling tech applied to drop the emissions(which have also increased along with HP) to within legal requirements but not to drop the HP to below the orginal "untuned" state of the same engine, is this all a bit far fetched or at all possible?

Here is a youtube video of one of these concept bikes, it will shows these "heatsinks" in more detail: http://www.youtube.com/watch?v=4WiNeOZXAqE"

Last edited by a moderator: Apr 24, 2017
10. Dec 4, 2009

### Ranger Mike

Will cooling exhaust gases lowers emissions. this goes counter to engine development since the EPA initiated emission standards in the 1970s. Engines before this ran at 180 degrees cooling system. after unleaded gasoline was introduced this went to 195 degrees. these " lean Burn" engines has a lot higher exhaust temperatures because air was added to the exhaust after it entered the exhaust pipe to further " burn" the remaining hydrocarbons. finally there was a catalytic converter added to further burn the spent mix.
what I think the current thinking is to cool the valve seat area to permit detonation when upping the compression ration with the crap gasoline we have to run these days. Nascar and trick engine builders do this now to get more HP. They drill passages into the cylinder head at the valve seat area to carry coolant to this area. I can see your question on exhaust tube cooling related to an air cooled motorcycle engine since it has no coolant.

11. Dec 4, 2009

### Mech_Engineer

Exhaust gas temperature is related to engine emissions because it is related to the air/fuel ratio in the engine. A cooler EGT generally menas the engine is running richer, and there is more water in the exhaust (water is a major byproduct of the combustion of gasoline and diesel). Cooling the exhaust gases off after the combustion has taken place is useless. To change the exhaust gas composition after the combustion, you have to add another chemical process (like what a catalytic converter does).

12. Dec 11, 2009

### daveg360

Doesn't temperature have a direct impact on the formation of NOx?

13. Dec 11, 2009

### brewnog

NOx formation occurs under high peak cylinder temperatures. Exhaust temperatures are a poor indication of this.

14. Dec 13, 2009

### boostedHULK

i believe a properly set up cooling system would absolutely work. the colder exhaust should create a low pressure if the system worked as well as we'd like. low pressure would help a great deal in a naturally aspirated engine use a lot of valve overlap. i really doubt you'd lose scavenging or velocity. The velocity is really only gonna be limited by restrictions in the exhaust. If the exhaust is cool, i believe the velocity is still gonna remain at whatever the engine needs. now the lower pressure may cause a need for less velocity, so the velocity may drop, but not necessarily in a way that is gonna hinder performance. i say, someone test is.

15. Dec 13, 2009

### boostedHULK

NOx occurs above a very specific in cylinder combustion situation, during Lean conditions specifically. i believe the temperature that it takes to create NOx is 1800* or something like that. it's pretty high.

16. Dec 13, 2009

### brewnog

NO formation will occur under rich conditions too providing there's sufficient free oxygen and high enough peak cylinder temperatures.

17. Dec 14, 2009

### Ranger Mike

Exhaust Insulating Wrap

The original Exhaust Insulating Wrap was developed over 12 years ago by Thermo-Tec. Exhaust Insulating Wrap is an innovative way to create more horsepower and reduce under-hood temperatures.

Wrapping headers maintains hotter exhaust gases that exit the system faster through decreased density. Increased exhaust scavenging is produced, along with lower intake temperatures. Exhaust Insulating Wrap withstands continuous heat up to 2000°F, and contains no asbestos.

Thermo-Tec exhaust wrap will not over-insulate a system when properly installed due to a proprietary coating developed by Thermo-Tec - Thermal Conduction Technology (TCT) - that conducts heat across the wrap's surface. This coating controls heat build-up and dissipation.

these guys been doing it for years. Dynometer results varify the benefit of going stainless steel or wrapping the headers.

18. Dec 14, 2009

### dr dodge

it seems to me that if the exhaust port area were cooled to much, the resulting condensing gas could cause a reversion someplace in the exhaust system. and the wasted heat being removed needs to be recycled" some way to increase the efficiency of the engine. The header wraps are good products. Under hood temps would decrease drasticly if the better part of the OEM exhaust were covered in this stuff. cooled water condensation in the exhaust systen could also pose problems in the "northlands" I have seen cat converters frozen solid in north dakota after the car sat overnite. (we used to drill a single 1/8 in hole to get them to drain)

dr

19. Dec 17, 2009

### boostedHULK

companies have been building, advertising, and selling the crap out of short ram intakes and cold-air intakes too, but they don't add power. i've seen it, on the dyno with my own eyes. doesn't matter if it's a big block chev. or a 1.3liter suzuki swift...it doesn't add power. without the engine being capable of flowing more air through the entire engine, you don't get anything. The companies that design the engines in the first place, generally put a lot of effort, time and money into designing the engine to work at peak efficiency. A small number of engines use the intake as an intended restriction, and you could pick up a ton of power on an engine like that. But what if the company used the exhaust as the restriction?

20. Dec 18, 2009

### Ranger Mike

i disagree with you. cold air intakes do add HP and performance. but,,you will never see this in a dyno room. time after time our lap times were dramatically improved on chilly autumn evenings when the air was dense...why do you think they had carb chokes in the old days? had to richen the air / fuel mix. cold air more dense and more fule must be added to get back to the correct fuel/air mix. since you can not change the jets in a carb ..easily, the air volume is reduced via the choke mechanism...ram air is exactly that..you need to be moving for it to work...and motown engineers took advantage of this in 1963 with the Ramcharger Dodges and Plymouths , Ford Thunderbolts, 440 six pack big scoop hood, 454 chevy scoops. Pontiac GTO scoops,Ford cobra jet air scoop and many more..if it did NOT help HP why would they spend the

Last edited: Dec 18, 2009


text:
# formal proof – Show by induction hypothesis in the typing structure in \$lambda\$-calculus

I’m starting to study lambda calculus and I need help with the proof methods, especially with induction over typing.
For example, on the

Lemma (Weakening) If $$Gammavdash t:T$$ and $$xnotin dom(Gamma)$$, then $$Gamma,x:Svdash t:T$$. Moreover, the latter derivation has the same depth as the former.


text:
# Hexagonal Close-packed Structure

We get the hcp structure when the third layer is laid down in positions right above A – immediately above the atoms in the first layer. This gives a layering of the type ABABAB.

Back To Solid State Physics

Categories H3


text:
+0

# asymptotes

0
95
1

A function f has a horizontal asymptote of y = -4, a vertical asymptote of x = 8, and an x-intercept at (2,0).

Let f be of the form

f(x)=(ax+b)/(x+c)

Find an expression for f(x).

Oct 19, 2020

#1
+11086
+1

A function f has a horizontal asymptote of y = - 4, a vertical asymptote of x = 8, and an x-intercept at (2,0).

Let f be of the form

f(x)=(ax+b)/(x+c)

Find an expression for f(x).

Hello Guest!

$$f(x)=-\frac{24}{x-8}-4\color{black}=\frac{-24-4x+32}{x-8}=\frac{-4x+8}{x-8}$$

$$f(x)=\large \frac{-4x+8}{x-8}$$        a = - 4,  b = 8,    c = - 8

!

Oct 19, 2020
edited by asinus  Oct 19, 2020