text:
## Obama Administration announces first fuel economy and GHG standards for medium- and heavy-duty vehicles

##### 09 August 2011
 The new HD National Program covers vehicle classes 2b through 8. Click to enlarge.

US President Barack Obama announced fuel efficiency and greenhouse gas emission standards for medium- and heavy-duty vehicles. The US Department of Transportation (DOT) National Highway Traffic Safety Administration (NHTSA) and the Environmental Protection Agency (EPA) developed the standards—fuel economy and greenhouse gas emissions, respectively—in coordination with truck and engine manufacturers, fleet owners, the State of California, environmental groups and other stakeholders.

For purposes of the new HD National Program, the heavy-duty fleet incorporates all on-road vehicles rated at a gross vehicle weight at or above 8,500 pounds, and the engines that power them, except those covered by the current GHG emissions and Corporate Average Fuel Economy standards for model year 2012-2016 passenger vehicles.

Heavy-duty vehicles include both work trucks and commercial medium and heavy-duty on-highway vehicles as defined by the Energy Independence and Security Act (EISA). Heavy-duty engines affected by the final standards are generally those that are installed in commercial medium- and heavy-duty trucks and buses. The agencies’ scopes are the same except that EPA is including recreational on-highway vehicles (RVs, or motor homes) within its rulemaking, while NHTSA is not including these vehicles.

Under the new program, trucks and buses built in 2014 through 2018 will reduce oil consumption by a projected 530 million barrels and greenhouse gas (GHG) pollution by approximately 270 million metric tons. The joint DOT/EPA program will include a range of targets which are specific to the diverse vehicle types and purposes. Vehicles are divided into three major categories:

• combination tractors (semi-trucks);
• heavy-duty pickup trucks and vans; and
• vocational vehicles such as transit buses and refuse trucks.

The joint standards cover not only engines but also complete vehicles, allowing the agencies to achieve the greatest possible reductions in fuel consumption and GHG emissions, while avoiding unintended consequences.

To account for this in the regulatory program, two types of standard metrics have been adopted: payload-dependent gram per mile (and gallon per 100- mile) standards for pickups and vans; and gram per ton-mile (and gallon per 1,000 ton-mile) standards for vocational vehicles and combination tractors. These metrics account for the fact that the work to move heavier loads burns more fuel, and emits more CO2 than in moving lighter loads.

Within each of the three categories of trucks, even more specific targets are laid out based on the design and purpose of the vehicle—e.g., a semi truck with a low roof versus a semi truck with a high roof. Fuel efficiency improvement goals are then charted for each year and for each vehicle category and type.

By the 2018 model year, the program is expected to achieve significant savings relative to current levels, across vehicle types.

• Combination Tractors. Heavy-duty combination tractors—the semi trucks that typically pull trailers—are built to move freight. Freight transportation customers choose tractors primarily based on two major characteristics: the gross vehicle weight rating (GVWR, which establishes the maximum carrying capacity of the tractor and trailer) and cab type (sleeper cabs provide overnight accommodations for drivers). Operators also consider the tractor roof height when mating with trailers for the most efficient configuration.

The agencies have adopted differentiated standards for nine subcategories of combination tractors based on three attributes: weight class, cab type and roof height. The standards will phase in to the 2017 levels shown in Table 1. These final standards will achieve from 9–23% reduction in emissions and fuel consumption from affected tractors over the 2010 baselines.

• Heavy-Duty Pickup Trucks and Vans. The agencies are setting corporate average standards for heavy-duty pickup trucks and vans, similar to the approach taken for light-duty vehicles. Each manufacturer’s standard for a model year depends on its sales mix, with higher capacity vehicles (payload and towing) having numerically less stringent target levels, and with an added adjustment for 4-wheel drive vehicles. This approach recognizes both the inherently higher GHG emissions and fuel consumption of higher-capacity vehicles, and the importance of payload and towing capacity to the owners of these work trucks and vans.

EPA has established standards for this segment in the form of a set of target standard curves, based on a “work factor” that combines a vehicle’s payload, towing capabilities, and whether or not it has 4-wheel drive. The standards will phase in with increasing stringency in each model year from 2014 to 2018. The EPA standards adopted for 2018 (including a separate standard to control air conditioning system leakage) represent an average per-vehicle reduction in GHG emissions of 17% for diesel vehicles and 12% for gasoline vehicles, compared to a common baseline.

NHTSA is setting corporate average standards for fuel consumption that are equivalent to EPA’s standards (though not including EPA’s final air conditioning leakage standard). The final NHTSA standards represent an average per-vehicle improvement in fuel consumption of 15% for diesel vehicles and 10% for gasoline vehicles, compared to a common baseline.

To satisfy lead time requirements under EISA, NHTSA standards will be voluntary in 2014 and 2015. Both agencies are providing manufacturers with two alternative phase-in approaches that get equivalent overall reductions. One alternative phases the final standards in at 15-20-40-60-100 percent in model years 2014-2015-2016-2017-2018. The other phases the final standards in at 15-20-67-67-67-100 percent in model years 2014-2015-2016-2017-2018-2019.

• Vocational Vehicles. Vocational vehicles consist of a very wide variety of truck and bus types including delivery, refuse, utility, dump, cement, transit bus, shuttle bus, school bus, emergency vehicles, motor homes, tow trucks, and many more. Vocational vehicles undergo a complex build process, with an incomplete chassis often built with an engine and transmission purchased from different manufacturers, which is then sold to a body manufacturer. In these rules, the agencies are regulating chassis manufacturers for this segment.

The agencies have divided this segment into three regulatory subcategories: Light Heavy (Class 2b through 5); Medium Heavy (Class 6 and 7); and Heavy Heavy (Class 8), which is consistent with the engine classification.

After engines, tires are the second largest contributor to energy losses of vocational vehicles. The final program for vocational vehicles for this phase of regulatory standards is limited to tire technologies (along with the separate engine standards). The standards depicted in Table 2 represent emission reductions from 6–9%, from a 2010 baseline.

 Click to enlarge.

In addition to the CO2 standards described above, EPA has adopted standards for N2O and CH4 emissions. N2O and CH4 are important GHGs that contribute to global warming, more so than CO2 for the same amount of emissions. While today’s gasoline and diesel engines emit relatively low levels of N2O and CH4 emissions, EPA’s standards will act to cap emissions to ensure that manufacturers do not allow the N2O and CH4 emissions of their future engines to increase significantly above the currently controlled low levels.

Air conditioning (A/C) systems contribute directly to GHG emissions through leakage of HFC refrigerants, which are powerful GHG pollutants. EPA has adopted standards to assure that high-quality, low-leakage components are used in each air conditioning system designed for heavy-duty pickup trucks and vans, and semi trucks. The standard for larger A/C systems (capacity above 733 grams) is measured in percent total refrigerant leakage per year, while the standard for smaller A/C systems (capacity of 733 grams or less) is measured in grams of refrigerant leakage per year.

While the first two years of the NHTSA standards will be voluntary, vehicle manufacturers will be required to meet the corresponding EPA standards for those two years. Small businesses are excluded from both the EPA and DOT standards.

Flexibilities. EPA’s and NHTSA’s final HD National Program provides flexibilities to manufacturers in terms of how they can comply with the new standards. These flexibilities are expected to provide sufficient lead time for manufacturers to make necessary technological improvements and reduce the overall cost of the program, without compromising overall environmental and fuel consumption objectives.

The primary flexibility provisions are an engine averaging, banking, and trading (ABT) program and a vehicle ABT program. These ABT programs will allow for emission and fuel consumption credits to be averaged, banked, or traded within each of the defined averaging sets.

There are three weight-based averaging sets for two of the regulatory categories: combination tractors and vocational vehicles. The pickup trucks and vans are one fleetwide averaging set, and there are four averaging sets for engines.

In addition to the general ABT programs, EPA is providing engine manufacturers and heavy-duty pickup and van manufacturers the added option of using CO2 credits to offset CH4 or N2O emissions that exceed the applicable emission standards based on the relative global warming potentials of these emissions.

The structure of the ABT program for HD engines is based closely on earlier EPA ABT programs for HD engines; the program for pickup trucks and vans is built on the existing light-duty GHG and fuel economy credit carry-forward, carry-back, and trading provisions; and first-time ABT provisions are adopted for other HD vehicle manufacturers that are as consistent as possible with the provisions for other categories.

• An early credit option intended for manufacturers who demonstrate improvements in excess of the standards prior to the model year that they become effective;

• a credit program intended to promote implementation of advanced technologies, such as hybrid powertrains, engines with Rankine cycle waste heat recovery systems, and electric or fuel cell vehicles; and

• a credit intended to apply to new and innovative technologies that reduce vehicle CO2 emissions and fuel consumption, for which the benefits are not captured over the test procedure used to determine compliance with the standards (i.e., “off-cycle”).

Administration analysis projects that the standards will yield an estimated $50 billion in net benefits over the life of model year 2014 to 2018 vehicles, and to result in significant long-terms savings for vehicle owners and operators. A semi-truck operator could pay for the technology upgrades in less than a year and realize net savings of$73,000 through reduced fuel costs over the truck’s useful life. These cost saving standards will also reduce emissions of harmful air pollutants like particulate matter, which can lead to asthma, heart attacks and premature death.

The agencies are considering a next phase of rules for this sector, as there are more opportunities to reduce GHG emissions and fuel use from the heavy-duty fleet for model years beyond 2018. The goals would include spurring innovation as well as updating the assessment of actual emissions and fuel use from this sector. Such future regulation would also be designed to align with similar programs developed outside the US.

Resources

It's about time. There are so many things trucker can do to inmprove efficiency, but they don't. I can't figure out why. Presumably they are business men who look to improve the bottom line, but that just hasn't been the case. Maybe they just don't care. I guess when you spend your life driving, the road hum kind of numbs you out. Plus, it's probably just easier to whine about fuel prices.

Actually, the challenge is the same as with autos. The capital cost of the efficiency is painful and visible at the point of purchase, while the efficiency benefit is diffuse and down the road.

When you add in the much higher capital cost for efficiency improvements before they reach million unit manufacturing scale, you have the same chicken/egg problem we have with cars.

That's why these types of programs and regulations are smart government - they get private industry over a hump and bring general benefits to all, and specific long term benefits to the regulated industy.

Don't worry...American consumers will gladly pay for the vehicle upgrades after the costs are ultimately passed on to them...if not American consumers, just go further into debt with China.

Gas prices dropping...expect more whining about regulations.

The best truck improvements I've seen are aerodynamic farings, skirts, and trim at the back of the trailer.

The trick is, this mostly applies for truckers who pull the same trailer all the time. If the trailer is a container or such, there's less chance of those very good drag reducers. Still, if half of the trailers got enhanced, that would reduce fuel consumption something like 10% for those trucks...still a massive benefit.

God bless the EPA! If it weren't for them the auto and truck industry would still be spewing out crap powertrains and laying off American jobs while outsourcing all engineering to BRIC countries. Let the market decide to improve does not work on its own. It needs responsible regulatory help.

The comments to this entry are closed.


text:
# What is an Algebra? (Part III)

In our next few Algebras, we broaden our sense of elements. Until now, we’ve looked at different types of numbers as our elements.

Now, consider matrices as elements. Given any two 2×2 matrices, $A$ and $B$, we can certainly computer $A+B$ and $A\cdot B$. And crucially, this sum and this product are still 2×2 matrices. So, we see that the set of 2×2 matrices forms an Algebra. It shouldn’t be too surprising that the set of 3×3 matrices also forms an Algebra, and more generally the set of $n$x$n$ matrices do as well.

We could also use functions (say, ones that turn a real number into another real number) as our elements. In that case, we have addition and multiplication of functions as operations. And we have another reasonable operation to look into–composition.

Do we have division in the world of matrices or the world of functions? If you multiply a matrix A by a matrix B, is there another matrix to multiply by that will get you back to A? What about something that undoes composition by $f$ or multiplication by $f$ in the same way that subtracting $f$ undoes adding $f$?

format: plain


text:
# Preface

This time, the Lab requires us to realize the bobing software of lab3, which is really a great challenge for us, because we have never been in contact with such a project before. And finally, at my insistence, my teammate Zongtan Li agreed to write this with Unity. In this assignment, Li is mainly responsible for UI construction and scene switching, while I am responsible for writing dice interaction code. Here is the information about my partner.

The Link of the Blog of my partnerEE308 Lab4: Pairing Coding for BOBING App
Partner’s MU STU ID and FZU STU ID19105690_831902209

# Problem analysis and solution

### 1. Key functions

• #### Random results of six dice

The most important thing of bobing is to generate 6 random points. Although this is easy to realize with random numbers, we think that is very boring and the sudden points are unnatural. Therefore, it is a good choice to use a real physics engine, as shown in the figure below.

Simulate the real Bobing situation, which makes people feel more surrogate.

• #### Multiplayer gaming

In lab3, we use the network to realize online connection, but due to the short time and insufficient ability of this experiment, we decided to use multiple people to play games with one mobile phone. The relationship between the number of people and the display is also very necessary. The game screen should show the total number of players, the number of players’ turn to operate, etc. The specific effect is shown in the figure below.

### 2. Difficulty

• #### Modeling

As a game engine, everyone knows the performance of unity. But if you take it as a modeling software, my evaluation of it is 😅. At the same time, it is not easy to make the material of the model. Without modeling experience, I spent two days building many different bowls and dice models. However, there are always various problems, such as the surface of the bowl is not smooth, and the hole representing the number of points on the dice sometimes gets stuck on the wall, which is very funny. I was not satisfied with the results every time. I once wanted to use maps instead of bowls and let the dice collide in a square box. Make the result look like a collision in a bowl. So how do I solve this problem? It’s simple: https://sketchfab.com .

• #### Get dice points

Using this simulation method can not control the final dice points, but also need to use the function to read the dice points. But this is not easy. First of all, when a dice can read its points, it must have stopped, so first write a script to judge the dice speed. When its speed is 0, calculate its points. But sometimes the instantaneous speed of the dice will also be 0. So I added a limiting condition. When the dice are stationary for 10 frames, it is considered that the dice are stationary, and the dice points can be read at this time. Then it is to judge the number of dice. The first method I think of is to judge the angle between the dice axis and the world axis. There are 6 positive and negative axes of XYZ axis, which just represent 6 faces. When the angle between an axis and the Y axis of the world coordinate is within a certain range, the number of points corresponding to the axis is considered to be the number of dice at this time. However, the positive and negative half axes of the axis meet this condition. Although a variable can be added to count the height of each face, I think it is very troublesome, so I abandoned this idea.

Then, I thought, if I want to compare the height, why can’t it be higher than the height of all points? Which surface has the highest Y-axis coordinate, and the number of dice is the number of points corresponding to that midpoint. This method is easy to implement and has high accuracy. But then I found a problem, that is, sometimes the dice are stuck between the bowl wall and other dice. Generally speaking, the number of dice can not be counted at this time, but this method will return a specific value, which is inconsistent with the facts, so this scheme is also rejected by me.

Finally, I decided to give full play to the powerful function of unity. I added a trigger to each side of the dice. When the dice were stationary, I detected which side triggered the contact with the ground. At this time, the dice points were the points of the face-to-face. If the number of triggers is not 1, it indicates that the state of the dice cannot be read normally. At this time, add a force to the dice to make it rotate again. Until it reads its points. The triggers of dice is shown in the figure below

Key part code

//Script of dice
if (canStart == false && Vector3.Magnitude(rigidbody.velocity) != 0)
{
isMoved = 0;
for (int i = 0; i < 6; i++)
{
triggles[i].isTriggle = false;
}
}
else if(isMoved < 10)
{
isMoved++;	//Record the number of frames the die is still
}

if (!canStart && Vector3.Magnitude(rigidbody.velocity) == 0 && isMoved >=10/*dice is still*/)
{
int count = 0;
int diceface = -1;
for (int i = 0; i < 6; i++)
{
if (triggles[i].isTriggle)
{
count++;
triggles[i].isTriggle = false;
diceface = i;
}
}
if (count != 1)		//The number of triggers is not 1
{
Debug.Log("Abnormal dice state"+count.ToString());
isMoved = 0;
}
else
{
result = triggles[diceface].point;	//point of dice
canStart = true;
}

}

//Script of trigger
public bool isTriggle = false;

void OnTriggerStay(Collider collider)
{
if (collider.tag == "ground")
{
isTriggle = true;
}
}

• #### The sound of dice colliding

As a software that shakes dice, there is no soul without the sound of dice collision. I found many sounds of dice on the Internet, but I was not very satisfied. The audio file I finally used was the sound of small stones falling on the glass.

At first, I thought it was very simple. Just play the sound of collision during collision. But during the test, I found that the sound was very chaotic and mixed together and the collision sound is the same. It sounds strange. My solution is: When the time interval between two collisions is very short, only one collision sound is emitted, and the size of the sound is related to the speed of the collision. The core code is as follows.

float curTime, lastTime;	//Time of this collision, time of last collision
void Start()
{
this.rb = GetComponent<Rigidbody>();
this.lastTime = 0;
}

void OnTriggerStay(Collider collider)
{
curTime = Time.time;
if (lastTime>0 && curTime - lastTime > 0.1)	//Filter collisions within 0.1 seconds
{
float pow = Mathf.Pow(Vector3.Magnitude(rb.velocity),2)/100;	//Strength of collision
this.GetComponent<AudioSource>().volume = pow;
this.GetComponent<AudioSource>().Play();
}
this.lastTime = curTime;	//The time of this collision is assigned to the last collision
}

More code please see our Unity project: BoBing-Program

# Working Environment

Since neither of us likes taking pictures, I put a picture of our late night communication.

Late night liver explosion.🤗

# Pair programming experience and gain

For this pair work, Li’s and my familiar things are different, so we have a problem in software selection. Because this is mainly graphical programming, we planned to use Processing at first, but we were not familiar with its usage. We also considered other ways of WeChat applet login, and finally decided to use Unity at my request. But the progress is still good after starting programming. Li is good at UI, I am good at code, and we perform our respective duties. No, we will help each other. If we spend more time, I think we will improve more details. However, we also have some differences. I buckle some small details, but Li doesn’t stick to details. As a result, many things Li does are not perfect, and my work speed is not fast.

For example, in the case of background music, we initially set that the concert will be played all the time and will not be interrupted when switching scenes. At first, it can work normally, but then we found a problem in the test. Although the music will not be interrupted, each time we switch to the main interface, the music files will not be destroyed, and the main interface comes with a music playback component, As a result, there will be multiple background music. After finding many methods, we can’t solve this problem perfectly. Finally, we chose a compromise. The background music will not be superimposed, but the components controlling the music can’t control the volume due to the lack of objects. This is still a bug for us. We will try our best to fix this bug. Sometimes, many things can’t satisfy you. You have to learn to accept it.

There are also windows for inputting the number of rewards and game rules. Now we may not be able to solve this problem, but after mastering sufficient knowledge, I will try to improve the software. After all, this is my first time to make a software, which is very meaningful to me.

### 1. Picture display

• Start interface

• Mode selection

• Game settings

• Result display

• Game interface

Passcode：7uqd

passcode: e7io

# summary

### 1.PSP form for this work

Personal Software Process StagesEstimated Time (minutes)Actual time (minutes)
Planning180120
Estimate18653105
Development120120
Analysis120180
Design Spec3060
Design Review1020
Coding Standard60120
Design200840
Coding10001200
Code Review60180
Reporting60240
Test Report55
Size Measurement55
Postmortem & Process Improvement Plan1515
Total18653105

### 2.Personal feelings

I think this lab is very challenging for me. It is undoubtedly difficult to challenge a field I haven’t touched before in a time limit of a week for the first time, but as long as I conquer the past, I will have a great sense of achievement. Although our software still has many vulnerabilities, so I still need to learn how to solve these problems. If you have some opinions or can solve my bugs, please contact me. My email is 2579538675@qq.com.

The Link of Requirement of This AssignmentLAB 4 Second pair programming assignment
MU STU ID and FZU STU ID19103387_831902225
Teammate’s MU STU ID and FZU STU ID19105690_831902209
Teammate’s blog linkEE308 Lab4: Pairing Coding for BOBING App
• 0
点赞
• 0
评论
• 0
收藏
• 打赏
• 扫一扫，分享海报

10-09 475
05-06
04-08 253
08-16 650

_Weii

¥2 ¥4 ¥6 ¥10 ¥20

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。


text:
## College Physics (4th Edition)

The total kinetic energy of the neutron and the pion is $40~MeV$ which is $6.4\times 10^{-12}~J$
We can find the mass $M$ that is lost: $1115~MeV/c^2 = 940~MeV/c^2+135~MeV/c^2+M$ $M = 1115~MeV/c^2 - 940~MeV/c^2-135~MeV/c^2$ $M = 40~MeV/c^2$ We can assume that the missing mass is converted into kinetic energy. We can find this energy: $E = Mc^2$ $E = (40~MeV/c^2)(c^2)$ $E = 40~MeV$ $E = (40~MeV)(\frac{1.60\times 10^{-13}~J}{1~MeV})$ $E = 6.4\times 10^{-12}~J$ The total kinetic energy of the neutron and the pion is $40~MeV$ which is $6.4\times 10^{-12}~J$.


text:
# Why is power specified in watts rather than amperes?

This probably has an obvious answer I'm missing, but searching the web only gave me information on how watts are defined, not why we use them.

Many electric appliances (from things used to build circuits to appliances we use every day) give their power draw in watts. Many other appliances, however, give their draw in amps.

From what I've seen online, watts is calculated by multiplying voltage by current. However, Ohm's law states that $$\I = \frac{V}{R}\$$, which implies that current already varies linearly with voltage (given constant resistance.) Isn't multiplying current by voltage again redundant?

Similarly to electrical appliances, I've also seen battery capacities defined in both watt-hours and amp-hours, even with batteries that have variable voltages (depending on the charge.)

This doesn't seem to really make sense: if the battery has varying voltages and if amperes don't truly represent power (as I've seen several sources online state as a reason for the usage of watts), why are they used to measure the capacity of batteries that have varying voltages?

• Do you understand what the word dimension means in the context of metrology? Nov 24, 2021 at 2:38
• Why is pressure specified in pounds per square inch rather than pounds? Pretty much same thing with power Nov 24, 2021 at 6:22
• I think for even a person who's less knowledgeable, "you can draw up to 1A from this powerbank for 10 hours, or 2A for 5 hours" makes more sense than "you can squeeze 5Wh energy from this power bank". Nov 24, 2021 at 7:35
• @MituRaj Except that a "10Ah power bank" usually has a ~3.8V 10Ah battery, but delivers 5V. So a "10Ah power bank" can't deliver 1A at 5V for 10h, more like 7h. Honestly, Ah makes reasonable sense for a component like a battery. For a product, such as a powerbank, it is borderline useless. Nov 24, 2021 at 11:21
• I am afraid how many ordinary people are able to understand 'Watts' or 'Watt hour'. But an average smart phone user does understand what is current and Amperes. Nov 24, 2021 at 13:24

Power is specified in watts because a watt is a unit of power. Current is specified in amperes because an ampere is a unit of current. Appliances made for use in homes are designed to run on the AC mains supplied by utilities. In general mains power is generated at a fixed voltage (120 volts in the United States, 240 volts in some other countries). Therefore you can specify the power used by such appliances either directly in watts or in amperes since it is assumed that the latter is for the fixed utility supplied voltage (thus the power can be calculated by multiplying the current by the AC mains voltage). Also most appliances do not appear to the AC mains as fixed resistances so your use of Ohm's law is not relevant.

• The US is an interesting edge case because 240V is used for larger loads and a few items can exist in 120V (small) and 240V (large) versions. Then the power in W is essential for comparison Nov 24, 2021 at 15:07

Because 1-amp looks the same whether it is...

A) pushed through a 1000-ohm resistor by a 1000V potential, or,

B) pushed through a 1-ohm resistor by a 1V potential.

Option A requires 1000 watts and will soon vaporize the resistor.

Option B will still get warm but only requires 1 watt.

• "and will soon vaporize the resistor" Depending on the resistor. Open your mind (and your wallet, if you want to buy a 1000W resistor). Nov 24, 2021 at 4:04
• Why would I want use a 1000w resistor when I am looking to emphasize the dramatic difference between 1 amp at 1000v and 1 amp at 1 v. Any good researcher would keep as many variables constant as possible between the two experiments or you hide your result. Nov 24, 2021 at 4:25
• You could use a 1000 watt 1 ohm resistor too! Nov 24, 2021 at 4:38
• Of course, but which version paints the best picture to enlighten the OP? Nov 24, 2021 at 4:42

Because amps are a unit of current, and watts are a unit of power. They're not the same thing.

An outlet is often just called a power outlet. But if nothing is plugged in, it's not delivering any power. And some I've spoken with were confused by that because they wanted to know what happens to the power if nothing is plugged in. "Does it get recovered or captured and 'put back somehow' if nothing is plugged in?" they asked. "Or does it just spill out and get wasted?"

However, these power outlets do deliver a voltage to each and every outlet. So, to be technical, perhaps the outlet should be called a voltage outlet and not a power outlet, as it always provides a consistent voltage even if there's no power involved as there is no device connected up.

But you have to pick a word and go with it. And in any case, that's what people require (power) when they do plug in a device for use. So "power" it is.

Besides, voltages tend to come in standard lengths. So they don't need to be stated, much of the time. It's either there or it isn't. The value when it is there is just assumed to be known.

I'll switch over to an analogy of sorts.

Voltage is like the distance from a floor to a ceiling in a home. There is a standard height that most folks can just assume. So you don't need to mention a quantity, at all. It's "enough" and that's all you need to know. If you need to look up a specific value, that is easily had.

Current tends to be more like "floor space." It can be anything at all that is appropriate for a use.

You don't need to talk about the height of a room. But people are interested in the area, if you want to tell them. So it would seem odd to hear someone ask, "Could you also tell me how high your ceiling is?" just after having being told that the house is 1300 sq. ft. (or 120 sq. m.).

Sure, the actual living space really is a volume and without the ceiling height you don't know the volume. But you don't care, either. The floor space tells you what you need to know for most uses.

So it may be easier to see why voltage may not be mentioned, at all. (It's assumed to be some standard value.) And why it's enough to mention the current (analogous to floor area.)

In this analogy, power is like the home's volume. That's the actual 3D space required for a decent life, as you can't live glued down flat to a floor (we aren't flounders.) But just saying the area gets across all that's needed for most non-technical discussions.

Floor-space is what you think in, when you are considering some function: kitchen, pantry, bedroom, etc. Yet you really mean volume when thinking that way, because there is an implied working height that you also expect. And there are standards for that. Separately, the functions might be: door and cabinet carpentry, auto repair shop, and so on. And each of these would likely imply a different standard height needed. You need and will pay for the required working volume and the required time it is needed, but you think in terms of the working area and just assume the standards for the height that everyone shares as an assumption for the function. (And you pay for the time you use it.)

Likewise, the voltage for a home is standardized. So there's no need to refer to it. It's a given. The current matters because of the safety breakers and the power matters because of the cost (when considered with time) to operate the device. So while current is a concern ("Will my circuit breaker support this?") and while power is a concern ("Is this freezer more expensive to operate than another freezer?"), the voltage is not a concern. It just exists in the background, so to speak.

That said, like renting space for some function, you will pay for the floor space and the ceiling heights needed (the total volume -- similar to power, here) and also the rental period (time.) In total, the voltage times the current times the time is the energy consumed. And that is what you pay for. So voltage matters in that computation. (If you need 240 VAC instead of 120 VAC and use the same current for the same time, you will pay twice as much for the 240 VAC power usage.) But voltage is just a matter of determining compatibility ("Will this device function properly with this voltage?") What you mostly care about is the current (circuit handling) and the power (cost to operate per unit time of use.)

So it's reasonable for some devices to talk about current. In this way, you can make sure that your circuit, together with other devices that may share the same circuit, will function properly with your breaker. It's also reasonable to talk about power. In this way, you can think about functional efficiency or cost-to-operate. The only use of voltage is for compatibility (a yes-no question of whether or not you can plug device X into socket A.)

But everything, voltage, current, and time goes into computing the dollars spent for some job or task performed.

Power is formally defined as the amount of work done over a period of time. Work is a fundamental concept in physics, and is quantified in units of joules. And the derived quantity of power is canonically expressed in units of joules per second; a watt is by definition 1 joules per second (it is simply defined as such by humans).

Electrical current describes the rate of change of charge over a period of time. Charge is a fundamental quantity in physics and is expressed in coulombs. And the derived quantity of electrical current is expressed in coulombs per second; an amp is by definition 1 coulomb per second (it is simply defined as such by humans).

If you understand and/or accept the fundamental nature of what a joule represents and what a coulomb represents, it is self evident that the derived quantities of power and electrical current are fundamentally different. They are relatable things, but a third concept links them.

That concept is voltage (electromotive force), which is another derived quantity, and which is expressed in terms of joules per coulomb; and again by human definition 1 joule per coulomb is called a volt.

• updated thanks @ThePhoton Nov 25, 2021 at 14:18

Watts are a unit of power, they should be preferably be used. However, for certain appliances such as batteries, amps can make more sense because of the loses inside the battery.

The difference between power, current, voltage has been explained in other aswers, I will only focus on why amp-hours can make sense even if it's not properly a unit of energy.

Let's take an example with a battery that is 12V, 12Wh (1Ah), with an internal resistance of 1Ω

here is a simplified diagram: a perfect source (always 12V) in series with a 1Ω resistor

Let's assume Rload is 11Ω. The output current is $$I = U/(Rg+Rload) = 12V / (1+11)\Omega = 1A$$

the internal perfect source delivers $$P = U*I = 12V * 1A = 12W$$

the battery will be empty after 1h (12Wh delivered) but the load only received $$P = Rload*I^2 = 11\Omega * (1A)^2 = 11W$$ $$E = P*dt = 11W*1h = 11Wh$$

In Ah, the load "received" $$1A * 1h = 1Ah$$

So, should the battery be branded as 11Wh ? Not so fast, it depends of the load, let's see with a 1Ω load. This is the maximum power output and can happen when a car starts for example, where a huge amount of power is needed.

now, the current is $$I = U/(Rg+Rload) = 12V/(1+1)Ω = 6A$$ so the internal source delivers

$$P = I*U = 6A*12V = 72W$$ so it will last 1/6 h or 10 minutes

during these 10 minutes, the internal source delivered 12Wh, but the load only received $$P = Rload*I^2 = 1\Omega * (6A)^2 = 36W$$ $$E = P*dt = 36W * (1/6)h = 6Wh$$ Only half! If counting in Ah however, it is still $$6A * (1/6)h = 1Ah$$

Now, the battery delivered only 6Wh, but the 1Ah is still "correct"

In practice, it's even worse than that because the internal resistance isn't constant or even linear, it can vary depending on many factors (current, state of charge, temperature, aging, etc)

TLDR: for a battery, measuring the current output is more accurate than the power because it is depends less of what happens inside the battery, even if it's not a true measure of the available power

it generally changes to what you model the load as, each unit has sort of an implied meaning to it, with a model I mean that you assume something about the load to simplify. Remember that V= I/R is not always true there a lot of conditions that need to be met so you can do that.

I will give you some examples:

Constant impedance : you can think of it as resistance to simplify but it is not exactly the same, the square root of the voltage magnitude controls the power mainly. example Headphones and audio equipment usually mention ohms

Constant current : the voltage will control the power, but we assume the load draws a constant current so from there we can know the power. Transducers and arc lamps behave like this.

Constant power : here you assume the load only has constant power. Some electronic devices behave like this but I got no examples from the top of my head

so each definition implies how it should be modelled as when you work with it, or what conditions are considered constant.

there is nothing wrong with using ohm's law but don't forget the formal definition of electric power

Imagine two rubber balloons, A and B, where B's rubber wall is twice as thick as balloon A.

They are both inflated by injecting air into them, but balloon B's thicker wall will resist inflation more. To inflate them both with 1 litre of air would take much more physical effort for B than A would require, and yet it's the same amount of air in both cases.

In other words, you expend more Joules of energy inflating balloon B than for A, to the same volume, to move the same amount of air from outside the balloons to inside.

To extend this analogy to power, remember that power is the rate of doing work, the number of Joules of "exertion" made each second. The unit is Watts, which means Joules per second. If you intend to inflate both balloons to the same volume of 1L in the same amount of time, obviously you will have to work harder blowing into balloon B than A. In this scenario you are doing more Joules of work per second (power, in Watts) for ballon B than for A.

Conversely, if you don't care how long it takes, then you can make the same effort to inflate both balloons, but for balloon B you will have to make that effort for longer. In this scenario you are delivering the same power to both balloons, but for far longer in the case of balloon B.

The rate of air flow here is analagous to electric current, which is charge flow. Balloon volume would be analogous to total electric charge moved. I hope it's clear by this point that you can't measure power, or work done by knowing only how much air/charge moved, since in all cases it has been 1 litre.

Current tells you how much charged moved, in the same way volume tells you how much air you moved, but it doesn't tell you anything about how much effort the battery or lungs made in order to do the moving. To know that, you also need to know how hard you blew into the balloon, or how hard the battery/mains pushed charge through some device.

For the air analogy, clearly the measure of "how hard" is pressure, and for electricity, that measure is voltage.

If you have to blow twice as hard (twice the pressure) to inflate ballon B to 1L in 10s, as you do to inflate balloon A to 1L in the same time, then you've done twice the amount of work over the same duration, and therefore delivered twice the power. That's why fluid power is proportional to pressure, and electrical power is proportional to voltage.

Now understand that to inflate any balloon to 1L, you can control the flow of air into it, and that rate of flow will determine how long it takes to deliver each Joule of energy. In other words, doubling the air-flow/current will also double the the number of Joule's of work done each second. That's why electrical power is also a function of electric current.

If you double electric current, you double the power, the number of Joules of energy delivered each second to whatever that current is flowing through. If you double the voltage across something, then you also double the power delivered to that thing.

Crucially, what happens if you double both? You quadruple the power. For a fixed electrical resistance, something interesting happens. Let's say you double the voltage across a resistor. Ohm's law tells us what happens to the current:

\begin{aligned} \frac{V}{R} &= I \\ \\ \frac{2V}{R} &= 2I \end{aligned}

Doubling the voltage across the resistor will also double the current through it, and the combined effect on power is a quadrupling. Similarly, if you double the current through a resistor, you also consequently double the voltage across it. Either case therefore results in a quadrupling of power, a relationship which can be clearly seen in the "square" terms of the two other famous power equations:

\begin{aligned} P = \frac{V^2}{R} \\ \\ P = I^2 \times R \end{aligned}

TLDR; To get to your question, current on its own cannot tell you about energy delivered per second. Voltage alone cannot tell you this either. Only together can you know the power:

$$P = I \times V$$

Few household appliances have constant electrcal resistance, though an electric kettle comes close. For a kettle, doubling the voltage supply from its usual 110V to 220V would (if the kettle survived) cause the kettle to boil the same amount of water in a quarter of the time, because four times as many Joules of heat energy are delivered to the water each second.

Most electrical appliances are not so simple, and may not be treated as constant resistances. As an example, if you had a multi-voltage TV, rated at 100W, doubling the supply voltage would halve the current, to maintain 100W. That requires some complex switch-mode power supply magic, but it is possible.

Most appliances would just die if you doubled the voltage. Unless they are designed to cope with the sudden doubling or quadrupling of power delivery (which entails some kind of dynamic control of their "apparent resistance"), they usually deal with it by not doing anything any more. Like when you put your back out trying to deliver too many Joules of gravitational potential energy to something in too short a time.

Assuming you know the difference between current and power...

why are they used to measure the capacity of batteries that have varying voltages?

Simple: if the stuff you want to power from the battery draws current that doesn't depend on battery voltage, you'll be interested in battery capacity expressed in Amphours. However if your load uses constant power, then its current will depend on battery voltage, and then battery capacity expressed in Watthours will be more useful. It's not obvious how to convert between the two because battery voltage isn't constant.

An example of a load that current independent of battery voltage would be anything powered by a linear regulator.

An example of a load that draws constant power would be a LED flashlight driven by a switching DC-DC converter. This will regulate a constant output current into the LED, so it has constant output power, and it will draw constant power from the battery (equal to output power + losses) so input current is in inverse proportion to battery voltage.

Many electric appliances (from things used to build circuits to appliances we use every day) give their power draw in watts. Many other appliances, however, give their draw in amps.

If your appliance is a resistor, or if it behaves as a resistor, it makes no difference.

If it doesn't behave as a resistor, for example a switching power supply without power factor correction, then its power factor will be far from 1, and it will draw current in pulses or other weird shapes.

So if you want to use a switch on your wall to control a bunch of LED "transformers" (which are really switching power supplies) you'll be interested in the maximum peak input current of these, so that it doesn't exceed the rating of the switch. In this case, power will be very low, so the switch won't care, but peak current could be a problem.


text:
# Reference sf::RenderWindow from another source file in SFML

In SFML, How would you be able to reference a window in your main.cpp file to another source file? I want to be able to reference the window made in main.cpp from player.cpp, so I can keep everything organized and not have so much stuff in main.cpp. Any help is greatly appreciated.

Main.cpp

#include "SFML/Graphics.hpp"
#include <iostream>
#include "Player.h"

int main()
{
sf::RenderWindow window;
sf::VideoMode vmode(800, 600, 32);
window.create(vmode, "Test");

PlayerTest(2);

//Game Loop
while (window.isOpen())
{
// REMEMBER TO FIX PLAYER.CPP

sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}

window.clear();
window.draw(text);
window.display();
}

return 0;
}

Player.h

#ifndef PLAYER_H
#define PLAYER_H

#include <SFML/Graphics.hpp>
#include <iostream>

void PlayerTest(float speed);

#endif

Player.cpp

#include "SFML/Graphics.hpp"
#include <iostream>
#include "Player.h"

void PlayerTest(float speed) {

sf::RectangleShape square(sf::Vector2f(100, 100));
square.setFillColor(sf::Color::Cyan);

//window from Main.cpp I need to reference
while (window.isOpen())
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)) {
square.move(0, -speed);
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)) {
square.move(0, speed);
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) {
square.move(-speed, 0);
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)) {
square.move(speed, 0);
}

//Window from Main.cpp I need to reference
window.clear();
window.draw(square);
window.display();
}
}

• You might want to read a basic C++ tutorial. Why not simply pass the window instace as a reference or a pointer to the PlayerTest function? Anyways I don't feel like this is gamedev specific. Your generic game flow looks also quite wrong, as you have two while loops after each other.
– user35344
Sep 18 '16 at 20:58
• @Tyyppi_77 Thanks for the help, I'm kind of new to C++ and I'll read up again on some tutorials I have. Sep 18 '16 at 21:25

Have your main.cpp call an object Game. This Game object contains everything else. Your game first initializes the Window, then passes the reference to Player when it initializes it.


text:
# Questions Asked onSeptember 21, 2013

1. ## Chemistry

Consider the following reaction: 2Fe2O3 --> 4Fe + 3O2 ∆Hrxn° = +824.2 kJ The decomposition of 29.0 g of Fe2O3 results in a. the release of 150 kJ of heat b. the release of 12000 kJ of heat c. the absorption of 12000 kJ of heat d. the absorption of 150

2. ## Chemistry

The standard internal energy change for a reaction can be symbolized as ΔU°rxn or ΔE°rxn. For the following reaction equations, calculate the energy change of the reaction at 25 °C and 1.00 bar. Sn(s) + 2Cl2(g) --> SnCl4(l) ΔH°rxn = -511.3 kJ/mol

3. ## college physics

A rod 14.0 cm long is uniformly charged and has a total charge of -20.0 µC. Determine the magnitude and direction of the electric field along the axis of the rod at a point 36.0 cm from its center. N/C

4. ## Science

Family Smith is interested in buying a solar energy system. After some search on internet they have found two different systems that they are considering. System A is a PV system based on multicrystalline silicon solar cells and System B is a PV system

5. ## Chemistry stoch1

Calculate mass of iron, which will be converted into (Fe3O4) by the action of 18g of steam on it.

6. ## math

A researcher was interested in the emotional effects of music on exam performance. Before their exam, a professor took one group of students into a room in which calming music was played. A different group of students were taken to another room in which

Which property is illustrated by the following statement? 2x(6) = (6)2x a. Associative Property of Addition b. Commutative Property of Multiplication (?) c. Inverse Property of Multiplication d. Commutative Property of Addition Which property is

8. ## math

in triangle ABC, AB=6, BC=12 AND AC=X. Which of the following cannot be a value of x? a. 6 b.7 c.8 d.9 e.10

9. ## Chemistry

What is the maximum mass of S8 that can be produced by combining 85.0 g of each reactant? 8SO2 + 16H2S yields 3S8 +16H2O

10. ## chem

Assume that you have 1.41mol of H2 and 3.50mol of N2. How many grams of ammonia (NH3) can you make, and how many grams of which reactant will be left over? 3H2+N2→2NH3

11. ## chemistry

The radius of a aluminum atom is 143 pm. How many aluminum atoms would have to be laid side by side to span a distance of 4.90 mm?

12. ## Algebra

Which property is illustrated by the following statement? (7p)mn = 7p(mn) a. Commutative Property of Multiplication b. Associative Property of Multiplication(?) c. Inverse Property of Multiplication d. Commutative Property of Addition What is the

13. ## Math

An elevator moves at a rate of -5.8 feet per second from a height of 300 feet above the ground. It takes 3 seconds for the elevator to make its first stop. How many feet above the ground is the elevator now?

14. ## Algebra

The perimeter of a basketball court is 108 meters and the length is 6 meters longer than twice the width. what are the length and the width?

32. ## Math

Which sum or difference is equivalent to the following expression? 5-3x --- 5 Is this 1 - 3x/5?

What is the maturity date of Samantha Best’s loan?

34. ## physics

The initial speed of a cannonball is 520 m/s. The acceleration of gravity is 9.8 m/s 2 . The cannon and target are at the same elevation. If the ball is to strike a target that is at a horizontal distance of 2.7 km from the cannon, what is the minimum time

75. ## algebra

I have to find the solution for (fg)(x) f(x)= -6x-1 g(x)=4x^2 can you show steps please

76. ## Math

A new car depreciates as soon as you drive it out of the parking lot. A certain car depreciates to half its original value in 4 years. IF you bought a car 8 years ago, and it's now worth \$5,000, how much did you pay for the car originally?

77. ## algebra

A parallelogram is 22 inches long and 14 inches wide. How do you find the height of the parallelogram? How do you find the area of the parallelogram ?

y/11=3

79. ## Cell Biology

Suppose 1.00 ml of blood from a given donor contained 5 X 106 red blood cells and the donor’s hematocrit were 48%. Determine the surface area that the lipids extracted from the plasma membranes of red blood cells obtained from 10.0 ml blood would occupy

80. ## college physics

In the Bohr theory of the hydrogen atom, an electron moves in a circular orbit about a proton, where the radius of the orbit is approximately 0.542 multiplied by 10-10 m. (The actual value is 0.529 multiplied by 10-10 m.) (a) Find the electric force

-22+y=y/-14

82. ## algebra

Can someone help me with steps showing select approximate value of x that are solutions to f(x)=0 f(x)=-7x^2 + 5x + 9

83. ## algebra

-22x + 11y +55z =

84. ## english

There was no danger, difficulty, or that could ponce de leon from venturing into the jungles of florida to search for the fountain of youth. a= obstructuion...deter b=procrastination... subside i know the definitions its to hard i think its b

85. ## Chemistry

A sample of glucose, C6H12O6, contains 5.1x10623. a.)How many atoms of hydrogen does it contain? b.)How many molecules of glucose does it contain? please help me. :(

86. ## Chemistry

A sample of glucose, C6H12O6, contains 5.1x10623. a.)How many atoms of hydrogen does it contain? b.)How many molecules of glucose does it contain? please help me. :(

87. ## PURE MATHEMATICS

5) find the complex number z and w such that z+w=4+3i and z-iw=3-2i

88. ## Bus/475

why should core values remain relatively constant.

89. ## triangles (math)

BO and CO are respectively the bisector of angle b and angle c triangle ABC.AO produced meets BC at P, then find AB/AC.

90. ## ENGLISH (ESL)

please need proof Reading Health promotion means what you can do to reduce the health risks and promote the wellness of a human being. This process directed towards enabling people to take action and support them in changing their lifestyle to move toward

91. ## math

Order: Furosemide 40mg IV push every 12 hours x 3 days. have 50 mg dont clue how to do this .

92. ## English

what is the Past Present and future for carry

93. ## socials

An extension to my other question- how did oliver cromwell like impact the world and why was he significant? It could relate to if he had high moral principles. I wrote my essay but I don't know how to close it up.

94. ## polynomials

can someone please help me with this problem I have to get the sum diff and product I keep trying to work it out but i really think im blowing it. x^3- ¡¼2x¡½^2 + 3x-1 ¡Ã x^2- x+4

95. ## Chemistry

When electrons get excited can they only move up one level or can they go up multiple orbitals, but just one at a time.

96. ## physics

Two stones are thrown simultaneously, one straight upward from the base of a cliff and the other straight downward from the top of the cliff. The height of the cliff is 5.16 m. The stones are thrown with the same speed of 8.67 m/s. Find the location (above

97. ## Algebra

Is -7 + 9 = -9 + 7 true, false, or open? a. true b. false (this one?) c. open Is 4x - 3 = 19 true, false, or open? a. true b. false c. open (this one?) Which of the following is a solution to the equation 16 = 4x - 4? a. -5 b. -4 c. 5 (this one?) d. 16

98. ## polynomials help me please

Im sorry here is the problem rewritten X^3 -2x^3 + 3x-1 : X^2-x+4 I have to get the sum diff and product and it kicking my tail i think i keep doing it wrong can someone please help me

99. ## math

The variable n represents a whole number. a. For what values of n will the sum of n+3 be less than 50? b. For what values of n will the product 3n be less than 50?

An important factor of being judged a best company to work for is the input provided by company employess.

101. ## statistics

if a toaster ovens hav an average life expectancy of 9.5 years with a standard deviation of 4.75 years. what is the probability that a toaster oven will last twenty years or will fail in one year or less?

102. ## Englsih

Please edit this writing. There are several errors in this writing. People take out oil from the sands in AB so we can drive and leave tailings ponds. This caused a lot of damage to the land and negative impacts to wildlife. Natives get sick from eating

103. ## English

Please edit this writing. There are several errors. Also, evaluate the writing, style, spelling and content of this writing piece. The Alberta oil sands are being developed at an unprecedented rate for oil extraction. Consequently there is a great deal of

104. ## English

Please evaluate the writing, grammar, style, spelling as well as content. People take out oil from the sands in AB so we can drive and leave tailings ponds. This caused a lot of damage to the land and negative impacts to wildlife. Natives get sick from

105. ## statistics

if anxiety scores were recorded as Z score or 1.10, is that higher than 35 in the current study?

106. ## math

If f (x,y)= x-y+3, What is f (f (6,4), 2)? A. 12 B. 11 C. 6 D. 3 E. 2

107. ## Chemistry

What is the energy of a bond formed between a potassium (K+) cation and an iodide (I−) anion? The ionic radii of K+ and I−, are 152 pm and 206 pm, respectively. Assume the Born exponent n is 10

108. ## Chemistry

Calculate the cohesive energy of potassium iodide (KI). The ionic radii of K+ and I−, are 152 pm and 206 pm, respectively. Assume the Born exponent n is 10. Assume a Madelung constant of 1.7.

109. ## Math

In a certain Library, there are r bookcases with s shelves in each book case. If a total of b books is to be distributed among the shelves, What is the number of books per shelf? a) b/rs b) rb/s c) rsb d) r/s-b e) b/s-r

110. ## Statistics

2. A researcher hypothesized that the pulse rates of long-distance athletes differ from those of other athletes. He believed that the runners’ pulses would be slower. He obtained a random sample of 10 long-distance runners. He measured their resting

111. ## Algebra

Two cyclists leave towns apart at the same time and travel toward each other. One cyclist travels slower than the other. If they meet in hours, what is the rate of each cyclist?

112. ## math

The average of 20,70 and x is 40. If the average of 20,70, x and y is 50, then y= a. 30 b. 60 c. 70 d. 80 e. 100


text:
# 3.3F: Mixed Solvents

When no single solvent can be found that meets all of the criteria for crystallization, it may be possible to use a mixed solvent. A pair of solvents is chosen: one in which the compound is soluble (called the "soluble solvent"), and one in which the compound is insoluble (called the "insoluble solvent"). The two solvents must be miscible in one another so that their solubility with one another does not limit the proportions used. Table 3.2 shows a list of common mixed solvents used in crystallization.

Table 3.2: Common mixed solvent pairs in crystallization.
Solvent Pair
Methanol / Water
Ethanol / Water
Acetone / Water
Methanol / Diethyl ether
Petroleum Ether (or hexanes) / Diethyl ether
Hexanes / Ethyl acetate

To perform a crystallization using a mixed solvent, the solid to be crystallized is first dissolved in the minimum amount of hot "soluble solvent", then hot "insoluble solvent" is added dropwise until the solution becomes slightly cloudy. An additional small portion of hot soluble solvent is then added to clarify the solution, and the solution is set aside to slowly cool and crystallize. A diagram describing this process is shown in Figure 3.13.

Although this procedure can produce good results, when possible it is often best to use a single solvent for crystallization. As a mixed solvent is heated, the composition can change as the solvents evaporate at different rates, which can affect the solubility of the compound in the mixed solvent. Also, crystallizations from mixed solvents sometimes "oil out", where the dissolved compound comes out of solution above its melting point and forms a liquid instead of a solid.

To test a mixed solvent for crystallization, use the procedure that follows. This process is demonstrated by crystallizing trans-cinnamic acid from a mixed solvent of water and methanol (Figures 3.14 + 3.15).

1. Use the previously described method ($$100 \: \text{mg}$$ compound in $$3 \: \text{mL}$$ solvent), to find a pair of solvents: one solvent in which the compound is soluble and one solvent in which the compound is insoluble (Figure 3.14). The solvents must be miscible with one another.
2. Place a fresh $$100 \: \text{mg}$$ of the solid to be crystallized in a test tube and add the "soluble solvent" dropwise while heating (with a steam bath or hot water bath, Figure 3.15a) until the solid just dissolves. The suspension should be immersed in the heat source after each drop, and some time should be allowed in between additions for the sometimes slow dissolving process.
3. Add the "insoluble solvent" dropwise while heating until the solution becomes faintly cloudy (Figure 3.15c).
4. Add the "soluble solvent" dropwise while heating until the solution is clarified (clear).
5. Allow the system to cool to room temperature (Figure 3.15e), and then submerge in an ice bath for 10-20 minutes. If crystals return, the mixed solvent may work for the crystallization.

This page titled 3.3F: Mixed Solvents is shared under a CC BY-NC-ND 4.0 license and was authored, remixed, and/or curated by Lisa Nichols via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.


text:
# Question #dff70

Jan 24, 2017

Solve the equation for $y$.

#### Explanation:

$- 4 x + 3 y = 21$

Add $4 x$ to both sides.

$3 y = 4 x + 21$

Divide both sides by $3$.

$y = \frac{4}{3} x + \frac{21}{3}$

Simplify.

$y = \frac{4}{3} x + 7$

Jan 24, 2017

We know that slope-intercept form is

$y = m x + c$
where $m$ is slope and $c$ is intercept on $y$-axis.

Let us convert given equation $- 4 x + 3 y = 21$ in the above form by keeping $y$ term on LHS and all taking remaining terms to RHS.
$\implies 3 y = 4 x + 21$
Dividing both sides by $3$, we get

$\frac{3 y}{3} = \frac{4 x + 21}{3}$
$y = \frac{4}{3} x + 7$
is the required form.

If we plot this equation with inbuilt graphic tool we get the following:

Slope$= \frac{\Delta y}{\Delta x} = \frac{7}{5.25} = \frac{7}{5.25} \times \frac{4}{4} = \frac{28}{21} = \frac{4}{3}$
Intercept on $y$axis$= 7$


text:
### Kognition's blog

By Kognition, history, 7 weeks ago, ,

I feel like a majority of the Div 1 problems on Codeforces have $n \leq 10^5$ or $n \leq 10^6$ here, which basically means that the solutions have to be between $O(n)$ and $O(n \log n)$ (maybe in rare cases $O(n \sqrt n)$ or $O(n \log^2 n)$). However, this doesn't seem to be the case in other high level competitions; for example, this rarely seems to be the case in Topcoder Div 1 SRM, Google Code Jam, and ICPC.

With such a high constraint on $n$, the solution space is pretty constrained, and only certain algorithms will be viable. This might explain why certain data structures like Segment Trees/Fenwick Trees are overrepresented on Codeforces compared to other platforms. Other interesting algorithms like Max Flow, Knuth DP, Blossom Algorithm, etc pretty much never appear on Codeforces, and when there is a difficult problem (eg Div 1 C/D) with constraints that are not $10^5$/$10^6$, you can pretty much expect that the solution will be one of these algorithms that rarely appears, as opposed to other platforms where you would have to be on your toes for all problems.

I have never formally set problems before, so perhaps there is something I am missing (eg perhaps $n \leq 10^5$ are easier to test and block incorrect solutions), but is there any particular reason that there are so many problems with this constraint? I feel like contests would be filled with a more rich variety of algorithms if this was not the case.

EDIT: I suppose I wrote this in a way that seems to discount the effort of many problemsetters. I recognize that problemsetting is hard work and am pretty grateful that CF problemsetters are active enough to allow contests to be created multiple times a week; that's pretty much unheard of on any other site. I didn't intend to say that these types of problems are necessarily bad, I was just curious if there was any reason that I hadn't thought of for why the problems tend to be of this flavor.

• +154

 » 7 weeks ago, # |   +106 1) Topcoder system can only handle input of size up to 20,000 characters so that's a reason why you won't meet many DS problems there.2) Arguably, it's easier to come up with problems with big $n$ and those are more standard. Big competitions like Code Jam have more resources to come up with plenty of problems and choose just a few of them that they find most interesting and unusual.
•  » » 7 weeks ago, # ^ | ← Rev. 2 →   -75 sorry
•  » » 7 weeks ago, # ^ |   +28 Interesting, I didn't know about that restriction on the Topcoder system, thanks. Your reasoning for 2) is the hypothesis I was currently working with, but I wasn't sure how true it was.
•  » » 7 weeks ago, # ^ |   -73 Hello bro ,i watched your video for geany set up for CP. I did all what you said , but recently one of my solution was not working on it .I used comparator function for multiset in that problem. Solution got AC on submission but was giving error while compiling on my geany compiler. What can be wrong , do i need to reinstall geany or what.My OS — Parrot Security linux
•  » » 7 weeks ago, # ^ |   -66 Also , it will be grate ,if you can make a video for python setup in geany also.
 » 7 weeks ago, # |   +95 Do you think that problemsetters work in this order:1. What will be the limitation on $n$ in my problem?2. With that settled, let's come up with the problem. Also, what was that mysterious $n$ thing?Problemsetter come up with some problem, decide what solutions they want to accept and what solutions they want to reject, deciding on that they choose limitations.I don't really understand your question.
•  » » 7 weeks ago, # ^ |   +48 Ok, so under your framework for how problemsetters create problems, I think the appropriate and somewhat straightforward formulation of the question is: "Why is it that the problems on Codeforces happen to mostly have model solutions with $O(n)$ or $O(n \log n)$ complexity while all "naive" solutions happen to be $O(n^2)$, when this does not seem to be the case for problems in other platforms/contests?"Is that question more clear?
•  » » 7 weeks ago, # ^ |   +39 Well, it doesn't have to be exactly such process, but some people may definitely think like "hm, what kind of interesting queries on interval I could perform?" or "I am curious whether I am able to push suffix automaton to its limits" and then you are bound to have not very interesting problem with $n \le 10^5$
 » 7 weeks ago, # |   +67 In Google Code Jam, one reason may be that the contest used to have input files that the participants downloaded — this restricted input sizes.Are you sure about ICPC? I checked the problems from ICPC World Finals 2019 and 7/11 of them had large constraints.Still, I think you have a good point: it would be great to have more problems where the interesting part is how to solve the problem in polynomial time, instead of how to improve the time complexity from O(n^2) to O(n log n).
•  » » 7 weeks ago, # ^ | ← Rev. 2 →   +45 I'll admit that to verify my initial statement I only checked the most recent Codeforces, GCJ and Topcoder contests, not ICPC. I could be wrong and the same could be true of ICPC, I'd still need to more sampling of CF and old WF sets to see if there's a difference. I think the point you make about old GCJ format is pretty relevant; that makes sense. Another factor I guess is that GCJ allows Python so it can't push $n$ up exorbitantly high.But yeah, you seemed to get the gist of my post, which was asking why a lot of the problems here focus specifically on $O(n^2)$ -> $O(n)$/$O(n \log n)$ optimizations. I remember a Topcoder problem a while back where the interesting optimization was $O(2^n)$->$O(n^2)$, and you could even go down to $O(n)$ using linear bridge finding algorithm but that was obvious and not really the point of the problem.I also don't like habit of pushing up the constraints unnecessarily just to get to the ~$10^5$ number, since it prematurely can give away the complexity for the answer. For example I think today's problem E could have just had $n \leq 50$, and it would still be fundamentally the same problem, but with $n \leq 500$ it's obvious that you only have to think about straightforward linear construction algorithms (ie linear in the total number of elements). Again I could be wrong here and missing some detail.
•  » » » 7 weeks ago, # ^ |   -16 Another factor I guess is that GCJ allows Python so it can't push n up exorbitantly high. The same is true for problems with quadratic intended solution, so I don't see your point.
 » 7 weeks ago, # |   +90 I find that Um_nik shares my opinion — your logic seems to imply that authors do this purposefully. They most definitely don't.However, I can't deny that thinking about it the correlation you've observed is somewhat true. My opinion is that this is due to the format of the competition. We have short time for a decent amount of problems. What seems to happen is that "difficult" problems are often ones where some clever data structure or a twist on a known approach yields some speedup (often from $O(N^2)$ down to linear or quasilinear as you pointed out).Problems with smaller constraints are often (not always) more about coming up with a decent (e.g. polynomial) solution to what's seemingly an intractable problem, rather than optimising something with structures and tweaks. These problems can be interesting but I personally think they're more fit for longer competitions (IOI style). If the application of the appropriate algorithm is not concealed in a neat and smart way, it's just a bad problem.Consider your examples. It's not easy to come up with an original max flow problem and its implementation is not particularly interesting (most people will have a ready copy of it anyway). Knuth optimization of DP is cool, but again, pretty much all problems using it that I've seen share very similar features. The Blossom Algorithm, in my opinion, should never be given on a competition. I suppose my theory boils down to the fact that taking something and optimizing it in a smart way is a much straightforward way of creating a problem than coming up with a completely new problem that has a neat solution. The former approach will yield problems such as those you've described, the latter is harder to do and I believe is more fit for longer competitions.Note that all of this is very general talk, of course there are plenty of problems that don't follow this logic.
•  » » 7 weeks ago, # ^ |   +13 "I suppose my theory boils down to the fact that taking something and optimizing it in a smart way is a much straightforward way of creating a problem than coming up with a completely new problem that has a neat solution. The former approach will yield problems such as those you've described, the latter is harder to do and I believe is more fit for longer competitions."Cool, I think this makes sense. Out of curiosity, is there a reason why you think Blossom should never appear in a contest? I remember doing a Google foo.bar problem that involved that algorithm a while back, and it seemed like a reasonable enough problem.
•  » » » 7 weeks ago, # ^ |   +26 I find Blossom algorithm's implementation to be nasty and the only time I've used it was a copy-paste from a public implementation (it was allowed). For onsite competitions it just sounds mean.There are many arguments for which algorithms should be allowed on competitions and which shouldn't. Everybody has a different threshold, but for everyone there exist some algorithms which are too nasty and shouldn't be given on competitions. I'm sure for a lot of people Blossom is not one of them, but for me it is.
 » 7 weeks ago, # | ← Rev. 2 →   +31 With such a high constraint on n, the solution space is pretty constrained, and only certain algorithms will be viable It's not, why do you think so?I don't think problems are "standard" or whatsoever just because $N$ is large, it's an inherently silly demarcation, and there is no backing evidence (my personal experience disagrees with that). Bad problems are just bad for their own reason.
•  » » 7 weeks ago, # ^ |   +10 Sorry, I don't mean to say that such problems would be "standard". But is it not necessarily true that it reduces the amount of algorithms that may end up being involved (ie any algorithm with over O(n) complexity)? Perhaps this is exclusion is irrelevant, since competition problems are less about the algorithms themselves and more about the observations/reductions leading up to using the algorithms.I also don't mean to say that these problems are necessarily bad, of course "bad problem" has an entirely separate meaning.
•  » » » 7 weeks ago, # ^ | ← Rev. 2 →   +28 Thanks for the clarification. But is it not necessarily true that it reduces the amount of algorithms that may end up being involved This is true. But I claim this doesn't necessary means "such problem is easy to think of a solution" (aka boring): Obviously, such problems are harder because only excellent solutions survive. This is the most recent commented case where there are a bunch of easy $O(NQ)$ solution but only one of them have a nice property that is optimizable. So they pose a different kind of challenge compared to exponential-polytime game, and personally I enjoy these kind of problems more. As you mentioned, if you are solving a non-standard problem, then even with the right toolkit it shouldn't be obvious. Starting to think from any polynomial-time solution is a valid strategy regardless of the size of $n$. Reducing the problem into multi-state DP or flows could be helpful, since these are much familiar concepts and so is easy to manipulate. On the other hand, if it's trivial or only technical to optimize the algorithm from any poly-time to linear ones, I don't see a reason to give it that way either. But it's up to the setter's decision. Sometimes, there is an occasion where the setter increases the $N$ to make problem easier.
 » 7 weeks ago, # |   +8 An easy way to get an $O(N^2)$ naive solution: for each of $N$ obvious parameter choices, run an easy $O(N)$ algorithm. Alternatively, answering queries that can be trivially answered in $O(N)$ — most tree problems are like this. These are common and often boring problems.
 » 7 weeks ago, # |   +110 You may be right that there are a lot (maybe even too many) problems of kind "given array of length $10^5$ and $10^5$ queries of $10^5$ different types, do some shit". You know, ko_osaga-type. But it is kinda its own genre of problems which has rights to exist.I don't agree on the part "there are a lot of algorithms with polynomial but non-linear complexity". You have mentioned most of them, really. There are flows/matchings, Floyd/Ford-Bellman, some linear algebra stuff. I guess you can count DP optimizations, but I think DP complexities are out of discussion here, because they depend on what is the DP state, which changes from problem to problem.On the other hand, there are A LOT of linear or quasi-linear algorithms.- Most basic graph stuff: DFS (+bridges+articulation_points+topological_sort+SCC+euler_tour), BFS, Dijkstra, Kruskal- A lot of things on trees can be done in $O(log^p)$ after precalc in quasi-linear time: binary lifting, heavy-light decomposition, centroid decomposition, small-to-large- Most string algorithms: Z-function, Prefix-function, hashing, Aho-Korasik, suffix structures- Some geometry stuff: convex hull, two closest points, halfplane intersection- Some combinatorics, since we can precalculate factorials- FFT- and yes, data structures. a lot of themThen we have a lot of greedy and ad-hoc problems which requires only sorting, binary searches, maybe some two-pointers or scanlines. All of which is quasi-linear. Sometimes these problems will remain the same if lower $n$ to 100. But is it necessary?On the point of exponential/polynomial vs $O(n^2)$/$O(n \log n)$: well, yes, it is rewarding to come up with polynomial solution to a problem that looks NP-hard. But the problem is that if you take a random problem that looks NP-hard, it is with high probability NP-hard. Sometimes you can make interesting transitions from $O(n^n)$ to $O(n!)$ to $O(3^n)$ to $O(n2^n)$ and it is interesting to make a problem out of it. But most of the time you just cannot do anything. While speeding-up existing polynomial solutions can be done with various standard technics.What I want to say is that we are trying hard to come up with problems that look impossible to solve in polynomial time. But most of the time it remains unsolved.Summary:1. We have a lot more tools to optimize polynomial solutions to quasi-linear times than to solve impossible problems in polynomial time;2. Some topics (not only data structures) almost purely consist of quasi-linear algorithms;3. Not all of the problem with $n \le 10^{5}$ are just optimizing $O(n^2)$;4. Yes, in some sense it is easier to come up with problems with $n \le 10^5$. But it is not that bad. Not in all cases, at least.I think we should analyze this case by case. In the next comment I'll try to overview some recent CF problems.
•  » » 7 weeks ago, # ^ |   +70 Round 631ALimitations: $n, m \le 10^5$Intended complexity: $O(n+m)$Bruteforce complexity: $O(n^m)$Ad-hoc problem, limitations could be lower, but why. BLimitations: $d \le 10^9$Intended complexity: $O(\log d)$Bruteforce complexity: $O(d^{d})$ or $O(d^{\log d})$Math. I guess there are $O(d)$ solutions which author didn't want to pass. CLimitations: $h \le 20$, but actually $n = 2^{h} \le 2^{20}$Intended complexity: $O(n \log n)$Bruteforce complexity: $O(n!)$ ?In a sense intended solution is bruteforce after sorting. I guess some people may have troubles implementing the solution not in $O(n^2)$, but I don't see a way now, no reason to lower limitations. DLimitations: $n \le 2 \cdot 10^5$Intended complexity: $O(n (A + \log n))$Bruteforce complexity: $O(n^2)$ for implementationHere idea is easier than implementation, so letting $O(n^2)$ pass doesn't make sense. ELimitations: $n \le 10^{15}$, $m \le 4 \cdot 10^{5}$Intended complexity: $O(m (\log n + \log m))$Bruteforce complexity: $O(nm)$The problem is about getting rid of $O(n)$ in complexity, optimizing $O(m^2)$ to $O(m \log m)$ after that is a cakewalk. Maybe lower $m$ would make problem better, but only slightly.4 out of 5 problems have $10^5$ somewhere, but only 1 of them has optimizing $O(n^2)$ to $O(n \log n)$ as a significant part. Global Round 7CLimitations: $n \le 2 \cdot 10^5$Intended complexity: $O(n)$Bruteforce complexity: $O(2^n)$Ad-hoc problem, limitations could be lower, but why. DLimitations: $n \le 10^6$Intended complexity: $O(n)$Bruteforce complexity: $O(n^3)$ or $O(n^2)$String problem, obviously $O(n)$ wanted. ELimitations: $n \le 3 \cdot 10^5$Intended complexity: $O(n \log n)$Bruteforce complexity: $O(n^2)$Data structure problem, optimizing $O(n^2)$ to $O(n \log n)$, but not in a straightforward way. FLimitations: $n \le 18$Intended complexity: $O(2^n (p(n) + n^2))$Bruteforce complexity: $O(2^{2n} n^2)$Beautiful problem, hardly relevant to the current discussion. GI'm not good enough to judge this crazy hard problem, but for certain it is not relevant.3 out of 5 problems have $10^5$ (or more) somewhere, 2 of them has optimizing $O(n^2)$ to $O(n \log n)$ as a significant part, but 1 of them is string problem. Ozon Tech ChallengeDLimitations: $n \le 1000$Intended complexity: $O(n^2)$Bruteforce complexity: N/AAd-hoc interactive problem, limitations could be lower, but why. ELimitations: $n \le 5000$Intended complexity: $O(n)$Bruteforce complexity: N/AConstructive problem, limitations don't matter. FLimitations: $n \le 2 \cdot 10^5$, $C \le 10^{12}$Intended complexity: $O(n \log C + \sqrt{C})$Bruteforce complexity: $O(n(n \log C + \sqrt{C}))$ after getting main ideaSolution consists of two parts: noticing solution with cost $n$, and then noticing that at least half numbers won't be moved further than 1. Maybe limitation on $n$ could be a bit lower, but it is fine as is. GLimitations: $n \le 2 \cdot 10^{5}$Intended complexity: $O(n^{log_{2} 3})$Bruteforce complexity: $O(n^2)$Main part of solution is coming up with reduction to MST which is $O(n^2)$ at first, but can be optimized. Unfortunately, there is fairly standard bruteforce approach in $O(n^2)$, so higher limitation is necessary. HI'm not good enough to judge this hard problem, but I don't think that it is obvious how to do in any polynomial.3 out of 5 problems have $10^5$ (or more) somewhere, but I don't think that any of them are "optimize $O(n^2)$" kind.Now I understand that I just wasted hour of my life and that was completely useless. I enjoy analyzing things and calculating statistics though.
•  » » 7 weeks ago, # ^ |   +142 300iq, let's stream solving some spooky data structure problem together. Um_nik is bullying me T.T
•  » » » 7 weeks ago, # ^ |   +14 Sorry :|


text:
# biblatex: reference both by chapter and at the end of the book

I currently print my references after the end of each chapter, using:

\usepackage[backend=biber,
bibencoding=utf8,
refsection=chapter,
style=numeric,
firstinits=true,
isbn=false,
doi=true,
url=false,
clearlang=true
]{biblatex}

and

\printbibliography[heading=subbibliography]

at the end of each chapter.

I would like to have also a chapter at the end of the book with all cited references. How could I do ?

• Using the numeric style that is a very dangerous idea indeed. There will be a [1] in chapter 1 and a [1] in chapter 2, but they might not necessarily be the same work. What is [1] supposed to be in the cumulative bibliography? – moewe Sep 3 '14 at 15:25

We can use refsegment instead of refsection (read about refsection and refsegment in the biblatex documentation §3.6.5 Bibliography Sections & §3.6.6 Bibliography Segments, pp. 78-79).

Instead of refsection=chapter we pass refsegment=chapter to biblatex, we also issue defernumbers=true (you can find out more about defernumbers on p. 53 of the doc).

We then have to specify the segment in the per-chapter bib manually, but this can be automated with \therefsegment, so the chapter-bibliographies are

\printbibliography[segment=\therefsegment,heading=subbibliography]

The full end-document bib is created by

\printbibliography

MWE

\documentclass{book}
\usepackage[backend=biber,
bibencoding=utf8,
refsegment=chapter,
style=numeric,
firstinits=true,
isbn=false,
doi=true,
url=false,
clearlang=true,
defernumbers=true,
]{biblatex}

\begin{document}
\tableofcontents

\chapter{Ch 1}
A citation \cite{wilde}.

\chapter{Ch 2}
And another one \cite{cicero}.

• @Napseis I used defernumbers to get [1] in the first chapter and [2] in the second. Otherwise it would have been [2] in the first and [1] in the second. As far as I understand defernumbers makes sure an entry gets a number the first time it is printed in a bibliography. Note that with refsection the numbering was local and confined to one refsection (i.e. a chapter) while refsection applies global numbering. – moewe Sep 4 '14 at 6:02
• @Napseis I'm only speculating here, but that may be because of the sorting in the bibliography, maybe a sorting=none to the global options might help there. But if it works for you without defernumbers and you notice no adverse effects, I guess it's not absolutely necessary to investigate further. If you are interested in a solution though (I know, I am), you could ask a new question with a short MWE that shows the issue (maybe not with 57 entries, probably better 3, 4 or so). – moewe Sep 4 '14 at 14:40


text:
• Mar 21st 2012, 07:16 AM
Caylie
What are the first five partial sums of the geometric series (5/8)*3^(n-1)?

Any help is appreciated!

~Caylie :)
• Mar 21st 2012, 07:43 AM
princeps
Quote:

Originally Posted by Caylie
What are the first five partial sums of the geometric series (5/8)*3^(n-1)?

Any help is appreciated!

~Caylie :)

$\displaystyle \sum_{n=1}^5 \left(\frac{5}{8} \cdot 3^{n-1}\right)=\frac{5}{8} \cdot \displaystyle \sum_{n=1}^5 3^{n-1}=\frac{5}{8} \cdot \left(3^0+3^1+3^2+3^3+3^4\right)=\frac{605}{8}$
• Mar 21st 2012, 07:52 AM
emakarov
$\displaystyle \sum_{n=1}^5 \left(\frac{5}{8} \cdot 3^{n-1}\right)=\frac{5}{8} \cdot \displaystyle \sum_{n=1}^5 3^{n-1}=\frac{5}{8} \cdot \left(3^0+3^1+3^2+3^3+3^4\right)=\frac{605}{8}$


text:
Energy Levels Finite Well

1. Sep 21, 2008

mju4t

Hi, I am trying to show that the energy levels for a finite potential well can be determined from these two equations$$\gamma$$ = kcot(-ka/2) for B=0 and $$\gamma$$ =-ktan(-ka/2) for A=0.

I think it has something to do with substituting in the value of k, but I'm not quite sure where to start....any help would be appreciated!

Thanks,
Alex

2. Sep 21, 2008

olgranpappy

What's A? What's B? What's a? What's k? What are you talking about? Try and rephrase your question in the form of a question, please...

Also, post homework questions in the Homework Forums.


text:
help-octave
[Top][All Lists]

 From: Giuseppe Marullo Subject: Dumb question about step Date: Sat, 2 Feb 2008 10:18:01 +0100

```Hi all,
I am trying to use octave to run a simulation of a PID system:

http://www.engin.umich.edu/class/ctms/matlab42/pid/pid.htm

This is the first one:

num=1;
den=[1 10 20];
step(num,den)
I get this output:
error: step: sys must be a system data structure.
error: evaluating if command near line 64, column 3
error: called from `step' in file `C:\Program
Files\Octave\share\octave\3.0.0\m\control\base\step.m'
Does not work in octave, while in matlab I get a nice graph.
I need to run simple stuff, but I need complete compatibility with
matlab(welcome to the club, I guess).


text:
Search

## You're onto something when...

Trying to figure out: 1) how to scale the operation, 2) decide whether or not to use leverage and, most importantly, 3) does it make financial sense to use Amazon EC2 compute instances?

## Combining Multiple Model Probabilities

Here's another area of work for modeling Prosper loans. How do I combine the probabilities of multiple models? I started with the brain-dead approach of using a convex combination of probabilities:

$p^* = \sum_{i=1}^{n}w_ip_i$

This can be interpretated as the coefficients directly proportional to the amount of information each model has. The optimal weights can be estimated from training data. However I am wondering if I can improve this approach and, of course, the Google is all powerful. Time for some more bed-time reading.

Risk Analysis, Vol. 19, No. 2, 1999. Combining Probability Distributions From Experts in Risk Analysis. R. T. Clemen and R. L. Winkler.

Technical Report no. 543, Department of Statistics, University of Washington, Oct 2008. Combining Probability Forecasts. R. Ranjan and T. Gneiting.

## Prosper P2P Loan Model

My latest side project has been working on modeling Prosper P2P loans. Features of the data like credit grade, income, etc. are all readily available for import (it's like they actually want you to use this data!). All of the data is imported in MySQL using a script, and then sliced and diced using R.

I created a runtime model, which is an ensemble of various machine learning models (think Netflix prize grand prize solution). The runtime model runs on a Raspberry Pi and uses the Prosper API to place bids automatically.

## Mental health is important

Since my 20s, I have been meditating on a semi-regular basis; having attended meditation classes, retreats and read multiple books on the subject.

## Why meditate?

The brain is not idempotent: as the mind thinks, the brain changes too. For example, London taxi drivers with years of navigating the twisty and confusing streets of road developed a larger hippocampus since that part of the brain is used for visual-spatial memories [Maguire et al 2006]. There is increasing evidence that meditation improves cognition [Lazar et al 2006] [Luders et al 2011]

Even after just a few days of training and practice, participants with no prior meditation experienced reduced fatigue and anxiety, together with increased mindfulness [Zeidan et al 2010]. Moreover, brief mindfulness training significantly improved visuo-spatial processing, working memory, and executive functioning.

Meditation trains your mind to treat negative situations with equanimity, which results in a natural state of calm and happiness.

Buddha’s Brain: Neuroplasticity and Meditation (online article)

Can Meditation Make You Smarter? (online article)

Evidence Builds That Meditation Strengthens the Brain (online article)

## What is meditation?

In this article, I use the word meditation to refer to Concentration (or Samatha) meditation and Insight (or Vipassana) meditation. There are multiple meditation methods, but the forms that I have practiced extensively with are breath meditation and body scanning.

Samatha is really simple, and is used in the Theravada tradition as the preliminary meditation technique to build a foundation to embark on Vipassana meditation. The practice I have learnt and practiced most extensively is the the breath meditation. Follow the sensations of the breath as it flows in through and nostrils, keeping your attention at the tip of the nostrils. Your mind may wander, but keep patiently returning to the breath.

It is not necessary to develop concentration to the point of excluding everything else except the breath. The purpose of this practice to to allow you to rein in the mind, and allow you to ntoice the workings of the mind. The entire process of gathering your attention, noticing your breath, noticing that your mind has wandered, and re-focusing you attention develops mindfulness, patience and concentration. Deep and sustained practice in Samatha allow you to reach various states of consciousness called Jhanas.

Vipassana are meditation techniques to develop mindfulness and is used to become aware of the impermanence of everything that exists. Vipassana provides you with the guidance on how to see clearly into the nature of the mind, which claims to lead to liberation. I am practicing the body sweeping meditation to develop mindfulness.

## How to practice?

My practice in my 20s has been spotty: I would diligently meditate an hour every day for a month, and then lapse into meditating once a week (maybe) for 10 minutes. Even the type of meditation would vary: one month it would be concentration meditation like breath meditation on the tip of the nostril, the next it would be Vipassana or Insight meditation by scanning the body, and yet another it would be loving kindness meditation. Heck, I even tried meditating for a period of time on a burning flame.

A few years back, I realized that this inconsistent practice meant that I was not incorporating the goal of meditation by integrating the practice into my daily life. I was riding the whims of my monkey mind and siloing the practice into a separate aspect of my life.

Unfortunately, meditation as an activity is so mind-numbingly boring (initially). Some motivation techniques suggested can be using the carrot or the stick. The carrot includes the benefits of meditation, both secular (mental wellness) and spiritual (enlightenment). The stick might be to practice “death” meditation to become aware of our morality.

One mental hack that I have learnt over the years is to institute a habit to perform a desirable activity. The label “habit” is very persuasive, especially since you are engaging in an initially undesirable activity. I currently meditate for at least 30 minutes before going to bed, and meditate on weekends for an hour. You only have a finite amount of willpower each day, so forming a habit makes it easier to carry out. How long will it take to form this habit? Research suggests that forming a meditative practice will take over two months of daily repetition before the behavior becomes a habit (and skipping single days is not detrimental in the long-term). [Lally et al 2009]

Willpower (book)

Habits: How They Form And How To Break Them (online article)

The Power of Habit (book)

## San Francisco Sourdough Bread

I have been baking bread to bring to work and someone asked for the recipe, which is modified based on ideas from Tartine Bread and The Bread Baker's Apprentice books.

## Wild Yeast Levain

• 1/4 cup sourdough starter
• 1 and 3/4 cups unbleached bread or all purpose flour
• 1/2 cup lukewarm water

Mix the ingredients by hand for a few minutes. The mix should be slightly sticky but doughlike. Transfer the starter to a work surface and knead for a minute. Transfer to a bowl with oiled surface and leave it until it has doubled in size. The temperature in my apartment falls to about 60F at night and I just leave it out on my countertop overnight. To retard the growth, you can store the levain in the refrigerator for a few days.

## Dough (makes two loaves)

• all of levain
• 1 and 3/4 cup lukewarm water
• 4 and 1/2 cup of unbleached bread or all purpose flour
• 3 teaspoons of coarse salt
• [optional] 4 tablespoons of potato flour
• [optional] nuts and seeds, about 4 tablespoons

Sift the flour and salt, then add in the levain and water. Mix by hand for a few minutes until the dough coarsely holds together and then let it rest for 5 minutes. By giving the gluten time to form the bonds, time helps me strengthen the dough and makes the next mixing and kneading steps easier.

After a short rest, continue mixing, adding flour and/or water until the dough is soft and only slightly sticky. This is also when I add the nuts and seeds. Then transfer to a work surface and knead for a few minutes.

Use stretch and fold technique to develop the dough. Let the dough rest for 10 to 30 minutes in a bowl or container, and then stretch and fold the dough. Repeat one or two more times.

After last stretch and fold, transfer to a lightly oiled bowl which is big enough for the dough to double in, and cover. Leave the bowl out for 1 to 2 hours and then leave in the refrigerator until baking day.

## Baking

I bake in the morning, so I take the dough out the night before. I leave it for 2 hours to warm to room temperature, and then I split the dough into halves. I then shape the dough and leave them overnight (about 10 hours) to proof.

In the morning, I preheat the oven to 500F for 30 minutes. The oven has two pizza stones and a metal pan. So even though the oven might say it's reached the right temperature, I do not proceed until the baking stones are warmed up too.

Turn the shaped dough onto a pizza peel, and then score it ([boule] and [batard]) just before placing it in the oven. Repeat for the other dough. Before closing the door I add one cup of hot water to the metal pan.

After one minute, I spray water to the side of the oven, and then again the next minute. I then lower the oven temperature to 450F. After 15 minutes I rotate the loaves so that the baking is even. I leave the loaves in for another 20 to 30 minutes.

 Bread with sourdough starter

## Be Credible by being Bayesian

Recently at work we encountered a problem with the "standard" way of computing confidence intervals for a Binomial proportion using the Normal approximation. That is,
At small sample sizes and high sample proportions, this is too conservative. For example, with a sample size of 10, the confidence intervals for a sample proportion of 0.8 at 95% confidence level, the confidence interval based on the Normal approximation is [0.55, 1].

We can easily see that this confidence interval is too wide as it includes p = 1.0, but we already saw 2 negative examples, which flies in the face of the evidence that p = 1.0 should be on the table.

There are many alternative confidence interval computation methods available, but one particular approach which I prefer is Bayesian: Use a Beta prior disitribution and use that to obtain a posterior distribution (Beta-Binomial). For example, using the Uniform (Uninformed) prior distribution Beta(1,1), the confidence interval (or "credible interval") is the much more plausible [0.480.94].

One of the nice properties of this approach is the subjective knowledge that is inherently available as input to the model. The hyperparameters alpha and beta can be interpreted as alpha - 1 is the number of successes and beta - 1 is the number of failures. So if we strongly believe a priori that the sample proportion is around 0.9, then we could use the Beta(10, 2) as the prior distribution instead, which gives the credible interval of [0.64, 0.95].

## The Ph.D. Grind

This is great. Highly recommended reading for current and potential Ph.D. candidates.

Philip Guo wrote a memoir documenting his Ph.D. experiences and released it online for free (http://pgbovine.net/PhD-memoir.htm).

## Four fingers back at me

So here's a change in tack since my ancecdote on "PhD jobs" (aka good technical jobs in Singapore) now turns up within the top ten results for [phd jobs singapore].

Quite simply, it is my sincere belief that there needs to be more companies where there is excellent engineer culture (*). This creates a cycle where the brightest and best will gravitate towards these areas of study. Merely having one or two successful company is not enough, you want a garden of them. Creative technology anyone?

As it turns out, Singapore is starting to have some traction as a start up hub in Southeast Asia. So entrepreneurs - make your millions and billions, and play your part in making software engineering (and technical jobs) a sexy career choice in Singapore!

p.s., I'm very contented in Google; but feel free to pitch to me if you want my opinion on getting stuff done.

(*) You want to foster a culture where innovating is the norm, and the Silicon Valley model has worked well so I am limited by this mindset, but it is certainly true that there are other ways to achieve this.

## Do I believe in this list?

According to The Times Higher Education ranking for engineering and technology universities, the National University of Singapore is ranked 19th versus the University of Waterloo which is ranked 48th.

I just picked up You.next(): Move Your Software Development Career to the Leadership Track which (at the time of this writing) is priced at $2 for the Kindle edition vs$16 for the paperback editiion. It is a very down-to-earth discussion and notes on software engineers making the leap from staying technical and doing what they do well into the mysterious black art of software engineering management.