text:
# How to determine if two devices are connected in network?

Is there a free linux softwear to determine if two network devices are connected? Or a php class can be also good...

I'd like to draw the network topology. I can determine the devices in the network with zenmap (it saves the results to file), but I don't know which device connected to which device... (zenmap can also draw topology, but it doesn't save it to file)

-

## migrated from stackoverflow.comMar 11 '11 at 14:20

This question came from our site for professional and enthusiast programmers.

@kungfusia, can you elaborate on what problem you could solve with this information? –  Mike Pennington Apr 24 '11 at 9:40

It sounds like you're trying "map out" a network, going from zero knowledge of what's "out there" to a full knowledge of every device that is reachable from a given point.

Linux commands like ethtool can tell you whether or not your interfaces are physically connected to something else. So that's a good start. Of course, if the thing you are connected to is a router or switch, then you've got additional work to do.

This is actually a deep and complex problem. There isn't a universally recognized "hey, I'm here" protocol other than ping, which is often disabled for security reasons.

Continuning, however, the next thing to work from is your current subnet mask. That should tell you the range of IP addresses that it's possible to communicate with out of that interface. Scanning every possible IP address of a subnet is generally the most reliable way to do this (using a tool like nmap to accomplish it). It's best if a protocol exists to support this purpose, like ping, CDP for Cisco devices, or LLTD for Windows Vista/XP systems.

If you are in a situation where you are dealing with multiple LAN routers, then you can use routes in the FIB (the route or ip route show command), to learn about other subnets that should be indirectly reachable. You then have additional known-reachable IP ranges to scan.

However, if we are talking about the entire Internet, or a very large subnet, then this becomes impractical. In that case a workable solution is generally to rely on "discovery" or "rendezvous" services such as IGMP or Bonjour. You are then at the mercy of only knowing about devices that wish to be known about. But this is better than trying to port scan the entire Internet.

-

traceroute may be a good start: it shows you the number of hops between your own host and a remote. I don't know of a way to get this kind of info for a pair of remotes, except by running traceroute on one of them.

-
Thank you for your answer! In my opinion tracerout can only show the hops between routers... but I'd like to know where is a host, or a switch also. –  kungfucsiga Mar 11 '11 at 14:17

If your device list includes IP addresses and netmasks, you could create a basic layer 3 graph by creating a vertex for each subnet, a vertex for each device, and an edge between each (subnet, device) in your device list.

This will result in a pure layer-3 topology which probably isn't a bad start. Also if your network is somewhat complex, this won't work too well. For example, if you have duplicate or overlapping subnets (perhaps with NAT or MPLS VPNs), the assumption that all devices within a particular IP range are connected may not be true.

-
Thank you for your answer! But how can I do this in practice? (what command should I use, or what software should I use) –  kungfucsiga Mar 11 '11 at 14:14


text:
par2bsp {bspline} R Documentation

## Convert parameters to B-spline function

### Description

Convert parameters to B-spline function

### Usage

par2bsp(n, qw, xk, covqw = NULL, sdy = NULL, sdqw = NULL)

### Arguments

 n Integer scalar, polynomial order of B-splines qw Numeric vector or matrix, coefficients of B-splines, one set per column in case of matrix xk Numeric vector, knots covqw Numeric Matrix, covariance matrix of qw (can be estimated in smbsp). sdy Numeric vector, SD of each y column (can be estimated in smbsp). sdqw Numeric Matrix, SD of qw thus having the same dimension as qw (can be estimated in smbsp).

### Value

Function, calculating B-splines at arbitrary points and having interface f(x, select) where x is a vector of abscissa points. Parameter select is passed to qw[, select, drop=FALSE] and can be missing. This function will return a matrix of size length(x) x ncol(qw) if select is missing. Elsewhere, a number of column will depend on select parameter. Column names in the result matrix will be inherited from qw.

[Package bspline version 2.1 Index]

format: plain


text:
# Math Help - Rearrange in terms of z

1. ## Re: Rearrange in terms of z

Originally Posted by TomByrne
Hi,
I need to rearrange this function in terms of z, I'm struggling a little bit (asterisks are multiplication):

a*(z-b) = -c*d*(f/(f+z))-(c*g)-h*e*(f/(f+z))-(h*i)

Any help?
\displaystyle \begin{align*}a(z - b) &= \frac{cdf}{f + z} - cg - \frac{efh}{f +z } - hi \\ az - ab &= \frac{cdf}{f + z} - \frac{cg(f + z)}{f + z} - \frac{efh}{f + z} - \frac{hi(f + z)}{f + z} \\ az - ab &= \frac{cdf - cg(f + z) - efh - hi(f + z)}{f + z} \\ (az - ab)(f + z) &= cdf - cg(f + z) - efh - hi(f + z) \\ afz + az^2 - abf - abz &= cdf - cgf - cgz - efh - fhi - hiz \\ az^2 + afz + abz + cgz + hiz - abf - cdf + cgf + efh + fhi &= 0 \\ az^2 + \left(af + ab + cg + hi\right)z - abf - cdf + cgf + efh + fhi &= 0 \end{align*}

This is a quadratic of the form $\displaystyle \alpha z^2 + \beta z + \gamma = 0$, which has solution $\displaystyle z = \frac{-\beta \pm \sqrt{\beta ^2 - 4\alpha\gamma}}{2\alpha}$.

2. ## Re: Rearrange in terms of z

Originally Posted by TomByrne
Thanks, great. What are the square brackets in this situation?
SAME as (); simply makes for improved appearance; easier to tell what the numerator is.

3. ## Re: Rearrange in terms of z

Originally Posted by Prove It
\displaystyle \begin{align*}az^2 + \left(af + ab + cg + hi\right)z - abf - cdf + cgf + efh + fhi &= 0 \end{align*}
ProveIT, I think your "ab" should be negative, and your "cdf" should be positive.
Rest of them are same as mine...

4. ## Re: Rearrange in terms of z

Originally Posted by Wilmer

What you think, Pickslide? You proud of me?
Love it, have a beer for me.

5. ## Re: Rearrange in terms of z

Originally Posted by Wilmer
ProveIT, I think your "ab" should be negative, and your "cdf" should be positive.
Rest of them are same as mine...
Well, I agree that ab should be negative. But cdf was positive on the right, so should be negative on the left.

6. ## Re: Rearrange in terms of z

Originally Posted by Prove It
Well, I agree that ab should be negative. But cdf was positive on the right, so should be negative on the left.
No, cdf was negative on the right; original equation:
a * (z-b) = -c * d * (f / (f+z)) - (c * g) - h * e * (f / (f+z)) - (h * i)

Page 2 of 2 First 12


text:
Previous issue ·  Next issue ·  Most recent issue · All issues

# Journal of Operator Theory

Volume 59, Issue 1, Winter 2008  pp. 115-155.

Compact perturbations and stability of the essential spectrum of singular differential operators

Authors V. Georgescu (1) and S. Golenia (2)
Author institution: (1) Departement de Mathematiques, Universite de Cergy-Pontoise, 95302 Cergy-Pontoise, France (2) Departement de Mathematiques, Universite de Cergy-Pontoise, 95302 Cergy-Pontoise, France

Summary:  We establish criteria which ensure that the difference of the resolvents of two unbounded operators acting in Banach modules is compact. The applications cover operators acting on sections of vector fiber bundles over non-smooth manifolds or locally compact abelian groups, in particular differential operators of any order with complex measurable coefficients on $\R^n$, singular Dirac operators, and Laplace-Beltrami operators on Riemannian manifolds with measurable metrics.

Contents    Full-Text PDF


text:
homechevron_rightStudychevron_rightMathchevron_rightAlgebrachevron_rightPolynomials

# Partial fraction decomposition

The calculator decomposes a polynomial fraction to several fractions with a simpler denominator.

The calculator below transforms a polynomial fraction to a sum of simpler fractions. The fraction numerator is defined by a sequence of coefficients (starting form higher-degree coefficient to lower one). The denominator is given by a product of linear or quadratic polynomials raised to a degree >=1.

#### Partial fraction decomposition

Space separated polynomial coefficients.

#### Denominator polynomial factors

arrow_upwardarrow_downwardFactorarrow_upwardarrow_downwardExponent
Items per page:

Problem

#### Solution

Solution

The following calculator provides simpler method to input the denominator and more complicated logic to find the fraction decomposition. But this calculator will not work if the denominator polynomial has irreducible factors of degree>2 in rational numbers.

#### Partial fraction decomposition 2

Space separated polynomial coefficients.
Space separated polynomial coefficients.
Problem

Solution

### Partial fraction expansion procedure

The partial fraction decomposition procedure of a polynomial fraction P(x)/Q(x) is as follows:

• convert the denominator polynomial to monic by dividing P (x) and Q (x) by the leading coefficient of Q (x)

$\frac{P_1(x)}{Q_1(x)} = \frac{P(x)/lc(Q(x)}{Q(x)/lc(Q(x))}$

• if the degree of P1(x) is greater than or equal to the degree of Q1(x), do the long division to find the common polynomial term (quotient) and the new numerator P2(x) (remainder), which degree is less than Q1(x) degree:

$\frac{P_1(x)}{Q_1(x)} = quot(P_1(x),Q_1(x)) + \frac{P_2(x)}{Q_1(x)}$, where $P_2(x)=\frac{rem(P_1(x),Q_1(x))}{Q_1(x)}$

• find the denominator factorization as l linear factors for real roots of Q1(x) and n quadratic factors for complex roots of Q1(x):

$Q_1(x) = (x-x_1)^{k_1}\cdots(x-x_l)^{k_l}(x^2+p_1x+q_1)^{m_1}\cdots(x^2+p_nx+q_n)^{m_n}$

• then the partial fraction decomposition takes the form:

$\frac{P_2(x)}{Q_1(x)} = \sum_{j=1}^l\sum_{k=1}^{k_j} \frac{a_{jk}}{(x-x_j)^k} + \sum_{j=1}^n\sum_{k=1}^{m_j} \frac{b_{jk}x+c_{jk}}{(x^2+p_jx+q_j)^k}$, where ajk, bjk,cjk are real numbers. 1

• reduce the right side numerator to a common denominator
• expand the numerator polynomial factors and express the numerator polynomial coefficients in terms of linear expression of unknown constants ajk, bjk,cjk
• equate each coefficient of P2(x) to the linear expression with ajk, bjk,cjk corresponding to the same degree of x
• create and solve the system of linear equations to obtain ajk, bjk,cjk
You may switch on the 'Show details' toggle of the calculators above to study the procedure steps using an example.

1. V.A.Zorich Math analysis vol.1

#### Similar calculators

PLANETCALC, Partial fraction decomposition


text:
# Numbers defined on graph structures

I asked a question yesterday regarding numbers defined on graph structures that I call graph numbers. I posted the algorithm I was using to define graph numbers, which are simply a natural extension of linear numbers we use all the time. Nolion's response was close but not quite right. The equations are actually:

$$d_{m+n}(v) = \biggl (d_{n}(v) + d_{m}(v) + \sum_{(u,v)\in{E}}{d_{{m+n},{carry over}}(u)} \biggr ) \mod {2}$$

$$d_{{m+n},carryover}(v) = \biggl \lfloor \frac {d_{n}(v) + d_{m}(v) + \sum_{(u,v)\in{E}}{d_{{m+n},{carry over}}(u)} } {2} \biggr \rfloor$$

After reading nolion's response, I was able to come up with these equations. Notice, they are added in $Z$, which is why I need the $\mod 2$ to bring them back to $Z/2Z$. However, the digits of m and n are chosen from $Z/2Z$ (just as in normal binary addition of more than 2 numbers). But the order of evaluation of $d_{m+n}$ matters (which, again, I am not sure how to describe mathematically) starting from the "root" nodes and evaluating as in a Breadth First Search. Notice, that if the Directed Acyclic Graph is a linear connection of nodes, this becomes normal arithmetic in base 2. My question is, has there been any work done on such numbers?

-
I just need to know if I can take this to my professor without looking like an idiot. Any help would be greatly appreciated. I am a Computer Science grad student, and if no work has been done in this area, I am considering doing my thesis on this. –  user7263 Feb 19 '11 at 21:36
Thanks for clarifying the question somewhat. In yesterday's question you also wrote that you defined multiplication on these numbers -- how is that defined? –  joriki Feb 19 '11 at 21:37
That gets really complicated. For the subset of numbers that are isomorphic to the regular integers over addition, you can convert them to integers, multiply, and convert them back to these graph numbers. For those numbers that are not part of that subset, I have developed a process for specific types of graphs (square, cubic, etc..., and polyhedral, triangular, square, pentagonal, etc... and similar types of graphs), but again, I don't know how to describe it mathematically, because it requires "shifting" the graph. –  user7263 Feb 19 '11 at 21:44
@Fred: I neither gave nor few any conclusions; in fact, what I said is that you cannot make conclusions as to the usefulness of something based only on the fact that it is new. Your (undisclosed) definition of "useful" is at odds with the way the vast majority of the world uses that word, and I'll wager it is at odds with the way 100% of Computer Science people use the word. And since you say you are in Computer Science, and are thinking about this for a dissertation, then it is the CS-notion of "useful" that is at issue. (cont...) –  Arturo Magidin Feb 19 '11 at 22:52
@Fred: I'll wager that none of the many ways in which CS people use the word "useful" is as a synonym for "nobody has done it before", which is how you are proposing to use it. And numbers are considered useful not because of the many thing you can do that have no practical applications, but in spite of those, and because of all the ways that they do have practical applications. Just because the sky is blue doesn't mean that everything which is above your head is blue. –  Arturo Magidin Feb 19 '11 at 23:30

I had a nice, long answer written out that has been subsumed by all the comments above. Oh well.

The only part that isn't redundant is that for multiplication, you want to look at whether the set of endomorphisms of your DAG acts vertex transitively. Ideally, it would act simply vertex-transitively, because otherwise, you would have to include choices of endomorphisms explicitly in the structure. Anyway, that's the mathematical terminology for your "fractal structure".

-
I think I understand you. I have "shown" that for certain graphs, multiplication is transitive and vertex transitive on these graph numbers. It is also commutative, and distributive over addition. –  user7263 Feb 19 '11 at 22:19
Now, I am going to take (what some would consider) an enormous leap. I would say that these numbers (or, the lack thereof) are the reason why Fermat's Last Theorem and Fermat's Polygonal Number theorem are so difficult to solve. You can describe "cubic" or high powers with these numbers, but in a different form. You can also describe polygonal numbers. And Fermat was specifically investigating these types of numbers and claimed he had a proof for his (also considered Cauchy's) Polygonal Number Theorem. Now, I don't put much weight on this line of reasoning, but it does make some sense. –  user7263 Feb 19 '11 at 23:39
@Aubrey da Cunha: Can you point me toward the work that has been done for addition? Thanks. –  user7263 Feb 20 '11 at 0:03
I'm not sure exactly what work you mean. As far as I know, nobody has defined exactly this structure before. Under appropriate assumptions about the underlying graph, you shouldn't have any trouble showing that these things form a ring, but math is awash with examples of rings. Arturo's comment about the usefulness of these rings boils down to an explanation of why anyone should care about these rings. Maybe they have interesting computational properties? –  Aubrey da Cunha Feb 20 '11 at 7:08
@Fred I should add that I agree with Arturo's assessment: do show this to your professor and don't sweat the response too much. –  Aubrey da Cunha Feb 20 '11 at 7:11


text:
# A Linear Programming Model for Selecting Sparse High-Dimensional Multi-period Portfolios

European Journal of Operational Research, Volume 273, Issue 2, 1 March 2019, Pages 754-771

45 Pages Posted: 18 May 2015 Last revised: 16 Dec 2018

See all articles by Chi Seng Pun

## Chi Seng Pun

Nanyang Technological University (NTU) - School of Physical and Mathematical Sciences

## Hoi Ying Wong

The Chinese University of Hong Kong (CUHK) - Department of Statistics

Date Written: May 17, 2015

### Abstract

This paper studies the mean-variance (MV) portfolio problems under static and dynamic settings, particularly for the case that the number of assets ($p$) is larger than the number of observations ($n$). We prove that the classical plug-in estimation seriously distorts the optimal MV portfolio in the sense that the probability, that the plug-in portfolio will outperform the bank deposit, tends to 50\% for $p\gg n$ and a large $n$. We investigate a constrained $\ell_1$ minimization approach for directly estimating effective parameters appearing in the optimal portfolio solution. The proposed estimator is efficiently implemented with linear programming and the resulting portfolio is called the linear programming optimal (LPO) portfolio. We derive the consistency and the rate of convergence for the LPO portfolios. The LPO procedure essentially filters out unfavorable assets based on the MV criterion, resulting in a sparse portfolio. The advantages of the LPO portfolio include its computational superiority and its applicability for dynamic settings and non-Gaussian distributions of asset returns. Simulation studies validate the theory and illustrate its finite-sample properties. Empirical studies show that the LPO-based portfolios outperform the equally weighted portfolio, and the estimated optimal portfolios using shrinkage and other competitive estimators.

Keywords: Investment analysis; High-dimensional portfolio selection; Dynamic mean-variance portfolio; $\ell_1$ minimization; Sparse portfolio

JEL Classification: G11; C13; C16

Suggested Citation

Pun, Chi Seng and Wong, Hoi Ying, A Linear Programming Model for Selecting Sparse High-Dimensional Multi-period Portfolios (May 17, 2015). European Journal of Operational Research, Volume 273, Issue 2, 1 March 2019, Pages 754-771, Available at SSRN: https://ssrn.com/abstract=2607324 or http://dx.doi.org/10.2139/ssrn.2607324


text:
2-Approximation for the Min. $k$-Enclosing Geodesic Disc in a Simple Polygon
Anthony D'Angelo
Carleton University

I will present the algorithm I am currently working on that uses random sampling and a combination of polygon decomposition and $k$-levels to get a 2-approximation algorithm for the min enclosing geodesic disc of $k$ points in simple polygons. The polygon has $m$ vertices total, $r$ reflex vertices, and the set of points $S$ that our $k$ points is to be chosen from has size $n$. After $O(m+(n + r)\log(r))$ preprocessing, the runtime of the current approach is $O((n^{11/7}\log^2(n)+nr)\log(r))$.


text:
## Tesla launches line of Li-ion stationary storage systems for homes and businesses: POWERWALL and POWERPACK

##### 01 May 2015
 Multiple POWERWALL units may be combined. Click to enlarge.

As widely expected, Tesla CEO Elon Musk unveiled the company’s new product line: scalable stationary battery systems for homes, businesses and beyond. Available for immediate order on the Tesla Web site (teslaenergy.com or teslamotors.com/powerwall) is the modular wall-mounted POWERWALL system, which is targeted at homes and perhaps some small commercial applications, Musk said. Delivery is projected for sometime later this summer (3-4 months from now.)

The sleek, sculpture-like Li-ion packs come in 7 kWh ($3,000) and 10 kWh ($3,500) configurations. Both are guaranteed for 10 years (with an optional 10-year extension), and can be combined to up to 9 units—i.e., up to 90 kWh of storage. The packs contain all the integrated safety systems, the liquid thermal control and the DC/DC converter, and work with solar systems straight out of the box, Musk said.

 Tesla POWERWALL unit. Click to enlarge.

Round-trip DC efficiency is 92%, power output is 2 kW continuous, 3.3 kW peak. Voltage is 250-450 volts, with 5 amp nominal current, 8.5 amp peak output. The POWERWALL units are rated for indoor or outdoor installation, and operate in the range of -4°F to 110°F / -20°C to 43°C. The POWERWALL requires installation by a trained electrician; the AC-DC inverter is not included.

The 220 lb (100 kg) unit measures 52.1" x 33.9" x 7.1" (130 cm x 86 cm x 18 cm), and comes, noted Musk, in different colors.

The fact that it is wall-mounted is vital. You don’t need a battery room filled with nasty batteries. A normal household can mount these in the garage or outside the house.

—Elon Musk

The POWERWALL units will initially be assembled at the Fremont plant, Musk said, and the ramp will be slow. a plans to transition production to the GigaFactory in Nevada next year, resulting in a higher ramp.

For larger scale systems, Tesla is proposing the industrial POWERPACK, which, Musk said, is “designed to scale infinitely. This could be a GWh solution.” Musk said that a Tesla is already working with a utility that wants to do a 250 MWh pilot. (The entire evening livestream event was powered by POWERPACKs.)

At the conclusion of the streamed announcement, Musk said that solar panels and batteries represented “the only path I know” that could transition the world to sustainable energy. He suggested that 2 billion POWERPACKs could fully transition the world to a solar/battery future, and observed that it is “within the power of humanity to do so.

'power output is 2 kW continuous, 3.3 kW peak.'

So if your freezer is running, don't try to boil a kettle.

Prices do not include installation and the inverter.

Solar + storage is OK near the equator, but when you get further north, you get very short days in winter and more or less no usable sun for 2+ months of the year.

+ Even in sunny places you get monsoons etc when you get days of no sun.

I can see that you could get to an 80% solution (solar+storage) at a high but manageable price, but going to 100% would be extortionate.

Thus, you will need the grid or a generator.

The problem then is how do you pay for a grid that people are taking 75% less electricity from.

You will have to keep all the capacity for winter days and expect to pay for it during the summer when you don;t need the grid.

Else, as @DM pointed out, you might use the grid for spikes (Kettle, electric power shower) all year round and main power during the winter.

Setting the rules and costs for this will be a bundle of fun.

The 10kwh unit is only rated for once weekly cycling!
So it is good for 520 cycles, which if it were counted on a per kwh basis comes out to $1kwh if the inverter and installation are included. For the daily cycling 7kwh unit, assuming it is rated at usable capacity, then 10 years is 3,650 cycles. At 7kwh and with the capacity assumed to decrease to 80% over the period the average is 90%. So 3,650*7*0.9 = 22,995 kwh At$3,000 for the unit that is 13 cents/kwh just for the box to cycle the load, not counting the cost of the inverter, installation, or interest on the capital sum expended.

Anyone know what they are talking about with the 92% round trip efficiency since no inverter is included?

So now there's a Tesla you can afford to put in your garage.

As I mentioned in posts a few weeks ago, this is one of the few appliances you can buy that will actually earn a positive rate of return after depreciation. This appliance throws off cash if you live in a region where there is a decent spread between peak/off peak, or where you can't get net metering for solar.

Very exciting that this technology is going mainstream.

eci:

Who provides the 250v-450v inverter?

@Randy:
Apparently not all of them work, so if you already have an inverter for your solar array you may be out of luck.

There was an article here a few months ago about a company offering grid scale storage for about $160/kwh with life cycles up to 10,000. Sounds much better than what Tesla is offering, but what is truly amazing is that the Tesla announcement is covered on the websites of all of the major news outlets I look at. For a simple battery pack? Davemart, that is what I say too. My story concerns my older fridge that the local utility wanted me to replace. In their promotions, flyers with the bill and a feature in the local newspaper etc, I happened to notice that the model depicted was the exact same model that I had. Installed in May '96 and working perfectly ever since I should add. I was therefore motivated to phone the utility and see what their figures were for an 18cu-ft fridge consuming 683Kwh/yr - which I admit is not stellar performance in this class. Well, this otherwise know-it-all authority could not supply any financial proof of savings or ROI and said I should check with the metal recycler who's 1-800 number was in the promo as it is they who actually run the program. Spokesperson for the recycler said his responsibility was merely to get my address and pick up the fridge - which, incidently, must be in good working order??? Huh, the nerve. As for Mr Kettle back there. I use a 800W microwave to heat water for instant coffee, and a gas range for an actual kettle when I make tea. But that's just my english heritage. Regarding HVAC, I'm retired so it's safe to leave some windows open with bug screens in place most days. I will allow that there are days when humidity dictates employing the HVAC to dehumidify the house before things become unbearable. In California I think this may not be an option. A suggestion that Lead Acid batteries working out at$100/Kwh would be a cheaper solution met with disfavor by a friend who had served as a volunteer fireman. Apparently this type of backup solution has been known to have caused call-outs after someone was puttering about in the basement, while smoking and in the vicinity of cells which happened to be gassing at the time.

TESLA's competence in thermal management of lithium ion energy storage enables safe in-home installations that will hopefully promote changes in the HVAC industry. Why not DC current compressor feeds ? Then there's the problem of 110vac LEDs, why not change to 24Vdc lighting circuits at the breaker/fuse box? Going forwards for the power receptacles, what really needs to be operating on 110Vac that now requires upwards of 50 receptacles in the average house ?

2kw average power draw is ludicrously inadequate, and the 3 and a half hours it will last for just as bad.

My guess would be that when the average American fridge freezer comes on, it will use most of the power.

A decent kettle will use as much as the peak power.

If you want to do without electricity in an emergency, spend a couple of hundred on some camping equipment.

If you want to live with anything remotely resembling normality, buy a generator.

'Powerwall comes in 10 kWh weekly cycle and 7 kWh daily cycle models. Both are guaranteed for ten years and are sufficient to power most homes during peak evening hours. Multiple batteries can be installed together for homes with greater energy needs.'

http://bit.ly/1Pcgc82

Which is a flaming lie, unless most US homes don't have anything drawing more than 2kwh more than briefly.

BTW, since the weights are given as the same for both the 7kwh and 10kwh versions, they have clearly used the same cells in both, and have simply given 3kwh more slack to enable daily cycling.

Apparently air con units need over 3kw to run, and over 12kw to start them up.

That is one of the reasons why back up generators are 20-25kw, not the 10kw or so that are needed on average for a home.

This ludicrous bling is rated at 2kw.

Most American homes don't use air con then, according to the increasingly bizarre Musk those who connive at his stock pumping.

I agree that 2kW continuous and 3.3kW peak is rather low. I think these first-generation units will supplement grid power, not replace them. Its the Tesla Roadster of home battery packs (you buy one to have another car, not to replace your daily driver).

If your house is pulling 4kW, then you'll get 2kW from the grid and 2kW from the battery. If you want more then buy more and daisy chain them, but I doubt it'll be economical at anything less than grid-scale applications with industrial inverters that get 95%+ efficiencies.

Apparently air con units need over 3kw to run, and over 12kw to start them up.

Then I would respectfully say that if your air con pulls a 12Kw surge at start up, then it's time to replace it with more modern equipment which doesn't rely on motor control technology from the 1950's.

Davemart,
you bring up some great points. Would you please compare this Tesla pack to those home H2 units we're all waiting to buy for our HFCV? LOL
:)

DaveD:
No worries.
Here is one of the early installations in Europe:
http://enefield.eu/field-trials/installations/first-buderus-ene-field-fuel-cell-system-successfully-tested-in-single-family-home/

Only 700watts, but this is designed to cover hot water too, and so the combined heat and power must be considered.

Burning NG with way more efficiency than the grid can do as that throws away the heat means that it is far more of a total solution which also combines well with solar panels, although obviously it is less mature than batteries.

Hi T2:
I simply used the figures someone else did without adverse comment or correction on another blog.
Since I do not live in the US I have found it difficult on other occasions to work out what typical US spec equipment is.

Two questions:
Are the differences you suggest enough to make a very material change to the requirements suggested?
That back up generators have often been uprated in the latest models from 20kw to 25kw suggests not, in relation to a source which can only provide 2kw continuous.

What specs would you suggest are appropriate to a reasonably modern although perhaps not state of the art air con installation?

Here in the UK heating systems are very different, and air con in the home very rare, although I happen to have it in an air source heat pump, which though runs on different principles.

10 kWh (\$3,500)
..good price

Davemart,

Oh come on! You're doing it again. You're picking apart every little detail and say that this would never be sufficient to supply a home with 2kW with 3.3kW peak...yada yada yada. Then turn around and tell us about a .7kW H2 generator? LOL

You think that half the homes in the US don't use gas to heat their water and/or their home heating? LOL

You question the 92% efficiency and then ignore that you lose efficiency in converting the NG to H2 and then lose another 50% efficiency on the fuel cell itself?

If you're going to keep claiming your open to "multiple alternate technologies" then you've got to stop being so blatantly hard on batteries/EVs while picking them apart at ever opportunity and then not only giving a pass to fuel cells...but making excuses for their every shortcoming.

You bring up very valid points...but do it fairly on BOTH sides.

:)

DaveD:
They are very different ball games, as a battery will do nothing at all for much of household energy consumption, which is NG.

So overall fuel savings are much greater from using even a very modest fuel cell, which is not intended to provide stand alone back up, only contribute to electricity production.

The electricity production is a freebie from producing the hot water.

Fuel cells are undoubtedly at an earlier stage of development than batteries, so this is a trial, as opposed to the full scale deployment that Tesla proposes for its batteries.

I have not got anything at all against battery back up, but it should do what it says on the tin, and this doesn't.

A home version of this however would:
http://www.greencarcongress.com/2015/04/20150421-toshiba.html

The lithium titanate technology is tough as boots, and a 10kwh unit would produce an ample 20kw.

Cost is the thing, but if you are using a less capable chemistry the unit that Tesla is offering is impractically underpowered.

30kwh and 10kw continuous would offer something, whereas this offers very little.

Here is a link to Musk's presentation of the Tesla power systems. One commentator called it the best tech keynote presentation by any CEO ever in history even better than Steve Jobs presentations of the iPhones. I agree. It is really good. Musk have you convinced that Tesla has a product you can order now that you can afford and that can make a real difference for a better future for all of us. Now homeowners in the Northern hemisphere will have an option to become pollution free during summer and spring using Tesla Powerwalls, solar cells, a geothermal heat pump and battery electric cars.

http://www.theverge.com/2015/5/1/8527543/elon-musk-tesla-battery-feels

I noted that musk during the presentation said Tesla was in talk with a utility to deliver a 250MW backup system based on the Powerpack! So it is truly scalable. Also good to see that Tesla can deliver 10kwh for only 3500 USD at the pack level. That is the lowest price 350 USD per kWh I have ever seen for such a battery backup system. The powerwall weights 100 kg so 100wh/kg which is not much. For that reason and also because the cycle life of the Model S batteries is not high enough to support a 10 year warranty on a battery that will see daily deep cycles for ten years I am convinced Tesla uses another battery cell for those Powerwalls and Powerpacks than they for the Model S. May still be a 18650 cell though.

Also nice that up to nine Powerwalls can be connected giving the owner of a large house a 90kWh storage with 18kW of continuous power and 30kW of peak power. That should cover the needs of 98% of all house owners (including Davemart who need 4 Powerwalls) and for those 2% with more need than 9 Powerwalls Tesla's Powerpacks will be applicable. There are already several million homeowners globally with solar roof power and many more millions are coming on line in the future so Tesla's power systems will have a very large market especially since Tesla's systems are the most affordable and practical that currently is on the market.

I think people have this the wrong way round.
This is not designed to take you off grid, it is to enable you to spread your Solar energy across the whole day and reduce, but not eliminate, the amount of power you take from the grid.

Thus, if you have a 5kw solar and one or two of these, you will need very little power during summer, spring and autumn,excepting peaks (power shower, kettle+freezer etc.)

During winter, you could use it to shift low rate night power to day time use, while taking 90% of your power from the grid.

Thus, they are NOT a solution for going off grid, they ARE a solution for reducing the amount of power you take from the grid.

Someone commented that apparently the SGIP money goes to the customer in California, not the provider.

If that is the case, and the perks are not grabbed in fancy lease terms in Solar City installations, then clearly nearly free is good.

I don't like wall mounted for 100kg units, nor do I think it is a great idea to have several too small modules, so I would prefer a 14kwh unit capable of daily cycling, with output a more practical 4kw continuous, floor standing as the base model.

If the tax system means that other tax payers are effectively paying for your system, then even this is good though.

The comments to this entry are closed.


text:
Power in Circuits Video Lessons

Concept

# Problem: In this problem you will derive two different formulas for the power delivered to a resistor.What is the power P supplied to a resistor whose resistance is R when it is known that it has a voltage ?V across it?

###### FREE Expert Solution

Power supplied to a resistor:

From Ohm's law, the current through a resistor is:

$\overline{){\mathbf{i}}{\mathbf{=}}\frac{\mathbf{V}}{\mathbf{R}}}$

The power supplied to a resistor is expressed as:

P = Vi

79% (137 ratings)
###### Problem Details

In this problem you will derive two different formulas for the power delivered to a resistor.

What is the power P supplied to a resistor whose resistance is R when it is known that it has a voltage ?V across it?


text:
# Math Help - Partial fractions

1. ## Partial fractions

1. a) Express (x+3)/x²(x-1) in terms of partial fractions

b) Find ∫(x+3)/x²(x-1)dx

Not sure if i need to expand the denominator in a?

really have no idea how to do b!

2. Originally Posted by djmccabie
1. a) Express (x+3)/x²(x-1) in terms of partial fractions

b) Find ∫(x+3)/x²(x-1)dx

Not sure if i need to expand the denominator in a?

really have no idea how to do b!
$\frac{x+3}{x^2(x-1)}$

$= \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x-1}$

3. Originally Posted by djmccabie
1. a) Express (x+3)/x²(x-1) in terms of partial fractions

b) Find ∫(x+3)/x²(x-1)dx

Not sure if i need to expand the denominator in a?

really have no idea how to do b! that's why you do (a) first
$
\frac{x+3}{x^2(x-1)} = \frac{A}{x} + \frac{B}{x^2} + \frac{C}{x-1}
$

$x+3 = Ax(x-1) + B(x-1) + Cx^2$

let $x = 1$ ... $C = 4$

let $x = 0$ ... $B = -3$

let $x = 2$ ... $A = -4$

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

4. hi just a question. When you let x=2, what happens to B and C ?

5. Replace them with the values you already had: B= -3, C= 4.


text:
# How do you simplify sqrt(5/4 )+ sqrt(10/8)?

Sep 2, 2016

$\sqrt{5}$

#### Explanation:

Split the root so there is a separate numerator and denominator.

$\frac{\sqrt{5}}{\sqrt{4}} + \frac{\sqrt{10}}{\sqrt{4 \times 2}}$

=$\frac{\sqrt{5}}{2} + \frac{\sqrt{10}}{2 \sqrt{2}} \text{ find LCD}$

=$\frac{\textcolor{red}{\sqrt{2} \times \sqrt{5}} + \sqrt{10}}{2 \sqrt{2}}$

=$\frac{\textcolor{red}{\sqrt{10}} + \sqrt{10}}{2 \sqrt{2}}$

=$\frac{\cancel{2} \sqrt{10}}{\cancel{2} \sqrt{2}}$

=$\frac{\sqrt{2} \times \sqrt{5}}{\sqrt{2}}$

=$\sqrt{5}$

Nice!!


text:
# A new mechanism for atomization and the primary instability in liquid-gas mixing layers

* Corresponding author
Abstract : We investigate numerically and experimentally the appearance of instabilities in two planar coflowing liquids sheets. As a function of the momentum ratio $M= \rho_G U_G^2/\rho_L U_L^2$, two different regimes are distinguished. At low momentum ratios the frequency of the waves appearing in the primary atomization region is influenced by the liquid velocity, whereas another asymptotic regime is obtained for large momentum ratios. In this regime, the gas velocity and the ratio between the gas boundary layer and the thickness of the separator plate influence the observed frequency. The low $M$, liquid-dominated regime appears to be a noise amplifier, while the gas-dominated, large $M$ regime displays the characteristics of a global mode. Current computational results are in agreement with experimental observations. These results are compared to the predictions of linearized stability theory. We discuss both the inviscid linearized stability theory and the viscous, Orr-Sommerfeld stability theory, and conjecture that the viscous stability theory is valid in the low $M$ regime.
Document type :
Conference papers
Domain :
Complete list of metadata

https://hal.archives-ouvertes.fr/hal-00710286
Contributor : Alain Cartellier Connect in order to contact the contributor
Submitted on : Wednesday, June 20, 2012 - 3:16:04 PM
Last modification on : Tuesday, November 16, 2021 - 5:04:44 AM

### Identifiers

• HAL Id : hal-00710286, version 1

### Citation

Stéphane Zaleski, Alain H. Cartellier, Daniel Fuster, Jérôme Hoepffner, Jean-Philippe Matas. A new mechanism for atomization and the primary instability in liquid-gas mixing layers. 64th Annual Meeting of the APS Division of Fluid Dynamics, Nov 2011, Baltimore, United States. http://meetings.aps.org/link/BAPS.2011.DFD.M16.10. ⟨hal-00710286⟩

Record views


text:
# What does it mean to take the "average" of two decision trees by 'voting'

I have heard, in relation to random forest algorithm, that the algorithm will fit many decision trees and take the average of them by votes. (This is related to bagging as well)

I understand what the average means for something example such as $$\vec{x}=[1,2,3], \; \bar{x} =2$$. But I don't know what it would mean if I had two decision trees.

Could anyone please provide a simple example / explanation of this averaging process for a couple of decision trees?

I think that you are mixing together two different things - random forests for regression and for classification. Regression means to predict a continuous value (number). Random forest can construct multiple regression trees, each of which makes a prediction about the number. In that case, it is simple to understand. The numerical predictions are averaged to give a robust prediction of the true number value.

However, I think that you are asking about classification - predicting a nominal value (also called categorical or factor). In this case, each decision tree predicts a category. Usually, it does not make sense to talk about averaging categories. Instead, the multiple decision trees "vote" - that is one counts how many times each category was predicted and takes the category that received the most votes as the prediction. There is no averaging, only counting.

Here is a simple example.

## Data

V1   V2    V3    Class
A     C     E      X
A     C     F      X
B     C     F      Y
B     D     F      Y
B     D     E      X

Decision Tree 1 uses only feature V1:
If V1 = A, predict X, otherwise predict Y

Decision Tree 2 uses only feature V2:
If V2 = C, predict X, otherwise predict Y

Decision Tree 3 uses only feature V3:
If V3 = E, predict X, otherwise predict Y

Now we want to predict the class of a new point (A, C, F):
- Decision Tree 1 sees V1 = A and predicts Class=X
- Decision Tree 2 sees V2 = C and predicts Class=X
- Decision Tree 3 sees V3 = F and predicts Class=Y
There were two votes for X and one vote for Y, so the forest predicts X, the class that received the majority of the votes.


text:
MathSciNet bibliographic data MR1355713 (97d:11080) 11F70 (11L05 22E50) Friedberg, Solomon; Jacquet, Hervé The fundamental lemma for the Shalika subgroup of ${\rm GL}(4)$${\rm GL}(4)$. Mem. Amer. Math. Soc. 124 (1996), no. 594, x+149 pp. Article

For users without a MathSciNet license , Relay Station allows linking from MR numbers in online mathematical literature directly to electronic journals and original articles. Subscribers receive the added value of full MathSciNet reviews.


text:
# Remarks on the spectrum of the Dirac operator of pseudo-Riemannian spin manifolds

Research paper by Momsen Reincke

Indexed on: 20 Jan '16Published on: 20 Jan '16Published in: Mathematics - Differential Geometry

#### Abstract

We study the spectrum of the Dirac operator $D$ on pseudo-Riemannian spin manifolds of signature $(p,q)$, considered as an unbounded operator in the Hilbert space $L^2_\xi(S)$. The definition of $L^2_\xi(S)$ involves the choice of a $p$-dimensional time-like subbundle $\xi\subset TM$. We establish a sufficient criterion for the spectra of $D$ induced by two maximal time-like subbundles $\xi_1,\xi_2\subset TM$ to be equal. If the base manifold $M$ is compact, the spectrum does not depend on $\xi$ at all. We then proceed by explicitely computing the full spectrum of $D$ for $\mathbb R^{p,q}$, the flat torus $\mathbb T^{p,q}$ and products of the form $\mathbb T^{1,1}\times F$ with $F$ being an arbitrary compact, even-dimensional Riemannian spin manifold.


text:
location:  Publications → journals
Search results

Search: All MSC categories starting with 58F11

 Expand all        Collapse all Results 1 - 2 of 2

1. CMB 2006 (vol 49 pp. 337)

Berlanga, R.
 Homotopy Equivalence and Groups of Measure-Preserving Homeomorphisms It is shown that the group of compactly supported, measure-preserving homeomorphisms of a connected, second countable manifold is locally contractible in the direct limit topology. Furthermore, this group is weakly homotopically equivalent to the more general group of compactly supported homeomorphisms. Categories:57S05, 58F11

2. CMB 2002 (vol 45 pp. 97)

Haas, Andrew
 Invariant Measures and Natural Extensions We study ergodic properties of a family of interval maps that are given as the fractional parts of certain real M\"obius transformations. Included are the maps that are exactly $n$-to-$1$, the classical Gauss map and the Renyi or backward continued fraction map. A new approach is presented for deriving explicit realizations of natural automorphic extensions and their invariant measures. Keywords:Continued fractions, interval maps, invariant measuresCategories:11J70, 58F11, 58F03
 top of page | contact us | privacy | site map |


text:
# patches

1. ### A cloak covered with patches

Hi. Could you help me solve this problem. I've tried using inclusion–exclusion principle but it didn't work. There is a cloak which area equals 1. It is completely covered with 5 patches, whose area is at least 0,5. Show that the area of the intersection of certain two patces is at least 0,2...
2. ### How to connect cubic bezier surface patches continuous upto the 2nd derivative

Hi, Imagine that I have got 16 nodes in a 3D space, each node with its (x,y,z) coordinates. The nodes are ordered in a grid and numbered (i,j) in accordance with their position, so i\in[1,4] and j\in[1,4]. I also know that the nodes are part of a curved surface (a topological square) and that...
3. ### coordinate patches?

The hyperboloid is given by H=\{(x,y,z) \vert x^2 + y^2 - z^2 =1\}. Find coordinate patches that cover all of H, using the parametrization \textbf{H}(s,t)=(\cos s \, \sec t ,\, \sin s \, \sec t ,\, \tan t). First thing--we haven't covered "coordinate patch" in lecture, and the phrase does not...


text:
# Highlight important and diagnostic features as efficiently as possible#

Given human nature, even the best QC reports won’t be consistently used if they are too long, ugly, or annoying. It is often more effective to quickly create short, aesthetically pleasing QC files which emphasize easy-to-check diagnostic features. If these summary files suggest something may be amiss, it can be investigated in detail; trying to fit all possibly-useful images and statistics into one document is often counterproductive.

For checking the preprocessing of human fMRI data, we have found that it works well to plot temporal mean images (without masking) and confirm that the volumes look like brains. This is especially valuable if all of the participants’ runs are plotted side-by-side, like below (10 runs can fit on a single page, e.g., pages 12-14 of 132017_fMRI_movementSummary_fmriprep.pdf), enabling many runs to be examined at a glance, and differences between the runs to be spotted.

Surface images are more difficult to check for preprocessing errors, because a correctly-made gifti file can always be displayed as a brain. But it’s still worth looking at the surface images as large preprocessing or other problems can be spotted; one feature is that the tiger stripes along the top of the hemispheres due to the central sulcus (arrows) are plainly visible. The lower image shows how a acquisition mishap can appear on the surface; this sort or other non-anatomical patterns (like polka dots) should be investigated. Pages 15-17 of 132017_fMRI_movementSummary_fmriprep.pdf show an array of surface temporal mean images.

## Visual displays can help with more than image quality#

These previous examples are of visual displays for checking MR image quality, but plots can be used to efficiently examine other things, too, such as task performance. This plot shows what a participant did during the DMCC Sternberg task. Time is along the x-axis, and each grey-ish plotting symbol indicates a trial onset (NN, NP, RN, 5:8 refer to trial types). The pink and red lines show the time and identity of each button press, with the black tick marks indicating if the response was correct. With a bit of practice a lot of task and performance information can be quickly seen in these types of plots, including trial jitter, randomization, and unexpected participant response patterns. For example, this participant gave the incorrect response for several trials in each run and block, but got the great majority correct, suggesting that they were attending to the task and trying to do it properly.

By contrast, this participant responded to a few trials, sometimes correctly, but mostly did not respond at all. The RAs noted that the person was sleepy; we don’t want to include this person’s data in the analyses. It is important to be able to check for this (and other) strange response patterns. For example, if an analysis calculated performance as the percent of trials with a correct response out of the trials with a response, this person’s performance will seem quite good (most trials with a response are correct); the high proportion of trials without a response needs to be considered as well.

## Example: anatomical volume (nifti) image plotting#

Efficiently displaying QC images depends upon being able to easily access and plot the source files. This tutorial shows some basic image reading and plotting, the key foundation upon which more complex files (see links at the end of this page) are built.

library(RNifti);  # package for NIfTI image reading; https://github.com/jonclayden/RNifti

# S1200_AverageT1w_81x96x81.nii.gz (https://osf.io/6hdxv/) is a resampled (via afni 3dresample)
# version of S1200_AverageT1w_restore.nii.gz, the HCP 1200 Group Average anatomy,
# available from https://balsa.wustl.edu/file/show/7qX8N.
img <- readNifti("example2files/S1200_AverageT1w_81x96x81.nii.gz");

# the image values are in a 3d array (since this is a single anatomical image, not a timeseries)
print(dim(img));   # [1] 81 96 81

[1] 81 96 81

Now that the image is read in, many of the normal R commands and operations can be used with it, such as getting the value of individual voxels.

print(max(img));  # [1] 1374.128
print(img[30,20,50]);  # value of the voxel at 30,20,50

[1] 1374.128

[1] 370.3334

Slices through the image can be plotted with the same functions as any other image.

options(repr.plot.width=8, repr.plot.height=2.5);  # specify size in jupyter
layout(matrix(1:3, c(1,3)));  # have three images in one row
par(mar=c(0.1, 0.1, 0.1, 0.1));   # specify plot margins

image(img[15,,], col=gray(0:64/64), xlab="", ylab="", axes=FALSE, useRaster=TRUE);   # plot slice i=15
image(img[,20,], col=gray(0:64/64), xlab="", ylab="", axes=FALSE, useRaster=TRUE);   # plot slice j=20
image(img[,,50], col=gray(0:64/64), xlab="", ylab="", axes=FALSE, useRaster=TRUE);   # plot slice k=50

## Example: functional volume (nifti) image plotting#

Functional nifti images are read in with the same command, but as a 4d matrix: the three dimensions plus time. This next bit of code reads a functional run from the first DMCC55B participant, downloaded from https://openneuro.org/datasets/ds003465/versions/1.0.5, then edited to only have the first eight frames (so the file wouldn’t be too large).

# load a (small) functional run from the first DMCC55B participant
in.img <- readNifti("example2files/sub-f1027ao_ses-wave1bas_task-Stroop_acq-mb4AP_run-1_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz");

print(dim(in.img));  # [1]  81  96  81 8

[1] 81 96 81  8

We can plot the same slice at different times (frames), and calculate statistics from individual frames or across time. The frames look quite similar plotted this way, but there are differences, as reflected in the maximum voxel value on each image and the voxel timecourse below. Can you change the code to print a statistic on the first frame as well? Show different slices and TRs? The values of a different voxel?

options(repr.plot.width=8, repr.plot.height=2);  # specify size in jupyter
layout(matrix(1:4, c(1,4)));  # have four images in one row
par(mar=c(0.1, 0.1, 0.1, 0.1));   # specify plot margins

do.k <- 50;  # which k slice to plot
# so all frames will be plotted with the same color scaling, specify before plotting
z.lim <- c(min(in.img[,,do.k,]), max(in.img[,,do.k,]));  # range calculated across all TRs

# plot one frame
image(in.img[,,do.k,1], col=gray(0:64/64), zlim=z.lim, xlab="", ylab="", axes=FALSE, useRaster=TRUE);
text(x=0.2, y=0.95, labels="frame 1", col='green');  # add a label

# plot with a loop
show.frames <- c(3, 5, 7);  # which (and how many) frames to plot
for (i in 1:length(show.frames)) {   # i <- 1;
image(in.img[,,do.k,show.frames[i]], col=gray(0:64/64), zlim=z.lim, xlab="", ylab="", axes=FALSE, useRaster=TRUE);
text(x=0.15, y=0.95, labels=paste("frame", show.frames[i]), col='white');  # add a label
text(x=0.25, y=0.05, labels=paste0("max=", round(max(in.img[,,do.k,show.frames[i]]),2)), col='white');  # add a statistic
}

print(in.img[20,30,23,]);   # the value of this voxel in all frames

[1] 2933.060 2886.645 2766.290 2902.567 2746.861 2924.964 2581.170 2975.967


text:
# Ranges and the Fundamental Theorem of Calculus 1

I'm going over a chapter by chapter review for my calculus final and discovered this problem:

$$y=\int_{\sqrt{x}}^{x^3}\sqrt{t}\sin{t}\;\mathrm dt$$

They split it up so that it became:

$$-\int_1^{\sqrt{x}}\sqrt{t}\sin{t}\;\mathrm dt + \int_1^{x^3}\sqrt{t}\sin{t}\;\mathrm dt$$

Why 1? How was that determined?

-
Does the problem want you to take the derivative? The idea is that you need an actual real number as the lower limit to apply the FTC. Other than that, 1 was completely random. Put any other positive number there and try taking the derivative. You'll find that you get the same answer. –  Matt Dec 4 '10 at 22:58
The use of 1 here is only for reasons of convenience, I think; note that in your first expression, if $x$ is 1, then $y$ is zero. –  Guess who it is. Dec 5 '10 at 2:21

It doesn't have to be $1$; all it needs to be is in the domain of the function.

What is going on is that you have the Fundamental Theorem of Calculus, which tells you that if $f(x)$ is continuous on an interval containing $a$, then the function $F(x)$ defined on that interval by: $$F(x) = \int_a^x f(t)\,dt$$ is differentiable, and in fact $F'(x) = f(x)$ for all $x$ in the interval. But this requires (i) the lower limit to be constant; and (ii) the upper limit to be the variable with respect to which you are taking the derivative.

So the first question is: what does one do if you have the variable in the lower limit instead of the upper limit? Well, that only requires you to use the property of the integral that says $$\int_a^b f(t)\,dt = -\int_b^a f(t)\,dt,$$ and the fact that $(-G(x))' = -G'(x)$ for any $G$. So if $$F_2(x) = \int_x^a f(t)\,dt$$ then $$F_2'(x) = \frac{d}{dx}\int_x^a f(t)\,dt = \frac{d}{dx}\left(-\int_a^x f(t)\,dt\right) = -\frac{d}{dx}\int_a^x f(t)\,dt = -f(x),$$ with the last equality holding by the FTC.

Next, what if the upper limit is not $x$, but a function of $x$, say $$F_3(x) = \int_a^{g(x)} f(t)\,dt\ ?$$ Then we use the Chain Rule: $$\frac{dF_3}{dx} = \frac{dF_3}{dg}\frac{dg}{dx} = \left(\frac{d}{dg}\int_a^{g(x)}f(t)\,dt\right)\frac{dg}{dx} = f(g(x))g'(x),$$ with the last equality again by the FTC.

What if the lower limit is the function and the upper limit the constant? We combine the two "tricks" above to get the derivative.

And finally, what if both upper and lower limit are functions? Then we use the property of the integrals mentioned by Huy: $$\int_a^b f(t)\,dt = \int_a^cf(t)\,dt + \int_c^b f(t)\,dt$$ for any $c$ such that $f(x)$ is defined and continuous on an interval containing $a$, $c$, and $b$. In the case at hand, they pick $1$ simply because it's an easy point; you can use any point on $[0,\infty)$ (cannot be a negative point because you have $\sqrt{t}$ in the integrand). Pick your favorite $a$ on $[0,\infty)$, and you have $$F(X) = \int_{\sqrt{x}}^{x^2}f(t)\,dt = \int_{\sqrt{x}}^a f(t)\,dt + \int_a^{x^2}f(t)\,dt = -\int_a^{\sqrt{x}}f(t)\,dt + \int_a^{x^2}f(t)\,dt$$ and each of the integrals on the right is an integral we know how to do using the FTC. So if we let the first integral be some $G(X)$ and the second be $H(X)$, then $F(X)=G(X)+H(X)$, so $F'(X) = G'(X)+H'(X)$, and we can find $G'(X)$ and $H'(X)$ using the methods outlined above.

They did it with $a=1$, but you could do it with $a=\pi$, or $a=4$, or any nonnegative $a$.

-
Thanks Arturo! That was very thorough and informative. –  ShrimpCrackers Dec 5 '10 at 2:44

You can take any lower limit, it doesn't need to be 1.

$\int_b^c f(x) dx = \int_a^c f(x) dx - \int_a^b f(x) dx$

Just think of it as the area under the curve.

-


text:
# Product of two matrices sharing the same eigenvector

I have never learned how to prove things, so I don't know how or when a proof is finished. If you prove this, it may help me understand a bit how things are done:

The vector $e$ is an eigenvector of each of the $n\times n$ matrices $A$ and $B$, with the corresponding eigenvalues $\lambda$ and $\mu$, respectively. Prove that $e$ is an eigenvector of the matrix $AB$ with the eigenvalue $\lambda\mu$.

What you know is $Ae=\lambda e$ and $Be=\mu e$. This is what your are allowed to use.
Can you compute $ABe$ now just using the above?
• Is it: $ABe = (A(Be) = A(µe) = (Ae)µ = µλe$ ? – George May 28 '14 at 11:36
• Yes, this is right. Does this prove that $e$ is an eigenvector of $AB$? – daw May 28 '14 at 11:39
• Yes because $ABe = µλe$. Thanks guys by the way, for helping me solve. – George May 28 '14 at 11:43


text:
# Closed form for Chu–Vandermonde identity-like summations

I have been trying to analyze a randomized algorithm I cooked up and have found the need to compute some moments of a random variable modeling an aspect of the algorithm but I am unsure if there is a nice closed form. Suppose the random variable in question is $$X$$ and it can take a value $$i \in \lbrace 0, 1, \cdots, k \rbrace$$ with probability $$\text{Pr}\lbrace X = i \rbrace = \binom{n}{k}^{-1}\binom{M}{i}\binom{n-M}{k-i}$$ where $$n \geq M \geq 1$$ and $$n \geq k \geq 1$$. Note that I assume that $$\binom{a}{b} = 0$$ if $$a < b$$ since there are $$0$$ ways to choose size $$b$$ sets out of a size $$a$$ set when this inequality holds. It is clear by the Chu-Vandermonde identity that indeed these values are probabilities because $$\sum_{i=0}^{k} \text{Pr}\lbrace X = i \rbrace = \binom{n}{k}^{-1} \sum_{i=0}^k \binom{M}{i}\binom{n-M}{k-i} = 1$$ The first moment of $$X$$, namely its expectation, can be computed analytically as \begin{align} \mathbb{E}(X) &= \sum_{i=0}^k i \text{Pr}\lbrace X = i \rbrace \\ &= \binom{n}{k}^{-1} \sum_{i=1}^k i \binom{M}{i}\binom{n-M}{k-i} \\ &= M \binom{n}{k}^{-1} \sum_{i=1}^k \binom{M-1}{i-1}\binom{(n-1)-(M-1)}{(k-1)-(i-1)} \\ &= M \binom{n}{k}^{-1} \binom{n-1}{k-1} \\ &= \frac{Mk}{n} \end{align}

I also need to compute $$\mathbb{E}(X^2)$$ so I can do a variance calculation but I am not sure how to go about it. One can find a loose upper bound of $$Mk^2/n$$ but at least empirically, it seems for the valid ranges of $$k$$, the upper bound can at least be made to be $$Mk^{3/2}/n$$. If I could find an exact expression to this moment, I would feel a lot better of where I might be able to go with this algorithm.

So does anyone recognize this probability distribution and have insight into the desired moment I want to compute?


text:
# [OzTeX] Problem with DVIPS and the production of HyperPostscript output

Andrew Trevorrow andrew at trevorrow.com
Sun Feb 13 03:04:29 CET 2005

```> I've got a 152-page document being processed by OzTeX 5.1 and using the hyperref package (i.e., \usepackage{hyperref}).  My dvi file looks great - all the links that are supposed to be active *are* active: table of contents/figures/tables, footnote numbers, section/page references, bibliographic citations, and all of my \href commands.  If I call DVIPS *without* the -z option and send the resulting Postscript file through Distiller, I get a 152-page PDF document - without any active links, as expected.  BUT, when I *do* provide the -z option (to produce HyperPostscript) and again run it through Distiller, I get a PDF file that contains only the last 6 pages of my original document - but the links *are* active!
>
> The cause of the problem is clearly the Postscript file, since in the first case (without the -z option), the Postscript file is 87Mb, while in the second case, it's only 2.3Mb.  The curious thing about the processing by DVIPS is that it is (seemingly) identical in both cases (i.e., with and without the -z option).  It generates the same "[1] [2] [3<Figures/fig1.eps>] [4<Figures/fig2.eps>] ... [151] [152]" output each time and takes the same amount of processing time.  In looking at the two different Postscript files, I notice that the big one that includes all 152 pages has "DVIPSSectionPage" commands for each page, while the small, 6-page one has only six "DVIPSSectionPage" commands, corresponding to the last 6 pages in the document.
>
> So, my question is, why would the -z option to DVIPS be leaving out the first 146 pages of my document when producing HyperPostscript output?

It looks like the -z option doesn't work correctly if dvips has partitioned
the .ps output into a number of sections (the appearance of DVIPSSectionPage
indicates this is the case).  The output will be in sections if you used
the -S option, or if dvips thinks the output is too complicated and will
exceed your printer's available memory.  The latter is of course pointless
if you are converting the .ps to .pdf so I've decided to rebuild dvips with
a much larger constant that should avoid your output being sectioned.
It should also avoid dvips error messages like "Page n may be too complex
to print" that can occur if you include large/complicated eps files.


text:
Roliver is three times as old as Cerise. Three years ago, the sum of their ages was sixty-six. Find their present age?

Feb 25, 2018

Cerise is currently 18 and Roliver is 54.

Explanation:

Let Cerise's current age be $x$,
If Roliver is currently three times her age, his current age is thus $3 x$.

So 3 years ago, Cerise must have been $x - 3$ years old and Roliver must have been $3 x - 3$ years old.

Since we know that the sum of their ages 3 years ago was 66, we can form an equation:

$\left(3 x - 3\right) + \left(x - 3\right) = 66$

$4 x = 72$

$x = 18$

Hence, Cerise's age is $18$ and Roliver's is $3 \left(18\right) = 54$.

Feb 25, 2018

Cerise's current age is 12
Roliver's current age is 36

Explanation:

Let Roliver's current age be $r$
Let Cerise's current age be $c$

Breaking the question down into its component parts

Roliver is ............................ r=?
tree timeas as old as Cerise $\ldots r = 3 c$
Three years ago $\ldots \ldots \ldots \ldots \ldots \ldots . r - 3 = 3 c - 3 \text{ } . . E q u a t i o n \left(1\right)$

The sum of their ages was..(r-3)+(3c-3)=?
sixty six $\ldots \ldots \ldots \ldots \ldots \ldots . \left(r - 3\right) + \left(3 c - 3\right) = 66 \text{ } . . E q u a t i o n \left(2\right)$

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider $E q n \left(1\right)$

$\textcolor{g r e e n}{r = 3 c \ldots E q u a t i o n \left({1}_{a}\right)}$

Consider $E q n \left(2\right)$ and write as:

$\textcolor{g r e e n}{r + 3 c - 6 = 66}$

color(green)(r+3c=72...Equation(2_a)

Using $E q n \left({1}_{a}\right)$ substitute for $r$ in $E q n \left({2}_{a}\right)$

color(green)(color(red)(r)+3c=72color(white)("ddd") ->color(white)("ddd") color(red)(3c)+3c=72

color(green)(color(white)("dddddddddddd")->color(white)("ddd")6c=72

Divide both sides by 6

color(green)(color(white)("ddddddd")->color(white)("d")bar(ul(|color(white)(./.) c=72/6=12color(white)(./.)|))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Substitute for $c$ in $E q n \left({1}_{a}\right)$

$\textcolor{g r e e n}{r = 3 \textcolor{red}{c} \textcolor{w h i t e}{\text{ddd") ->color(white)("ddd}} r = 3 \times \textcolor{red}{\frac{72}{6}} = 36}$

$\textcolor{w h i t e}{\text{ddddddddddddd}} \textcolor{g r e e n}{\overline{\underline{| \textcolor{w h i t e}{\frac{.}{.}} r = 36 \textcolor{w h i t e}{\frac{.}{.}} |}}}$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

check

$E q n \left(1\right)$

$r - 3 = 3 c - 3 \textcolor{w h i t e}{\text{dddd") ->color(white)("dddd}} 36 - 3 = 3 \left(12\right) - 3$

$E q n \left(2\right)$

$\left(r - 3\right) + \left(3 c - 3\right) = 66 \textcolor{w h i t e}{\text{ddd")->color(white)("ddd}} 36 - 3 + 3 \left(12\right) - 3 = 66$


text:
# implicit differentiation, formula of a tangent line

I need to understand "implicit differentiation" and after that I need to be able to explain it to a student.

Here is an example:

Find the formula of a tangent line to the following curve at the given point using implicit differentiation.

x+xy+y^2=7 at a point (1,2)

What is the best way of explaining that?

Thank you.

• Can you tell us what you're thinking so far? Sep 26 at 19:15
• I suggest asking this question on math.stackexchange. I would be happy to answer there. Sep 26 at 20:32
• Something I used to do, and I even discussed it briefly in a talk at the 2007 MathFest (see p. 65 here), is for short classroom quizzes I would include two graphs (using this software), one zoomed in a bit so students could estimate the slope as a safety check for their answers and the other zoomed out enough to give a sense of what the full graph looks like. Sep 26 at 20:33
• When I teach implicit differentiation, I like to have students work through examples where the graph is given (as Dave suggests for quizzes). Sep 26 at 23:44

Without being rigourous, the equation $$F(x,y)=0$$ defines a relation between $$y$$ and $$x$$. To promote this relation to a function, some restrictions in the $$(x,y)$$-plane has to be imposed. Assuming that such conditions exists, you can say that the equation $$F(x,y)=0$$ is defining $$y$$ implicitly as a function of $$x$$.

In some cases, we will be able to manipulate the equation $$F(x,y)=0$$ to find an explicit representation of the desired function, by solving the expression for $$y$$. In other cases, it won't be able to solve, but in both cases the derivate $$y' = \dfrac{dy}{dx}$$ should exists as a function.

A simple example:

$$y^3 - x = 0$$ defines $$y$$ implicitly as a function of $$x$$. But in this case, we can solve the expression for $$y$$, which leads to $$y= \sqrt[3]{x}$$, and then, $$\dfrac{dy}{dx} = \dfrac{1}{3\sqrt[3]{x^2}}$$ Implicit differentiation will help to compute the derivative without the solving-for-y process. This requires the chain rule, because in general: $$\dfrac{dL}{dx} = \dfrac{dL}{dy}\cdot \dfrac{dy}{dx}$$ Thus, using properties of derivatives,

$$y^3 - x = 0 \implies \dfrac{d(y^3)}{dx} - \dfrac{d(x)}{dx} = \dfrac{d(0)}{dx}$$ $$\dfrac{d(y^3)}{dy}\cdot \dfrac{dy}{dx} - 1 = 0$$ $$3y^2\cdot \dfrac{dy}{dx} - 1 = 0 \implies \dfrac{dy}{dx} = \dfrac{1}{3y^2}$$

It should be noted that $$\dfrac{1}{3y^2}$$ and $$\dfrac{1}{3\sqrt[3]{x^2}}$$ are indeed the same expression, provided the explicit representation $$y=\sqrt[3]{x}$$ of the function.

Another example

$$e^{y}-y=x$$ is an expression where there's no way to find an explicit representation. Nevertheless, you can assume that $$y$$ is a function of $$x$$ and use implicit differentiation to find the derivative of the function:

$$\dfrac{d(e^{y})}{dx} - \dfrac{d(y)}{dx} = \dfrac{d(x)}{x}$$ $$\dfrac{d(e^y)}{dy}\cdot \dfrac{dy}{dx} - \dfrac{dy}{dx} = 1$$ $$\dfrac{dy}{dx} \left( e^y - 1\right) = 1 \implies \dfrac{dy}{dx} = \dfrac{1}{e^y-1}$$

As you can see, in the relation $$e^{y}-y=x$$ there are two ways (or "branches") to define $$y$$ as a function of $$x$$. The domain of the function is $$[1,+\infty[$$ and the range for the possitive branch is $$[0,+\infty[$$. This function is differentiable in $$]1,+\infty[$$, because for $$x=1$$ we have $$y=0$$ and therefore, the derivative is ill-defined. You can also deduce some other properties of the function. For example, since $$y>0 \implies e^y>1$$, the derivative is always possitive and therefore, the possitive branch is a stricly increasing function.

I hope this helps for the explanation.

• Thank you for your explanation. Sep 27 at 6:40

I think it is important to constantly connect implicit differentiation with the chain rule. At first, there might be examples where a third variable is the independent variable, and $$x$$ and $$y$$ are dependent variables. For example, find $$\frac{dy}{dx}$$ if $$x(t)^2+y(t)^2=1$$, so $$2x\frac{dx}{dt}+2y\frac{dy}{dt}=0$$. In this case, the coordinate variables are of the same status: dependent variables. Somehow, putting the coordinate variables on this same status makes it more clear that the chain rule is in play. To finish, we do have to employ the chain rule again, in the form $$\frac{dy}{dt}=\frac{dy}{dx}\cdot \frac{dx}{dt}.$$

Then the next step is the situation were $$x$$ is the independent variable, and $$y$$ depends on $$x$$. So in effect, $$x=t$$ and $$y=y(t)$$ but we might as well drop $$t$$ and think $$x=x$$ and $$y(x)$$, and consider finding $$\frac{dy}{dx}$$ when $$x^2+y^2=1$$, but reinforce the notation $$x^2+y(x)^2=1$$. Students will be annoyed at having to write $$x^2+y(x)^2=1$$ but this is good medicine to enforce at first.

Eventually, students learn to first think about what variables are dependent and which is the independent variable, before jumping into the mechanics of differentiation rules. Only then can they be freed from the instructor's requirement of writing the explicit dependency such as $$x(t)^2+y(t)^2=1$$ or $$x^2+y(x)^2=1$$.

When I grade a problem like this on an exam, students know that they will at least get partial credit if they write the equation with the correct explicit dependency.

• I am intrigued by the temporary move to a parametric equation. IMHO, it will be a great method to use if we know the class has had a good experience with parametrics. It's taught in pre-calc, but results vary. For some the attitude is "I'm glad we got past that." For the other students, I think this approach is really useful. Sep 28 at 11:29
• @JTP-ApologisetoMonica "Really" x and y are functions on the curve: they project points of the curve onto the x and y axis. The relation defining the curves is also a true equality of functions. Taking exterior derivatives is what "relates the rates". When the curve is parameterized locally (which is how we calculate everything with manifolds!) this becomes ordinary 1 variable calculus. Sep 28 at 15:25

I haven't taught calculus in a while and looking back, implicit differentiation is one of the (many) topics that I think I could have taught better. If I was teaching it now I would emphasize that the derivative is a local property, and show how by zooming in on a point on the graph we can find a region where $$y$$ is a function of $$x$$ (except when we can't, and maybe the students can see when that happens). Let's call this function $$g$$.

Then, using your example, I would rewrite $$x+xy+y^2=7$$ as $$x+xg(x)+g(x)^2=7$$, and emphasize that it holds locally. Since $$x+xg(x)+g(x)^2$$ is a constant function in our little region, its derivative is zero there. Now we just use basic differentiation rules to get an expression for $$g'$$, and thus the tangent line.

• Completely agree. Too often implicit differentiation is taught as if one is manipulating the variables x and y. Naming the implicitly defined function, and emphasizing that it is a function (whether or not one can find a closed form algebraic expression for it) is essential. Sep 27 at 15:03
• One can view x and y as projection functions from the curve to the axes, and then the manipulations make sense. However this is multivariable calculus (even differential geometry) and is (I think) too much for students to handle if you want them to actually have a logical view of the subject. Sep 27 at 15:05

I introduce implicit differentiation in two parts:

• How to differentiate dependent variables (i.e. $$\frac{d}{dx} y = \frac{dy}{dx}$$)
• If two functions are equal not just at a point, their derivatives are equal

And then go through a bunch of examples including the squircle $$x^4+y^4=1$$ and plenty of just "find $$\frac{d}{dx} \left(xy + x^2 + y^2\right)$$"-type problems.

• Might I suggest "If two functions are equal on an interval, then their derivatives are equal on that interval"? Sep 27 at 15:01


text:
1 .

# Rate of cooling depends on the

[ A ]    Temperature difference between the body and the surroundings
[ B ]    Area of the radiating surface
[ C ]    Nature of the radiating surface
[ D ]    All of the above
 Answer : Option D Explanation :


text:
# Quick Start for BLAS

Anyone who has used R or Python's numpy extensively has been pleased with the speed of operations on large vectors of numbers. I wanted to get the speedy vector operations in a very lean program, so I looked under the hood and surveyed some of the libraries that do calculations on large vectors and matrices.

It turns out that BLAS (Basic Linear Algebra Subroutines) is everywhere. It lies beneath more sophisticated operations in libraries like LAPACK, and it has many implementations, ranging from Fortran (don't laugh---they're fast and reliable) code bases that started in the Seventies to implementations like OpenBLAS that use the latest low-level instructions from Intel's newest processors.

By gaining a basic familiarity with BLAS, you can gain access to all those new SIMD instructions, like AVX, MMX, and SSE2. There are bindings in C, Go, and many other languages.

The routines do take some getting used to, though. They have lots of parameters. The names of the parameters are very short coded strings that you have to learn to decypher. Fortunately, there are only a few tricks you need to master, and they're all explained in a few papers.

http://www.netlib.org/blas/blas2-paper.ps

There are many helpful references online that don't go into all the details discussed in the papers.

http://web.stanford.edu/class/me200c/tutorial_77/18.1_blas.html

So how to get started? I'm going to talk about a specific example, using the OpenBLAS implementation on Ubuntu 14.04 x86_64 in C.

First I install the libopenblas packages from APT.

sudo apt-get update
sudo apt-get install libblas-doc libopenblas-{dev,base}

A simple Makefile will build the C program. Even though Ubuntu used the "alternatives" mechanism to make OpenBLAS appear as libblas.so, I like to use the more explicit "-lopenblas" linker option. Note that there has to be a real tab character before "gcc" in the Makefile contents.

dist: dist.c
gcc -Wall -O3 -o $@$< -lopenblas

The C program starts off like this:

#include <stdio.h>
#include <stdlib.h>
#include <cblas.h>

int main(void)
{
const int p = 10;
float *a = malloc(p * sizeof *a);
float *b = malloc(p * sizeof *b);
float *c = malloc(p * sizeof *c);
float *orig = malloc(p * sizeof *orig);
int i;

if (!(a && b && c && orig)) {
perror("malloc");
exit(1);
}

for (i = 0; i < p; ++i) {
b[i] = i;
a[i] = 2 * i;
c[i] = 0;
}
cblas_scopy(p, b, 1, orig, 1);

There are several items of note in this example:

1. The arrays used by BLAS are regular, space-efficient, C arrays. They could just as well have been allocated on the stack.
2. You use BLAS as "cblas", and the routines have a cblas_ prefix.
3. There is an additional s prefix before the part of the function name that describes what it does, copy. That s stands for "single-precision floating point." There are other prefixes for doubles or complex numbers.

The parameters in the original example are,

name description argument
N number of assignments to make p
X the source array y
incX the increment in X 1
Y the destination array orig
incY the increment in Y 1

You might also be wondering, "What are the ones for in the parameter list?" They're for specifying what the increment should be on their respective arrays in the parameter list. I doubt you'll use them much, but here's an illustrative example.

incdemo.c

#include <stdio.h>
#include <cblas.h>

int main(void)
{
float a[] = { 1, 2, 3, 4, 5, 6 };
float b[] = { 0, 0, 0, 0, 0, 0 };
const int n = sizeof a / sizeof a[0];
int i;

cblas_scopy(n/2, a, 2, b, 2);   /* copy every other element */
for (i = 0; i < n; ++i)
printf("%f ", b[i]);
putchar('\n');

return 0;
}

See how every other element remains zero in the run below:

bash$gcc -Wall -O3 incdemo.c -lopenblas bash$ ./a.out
1.000000 0.000000 3.000000 0.000000 5.000000 0.000000
bash$ That clears up what the parameters are for, but let's get back to the original example and focus on adding and multiplying vectors together. Continuing the original example, here below is the first arithmetical vector operation. The first time I heard the name of this routine, it sounded really funny cblas_saxpy(p, -1, x, 1, y, 1);  The name, "saxpy", means single-precision floating point alpha times x plus y. The alpha is a scalar that is multiplied with every element in x. The result is added element-wise to y. I want to subtract these two vectors, so I use -1 as alpha. What if we want to square the result? Hmm... There's no obvious element-wise vector-vector multiply function to call. And it seems kind of clunky to use a matrix when it would be mostly empty space. Happily, the creators of BLAS had a plan. They chose to create a small number of functions that are useful in several kinds of circumstances. There is a notion of "banded matrices", where only the diagonal (or the diagonals above and below it) are non-zero. These banded matrices are represented efficiently. For a single diagonal, you can just use an array of numbers with the values of the diagonal. So by using a banded matrix for one vector and a vector for the other, you can multiply two vectors element wise. The routine to use here is cblas_sgbmv, as shown below. It does the following operation. \begin{equation*} y \gets \alpha*A*x + \beta*y \end{equation*} Here that is again in monospace, in case you read this before nikola fixes mathjax or I figure out what user error causes that math to fail to render in this blog. y <- alpha*A*x + beta*y  Note that there are a large number of parameters to use for tweaking the way the function works. cblas_sgbmv(CblasRowMajor, CblasNoTrans, /* Don't transpose A */ p, /* M is the number of rows in A */ p, /* N is the number of columns in A */ 0, /* KL: bands below the diagonal */ 0, /* KU: bands above the diagonal */ 1, /* alpha: the scalar multiplier */ b, /* A: just the diagonal of A in this case */ 1, /* LDA: 1st dimension of A */ b, /* X: the vector to multiply */ 1, /* incX */ 1, /* beta: the scalar multiplier for */ c, /* Y: the results are stored here */ 1); /* incY */  I find it handy to have the cblas.h file open for reference while writing a call like this. I guess one gets used to this kind of thing. Maybe not. Usually one just uses numpy, julia, or something similarly convenient, so maybe there's not enough time to get used to it. Anyway, it could be worse, and that's a relatively small price to pay for portable programs that get the absolute best in performance. The rest of the file is easy:  for (i = 0; i < p; ++i) { printf("b(%f) - a(%f) = %f\n", orig[i], a[i], b[i]); printf("(b-a)^2 = %f\n", c[i]); } free(a); free(b); free(c); free(orig); return 0; }  And running it looks like this: bash$ ./dist
b(0.000000) - a(0.000000) = 0.000000
(b-a)^2 = 0.000000
b(1.000000) - a(2.000000) = -1.000000
(b-a)^2 = 1.000000
b(2.000000) - a(4.000000) = -2.000000
(b-a)^2 = 4.000000
b(3.000000) - a(6.000000) = -3.000000
(b-a)^2 = 9.000000
b(4.000000) - a(8.000000) = -4.000000
(b-a)^2 = 16.000000
b(5.000000) - a(10.000000) = -5.000000
(b-a)^2 = 25.000000
b(6.000000) - a(12.000000) = -6.000000
(b-a)^2 = 36.000000
b(7.000000) - a(14.000000) = -7.000000
(b-a)^2 = 49.000000
b(8.000000) - a(16.000000) = -8.000000
(b-a)^2 = 64.000000
b(9.000000) - a(18.000000) = -9.000000
(b-a)^2 = 81.000000
bash\$

That's great, and now we have seen how to add and multiply vectors, but to calculate the distance is even easier than using the explicit steps like the ones we've seen so far. Check out cblas_snrm2 for Euclidean distance and cblas_sasum for Manhattan distance.

Hopefully some of these examples has given you a head start in working with BLAS tools and code.


text:
# Expansión binomial

This page is a translated version of the page Dictionary:Binomial expansion and the translation is 100% complete.

Other languages:
English • español

(bī, nōm’ ē ∂l)

Si ${\displaystyle \left|y\right|<\left|x\right|}$,

${\displaystyle (x\;\pm \;y)^{n}=x^{n}\;\pm \;{\frac {n}{1!}}x^{n-1}y\;+\;{\frac {n(n-1)}{2!}}x^{n-2}y^{2}\;\pm \;{\frac {n(n-1)(n-2)}{3!}}x^{n-3}{y^{3}}\;+\;\dots \;\pm \;(-1)^{n}y^{n}}$.


text:
siunitx version 2.0: alpha 1

I’ve been working on siunitx version 2, getting the code to the point where I’d hope it works for most things that the current release does. Over the last couple of weeks I hope I’ve sorted out the table issues which tend to be a problem in version 1, plus “mopped up” a few outstanding odds and ends. So it feels like an appropriate point for a public snap shot of the code. As progress has been good, I’m calling this one alpha 1.

At this stage, there are likely to be some bugs and other annoyances in the code. However, I hope that enough works for people to risk taking the plunge and trying it out. For those willing to try out siunitx v2.0, you can get:

You’ll need to have up to date installations of both expl3 and the xpackages to try out the code, as internally the new code uses the LaTeX3 internal syntax. The biggest change that users should see from version 1 is that I’ve re-thought the option names. They are mainly longer, but more informative, in the new code. Improvements to the names I’ve picked are of course welcome.

At this stage, I’m still working on adding more ideas to the code. So there are some omissions in the release that I know are there and am intending to sort out. Of course, different users have different priorities for improvement. That said, there are bound to be things which simply are broken, things I’ve forgotten and the odd item that I’m currently planning not to carry forward from version 1. Feedback by as comments here, by e-mail or at the BerliOS site is very welcome.

The current development plan is to see how much is wrong with the alpha code, and if necessary to have some more alpha-status snap shots. I’d then hope to have a beta some time in the spring (perhaps April or May), with a full release currently in my mind for June or July. Exactly how this will work out depends on other projects: I’d like, for example, to have some floating-point tools in siunitx, but for that I need to write them for LaTeX3. The feature list for the release certainly isn’t fixed, and I’d expect that once v2.0 is out there will continue to be more ideas to add on.

Real life pgfplots examples

I’ve just sent a draft to TUGBoat for an article about pgfplots. As many readers will know, pgfplots is built on pgf/Tikz, which means that it can be used for both DVI and PDF output, and with plain TeX, LaTeX and ConTeXt. In my draft, I’ve used some real life plots (from a couple of recent publications in the research group I work in). The draft will probably change a bit, but for a preview take a look a the the PDF.

LaTeX Books online

I was looking something up today, and quite by accident found that Safari Books Online has both the Guide to LaTeX and The LaTeX Companion available. Unfortunately, the subscription costs mean that for individuals the price is far too high, compared to buying the printed versions. However, I also found that my employers (UEA) have paid for access to a range of books via the service. So if you are in a university it might be worth seeing if you can get the books as part of your institution’s more general access policies.

Building biblatex-biber

The biblatex-biber project provides probably the best way for biblatex users to switch to pure UTF-8 bibliography information. However, getting it to build can cause problems: biblatex-biber is a Perl programme, and needs various downloads from CPAN. I thought it would therefore be useful to put some simple recipes here, explaining what I’ve done to get a working biblatex-biber on Windows, Ubuntu and Mac OS X. I’m assuming that the latest biblatex-biber release has been downloaded and unzipped somewhere, and that the Command Prompt/Terminal/Shell is open in that directory (folder).

Mac OS X 10.6 (Snow Leopard)

Mac OS X comes with Perl installed, so life is relatively easy. At the Terminal, you need to run the cpan script as root:

sudo cpan

The cpan script has its own prompt, but this is very similar to the Terminal one. First, I updated cpan itself and installed a helper module with

install CPAN
install YAML

That done, the various requirements for biblatex-biber can be installed, using the single call

install Data::Dump List::AllUtils Readonly Text::BibTeX Readonly::XS

For the more cautious person (such as me), each install instruction can be given on a separate line: this keeps things a bit more controlled. I accepted the standard settings, except when asked about installing items that were only needed for testing, where I said no.

Once cpan has done all of the installing, you can leave it by typing

exit

So now back at the Terminal prompt, a few simple instructions

perl Build.PL
./Build
sudo ./Build install

That put biblatex-biber onto the path for all users: everything then worked correctly.

Ubuntu 9.10

Once again, Perl is installed as standard in Linux distributions: I’m using Ubuntu as a representative system. Before starting cpan, there is an additional step, which is to install an extra Ubuntu package. So at the Terminal, you need to do

sudo apt-get install libxml2-dev

This is needed as otherwise you get some very odd errors in a bit. Now, essentially the same recipe works as for the Mac. First run cpan running and update and install YAML. Then there is a long list of items to install

install Data::Dump List::AllUtils Readonly Text::BibTeX Readonly::XS XML::Writer XML::LibXML File::Slurp

which can again be done one at a time, for the more cautious.

After exiting cpan, the same three lines at the Terminal should work as in the Mac section.

perl Build.PL
./Build
sudo ./Build install

Windows (XP, Vista and 7)

To date, my attempts to build biblatex-biber on Windows (using Strawberry Perl) have failed as I can’t get the Perl module Text::BibTeX to install. This is supposed to be optional, but without it biblatex-biber does not seem to work, although I do get it to build. Luckily, there is a self-contained binary for Windows available from the project site. This includes its own Perl system, so there is no need to get Perl set up before trying it. Everything seems to work for me with this version. Any ideas on what is necessary would be helpful!

I get quite a few e-mails asking for help with my packages, and also spot a few questions in various public places (comp.text.tex and The LaTeX Community, mainly). I’m always happy to help where I can, and it always makes my life a bit easier if the question arrives with all the information to start with.

One of the things that get repeated by almost everyone trying to help out users is the need for a minimal example. For LaTeX, that typically looks something like:

\documentclass{article} % Or perhaps memoir, beamer, ...
\usepackage{...}
\begin{document}
Example here
\end{document}

ConTeXt examples are not dissimilar, while plain TeX ones need very little at all (but I get very few of these). It’s much faster to supply everything to start with than to send a snippet with key details left out. It’s surprising how many things people simply assume are obvious, when they are not (“Surely everyone uses package wibble”).

Another useful thing to do in advance of sending a query is to send a log file. Again, LaTeX users are normally best advised to include \listfiles in their input, so the kernel makes a neat listing of everything in use (hopefully including the versions).

Often, I get description of either how things should look or why they are wrong, rather than an actual example. If at all possible, a “reference rendering” is much easier to follow. That can be something done in a drawing programme, using some alternative (but awkward) TeX code, or a screenshot of something. Describing things in words (especially if the questioner is not a native English speaker) can be a recipe for a long and painful process.

For questions posted in public, it’s always best to drop me a line so I spot it: I do my best but sometimes I miss things. For places such as comp.text.tex, that can simply be a CC on the posting, or for forums a quick note that says

Hello,

http://some-url-here/

will make sure that the issue gets me interest.

On the other hand, questions direct to me obviously get straight to the point but miss out on the public record part of a posting to Usenet. The same issues do tend to pop up more than once! Sometimes there is good reason for avoiding public postings: I get questions including unpublished material about achemso, for example. So I’d encourage anyone with an issue they think is general (such as a bug in one of my releases) to post something in public if possible. I always try to follow up postings as well as e-mailing people directly as well.

As I say, I’m always happy to try to help. I hope that most of the time I succeed.

achemso: Cross-referencing to floats

I’ve had a a few questions about the achemso bundle concerning creating references such as “Figures 1 to 3” automatically. The problem has been that I’ve been using the varioref package to turn \ref{some-fig} in “Figure 1” automatically, rather than having to put Figure~\ref{some-fig}. Unfortunately, varioref does not handle multiple references in an automated fashion.

For version 3.4 of achemso (which I’ve just sent to CTAN), I’ve switched to the cleveref package. This means that you can now write something like \ref{fig-1,fig-2,fig-3} and get “Figures 1 to 3” without further effort. I hope that this makes life much easier for users, although it does mean that there is another package required to use achemso. I think that this is the right balance: I’m sure users will let me know if I’ve got it wrong.

The PDF format has evolved over the years as Adobe have released new versions of their Acrobat and Reader software. New ideas have been added to the file format, and as a result there are different versions of the PDF format. If you take a look at a PDF in Adobe Reader, you can see which version the file is using in the Document Properties information. Of course, files using the newer versions of the PDF format need a suitable viewer, be that Reader or something else.

This is relevant to TeX users as PDF tends to be the target format, either directly or via DVI files, for many users. Tools such as pdfTeX are not tied to one version of the PDF specification. For example, when creating a PDF directly with pdfTeX the \pdfminorversion primitive can be used to set the PDF version to 1.3, 1.4 or 1.5.

Why would you want to do this? Well, obviously the newer versions bring new features. A particularly significant one is the compression of non-stream objects. The detail of these objects is not really important, but they relate to items such as links within documents. Version 1.5 of the PDF specification allows these to be compressed, which can make quite a difference to the resulting file size. For example, I did a trial run with the siunitx manual, and by adding the lines

\pdfminorversion=5
\pdfobjcompresslevel=2

resulted in reducing the file size from around 700 KiB to around 550 KiB, a saving of roughly 20 %.

There is some discussion ongoing at the moment on the TeX Live mailing list about possibly changing the default PDF version produced by tools such as pdfLaTeX, XeLaTeX, etc. The current standard setting is version 1.4, which makes larger files but does have the advantage of being readable by a wider range of viewers. On the other hand, PDF version 1.5 was first released in 2003, and there is pretty good support for it in most of the well-known readers. As long as switching to version 1.5 also enables the compression, this looks like a good idea: just moving to version 1.5 without using the features available seems a bit odd to me.

There are times where you need to use PDF version 1.4 (for example for archive-type PDFs), but for those you also need to check other features of the PDF. So I feel that the change looks like a good idea, provided there is a good way to set the version to something else.

Chemistry journals: publishers support of LaTeX

As the author of the achemso bundle (for supporting submissions to the American Chemical Society), I get a few queries about the support various publishers provide for LaTeX. Unlike more physics-focussed journals, the chemistry journals never typeset directly from authors LaTeX sources. As a result, the acceptance of LaTeX material from authors is rather less popular, and tends to be patchy. So I thought I’d summarise things as I currently understand them.

American Chemical Society (ACS)

As I said above, I’ve written the achemso bundle specifically for submissions to the ACS. However, while the central office are happy to host a copy on their website and so on, the ACS don’t officially support the bundle. That means, in practice, that some journals are happier with LaTeX submissions than others. Each journal has its own office, and so I hear different things from people submitting to different journals. It also means that I have to pick up the requirements of each office based on feedback via authors, rather than getting any formalised instructions. There are mistakes in the achemso bundle, and there are also requirements that I don’t know about. So feedback is always useful (good or bad).

Royal Society of Chemistry (RSC)

The RSC have rather less information about LaTeX on their website than the ACS. They do mention TeX, but only very briefly. I’ve written some BibTeX styles, and a very basic article template, which are available in the rsc bundle. I’ve had a bit of feedback on these, and I hope that they at least provide a starting point for writing a submission to the RSC in LaTeX. More generally, I think the best advice is to check with the editorial office for the relevant journal before writing anything, and to stick to the basic LaTeX article class when you do.

Wiley

As with the RSC, Wiley don’t have a lot of LaTeX information. What they do say is that they only accept PDF submissions: you can’t send your source. They also say to stick to the plain article class, and basically to keep things simple.

Elsevier

Elsevier have recently had a new class written for journal submissions, elsarticle. From what I can make out on their site, you can use this for most of their journals, which should include the chemistry ones. As this has actually been written for them to order, I imagine that Elsevier is the best place to be sending LaTeX submissions to. Hopefully other publishers will see that they have made life easier for their authors and will take note.

pgfplots v1.3

A new version of the very useful pgfplots package has been released. pgfplots provides a very handy interface on top of pgf/TikZ to generate print-quality plots without too much effort. As many readers will know, pgf works with both DVI and PDF output methods, making pgfplots very handy for generating plots without worrying about other content.

For me, the stand-out new feature in v1.3 of pgfplots is the ability to automatically reverse the axes. As a chemist, I need to do this as convention dictates that some types of data are displayed with the x axis running from high values to low ones. So for me not having to do this by hand is a really significant reason to upgrade. There are lots of other new features as well: I see that the manual now includes a number of 3D surface style graphs, which many people like.

If you are plotting data in TeX, the pgfplots should be very high on your list of packages to consider.

siunitx performance (again)

My previous post mentioned some efforts to improve the performance of the siunitx parser. I’ve now committed an entirely new version of the parsing code to the repository. I’ve also done my best to speed up the rest of the package. The speed you see very much depends on the type of input involved. With my test file, I got a time of roughly 3 minutes using version 1 of siunitx, about 2 minutes before improving version 2, and about 1.5 minutes after. For comparison, doing no processing at all take the time down below 10 seconds for the same file (roughly 700 pages of repeated input). For the interested reader, an siunitx snapshot TDS-style zip is available.

One thing that I find interesting in all of this is that even before optimising the code, version 2 still worked faster than version 1, even though it does more things. A lot of that is because the pre-built looping material in expl3 does a much better job than my own attempts in version 1 of siunitx. Of course, good programmers will always use fast loops, but for the rest of us I think this shows how a sensible tool-kit can bring benefits “behind the scenes”.