content
string | pred_label
string | pred_score
float64 |
---|---|---|
Orbit
Sentinel-3 Mission Orbit
The Sentinel-3 orbit is similar to the orbit of Envisat allowing continuation of the ERS/Envisat time series.
Sentinel-3 uses a high inclination orbit (98.65°) for optimal coverage of ice and snow parameters in high latitudes. The orbit inclination is the angular distance of the orbital plane from the equator.
The Sentinel-3 orbit is a near-polar, sun-synchronous orbit with a descending node equatorial crossing at 10:00 h Mean Local Solar time. In a sun-synchronous orbit, the surface is always illuminated at the same sun angle.
The orbital cycle is 27 days (14+7/27 orbits per day, 385 orbits per cycle). The orbit cycle is the time taken for the satellite to pass over the same geographical point on the ground.
The two in-orbit Sentinel-3 satellites enable a short revisit time of less than two days for OLCI and less than one day for SLSTR at the equator.
The orbit reference altitude is 814.5 km.
Sentinel-3B's orbit is identical to Sentinel-3A's orbit but flies +/-140° out of phase with Sentinel-3A.
The following table contains a summary of useful orbital information for Sentinel-3:
Altitude
Inclination
Period
Cycle
Ground-track deviation
Local Time at Descending Node
814.5 km
98.65 deg
100.99 min
27 days
+- 1 km
10:00 hours
The KML data files displaying the Sentinel-3 orbit ground tracks for a complete cycle with a time step of 10 seconds are available below:
Download ASCII files with the Sentinel-3 reference latitude and longitude, for a complete cycle, with a time step of 1 second.
|
__label__pos
| 0.7749 |
I2E: Event-Driven Programming and Agents
The division of roles in object technology is clear: of the two principal constituents of a system, object types and operations, the first dominates. Classes, representing object types, determines the structure of the software; every routine, representing an operation, belongs to a class.
In some circumstances it is useful to define an object that denotes an operation. This is especially useful if you want to build an object structure that refers to operations, so that you can later traverse the structure and execute the operations encountered. A typical application is event-driven programming for Graphical User Interfaces (GUI), including Web programming. In GUI programming you will want to record properties of the form "When the user clicks this OK button, the system must update the file"
each involves a control (here the OK button), an event (mouse click) and an operation (update the file). This can be programmed by having an "event loop", triggered for each event, which performs massive decision-making (if "The latest event was `left mouse click on button 23'" then "Appropriate instructions" else if ... and so on with many branches); but this leads to bulky software architectures where introducing any new control or event requires updating a central part of the code. It's preferable to let any element of the system that encounters a new control-event-operation association [control, event, operation]
store it as a triple of objects into an object structure, such as an array or a list. Triples in that structure may come from different parts of the system; there is no central know-it-all structure. The only central element is a simple mechanism which can explore the object structure to execute each operation associated with a certain control and a certain event. The mechanism is not just simple; it's also independent of your application, since it doesn't need to know about any particular control, event or operation (it will find them in the object structure). So it can be programmed once and for all, as part of a library such as EiffelVision 2 for platform-independent graphics.
To build an object structure, we need objects. A control, an event are indeed objects. But an operation is not: it's program code -- a routine of a certain class.
Agents address this issue. An agent is an object that represents a routine, which can then be kept in an object structure. The simplest form of agent is written agent r, where r is a routine. This denotes an object. If your_agent is such an agent object, the call your_agent.call ([a, b])
where a and b are valid arguments for r, will have the same effect as a direct call to r with arguments a and b. Of course, if you know that you want to call r with those arguments, you don't need any agents; just use the direct call r (a, b). The benefit of using an agent is that you can store it into an object structure to be called later, for example when an event-driven mechanism finds the agent in the object structure, associated with a certain control and a certain event. For this reason agents are also called delayed calls.
Info: The notation [a, b] denotes a sequence of elements, or tuple. The reason call needs a tuple as argument, whereas the direct call r (a, b) doesn't, is that call is a general routine (from the EiffelBase class ROUTINE, representing agents) applicable to any agent, whereas the direct call refers explicitly to r and hence requires arguments a and b of specific types. The agent mechanism, however, is statically typed like the rest of the language; when you call call, the type checking mechanism ensures that the tuple you pass as argument contains elements a and b of the appropriate types.
A typical use of agents with EiffelVision 2 is ok_button.select_actions.extend (agent your_routine)
which says: "add your_routine to the list of operations to be performed whenever a select event (left click) happens on ok_button". ok_button.select_actions is the list of agents associated with the button and the event; in list classes, procedure extend adds an item at the end of a list. Here, the object to be added is the agent.
This enables the EiffelVision 2 event-handling mechanism to find the appropriate agent when it processes an event, and call call on that agent to trigger the appropriate routine. EiffelVision 2 doesn't know that it's your_routine; in fact, it doesn't know anything about your application. It simply finds an agent in the list, and calls call on it. For your part, as the author of a graphical application, you don't need to know how EiffelVision 2 handles events; you simply associate the desired agents with the desired controls and events, and let EiffelVision 2 do the rest.
Agents extend to many areas beyond GUIs. In numerical computation, you may use an agent to pass to an "integrator" object a numerical function to be integrated over a certain interval. In yet another area, you can use agents (as in the iteration library of EiffelBase) to program iterators : mechanisms that repetitively apply an arbitrary operation -- represented by an agent -- to every element of a list, tree or other object structure. More generally, agent embody properties of the associated routines, opening the way to mechanism for reflection, also called "introspection": the ability, during software execution, to discover properties of the software itself.
cached: 02/22/2018 10:08:48.000 PM
|
__label__pos
| 0.795902 |
How to make a function that returns a promise works correctly in a forEach loop?
advertisements
Since a function that returns a promise is asynchronous, how would you use it inside of a forEach loop? The forEach loop will almost always finish before the data being fetched or manipulated by the promise returning function can complete its data manipulation.
Here is an example of some code where I am having this problem.
var todaysTopItemsBySaleFrequency = [];
listOfItemIdsAndSaleFrequency.forEach((item) => {
Product.findById(item.itemId).then((foundItem) => {
var fullItemData = foundItem.toJSON();
fullItemData.occurrences = item.occurrences;
todaysTopItemsBySaleFrequency.push(fullItemData);
});
});
return res.status(200).json(todaysTopItemsBySaleFrequency);
The array called todaysTopItemsBySaleFrequency is sent back to the client empty. findById is a mongoose function which returns a promise, so it doesn't fully populate the array by the time the response is sent back to the client.
You cannot use a forEach loop, as that works only with functions that don't return anything. If they return something, or a promise for it, you'll have to use a map loop. You then can use Promise.all on the result, the array of promises:
Promise.all(listOfItemIdsAndSaleFrequency.map(item =>
Product.findById(item.itemId).then(foundItem => {
var fullItemData = foundItem.toJSON();
fullItemData.occurrences = item.occurrences;
return fullItemData;
})
)).then(todaysTopItemsBySaleFrequency => {
res.status(200).json(todaysTopItemsBySaleFrequency);
})
|
__label__pos
| 0.962524 |
The Non-Technical Founder’s Common Tech Terms for Building Your Product
Nolte non technical founder
In today’s digital age, having a technical co-founder isn’t the only path to turning your brilliant idea into a digital product. If you’re a non-technical founder with a vision, you can make it a reality. This article is your guide to understanding the essentials of tech, from coding languages to security, enabling you to embark on your founder journey confidently.
Common Coding Languages and Their Uses
Before diving into the intricacies of tech, let’s start with the basics by exploring the fundamental coding languages and their specific roles in software development.
HTML
HTML is the cornerstone of web content structuring, allowing you to define the structure of your web pages.
CSS
CSS (Cascading Style Sheets) complements HTML by enabling you to add style and aesthetics to your web content.
JavaScript
As a versatile and dynamic scripting language, JavaScript adds interactivity, responsiveness, and functionality to websites and web applications.
Python
Renowned for its simplicity and readability, Python finds applications in web development, data analysis, and various other fields.
Ruby
Praised for its user-friendly syntax, Ruby is a popular choice for web development and building dynamic web applications.
Frameworks and Platforms: What Are They and Why Are They Important?
Frameworks and platforms are the scaffolding upon which your digital product is constructed and streamline development processes. Here’s what you need to know.
Frameworks
Frameworks are pre-established structures provide a systematic foundation for application development. By leveraging a framework, you save valuable time and effort while ensuring best practices are followed.
Platforms
Platforms furnish the environment necessary for hosting and deploying your digital product. Platforms like AWS (Amazon Web Services) and Azure offer scalability, reliability, and security for your projects.
Understanding the Cloud and Its Components
The cloud is the digital realm where your product’s data and services reside. Here’s a closer look at its components.
Cloud Services
Offered by providers like AWS and Google Cloud, Cloud Services grant you access to scalable and flexible infrastructure for your digital product.
Data Storage
Data Storage is made up of cloud-based repositories that enable seamless storage and retrieval of your data, ensuring it remains accessible and secure.
Key Terms in Software Development
Your software development team may mention these terms when they communicate with you about your digital product. Here are their definitions.
API
API (Application Programming Interface) acts as an intermediary, allowing different software components to communicate with one another. APIs are the building blocks of modern software development.
UI/UX
UI (User Interface) & UX (User Experience) encompass the design and user-friendliness of your product. A well-crafted UI/UX is vital for user satisfaction and engagement.
Frontend and Backend
Frontend deals with the visual aspects and user interactions, while the Backend manages the underlying processes, databases, and server-side operations.
Database Basics: SQL vs. NoSQL
Databases serve as the repository for your digital product’s data. Two primary database types are SQL and NoSQL.
SQL
SQL (Structured Query Language) databases excel at managing structured data. They are reliable, ensure data integrity, and are often used in complex data systems.
NoSQL
NoSQL (Not Only SQL) databases are renowned for their flexibility, making them suitable for handling unstructured or semi-structured data. They are preferred for projects requiring scalability and quick iterations.
The Difference Between Web Apps, Mobile Apps, and Desktop Apps
Understanding the various application types is pivotal to your non-technical founder journey.
Web Apps
Web Applications run within web browsers, making them accessible across various devices with internet connectivity.
Mobile Apps
Mobile Apps are specifically designed for smartphones and tablets, mobile apps offer a tailored user experience, taking advantage of mobile device capabilities.
Desktop Apps
Desktop Apps are installed directly on computers and laptops, desktop apps provide more robust functionality and offline capabilities.
Security Essentials: Encryption, Two-Factor Authentication, VPN
Ensuring the security of your digital product is paramount.
Encryption
Encryption is a security measure that protects your data from unauthorized access by converting it into unreadable code that can only be deciphered with the correct encryption key.
Two-Factor Authentication
Adding an extra layer of security, 2FA (Two-Factor Authentication) requires users to provide two forms of verification before granting access, significantly enhancing security.
VPN
VPNs (Virtual Private Network) are indispensable for safeguarding your online activities by creating secure, encrypted connections, particularly when using public Wi-Fi networks.
Now that you’ve gained a profound understanding of these tech essentials, you’re better prepared to embark on your digital product journey. Remember, learning is an ongoing process, and you don’t need to become a tech guru overnight.
Collaboration with tech-savvy individuals and maintaining curiosity will be your allies in this exciting endeavor. Becoming a non-technical founder and creating a digital product is not only feasible but also a rewarding journey. Embrace the learning process, seek guidance when needed, and stay curious. Your determination and vision can transform your ideas into reality in the digital realm.
FAQs
1. Is it necessary to learn coding languages as a non-technical founder?
While it’s not mandatory, having a basic understanding can significantly enhance communication with your development team and help you make informed decisions.
2. What are the advantages of using a framework in development?
Frameworks provide a structured, efficient foundation for your project, reducing development time and ensuring best practices are followed.
3. How can I ensure the security of my digital product?
Implement robust security measures such as encryption, two-factor authentication (2FA), and consider using a Virtual Private Network (VPN) to protect your product and user data.
4. Which database type, SQL or NoSQL, is more suitable for my project?
The choice depends on your project’s specific requirements and data structure. Consult with experts or your development team to make an informed decision.
5. Can I successfully build a digital product without a technical co-founder?
Absolutely! Many successful digital products have been created by non-technical founders. By partnering with a vetted technical partner like Nolte, you can successfully launch a digital product with full control over your vision.
Subscribe to our Newsletter!
Let’s build together. Subscribe to our newsletter and we’ll send our best content to your inbox.
Leave a Reply
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.86296 |
A variety of different conditions can cause rashes and itchy skin. Eczema is by far the most common cause of itchy skin, but allergies to various compounds can cause a similar itchy rash. Other causes of itchy skin include medication reactions, fungal infections, scabies infestation, Grover’s disease, lichen planus and rarer conditions such as bullous pemphigoid. Patients that develop itchy skin without developing a rash need appropriate investigation. Xerosis, the medical term for dry skin, is often an exacerbating factor in itchy skin. Regular use of moisturisers, avoiding soaps and hot water (which strips natural, nourishing oils off the skin) are key to managing xerosis.
Specialist Skin Services
As an all-round specialist dermatology clinic, we work with our patients to achieve their goals and always maintain professional standards.
|
__label__pos
| 0.924102 |
Nomogram and scoring system for predicting stone-free status after extracorporeal shock wave lithotripsy in children with urolithiasis
Onal B. , Tansu N., Demirkesen O., Yalcin V., Huang L., Nguyen H. T. , et al.
BJU INTERNATIONAL, cilt.111, ss.344-352, 2013 (SCI İndekslerine Giren Dergi)
Özet
What's known on the subject? and What does the study add? Extracorporeal shock wave lithotripsy is often considered to be the first-line treatment method for the majority of urinary tract stone disease in children. The stone clearance rate in children treated with ESWL is higher than that in adults. Recently, nomograms for several diseases, e.g. for specific cancers, have been developed and validated in large patient populations. They have become very popular predictive tools that provide the most objective, evidence-based, and individualized risk estimation. These nomograms have gained acceptance as useful guides in clinical practice for use by physicians and patients. In adults, a nomogram has been created to predict stone-free outcome after ESWL; however, to our knowledge none has been developed for children with urolithiasis. This is the first study-generated nomogram table and scoring system for predicting the stone-free rate after ESWL in children. This predictive tool could be useful for clinicians in counselling the parents of children with urolithiasis and in recommending treatment. Objective To determine the stone-free rate after extracorporeal shock wave lithotripsy (ESWL) and its associated factors to formulate a nomogram table and scoring system to predict the probability of stone-free status in children. Patients and Methods A total of 412 children (427 renal units [RUs]) with urolithiasis were treated with ESWL using a lithotriptor between 1992 and 2008. Cox proportional hazards regression was used to model the number of treatment sessions to stone-free status as a function of statistically significant demographic characteristics, stones and treatment variables. A bootstrap method was used to evaluate the model's performance. Based on the multivariate model, the probabilities of being stone-free after each treatment session (1, 2 and >3) were then determined. A scoring system was created from the final multivariate proportional hazard model to evaluate each patient and predict their stone-free probabilities. Results Complete data were available for 395 RUs in 381 patients. Of the 395 RUs, 303 (76.7%) were considered to be stone-free after ESWL. Multivariate analysis showed that previous history of ipsilateral stone treatment is related to stone-free status (hazard ratio [HR]: 1.49; P = 0.03). Stone location was a significant variable for stone-free status, but only in girls. Age (HR 1.65, P = 0.02) and stone burden (HR 4.45, P = 0.002) were significant factors in the multivariate model. Conclusion We believe that the scoring system, and nomogram table generated, will be useful for clinicians in counselling the parents of children with urolithiasis and in recommending treatment.
|
__label__pos
| 0.820449 |
This documentation is archived and is not being maintained.
Working with DataTable Events
The DataTable object provides a series of events that can be processed by an application. The following table describes DataTable events.
Event Description
Initialized
Occurs after the EndInit method of a DataTable is called. This event is intended primarily to support design-time scenarios.
ColumnChanged
Occurs after a value has been successfully changed in a DataColumn.
ColumnChanging
Occurs when a value has been submitted for a DataColumn.
RowChanged
Occurs after a DataColumn value or the RowState of a DataRow in the DataTable has been changed successfully.
RowChanging
Occurs when a change has been submitted for a DataColumn value or the RowState of a DataRow in the DataTable.
RowDeleted
Occurs after a DataRow in the DataTable has been marked as Deleted.
RowDeleting
Occurs before a DataRow in the DataTable is marked as Deleted.
TableCleared
Occurs after a call to the Clear method of the DataTable has successfully cleared every DataRow.
TableClearing
Occurs after the Clear method is called but before the Clear operation begins.
TableNewRow
Occurs after a new DataRow is created by a call to the NewRow method of the DataTable.
Disposed
Occurs when the DataTable is Disposed. Inherited from MarshalByValueComponent.
NoteNote
Most operations that add or delete rows do not raise the ColumnChanged and ColumnChanging events. However, the ReadXml method does raise ColumnChanged and ColumnChanging events, unless the XmlReadMode is set to DiffGram or is set to Auto when the XML document being read is a DiffGram.
Additional Related Events
The Constraints property holds a ConstraintCollection instance. The ConstraintCollection class exposes a CollectionChanged event. This event fires when a constraint is added, modified, or removed from the ConstraintCollection.
The Columns property holds a DataColumnCollection instance. The DataColumnCollection class exposes a CollectionChanged event. This event fires when a DataColumn is added, modified, or removed from the DataColumnCollection. Modifications that cause the event to fire include changes to the name, type, expression or ordinal position of a column.
The Tables property of a DataSet holds a DataTableCollection instance. The DataTableCollection class exposes both a CollectionChanged and a CollectionChanging event. These events fire when a DataTable is added to or removed from the DataSet.
Changes to DataRows can also trigger events for an associated DataView. The DataView class exposes a ListChanged event that fires when a DataColumn value changes or when the composition or sort order of the view changes. The DataRowView class exposes a PropertyChanged event that fires when an associated DataColumn value changes.
Sequence of Operations
Here is the sequence of operations that occur when a DataRow is added, modified, or deleted:
1. Create the proposed record and apply any changes.
2. Check constraints for non-expression columns.
3. Raise the RowChanging or RowDeleting events as applicable.
4. Set the proposed record to be the current record.
5. Update any associated indexes.
6. Raise ListChanged events for associated DataView objects and PropertyChanged events for associated DataRowView objects.
7. Evaluate all expression columns, but delay checking any constraints on these columns.
8. Raise ListChanged events for associated DataView objects and PropertyChanged events for associated DataRowView objects affected by the expression column evaluations.
9. Raise RowChanged or RowDeleted events as applicable.
10. Check constraints on expression columns.
NoteNote
Changes to expression columns never raise DataTable events. Changes to expression columns only raise DataView and DataRowView events. Expression columns can have dependencies on multiple other columns, and can be evaluated multiple times during a single DataRow operation. Each expression evaluation raises events, and a single DataRow operation can raise multiple ListChanged and PropertyChanged events when expression columns are affected, possibly including multiple events for the same expression column.
Example
The following example demonstrates how to create event handlers for the RowChanged, RowChanging, RowDeleted, RowDeleting, ColumnChanged, ColumnChanging, TableNewRow, TableCleared, and TableClearing events. Each event handler displays output in the console window when it is fired.
static void DataTableEvents()
{
DataTable table = new DataTable("Customers");
// Add two columns, id and name.
table.Columns.Add("id", typeof(int));
table.Columns.Add("name", typeof(string));
// Set the primary key.
table.Columns["id"].Unique = true;
table.PrimaryKey = new DataColumn[] { table.Columns["id"] };
// Add a RowChanged event handler.
table.RowChanged += new DataRowChangeEventHandler(Row_Changed);
// Add a RowChanging event handler.
table.RowChanging += new DataRowChangeEventHandler(Row_Changing);
// Add a RowDeleted event handler.
table.RowDeleted += new DataRowChangeEventHandler(Row_Deleted);
// Add a RowDeleting event handler.
table.RowDeleting += new DataRowChangeEventHandler(Row_Deleting);
// Add a ColumnChanged event handler.
table.ColumnChanged += new
DataColumnChangeEventHandler(Column_Changed);
// Add a ColumnChanging event handler.
table.ColumnChanging += new
DataColumnChangeEventHandler(Column_Changing);
// Add a TableNewRow event handler.
table.TableNewRow += new
DataTableNewRowEventHandler(Table_NewRow);
// Add a TableCleared event handler.
table.TableCleared += new
DataTableClearEventHandler(Table_Cleared);
// Add a TableClearing event handler.
table.TableClearing += new
DataTableClearEventHandler(Table_Clearing);
// Add a customer.
DataRow row = table.NewRow();
row["id"] = 1;
row["name"] = "Customer1";
table.Rows.Add(row);
table.AcceptChanges();
// Change the customer name.
table.Rows[0]["name"] = "ChangedCustomer1";
// Delete the row.
table.Rows[0].Delete();
// Clear the table.
table.Clear();
}
private static void Row_Changed(object sender, DataRowChangeEventArgs e)
{
Console.WriteLine("Row_Changed Event: name={0}; action={1}",
e.Row["name"], e.Action);
}
private static void Row_Changing(object sender, DataRowChangeEventArgs e)
{
Console.WriteLine("Row_Changing Event: name={0}; action={1}",
e.Row["name"], e.Action);
}
private static void Row_Deleted(object sender, DataRowChangeEventArgs e)
{
Console.WriteLine("Row_Deleted Event: name={0}; action={1}",
e.Row["name", DataRowVersion.Original], e.Action);
}
private static void Row_Deleting(object sender,
DataRowChangeEventArgs e)
{
Console.WriteLine("Row_Deleting Event: name={0}; action={1}",
e.Row["name"], e.Action);
}
private static void Column_Changed(object sender, DataColumnChangeEventArgs e)
{
Console.WriteLine("Column_Changed Event: ColumnName={0}; RowState={1}",
e.Column.ColumnName, e.Row.RowState);
}
private static void Column_Changing(object sender, DataColumnChangeEventArgs e)
{
Console.WriteLine("Column_Changing Event: ColumnName={0}; RowState={1}",
e.Column.ColumnName, e.Row.RowState);
}
private static void Table_NewRow(object sender,
DataTableNewRowEventArgs e)
{
Console.WriteLine("Table_NewRow Event: RowState={0}",
e.Row.RowState.ToString());
}
private static void Table_Cleared(object sender, DataTableClearEventArgs e)
{
Console.WriteLine("Table_Cleared Event: TableName={0}; Rows={1}",
e.TableName, e.Table.Rows.Count.ToString());
}
private static void Table_Clearing(object sender, DataTableClearEventArgs e)
{
Console.WriteLine("Table_Clearing Event: TableName={0}; Rows={1}",
e.TableName, e.Table.Rows.Count.ToString());
}
See Also
Show:
|
__label__pos
| 0.756966 |
返回首页
0
0
趣题:圆内接八边形的面积
admin 发表于 2014年09月22日 21:09 | Hits: 2107
Tag: 几何 | Uncategorized | 趣题 | 大发排列3官网
一个圆内接八边形,各边长度依次为 2, 2, 2, 2, 3, 3, 3, 3 。求这个八边形的面积。
假设圆的半径为 R 。整个八边形是由 4 个三边分别为 3, R, R 的三角形和 4 个三边分别为 2, R, R 的三角形组成。如果我们重新摆放这 8 个三角形,让这两种三角形交替出现的话,整个图形的面积是不会变的。然而,新的八边形相当于是一个边长为 3 + 2√2的正方形去掉了 4 个直角边为 √2的等腰直角三角形以后所得的图形。它的面积是 (3 + 2√2)2– 4 = 13 + 12√2。
这是 1978 年 Putnam 数学竞赛的 B1 题。我是在 Proofs Without Words II – More Exercises in Visual Thinking 一书里看到的题目及其解法。
原文链接: 大发排列3注册
0 0
评价列表(0)
返回首页
|
__label__pos
| 0.879062 |
Unveiling the Remarkable Functions of the Esophagus: Understanding Its Vital Role in Digestion
The esophagus is a muscular tube that connects the throat to the stomach, playing a crucial role in the process of digestion. It serves as a conduit for food and liquids, allowing them to pass from the mouth to the stomach for further processing. In this article, we will explore the functions of the esophagus, understanding its vital role in digestion and how it contributes to the overall well-being of an individual.
Function 1: Food Transport
The primary function of the esophagus is to transport food and liquids from the mouth to the stomach. When we swallow, the muscles in the esophagus contract in a coordinated manner, propelling the food bolus downward through a series of rhythmic contractions known as peristalsis. This movement allows the food to bypass the throat and safely reach the stomach for further digestion.
Function 2: Mucus Secretion
The esophagus also plays a role in mucus secretion. Specialized cells within the lining of the esophagus produce mucus, a slippery substance that helps lubricate and protect the walls of the esophagus. This mucus layer prevents friction and damage as food passes through the esophagus, ensuring smooth and efficient transport.
Function 3: Prevention of Acid Reflux
Another important function of the esophagus is to prevent acid reflux. At the junction between the esophagus and the stomach, there is a muscular ring called the lower esophageal sphincter (LES). The LES acts as a valve, opening to allow food to enter the stomach and closing to prevent stomach acid from flowing back into the esophagus. This mechanism helps protect the delicate lining of the esophagus from the corrosive effects of stomach acid.
Function 4: Sensory Perception
The esophagus is involved in sensory perception related to swallowing and digestion. Nerve endings within the esophagus detect the presence of food and liquids, triggering the swallowing reflex. This reflex initiates the coordinated contraction of the esophageal muscles and the relaxation of the LES, allowing the food to pass through. Additionally, the esophagus can sense discomfort or irritation, signaling the brain to initiate protective responses such as coughing or clearing the throat.
Function 5: Passage of Air
Although the primary function of the esophagus is to transport food, it also allows for the passage of air during burping or belching. When excess air accumulates in the stomach or upper digestive tract, it can be released by a voluntary or involuntary relaxation of the upper esophageal sphincter. This allows the air to travel up the esophagus and be expelled through the mouth, providing relief from discomfort.
Frequently Asked Questions (FAQ)
Q1: Can the esophagus become blocked or obstructed?
A1: Yes, the esophagus can become blocked or obstructed, leading to difficulty in swallowing. This condition is known as esophageal obstruction or dysphagia. It can be caused by various factors, including structural abnormalities, tumors, strictures, or the presence of foreign objects. Treatment options depend on the underlying cause and may include medication, dilation procedures, or surgical intervention.
Q2: Are there any diseases or conditions associated with the esophagus?
A2: Yes, there are several diseases and conditions that can affect the esophagus. Examples include gastroesophageal reflux disease (GERD), esophagitis, Barrett’s esophagus, and esophageal cancer. GERD is a chronic condition characterized by the reflux of stomach acid into the esophagus, causing symptoms such as heartburn and acid regurgitation. Esophagitis refers to inflammation of the esophagus, often caused by GERD or infections. Barrett’s esophagus is a condition where the lining of the esophagus changes, increasing the risk of esophageal cancer. Esophageal cancer refers to the development of cancerous tumors in the esophagus. These conditions may require medical management and treatment.
Q3: How can I maintain the health of my esophagus?
A3: Maintaining the health of your esophagus is essential for proper digestion and overall well-being. Here are some tips to support the health of your esophagus:
1. Practice mindful eating: Chew your food thoroughly and eat at a relaxed pace. This helps ensure that food is properly broken down before swallowing, reducing the strain on the esophagus.
2. Maintain a healthy weight: Excess weight can put pressure on the abdomen, increasing the risk of acid reflux and esophageal issues. Maintain a healthy weight through a balanced diet and regular exercise.
3. Avoid trigger foods and beverages: Certain foods and beverages, such as spicy foods, citrus fruits, and carbonated drinks, can trigger acid reflux and irritate the esophagus. Identify your personal triggers and limit their consumption.
4. Quit smoking: Smoking can weaken the lower esophageal sphincter and increase the risk of acid reflux. Quitting smoking not only benefits your esophageal health but also improves your overall well-being.
5. Manage stress: Chronic stress can contribute to digestive issues, including esophageal problems. Find healthy ways to manage stress, such as practicing relaxation techniques, exercising, or seeking support from a therapist.
Q4: Can lifestyle changes help alleviate symptoms of acid reflux?
A4: Yes, lifestyle changes can often help alleviate symptoms of acid reflux and improve esophageal health. Some recommended changes include:
1. Elevate the head of your bed: Raising the head of your bed by 6 to 8 inches can help prevent stomach acid from flowing back into the esophagus during sleep.
2. Avoid eating before bedtime: Allow at least 2 to 3 hours between your last meal and bedtime to give your stomach enough time to empty.
3. Wear loose-fitting clothing: Tight clothing, especially around the waist, can put pressure on the abdomen and increase the risk of acid reflux. Opt for loose-fitting clothing to reduce this pressure.
4. Limit alcohol consumption: Alcohol can relax the lower esophageal sphincter and worsen acid reflux symptoms. Limit your alcohol intake or avoid it altogether.
5. Practice portion control: Overeating can put pressure on the stomach and increase the likelihood of acid reflux. Practice portion control and eat smaller, more frequent meals throughout the day.
Q5: When should I seek medical attention for esophageal symptoms?
A5: It is advisable to seek medical attention if you experience persistent or severe esophageal symptoms. These may include difficulty swallowing, chest pain, unexplained weight loss, frequent heartburn, or persistent coughing. A healthcare professional can evaluate your symptoms, perform diagnostic tests if necessary, and provide appropriate treatment options.
Conclusion
The esophagus is a remarkable organ with multiple functions that contribute to the process of digestion. From transporting food to preventing acid reflux and facilitating the passage of air, the esophagus plays a vital role in maintaining our overall well-being. By understanding its functions and taking steps to support its health, we can ensure optimal digestion and a healthy esophageal system. Remember to practice mindful eating, maintain a healthy lifestyle, and seek medical attention when needed to keep your esophagus in top condition.
Related Posts
|
__label__pos
| 0.999559 |
Matter makes up everything, everywhere. All matter, both living and non-living, is composed of miniature chemical building blocks called atoms. Your body contains billions of hydrogen, oxygen, nitrogen, phosphorus, sulfur and carbon atoms.
What is life? What does it mean to be alive? How is something made “living”?
There is no universal agreement on what life is. However, scientists generally accept that the biological manifestation of life exhibits seven specific characteristics. In order for something to be described as living, that something must display all seven of those characteristics.
Biology is the study of life. But what is life? All living organisms share the following characteristics. These characteristics of life can be remembered with the use of “GRAMMIC”.
All Living Things …
1. Grow
A growing organism increases in size in all of its parts, rather than simply accumulating matter. The particular species begins to multiply and expand as the evolution continues to flourish.
2. Reproduce.
All living organisms reproduce to produce new organisms, either by sexual or asexual means.
3. Adaptation
Living organisms adapt to their environment and evolve.
4. Movement
Living things have moving parts or processes. Examples include the following processes cytoplasmic flow, cilia, flagella, muscles.
5. Metabolism … depend on chemical reactions and require energy.
Living organisms require chemical processes to maintain life. They use energy to carry out energy-requiring activities such as digestion, reproduction, cellular processes and locomotion.
6. Irritability… respond to stimuli.
A response can take many forms, but a response is often expressed by motion, for example, the leaves of a plant turning toward the sun or an animal chasing its prey
7. Cells
Cells are the basic components of all living things. If it doesn’t have cells its not alive. Some organisms are single-celled, like bacteria, or multi-celled, like humans.
Related Articles
Leave a Reply
avatar
|
__label__pos
| 0.996218 |
The Association Between Plasma 25-Hydroxyvitamin D3 Concentrations, C-reactive Protein Levels, and Coronary Artery Atherosclerosis in Postmenopausal Monkeys.
Document Type
Article
Publication Date
10-1-2012
Abstract
OBJECTIVE: The aim of this study was to identify the potential relationships between plasma 25-hydroxyvitamin D(3) (25OHD(3)), C-reactive protein (CRP), coronary artery atherosclerosis (CAA), and coronary artery remodeling in monkeys consuming atherogenic diets.
METHODS: Female cynomolgus monkeys (n = 74) were fed a casein-lactalbumin (C/L)-based, moderately atherogenic diet for 12 months. They then consumed either a soy-based (n = 35) or C/L-based (n = 39) diet for 32 months. CRP concentrations were then determined, and monkeys underwent surgical menopause. Each diet group was then rerandomized to receive soy (n = 36) or C/L (n = 38). After 32 postmenopausal months, 25OHD(3), CRP, CAA, and coronary artery remodeling were determined. All monkeys received a woman's equivalent of 1,000 IU/day of vitamin D(3) and 1,200 mg/day of calcium throughout the study.
RESULTS: The premenopausal and postmenopausal dietary protein sources had no effect on postmenopausal 25OHD(3) concentrations (P = 0.6). Across treatment groups, there was a statistically significant inverse relationship between 25OHD(3) concentrations and CRP at necropsy (r = -0.35, P = 0.003). A significant inverse correlation between 25OHD(3) concentration and the change in CRP from premenopause to postmenopause was observed (r = -0.32, P = 0.007). The significant associations identified between plasma 25OHD(3) and CRP remained after controlling for postmenopausal diet. Those monkeys with a greater increase in CRP also had significantly more CAA and less ability to maintain normal lumens by remodeling.
CONCLUSIONS: Higher plasma concentrations of 25OHD(3) were associated with lower CRP. Lower CRP was associated with less coronary atherosclerosis and improved coronary artery remodeling. These findings suggest that 25OHD(3) concentrations are associated with an anti-inflammatory state and may support an association between oral vitamin D3 and cardioprotection.
Publication Title
Menopause (New York, N.Y.)
Volume
19
Issue
10
First Page
1074
Last Page
1080
Share
COinS
|
__label__pos
| 0.986487 |
id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 17706,Improve short description example in Tutorial 2,Fernando Gutierrez,nobody,In the Customize admin change list section there is an example that shows how to add a different description for the method in the Change list header. It doesn't show the indentation required relative to the class Poll. Attached is the improved version showing the class Poll like other examples in the same tutorial shows the class PollAdmin for example.,Cleanup/optimization,closed,Documentation,1.4-beta-1,Normal,fixed,,,Ready for checkin,1,0,0,0,1,0
|
__label__pos
| 0.992219 |
Chapter 19: Complex Reaction Mechanism
Example Problem: 19.1, Page Number 501
In [9]:
import numpy as np
from numpy import arange,array,ones,linalg
from matplotlib.pylab import plot,show
%matplotlib inline
#Variable declaration
Ce = 2.3e-9 #Initial value of enzyme concentration, M
r = array([2.78e-5,5.e-5,8.33e-5,1.67e-4])
CCO2 = array([1.25e-3,2.5e-3,5.e-3,20.e-3])
#Calculations
rinv = 1./r
CCO2inv = 1./CCO2
xlim(0,850)
ylim(0,38000)
xi = CCO2inv
A = array([ CCO2inv, ones(size(CCO2inv))])
# linearly generated sequence
w = linalg.lstsq(A.T,rinv)[0] # obtaining the parameters
slope = w[0]
intercept = w[1]
line = w[0]*CCO2inv+w[1] # regression line
plot(CCO2inv,line,'r-',CCO2inv,rinv,'o')
xlabel('$ {C_{CO}}_2, mM^{-1} $')
ylabel('$ Rate^{-1}, s/M^{-1} $')
show()
rmax = 1./intercept
k2 = rmax/Ce
Km = slope*rmax
#Results
print 'Km and k2 are %4.1f mM and %3.1e s-1'%(Km*1e3,k2)
Km and k2 are 10.0 mM and 1.1e+05 s-1
Example Problem: 19.2, Page Number 507
In [11]:
from numpy import arange,array,ones,linalg
from matplotlib.pylab import plot,show
%matplotlib inline
#Variable declaration
Vads = array([5.98,7.76,10.1,12.35,16.45,18.05,19.72,21.1]) #Adsorption data at 193.5K
P = array([2.45,3.5,5.2,7.2,11.2,12.8,14.6,16.1]) #Pressure, torr
#Calculations
Vinv = 1./Vads
Pinv =1./P
xlim(0,0.5)
ylim(0,0.2)
A = array([ Pinv, ones(size(Pinv))])
# linearly generated sequence
w = linalg.lstsq(A.T,Vinv)[0] # obtaining the parameters
m = w[0]
c = w[1]
line = m*Pinv+c # regression line
plot(Pinv,line,'r-',Pinv,Vinv,'o')
xlabel('$ 1/P, Torr^{-1} $')
ylabel('$ 1/V_{abs}, cm^{-1}g $')
show()
Vm = 1./c
K = 1./(m*Vm)
#Results
print 'Slope and intercept are %5.4f torr.g/cm3 and %5.4f g/cm3'%(m,c)
print 'K and Vm are %4.2e Torr^-1 and %3.1f cm3/g'%(K,Vm)
Slope and intercept are 0.3449 torr.g/cm3 and 0.0293 g/cm3
K and Vm are 8.48e-02 Torr^-1 and 34.2 cm3/g
Example Problem: 19.4, Page Number 520
In [19]:
from numpy import arange,array,ones,linalg
from matplotlib.pylab import plot,show
%matplotlib inline
#Variable declaration
CBr = array([0.0005,0.001,0.002,0.003,0.005]) #C6Br6 concentration, M
tf = array([2.66e-7,1.87e-7,1.17e-7,8.50e-8,5.51e-8]) #Fluroscence life time, s
#Calculations
Tfinv = 1./tf
xlim(0,0.006)
ylim(0,2.e7)
A = array([ CBr, ones(size(CBr))])
# linearly generated sequence
[m,c] = linalg.lstsq(A.T,Tfinv)[0] # obtaining the parameters
line = m*CBr+c # regression line
plot(CBr,line,'r-',CBr,Tfinv,'o')
xlabel('$ Br_6C_6, M $')
ylabel('$ tau_f $')
show()
#Results
print 'Slope and intercept are kq = %5.4e per s and kf = %5.4e per s'%(m,c)
Slope and intercept are kq = 3.1995e+09 per s and kf = 2.1545e+06 per s
Example Problem: 19.5, Page Number 523
In [21]:
from scipy.optimize import root
#Variable Declaration
r = 11. #Distance of residue separation, °A
r0 = 9. #Initial Distance of residue separation, °A
EffD = 0.2 #Fraction decrease in eff
#Calculations
Effi = r0**6/(r0**6+r**6)
Eff = Effi*(1-EffD)
f = lambda r: r0**6/(r0**6+r**6) - Eff
sol = root(f, 12)
rn = sol.x[0]
#Results
print 'Separation Distance at decreased efficiency %4.2f'%rn
Separation Distance at decreased efficiency 11.53
Example Problem: 19.6, Page Number 525
In [4]:
#Variable Declarations
mr = 2.5e-3 #Moles reacted, mol
P = 100.0 #Irradiation Power, J/s
t = 27 #Time of irradiation, s
h = 6.626e-34 #Planks constant, Js
c = 3.0e8 #Speed of light, m/s
labda = 280e-9 #Wavelength of light, m
#Calculation
Eabs = P*t
Eph = h*c/labda
nph = Eabs/Eph #moles of photone
phi = mr/6.31e-3
#Results
print 'Total photon energy absorbed by sample %3.1e J'%Eabs
print 'Photon energy absorbed at 280 nm is %3.1e J'%Eph
print 'Total number of photon absorbed by sample %3.1e photones'%nph
print 'Overall quantum yield %4.2f'%phi
Total photon energy absorbed by sample 2.7e+03 J
Photon energy absorbed at 280 nm is 7.1e-19 J
Total number of photon absorbed by sample 3.8e+21 photones
Overall quantum yield 0.40
Example Problem: 19.7, Page Number 530
In [9]:
from math import exp
#Variable Declarations
r = 2.0e9 #Rate constant for electron transfer, per s
labda = 1.2 #Gibss energy change, eV
DG = -1.93 #Gibss energy change for 2-naphthoquinoyl, eV
k = 1.38e-23 #Boltzman constant, J/K
T = 298.0 #Temeprature, K
#Calculation
DGS = (DG+labda)**2/(4*labda)
k193 = r*exp(-DGS*1.6e-19/(k*T))
#Results
print 'DGS = %5.3f eV'%DGS
print 'Rate constant with barrier to electron transfer %3.2e per s'%k193
DGS = 0.111 eV
Rate constant with barrier to electron transfer 2.66e+07 per s
|
__label__pos
| 0.984791 |
Control of basal autophagy rate by <i>vacuolar peduncle</i>
<div><p>Basal autophagy is as a compressive catabolic mechanism engaged in the breakdown of damaged macromolecules and organelles leading to the recycling of elementary nutrients. Thought essential to cellular refreshing, little is known about the origin of a constitutional rate of basal autophagy. Here, we found that loss of <i>Drosophila vacuolar peduncle</i> (<i>vap</i>), a presumed GAP enzyme, is associated with enhanced basal autophagy rate and physiological alterations resulting in a wasteful cell energy balance, a hallmark of overactive autophagy. By contrast, starvation-induced autophagy was disrupted in <i>vap</i> mutant conditions, leading to a block of maturation into autolysosomes. This phenotype stem for exacerbated biogenesis of PI(3)P-dependent endomembranes, including autophagosome membranes and ectopic fusions of vesicles. These findings shed new light on the neurodegenerative phenotype found associated to mutant <i>vap</i> adult brains in a former study. A partner of Vap, Sprint (Spri), acting as an endocytic GEF for Rab5, had the converse effect of leading to a reduction in PI(3)P-dependent endomembrane formation in mutants. <i>Spri</i> was conditional to normal basal autophagy and instrumental to the starvation-sensitivity phenotype specific of <i>vap</i>. Rab5 activity itself was essential for PI(3)P and for pre-autophagosome structures formation. We propose that Vap/Spri complexes promote a cell surface-derived flow of endocytic Rab5-containing vesicles, the traffic of which is crucial for the implementation of a basal autophagy rate.</p></div>
|
__label__pos
| 0.993083 |
0 follower
Class yii\helpers\Json
Inheritanceyii\helpers\Json » yii\helpers\BaseJson
Available since version2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/helpers/Json.php
Json is a helper class providing JSON data encoding and decoding.
It enhances the PHP built-in functions json_encode() and json_decode() by supporting encoding JavaScript expressions and throwing exceptions when decoding fails.
Public Properties
Hide inherited properties
PropertyTypeDescriptionDefined By
$jsonErrorMessages array yii\helpers\BaseJson
Public Methods
Hide inherited methods
MethodDescriptionDefined By
decode() Decodes the given JSON string into a PHP data structure. yii\helpers\BaseJson
encode() Encodes the given value into a JSON string. yii\helpers\BaseJson
errorSummary() Generates a summary of the validation errors. yii\helpers\BaseJson
htmlEncode() Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code. yii\helpers\BaseJson
Protected Methods
Hide inherited methods
MethodDescriptionDefined By
handleJsonError() Handles encode() and decode() errors by throwing exceptions with the respective error message. yii\helpers\BaseJson
processData() Pre-processes the data before sending it to json_encode(). yii\helpers\BaseJson
|
__label__pos
| 0.935029 |
%A Zhang Li;Wang Jin-Ben;Liu Ming-Hua %T Supramolecular Assembly and Chirality of a Complex Film between Achiral TPPS and a Gemini Surfactant at the Air/water Interface %0 Journal Article %D 2004 %J Acta Phys. -Chim. Sin. %R 10.3866/PKU.WHXB20040407 %P 368-372 %V 20 %N 04 %U {http://www.whxb.pku.edu.cn/CN/abstract/article_25542.shtml} %8 2004-04-15 %X Supramolecular assembly and chirality between a novel gemini surfactant (C12H24-α,ω-(C12H25N+(CH3)2Br-)2), (abbreviated as C12-C12-C12) and TPPS (tetrakis(4-sulfonatophenyl) porphine) at the air/water interface were investigated. It was found that although the gemini surfactant itself could not form a stable monolayer at the air/water interface, when there existed TPPS in the subphase, a stable complex monolayer could be formed. The complex monolayer could be transferred onto solid substrate by a horizontal lifting method. At a certain pH value of the subphase, TPPS could form a J-aggregate. It was further found that the J-aggregate of TPPS showed a strong split Cotton effect in the transferred film although both the gemini surfactant and TPPS are achiral. Further investigation through AFM measurements revealed that the nanothread formed in the transferred film was responsible for the chirality of the multilayer film. In addition, the two positive charge center of the gemini surfactant did not necessarily play the cooperative role in inducing the chirality of TPPS J-aggregate.
|
__label__pos
| 0.965963 |
Speech for Fest
Topics: Electric double-layer capacitor, Electric vehicle, Capacitor Pages: 2 (753 words) Published: April 5, 2013
Abstract of SuperCapacitor
Supercapacitor also known as electric double-layer capacitor (EDLC),electrochemical double layer capacitor, or ultracapacitors, is an electrochemical capacitor with relatively high energy density. Compared to conventional electrolytic capacitors the energy density is typically on the order of hundreds of times greater. In comparison with conventional batteries or fuel cells, EDLCs also have a much higher power density. In this article the use of super capacitors likes hybrid power supply for various applications is presented. The main application is in the field of automation. The specific Power of the super capacitors and its high lifetime (1 million of Cycles) makes it very attractive for the startup of the automobiles. Unfortunately, the specific energy of this component is very low. For that this technology is associated with battery to supply the starter alternator.condenser, pseudo capacitor, electrochemical double layer capacitor, or ultracapacitors, is an electrochemical capacitor with relatively high energy density. Compared to Introduction of Super Capacitor Super capacitors also known as Electric double-layer capacitors, or Super capacitorss, or electrochemical double layer capacitors (EDLCs), or ultracapacitors, are electrochemical capacitors that have an unusually high energy density when compared to common capacitors, typically on the order of thousands of times greater than a high capacity electrolytic capacitor. For instance, a typical electrolytic capacitor will have a capacitance in the range of tens of millifarads. The same size super capacitor would have a capacitance of several farads.electrochemical double layer capacitors (EDLCs), or ultracapacitors, are electrochemical capacitors that have an unusualment of about two
conventional electrolytic capacitors the energy density is typically on the order of In a conventional capacitor, energy is stored by the removal of charge carriers, typically electrons, from one...
Continue Reading
Please join StudyMode to read the full document
You May Also Find These Documents Helpful
• Speech for the Fest Essay
• Speech Essay
• SPEECH Essay
• Speech I Informative Speech Essay
• Demonstration Speech Essay
• Speech Devotional Essay
• persuasive speech Essay
• Persuassive Speech Research Paper
Become a StudyMode Member
Sign Up - It's Free
|
__label__pos
| 0.981014 |
Three breathing techniques for five-minute relaxation
Reverse breathing involves contracting the abdomen inwards during inhalation rather than puffing out the stomach.
Reverse breathing involves contracting the abdomen inwards during inhalation rather than puffing out the stomach.
PARIS, Nov 29 — These three relaxation techniques can help calm the mind, settle emotions and clarify thoughts. All three can be easily practiced alone at home, in the office, in the car or on public transport. All it takes is a little practice, and you’ll soon start feeling the benefits.
Release tension with reverse breathing
As its name suggests, reverse breathing involves contracting the abdomen inwards during inhalation rather than puffing out the stomach as when practicing deep, abdominal breathing. Relaxation specialist and author Estelle Pouchelon, recommends practicing this breathing technique in a sitting or lying position to release tension around the diaphragm while also working the abdominal muscles. The aim is to breathe in as much as possible while pulling in your stomach under your ribs. Then, breathe out through the mouth while contracting the abdominal muscles. Each series can be repeated five to 10 times.
Manage emotions with cardiac coherence
The biofeedback from cardiac coherence helps regulate the heart rate, creating a coherent heart rate variability through regular breathing. The technique involves breathing in while counting to five then breathing out while counting to five. A series of six cycles therefore makes up one minute of exercise. It’s recommended to keep going for five minutes in total. A host of cardiac coherence apps and online videos can be used to help time breathing along with air bubbles, water drops or pleasant landscapes.
Find calm with alternate nostril breathing
Often practiced in yoga, alternate nostril breathing can be carried out sitting on a chair, on the ground or on a zafu cushion (a yoga and meditation cushion). The technique seeks to calm the mind and body while also promoting sleep. It involves breathing through just one nostril at a time, alternating between the left and the right. For best results, make sure your nose is properly clear beforehand. The practice does require a small amount of training, as you can experiment with breathing in, holding the breath and breathing out for different lengths of time. Start by blocking your right nostril with your thumb and breathing in through your left nostril for four seconds, holding your breath for 16 seconds and then breathing out for eight seconds, recommends pranayama teacher François Gautier. Then repeat with the left nostril blocked. — AFP-Relaxnews
Related Articles
Up Next
Loading...
|
__label__pos
| 0.872834 |
+39 – 3333 230 381 [email protected]
The retreat how addiction hijacks the brain
How addiction hijacks the brain
The word “addiction” is derived from a Latin term for “enslaved by” or “bound to.” Anyone who has struggled to overcome an addiction, or has tried to help someone else to do so, understands why.
Addiction exerts a long and powerful influence on the brain that manifests in three distinct ways: craving for the object of addiction, loss of control over its use, and continuing involvement with it despite adverse consequences. While overcoming addiction is possible, the process is often long, slow, and complicated. It took years for researchers and policymakers to arrive at this understanding.
When researchers first began to investigate what caused addictive behavior, they believed that people who developed addictions were somehow morally flawed or lacking in willpower. Overcoming addiction, they thought, involved punishing miscreants or, alternately, encouraging them to muster the will to break a habit.
A lot has changed since then. Today addiction is being recognized as a chronic disease that changes both brain structure and function. Just as cardiovascular disease damages the heart and diabetes impairs the pancreas, addiction hijacks the brain. Recovery from addiction involves willpower, certainly, but it is not enough to “just say no”. Instead, people typically use multiple strategies, including psychotherapy, medication, and self-care, as they try to break the grip of an addiction.
Another shift in thinking about addiction has occurred as well. For many years, experts believed that only alcohol and powerful drugs could cause addiction. More recent research, however, has shown that certain pleasurable activities, such as gambling, shopping, and sex, can also co-opt the brain and may represent multiple expressions of a common underlying brain process.
From liking to wanting
Nobody starts out intending to develop an addiction, but many people get caught in its snare. More than two-thirds of people with addiction abuse alcohol. The top three drugs causing addiction are marijuana, opioid (narcotic) pain relievers, and cocaine.
Genetic vulnerability contributes to the risk of developing an addiction. Twin and adoption studies show that about 40% to 60% of susceptibility to addiction is hereditary. But behavior plays a key role, especially when it comes to reinforcing a habit.
Pleasure principle
The brain registers all pleasures in the same way, whether they originate with a psychoactive drug, a monetary reward, a sexual encounter, or a satisfying meal. In the brain, pleasure has a distinct signature: the release of the neurotransmitter dopamine is so consistently tied with pleasure that neuroscientists refer to the region as the brain’s pleasure center.
How addiction hijacks the brain
The brain’s reward center
Addictive drugs provide a shortcut to the brain’s reward system by flooding the nucleus accumbens with dopamine. The hippocampus lays down memories of this rapid sense of satisfaction, and the amygdala creates a conditioned response to certain stimuli.
All drugs of abuse, from nicotine to heroin, cause a particularly powerful surge of dopamine in the nucleus accumbens. The likelihood that the use of a drug or participation in a rewarding activity will lead to addiction is directly linked to the speed with which it promotes dopamine release, the intensity of that release, and the reliability of that release. Even taking the same drug through different methods of administration can influence how likely it is to lead to addiction. Smoking a drug or injecting it intravenously, as opposed to swallowing it as a pill, for example, generally produces a faster, stronger dopamine signal and is more likely to lead to drug misuse.
Learning process
Dopamine not only contributes to the experience of pleasure, but also plays a role in learning and memory — two key elements in the transition from liking something to becoming addicted to it.
According to the current theory about addiction, dopamine interacts with another neurotransmitter, glutamate, to take over the brain’s system of reward-related learning. This system has an important role in sustaining life because it links activities needed for human survival (such as eating and sex) with pleasure and reward. The reward circuit in the brain includes areas involved with motivation and memory as well as with pleasure. Addictive substances and behaviors stimulate the same circuit, and then overload it.
Repeated exposure to an addictive substance or behavior causes nerve cells in the nucleus accumbens and the prefrontal cortex, the area of the brain involved in planning and executing tasks, to communicate in a way that couples liking something with wanting it, in turn driving us to go after it. That is, this process motivates us to take action to seek out the source of pleasure.
Tolerance and compulsion
Over time, the brain adapts in a way that actually makes the sought-after substance or activity less pleasurable. In nature, rewards usually come only with time and effort. Addictive drugs and behaviors provide a shortcut, flooding the brain with dopamine and other neurotransmitters. Our brains do not have an easy way to withstand the attack.
Addictive drugs, for example, can release two to 10 times the amount of dopamine that natural rewards do, and they do it more quickly and more reliably. In a person who becomes addicted, brain receptors become overwhelmed. The brain responds by producing less dopamine or eliminating dopamine receptors, an adaptation similar to turning the volume down on a loudspeaker when noise becomes too loud.
As a result of these adaptations, dopamine has less impact on the brain’s reward center. People who develop an addiction typically find that, in time, the desired substance no longer gives them as much pleasure. They have to take more of it to obtain the same dopamine “high” because their brains have adapted, an effect known as tolerance.
At this point, compulsion takes over. The pleasure associated with an addictive drug or behavior subsides — and yet the memory of the desired effect and the need to recreate it (the wanting) persists. It is as though the normal machinery of motivation is no longer functioning.
The learning process mentioned earlier also comes into play. The hippocampus and the amygdala store information about environmental cues associated with the desired substance, so that it can be located again. These memories help create a conditioned response, intense craving, whenever the person encounters those environmental cues.
Cravings contribute not only to addiction, but to relapse after a hard-won sobriety. A person addicted to heroin may be in danger of relapse when he sees a hypodermic needle, for example, while another person might start to drink again after seeing a bottle of whiskey. Conditioned learning helps explain why people who develop an addiction risk relapse even after years of abstinence.
|
__label__pos
| 0.805985 |
Compatibility of Gases
A particular Gas may be incompatible with the cylinder or any packaging in which it is stored or with the pipelines through which it passes. For example Acetylene will react with zinc and copper, hydrogen sulphide will react with brass..
English: Gas cilinder
English: Gas cilinder (Photo credit: Wikipedia)
There was an incident in which an aluminium cylinder containing ethyl chloride and helium with trace amounts of 1,1,1-trichloroethane and trichloroethylene exploded in a cargo warehouse in the Dubai Airport. This was due to non-compatibility of the mixture of gases and the material of cylinder.
Two different gases may react with each other, example Acetylene, which is a highly flammable gas will dangerously react with Chlorine which is a strong oxidizing agent; water-reactive gas.
In transport regulations gases are classified as below
Class 2: Gases
Class 2.1: flammable gases
Class 2.2: non-flammable, non-toxic gases
Class 2.3: toxic gases
According to physical state transport condition of gases are divided in to four;
1. Compressed gas
2. Liquefied gas
3. Refrigerated liquefied gas
4. Dissolved gas.
While storing gas in cylinders or any pressure receptacles or while transporting or storing different gases together, one must take into consideration of below;
1. Compatibility of gas with the storage device (materials of the cylinder made of).
2. Compatibility of gases stored or transported together (chemical reactions between the gases in case of leakage of both or when involved together in fire what may be the consequences).
3. Compatibility of gas with other goods
4. Any other safety concerns
Below is the segregation table for gases as per IMDG Code, in this we can see the different clauses for transporting gas by ocean going vessels.
SEGREGATION OF CLASS 2SEGREGATION OF CLASS 2
SEGREGATION OF CLASS 2
For sea transport one must look in to the individual provisions in IMDG Code for each gas before deciding whether it can be stored together on a ship.
Write your view
|
__label__pos
| 0.964529 |
Warning: This API is deprecated and will be removed in a future version of TensorFlow after the replacement is stable.
NonMaxSuppressionV5
Stay organized with collections Save and categorize content based on your preferences.
public final class NonMaxSuppressionV5
Greedily selects a subset of bounding boxes in descending order of score,
pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than `score_threshold` are removed. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected_indices = tf.image.non_max_suppression_v2( boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather(boxes, selected_indices) This op also supports a Soft-NMS (with Gaussian weighting) mode (c.f. Bodla et al, https://arxiv.org/abs/1704.04503) where boxes reduce the score of other overlapping boxes instead of directly causing them to be pruned. To enable this Soft-NMS mode, set the `soft_nms_sigma` parameter to be larger than 0.
Nested Classes
class NonMaxSuppressionV5.Options Optional attributes for NonMaxSuppressionV5
Public Methods
static <T extends Number> NonMaxSuppressionV5<T>
create(Scope scope, Operand<T> boxes, Operand<T> scores, Operand<Integer> maxOutputSize, Operand<T> iouThreshold, Operand<T> scoreThreshold, Operand<T> softNmsSigma, Options... options)
Factory method to create a class wrapping a new NonMaxSuppressionV5 operation.
static NonMaxSuppressionV5.Options
padToMaxOutputSize(Boolean padToMaxOutputSize)
Output<Integer>
selectedIndices()
A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
Output<T>
selectedScores()
A 1-D float tensor of shape `[M]` representing the corresponding scores for each selected box, where `M <= max_output_size`.
Output<Integer>
validOutputs()
A 0-D integer tensor representing the number of valid elements in `selected_indices`, with the valid elements appearing first.
Inherited Methods
Public Methods
public static NonMaxSuppressionV5<T> create (Scope scope, Operand<T> boxes, Operand<T> scores, Operand<Integer> maxOutputSize, Operand<T> iouThreshold, Operand<T> scoreThreshold, Operand<T> softNmsSigma, Options... options)
Factory method to create a class wrapping a new NonMaxSuppressionV5 operation.
Parameters
scope current scope
boxes A 2-D float tensor of shape `[num_boxes, 4]`.
scores A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes).
maxOutputSize A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.
iouThreshold A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.
softNmsSigma A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et al (c.f. https://arxiv.org/abs/1704.04503). When `soft_nms_sigma=0.0` (which is default), we fall back to standard (hard) NMS.
options carries optional attributes values
Returns
• a new instance of NonMaxSuppressionV5
public static NonMaxSuppressionV5.Options padToMaxOutputSize (Boolean padToMaxOutputSize)
Parameters
padToMaxOutputSize If true, the output `selected_indices` is padded to be of length `max_output_size`. Defaults to false.
public Output<Integer> selectedIndices ()
A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`.
public Output<T> selectedScores ()
A 1-D float tensor of shape `[M]` representing the corresponding scores for each selected box, where `M <= max_output_size`. Scores only differ from corresponding input scores when using Soft NMS (i.e. when `soft_nms_sigma>0`)
public Output<Integer> validOutputs ()
A 0-D integer tensor representing the number of valid elements in `selected_indices`, with the valid elements appearing first.
|
__label__pos
| 0.894086 |
setMatchLevel method
Class: ConfigurationPlatform: EspressoLanguage: Java SDK:
Use this method to set the default match level to be used for subsequent checkpoints in the test.
Syntax
IConfigurationSetter configval = config.setMatchLevel(matchLevel);
Parameters
matchLevel
Type:MatchLevel
Available match level values are: For a description of these match levels and the different ways to apply them to tests, checkpoints, and regions, see Eyes match levels.
Return value
Type: IConfigurationSetter
The value returned is the object that called the method. This allows you to use a fluent style to call the setXXXX methods of the Configuration class.
Remarks
For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.
|
__label__pos
| 0.73029 |
Advertisements
• amimo
• Kandungan
• Kategori
• Archive
• Flickr Photos
Buruj Bajak
Buruj Bajak ialah buruj Big Dipper atau Ursa Major. Sekiranya kita membincangkan perkataan bajak mungkin masyarakat umum terutama golongan muda pada hari ini tidak mengetahui apa itu bajak, melainkan masyarakat yang berada di kawasan pertanian tradisional.
DSC_0405
Advertisements
1.8 LOKASI DI BUMI
Semakin banyak kita memahami tentang bintang dan pergerakannya, semakin seronok kita mencerap. Glob langit berfungsi sepertimana glob daratan. Glob daratan memberikan maklumat tentang kedudukan sesuatu tempat di daratan.
Ingat kembali bagaimana sebuah peta berfungsi. Dengan menggunakan peta tersebut kita gambarkan Bumi sebagai sebuah sfera kemudian kita gariskan garisan bayangan padanya sebagai panduan. Garis bayangan tersebut terdiri dari garis latitud dan garis longitud. Kedudukan sesuatu tempat mestilah dirujukkan kepada kedua-dua garis ini. Garis longitud ialah garis yang menyambungkan dari kutub utara hingga ke kutub selatan, garis ini juga dinamakan sebagai garis meridian. Garis latitud dengan rujukan 0° adalah garis dari kutub utara melalui Bandar Greenwich, England ke kutub selatan. Garis yang membahagi dua garis latitud di kenali sebagai garis khatulistiwa atau equator, garis ini membahagikan Bumi kepada Hemisfera utara dan hemisfera selatan. Garis khatulistiwa ini adalah garis longitud yang bernilai 0°
clip_image002
Rujuk gambarajah di atas
a: garis latitud 30° U
b: garis longitud 30° T
c: Khatulistiwa
d: Garis Prime Meridian 0°
Hadiah Nobel Kategori Fizik
Motivation :
“for groundbreaking experiments regarding the two-dimensional material graphene”
image image
Disebelah Kiri Andre Geim dilahirkan di sochi Russia 1958, bekerja di University of Manchester UK, Kanan Konstantin Novoselov dilahirkan di Ninzhy Tagil Russia 1974, bekerja di University yang sama.
Gabungan kedua-dua generasi ini telah berjaya mengsasingkan “graphene” . Kejayaan ini merupakan kejayaan yang mampu mengubah senario dunia. ini kerana bahan ini dikatakan lebih kuat daripada besi dan merupakan bahan konduktor yang tersangat baik.
Gabungan kedua ciri ini memungkinkan pembinaan super komputer. Klik
sciback_phy_10.pdf untuk download laporan ringkas tentang penemuan ini.
Chapter 6 static
6.1 Equilibrium of Particles
> Any object is said to be in equilibrium if its acceleration is zero.
> If the velocity is also zero, the object is said to be in static equilibrium.
> Since F = ma, if a = 0, then F = 0. Thus the conditions for a point object (particle) in equilibrium is:
the vector sum of all the external forces acting on the particle must be zero, ΣF = 0
> For forces in a plane, (x-y plane) in order that a particle is in equilibrium, the sums of the resolved parts of the forces in the x and y directions must be zero. ΣFx = 0 and ΣFy = 0. (In general, to prove that a particle is in equilibrium, we must show that the sums of the resolved parts of the forces on the particle in any two directions are each equal zero.)
6.2 Closed Polygon
> If the forces as mention in 6.1, drawn to scale and in the appropriate directions, a close triangle or a closed polygon is formed.
For example,(summary)
(a) Two forces in equilibrium along the x-axis
clip_image002
ΣF = 0
F1 = F2
(b) Three forces in equilibrium in the x-y plane
clip_image004
clip_image006
The forces will formed a closed triangle
ΣF = 0
ΣFx = 0 and ΣFy = 0
(c) Four forces in equilibrium in the x-y plane
clip_image008
forces will formed a closed polygon
clip_image010
ΣF = 0
ΣFx = 0 and ΣFy = 0
Example 1
clip_image012
Coplanar forces F1,F2 and F3 act on a point mass A. as shown in figure above. State or show on a labeIled diagram, the condition for the mass to be in equilibrium.
solution
Example 2
clip_image014
a small ball with weight W = 20 N is suspended by a light thread. When strong wind blows horizontally, exerting a instant force F on the ball, the thread makes an angle 30° to the vertical as shown. What are the values of T and F ?
solution
Example 3
clip_image016
A cable car travels along a fixed support cable and is pulled along this cable by a moving draw cable. For the situation shown, the cable car and passengers with weight 50 x 104 N is considered to be stationary with forces T, and T, acting on it. Assuming the draw cable exerts negligible force on the cable car.
(a) sketch and show the forces acting on the cable car.
(b) find the magnitude of T1 and T2
Solution
Example 4
clip_image018
An object of weight W is placed on a smooth plane inclined at an angle q to the horizontal. A force F is applied in a direction parallel to the plane so that the body is in equilibrium. Find F and R, the I normal reaction in terms of W and q. ,
Solution
Resolving forces in a direction perpendicular to the plane, R = W cos q
Resolving forces in a direction parallel to the plane, F = W sin q
Example 5
clip_image020
An object of weight W is placed on a smooth plane inclined at an angle 0 to the horizontal. A force F is applied horizontally so that / the body is in equilibrium. Find F and R, the normal reaction in / terms of W and 0.
Solution
Turning effects of forces
• Torque or moment of a force about a point is the product of that force and the perpendicular distance from the line of action of the force to the point.
(a)Torque/Moment, t = F x d
clip_image022
(b) Torque/Moment = F d sin q
clip_image024
• moment of a force = force x perpendicular distance from pivot to the line of action of force
• Unit of moment is Newton metre (N m)
· torque is a vector quantity
• A torque can turn in a clockwise direction or an anticlockwise direction.
Example 6
clip_image026
The crank of a bicycle pedal is 16 cm long and the downwards push of a leg is 300 N. Calculate the moment due to the force exerted on the pedal when crack has turned through an angle of 60° below the horizontal.
Solution
Moment of the force = 300 x 0.16 cos 60° = 300 x0.16 x0.5 = 24 Nm
Couple/Gandingan
•When two equal forces are acting in opposite direction but not along the same straight line, they form a couple.
•A couple has no resultant force.
•A couple only produces turning effect (rotation).
clip_image028
•The moment of a couple is given by:
clip_image030
• The moment of a couple is the product of one of the forces and the perpendicular distance
between the two forces.
Summary
Torque/Moment* Couple
Turning Effect
t = F x d
F : force
d : jejari/radius
Moment = F d sin q
Equilibrium when moment clockwise = anticlockwise
*in physic moment of force(moment) and Torque, they have the same meaning
When two equal forces are acting in opposite direction
Example 7
clip_image032
Calculate the moment of the Couple produced by the forces acting on the steering wheel of a car in the diagram given.
Solution
Moment of couple = 25 x 0.30 = 7.5 N m
6.3 Equilibrium of Rigid Bodies
> For a rigid body (a non-point object or extended object) in equilibrium,
(a) there must be zero resultant force. ΣF = 0
(b) there must be zero resultant torque. Στ = 0
Alternatively, we can apply the principle of moments which state that for any body in equilibrium, the sum of the clockwise moments about any pivot must equal the sum of , the anticlockwise moments about that pivot.
> Forces that act on rigid body may be concurrent forces or non-concurrent forces.
1.concurrent forces(Daya bersetemu)
– Concurrent forces are forces whose lines of action pass through a single common point.
– Concurrent forces will only cause translational motion.
– To determine whether concurrent forces acting on a rigid body are in equilibrium, all that is required is to check whether the resultant forces is zero.
clip_image034
2. Under non concurrent forces
clip_image036
– Non-concurrent forces are forces whose lines of action do not pass through a single common point.
– To determine whether non-concurrent forces acting on a rigid body has translational and rotational equilibrium, it is necessary to check whether condition ΣF = 0 as well as condition Στ = 0.
Example 8
clip_image038
The seesaw in the diagram is balanced. Use the principle of moments to calculate the weight, W.
Solution
W(15) = 300(1.0) + 450(1.5) = 650N
Example 9
clip_image040
uniform rod XY of weight 20.0 N is freely hinged to a wall at X. It is held horizontal by force F acting from Y at an angle of 60° to the vertical as shown in the diagram. What is the value of F?
solution
clip_image042
The diagram shows the forces acting on your forearm when you hold a weight of 60 N with your arm horizontally. Your elbow joint acts as a fulcrum. The weight of the arm is 20 N and its
is considered to act at a distance 14.0 cm from the fulcrum. Use the principle of moments to calculate the force T exerted by your biseps. What is the reaction force R at the fulcrum?
solution
6.4 Frictional Forces
> Friction acts whenever two surfaces move or try to move relative to one another.
> There are two kinds of frictional forces:
1. Static friction
– It is a force at the contact surfaces which prevents the surfaces from sliding over each other.
clip_image044
-The frictional force always acts in the opposite direction to the pulling force P. It is always self-adjusting, constantly equalising itself to P, maintaining static equilibrium as long as the limiting friction is not exceeded.
-If the pulling force is greater than the limiting friction, the block moves and anoth frictional force known as kinetic friction comes into effect.
Limiting friction:
(a) Depands on the nature of the surfaces.
(b) Is independent of the area of contact.
(c) Is proportional to the normal reaction,R.
Thus limiting friction has a value F = mR
2.Kinetic friction
-It is a force between two moving surfaces which opposes the sliding motion.
clip_image046
– When the pulling force P exceeds the limiting friction, the resultant force accelerates the block.
– Once in motion, the frictional force decreases. The frictional force involved now is the kinetic friction.
– To maintain constant velocity, the pulling force P has to be decreased to the same magnitude as the frictional force (kinetic friction).
– The kinetic friction is independent of the relative velocity of the surfaces.
China Lancar Roket Ke Bulan
2 oktober 2010 China melancarkar Roket menuju ke Bulan. Pihak berkuasa China menjangkakan probe Chong-e2 akan berada mendarat di Bulan dalam masa 5 hari.
BBC News – China launches Moon mission.
%d bloggers like this:
|
__label__pos
| 0.991754 |
Carbohydrates
From W8MD weight loss and sleep centers
Jump to navigation Jump to search
Along with proteins and lipids, carbohydrates are one of the three macronutrients that provide our bodies with energy. A diet that emphasizes carbohydrates can be an effective means of managing energy levels, enhancing athletic performance, and achieving certain health objectives.
Here are steps that emphasizes carbohydrates
Also see
This is a short summary article. For quality control, we do not encourage or allow strangers to edit the content.
|
__label__pos
| 0.709253 |
Category:
What is the Law of Conservation of Energy?
Article Details
• Written By: Vasanth S.
• Edited By: Kathryn Hulick
• Last Modified Date: 25 October 2016
• Copyright Protected:
2003-2016
Conjecture Corporation
• Print this Article
Free Widgets for your Site/Blog
Relatively speaking, Roman charioteers earned more than modern pro athletes. more...
October 25 , 1971 : The United Nations expelled Taiwan and admitted China. more...
The law of conservation of energy is a principle of physics that states that, in a closed system, energy cannot be created or destroyed. It is expressed in the First Law of Thermodynamics, which states that energy may be transformed into many forms, such as light or heat, but the overall sum of the energies is conserved, or remains constant. Generally, this law is illustrated with a pendulum. The height at which the ball is released at one end of a pendulum will equal the height the ball will reach at the other end. In fact, in a theoretically frictionless environment, the ball will continue to swing back and forth forever.
As a fundamental concept in physics, the law of conservation of energy provides an explanation for how energy is conserved and converted within a system. Generally, one form of energy can be converted into another form of energy. For example, potential energy can be converted to kinetic energy.
Ad
The kinetic energy of a particular object is the energy it posses while in motion. As an expression, kinetic energy equals one-half of the mass of the object, multiplied by the square of the velocity of the object, or KE = 1/2mv2. Kinetic energy consists of three types of energies. Vibrational kinetic energy is the energy due to vibrational motion, and rotational kinetic energy is the energy due to rotational motion. Translational kinetic energy is the energy due to motion of the center of mass from one point to another.
Generally, the potential energy of an object is the energy that is stored while at rest in a force field. Gravity is a force that acts upon an object and gives it potential energy. For example, a ball at the top of a hill has a certain amount of stored energy due to gravity. Other types of potential energy include electric, magnetic, and elastic. An example of elastic potential energy is a stretched spring.
The law of conservation of energy states that the potential energy of a ball on a hill is generally converted to kinetic energy when the ball starts rolling down the hill as a result of gravity. Similarly, the potential energy of a stretched spring becomes kinetic energy when the spring is released. In a pendulum, the law establishes that, when the ball is at its highest point, all the energy is potential energy and there is zero kinetic energy. At the ball's lowest point, all the energy in the ball is kinetic and there is zero potential energy. The total energy of the ball is the sum of the potential energy and kinetic energy.
Ad
You might also Like
Recommended
Discuss this Article
anon357739
Post 8
What is the behind the law that energy is neither created nor destroyed?
anon354977
Post 7
I really want to know what are its disadvantages? I can't find it anywhere on any website. If you can help, please do.
anon346890
Post 6
Who established the Law of Conservation of Energy?
anon218447
Post 4
I had only one question: what is its disadvantage?
Babalaas
Post 3
@ PelesTears- The first law, the law of conservation of enery, has been explained. The second law is the law of entropy. This is basically the law of chaos, stating that energy cannot be returned to the same state, basically implying that entropy increases and a perpetual motion machine is impossible. The third law is the law of absolute zero, stating that absolute zero is unattainable.
There is a zeroth law, which was created afterward to define the other laws. This law describes thermodynamic equilibrium and defines temperature.
PelesTears
Post 2
What are the other laws of thermodynamics?
Glasshouse
Post 1
The law of consevation of energy is important in understanding thermodynamics. Any heat gained by one object in a closed system must equal the heat lost by the other object(s) in the system.
I recently did a lab experiment where I used the change in temperature and mass of a piece of hot aluminum dropped into an insulated container of water to determine how much energy was transferred to the container of water.
The law of conservation of energy let me know that the energy transferred into the water is the exact same amount of energy released by the aluminum. the amount of energy released by the aluminum is the equivalent of the mass, change in temperature, and specific heat all multiplied together.
Post your comments
Post Anonymously
Login
username
password
forgot password?
Register
username
password
confirm
email
|
__label__pos
| 0.986289 |
Printer Friendly
7DO: a model for ontology complexity evaluation.
1. Introduction
Ontologies are becoming increasingly important in artificial intelligence, software engineering, bioinformatics, library science, information system architecture, software agents, e-commerce, natural language processing, information query systems, knowledge management and Semantic Web applications as a form of knowledge representation about the world or some part of it. Ontologies are often defined as an explicit specification of a conceptualization [1]. A more technical definition of ontology describes it as an engineering artefact (abstract model) that provides a simplified view of a particular domain of concern and defines formally the concepts, relations, and the constraints on their use [2]. The advantages of developing and using ontologies include more effective information retrieval and analysis processes, allow communication and knowledge sharing over a domain of interest in an unambiguous way, and encourage knowledge reuse.
Though there are several knowledge representation languages available for modelling domain ontologies, the Web Ontology Language (OWL) [3] is already being used as a de facto standard ontology description language. Available ontologies are very diverse in size, quality, coverage, level of detail and complexity. Therefore it is important to evaluate important characteristics of ontologies, which would help ontology developers to design and maintain ontologies as well as help ontology users to choose the ontologies that best meet their needs [4]. As more ontologies are being developed and maintained, the issues of ontology evolution [5] also become important
Several authors have proposed using technical ontology characteristics for ontology evaluation. The OntoMetric [6] framework for ontology evaluation consists of 160 characteristics spread across five dimensions: content of the ontology, language, development methodology, building tools, and usage costs. A framework for comparing ontology schemas described in [7] is based on the following groups of ontology characteristics: design process, taxonomy, internal concept structure and relations between concepts, axioms, inference mechanism, applications, and contribution. The OntoQA [8] approach assesses quality of both ontology schemas as well as of populated ontologies (knowledge bases) through a set of metrics. These metrics can highlight key characteristics of an ontology schema as well as its population. Also a set of ontology cohesion metrics have been proposed by [4].
The novelty of this paper is a model and a collection of technical metrics (adopted or newly proposed) for evaluation of the structural complexity of ontologies. The structure of the paper is as follows. Section 2 presents a 7DO model for evaluation of complexity of OWL ontologies. Section 3 describes the complexity metrics used at different dimensions of the 7DO model. Section 4 describes the application of the proposed metrics for ontology evolution research. Finally, Section 5 presents conclusions.
2. 7DO Model for Ontology Evaluation
Domain ontologies, especially ontologies specified using OWL, are increasingly used in the process of developing information system architectures, e-Learning software, Semantic Web applications, web services [9]. So, OWL ontologies are not only documents, but also software development artefacts, too. OWL ontologies are based on XML schemas. The fact that XML schemas are software artefacts, which claim an increasingly central role in software construction projects, has been noted by [10].
Ontologies are complex artefacts, which combine structural information about domain concepts, different kinds of their relationships, classification of concepts into different hierarchies, logic reasoning on the properties and restrictions of concepts and their relationships. Therefore, we need not a single, but a collection of complexity measures for evaluation of complexity of ontology description artefacts at different ontology dimensions.
Here we distinguish between:
1) first-order properties, or characteristics, which are derived directly from the ontology description itself using simple mathematical actions such as counting, e.g., file size (count of symbols in a file) or number tags in an XML document; and
2) second-order properties or metrics, which can not be derived directly from artefacts, but are calculated from first-order properties.
Complexity is one of such metrics. Complexity metrics may be helpful for reasoning about ontology structure, understanding the relationships between different parts of ontologies, comparing and evaluating ontologies. There are many definitions of what complexity is, so there can be many different complexity metrics. Therefore, the selection of a particular complexity metric is always a subjective matter.
The common approach to measure the complexity of XML schema documents is to count the number of schema elements. Certainly, the complexity of ontology can be measured by the size of ontology (expressed in terms of file size in KB, or Lines of Code), the number of concepts in ontology, or the number of markup elements required to describe ontology. However, we do not consider size as a definitive metric of ontology complexity. First, small things can be complex, too. Second, size does not indicate the quality of ontology, but rather the scope of its domain, because a complex domain requires a larger number of concepts and their relationships to describe domain knowledge than a simple one. The metrics that measure schema's complexity by counting the number of each component do not give sufficient information about complexity of a given schema and the complexity of each independent component. Therefore, we focus on adopting or proposing new complexity metrics for ontology evaluation that are scale-free, i.e., are independent of the size of ontology.
Based on these considerations we propose a Seven Dimension Ontology (7DO) model to evaluation of OWL ontologies. The model has the following dimensions, which represent different views on ontology complexity:
1) Text: Ontology as text (sequence of symbols) with unknown syntax and structure. The only thing known is that this text describes a domain of our interest.
2) Metadata: Ontology as annotated domain knowledge. Domain knowledge is represented as a collection of domain artefacts with attached annotation metadata (labels, names, comments). Such separation of data and metadata is a first step towards creation of ontology.
3) Structure: Ontology as a structured document specified in a markup language (XML). Such document describes different domain entities as elements and properties of these entities as attributes. Separation of entities from their properties is a first analytical step towards understanding of a domain.
4) Algorithm: Ontology as a high-level program specification (algorithm), which describes a sequence of specific reasoning steps over domain knowledge. The transition from one step to other step is a functional operation specified as an XML element. An operation may have one or more operands specified as XML attributes. (The view on a markup document as a program specification is not new, e.g., XSLT is a XML-based functional programming language for XML document transformation).
5) Hierarchy: Ontology as taxonomy of things (domain concepts) arranged in a hierarchical structure. Such structure consists of classes related by subtype/supertype (inheritance/generalization) relationships. Hierarchy can be modelled in an object-oriented way using UML class diagrams, which can be used to represent ontology [11]. However such ontology has no semantics.
6) Metamodel: Ontology as a domain data metamodel described using Resource Description Framework (RDF) Schema. The RDF data model describes domain knowledge in terms of subject-predicate-object expressions. The subject denotes the resource, and the predicate denotes traits or aspects of the resource and expresses a relationship between the subject and the object. Such expressions describe domain knowledge formally using first-order logic.
7) Logic: Ontology as a domain knowledge representation specified using OWL. Domain knowledge is expressed in terms of a set of individuals (classes), a set of property assertions which relate these individuals to each other, a set of axioms which place constraints on sets of individuals, and the types of relationships permitted between them. Axioms provide semantics by allowing systems to infer additional information based on the data explicitly provided using Description Logics (DL). DL are decidable fragments of first-order logic, which are used to represent the domain concept definitions in a structured and formally well-understood way.
The 7DO model is summarized in Table 1.
3. Complexity Metrics at Different Dimensions of 7DO Model
We propose using the following complexity metrics for evaluating complexity at different dimensions of ontology in the 7DO model:
1) Text dimension: Relative Kolmogorov Complexity
Kolmogorov Complexity [12] measures the complexity of an object by the length of the smallest program that generates it. We have an object x and a description system [phi] that maps from a description w to this object. Kolmogorov Complexity [K.sub.[phi]](x) of an object x is the size of the shortest program in the description system [phi] capable of producing x on a universal computer:
(1) [MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII]
Kolmogorov Complexity [K.sub.[phi]](x) is the minimal size of information required to generate x by an algorithm. Unfortunately, it cannot be computed in the general case and must be approximated. Usually, compression algorithms are used to give an upper bound to Kolmogorov Complexity.
Suppose that we have a compression algorithm [C.sub.i]. Then, a shortest compression of w in the description system [phi] will give the upper bound to information content in x:
(2) [MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII]
The semantics-free complexity of OWL ontology O can be evaluated using the Relative Kolmogorov Complexity (RKC) metric, which can be calculated using a compression algorithm C as follows:
RKC = [parallel]C(O)[parallel]/[parallel]O[parallel], (3)
where [parallel]O[parallel] is the size of ontology O, and [parallel]C(O)[parallel] is the size of compressed ontology O.
A high value of RKC means that there is a high variability of text content, i.e., high complexity. A low value of RKC means high redundancy, i.e., the abundance of repeating fragments in text.
2) Metadata dimension: Annotation Richness Ontology O can be defined as a collection of statements on domain concepts with corresponding annotations (metadata) expressed symbolically: O = <(s,m)|s,m [member of] [[summation].sup.*]>, where s is a statement, m is the metadata of s, and [[summation].sup.*] is a string of symbols from alphabet [summation]. For the evaluation of ontology complexity at the metadata dimension, we propose using the Annotation Richness (AR) metric:
[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII] (4)
where [parallel]O[parallel] is the size of ontology O, and [parallel]m[parallel] is the size of metadata in ontology O.
A higher value of the AR metric means that ontology contains more metadata and its description is more complex.
3) Structure dimension: Structural Nesting Depth
An XML document D can be defined as a collection of elements D=(e|e[member of]E). Each element e is a 3-tuple e=(l,A,E), where l is the label of the element, A is the set of the attributes of the element, and E is a set of the nested elements. The complexity of an XML document can be evaluated using the depth of the document's structure tree. For characterizing complexity of the XML document's structure, we propose the Structural Nesting Depth (SND) metric:
[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII] (5)
where d is the largest depth of the XML document, [N.sub.e] is the total number of elements in an XML document, and [n.sub.e](i) is the number of elements at document depth i.
The SND metric is a combination of breadth and depth measures [13] for XML documents, and indicates the depth of the broadest part of the XML document tree.
4) Algorithm dimension: Normalized Difficulty
A functional program specification S is a sequence of functions S=([florin]|[florin][member or]F), where [florin]:(a,a[member of]A) [right arrow] A is a specific function (operator) that may have a sequence of operands as its arguments, and A is a set of function arguments (operands). For XML documents we accept that operations are specified as XML elements, and operands are specified as XML attributes.
We derive the number of distinct operators [n.sub.1], [n.sub.1] = |F|, the number of distinct operands [n.sub.2], [n.sub.2], = |A|, the total number of operators [N.sub.1], [N.sub.1] = |S|, the total number of operands [N.sub.2], [N.sub.2] = [summation over ([florin][member of]S)] |A|.
For evaluating ontology complexity at the algorithm dimension we introduce the Normalized Difficulty (ND) metric, which is a normalized ratio of Halstead Difficulty and Volume metrics [14]:
ND = [n.sub.1][N.sub.2]/([N.sub.1]+[N.sub.2])([n.sub.1]+[n.sub.2]) (6)
A high value of the ND metric means that ontology is highly complex with many distinct classes and relationships between them.
5) Hierarchy dimension: Subclassing Richness
Concept hierarchy (taxonomy) H is a 4-tuple H=(V,E,L,R), where V is a set of nodes (vertices) representing domain concepts, E is set of directed edges representing semantic relationships between concepts, L is a set of labels denoting different types of semantic relationships such as aggregation, generalization etc., and R is a set of constraints defined over nodes and edges to constrain these relationships.
Concept hierarchies provide a static modelling capability that is well suited for representing ontologies, so the structural complexity of a concept hierarchy (such as described using UML class diagram) is one of the most important measures to evaluate the quality of ontologies [15]. Here we assume that concept hierarchy is described using RDF schema. To evaluate the complexity of taxonomical relationships in ontology, the Subclassing Richness (SR) metric is used:
SR = [n.sub.SC]/[n.sub.C] + [n.sub.SC], (7)
where [n.sub.SC] is a number of sub-class (SC) relationships {rdfs:subClassOf}, and [n.sub.C] is a number of classes (C) {Class, Thing, Nothing} in the concept hierarchy.
The SR metric reflects the distribution of information across different levels of the ontology. A low SR value indicates a vertical ontology, which might reflect a very detailed type of knowledge that the ontology represents. A high SR value indicates a horizontal (flat) ontology, which means that ontology represents a wide range of general knowledge.
6) Metamodel dimension: Relationship Richness
Ontology described using an RDF schema is a graph G = <{C [union] L},P,[S.sup.C],[S.sup.P]>, where C is a set of nodes labelled with a class name, L is a set of nodes labelled with a data type (literals), [S.sup.C] is a subsumption between classes C , P is a set of arcs of the form < [c.sub.1], p, [c.sub.2] > , where [c.sub.1] [member of] C, [c.sub.2] [member of] C [union] L, p is a property name, and [S.sub.P] is a subsumption between properties P.
Main RDFS constructs for the description of ontologies are committed for describing resource class hierarchies {rdfs:subClassOf} and resource property relationships {rdfs:subPropertyOf, rdfs:domain, rdfs:range}. To evaluate complexity of relationships defined by the RDF schema constructs of the OWL ontology the
Relationship Richness (RR) metric is adopted from the OntoQA metric collection [8]:
RR = [n.sub.P]/[n.sub.P] + [n.sub.SC], (8)
where [n.sub.P] is the number of relationships (P) defined in the schema, and [n.sub.SC] is the number of subclasses (SC) (i.e., inheritance relationships).
The RR metric reflects the diversity of relationships in the ontology. An ontology that contains many relations other than class-subclass relations is richer than taxonomy with only sub-classing relationships.
7) Ontology dimension: Logic Richness
The ontology structure O, proposed by [8], can be described by a a 6-tuple O:={C, P, A, [H.sup.C], prop, att}, where C is a set of concepts (classes), P is a set of relationships, A is a set of attributes, [H.sup.C] , [H.sup.C] [??] C x C, is a concept hierarchy (taxonomy), prop: P[right arrow]C x C is a function that relates concepts non-taxonomically, att: A[right arrow]C is a function that relates concepts with literal values.
OWL language syntax has the following groups of constructs for describing non-taxonomic relationships between domain concepts:
-- classes (C) {Class, Thing, Nothing}, and -- properties (P) {rdf:Property, DatatypeProperty, ObjectProperty, FunctionalProperty, SymmetricProperty, AnnotationProperty, TransitiveProperty, InverseFunctionalProperty, OntologyProperty}.
The non-taxonomic relationships are:
-- class restrictions (CR) {Restriction}, -- property restrictions (PR) {rdfs:domain, rdfs:range}, -- equalities (E) {differentFrom, distinctMembers, equivalentClass, equivalentProperty, sameAs}, -- class axioms (CA) {oneOf, dataRange, disjointWith}, -- class expressions (CE) {complementOf, intersectionOf, unionOf}.
Class restrictions are used to restrict individuals that belong to a class. Property restrictions identify restrictions to be placed on how properties can be used by instances of a class. Equalities identify equalities/inequalities between classes and properties. Axioms are used to associate class and property identifiers with either partial or complete specifications of their characteristics, and to give other information about classes and properties. Class expressions are used to perform Boolean logic operations over class hierarchies.
The complexity of taxonomical relationships is defined at the hierarchy and metamodel dimensions of the 7DO model. For complexity of first-order logic relationships between concepts and properties we propose using a Logic Richness (LR) metric defined as follows:
[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII] (9)
where [n.sub.x]--is a number of objects x in ontology O. The LR metric reflects the diversity and complexity of logic relationships in the ontology.
8) Cumulative complexity of ontology
The Cumulative Complexity (CC) of ontology in the 7DO model is calculated as an arithmetic mean of dimensions' complexities:
CC = RKC + AR + SND + ND + IR + RR + LR/7. 100% (10)
All complexity metrics of the 7DO model satisfy the Non-negativity, Null Value, Symmetry Module Monotonicity, Disjoint Module Additivity properties of complexity metrics defined by [16]. Furthermore, all metric values are scaled to (0,1) range, which is convenient for comparison and aggregation of metric values. The 7DO model metrics are summarized in Table 2.
4. Case Study in Ontology Evolution
We performed complexity analysis of the SWETO [17] ontology. SWETO is a general purpose ontology that covers domains including publications, affiliations, geography and terrorism. We analyzed 5 versions of the SWETO ontology developed in 2003-2004. The size of the SWETO ontology was measured using Lines of Code (LOC) metric (Figure 1) and the number of classes (Figure 2).
The measurement of complexity metrics was performed by a PHP script that parses the XML-based OWL ontology and computes the complexity metrics based on the predefined XML, RDF and OWL primitives. The Relative Kolmogorov Complexity metric was calculated using the standard PHP ARCHIVE_ZIP library. The results are presented in Figure 3.
From the results we can see, that the SWETO ontology has grown from version to version linearly (size: R = 0.97; number of classes: R = 0.95). The complexity metric values (except RR) have remained flat. The value of the RR metric has decreased pointing to the introduction of relationships other than sub-classing relationships such as restrictions on class properties.
[FIGURE 1 OMITTED]
[FIGURE 2 OMITTED]
[FIGURE 3 OMITTED]
From the results shown in Figures 1-3 we can make two conclusions:
1) The size of an evolved ontology tends to grow linearly;
2) The complexity of an evolved ontology tends to remain constant.
Note that the Second Law of Lehman [18] for software evolution claims that complexity of an evolved software program tends to increase. The claim has been supported empirically for numerous software development projects [19]. It seems that the complexity of ontologies as a domain description artefact depends only upon the domain of ontology and stays flat as ontologies are being evolved. However, more research is needed on ontologies from different domain to confirm this observation. This research can be considered as a first step towards discovery and formulation of the Ontology Evolution Laws.
5. Conclusions
The presented 7DO model for evaluation of the structural complexity of ontology descriptions can be used for comparison and ranking of ontologies within the same domain, as well as for investigating ontology evolution issues. The proposed set of complexity metrics can be used by knowledge engineers, ontology designers, and ontology users.
The advantages of the ontology evaluation using the proposed metrics of the 7DO model are as follows: 1) Computation is easy and straightforward, only XML parser is required. 2) The 7DO model is ontology content-independent. 3) Metrics are reusable and domain-independent. 4) Metrics are scale-free, i.e., independent of an ontology size.
However for deeper ontology analysis, the metric-based evaluation should be combined with the expert-based evaluation of non-technical and content related ontology characteristics such as completeness or consistency. A suite of benchmark ontologies should be developed (or gathered), with which the results of ontology evaluation could be compared.
References
[1] T.R. Gruber. A translation approach to portable ontologies. Knowledge Acquisition, 5:199-220, 1993.
[2] N. Guarino. Formal Ontology and Information Systems. In Proc. of First Int. Conf. on Formal Ontologies in Information Systems (FOIS), Trento, Italy, pp. 3-15, 1998.
[3] World Wide Web Consortium. OWL Web Ontology Language Reference. W3C Recommendation 10 Feb, 2004.
[4] H. Yao, A.M. Orme, and L. Etzkorn. Cohesion Metrics for Ontology Design and Application. Journal of Computer Science 1(1): 107-113. Science Publications, 2005.
[5] L. Stojanovic. Methods and Tools for Ontology Evolution. PhD thesis, University of Karlsruhe, 2004.
[6] A. Lozano-Tello and A. Gomez-Perez. ONTOMETRIC: a method to choose the appropriate ontology. Journal of Database Management 15, 1-18, 2004.
[7] N. Noy and C. Hafner. The state of the art in ontology design: A survey and comparative review. AI Magazine, 18(3):53-74, 1997.
[8] S. Tartir, I.B. Arpinar, M. Moore, A. Sheth, B. Aleman-Meza. OntoQA: Metric-Based Ontology Quality Analysis. IEEE ICDM 2005 Workshop on Knowledge Acquisition from Distributed, Autonomous, Semantically Heterogeneous Data and Knowledge Sources, Houston, TX, USA, November 27, 2005, pp. 45-53.
[9] M. Hepp, P. De Leenheer, A. de Moor, and Y. Sure (Eds.). Ontology Management: Semantic Web, Semantic Web Services, and Business Applications. Springer, 2007.
[10] J. Visser. Structure metrics for XML Schema. In J.C. Ramalho et al. (eds.). Proc. of XATA 2006. Univ. of Minho, 2006.
[11] S. Cranfield. UML and the Semantic Web. Proc. of the International Semantic Web Working Symposium, Palo Alto, USA, 2001.
[12] M. Li and P. Vitanyi. An Introduction to Kolmogorov Complexity and Its Applications, 2nd Edition, Springer Verlag, 1997.
[13] R. Lammel, S.D. Kitsis, and D. Remy. Analysis of XML Schema Usage. Proc. of XML 2005, International Digital Enterprise Alliance, Atlanta, November 2005.
[14] M.H. Halstead. Elements of Software Science. New York, NY: Elsevier, 1977.
[15] D. Kang, B. Xu, J. Lu, W.C. Chu. A complexity measure for ontology based on UML. Proc. of 10th IEEE International Workshop on Future Trends of Distributed Computing Systems FTDCS 2004, 26-28 May 2004, pp. 222 - 228.
[16] L.C. Briand, S. Morasca, V.R. Basili. Property-Based Software Engineering Measurement. IEEE Trans. Software Eng. 22(1): 68-86, 1996.
[17] B. Aleman-Meza, C. Halaschek, A. Sheth, I.B. Arpinar, and G. Sannapareddy, SWETO: Large-Scale Semantic Web Test-bed. Proc. of 16th Int. Conf. on Software Engineering & Knowledge Engineering, Banff, Canada, pp. 490-493, 2004.
[18] M.M. Lehman, J.F. Ramil, P. Wernick, D.E. Perry, and W.M. Turski. Metrics and Laws of Software Evolution --The Nineties View. IEEE METRICS 1997, p. 20.
[19] W. Scacchi. Understanding Open Source Software Evolution. In N.H. Madhavji, M.M. Lehman, J.F. Ramil, and D. Perry, (eds.), Software Evolution and Feedback, John Wiley and Sons, New York, 2006.
Robertas Damasevicius
Software Engineering Department,
Kaunas University of Technology,
Studentu 50-415, LT-51368, Kaunas, Lithuania
email: [email protected]
Table 1: Summary of the 7DO model
Analyzed
Dimension Artefacts format Reasoning
Text Symbols TXT Syntax-free
Metadata Data, metadata XML Semantics-free
Structure Elements, attributes XML
Algorithm Operators, operands XML
Hierarchy Classes, relationships RDF
Metamodel Subjects, objects, RDF First-order logic
predicates
Logic Class and property OWL
restrictions class
expressions, axioms
Table 2: Summary of ontology dimension complexity metrics
Dimension Metric Subjects of measurement
Text Relative Kolmogorov Object: OWL file
Complexity Program: compressed OWL file
Metadata Annotation Richness Data: XML elements, attributes
Metadata: attribute values,
labels, comments
Structure Structural Nesting Depth: level of XML document
Depth
Elements: number of tags at
different document levels
Algorithm Normalized Difficulty Operators: XML tags
Operands: attributes of XML
tags
Hierarchy Subclassing Richness Concepts: Classes
Relationships: subclass
relationships
Metamodel Relationship Richness Subclass relationships, other
relationships
Ontology Logic Richness Class and property restrictions,
equalities, class axioms,
class expressions
Dimension Meaning for ontology
Text High variability of content
Metadata Provision of human-readable information on domain concepts
Structure Complexity of document's structure
Algorithm Uniqueness of classes and relationships between them
Hierarchy Detailness of domain knowledge
Metamodel Complexity of relationships between domain concepts
Ontology Complexity of logic
COPYRIGHT 2009 University of the West of Scotland, School of Computing
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2009 Gale, Cengage Learning. All rights reserved.
Reader Opinion
Title:
Comment:
Article Details
Printer friendly Cite/link Email Feedback
Author:Damasevicius, Robertas
Publication:Computing and Information Systems
Date:Feb 1, 2009
Words:4053
Previous Article:Bees collective dynamics.
Next Article:Immersive learning and assessment with quizHUD.
Terms of use | Copyright © 2015 Farlex, Inc. | Feedback | For webmasters
|
__label__pos
| 0.71048 |
RTC - Simple RTC Alarm
Materials
Example
This example demonstrates how to use the RTC library methods to create a RTC Alarm, so that to do some tasks when an alarm is matched. In particular, the RTC time is set at 16:00:00 and an alarm at 16:00:10. When the time matches, “Alarm Match” information will be printed on the serial monitor.
First, select the correct Ameba development board from the Arduino IDE: “Tools” -> “Board”.
Then open the ” RTCAlarm ” example from: “File” -> “Examples” -> “RTC” -> “RTCAlarm”:
1
In the example, the RTC time is set at 16:00:00 and an alarm is set at 16:00:10. Upon successfully upload the sample code and press the reset button. When the alarm time (10 seconds) is reached the attached interrupt function will print the following information: “Alarm Matched!” showing in this figure below.
1
Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved.
Please confirm that QQ communication software is installed
|
__label__pos
| 0.95406 |
The Vital Role of Brakes
The Vital Role of Brakes
Maintaining your car’s brake system is crucial to overall vehicle safety. It is vital when driving with passengers and other drivers. Avoiding hazardous driving habits such as slamming on the brakes and braking unnecessarily will help to extend the longevity of your vehicle’s brake components.
If you notice any signs of brake trouble, such as a squishy or low-feeling pedal, schedule an inspection right away! It will save you money and time in the long run.
Brake Pads
Brake pads are the underrated heroes of your braking system, serving as the front line of your vehicle’s defense against accidents. They convert kinetic energy into thermal energy to bring your car to a stop by generating friction against the rotors.
When you step on the brake pedal, it activates the hydraulic system that pushes a piston within a master cylinder filled with brake fluid into calipers situated at each wheel. The calipers then firmly grip the brake pads and apply pressure against the rotating rotors, which leads to a decrease in the speed of your wheels and ultimately brings your car to a stop.
The steel backing plates that the friction-based substance is bonded to on the surfaces facing the disc brake rotors make up the brake pads. When your brake pads begin to wear down, you will hear a squeaking sound. It is the result of friction-based material moving to the metal surface of the rotors, signaling that a replacement is necessary. For this reason, you must maintain your brake repair Edmonds, WA schedule.
Brake Rotors
Many gearheads describe the master cylinder as the “heart” of your brake system because, like the heart, it pumps fluid to where it is needed most. When you press the brake pedal, mechanical leverage pushes a rod known as the pushrod through the dual-chamber master cylinder and creates hydraulic pressure transferred to each wheel’s calipers.
The calipers act as metal clamps that grip the rotating disc or rotor of each wheel to slow its speed. If the calipers get too hot from constant exposure to heat, they can lose their ability to clamp onto the brake rotor, and your car may feel as if it pulls to one side. Other potential problems include:
• A low brake fluid level.
• Air trapped in the brake lines.
• A misadjusted master cylinder pushrod.
These are all things that can be diagnosed with a quick and easy visual inspection. You should also check the rotors and drums to ensure they are free of debris, rust, or damage that can interfere with brake function.
Brake Fluid
When you hit the brakes, a complex process converts your mechanical force into hydraulic pressure to slow and stop your vehicle. This alchemy depends on a hardworking fluid that can endure intense heat and pressure variations.
Brake fluid is a specialty hydraulic fluid that carries your foot’s force into the system through the master cylinder and brake lines. It then transfers this pressure to brake pads and rotors, creating friction that slows down your vehicle’s wheels.
To operate appropriately, brake fluid must have a high boiling point. It also needs to lubricate the brake system’s components. Various types of brake fluid exist, such as glycol DOT 3, DOT 4, and DOT 5.1 (which contain silicon and doesn’t absorb water). Over time, these liquids can absorb moisture and contaminants, reducing their boiling points. It can lead to a spongy pedal feel and decreased braking efficiency. Changing your brake fluid frequently can keep it working well. It is a must for your car’s safety and performance!
Brake Lines
It takes much more than pressing the brake pedal to stop your car. That’s why it is so important to keep all of the different components of your brake system in top working condition.
For example, your brake lines are the rigid metal tubing network that channels your brake fluid from the master cylinder to points near each of your wheels or brake calipers. Brake lines are made from various materials, including aluminum, stainless steel, and steel. Aluminum and stainless steel are very corrosion-resistant, especially compared to copper tubing or vinyl hoses, which can be damaged by road salt thrown on the roadways during winter.
Brake line tubes are usually manufactured with a soft metallic wear tab that closes an electric circuit when the brake pads wear thin, alerting you of the need for a replacement. They are also often ‘flared,’ similar to the end of a pair of jeans, to provide a tight seal at each connection point.
|
__label__pos
| 0.856261 |
Sigmoid dose response relationship toxicology
sigmoid dose response relationship toxicology
A normally distributed sigmoid curve such as this one approaches a response of 0% as the dose is. Interpret frequency (normal distribution) and dose - of most exposures in toxicology. Dosage - response mathematical relationship. (positive sigmoid curve. The dose–response relationship, or exposure–response relationship, describes the change in Dose–response curves are generally sigmoidal and monophasic and can be fit to a classical Hill equation. they apply to endocrine disruptors argues for a substantial revision of testing and toxicological models at low doses.
The dose-response relationship or curve allows one to establish causality that a chemical has induced the observed effects, helps establish the lowest dose at which toxicity occurs if there is a threshold, and determines the rate or slope for the dose response.
There was a problem providing the content you requested
There may or may not be a threshold, a dose below which no observable effect is expected. Within a species or population, the majority will respond similarly to a given toxicant; however, a wide variance of responses may be encountered, some individuals are susceptible and others resistant. As demonstrated in Figure 2. A large standard deviation indicates great variability of response.
sigmoid dose response relationship toxicology
The shape and slope of the dose-response curve is helpful in predicting the risk or toxicity of a substance at specific dose levels.
Major differences among toxicants may exist not only in the dose at which the toxicity is seen but also in the percent of population responding per unit change in dose i.
Dose–response relationship - Wikipedia
As illustrated in Figure 4 below, Toxicant A has a higher threshold but a steeper slope than Toxicant B, the implication being that comparatively, Toxicant B is more toxic at lower dosages and Toxicant A more toxic at higher dosages.
A threshold for toxic effects occurs at the point where the body's ability to detoxify a xenobiotic or repair toxic injury has been exceeded. For most organs there is a reserve capacity so that loss of some organ function does not cause decreased performance. Figure 5, below, see http: Given the larger number of subjects needed to observe an unlikely phenomenon one usually cannot afford to study sufficient numbers of subjects at very low doses to accurately portray the dose response relationship at the lowest dose ranges.
Hence laboratory animals are typically studied at dosages which are orders of magnitude higher than human beings are expected to be exposed and conclusions of risk in human settings are derived from extrapolations of observed data at higher ranges to the lower ranges at which humans might be exposed. Source available from here. For any updates to the material, or more permissions beyond the scope of this license, please email healthoer uct. One of the more commonly used measures of toxicity is the LD The LD50 says nothing about non-lethal toxic effects though.
sigmoid dose response relationship toxicology
A chemical may have a large LD50, but may produce illness at very small exposure levels. It is incorrect to say that chemicals with small LD50s are more dangerous than chemicals with large LD50s, they are simply more toxic.
sigmoid dose response relationship toxicology
The danger, or risk of adverse effect of chemicals, is mostly determined by how they are used, not by the inherent toxicity of the chemical itself. The LD50s of different poisons may be easily compared; however, it is always necessary to know which species was used for the tests and how the poison was administered the route of exposuresince the LD50 of a poison may vary considerably based on the species of animal and the way exposure occurs.
Some poisons may be extremely toxic if swallowed oral exposure and not very toxic at all if splashed on the skin dermal exposure.
Dose–response relationship
The potency of a poison is a measure of its strength compared to other poisons. The more potent the poison, the less it takes to kill; the less potent the poison, the more it takes to kill.
The potencies of poisons are often compared using signal words or categories as shown in the example in table 2. The designation toxic dose TD is used to indicate the dose exposure that will produce signs of toxicity in a certain percentage of animals.
sigmoid dose response relationship toxicology
The TD50 is the toxic dose for 50 percent of the animals tested. The larger the TD the more poison it takes to produce signs of toxicity.
General Principles of Toxicology - Page 2 of 6
The toxic dose does not give any information about the lethal dose because toxic effects for example, nausea and vomiting may not be directly related to the way that the chemical causes death. The toxicity of a chemical is an inherent property of the chemical itself. It is also true that chemicals can cause different types of toxic effects, at different dose levels, depending on the animal species tested.
|
__label__pos
| 0.734681 |
Skip to main content
Full text of "Metallurgy Of Cast Iron"
EFFECT OF VARIATIONS IN TOTAL CARBON. 247
in the percentages of carbon in iron cannot be controlled sufficiently to regulate mixtures in everyday founding. This proposition is largely due to some advocating that the creation of the graphitic carbon is not regulated by silicon, but due chiefly to changes in the percentages of carbon. It is true that the higher the carbon, the more graphite there is in normally made and cooled pig iron or castings, other conditions being equal. Nevertheless, variations in the silicon and sulphur, especially the silicon, are chiefly responsible for variations in the graphite of different pig or castings. If those who think otherwise will take note of variations in the total carbon and the combined carbon they will find that, allowing for changes in the percentage of total carbon, the combined carbon varies closely with those of silicon and sulphur, especially the former; or, in other words, with a constant total carbon, sulphur, and manganese, etc., the higher the silicon, the lower the combined carbon and the higher the graphite, in normally made and cooled pig iron or castings.
flalleable founders notice that the heat of irons is greatly derived from the carbon in it. As a rule the low silicon irons give them the highest carbon. When the exception to this rule takes place and they get low carbon in low silicon irons, which many prefer, they notice its heat effect in a very pronounced manner. Iron with less than i per cent, silicon may have carbon up to 4.50 per cent, while over 4.00 per cent, silicon iron may often not exceed 2.00 per cent, carbon.
To insure good fluidity it is not to be understood, by the above, that it is necessary to have carbon above 3.75. To obtain good fluidity, extra silicon, phosphorus, and often manganese are necessary to be com-o.n. in ladle 1,772 Ibs. .100" -326 " I.IOO .242 3
|
__label__pos
| 0.840126 |
The idea that Is Australia Wider than the Moon? might seem absurd at first glance. After all, the moon is a celestial body that orbits the Earth and has a diameter of 3,474 kilometers. Australia, on the other hand, is a continent located in the southern hemisphere with a total land area of 7.692 million square kilometers. But is it possible that is Australia wider than the moon?
To answer this question, we need to look at what we mean by “wider.” If we are talking about the physical size of these two objects, then it’s clear that the moon is much larger than Australia. However, if we are talking about the perceived width of Australia as seen from space, then things get a bit more interesting.Is Australia Wider than the Moon
When we look at the moon from Earth, it appears to be about the same size as the sun, even though the sun is much larger. This is because the moon is much closer to us than the sun, so it appears larger in our field of view. Similarly, if we were to view Australia from space, it would appear much wider than it actually is due to the curvature of the Earth.
To understand this phenomenon, we need to look at the concept of the “horizon.” The horizon is the line where the Earth appears to meet the sky, and it curves away from us as we move further away from the surface. This curvature is due to the shape of the Earth, which is roughly spherical. As a result, objects that are far away from us appear to be “squished” toward the horizon, making them appear wider than they actually are.
This effect is particularly pronounced when looking at large objects like continents. From space, Australia would appear to stretch almost from one end of the horizon to the other, making it seem much wider than it actually is. In fact, if we were to view Australia from space at the right angle, it could appear to be wider than the moon.
Of course, this is all just a matter of perspective. In reality, the moon is much larger than Australia, and it would take over 50 million Australia to fill the volume of the moon. However, the fact that Australia can appear wider than the moon when viewed from space is a fascinating reminder of the complexities of perception and the way our brains interpret the world around us.
Is Australia Wider than the Moon
Full blood moon eclipse 2018
This phenomenon is not unique to c, of course. Any large object viewed from space will appear wider than it actually is due to the curvature of the Earth. In fact, this effect is the reason why the Earth itself appears to be a flat disc from space, even though we know it is actually a sphere.
Despite this, there is something uniquely awe-inspiring about the idea of Australia stretching across the horizon, wider than the moon. It’s a reminder of the immense scale of the world we live in and the way that even the most familiar objects can take on new dimensions when viewed from a different perspective.
It’s also a reminder of the incredible advances we have made in space exploration over the past few decades. Thanks to satellites, telescopes, and other advanced technologies, we are able to view our world and the universe beyond it in ways that were once unimaginable. This has allowed us to gain new insights into the workings of our planet, as well as the larger cosmos that surrounds us.
In conclusion, while it may seem strange to suggest that Australia is wider than the moon, it is in fact a possibility when viewed from space. This is due to the way that the curvature of the Earth can make large objects appear wider than they actually are. While this phenomenon is not unique to Australia, it serves as a fascinating reminder of the way that perception and perspective can shape our understanding of the world around us. As we continue to explore the universe and push the boundaries of our knowledge, we will undoubtedly encounter many more surprising and unexpected phenomena that challenge our understanding of the world. But through continued curiosity and exploration, we can continue to expand our knowledge and appreciation of the vast and endlessly fascinating universe we inhabit.
Is Australia Wider than the Moon
NEW JERSEY, USA – OCTOBER 1: A plane flies through as The Harvest Moon rises behind The Statue of Liberty of New York City as seen from the Liberty State Park in New Jersey, United States on October 1, 2020. (Photo by Tayfun Coskun/Anadolu Agency via Getty Images)
It’s also worth noting that while the concept of Australia appearing wider than the moon is a fascinating one, it’s not something that is likely to have much practical significance in our day-to-day lives. After all, we don’t often view Australia or the moon from space, and even if we did, the perception of their relative widths would depend on a variety of factors, including the angle of observation, the time of day, and the weather conditions.
Nonetheless, the idea of Australia stretching across the horizon, wider than the moon, is a powerful and evocative one that speaks to our sense of wonder and awe at the natural world. It reminds us of the sheer scale and complexity of the universe we inhabit, and the way that even the most familiar objects can take on new dimensions and meanings when viewed from a different perspective.
Ultimately, the idea that Australia is wider than the moon is a testament to the power of curiosity and imagination to inspire and challenge us, to push us to explore new frontiers and seek out new knowledge. Whether we are exploring the far reaches of the universe or simply contemplating the wonders of our own planet, the pursuit of knowledge and understanding is a deeply human endeavor that drives us forward and helps us to make sense of the world around us.
Author
Write A Comment
|
__label__pos
| 0.98821 |
SciCombinator
Discover the most talked about and latest scientific content & concepts.
Concept: Numerical taxonomy
7
The origin of limes and lemons has been a source of conflicting taxonomic opinions. Biochemical studies, numerical taxonomy and recent molecular studies suggested that cultivated Citrus species result from interspecific hybridization between four basic taxa (C. reticulata, C. maxima, C. medica and C. micrantha). However, the origin of most lemons and limes remains controversial or unknown. The aim of this study was to perform extended analyses of the diversity, genetic structure and origin of limes and lemons.
Concepts: DNA, Taxonomy, Citrus, Orange, Citron, Rutaceae, Cultivated plant taxonomy, Numerical taxonomy
0
We argue that the mathematization of science should be understood as a normative activity of advocating for a particular methodology with its own criteria for evaluating good research. As a case study, we examine the mathematization of taxonomic classification in systematic biology. We show how mathematization is a normative activity by contrasting its distinctive features in numerical taxonomy in the 1960s with an earlier reform advocated by Ernst Mayr starting in the 1940s. Both Mayr and the numerical taxonomists sought to formalize the work of classification, but Mayr introduced a qualitative formalism based on human judgment for determining the taxonomic rank of populations, while the numerical taxonomists introduced a quantitative formalism based on automated procedures for computing classifications. The key contrast between Mayr and the numerical taxonomists is how they conceptualized the temporal structure of the workflow of classification, specifically where they allowed meta-level discourse about difficulties in producing the classification.
Concepts: Scientific method, Taxonomy, Categorization, Taxonomic rank, Biological classification, Alpha taxonomy, Systematics, Numerical taxonomy
|
__label__pos
| 0.898141 |
blob: c4e415b6d6996db44a0d483120ede74a91f733e2 [file] [log] [blame]
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Defines a Python binary.
#
# Example
#
# ```
# python_binary("main") {
# main_source = "main.py"
# main_callable = "main"
# sources = [
# "foo.py",
# "bar.py",
# ]
# output_name = "main.pyz"
# deps = [ "//path/to/lib" ]
# }
# ```
#
# Parameters
#
# main_source (required)
# Source file including the entry callable for this binary.
# This file will typically contain
# ```
# if __name__ == "__main__":
# main()
# ```
# Type: path
#
# main_callable (optional)
# Main callable, which serves as the entry point of the output zip archive.
# In the example above, this is "main".
# Type: string
# Default: main
#
# output_name (optional)
# Name of the output Python zip archive, must have .pyz as extension.
# Type: string
# Default: ${target_name}.pyz
#
# sources
# deps
# visibility
# testonly
template("python_binary") {
assert(defined(invoker.main_source), "main_source is required")
_library_infos_target = "${target_name}_library_infos"
_library_infos_json = "${target_gen_dir}/${target_name}_library_infos.json"
generated_file(_library_infos_target) {
forward_variables_from(invoker,
[
"testonly",
"deps",
])
visibility = [ ":*" ]
outputs = [ _library_infos_json ]
output_conversion = "json"
data_keys = [ "library_info" ]
walk_keys = [ "library_info_barrier" ]
}
action(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
sources = [ invoker.main_source ]
if (defined(invoker.sources)) {
sources += invoker.sources
}
inputs = [ _library_infos_json ]
deps = [ ":${_library_infos_target}" ]
# Output must be a .pyz, so our build knows to use a vendored Python
# interpreter to run them.
#
# Output a single .pyz file makes the output deterministic, otherwise we'd
# have to list out all the library sources that will be copied to output
# directory, which is not possible because they are not known until the
# generated JSON file is parsed at build time.
_output = "${target_out_dir}/${target_name}.pyz"
if (defined(invoker.output_name)) {
assert(get_path_info(invoker.output_name, "extension") == "pyz",
"output_name must have .pyz as extension")
_output = "${target_out_dir}/${invoker.output_name}"
}
outputs = [ _output ]
_main_callable = "main"
if (defined(invoker.main_callable)) {
_main_callable = invoker.main_callable
}
script = "//build/python/package_python_binary.py"
depfile = "${target_out_dir}/${target_name}.d"
args = [ "--sources" ] + rebase_path(sources, root_build_dir) + [
"--target_name",
target_name,
"--main_source",
rebase_path(invoker.main_source, root_build_dir),
"--main_callable",
_main_callable,
"--library_infos",
rebase_path(_library_infos_json, root_build_dir),
"--depfile",
rebase_path(depfile, root_build_dir),
"--gen_dir",
rebase_path(target_gen_dir, root_build_dir),
"--output",
rebase_path(_output, root_build_dir),
]
}
}
|
__label__pos
| 0.92897 |
The requested page is not available for the requested platform. You are viewing the content for Default platform.
DashboardExtensionsOptionBuilder Methods
A wrapper that provides access to the extensions collection.
Name Description
DashboardExport(Action<DashboardExportOptionBuilder>)
Allows you to use the DashboardExport extension.
DataSourceWizard(Action<DataSourceWizardOptionBuilder>)
Allows you to use the DataSourceWizard extension.
Equals(Object) Determines whether the specified object is equal to the current object.
(Inherited from Object)
Equals(Object, Object) Determines whether the specified object instances are considered equal.
(Inherited from Object)
GetHashCode() Serves as the default hash function.
(Inherited from Object)
GetType() Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone() Creates a shallow copy of the current Object.
(Inherited from Object)
MobileLayout(Action<DashboardMobileLayoutOptionBuilder>)
Allows you to use the MobileLayout extension.
ParameterDialog(Action<DashboardParameterDialogOptionBuilder>)
Allows you to use the ParameterDialog extension.
ReferenceEquals(Object, Object) Determines whether the specified Object instances are the same instance.
(Inherited from Object)
ToString() Returns a string that represents the current object.
(Inherited from Object)
UrlState(Action<DashboardUrlStateOptionBuilder>)
Allows you to use the UrlState extension.
ViewerApi(Action<DashboardViewerApiOptionBuilder>)
Allows you to use the ViewerApi extension.
See Also
|
__label__pos
| 0.872491 |
Page 1
Electricity and Magnetism For 50 years, Edward M. Purcell’s classic textbook has introduced students to the world of electricity and magnetism. This third edition has been brought up to date and is now in SI units. It features hundreds of new examples, problems, and figures, and contains discussions of real-life applications. The textbook covers all the standard introductory topics, such as electrostatics, magnetism, circuits, electromagnetic waves, and electric and magnetic fields in matter. Taking a nontraditional approach, magnetism is derived as a relativistic effect. Mathematical concepts are introduced in parallel with the physical topics at hand, making the motivations clear. Macroscopic phenomena are derived rigorously from the underlying microscopic physics. With worked examples, hundreds of illustrations, and nearly 600 end-of-chapter problems and exercises, this textbook is ideal for electricity and magnetism courses. Solutions to the exercises are available for instructors at www.cambridge.org/Purcell-Morin. EDWARD M . PURCELL
(1912–1997) was the recipient of many awards for his scientific,
educational, and civic work. In 1952 he shared the Nobel Prize for Physics for the discovery of nuclear magnetic resonance in liquids and solids, an elegant and precise method of determining the chemical structure of materials that serves as the basis for numerous applications, including magnetic resonance imaging (MRI). During his career he served as science adviser to Presidents Dwight D. Eisenhower, John F. Kennedy, and Lyndon B. Johnson. DAVID J . MORIN
is a Lecturer and the Associate Director of Undergraduate Studies in the
Department of Physics, Harvard University. He is the author of the textbook Introduction to Classical Mechanics (Cambridge University Press, 2008).
THIRD EDITION
ELECTRICITY AND MAGNETISM EDWARD M. PURCELL DAVID J. MORIN Harvard University, Massachusetts
CA M B R I D G E U N I V E R S I T Y P R E S S
Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo, Delhi, Mexico City Cambridge University Press The Edinburgh Building, Cambridge CB2 8RU, UK Published in the United States of America by Cambridge University Press, New York www.cambridge.org Information on this title: www.cambridge.org/Purcell-Morin © D. Purcell, F. Purcell, and D. Morin 2013 This edition is not for sale in India. This publication is in copyright. Subject to statutory exception and to the provisions of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. Previously published by Mc-Graw Hill, Inc., 1985 First edition published by Education Development Center, Inc., 1963, 1964, 1965 First published by Cambridge University Press 2013 Printed in the United States by Sheridan Inc. A catalog record for this publication is available from the British Library Library of Congress cataloging-in-publication data Purcell, Edward M. Electricity and magnetism / Edward M. Purcell, David J. Morin, Harvard University, Massachusetts. – Third edition. pages cm ISBN 978-1-107-01402-2 (Hardback) 1. Electricity. 2. Magnetism. I. Title. QC522.P85 2012 537–dc23 2012034622 ISBN 978-1-107-01402-2 Hardback Additional resources for this publication at www.cambridge.org/Purcell-Morin Cambridge University Press has no responsibility for the persistence or accuracy of URLs for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate.
Preface to the third edition of Volume 2
xiii
Preface to the second edition of Volume 2
xvii
Preface to the first edition of Volume 2
xxi
CHAPTER 1 ELECTROSTATICS: CHARGES AND FIELDS 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16
Electric charge Conservation of charge Quantization of charge Coulomb’s law Energy of a system of charges Electrical energy in a crystal lattice The electric field Charge distributions Flux Gauss’s law Field of a spherical charge distribution Field of a line charge Field of an infinite flat sheet of charge The force on a layer of charge Energy associated with the electric field Applications
1 1 4 5 7 11 14 16 20 22 23 26 28 29 30 33 35
CONTENTS
vi
CONTENTS
Chapter summary Problems Exercises CHAPTER 2 THE ELECTRIC POTENTIAL 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18
Line integral of the electric field Potential difference and the potential function Gradient of a scalar function Derivation of the field from the potential Potential of a charge distribution Uniformly charged disk Dipoles Divergence of a vector function Gauss’s theorem and the differential form of Gauss’s law The divergence in Cartesian coordinates The Laplacian Laplace’s equation Distinguishing the physics from the mathematics The curl of a vector function Stokes’ theorem The curl in Cartesian coordinates The physical meaning of the curl Applications Chapter summary Problems Exercises
CHAPTER 3 ELECTRIC FIELDS AROUND CONDUCTORS 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9
Conductors and insulators Conductors in the electrostatic field The general electrostatic problem and the uniqueness theorem Image charges Capacitance and capacitors Potentials and charges on several conductors Energy stored in a capacitor Other views of the boundary-value problem Applications Chapter summary
38 39 47
58 59 61 63 65 65 68 73 78 79 81 85 86 88 90 92 93 95 100 103 105 112
124 125 126 132 136 141 147 149 151 153 155
CONTENTS
Problems Exercises
155 163
CHAPTER 4 ELECTRIC CURRENTS
177
4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12
Electric current and current density Steady currents and charge conservation Electrical conductivity and Ohm’s law The physics of electrical conduction Conduction in metals Semiconductors Circuits and circuit elements Energy dissipation in current flow Electromotive force and the voltaic cell Networks with voltage sources Variable currents in capacitors and resistors Applications Chapter summary Problems Exercises
CHAPTER 5 THE FIELDS OF MOVING CHARGES 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9
From Oersted to Einstein Magnetic forces Measurement of charge in motion Invariance of charge Electric field measured in different frames of reference Field of a point charge moving with constant velocity Field of a charge that starts or stops Force on a moving charge Interaction between a moving charge and other moving charges Chapter summary Problems Exercises
CHAPTER 6 THE MAGNETIC FIELD 6.1 6.2
Definition of the magnetic field Some properties of the magnetic field
177 180 181 189 198 200 204 207 209 212 215 217 221 222 226
235 236 237 239 241 243 247 251 255 259 267 268 270
277 278 286
vii
viii
CONTENTS
Vector potential Field of any current-carrying wire Fields of rings and coils Change in B at a current sheet How the fields transform Rowland’s experiment Electrical conduction in a magnetic field: the Hall effect 6.10 Applications Chapter summary Problems Exercises 6.3 6.4 6.5 6.6 6.7 6.8 6.9
CHAPTER 7 ELECTROMAGNETIC INDUCTION 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11
Faraday’s discovery Conducting rod moving through a uniform magnetic field Loop moving through a nonuniform magnetic field Stationary loop with the field source moving Universal law of induction Mutual inductance A reciprocity theorem Self-inductance Circuit containing self-inductance Energy stored in the magnetic field Applications Chapter summary Problems Exercises
CHAPTER 8 ALTERNATING-CURRENT CIRCUITS 8.1 8.2 8.3 8.4 8.5 8.6 8.7
A resonant circuit Alternating current Complex exponential solutions Alternating-current networks Admittance and impedance Power and energy in alternating-current circuits Applications Chapter summary Problems Exercises
293 296 299 303 306 314 314 317 322 323 331
342 343 345 346 352 355 359 362 364 366 368 369 373 374 380
388 388 394 402 405 408 415 418 420 421 424
CONTENTS
CHAPTER 9 MAXWELL’S EQUATIONS AND ELECTROMAGNETIC WAVES 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8
“Something is missing” The displacement current Maxwell’s equations An electromagnetic wave Other waveforms; superposition of waves Energy transport by electromagnetic waves How a wave looks in a different frame Applications Chapter summary Problems Exercises
CHAPTER 10 ELECTRIC FIELDS IN MATTER 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11 10.12 10.13 10.14 10.15 10.16
Dielectrics The moments of a charge distribution The potential and field of a dipole The torque and the force on a dipole in an external field Atomic and molecular dipoles; induced dipole moments Permanent dipole moments The electric field caused by polarized matter Another look at the capacitor The field of a polarized sphere A dielectric sphere in a uniform field The field of a charge in a dielectric medium, and Gauss’s law A microscopic view of the dielectric Polarization in changing fields The bound-charge current An electromagnetic wave in a dielectric Applications Chapter summary Problems Exercises
CHAPTER 11 MAGNETIC FIELDS IN MATTER 11.1
How various substances respond to a magnetic field
430 430 433 436 438 441 446 452 454 455 457 461
466 467 471 474 477 479 482 483 489 492 495 497 500 504 505 507 509 511 513 516
523 524
ix
x
CONTENTS
11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.10 11.11 11.12
The absence of magnetic “charge” The field of a current loop The force on a dipole in an external field Electric currents in atoms Electron spin and magnetic moment Magnetic susceptibility The magnetic field caused by magnetized matter The field of a permanent magnet Free currents, and the field H Ferromagnetism Applications Chapter summary Problems Exercises
CHAPTER 12 SOLUTIONS TO THE PROBLEMS 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 12.10 12.11
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11
529 531 535 540 546 549 551 557 559 565 570 573 575 577
586 586 611 636 660 678 684 707 722 734 744 755
Appendix A: Differences between SI and Gaussian units
762
Appendix B: SI units of common quantities
769
Appendix C: Unit conversions
774
Appendix D: SI and Gaussian formulas
778
Appendix E: Exact relations among SI and Gaussian units
789
CONTENTS
Appendix F: Curvilinear coordinates
791
Appendix G: A short review of special relativity
804
Appendix H: Radiation by an accelerated charge
812
Appendix I: Superconductivity
817
Appendix J: Magnetic resonance
821
Appendix K: Helpful formulas/facts
825
References
831
Index
833
xi
For 50 years, physics students have enjoyed learning about electricity and magnetism through the first two editions of this book. The purpose of the present edition is to bring certain things up to date and to add new material, in the hopes that the trend will continue. The main changes from the second edition are (1) the conversion from Gaussian units to SI units, and (2) the addition of many solved problems and examples. The first of these changes is due to the fact that the vast majority of courses on electricity and magnetism are now taught in SI units. The second edition fell out of print at one point, and it was hard to watch such a wonderful book fade away because it wasn’t compatible with the way the subject is presently taught. Of course, there are differing opinions as to which system of units is “better” for an introductory course. But this issue is moot, given the reality of these courses. For students interested in working with Gaussian units, or for instructors who want their students to gain exposure to both systems, I have created a number of appendices that should be helpful. Appendix A discusses the differences between the SI and Gaussian systems. Appendix C derives the conversion factors between the corresponding units in the two systems. Appendix D explains how to convert formulas from SI to Gaussian; it then lists, side by side, the SI and Gaussian expressions for every important result in the book. A little time spent looking at this appendix will make it clear how to convert formulas from one system to the other. The second main change in the book is the addition of many solved problems, and also many new examples in the text. Each chapter ends with “problems” and “exercises.” The solutions to the “problems” are located in Chapter 12. The only official difference between the problems
Preface to the third edition of Volume 2
xiv
Preface to the third edition of Volume 2
and exercises is that the problems have solutions included, whereas the exercises do not. (A separate solutions manual for the exercises is available to instructors.) In practice, however, one difference is that some of the more theorem-ish results are presented in the problems, so that students can use these results in other problems/exercises. Some advice on using the solutions to the problems: problems (and exercises) are given a (very subjective) difficulty rating from 1 star to 4 stars. If you are having trouble solving a problem, it is critical that you don’t look at the solution too soon. Brood over it for a while. If you do finally look at the solution, don’t just read it through. Instead, cover it up with a piece of paper and read one line at a time until you reach a hint to get you started. Then set the book aside and work things out for real. That’s the only way it will sink in. It’s quite astonishing how unhelpful it is simply to read a solution. You’d think it would do some good, but in fact it is completely ineffective in raising your understanding to the next level. Of course, a careful reading of the text, including perhaps a few problem solutions, is necessary to get the basics down. But if Level 1 is understanding the basic concepts, and Level 2 is being able to apply those concepts, then you can read and read until the cows come home, and you’ll never get past Level 1. The overall structure of the text is essentially the same as in the second edition, although a few new sections have been added. Section 2.7 introduces dipoles. The more formal treatment of dipoles, along with their applications, remains in place in Chapter 10. But because the fundamentals of dipoles can be understood using only the concepts developed in Chapters 1 and 2, it seems appropriate to cover this subject earlier in the book. Section 8.3 introduces the important technique of solving differential equations by forming complex solutions and then taking the real part. Section 9.6.2 deals with the Poynting vector, which opens up the door to some very cool problems. Each chapter concludes with a list of “everyday” applications of electricity and magnetism. The discussions are brief. The main purpose of these sections is to present a list of fun topics that deserve further investigation. You can carry onward with some combination of books/ internet/people/pondering. There is effectively an infinite amount of information out there (see the references at the beginning of Section 1.16 for some starting points), so my goal in these sections is simply to provide a springboard for further study. The intertwined nature of electricity, magnetism, and relativity is discussed in detail in Chapter 5. Many students find this material highly illuminating, although some find it a bit difficult. (However, these two groups are by no means mutually exclusive!) For instructors who wish to take a less theoretical route, it is possible to skip directly from Chapter 4 to Chapter 6, with only a brief mention of the main result from Chapter 5, namely the magnetic field due to a straight current-carrying wire.
Preface to the third edition of Volume 2
The use of non-Cartesian coordinates (cylindrical, spherical) is more prominent in the present edition. For setups possessing certain symmetries, a wisely chosen system of coordinates can greatly simplify the calculations. Appendix F gives a review of the various vector operators in the different systems. Compared with the second edition, the level of difficulty of the present edition is slightly higher, due to a number of hefty problems that have been added. If you are looking for an extra challenge, these problems should keep you on your toes. However, if these are ignored (which they certainly can be, in any standard course using this book), then the level of difficulty is roughly the same. I am grateful to all the students who used a draft version of this book and provided feedback. Their input has been invaluable. I would also like to thank Jacob Barandes for many illuminating discussions of the more subtle topics in the book. Paul Horowitz helped get the project off the ground and has been an endless supplier of cool facts. It was a pleasure brainstorming with Andrew Milewski, who offered many ideas for clever new problems. Howard Georgi and Wolfgang Rueckner provided much-appreciated sounding boards and sanity checks. Takuya Kitagawa carefully read through a draft version and offered many helpful suggestions. Other friends and colleagues whose input I am grateful for are: Allen Crockett, David Derbes, John Doyle, Gary Feldman, Melissa Franklin, Jerome Fung, Jene Golovchenko, Doug Goodale, Robert Hart, Tom Hayes, Peter Hedman, Jennifer Hoffman, Charlie Holbrow, Gareth Kafka, Alan Levine, Aneesh Manohar, Kirk McDonald, Masahiro Morii, Lev Okun, Joon Pahk, Dave Patterson, Mara Prentiss, Dennis Purcell, Frank Purcell, Daniel Rosenberg, Emily Russell, Roy Shwitters, Nils Sorensen, Josh Winn, and Amir Yacoby. I would also like to thank the editorial and production group at Cambridge University Press for their professional work in transforming the second edition of this book into the present one. It has been a pleasure working with Lindsay Barnes, Simon Capelin, Irene Pizzie, Charlotte Thomas, and Ali Woollatt. Despite careful editing, there is zero probability that this book is error free. A great deal of new material has been added, and errors have undoubtedly crept in. If anything looks amiss, please check the webpage www.cambridge.org/Purcell-Morin for a list of typos, updates, etc. And please let me know if you discover something that isn’t already posted. Suggestions are always welcome. David Morin
xv
This revision of “Electricity and Magnetism,” Volume 2 of the Berkeley Physics Course, has been made with three broad aims in mind. First, I have tried to make the text clearer at many points. In years of use teachers and students have found innumerable places where a simplification or reorganization of an explanation could make it easier to follow. Doubtless some opportunities for such improvements have still been missed; not too many, I hope. A second aim was to make the book practically independent of its companion volumes in the Berkeley Physics Course. As originally conceived it was bracketed between Volume I, which provided the needed special relativity, and Volume 3, “Waves and Oscillations,” to which was allocated the topic of electromagnetic waves. As it has turned out, Volume 2 has been rather widely used alone. In recognition of that I have made certain changes and additions. A concise review of the relations of special relativity is included as Appendix A. Some previous introduction to relativity is still assumed. The review provides a handy reference and summary for the ideas and formulas we need to understand the fields of moving charges and their transformation from one frame to another. The development of Maxwell’s equations for the vacuum has been transferred from the heavily loaded Chapter 7 (on induction) to a new Chapter 9, where it leads naturally into an elementary treatment of plane electromagnetic waves, both running and standing. The propagation of a wave in a dielectric medium can then be treated in Chapter 10 on Electric Fields in Matter. A third need, to modernize the treatment of certain topics, was most urgent in the chapter on electrical conduction. A substantially rewritten
Preface to the second edition of Volume 2
xviii
Preface to the second edition of Volume 2
Chapter 4 now includes a section on the physics of homogeneous semiconductors, including doped semiconductors. Devices are not included, not even a rectifying junction, but what is said about bands, and donors and acceptors, could serve as starting point for development of such topics by the instructor. Thanks to solid-state electronics the physics of the voltaic cell has become even more relevant to daily life as the number of batteries in use approaches in order of magnitude the world’s population. In the first edition of this book I unwisely chose as the example of an electrolytic cell the one cell—the Weston standard cell—which advances in physics were soon to render utterly obsolete. That section has been replaced by an analysis, with new diagrams, of the lead-acid storage battery—ancient, ubiquitous, and far from obsolete. One would hardly have expected that, in the revision of an elementary text in classical electromagnetism, attention would have to be paid to new developments in particle physics. But that is the case for two questions that were discussed in the first edition, the significance of charge quantization, and the apparent absence of magnetic monopoles. Observation of proton decay would profoundly affect our view of the first question. Assiduous searches for that, and also for magnetic monopoles, have at this writing yielded no confirmed events, but the possibility of such fundamental discoveries remains open. Three special topics, optional extensions of the text, are introduced in short appendixes: Appendix B: Radiation by an Accelerated Charge; Appendix C: Superconductivity; and Appendix D: Magnetic Resonance. Our primary system of units remains the Gaussian CGS system. The SI units, ampere, coulomb, volt, ohm, and tesla are also introduced in the text and used in many of the problems. Major formulas are repeated in their SI formulation with explicit directions about units and conversion factors. The charts inside the back cover summarize the basic relations in both systems of units. A special chart in Chapter 11 reviews, in both systems, the relations involving magnetic polarization. The student is not expected, or encouraged, to memorize conversion factors, though some may become more or less familiar through use, but to look them up whenever needed. There is no objection to a “mixed” unit like the ohmcm, still often used for resistivity, providing its meaning is perfectly clear. The definition of the meter in terms of an assigned value for the speed of light, which has just become official, simplifies the exact relations among the units, as briefly explained in Appendix E. There are some 300 problems, more than half of them new. It is not possible to thank individually all the teachers and students who have made good suggestions for changes and corrections. I fear that some will be disappointed to find that their suggestions have not been followed quite as they intended. That the net result is a substantial improvement I hope most readers familiar with the first edition will agree.
Preface to the second edition of Volume 2
Mistakes both old and new will surely be found. Communications pointing them out will be gratefully received. It is a pleasure to thank Olive S. Rand for her patient and skillful assistance in the production of the manuscript. Edward M. Purcell
xix
The subject of this volume of the Berkeley Physics Course is electricity and magnetism. The sequence of topics, in rough outline, is not unusual: electrostatics; steady currents; magnetic field; electromagnetic induction; electric and magnetic polarization in matter. However, our approach is different from the traditional one. The difference is most conspicuous in Chaps. 5 and 6 where, building on the work of Vol. I, we treat the electric and magnetic fields of moving charges as manifestations of relativity and the invariance of electric charge. This approach focuses attention on some fundamental questions, such as: charge conservation, charge invariance, the meaning of field. The only formal apparatus of special relativity that is really necessary is the Lorentz transformation of coordinates and the velocity-addition formula. It is essential, though, that the student bring to this part of the course some of the ideas and attitudes Vol. I sought to develop—among them a readiness to look at things from different frames of reference, an appreciation of invariance, and a respect for symmetry arguments. We make much use also, in Vol. II, of arguments based on superposition. Our approach to electric and magnetic phenomena in matter is primarily “microscopic,� with emphasis on the nature of atomic and molecular dipoles, both electric and magnetic. Electric conduction, also, is described microscopically in the terms of a Drude-Lorentz model. Naturally some questions have to be left open until the student takes up quantum physics in Vol. IV. But we freely talk in a matter-of-fact way about molecules and atoms as electrical structures with size, shape, and stiffness, about electron orbits, and spin. We try to treat carefully a question that is sometimes avoided and sometimes beclouded in introductory texts, the meaning of the macroscopic fields E and B inside a material.
Preface to the first edition of Volume 2
xxii
Preface to the first edition of Volume 2
In Vol. II, the student’s mathematical equipment is extended by adding some tools of the vector calculus—gradient, divergence, curl, and the Laplacian. These concepts are developed as needed in the early chapters. In its preliminary versions, Vol. II has been used in several classes at the University of California. It has benefited from criticism by many people connected with the Berkeley Course, especially from contributions by E. D. Commins and F. S. Crawford, Jr., who taught the first classes to use the text. They and their students discovered numerous places where clarification, or something more drastic, was needed; many of the revisions were based on their suggestions. Students’ criticisms of the last preliminary version were collected by Robert Goren, who also helped to organize the problems. Valuable criticism has come also from J. D. Gavenda, who used the preliminary version at the University of Texas, and from E. F. Taylor, of Wesleyan University. Ideas were contributed by Allan Kaufman at an early stage of the writing. A. Felzer worked through most of the first draft as our first “test student.” The development of this approach to electricity and magnetism was encouraged, not only by our original Course Committee, but by colleagues active in a rather parallel development of new course material at the Massachusetts Institute of Technology. Among the latter, J. R. Tessman, of the MIT Science Teaching Center and Tufts University, was especially helpful and influential in the early formulation of the strategy. He has used the preliminary version in class, at MIT, and his critical reading of the entire text has resulted in many further changes and corrections. Publication of the preliminary version, with its successive revisions, was supervised by Mrs. Mary R. Maloney. Mrs. Lila Lowell typed most of the manuscript. The illustrations were put into final form by Felix Cooper. The author of this volume remains deeply grateful to his friends in Berkeley, and most of all to Charles Kittel, for the stimulation and constant encouragement that have made the long task enjoyable. Edward M. Purcell
1 Overview The existence of this book is owed (both figuratively and literally) to the fact that the building blocks of matter possess a quality called charge. Two important aspects of charge are conservation and quantization. The electric force between two charges is given by Coulomb’s law. Like the gravitational force, the electric force falls off like 1/r2 . It is conservative, so we can talk about the potential energy of a system of charges (the work done in assembling them). A very useful concept is the electric field, which is defined as the force per unit charge. Every point in space has a unique electric field associated with it. We can define the flux of the electric field through a given surface. This leads us to Gauss’s law, which is an alternative way of stating Coulomb’s law. In cases involving sufficient symmetry, it is much quicker to calculate the electric field via Gauss’s law than via Coulomb’s law and direct integration. Finally, we discuss the energy density in the electric field, which provides another way of calculating the potential energy of a system. 1.1 Electric charge Electricity appeared to its early investigators as an extraordinary phenomenon. To draw from bodies the “subtle fire,” as it was sometimes called, to bring an object into a highly electrified state, to produce a steady flow of current, called for skillful contrivance. Except for the spectacle of lightning, the ordinary manifestations of nature, from the freezing of water to the growth of a tree, seemed to have no relation to the curious behavior of electrified objects. We know now that electrical
Electrostatics: charges and fields
2
Electrostatics: charges and fields
forces largely determine the physical and chemical properties of matter over the whole range from atom to living cell. For this understanding we have to thank the scientists of the nineteenth century, Ampère, Faraday, Maxwell, and many others, who discovered the nature of electromagnetism, as well as the physicists and chemists of the twentieth century who unraveled the atomic structure of matter. Classical electromagnetism deals with electric charges and currents and their interactions as if all the quantities involved could be measured independently, with unlimited precision. Here classical means simply “nonquantum.” The quantum law with its constant h is ignored in the classical theory of electromagnetism, just as it is in ordinary mechanics. Indeed, the classical theory was brought very nearly to its present state of completion before Planck’s discovery of quantum effects in 1900. It has survived remarkably well. Neither the revolution of quantum physics nor the development of special relativity dimmed the luster of the electromagnetic field equations Maxwell wrote down 150 years ago. Of course the theory was solidly based on experiment, and because of that was fairly secure within its original range of application – to coils, capacitors, oscillating currents, and eventually radio waves and light waves. But even so great a success does not guarantee validity in another domain, for instance, the inside of a molecule. Two facts help to explain the continuing importance in modern physics of the classical description of electromagnetism. First, special relativity required no revision of classical electromagnetism. Historically speaking, special relativity grew out of classical electromagnetic theory and experiments inspired by it. Maxwell’s field equations, developed long before the work of Lorentz and Einstein, proved to be entirely compatible with relativity. Second, quantum modifications of the electromagnetic forces have turned out to be unimportant down to distances less than 10−12 meters, 100 times smaller than the atom. We can describe the repulsion and attraction of particles in the atom using the same laws that apply to the leaves of an electroscope, although we need quantum mechanics to predict how the particles will behave under those forces. For still smaller distances, a fusion of electromagnetic theory and quantum theory, called quantum electrodynamics, has been remarkably successful. Its predictions are confirmed by experiment down to the smallest distances yet explored. It is assumed that the reader has some acquaintance with the elementary facts of electricity. We are not going to review all the experiments by which the existence of electric charge was demonstrated, nor shall we review all the evidence for the electrical constitution of matter. On the other hand, we do want to look carefully at the experimental foundations of the basic laws on which all else depends. In this chapter we shall study the physics of stationary electric charges – electrostatics. Certainly one fundamental property of electric charge is its existence in the two varieties that were long ago named positive and negative.
1.1 Electric charge
The observed fact is that all charged particles can be divided into two classes such that all members of one class repel each other, while attracting members of the other class. If two small electrically charged bodies A and B, some distance apart, attract one another, and if A attracts some third electrified body C, then we always find that B repels C. Contrast this with gravitation: there is only one kind of gravitational mass, and every mass attracts every other mass. One may regard the two kinds of charge, positive and negative, as opposite manifestations of one quality, much as right and left are the two kinds of handedness. Indeed, in the physics of elementary particles, questions involving the sign of the charge are sometimes linked to a question of handedness, and to another basic symmetry, the relation of a sequence of events, a, then b, then c, to the temporally reversed sequence c, then b, then a. It is only the duality of electric charge that concerns us here. For every kind of particle in nature, as far as we know, there can exist an antiparticle, a sort of electrical “mirror image.” The antiparticle carries charge of the opposite sign. If any other intrinsic quality of the particle has an opposite, the antiparticle has that too, whereas in a property that admits no opposite, such as mass, the antiparticle and particle are exactly alike. The electron’s charge is negative; its antiparticle, called a positron, has a positive charge, but its mass is precisely the same as that of the electron. The proton’s antiparticle is called simply an antiproton; its electric charge is negative. An electron and a proton combine to make an ordinary hydrogen atom. A positron and an antiproton could combine in the same way to make an atom of antihydrogen. Given the building blocks, positrons, antiprotons, and antineutrons,1 there could be built up the whole range of antimatter, from antihydrogen to antigalaxies. There is a practical difficulty, of course. Should a positron meet an electron or an antiproton meet a proton, that pair of particles will quickly vanish in a burst of radiation. It is therefore not surprising that even positrons and antiprotons, not to speak of antiatoms, are exceedingly rare and short-lived in our world. Perhaps the universe contains, somewhere, a vast concentration of antimatter. If so, its whereabouts is a cosmological mystery. The universe around us consists overwhelmingly of matter, not antimatter. That is to say, the abundant carriers of negative charge are electrons, and the abundant carriers of positive charge are protons. The proton is nearly 2000 times heavier than the electron, and very different, too, in some other respects. Thus matter at the atomic level incorporates negative and positive electricity in quite different ways. The positive charge is all in the atomic nucleus, bound within a massive structure no more than 10−14 m in size, while the negative charge is spread, in 1 Although the electric charge of each is zero, the neutron and its antiparticle are not
interchangeable. In certain properties that do not concern us here, they are opposite.
3
4
Electrostatics: charges and fields
effect, through a region about 104 times larger in dimensions. It is hard to imagine what atoms and molecules – and all of chemistry – would be like, if not for this fundamental electrical asymmetry of matter. What we call negative charge, by the way, could just as well have been called positive. The name was a historical accident. There is nothing essentially negative about the charge of an electron. It is not like a negative integer. A negative integer, once multiplication has been defined, differs essentially from a positive integer in that its square is an integer of opposite sign. But the product of two charges is not a charge; there is no comparison. Two other properties of electric charge are essential in the electrical structure of matter: charge is conserved, and charge is quantized. These properties involve quantity of charge and thus imply a measurement of charge. Presently we shall state precisely how charge can be measured in terms of the force between charges a certain distance apart, and so on. But let us take this for granted for the time being, so that we may talk freely about these fundamental facts.
1.2 Conservation of charge Pho
ton
Before
e– e+
After
Figure 1.1. Charged particles are created in pairs with equal and opposite charge.
The total charge in an isolated system never changes. By isolated we mean that no matter is allowed to cross the boundary of the system. We could let light pass into or out of the system, since the “particles” of light, called photons, carry no charge at all. Within the system charged particles may vanish or reappear, but they always do so in pairs of equal and opposite charge. For instance, a thin-walled box in a vacuum exposed to gamma rays might become the scene of a “pair-creation” event in which a high-energy photon ends its existence with the creation of an electron and a positron (Fig. 1.1). Two electrically charged particles have been newly created, but the net change in total charge, in and on the box, is zero. An event that would violate the law we have just stated would be the creation of a positively charged particle without the simultaneous creation of a negatively charged particle. Such an occurrence has never been observed. Of course, if the electric charges of an electron and a positron were not precisely equal in magnitude, pair creation would still violate the strict law of charge conservation. That equality is a manifestation of the particle–antiparticle duality already mentioned, a universal symmetry of nature. One thing will become clear in the course of our study of electromagnetism: nonconservation of charge would be quite incompatible with the structure of our present electromagnetic theory. We may therefore state, either as a postulate of the theory or as an empirical law supported without exception by all observations so far, the charge conservation law:
1.3 Quantization of charge
The total electric charge in an isolated system, that is, the algebraic sum of the positive and negative charge present at any time, never changes. Sooner or later we must ask whether this law meets the test of relativistic invariance. We shall postpone until Chapter 5 a thorough discussion of this important question. But the answer is that it does, and not merely in the sense that the statement above holds in any given inertial frame, but in the stronger sense that observers in different frames, measuring the charge, obtain the same number. In other words, the total electric charge of an isolated system is a relativistically invariant number.
1.3 Quantization of charge The electric charges we find in nature come in units of one magnitude only, equal to the amount of charge carried by a single electron. We denote the magnitude of that charge by e. (When we are paying attention to sign, we write −e for the charge on the electron itself.) We have already noted that the positron carries precisely that amount of charge, as it must if charge is to be conserved when an electron and a positron annihilate, leaving nothing but light. What seems more remarkable is the apparently exact equality of the charges carried by all other charged particles – the equality, for instance, of the positive charge on the proton and the negative charge on the electron. That particular equality is easy to test experimentally. We can see whether the net electric charge carried by a hydrogen molecule, which consists of two protons and two electrons, is zero. In an experiment carried out by J. G. King,2 hydrogen gas was compressed into a tank that was electrically insulated from its surroundings. The tank contained about 5 · 1024 molecules (approximately 17 grams) of hydrogen. The gas was then allowed to escape by means that prevented the escape of any ion – a molecule with an electron missing or an extra electron attached. If the charge on the proton differed from that on the electron by, say, one part in a billion, then each hydrogen molecule would carry a charge of 2 · 10−9 e, and the departure of the whole mass of hydrogen would alter the charge of the tank by 1016 e, a gigantic effect. In fact, the experiment could have revealed a residual molecular charge as small as 2 · 10−20 e, and none was observed. This proved that the proton and the electron do not differ in magnitude of charge by more than 1 part in 1020 . Perhaps the equality is really exact for some reason we don’t yet understand. It may be connected with the possibility, suggested by certain 2 See King (1960). References to previous tests of charge equality will be found in this
article and in the chapter by V. W. Hughes in Hughes (1964).
5
6
Electrostatics: charges and fields
theories, that a proton can, very rarely, decay into a positron and some uncharged particles. If that were to occur, even the slightest discrepancy between proton charge and positron charge would violate charge conservation. Several experiments designed to detect the decay of a proton have not yet, as of this writing, registered with certainty a single decay. If and when such an event is observed, it will show that exact equality of the magnitude of the charge of the proton and the charge of the electron (the positron’s antiparticle) can be regarded as a corollary of the more general law of charge conservation. That notwithstanding, we now know that the internal structure of all the strongly interacting particles called hadrons – a class that includes the proton and the neutron – involves basic units called quarks, whose electric charges come in multiples of e/3. The proton, for example, is made with three quarks, two with charge 2e/3 and one with charge −e/3. The neutron contains one quark with charge 2e/3 and two quarks with charge −e/3. Several experimenters have searched for single quarks, either free or attached to ordinary matter. The fractional charge of such a quark, since it cannot be neutralized by any number of electrons or protons, should betray the quark’s presence. So far no fractionally charged particle has been conclusively identified. The present theory of the strong interactions, called quantum chromodynamics, explains why the liberation of a quark from a hadron is most likely impossible. The fact of charge quantization lies outside the scope of classical electromagnetism, of course. We shall usually ignore it and act as if our point charges q could have any strength whatsoever. This will not get us into trouble. Still, it is worth remembering that classical theory cannot be expected to explain the structure of the elementary particles. (It is not certain that present quantum theory can either!) What holds the electron together is as mysterious as what fixes the precise value of its charge. Something more than electrical forces must be involved, for the electrostatic forces between different parts of the electron would be repulsive. In our study of electricity and magnetism we shall treat the charged particles simply as carriers of charge, with dimensions so small that their extension and structure is, for most purposes, quite insignificant. In the case of the proton, for example, we know from high-energy scattering experiments that the electric charge does not extend appreciably beyond a radius of 10−15 m. We recall that Rutherford’s analysis of the scattering of alpha particles showed that even heavy nuclei have their electric charge distributed over a region smaller than 10−13 m. For the physicist of the nineteenth century a “point charge” remained an abstract notion. Today we are on familiar terms with the atomic particles. The graininess of electricity is so conspicuous in our modern description of nature that we find a point charge less of an artificial idealization than a smoothly varying distribution of charge density. When we postulate such smooth charge distributions, we may think of them as averages over very
1.4 Coulomb’s law
large numbers of elementary charges, in the same way that we can define the macroscopic density of a liquid, its lumpiness on a molecular scale notwithstanding.
1.4 Coulomb’s law As you probably already know, the interaction between electric charges at rest is described by Coulomb’s law: two stationary electric charges repel or attract one another with a force proportional to the product of the magnitude of the charges and inversely proportional to the square of the distance between them. We can state this compactly in vector form: F2 = k
q1 q2 rˆ 21 . 2 r21
(1.1)
Here q1 and q2 are numbers (scalars) giving the magnitude and sign of the respective charges, rˆ 21 is the unit vector in the direction3 from charge 1 to charge 2, and F2 is the force acting on charge 2. Thus Eq. (1.1) expresses, among other things, the fact that like charges repel and unlike charges attract. Also, the force obeys Newton’s third law; that is, F2 = −F1 . The unit vector rˆ 21 shows that the force is parallel to the line joining the charges. It could not be otherwise unless space itself has some builtin directional property, for with two point charges alone in empty and isotropic space, no other direction could be singled out. If the point charge itself had some internal structure, with an axis defining a direction, then it would have to be described by more than the mere scalar quantity q. It is true that some elementary particles, including the electron, do have another property, called spin. This gives rise to a magnetic force between two electrons in addition to their electrostatic repulsion. This magnetic force does not, in general, act in the direction of the line joining the two particles. It decreases with the inverse fourth power of the distance, and at atomic distances of 10−10 m the Coulomb force is already about 104 times stronger than the magnetic interaction of the spins. Another magnetic force appears if our charges are moving – hence the restriction to stationary charges in our statement of Coulomb’s law. We shall return to these magnetic phenomena in later chapters. Of course we must assume, in writing Eq. (1.1), that both charges are well localized, each occupying a region small compared with r21 . Otherwise we could not even define the distance r21 precisely. The value of the constant k in Eq. (1.1) depends on the units in which r, F, and q are to be expressed. In this book we will use the International System of Units, or “SI” units for short. This system is based on the 3 The convention we adopt here may not seem the natural choice, but it is more
consistent with the usage in some other parts of physics and we shall try to follow it throughout this book.
7
8
Electrostatics: charges and fields
meter, kilogram, and second as units of length, mass, and time. The SI unit of charge is the coulomb (C). Some other SI electrical units that we will eventually become familiar with are the volt, ohm, ampere, and tesla. The official definition of the coulomb involves the magnetic force, which we will discuss in Chapter 6. For present purposes, we can define the coulomb as follows. Two like charges, each of 1 coulomb, repel one another with a force of 8.988 · 109 newtons when they are 1 meter apart. In other words, the k in Eq. (1.1) is given by k = 8.988 · 109
8 esu F = 10 dynes rs ete
20 esu 4
esu
tim cen
F=
q1q2
N m2 . C2
In Chapter 6 we will learn where this seemingly arbitrary value of k comes from. In general, approximating k by 9 · 109 N m2 /C2 is quite sufficient. The magnitude of e, the fundamental quantum of electric charge, happens to be about 1.602 · 10−19 C. So if you wish, you may think of a coulomb as defined to be the magnitude of the charge contained in 6.242 · 1018 electrons. Instead of k, it is customary (for historical reasons) to introduce a constant 0 which is defined by
r 221 cm2
1 k≡ ⇒ 4π 0
F = 10 dynes
(1.2)
C2 1 0 ≡ = 8.854 · 10−12 4π k N m2
C2 s2 or kg m3
.
(1.3)
1 newton = 105 dynes
In terms of 0 , Coulomb’s law in Eq. (1.1) takes the form
1 coulomb = 2.998 × 109 esu e = 4.802 × 10−10 esu = 1.602 × 10−19 coulomb
F = 8.988 ×
108
newtons
F=
1 q1 q2 rˆ 21 2 4π 0 r21
(1.4)
2 coulombs coulomb 5 coulombs
rs ete
m 10
F=
1 4p
newtons F = 8.988 × 108 newtons
q1q2 0
r 221
m2
8.988 × 109
−12 0 = 8.854 × 10
Figure 1.2. Coulomb’s law expressed in Gaussian electrostatic units (top) and in SI units (bottom). The constant 0 and the factor relating coulombs to esu are connected, as we shall learn later, with the speed of light. We have rounded off the constants in the figure to four-digit accuracy. The precise values are given in Appendix E.
The constant 0 will appear in many expressions that we will meet in the course of our study. The 4π is included in the definition of 0 so that certain formulas (such as Gauss’s law in Sections 1.10 and 2.9) take on simple forms. Additional details and technicalities concerning 0 can be found in Appendix E. Another system of units that comes up occasionally is the Gaussian system, which is one of several types of cgs systems, short for centimeter–gram–second. (In contrast, the SI system is an mks system, short for meter–kilogram–second.) The Gaussian unit of charge is the “electrostatic unit,” or esu. The esu is defined so that the constant k in Eq. (1.1) exactly equals 1 (and this is simply the number 1, with no units) when r21 is measured in cm, F in dynes, and the q values in esu. Figure 1.2 gives some examples using the SI and Gaussian systems of units. Further discussion of the SI and Gaussian systems can be found in Appendix A.
1.4 Coulomb’s law
Example (Relation between 1 coulomb and 1 esu) Show that 1 coulomb equals 2.998 · 109 esu (which generally can be approximated by 3 · 109 esu). Solution From Eqs. (1.1) and (1.2), two charges of 1 coulomb separated by a distance of 1 m exert a (large!) force of 8.988 · 109 N ≈ 9 · 109 N on each other. We can convert this to the Gaussian unit of force via 1N = 1
(1000 g)(100 cm) kg m g cm = = 105 2 = 105 dynes. s2 s2 s
(1.5)
The two 1 C charges therefore exert a force of 9 · 1014 dynes on each other. How would someone working in Gaussian units describe this situation? In Gaussian units, Coulomb’s law gives the force simply as q2 /r2 . The separation is 100 cm, so if 1 coulomb equals N esu (with N to be determined), the 9 · 1014 dyne force between the charges can be expressed as 9 · 1014 dyne =
(N esu)2 ⇒ N 2 = 9 · 1018 ⇒ N = 3 · 109 . (100 cm)2
(1.6)
Hence,4 1 C = 3 · 109 esu.
(1.7)
The magnitude of the electron charge is then given approximately by e = 1.6 · 10−19 C ≈ 4.8 · 10−10 esu. If we had used the more√exact value of k in Eq. (1.2), the “3” in our result would have been replaced by 8.988 = 2.998. This looks suspiciously similar to the “2.998” in the speed of light, c = 2.998 · 108 m/s. This is no coincidence. We will see in Section 6.1 that Eq. (1.7) can actually be written as 1 C = (10{c}) esu, where we have put the c in brackets to signify that it is just the number 2.998 · 108 without the units of m/s. On an everyday scale, a coulomb is an extremely large amount of charge, as evidenced by the fact that if you have two such charges separated by 1 m (never mind how you would keep each charge from flying apart due to the self repulsion!), the above force of 9 · 109 N between them is about one million tons. The esu is a much more reasonable unit to use for everyday charges. For example, the static charge on a balloon that sticks to your hair is on the order of 10 or 100 esu.
The only way we have of detecting and measuring electric charges is by observing the interaction of charged bodies. One might wonder, then, how much of the apparent content of Coulomb’s law is really only definition. As it stands, the significant physical content is the statement of inverse-square dependence and the implication that electric charge 4 We technically shouldn’t be using an “=” sign here, because it suggests that the units of
a coulomb are the same as those of an esu. This is not the case; they are units in different systems and cannot be expressed in terms of each other. The proper way to express Eq. (1.7) is to say, “1 C is equivalent to 3 · 109 esu.” But we’ll usually just use the “=” sign, and you’ll know what we mean. See Appendix A for further discussion of this.
9
10
Electrostatics: charges and fields
(a)
is additive in its effect. To bring out the latter point, we have to consider more than two charges. After all, if we had only two charges in the world to experiment with, q1 and q2 , we could never measure them 2 . Suppose separately. We could verify only that F is proportional to 1/r21 we have three bodies carrying charges q1 , q2 , and q3 . We can measure the force on q1 when q2 is 10 cm away from q1 , with q3 very far away, as in Fig. 1.3(a). Then we can take q2 away, bring q3 into q2 ’s former position, and again measure the force on q1 . Finally, we can bring q2 and q3 very close together and locate the combination 10 cm from q1 . We find by measurement that the force on q1 is equal to the sum of the forces previously measured. This is a significant result that could not have been predicted by logical arguments from symmetry like the one we used above to show that the force between two point charges had to be along the line joining them. The force with which two charges interact is not changed by the presence of a third charge. No matter how many charges we have in our system, Coulomb’s law in Eq. (1.4) can be used to calculate the interaction of every pair. This is the basis of the principle of superposition, which we shall invoke again and again in our study of electromagnetism. Superposition means combining two sets of sources into one system by adding the second system “on top of” the first without altering the configuration of either one. Our principle ensures that the force on a charge placed at any point in the combined system will be the vector sum of the forces that each set of sources, acting alone, causes to act on a charge at that point. This principle must not be taken lightly for granted. There may well be a domain of phenomena, involving very small distances or very intense forces, where superposition no longer holds. Indeed, we know of quantum phenomena in the electromagnetic field that do represent a failure of superposition, seen from the viewpoint of the classical theory. Thus the physics of electrical interactions comes into full view only when we have more than two charges. We can go beyond the explicit statement of Eq. (1.1) and assert that, with the three charges in Fig. 1.3 occupying any positions whatsoever, the force on any one of them, such as q3 , is correctly given by the following equation:
q2 m
c 10
Great distance
q3
Great distance
q2
q1
(b) q3 m
c 10
q1
(c) q2 q3 10
cm
q1
Figure 1.3. The force on q1 in (c) is the sum of the forces on q1 in (a) and (b).
F=
1 q3 q2 rˆ 32 1 q3 q1 rˆ 31 + . 2 2 4π 0 r31 4π 0 r32
(1.8)
The experimental verification of the inverse-square law of electrical attraction and repulsion has a curious history. Coulomb himself announced the law in 1786 after measuring with a torsion balance the force between small charged spheres. But 20 years earlier Joseph Priestly, carrying out an experiment suggested to him by Benjamin Franklin, had noticed the absence of electrical influence within a hollow charged container and made an inspired conjecture: “May we not infer from this experiment that the attraction of electricity is subject to the same laws with that of gravitation and is therefore according to the square of the
1.5 Energy of a system of charges
distances; since it is easily demonstrated that were the earth in the form of a shell, a body in the inside of it would not be attracted to one side more than the other.” (Priestly, 1767). The same idea was the basis of an elegant experiment in 1772 by Henry Cavendish. Cavendish charged a spherical conducting shell that contained within it, and temporarily connected to it, a smaller sphere. The outer shell was then separated into two halves and carefully removed, the inner sphere having been first disconnected. This sphere was tested for charge, the absence of which would confirm the inverse-square law. (See Problem 2.8 for the theory behind this.) Assuming that a deviation from the inverse-square law could be expressed as a difference in the exponent, 2 + δ, say, instead of 2, Cavendish concluded that δ must be less than 0.03. This experiment of Cavendish remained largely unknown until Maxwell discovered and published Cavendish’s notes a century later (1876). At that time also, Maxwell repeated the experiment with improved apparatus, pushing the limit down to δ < 10−6 . The present limit on δ is a fantastically small number – about one part in 1016 ; see Crandall (1983) and Williams et al. (1971). Two hundred years after Cavendish’s experiment, however, the question of interest changed somewhat. Never mind how perfectly Coulomb’s law works for charged objects in the laboratory – is there a range of distances where it completely breaks down? There are two domains in either of which a breakdown is conceivable. The first is the domain of very small distances, distances less than 10−16 m, where electromagnetic theory as we know it may not work at all. As for very large distances, from the geographical, say, to the astronomical, a test of Coulomb’s law by the method of Cavendish is obviously not feasible. Nevertheless we do observe certain large-scale electromagnetic phenomena that prove that the laws of classical electromagnetism work over very long distances. One of the most stringent tests is provided by planetary magnetic fields, in particular the magnetic field of the giant planet Jupiter, which was surveyed in the mission of Pioneer 10. The spatial variation of this field was carefully analyzed5 and found to be entirely consistent with classical theory out to a distance of at least 105 km from the planet. This is tantamount to a test, albeit indirect, of Coulomb’s law over that distance. To summarize, we have every reason for confidence in Coulomb’s law over the stupendous range of 24 decades in distance, from 10−16 to 108 m, if not farther, and we take it as the foundation of our description of electromagnetism.
1.5 Energy of a system of charges In principle, Coulomb’s law is all there is to electrostatics. Given the charges and their locations, we can find all the electrical forces. Or, given 5 See Davis et al. (1975). For a review of the history of the exploration of the outer limit
of classical electromagnetism, see Goldhaber and Nieto (1971).
11
12
Electrostatics: charges and fields
(a) q2
Great distance
q1
(b) q2 r 12 q1
(c)
q2 r 21 r 32
q1 r 31
Final position of q3
q3 in transit ds
F32
F31
Figure 1.4. Three charges are brought near one another. First q2 is brought in; then, with q1 and q2 fixed, q3 is brought in.
that the charges are free to move under the influence of other kinds of forces as well, we can find the equilibrium arrangement in which the charge distribution will remain stationary. In the same sense, Newton’s laws of motion are all there is to mechanics. But in both mechanics and electromagnetism we gain power and insight by introducing other concepts, most notably that of energy. Energy is a useful concept here because electrical forces are conservative. When you push charges around in electric fields, no energy is irrecoverably lost. Everything is perfectly reversible. Consider first the work that must be done on the system to bring some charged bodies into a particular arrangement. Let us start with two charged bodies or particles very far apart from one another, as indicated in Fig. 1.4(a), carrying charges q1 and q2 . Whatever energy may have been needed to create these two concentrations of charge originally we shall leave entirely out of account. How much work does it take to bring the particles slowly together until the distance between them is r12 ? It makes no difference whether we bring q1 toward q2 or the other way around. In either case the work done is the integral of the product: force times displacement, where these are signed quantities. The force that has to be applied to move one charge toward the other is equal and opposite to the Coulomb force. Therefore, W = (applied force) · (displacement) r12 1 q1 q2 1 q1 q2 . (1.9) − dr = = 2 4π 0 r 4π 0 r12 r=∞ Note that because r is changing from ∞ to r12 , the differential dr is negative. We know that the overall sign of the result is correct, because the work done on the system must be positive for charges of like sign; they have to be pushed together (consistent with the minus sign in the applied force). Both the displacement and the applied force are negative in this case, resulting in positive work being done on the system. With q1 and q2 in coulombs, and r12 in meters, Eq. (1.9) gives the work in joules. This work is the same whatever the path of approach. Let’s review the argument as it applies to the two charges q1 and q2 in Fig. 1.5. There we have kept q1 fixed, and we show q2 moved to the same final position along two different paths. Every spherical shell, such as the one indicated between r and r + dr, must be crossed by both paths. The increment of work involved, −F · ds in this bit of path (where F is the Coulomb force), is the same for the two paths.6 The reason is that F has the same magnitude at both places and is directed radially from q1 , while 6 Here we use for the first time the scalar product, or “dot product,” of two vectors.
A reminder: the scalar product of two vectors A and B, written A · B, is the number AB cos θ , where A and B are the magnitudes of the vectors A and B, and θ is the angle between them. Expressed in terms of Cartesian components of the two vectors, A · B = Ax Bx + Ay By + Az Bz .
1.5 Energy of a system of charges ds = dr/ cos θ ; hence F · ds = F dr. Each increment of work along one path is matched by a corresponding increment on the other, so the sums must be equal. Our conclusion holds even for paths that loop in and out, like the dotted path in Fig. 1.5. (Why?) Returning now to the two charges as we left them in Fig. 1.4(b), let us bring in from some remote place a third charge q3 and move it to a point P3 whose distance from charge 1 is r31 , and from charge 2, r32 . The work required to effect this will be P3 F3 · ds. (1.10) W3 = −
13
dr
q
ds r
Thanks to the additivity of electrical interactions, which we have already emphasized, − F3 · ds = − (F31 + F32 ) · ds (1.11) = − F31 · ds − F32 · ds. That is, the work required to bring q3 to P3 is the sum of the work needed when q1 is present alone and that needed when q2 is present alone: W3 =
1 q1 q3 1 q2 q3 + . 4π 0 r31 4π 0 r32
(1.12)
The total work done in assembling this arrangement of three charges, which we shall call U, is therefore q1 q3 q2 q3 q1 q2 1 + + . (1.13) U= 4π 0 r12 r13 r23 We note that q1 , q2 , and q3 appear symmetrically in the expression above, in spite of the fact that q3 was brought in last. We would have reached the same result if q3 had been brought in first. (Try it.) Thus U is independent of the order in which the charges were assembled. Since it is independent also of the route by which each charge was brought in, U must be a unique property of the final arrangement of charges. We may call it the electrical potential energy of this particular system. There is a certain arbitrariness, as always, in the definition of a potential energy. In this case we have chosen the zero of potential energy to correspond to the situation with the three charges already in existence but infinitely far apart from one another. The potential energy belongs to the configuration as a whole. There is no meaningful way of assigning a certain fraction of it to one of the charges. It is obvious how this very simple result can be generalized to apply to any number of charges. If we have N different charges, in any arrangement in space, the potential energy of the system is calculated by summing over all pairs, just as in Eq. (1.13). The zero of potential energy, as in that case, corresponds to all charges far apart.
q1
P
Figure 1.5. Because the force is central, the sections of different paths between r + dr and r require the same amount of work.
14
Electrostatics: charges and fields −e
(a)
−e −e −e +2e b
−e
−e –e
Example (Charges in a cube) What is the potential energy of an arrangement of eight negative charges on the corners of a cube of side b, with a positive charge in the center of the cube, as in Fig. 1.6(a)? Suppose each negative charge is an electron with charge −e, while the central particle carries a double positive charge, 2e. Solution Figure 1.6(b) shows that there are four different types of pairs. One type involves the center charge, while the other three involve the various edges and diagonals of the cube. Summing over all pairs yields 1 4.32e2 (−2e2 ) e2 e2 e2 1 ≈ 8· √ + 12 · √ . + 12 · +4· √ U= 4π 0 b 4π 0 b ( 3/2)b 3b 2b (1.14)
b b
−e
The energy is positive, indicating that work had to be done on the system to assemble it. That work could, of course, be recovered if we let the charges move apart, exerting forces on some external body or bodies. Or if the electrons were simply to fly apart from this configuration, the total kinetic energy of all the particles would become equal to U. This would be true whether they came apart simultaneously and symmetrically, or were released one at a time in any order. Here we see the power of this simple notion of the total potential energy of the system. Think what the problem would be like if we had to compute the resultant vector force on every particle at every stage of assembly of the configuration! In this example, to be sure, the geometrical symmetry would simplify that task; even so, it would be more complicated than the simple calculation above.
(b) 12 such pairs
One way of writing the instruction for the sum over pairs is this: 1 1 qj qk . 2 4π 0 rjk N
U= 12 such pairs 4 such pairs
8 such pairs
Figure 1.6. (a) The potential energy of this arrangement of nine point charges is given by Eq. (1.14). (b) Four types of pairs are involved in the sum.
(1.15)
j=1 k=j
The double-sum notation, N j=1 k=j , says: take j = 1 and sum over k = 2, 3, 4, . . . , N; then take j = 2 and sum over k = 1, 3, 4, . . . , N; and so on, through j = N. Clearly this includes every pair twice, and to correct for that we put in front the factor 1/2.
1.6 Electrical energy in a crystal lattice These ideas have an important application in the physics of crystals. We know that an ionic crystal like sodium chloride can be described, to a very good approximation, as an arrangement of positive ions (Na+ ) and negative ions (Cl− ) alternating in a regular three-dimensional array or lattice. In sodium chloride the arrangement is that shown in Fig. 1.7(a). Of course the ions are not point charges, but they are nearly spherical distributions of charge and therefore (as we shall prove in Section 1.11) the electrical forces they exert on one another are the same as if each ion
1.6 Electrical energy in a crystal lattice
were replaced by an equivalent point charge at its center. We show this electrically equivalent system in Fig. 1.7(b). The electrostatic potential energy of the lattice of charges plays an important role in the explanation of the stability and cohesion of the ionic crystal. Let us see if we can estimate its magnitude. We seem to be faced at once with a sum that is enormous, if not doubly infinite; any macroscopic crystal contains 1020 atoms at least. Will the sum converge? Now what we hope to find is the potential energy per unit volume or mass of crystal. We confidently expect this to be independent of the size of the crystal, based on the general argument that one end of a macroscopic crystal can have little influence on the other. Two grams of sodium chloride ought to have twice the potential energy of one gram, and the shape should not be important so long as the surface atoms are a small fraction of the total number of atoms. We would be wrong in this expectation if the crystal were made out of ions of one sign only. Then, 1 g of crystal would carry an enormous electric charge, and putting two such crystals together to make a 2 g crystal would take a fantastic amount of energy. (You might estimate how much!) The situation is saved by the fact that the crystal structure is an alternation of equal and opposite charges, so that any macroscopic bit of crystal is very nearly neutral. To evaluate the potential energy we first observe that every positive ion is in a position equivalent to that of every other positive ion. Furthermore, although it is perhaps not immediately obvious from Fig. 1.7, the arrangement of positive ions around a negative ion is exactly the same as the arrangement of negative ions around a positive ion, and so on. Hence we may take one ion as a center, it matters not which kind, sum over its interactions with all the others, and simply multiply by the total number of ions of both kinds. This reduces the double sum in Eq. (1.15) to a single sum and a factor N; we must still apply the factor 1/2 to compensate for including each pair twice. That is, the energy of a sodium chloride lattice composed of a total of N ions is 1 1 q1 qk . N 2 4π 0 r1k N
U=
(1.16)
k=2
Taking the positive ion at the center as in Fig. 1.7(b), our sum runs over all its neighbors near and far. The leading terms start out as follows: 1 1 U= N 2 4π 0
12e2 8e2 6e2 + ··· +√ −√ − a 3a 2a
.
(1.17)
The first term comes from the 6 nearest chlorine ions, at distance a, the second from the 12 sodium ions on the cube edges, and so on. It is clear, incidentally, that this series does not converge absolutely; if we were so
15
(a)
(b)
+ −
+
− +
+
+ −
− +
−−
+
+
+
a
+ −
− +
+ − −
+
Figure 1.7. A portion of a sodium chloride crystal, with the ions Na+ and Cl− shown in about the right relative proportions (a), and replaced by equivalent point charges (b).
16
Electrostatics: charges and fields
foolish as to try to sum all the positive terms first, that sum would diverge. To evaluate such a sum, we should arrange it so that as we proceed outward, including ever more distant ions, we include them in groups that represent nearly neutral shells of material. Then if the sum is broken off, the more remote ions that have been neglected will be such an even mixture of positive and negative charges that we can be confident their contribution would have been small. This is a crude way to describe what is actually a somewhat more delicate computational problem. The numerical evaluation of such a series is easily accomplished with a computer. The answer in this example happens to be U=
−0.8738Ne2 . 4π 0 a
(1.18)
Here N, the number of ions, is twice the number of NaCl molecules. The negative sign shows that work would have to be done to take the crystal apart into ions. In other words, the electrical energy helps to explain the cohesion of the crystal. If this were the whole story, however, the crystal would collapse, for the potential energy of the charge distribution is obviously lowered by shrinking all the distances. We meet here again the familiar dilemma of classical – that is, nonquantum – physics. No system of stationary particles can be in stable equilibrium, according to classical laws, under the action of electrical forces alone; we will give a proof of this fact in Section 2.12. Does this make our analysis useless? Not at all. Remarkably, and happily, in the quantum physics of crystals the electrical potential energy can still be given meaning, and can be computed very much in the way we have learned here.
1.7 The electric field Suppose we have some arrangement of charges, q1 , q2 , . . . , qN , fixed in space, and we are interested not in the forces they exert on one another, but only in their effect on some other charge q0 that might be brought into their vicinity. We know how to calculate the resultant force on this charge, given its position which we may specify by the coordinates x, y, z. The force on the charge q0 is F=
N 1 q0 qj rˆ 0j , 2 4π 0 r0j j=1
(1.19)
where r0j is the vector from the jth charge in the system to the point (x, y, z). The force is proportional to q0 , so if we divide out q0 we obtain a vector quantity that depends only on the structure of our original system of charges, q1 , . . . , qN , and on the position of the point (x, y, z). We call this vector function of x, y, z the electric field arising from the q1 , . . . , qN
1.7 The electric field
17 q2 = −1C
and use the symbol E for it. The charges q1 , . . . , qN we call sources of the field. We may take as the definition of the electric field E of a charge distribution, at the point (x, y, z), N 1 qj rˆ 0j . E(x, y, z) = 2 4π 0 r0j j=1
r02
−1r02 4
(1.20)
(x,y,z)
2 0 r02
+ 2r01 4
2 0 r01
r01
The force on some other charge q at (x, y, z) is then F = qE
E
r02
(1.21)
r01 q = +2 C
1 Figure 1.8 illustrates the vector addition of the field of a point charge of 2 C to the field of a point charge of −1 C, at a particular point in space. Figure 1.8. In the SI system of units, electric field strength is expressed in newtons The field at a point is the vector sum of the fields per unit charge, that is, newtons/coulomb. In Gaussian units, with the esu of each of the charges in the system. as the unit of charge and the dyne as the unit of force, the electric field strength is expressed in dynes/esu. After the introduction of the electric potential in Chapter 2, we shall have another, and completely equivalent, way of expressing the unit of electric field strength; namely, volts/meter in SI units and statvolts/ centimeter in Gaussian units. So far we have nothing really new. The electric field is merely another way of describing the system of charges; it does so by giving the force per unit charge, in magnitude and direction, that an exploring charge q0 would experience at any point. We have to be a little careful with that interpretation. Unless the source charges are really immovable, the introduction of some finite charge q0 may cause the source charges to shift their positions, so that the field itself, as defined by Eq. (1.20), is different. That is why we assumed fixed charges to begin our discussion. People sometimes define the field by requiring q0 to be an “infinitesimal” test charge, letting E be the limit of F/q0 as q0 → 0. Any flavor of rigor this may impart is illusory. Remember that in the real world we have never observed a charge smaller than e! Actually, if we take Eq. (1.20) as our definition of E, without reference to a test charge, no problem arises and the sources need not be fixed. If the introduction of a new charge causes a shift in the source charges, then it has indeed brought about a change in the electric field, and if we want to predict the force on the new charge, we must use the new electric field in computing it. Perhaps you still want to ask, what is an electric field? Is it something real, or is it merely a name for a factor in an equation that has to be multiplied by something else to give the numerical value of the force we measure in an experiment? Two observations may be useful here. First, since it works, it doesn’t make any difference. That is not a frivolous answer, but a serious one. Second, the fact that the electric field vector
18
Electrostatics: charges and fields
(a)
at a point in space is all we need know to predict the force that will act on any charge at that point is by no means trivial. It might have been otherwise! If no experiments had ever been done, we could imagine that, in two different situations in which unit charges experience equal force, test charges of strength 2 units might experience unequal forces, depending on the nature of the other charges in the system. If that were true, the field description wouldn’t work. The electric field attaches to every point in a system a local property, in this sense: if we know E in some small neighborhood, we know, without further inquiry, what will happen to any charges in that neighborhood. We do not need to ask what produced the field. To visualize an electric field, you need to associate a vector, that is, a magnitude and direction, with every point in space. We shall use various schemes in this book, none of them wholly satisfactory, to depict vector fields. It is hard to draw in two dimensions a picture of a vector function in three-dimensional space. We can indicate the magnitude and direction of E at various points by drawing little arrows near those points, making the arrows longer where E is larger.7 Using this scheme, we show in Fig. 1.9(a) the field of an isolated point charge of 3 units and in Fig. 1.9(b) the field of a point charge of −1 unit. These pictures admittedly add nothing whatsoever to our understanding of the field of an isolated charge; anyone can imagine a simple radial inverse-square field without the help of a picture. We show them in order to combine (side by side) the two fields in Fig. 1.10, which indicates in the same manner the field of two such charges separated by a distance a. All that Fig. 1.10 can show is the field in a plane containing the charges. To get a full three-dimensional representation, one must imagine the figure rotated around the symmetry axis. In Fig. 1.10 there is one point in space where E is zero. As an exercise, you can quickly figure out where this point lies. Notice also that toward the edge of the picture the field points more or less radially outward all around. One can see that at a very large distance from the charges the field will look very much like the field from a positive point charge. This is to be expected because the separation of the charges cannot make very much difference for points far away, and a point charge of 2 units is just what we would have left if we superimposed our two sources at one spot. Another way to depict a vector field is to draw field lines. These are simply curves whose tangent, at any point, lies in the direction of the field at that point. Such curves will be smooth and continuous except at singularities such as point charges, or points like the one in the example of Fig. 1.10 where the field is zero. A field line plot does not directly give
(b)
Charge +3 Charge −1
Figure 1.9. (a) Field of a charge q1 = 3. (b) Field of a charge q2 = −1. Both representations are necessarily crude and only roughly quantitative.
7 Such a representation is rather clumsy at best. It is hard to indicate the point in space to
which a particular vector applies, and the range of magnitudes of E is usually so large that it is impracticable to make the lengths of the arrows proportional to E.
1.7 The electric field
19
E = 0 here
Figure 1.10. The field in the vicinity of two charges, q1 = +3, q2 = −1, is the superposition of the fields in Figs. 1.9(a) and (b).
Charge +3 Charge −1
Charge +3 Charge −1
the magnitude of the field, although we shall see that, in a general way, the field lines converge as we approach a region of strong field and spread apart as we approach a region of weak field. In Fig. 1.11 are drawn some field lines for the same arrangement of charges as in Fig. 1.10, a positive charge of 3 units and a negative charge of 1 unit. Again, we are restricted
Figure 1.11. Some field lines in the electric field around two charges, q1 = +3, q2 = −1.
20
Electrostatics: charges and fields
by the nature of paper and ink to a two-dimensional section through a three-dimensional bundle of curves.
1.8 Charge distributions
r (x, y, z)
(x, y, z)
This is as good a place as any to generalize from point charges to continuous charge distributions. A volume distribution of charge is described by a scalar charge-density function ρ, which is a function of position, with the dimensions charge/volume. That is, ρ times a volume element gives the amount of charge contained in that volume element. The same symbol is often used for mass per unit volume, but in this book we shall always give charge per unit volume first call on the symbol ρ. If we write ρ as a function of the coordinates x, y, z, then ρ(x, y, z) dx dy dz is the charge contained in the little box, of volume dx dy dz, located at the point (x, y, z). On an atomic scale, of course, the charge density varies enormously from point to point; even so, it proves to be a useful concept in that domain. However, we shall use it mainly when we are dealing with largescale systems, so large that a volume element dv = dx dy dz can be quite small relative to the size of our system, although still large enough to contain many atoms or elementary charges. As we have remarked before, we face a similar problem in defining the ordinary mass density of a substance. If the source of the electric field is to be a continuous charge distribution rather than point charges, we merely replace the sum in Eq. (1.20) with the appropriate integral. The integral gives the electric field at (x, y, z), which is produced by charges at other points (x , y , z ): E(x, y, z) =
r
1 4π 0
ρ(x , y , z )ˆr dx dy dz
. r2
(1.22)
This is a volume integral. Holding (x, y, z) fixed, we let the variables of integration, x , y , and z , range over all space containing charge, thus summing up the contributions of all the bits of charge. The unit vector rˆ points from (x , y , z ) to (x, y, z) – unless we want to put a minus sign before the integral, in which case we may reverse the direction of rˆ . It is always hard to keep signs straight. Let’s remember that the electric field points away from a positive source (Fig. 1.12).
(x,y,z)
Figure 1.12. Each element of the charge distribution ρ(x , y , z ) makes a contribution to the electric field E at the point (x, y, z). The total field at this point is the sum of all such contributions; see Eq. (1.22).
Example (Field due to a hemisphere) A solid hemisphere has radius R and uniform charge density ρ. Find the electric field at the center. Solution Our strategy will be to slice the hemisphere into rings around the symmetry axis. We will find the electric field due to each ring, and then integrate over the rings to obtain the field due to the entire hemisphere. We will work with
1.8 Charge distributions
polar coordinates (or, equivalently, spherical coordinates), which are much more suitable than Cartesian coordinates in this setup. The cross section of a ring is (essentially) a little rectangle with side lengths dr and r dθ , as shown in Fig. 1.13. The cross-sectional area is thus r dr dθ. The radius of the ring is r sin θ , so the volume is (r dr dθ )(2πr sin θ). The charge in the ring is therefore ρ(2πr2 sin θ dr dθ ). Equivalently, we can obtain this result by using the standard spherical-coordinate volume element, r2 sin θ dr dθ dφ, and then integrating over φ to obtain the factor of 2π . Consider a tiny piece of the ring, with charge dq. This piece creates an electric field at the center of the hemisphere that points diagonally upward (if ρ is positive) with magnitude dq/4π 0 r2 . However, only the vertical component survives, because the horizontal component cancels with the horizontal component from the diametrically opposite charge dq on the ring. The vertical component involves a factor of cos θ . When we integrate over the whole ring, the dq simply integrates to the total charge we found above. The (vertical) electric field due to a given ring is therefore dEy =
ρ(2π r2 sin θ dr dθ ) ρ sin θ cos θ dr dθ cos θ = . 2 20 4π 0 r
21
q
r dr r dq
Figure 1.13. Cross section of a thin ring. The hemisphere may be considered to be built up from rings.
(1.23)
Integrating over r and θ to obtain the field due to the entire hemisphere gives R π/2 R π/2 ρ ρ sin θ cos θ dr dθ = dr sin θ cos θ dθ Ey = 20 20 0 0 0 0 sin2 θ π/2 ρR ρ ·R· = . (1.24) = 20 2 0 40
E
(a)
Note that the radius r canceled in Eq. (1.23). For given values of θ, dθ, and dr, the volume of a ring grows like r2 , and this exactly cancels the r2 in the denominator in Coulomb’s law. R EMARK As explained above, the electric field due to the hemisphere is vertical. This fact also follows from considerations of symmetry. We will make many symmetry arguments throughout this book, so let us be explicit here about how the reasoning proceeds. Assume (in search of a contradiction) that the electric field due to the hemisphere is not vertical. It must then point off at some angle, as shown in Fig. 1.14(a). Let’s say that the E vector lies above a given dashed line painted on the hemisphere. If we rotate the system by, say, 180◦ around the symmetry axis, the field now points in the direction shown in Fig. 1.14(b), because it must still pass over the dashed line. But we have exactly the same hemisphere after the rotation, so the field must still point upward to the right. We conclude that the field due to the hemisphere points both upward to the left and upward to the right. This is a contradiction. The only way to avoid this contradiction is for the field to point along the symmetry axis (possibly in the negative direction), because in that case it doesn’t change under the rotation.
In the neighborhood of a true point charge the electric field grows infinite like 1/r2 as we approach the point. It makes no sense to talk about the field at the point charge. As our ultimate physical sources of field are
(b) E
Figure 1.14. The symmetry argument that explains why E must be vertical.
22
(a)
Electrostatics: charges and fields
not, we believe, infinite concentrations of charge in zero volume, but instead finite structures, we simply ignore the mathematical singularities implied by our point-charge language and rule out of bounds the interior of our elementary sources. A continuous charge distribution ρ(x , y , z ) that is nowhere infinite gives no trouble at all. Equation (1.22) can be used to find the field at any point within the distribution. The integrand doesn’t blow up at r = 0 because the volume element in the numerator equals r2 sin φ dφ dθ dr in spherical coordinates, and the r2 here cancels the r2 in the denominator in Eq. (1.22). That is to say, so long as ρ remains finite, the field will remain finite everywhere, even in the interior or on the boundary of a charge distribution.
1.9 Flux
(b)
(c)
Figure 1.15. (a) A closed surface in a vector field is divided (b) into small elements of area. (c) Each element of area is represented by an outward vector.
The relation between the electric field and its sources can be expressed in a remarkably simple way, one that we shall find very useful. For this we need to define a quantity called flux. Consider some electric field in space and in this space some arbitrary closed surface, like a balloon of any shape. Figure 1.15 shows such a surface, the field being suggested by a few field lines. Now divide the whole surface into little patches that are so small that over any one patch the surface is practically flat and the vector field does not change appreciably from one part of a patch to another. In other words, don’t let the balloon be too crinkly, and don’t let its surface pass right through a singularity8 of the field such as a point charge. The area of a patch has a certain magnitude in square meters, and a patch defines a unique direction – the outward-pointing normal to its surface. (Since the surface is closed, you can tell its inside from its outside; there is no ambiguity.) Let this magnitude and direction be represented by a vector. Then for every patch into which the surface has been divided, such as patch number j, we have a vector aj giving its area and orientation. The steps we have just taken are pictured in Figs. 1.15(b) and (c). Note that the vector aj does not depend at all on the shape of the patch; it doesn’t matter how we have divided up the surface, as long as the patches are small enough. Let Ej be the electric field vector at the location of patch number j. The scalar product Ej · aj is a number. We call this number the flux through that bit of surface. To understand the origin of the name, imagine a vector function that represents the velocity of motion in a fluid – say in a river, where the velocity varies from one place to another but is constant in time at any one position. Denote this vector field by v, measured in 8 By a singularity of the field we would ordinarily mean not only a point source where
the field approaches infinity, but also any place where the field changes magnitude or direction discontinuously, such as an infinitesimally thin layer of concentrated charge. Actually this latter, milder, kind of singularity would cause no difficulty here unless our balloon’s surface were to coincide with the surface of discontinuity over some finite area.
1.10 Gauss’s law
23
v
a
a
a
Flux = va
Flux = 0
meters/second. Then, if a is the oriented area in square meters of a frame lowered into the water, v · a is the rate of flow of water through the frame in cubic meters per second (Fig. 1.16). The cos θ factor in the standard expression for the dot product correctly picks out the component of v along the direction of a, or equivalently the component of a along the direction of v. We must emphasize that our definition of flux is applicable to any vector function, whatever physical variable it may represent. Now let us add up the flux through all the patches to get the flux through the entire surface, a scalar quantity which we shall denote by : Ej · aj . (1.25) =
60
Flux = va cos 60 = 0.5va
Figure 1.16. The flux through the frame of area a is v · a, where v is the velocity of the fluid. The flux is the volume of fluid passing through the frame, per unit time.
all j
Letting the patches become smaller and more numerous without limit, we pass from the sum in Eq. (1.25) to a surface integral: = E · da. (1.26) entire surface
A surface integral of any vector function F, over a surface S, means just this: divide S into small patches, each represented by a vector outward, of magnitude equal to the patch area; at every patch, take the scalar product of the patch area vector and the local F; sum all these products, and the limit of this sum, as the patches shrink, is the surface integral. Do not be alarmed by the prospect of having to perform such a calculation for an awkwardly shaped surface like the one in Fig. 1.15. The surprising property we are about to demonstrate makes that unnecessary!
E a
q
r
1.10 Gauss’s law Take the simplest case imaginable; suppose the field is that of a single isolated positive point charge q, and the surface is a sphere of radius r centered on the point charge (Fig. 1.17). What is the flux through this surface? The answer is easy because the magnitude of E at every point on the surface is q/4π 0 r2 and its direction is the same as that of the outward normal at that point. So we have q q = E · (total area) = · 4πr2 = . (1.27) 2 0 4π 0 r
Figure 1.17. In the field E of a point charge q, what is the outward flux over a sphere surrounding q?
24
Electrostatics: charges and fields
A
q
R
a r q
The flux is independent of the size of the sphere. Here for the first time we see the benefit of including the factor of 1/4π in Coulomb’s law in Eq. (1.4). Without this factor, we would have an uncanceled factor of 4π in Eq. (1.27) and therefore also, eventually, in one of Maxwell’s equations. Indeed, in Gaussian units Eq. (1.27) takes the form of = 4π q. Now imagine a second surface, or balloon, enclosing the first, but not spherical, as in Fig. 1.18. We claim that the total flux through this surface is the same as that through the sphere. To see this, look at a cone, radiating from q, that cuts a small patch a out of the sphere and continues on to the outer surface, where it cuts out a patch A at a distance R from the point charge. The area of the patch A is larger than that of the patch a by two factors: first, by the ratio of the distance squared (R/r)2 ; and second, owing to its inclination, by the factor 1/ cos θ . The angle θ is the angle between the outward normal and the radial direction (see Fig. 1.18). The electric field in that neighborhood is reduced from its magnitude on the sphere by the factor (r/R)2 and is still radially directed. Letting E(R) be the field at the outer patch and E(r) be the field at the sphere, we have flux through outer patch = E(R) · A = E(R) A cos θ , flux through inner patch = E(r) · a = E(r) a.
Figure 1.18. Showing that the flux through any closed surface around q is the same as the flux through the sphere.
(1.28)
Using the above facts concerning the magnitude of E(R) and the area of A, the flux through the outer patch can be written as
2 2 1 r R cos θ = E(r) a, (1.29) E(R) A cos θ = E(r) a R r cos θ which equals the flux through the inner patch. Now every patch on the outer surface can in this way be put into correspondence with part of the spherical surface, so the total flux must be the same through the two surfaces. That is, the flux through the new surface must be just q/0 . But this was a surface of arbitrary shape and size.9 We conclude: the flux of the electric field through any surface enclosing a point charge q is q/0 . As a corollary we can say that the total flux through a closed surface is zero if the charge lies outside the surface. We leave the proof of this to the reader, along with Fig. 1.19 as a hint of one possible line of argument. There is a way of looking at all this that makes the result seem obvious. Imagine at q a source that emits particles – such as bullets or photons – in all directions at a steady rate. Clearly the flux of particles through a window of unit area will fall off with the inverse square of the window’s distance from q. Hence we can draw an analogy between the electric field strength E and the intensity of particle flow in bullets per unit area per 9 To be sure, we had the second surface enclosing the sphere, but it didn’t have to, really.
Besides, the sphere can be taken as small as we please.
1.10 Gauss’s law
unit time. It is pretty obvious that the flux of bullets through any surface completely surrounding q is independent of the size and shape of that surface, for it is just the total number emitted per unit time. Correspondingly, the flux of E through the closed surface must be independent of size and shape. The common feature responsible for this is the inversesquare behavior of the intensity. The situation is now ripe for superposition! Any electric field is the sum of the fields of its individual sources. This property was expressed in our statement, Eq. (1.19), of Coulomb’s law. Clearly flux is an additive quantity in the same sense, for if we have a number of sources, q1 , q2 , . . . , qN , the fields of which, if each were present alone, would be E1 , E2 , . . . , EN , then the flux through some surface S in the actual field can be written (1.30) = E · da = (E1 + E2 + · · · + EN ) · da. S
25
(a)
q
(b)
S
We have just learned that S Ei · da equals qi /0 if the charge qi is inside S and equals zero otherwise. So every charge q inside the surface contributes exactly q/0 to the surface integral of Eq. (1.30) and all charges outside contribute nothing. We have arrived at Gauss’s law. The flux of the
electric field E through any closed surface, that is, the integral E · da over the surface, equals 1/0 times the total charge enclosed by the surface: 1 1 ρ dv (Gauss’s law) (1.31) E · da = qi = 0 0 i
We call the statement in the box a law because it is equivalent to Coulomb’s law and it could serve equally well as the basic law of electrostatic interactions, after charge and field have been defined. Gauss’s law and Coulomb’s law are not two independent physical laws, but the same law expressed in different ways.10 In Gaussian units, the 1/0 in Gauss’s law is replaced with 4π. Looking back over our proof, we see that it hinged on the inversesquare nature of the interaction and of course on the additivity of interactions, or superposition. Thus the theorem is applicable to any inverse-square field in physics, for instance to the gravitational field. 10 There is one difference, inconsequential here, but relevant to our later study of the
fields of moving charges. Gauss’s law is obeyed by a wider class of fields than those represented by the electrostatic field. In particular, a field that is inverse-square in r but not spherically symmetrical can satisfy Gauss’s law. In other words, Gauss’s law alone does not imply the symmetry of the field of a point source which is implicit in Coulomb’s law.
q
Figure 1.19. To show that the flux through the closed surface in (a) is zero, you can make use of (b).
26
Electrostatics: charges and fields
It is easy to see that Gauss’s law would not hold if the law of force were, say, inverse-cube. For in that case the flux of electric field from a point charge q through a sphere of radius R centered on the charge would be q q · 4π R2 = . (1.32) = E · da = 3 0 R 4π 0 R By making the sphere large enough we could make the flux through it as small as we pleased, while the total charge inside remained constant. This remarkable theorem extends our knowledge in two ways. First, it reveals a connection between the field and its sources that is the converse of Coulomb’s law. Coulomb’s law tells us how to derive the electric field if the charges are given; with Gauss’s law we can determine how much charge is in any region if the field is known. Second, the mathematical relation here demonstrated is a powerful analytic tool; it can make complicated problems easy, as we shall see in the following examples. In Sections 1.11–1.13 we use Gauss’s law to calculate the electric field due to various nicely shaped objects. In all of these examples the symmetry of the object will play a critical role.
r0
Figure 1.20. A charge distribution with spherical symmetry.
1.11 Field of a spherical charge distribution
E1
P1 r1 E2
S1
P2 r2
S2
We can use Gauss’s law to find the electric field of a spherically symmetrical distribution of charge, that is, a distribution in which the charge density ρ depends only on the radius from a central point. Figure 1.20 depicts a cross section through some such distribution. Here the charge density is high at the center, and is zero beyond r0 . What is the electric field at some point such as P1 outside the distribution, or P2 inside it (Fig. 1.21)? If we could proceed only from Coulomb’s law, we should have to carry out an integration that would sum the electric field vectors at P1 arising from each elementary volume in the charge distribution. Let’s try a different approach that exploits both the symmetry of the system and Gauss’s law. Because of the spherical symmetry, the electric field at any point must be radially directed – no other direction is unique. Likewise, the field magnitude E must be the same at all points on a spherical surface S1 of radius r1 , for all such points are equivalent. Call this field magnitude E1 . The flux through this surface S1 is therefore simply 4π r12 E1 , and by Gauss’s law this must be equal to 1/0 times the charge enclosed by the surface. That is, 4πr12 E1 = (1/0 ) · (charge inside S1 ) or E1 =
Figure 1.21. The electric field of a spherical charge distribution.
charge inside S1 . 4π 0 r12
(1.33)
Comparing this with the field of a point charge, we see that the field at all points on S1 is the same as if all the charge within S1 were concentrated at the center. The same statement applies to a sphere drawn
1.11 Field of a spherical charge distribution
27
inside the charge distribution. The field at any point on S2 is the same as if all charge within S2 were at the center, and all charge outside S2 absent. Evidently the field inside a “hollow” spherical charge distribution is zero (Fig. 1.22). Problem 1.17 gives an alternative derivation of this fact.
Example (Field inside and outside a uniform sphere) A spherical charge distribution has a density ρ that is constant from r = 0 out to r = R and is zero beyond. What is the electric field for all values of r, both less than and greater than R?
E=0 inside
Solution For r ≥ R, the field is the same as if all of the charge were concentrated at the center of the sphere. Since the volume of the sphere is 4π R3 /3, the field is therefore radial and has magnitude E(r) =
ρR3 (4π R3 /3)ρ = 2 4π 0 r 30 r2
(r ≥ R).
(1.34)
For r ≤ R, the charge outside radius r effectively contributes nothing to the field, while the charge inside radius r acts as if it were concentrated at the center. The volume inside radius r is 4πr3 /3, so the field inside the given sphere is radial and has magnitude E(r) =
ρr (4π r3 /3)ρ = 30 4π 0 r2
(r ≤ R).
Figure 1.22. The field is zero inside a spherical shell of charge.
E(r)
(1.35)
In terms of the total charge Q = (4π R3 /3)ρ, this can be written as Qr/4π 0 R3 . The field increases linearly with r inside the sphere; the r3 growth of the effective charge outweighs the 1/r2 effect from the increasing distance. And the field decreases like 1/r2 outside the sphere. A plot of E(r) is shown in Fig. 1.23. Note that E(r) is continuous at r = R, where it takes on the value ρR/30 . As we will see in Section 1.13, field discontinuities are created by surface charge densities, and there are no surface charges in this system. The field goes to zero at the center, so it is continuous there also. How should the density vary with r so that the magnitude E(r) is uniform inside the sphere? That is the subject of Exercise 1.68.
The same argument applied to the gravitational field would tell us that the earth, assuming it is spherically symmetrical in its mass distribution, attracts outside bodies as if its mass were concentrated at the center. That is a rather familiar statement. Anyone who is inclined to think the principle expresses an obvious property of the center of mass must be reminded that the theorem is not even true, in general, for other shapes. A perfect cube of uniform density does not attract external bodies as if its mass were concentrated at its geometrical center. Newton didn’t consider the theorem obvious. He needed it as the keystone of his demonstration that the moon in its orbit around the earth and a falling body on the earth are responding to similar forces. The delay of nearly 20 years in the publication of Newton’s theory of gravitation
rR 3
0
r
1/r 2
r R
Figure 1.23. The electric field due to a uniform sphere of charge.
28
Electrostatics: charges and fields
z
(a)
m)
C/
l(
r
dx
P dE q dEy
q
R
dq
y
x
p −q 2 q
(b)
dx
R dq
cos q =
R dq dx
Figure 1.24. (a) The field at P is the vector sum of contributions from each element of the line charge. (b) Detail of (a).
was apparently due, in part at least, to the trouble he had in proving this theorem to his satisfaction. The proof he eventually devised and published in the Principia in 1686 (Book I, Section XII, Theorem XXXI) is a marvel of ingenuity in which, roughly speaking, a tricky volume integration is effected without the aid of the integral calculus as we know it. The proof is a good bit longer than our whole preceding discussion of Gauss’s law, and more intricately reasoned. You see, with all his mathematical resourcefulness and originality, Newton lacked Gauss’s law – a relation that, once it has been shown to us, seems so obvious as to be almost trivial.
1.12 Field of a line charge A long, straight, charged wire, if we neglect its thickness, can be characterized by the amount of charge it carries per unit length. Let λ, measured in coulombs/meter, denote this linear charge density. What is the electric field of such a line charge, assumed infinitely long and with constant linear charge density λ? We’ll do the problem in two ways, first by an integration starting from Coulomb’s law, and then by using Gauss’s law. To evaluate the field at the point P, shown in Fig. 1.24, we must add up the contributions from all segments of the line charge, one of which is indicated as a segment of length dx. The charge dq on this element is given by dq = λ dx. Having oriented our x axis along the line charge, we may as well let the y axis pass through P, which is a distance r from the nearest point on the line. It is a good idea to take advantage of symmetry at the outset. Obviously the electric field at P must point in the y direction, so that Ex and Ez are both zero. The contribution of the charge dq to the y component of the electric field at P is dEy =
dq λ dx cos θ = cos θ , 2 4π 0 R 4π 0 R2
(1.36)
where θ is the angle the electric field of dq makes with the y direction. The total y component is then ∞ λ cos θ dx. (1.37) Ey = dEy = 2 −∞ 4π 0 R It is convenient to use θ as the variable of integration. Since Figs. 1.24(a) and (b) tell us that R = r/ cos θ and dx = R dθ/ cos θ , we have dx = r dθ/ cos2 θ. (This expression for dx comes up often. It also follows from x = r tan θ ⇒ dx = r d(tan θ ) = r dθ/ cos2 θ .) Eliminating dx and R from the integral in Eq. (1.37), in favor of θ, we obtain π/2 π/2 λ cos θ dθ λ λ Ey = cos θ dθ = = . (1.38) 4π 0 r −π/2 2π 0 r −π/2 4π 0 r We see that the field of an infinitely long, uniformly dense line charge is proportional to the reciprocal of the distance from the line. Its direction
1.13 Field of an infinite flat sheet of charge
29
is of course radially outward if the line carries a positive charge, inward if negative. Gauss’s law leads directly to the same result. Surround a segment of the line charge with a closed circular cylinder of length L and radius r, as in Fig. 1.25, and consider the flux through this surface. As we have already noted, symmetry guarantees that the field is radial, so the flux through the ends of the “tin can” is zero. The flux through the cylindrical surface is simply the area, 2πrL, times Er , the field at the surface. On the other hand, the charge enclosed by the surface is just λL, so Gauss’s law gives us (2πrL)Er = λL/0 or Er =
λ , 2π 0 r
L
l
r
(1.39)
in agreement with Eq. (1.38).
Figure 1.25. Using Gauss’s law to find the field of a line charge.
1.13 Field of an infinite flat sheet of charge Electric charge distributed smoothly in a thin sheet is called a surface charge distribution. Consider a flat sheet, infinite in extent, with the constant surface charge density σ . The electric field on either side of the sheet, whatever its magnitude may turn out to be, must surely point perpendicular to the plane of the sheet; there is no other unique direction in the system. Also, because of symmetry, the field must have the same magnitude and the opposite direction at two points P and P equidistant from the sheet on opposite sides. With these facts established, Gauss’s law gives us at once the field intensity, as follows: draw a cylinder, as in Fig. 1.26 (actually, any shape with uniform cross section will work fine), with P on one side and P on the other, of cross-sectional area A. The outward flux is found only at the ends, so that if EP denotes the magnitude of the field at P, and EP the magnitude at P , the outward flux is AEP + AEP = 2AEP . The charge enclosed is σ A, so Gauss’s law gives 2AEP = σ A/0 , or σ EP = . (1.40) 20 We see that the field strength is independent of r, the distance from the sheet. Equation (1.40) could have been derived more laboriously by calculating the vector sum of the contributions to the field at P from all the little elements of charge in the sheet. In the more general case where there are other charges in the vicinity, the field need not be perpendicular to the sheet, or symmetric on either side of it. Consider a very squat Gaussian surface, with P and P infinitesimally close to the sheet, instead of the elongated surface in Fig. 1.26. We can then ignore the negligible flux through the cylindrical “side” of the pillbox, so the above reasoning gives E⊥,P + E⊥,P = σ/0 , where the “⊥” denotes the component perpendicular to the sheet. If you want
s (C/m2)
P P
EP r
EP
Figure 1.26. Using Gauss’s law to find the field of an infinite flat sheet of charge.
30
Electrostatics: charges and fields ˆ to write this in terms of vectors, it becomes E⊥,P − E⊥,P = (σ/0 )n, where nˆ is the unit vector perpendicular to the sheet, in the direction of P. In other words, the discontinuity in E⊥ across the sheet is given by σ ˆ (1.41) E⊥ = n. 0 Only the normal component is discontinuous; the parallel component is continuous across the sheet. So we can just as well replace the E⊥ in Eq. (1.41) with E. This result is also valid for any finite-sized sheet, because from up close the sheet looks essentially like an infinite plane, at least as far as the normal component is concerned. The field of an infinitely long line charge, we found, varies inversely as the distance from the line, while the field of an infinite sheet has the same strength at all distances. These are simple consequences of the fact that the field of a point charge varies as the inverse square of the distance. If that doesn’t yet seem compellingly obvious, look at it this way: roughly speaking, the part of the line charge that is mainly responsible for the field at P in Fig. 1.24 is the near part – the charge within a distance of order of magnitude r. If we lump all this together and forget the rest, we have a concentrated charge of magnitude q ≈ λr, which ought to produce a field proportional to q/r2 , or λ/r. In the case of the sheet, the amount of charge that is “effective,” in this sense, increases proportionally to r2 as we go out from the sheet, which just offsets the 1/r2 decrease in the field from any given element of charge.
1.14 The force on a layer of charge
E = s/
s
2)
/m (C
s dA
E=0
r0
Figure 1.27. A spherical surface with uniform charge density σ .
0
The sphere in Fig. 1.27 has a charge distributed over its surface with the uniform density σ , in C/m2 . Inside the sphere, as we have already learned, the electric field of such a charge distribution is zero. Outside the sphere the field is Q/4π 0 r2 , where Q is the total charge on the sphere, equal to 4π r02 σ . So just outside the surface of the sphere the field strength is σ (1.42) Ejust outside = . 0 Compare this with Eq. (1.40) and Fig. 1.26. In both cases Gauss’s law is obeyed: the change in the normal component of E, from one side of the layer to the other, is equal to σ/0 , in accordance with Eq. (1.41). What is the electrical force experienced by the charges that make up this distribution? The question may seem puzzling at first because the field E arises from these very charges. What we must think about is the force on some small element of charge dq, such as a small patch of area dA with charge dq = σ dA. Consider, separately, the force on dq due to all the other charges in the distribution, and the force on the patch due to the charges within the patch itself. This latter force is surely zero. Coulomb repulsion between charges within the patch is just another example of
1.14 The force on a layer of charge
Newton’s third law; the patch as a whole cannot push on itself. That simplifies our problem, for it allows us to use the entire electric field E, including the field due to all charges in the patch, in calculating the force dF on the patch of charge dq: dF = E dq = EĎƒ dA.
31
(a) Δr r
(1.43)
But what E shall we use, the field E = Ďƒ/0 outside the sphere or the field E = 0 inside? The correct answer, as we shall prove in a moment, is the average of the two fields that is, dF =
Ďƒ 2 dA 1 . Ďƒ/0 + 0 Ďƒ dA = 2 20
(1.44)
To justify this we shall consider a more general case, and one that will introduce a more realistic picture of a layer of surface charge. Real charge layers do not have zero thickness. Figure 1.28 shows some ways in which charge might be distributed through the thickness of a layer. In each example, the value of Ďƒ , the total charge per unit area of layer, is the same. These might be cross sections through a small portion of the spherical surface in Fig. 1.27 on a scale such that the curvature is not noticeable. To make it more general, however, we can let the field on the left be E1 (rather than 0, as it was inside the sphere), with E2 the field on the right. The condition imposed by Gauss’s law, for given Ďƒ , is, in each case, E2 − E1 =
Ďƒ . 0
(1.45)
Now let us look carefully within the layer where the field is changing continuously from E1 to E2 and there is a volume charge density Ď (x) extending from x = 0 to x = x0 , the thickness of the layer (Fig. 1.29). Consider a much thinner slab, of thickness dx x0 , which contains per unit area an amount of charge Ď dx. If the area of this thin slab is A, the force on it is dF = EĎ dx ¡ A. Thus the total force per unit area of our original charge layer is x0 dF F EĎ dx. = = A A 0
E = s/
E=0
0
rΔr = s
(b) Δr r
E = s/
0
E=0
(c)
(1.46) E = s/
0
(1.47)
But Gauss’s law tells us via Eq. (1.45) that dE, the change in E through the thin slab, is just Ď dx/0 . Hence Ď dx in Eq. (1.47) can be replaced by 0 dE, and the integral becomes E2 0 2 F (1.48) 0 E dE = = E2 − E12 . A 2 E1
E=0
Figure 1.28. The net change in ďŹ eld at a charge layer depends only on the total charge per unit area.
32
Electrostatics: charges and fields Since E2 − E1 = Ďƒ/0 , the force per unit area in Eq. (1.48), after being factored, can be expressed as
dx
F 1 = E1 + E2 Ďƒ A 2 E = E1
(1.49)
E = E2
r(x)
x=0
x = x0
Figure 1.29. Within the charge layer of density Ď (x), E(x + dx) − E(x) = Ď dx/0 .
We have shown, as promised, that for given Ďƒ the force per unit area on a charge layer is determined by the mean of the external field on one side and that on the other.11 This is independent of the thickness of the layer, as long as it is small compared with the total area, and of the variation Ď (x) in charge density within the layer. See Problem 1.30 for an alternative derivation of Eq. (1.49). The direction of the electrical force on an element of the charge on the sphere is, of course, outward whether the surface charge is positive or negative. If the charges do not fly off the sphere, that outward force must be balanced by some inward force, not included in our equations, that can hold the charge carriers in place. To call such a force “nonelectricalâ€? would be misleading, for electrical attractions and repulsions are the dominant forces in the structure of atoms and in the cohesion of matter generally. The difference is that these forces are effective only at short distances, from atom to atom, or from electron to electron. Physics on that scale is a story of individual particles. Think of a charged rubber balloon, say 0.1 m in radius, with 10−8 C of negative charge spread as uniformly as possible on its outer surface. It forms a surface charge of density Ďƒ = (10−8 C)/4Ď€(0.1 m)2 = 8 ¡ 10−8 C/m2 . The resulting outward force, per area of surface charge, is given by Eq. (1.44) as dF (8 ¡ 10−8 C/m2 )2 Ďƒ2 = 3.6 ¡ 10−4 N/m2 . (1.50) = = dA 20 2 8.85 ¡ 10−12 C2 /(N m2 ) In fact, our charge consists of about 6 ¡ 1010 electrons attached to the rubber film, which corresponds to about 50 million extra electrons per square centimeter. So the “graininessâ€? in the charge distribution is hardly apparent. However, if we could look at one of these extra electrons, we would find it roughly 10−4 cm – an enormous distance on an atomic scale – from its nearest neighbor. This electron would be stuck, electrically stuck, to a local molecule of rubber. The rubber molecule would be attached to adjacent rubber molecules, and so on. If you pull on the electron, the force is transmitted in this way to the whole piece of rubber. Unless, of course, you pull hard enough to tear the electron loose from the molecule to which it is attached. That would take an electric field many thousands of times stronger than the field in our example. 11 Note that this is not necessarily the same as the average field within the layer, a
quantity of no special interest or significance.
1.15 Energy associated with the electric field
33
1.15 Energy associated with the electric field Suppose our spherical shell of charge is compressed slightly, from an initial radius of r0 to a smaller radius, as in Fig. 1.30. This requires that work be done against the repulsive force, which we found above to be σ 2 /20 newtons for each square meter of surface. The displacement being dr, the total work done is (4π r02 )(σ 2 /20 ) dr, or (2π r02 σ 2 /0 ) dr. This represents an increase in the energy required to assemble the system of charges, the energy U we talked about in Section 1.5: dU =
2πr02 σ 2 dr. 0
0 E 2 (1.52) 4πr02 dr. 2 This is an instance of a general theorem which we shall not prove now (but see Problem 1.33): the potential energy U of a system of charges, which is the total work required to assemble the system, can be calculated from the electric field itself simply by assigning an amount of energy (0 E2 /2) dv to every volume element dv and integrating over all space where there is electric field: dU =
0 2
entire field
E2 dv
r0
–d
r
r0
(1.51)
Notice how the electric field E has been changed. Within the shell of thickness dr, the field was zero and is now σ/0 . Beyond r0 the field is unchanged. In effect we have created a field of strength E = σ/0 filling a region of volume 4π r02 dr. We have done so by investing an amount of energy given by Eq. (1.51) which, if we substitute 0 E for σ , can be written like this:
U=
dr
(1.53)
E2 is a scalar quantity, of course: E2 ≡ E · E. One may think of this energy as “stored” in the field. The system being conservative, that amount of energy can of course be recovered by allowing the charges to go apart; so it is nice to think of the energy as “being somewhere” meanwhile. Our accounting comes out right if we think of it as stored in space with a density of 0 E2 /2, in joules/m3 . There is no harm in this, but in fact we have no way of identifying, quite independently of anything else, the energy stored in a particular cubic meter of space. Only the total energy is physically measurable, that is, the work required to bring the charge into some configuration, starting from some other configuration. Just as the concept of electric field serves in place of Coulomb’s law to explain the behavior of electric charges, so when we use Eq. (1.53) rather than Eq. (1.15) to express the total potential energy of an electrostatic system, we are merely using a different kind of bookkeeping. Sometimes a change in viewpoint, even if it is at
Figure 1.30. Shrinking a spherical shell or charged balloon.
34
Electrostatics: charges and fields
first only a change in bookkeeping, can stimulate new ideas and deeper understanding. The notion of the electric field as an independent entity will take form when we study the dynamical behavior of charged matter and electromagnetic radiation. Example (Potential energy of a uniform sphere) What is the energy stored in a sphere of radius R with charge Q uniformly distributed throughout the interior? Solution The electric field is nonzero both inside and outside the sphere, so Eq. (1.53) involves two different integrals. Outside the sphere, the field at radius r is simply Q/4π 0 r2 , so the energy stored in the external field is 2 ∞ 2 ∞ dr Q2 Q 2 dr = Q . (1.54) 4πr = Uext = 0 2 R 8π 0 R r2 8π 0 R 4π 0 r2 The example in Section 1.11 gives the field at radius r inside the sphere as Er = ρr/30 . But the density equals ρ = Q/(4πR3 /3), so the field is Er = (3Q/4π R3 )r/30 = Qr/4π 0 R3 . The energy stored in the internal field is therefore 2 R R 2 1 Q2 Qr 2 dr = 4 dr = Q · . 4πr r Uint = 0 3 6 2 0 8π R 5 4π 0 R 8π 0 R 0 0 (1.55) This is one-fifth of the energy stored in the external field. The total energy is the sum of Uext and Uint , which we can write as (3/5)Q2 /4π 0 R. We see that it takes three-fifths as much energy to assemble the sphere as it does to bring in two point charges Q to a separation of R. Exercise 1.61 presents an alternative method of calculating the potential energy of a uniformly charged sphere, by imagining building it up layer by layer.
We run into trouble if we try to apply Eq. (1.53) to a system that contains a point charge, that is, a finite charge q of zero size. Locate q at the origin of the coordinates. Close to the origin, E2 will approach q2 /(4π 0 )2 r4 . With dv = 4π r2 dr, the integrand E2 dv will behave like dr/r2 , and our integral will blow up at the limit r = 0. That simply tells us that it would take infinite energy to pack finite charge into zero volume – which is true but not helpful. In the real world we deal with particles like electrons and protons. They are so small that for most purposes we can ignore their dimensions and think of them as point charges when we consider their electrical interaction with one another. How much energy it took to make such a particle is a question that goes beyond the range of classical electromagnetism. We have to regard the particles as supplied to us ready-made. The energy we are concerned with is the work done in moving them around. The distinction is usually clear. Consider two charged particles, a proton and a negative pion, for instance. Let Ep be the electric field of the proton, Eπ that of the pion. The total field is E = Ep + Eπ , and E · E
1.16 Applications equals Ep2 + Eπ2 + 2Ep · Eπ . According to Eq. (1.53) the total energy in the electric field of this two-particle system is 0 E2 dv U= 2 0 0 = (1.56) Ep2 dv + Eπ2 dv + 0 Ep · Eπ dv. 2 2 The value of the first integral is a property of any isolated proton. It is a constant of nature which is not changed by moving the proton around. The same goes for the second integral, involving the pion’s electric field alone. It is the third integral that directly concerns us, for it expresses the energy required to assemble the system given a proton and a pion as constituents. The distinction could break down if the two particles interact so strongly that the electrical structure of one is distorted by the presence of the other. Knowing that both particles are in a sense composite (the proton consisting of three quarks, the pion of two), we might expect that to happen during a close approach. In fact, nothing much happens down to a distance of 10−15 m. At shorter distances, for strongly interacting particles like the proton and the pion, nonelectrical forces dominate the scene anyway. That explains why we do not need to include “self-energy” terms like the first two integrals in Eq. (1.56) in our energy accounts for a system of elementary charged particles. Indeed, we want to omit them. We are doing just that, in effect, when we replace the actual distribution of discrete elementary charges (the electrons on the rubber balloon) by a perfectly continuous charge distribution.
1.16 Applications Each chapter of this book concludes with a list of “everyday” applications of the topics covered in the chapter. The discussions are brief. It would take many pages to explain each item in detail; real-life physics tends to involve countless variations, complications, and subtleties. The main purpose here is just to say a few words to convince you that the applications are interesting and worthy of further study. You can carry onward with some combination of books/internet/people/pondering. There is effectively an infinite amount of information out there, so you should take advantage of it! Two books packed full of real-life applications are: • The Flying Circus of Physics (Walker, 2007); • How Things Work (Bloomfield, 2010). And some very informative websites are: • The Flying Circus of Physics website: www.flyingcircusofphysics.com; • How Stuff Works: www.howstuffworks.com;
35
36
Electrostatics: charges and fields • Explain That Stuff: www.explainthatstuff.com; • and Wikipedia, of course: www.wikipedia.org. These websites can point you to more technical sources if you want to pursue things at a more advanced level. With the exception of the gravitational force keeping us on the earth, and ignoring magnets for the time being, essentially all “everyday” forces are electrostatic in origin (with some quantum mechanics mixed in, to make things stable; see Earnshaw’s theorem in Section 2.12). Friction, tension, normal force, etc., all boil down to the electric forces between the electrons in the various atoms and molecules. You can open a door by pushing on it because the forces between neighboring molecules in the door, and also in your hand, are sufficiently strong. We can ignore the gravitational force between everyday-sized objects because the gravitational force is so much weaker than the electric force (see Problem 1.1). Only if one of the objects is the earth does the gravitational force matter. And even in that case, it is quite remarkable that the electric forces between the molecules in, say, a wooden board that you might be standing on can completely balance the gravitational force on you due to the entire earth. However, this wouldn’t be the case if you attempt to stand on a lake (unless it’s frozen!). If you want to give an object a net charge, a possible way is via the triboelectric effect. If certain materials are rubbed against each other, they can become charged. For example, rubbing wool and Teflon together causes the wool to become positively charged and the Teflon negatively charged. The mechanism is simple: the Teflon simply grabs electrons from the wool. The determination of which material ends up with extra electrons depends on the electronic structure of the molecules in the materials. It turns out that actual rubbing isn’t necessary. Simply touching and separating the materials can produce an imbalance of charge. Triboelectric effects are mitigated by humid air, because the water molecules in the air are inclined to give or receive electrons, depending on which of these actions neutralizes the object. This is due to the fact that water molecules are polar, that is, they are electrically lopsided. (Polar molecules will be discussed in Chapter 10.) The electrical breakdown of air occurs when the electric field reaches a strength of about 3 · 106 V/m. In fields this strong, electrons are ripped from molecules in the air. They are then accelerated by the field and collide with other molecules, knocking electrons out of these molecules, and so on, in a cascading process. The result is a spark, because eventually the electrons will combine in a more friendly manner with molecules and drop down to a lower energy level, emitting the light that you see. If you shuffle your feet on a carpet and then bring your finger close to a grounded object, you will see a spark. The electric field near the surface of the earth is about 100 V/m, pointing downward. You can show that this implies a charge of −5 · 105 C
1.16 Applications
on the earth. The atmosphere contains roughly the opposite charge, so that the earth-plus-atmosphere system is essentially neutral, as it must be. (Why?) If there were no regenerative process, charge would leak between the ground and the atmosphere, and they would neutralize each other in about an hour. But there is a regenerative process: lightning. This is a spectacular example of electrical breakdown. There are millions of lightning strikes per day over the surface of the earth, the vast majority of which transfer negative charge to the earth. A lightning strike is the result of the strong electric field that is produced by the buildup (or rather, the separation) of charge in a cloud. This separation arises from the charge carried on moving raindrops, although the exact process is rather complicated (see the interesting discussion in Chapter 9 of Feynman et al. (1977)). “Lightning” can also arise from the charge carried on dust particles in coal mines, flour mills, grain storage facilities, etc. The result can be a deadly explosion. A more gentle form of electrical breakdown is corona discharge. Near the tip of a charged pointy object, such as a needle, the field is large but then falls off rapidly. (You can model the needle roughly as having a tiny charged sphere on its end.) Electrons are ripped off the needle (or off the air molecules) very close to the needle, but the field farther away isn’t large enough to sustain the breakdown. So there is a slow leakage instead of an abrupt spark. This leakage can sometimes be seen as a faint glow. Examples are St. Elmo’s fire at the tips of ship masts, and a glow at the tips of airplane wings. Electrostatic paint sprayers can produce very even coats of paint. As the paint leaves the sprayer, an electrode gives it a charge. This causes the droplets in the paint mist to repel each other, helping to create a uniform mist with no clumping. If the object being painted is grounded (or given the opposite charge), the paint will be attracted to it, leading to less wasted paint, less mess, and less inhalation of paint mist. When painting a metal pipe, for example, the mist will wrap around and partially coat the back side, instead of just sailing off into the air. Photocopiers work by giving the toner powder a charge, and giving certain locations on a drum or belt the opposite charge. These locations on the drum can be made to correspond to the locations of ink on the original paper. This is accomplished by coating the drum with a photoconductive material, that is, one that becomes conductive when exposed to light. The entire surface of the drum is given an initial charge and then exposed to light at locations corresponding to the white areas on the original page (accomplished by reflecting light off the page). The charge can be made to flow off these newly conductive locations on the drum, leaving charge only at the locations corresponding to the ink. When the oppositely charged toner is brought nearby, it is attracted to these locations on the drum. The toner is then transferred to a piece of paper, producing the desired copy. Electronic paper, used in many eBook readers, works by using electric fields to rotate or translate small black and white objects.
37
38
Electrostatics: charges and fields One technique uses tiny spheres (about 10−4 m in diameter) that are black on one side and white on the other, with the sides being oppositely charged. Another technique uses similarly tiny spheres that are filled with many even tinier charged white particles along with a dark dye. In both cases, a narrow gap between sheets of electrodes (with one sheet being the transparent sheet that you look through) is filled with the spheres. By depositing a specific pattern of charge on the sheets, the color of the objects facing your eye can be controlled. In the first system, the black and white spheres rotate accordingly. In the second system, the tiny white particles pile up on one side of the sphere. In contrast with a standard LCD computer screen, electronic paper acts like normal paper, in that it doesn’t produce its own light; an outside light source is needed to view the page. An important advantage of electronic paper is that it uses a very small amount of power. A battery is needed only when the page is refreshed, whereas an LCD screen requires continual refreshing.
CHAPTER SUMMARY • Electric charge, which can be positive or negative, is both conserved and quantized. The force between two charges is given by Coulomb’s law: F=
1 q1 q2 rˆ 21 . 2 4π 0 r21
(1.57)
Integrating this force, we find that the potential energy of a system of charges (the work necessary to bring them in from infinity) equals 1 1 qj qk . 2 4π 0 rjk N
U=
(1.58)
j=1 k=j
• The electric field due to a charge distribution is (depending on whether the distribution is continuous or discrete) 1 E= 4π 0
ρ(x , y , z )ˆr dx dy dz
r2
or
N 1 qj rˆ j . (1.59) 4π 0 r2 j=1 j
The force on a test charge q due to the field is F = qE. • The flux of an electric field through a surface S is = E · da.
(1.60)
S
Gauss’s law states that the flux of the electric field E through any closed surface equals 1/0 times the total charge enclosed by the
Problems
surface. That is (depending on whether the distribution is continuous or discrete), 1 1 Ď dv = qi . (1.61) E ¡ da = 0 0 i
Gauss’s law gives the fields for a sphere, line, and sheet of charge as Q Îť Ďƒ , Eline = . (1.62) , Esheet = 2 2Ď€ 0 r 20 4Ď€ 0 r More generally, the discontinuity in the normal component of E across a sheet is E⊼ = Ďƒ/0 . Gauss’s law is always valid, although it is useful for calculating the electric field only in cases where there is sufficient symmetry. • The force per unit area on a layer of charge equals the density times the average of the fields on either side: 1 F (1.63) = E1 + E2 Ďƒ . A 2 Esphere =
• The energy density of an electric field is 0 E2 /2, so the total energy in a system equals 0 (1.64) E2 dv. U= 2
Problems 1.1
Gravity vs. electricity * (a) In the domain of elementary particles, a natural unit of mass is the mass of a nucleon, that is, a proton or a neutron, the basic massive building blocks of ordinary matter. Given the nucleon mass as 1.67 ¡ 10−27 kg and the gravitational constant G as 6.67 ¡ 10−11 m3 /(kg s2 ), compare the gravitational attraction of two protons with their electrostatic repulsion. This shows why we call gravitation a very weak force. (b) The distance between the two protons in the helium nucleus could be at one instant as much as 10−15 m. How large is the force of electrical repulsion between two protons at that distance? Express it in newtons, and in pounds. Even stronger is the nuclear force that acts between any pair of hadrons (including neutrons and protons) when they are that close together.
1.2
Zero force from a triangle ** Two positive ions and one negative ion are fixed at the vertices of an equilateral triangle. Where can a fourth ion be placed, along the symmetry axis of the setup, so that the force on it will be zero? Is there more than one such place? You will need to solve something numerically.
39
40
Electrostatics: charges and fields q
1.3
Force from a cone ** (a) A charge q is located at the tip of a hollow cone (such as an ice cream cone without the ice cream) with surface charge density σ . The slant height of the cone is L, and the half-angle at the vertex is θ . What can you say about the force on the charge q due to the cone? (b) If the top half of the cone is removed and thrown away (see Fig. 1.31), what is the force on the charge q due to the remaining part of the cone? For what angle θ is this force maximum?
1.4
Work for a rectangle ** Two protons and two electrons are located at the corners of a rectangle with side lengths a and b. There are two essentially different arrangements. Consider the work required to assemble the system, starting with the particles very far apart. Is it possible for the work to be positive for either of the arrangements? If so, how must a and b be related? You will need to solve something numerically.
1.5
Stable or unstable? ** In the setup in Exercise 1.37, is the charge −Q at the center of the square in stable or unstable equilibrium? You can answer this by working with either forces or energies. The latter has the advantage of not involving components, although things can still get quite messy. However, the math is simple if you use a computer. Imagine moving the −Q charge infinitesimally to the point (x, y), and use, for example, the Series operation in Mathematica to calculate the new energy of the charge, to lowest nontrivial order in x and y. If the energy decreases for at least one direction of displacement, then the equilibrium is unstable. (The equilibrium is certainly stable with respect to displacements perpendicular to the plane of the square, because the attractive force from the other charges is directed back toward the plane. The question is, what happens in the plane of the square?)
1.6
Zero potential energy for equilibrium ** (a) Two charges q are each located a distance d from a charge Q, as shown in Fig. 1.32(a). What should the charge Q be so that the system is in equilibrium; that is, so that the force on each charge is zero? (The equilibrium is an unstable one, which can be seen by looking at longitudinal displacements of the (negative) charge Q. This is consistent with a general result that we will derive Section 2.12.) (b) Same question, but now with the setup in Fig. 1.32(b). The three charges q are located at the vertices of an equilateral triangle. (c) Show that the total potential energy in each of the above systems is zero.
q q L/ 2
L/ 2 s
Figure 1.31.
(a) q
Q
q
d
d
q
(b)
Q d q
Figure 1.32.
q
Problems
41
(d) In view of the previous result, we might make the following conjecture: “The total potential energy of any system of charges in equilibrium is zero.” Prove that this conjecture is indeed true. Hint: The goal is to show that zero work is required to move the charges out to infinity. Since the electrostatic force is conservative, you need only show that the work is zero for one particular set of paths of the charges. And there is indeed a particular set of paths that makes the result clear. 1.7
Potential energy in a two-dimensional crystal ** Use a computer to calculate numerically the potential energy, per ion, for an infinite two-dimensional square ionic crystal with separation a; that is, a plane of equally spaced charges of magnitude e and alternating sign (as with a checkerboard).
1.8
Oscillating in a ring *** A ring with radius R has uniform positive charge density λ. A particle with positive charge q and mass m is initially located at the center of the ring and is then given a tiny kick. If it is constrained to move in the plane of the ring, show that it undergoes simple harmonic motion (for small oscillations), and find the frequency. Hint: Find the potential energy of the particle when it is at a (small) radius, r, by integrating over the ring, and then take the negative derivative to find the force. You √ will need to use the law of cosines and also the Taylor series 1/ 1 + ≈ 1 − /2 + 3 2 /8.
1.9
Field from two charges ** A charge 2q is at the origin, and a charge −q is at x = a on the x axis. (a) Find the point on the x axis where the electric field is zero. (b) Consider the vertical line passing through the charge −q, that is, the line given by x = a. Locate, at least approximately, a point on this line where the electric field is parallel to the x axis.
1.10 45-degree field line ** A half-infinite line has linear charge density λ. Find the electric field at a point that is “even” with the end, a distance from it, as shown in Fig. 1.33. You should find that the field always points up at a 45◦ angle, independent of . 1.11 Field at the end of a cylinder ** (a) Consider a half-infinite hollow cylindrical shell (that is, one that extends to infinity in one direction) with radius R and uniform surface charge density σ . What is the electric field at the midpoint of the end face? (b) Use your result to determine the field at the midpoint of a half-infinite solid cylinder with radius R and uniform volume
l
Figure 1.33.
42
Electrostatics: charges and fields charge density ρ, which can be considered to be built up from many cylindrical shells.
z
1.12 Field from a hemispherical shell *** A hemispherical shell has radius R and uniform surface charge density σ (see Fig. 1.34). Find the electric field at a point on the symmetry axis, at position z relative to the center, for any z value from −∞ to ∞.
R
Figure 1.34.
−Q
h
Q r
Figure 1.35.
1.13 A very uniform field *** (a) Two rings with radius r have charge Q and −Q uniformly distributed around them. The rings are parallel and located a distance h apart, as shown in Fig. 1.35. Let z be the vertical coordinate, with z = 0 taken to be at the center of the lower ring. As a function of z, what is the electric field at points on the axis of the rings? (b) You should find that the electric field is an even function with respect to the z = h/2 point midway between the rings. This implies that, at this point, the field has a local extremum as a function of z. The field is therefore fairly uniform there; there are no variations to first order in the distance along the axis from the midpoint. What should r be in terms of h so that the field is very uniform? By “very” uniform we mean that additionally there aren’t any variations to second order in z. That is, the second derivative vanishes. This then implies that the leading-order change is fourth order in z (because there are no variations at any odd order, since the field is an even function around the midpoint). Feel free to calculate the derivatives with a computer. 1.14 Hole in a plane ** (a) A hole of radius R is cut out from a very large flat sheet with uniform charge density σ . Let L be the line perpendicular to the sheet, passing through the center of the hole. What is the electric field at a point on L, a distance z from the center of the hole? Hint: Consider the plane to consist of many concentric rings. (b) If a charge −q with mass m is released from rest on L, very close to the center of the hole, show that it undergoes oscillatory motion, and find the frequency ω of these oscillations. What is ω if m = 1 g, −q = −10−8 C, σ = 10−6 C/m2 , and R = 0.1 m? (c) If a charge −q with mass m is released from rest on L, a distance z from the sheet, what is its speed when it passes through the center of the hole? What does your answer reduce to for large z (or, equivalently, small R)?
Problems
1.15 Flux through a circle ** A point charge q is located at the origin. Consider the electric field flux through a circle a distance from q, subtending an angle 2θ , as shown in Fig. 1.36. Since there are no charges except at the origin, any surface that is bounded by the circle and that stays to the right of the origin must contain the same flux. (Why?) Calculate this flux by taking the surface to be: (a) the flat disk bounded by the circle;
43
q
q q
Figure 1.36.
(b) the spherical cap (with the sphere centered at the origin) bounded by the circle. 1.16 Gauss’s law and two point charges ** (a) Two point charges q are located at positions x = Âą . At points close to the origin on the x axis, find Ex . At points close to the origin on the y axis, find Ey . Make suitable approximations with x and y . (b) Consider a small cylinder centered at the origin, with its axis along the x axis. The radius is r0 and the length is 2x0 . Using your results from part (a), verify that there is zero flux through the cylinder, as required by Gauss’s law. 1.17 Zero field inside a spherical shell ** Consider a hollow spherical shell with uniform surface charge density. By considering the two small patches at the ends of the thin cones in Fig. 1.37, show that the electric field at any point P in the interior of the shell is zero. This then implies that the electric potential (defined in Chapter 2) is constant throughout the interior. 1.18 Fields at the surfaces ** Consider the electric field at a point on the surface of (a) a sphere with radius R, (b) a cylinder with radius R whose length is infinite, and (c) a slab with thickness 2R whose other two dimensions are infinite. All of the objects have the same volume charge density Ď . Compare the fields in the three cases, and explain physically why the sizes take the order they do.
P
Figure 1.37.
r
B
1.19 Sheet on a sphere ** Consider a large flat horizontal sheet with thickness x and volume charge density Ď . This sheet is tangent to a sphere with radius R and volume charge density Ď 0 , as shown in Fig. 1.38. Let A be the point of tangency, and let B be the point opposite to A on the top side of the sheet. Show that the net upward electric field (from the sphere plus the sheet) at B is larger than at A if Ď > (2/3)Ď 0 . (Assume x R.)
x A R r
0
Figure 1.38.
44
Electrostatics: charges and fields
1.20 Thundercloud ** You observe that the passage of a particular thundercloud overhead causes the vertical electric field strength in the atmosphere, measured at the ground, to rise to 3000 N/C (or V/m). (a) How much charge does the thundercloud contain, in coulombs per square meter of horizontal area? Assume that the width of the cloud is large compared with the height above the ground. (b) Suppose there is enough water in the thundercloud in the form of 1 mm diameter drops to make 0.25 cm of rainfall, and that it is those drops that carry the charge. How large is the electric field strength at the surface of one of the drops? 1.21 Field in the end face * Consider a half-infinite hollow cylindrical shell (that is, one that extends to infinity in one direction) with uniform surface charge density. Show that at all points in the circular end face, the electric field is parallel to the cylinder’s axis. Hint: Use superposition, along with what you know about the field from an infinite (in both directions) hollow cylinder. 1.22 Field from a spherical shell, right and wrong ** The electric field outside and an infinitesimal distance away from a uniformly charged spherical shell, with radius R and surface charge density σ , is given by Eq. (1.42) as σ/0 . Derive this in the following way. (a) Slice the shell into rings (symmetrically located with respect to the point in question), and then integrate the field contributions from all the rings. You should obtain the incorrect result of σ/20 . (b) Why isn’t the result correct? Explain how to modify it to obtain the correct result of σ/0 . Hint: You could very well have performed the above integral in an effort to obtain the electric field an infinitesimal distance inside the shell, where we know the field is zero. Does the above integration provide a good description of what’s going on for points on the shell that are very close to the point in question? 1.23 Field near a stick ** A stick with length 2 has uniform linear charge density λ. Consider a point P, a distance η from the center (where 0 ≤ η < 1), and an infinitesimal distance away from the stick. Up close, the stick looks infinitely long, as far as the E component perpendicular to the stick is concerned. So we have E⊥ = λ/2π 0 r. Find the E component parallel to the stick, E . Does it approach infinity, or does it remain finite at the end of the stick?
Problems
45
1.24 Potential energy of a cylinder *** A cylindrical volume of radius a is filled with charge of uniform density ρ. We want to know the potential energy per unit length of this cylinder of charge, that is, the work done per unit length in assembling it. Calculate this by building up the cylinder layer by layer, making use of the fact that the field outside a cylindrical distribution of charge is the same as if all the charge were located on the axis. You will find that the energy per unit length is infinite if the charges are brought in from infinity, so instead assume that they are initially distributed uniformly over a hollow cylinder with large radius R. Write your answer in terms of the charge per unit length of the cylinder, which is λ = ρπa2 . (See Exercise 1.83 for a different method of solving this problem.) 1.25 Two equal fields ** The result of Exercise 1.78 is that the electric field at the center of a small hole in a spherical shell equals σ/20 . This happens to be the same as the field due to an infinite flat sheet with the same density σ . That is, at the center of the hole at the top of the spherical shell in Fig. 1.39, the field from the shell equals the field from the infinite horizontal sheet shown. (This sheet could actually be located at any height.) Demonstrate this equality by explaining why the rings on the shell and sheet that are associated with the angle θ and angular width dθ yield the same field at the top of the shell. 1.26 Stable equilibrium in electron jelly ** The task of Exercise 1.77 is to find the equilibrium positions of two protons located inside a sphere of electron jelly with total charge −2e. Show that the equilibria are stable. That is, show that a displacement in any direction will result in a force directed back toward the equilibrium position. (There is no need to know the exact locations of the equilibria, so you can solve this problem without solving Exercise 1.77 first.) 1.27 Uniform field in a cavity ** A sphere has radius R1 and uniform volume charge density ρ. A spherical cavity with radius R2 is carved out at an arbitrary location inside the larger sphere. Show that the electric field inside the cavity is uniform (in both magnitude and direction). Hint: Find a vector expression for the field in the interior of a charged sphere, and then use superposition. What are the analogous statements for the lower-dimensional analogs with cylinders and slabs? Are the statements still true? 1.28 Average field on/in a sphere ** (a) A point charge q is located at an arbitrary position inside a sphere (just an imaginary sphere in space) with radius R. Show
Shell q
dq
Sheet
Figure 1.39.
46
Electrostatics: charges and fields
that the average electric field over the surface of the sphere is zero. Hint: Use an argument involving Newton’s third law, along with what you know about spherical shells. (b) If the point charge q is instead located outside the sphere, a distance r from the center, show that the average electric field over the surface of the sphere has magnitude q/4π 0 r. (c) Return to the case where the point charge q is located inside the sphere of radius R. Let the distance from the center be r. Use the above results to show that the average electric field over the entire volume of the sphere of radius R has magnitude qr/4π 0 R3 and points toward the center (if q is positive). 1.29 Pulling two sheets apart ** Two parallel sheets each have large area A and are separated by a small distance . The surface charge densities are σ and −σ . You wish to pull one of the sheets away from the other, by a small distance x. How much work does this require? Calculate this by: (a) using the relation W = (force) × (distance); (b) calculating the increase in energy stored in the electric field. Show that these two methods give the same result. 1.30 Force on a patch ** Consider a small patch of charge that is part of a larger surface. The surface charge density is σ . If E1 and E2 are the electric fields on either side of the patch, show that the force per unit area on the patch equals σ (E1 + E2 )/2. This is the result we derived in Section 1.14, for the case where the field is perpendicular to the surface. Derive it here by using the fact that the force on the patch is due to the field Eother from all the other charges in the system (excluding the patch), and then finding an expression for Eother in terms of E1 and E2 . 1.31 Decreasing energy? * A hollow spherical shell with radius R has charge Q uniformly distributed over it. The task of Problem 1.32 is to show that the energy stored in this system is Q2 /8π 0 R. (You can derive this here if you want, or you can just accept it for the purposes of this problem.) Now imagine taking all of the charge and concentrating it in two point charges Q/2 located at diametrically opposite positions on the shell. The energy of this new system is (Q/2)2 /4π 0 (2R) = Q2 /32π 0 R, which is less than the energy of the uniform spherical shell. Does this make sense? If not, where is the error in this reasoning?
Exercises
1.32 Energy of a shell ** A hollow spherical shell with radius R has charge Q uniformly distributed over it. Show that the energy stored in this system is Q2 /8π 0 R. Do this in two ways as follows. (a) Use Eq. (1.53) to find the energy stored in the electric field. (b) Imagine building up the shell by successively adding on infinitesimally thin shells with charge dq. Find the energy needed to add on a shell when the charge already there is q, and then integrate over q. 1.33 Deriving the energy density *** Consider the electric field of two protons a distance b apart. According to Eq. (1.53) (which we stated but did not prove), the potential energy of the system ought to be given by 0 0 2 E dv = (E1 + E2 )2 dv U= 2 2 0 0 (1.65) E21 dv + E22 dv + 0 E1 · E2 dv, = 2 2 where E1 is the field of one particle alone and E2 that of the other. The first of the three integrals on the right might be called the “electrical self-energy” of one proton; an intrinsic property of the particle, it depends on the proton’s size and structure. We have always disregarded it in reckoning the potential energy of a system of charges, on the assumption that it remains constant; the same goes for the second integral. The third integral involves the distance between the charges. Evaluate this integral. This is most easily done if you set it up in spherical polar coordinates with one of the protons at the origin and the other on the polar axis, and perform the integration over r before the integration over θ . Thus, by direct calculation, you can show that the third integral has the value e2 /4π 0 b, which we already know to be the work required to bring the two protons in from an infinite distance to positions a distance b apart. So you will have proved the correctness of Eq. (1.53) for this case, and by invoking superposition you can argue that Eq. (1.53) must then give the energy required to assemble any system of charges.
Exercises 1.34 Aircraft carriers and specks of gold * Imagine (quite unrealistically) removing one electron from every atom in a tiny cube of gold 1 mm on a side. (Never mind how you would hold the resulting positively charged cube together.) Do the same thing with another such cube a meter away. What is the repulsive force between the two cubes? How many aircraft carriers
47
48
Electrostatics: charges and fields
would you need in order to have their total weight equal this force? Some data: The density of gold is 19.3 g/cm3 , and its molecular weight is 197; that is, 1 mole (6.02 · 1023 ) of gold atoms has a mass of 197 grams. The mass of an aircraft carrier is around 100 million kilograms. 1.35 Balancing the weight * On the utterly unrealistic assumption that there are no other charged particles in the vicinity, at what distance below a proton would the upward force on an electron equal the electron’s weight? The mass of an electron is about 9 · 10−31 kg. 2.5 m
1.36 Repelling volley balls * Two volley balls, mass 0.3 kg each, tethered by nylon strings and charged with an electrostatic generator, hang as shown in Fig. 1.40. What is the charge on each, assuming the charges are equal? 1.37 Zero force at the corners ** (a) At each corner of a square is a particle with charge q. Fixed at the center of the square is a point charge of opposite sign, of magnitude Q. What value must Q have to make the total force on each of the four particles zero? (b) With Q taking on the value you just found, show that the potential energy of the system is zero, consistent with the result from Problem 1.6. 0.5 m
1.38 Oscillating on a line ** Two positive point charges Q are located at points (± , 0). A particle with positive charge q and mass m is initially located midway between them and is then given a tiny kick. If it is constrained to move along the line joining the two charges Q, show that it undergoes simple harmonic motion (for small oscillations), and find the frequency.
Figure 1.40.
q q Q
Q
q
Figure 1.41.
1.39 Rhombus of charges ** Four positively charged bodies, two with charge Q and two with charge q, are connected by four unstretchable strings of equal length. In the absence of external forces they assume the equilibrium configuration shown in Fig. 1.41. Show that tan3 θ = q2 /Q2 . This can be done in two ways. You could show that this relation must hold if the total force on each body, the vector sum of string tension and electrical repulsion, is zero. Or you could write out the expression for the energy U of the assembly (like Eq. (1.13) but for four charges instead of three) and minimize it. 1.40 Zero potential energy ** Find a geometrical arrangement of one proton and two electrons such that the potential energy of the system is exactly zero. How
Exercises
many such arrangements are there with the three particles on the same straight line? You should find that the ratio of two of the distances involved is the golden ratio. 1.41 Work for an octahedron ** Three protons and three electrons are to be placed at the vertices of a regular octahedron of edge length a. We want to find the energy of the system, that is, the work required to assemble it starting with the particles very far apart. There are two essentially different arrangements. What is the energy of each? 1.42 Potential energy in a one-dimensional crystal ** Calculate the potential energy, per ion, for an infinite 1D ionic crystal with separation a; that is, a row of equally spaced charges of magnitude e and alternating sign. Hint: The power-series expansion of ln(1 + x) may be of use. 1.43 Potential energy in a three-dimensional crystal ** In the spirit of Problem 1.7, use a computer to calculate numerically the potential energy, per ion, for an infinite 3D cubic ionic crystal with separation a. In other words, derive Eq. (1.18). 1.44 Chessboard ** An infinite chessboard with squares of side s has a charge e at the center of every white square and a charge −e at the center of every black square. We are interested in the work W required to transport one charge from its position on the board to an infinite distance from the board. Given that W is finite (which is plausible but not so easy to prove), do you think it is positive or negative? Calculate an approximate value for W by removing the charge from the central square of a 7 × 7 board. (Only nine different terms are involved in that sum.) For larger arrays you can write a program to compute the work numerically. This will give you some idea of the rate of convergence toward the value for the infinite array; see Problem 1.7. 1.45 Zero field? ** Four charges, q, −q, q, and −q, are located at equally spaced intervals on the x axis. Their x values are −3a, −a, a, and 3a, respectively. Does there exist a point on the y axis for which the electric field is zero? If so, find the y value. 1.46 Charges on a circular track ** Suppose three positively charged particles are constrained to move on a fixed circular track. If the charges were all equal, an equilibrium arrangement would obviously be a symmetrical one with the particles spaced 120◦ apart around the circle. Suppose that two
49
50
Electrostatics: charges and fields
of the charges are equal and the equilibrium arrangement is such that these two charges are 90◦ apart rather than 120◦ . What is the relative magnitude of the third charge? 1.47 Field from a semicircle * A thin plastic rod bent into a semicircle of radius R has a charge Q distributed uniformly over its length. Find the electric field at the center of the semicircle. 1.48 Maximum field from a ring ** A charge Q is distributed uniformly around a thin ring of radius b that lies in the xy plane with its center at the origin. Locate the point on the positive z axis where the electric field is strongest. y E
x
Figure 1.42.
1.49 Maximum field from a blob ** (a) A point charge is placed somewhere on the curve shown in Fig. 1.42. This point charge creates an electric field at the origin. Let Ey be the vertical component of this field. What shape (up to a scaling factor) should the curve take so that Ey is independent of the position of the point charge on the curve? (b) You have a moldable material with uniform volume charge density. What shape should the material take if you want to create the largest possible electric field at a given point in space? Be sure to explain your reasoning clearly. 1.50 Field from a hemisphere ** (a) What is the electric field at the center of a hollow hemispherical shell with radius R and uniform surface charge density σ ? (This is a special case of Problem 1.12, but you can solve the present exercise much more easily from scratch, without going through all the messy integrals of Problem 1.12.) (b) Use your result to show that the electric field at the center of a solid hemisphere with radius R and uniform volume charge density ρ equals ρR/40 . 1.51 N charges on a circle *** N point charges, each with charge Q/N, are evenly distributed around a circle of radius R. What is the electric field at the location of one of the charges, due to all the others? (You can leave your answer in the form of a sum.) In the N → ∞ limit, is the field infinite or finite? In the N → ∞ limit, is the force on one of the charges infinite or finite? 1.52 An equilateral triangle * Three positive charges, A, B, and C, of 3 · 10−6 , 2 · 10−6 , and 2 · 10−6 coulombs, respectively, are located at the corners of an equilateral triangle of side 0.2 m.
Exercises
(a) Find the magnitude in newtons of the force on each charge. (b) Find the magnitude in newtons/coulomb of the electric field at the center of the triangle.
51
axis
1.53 Concurrent field lines ** A semicircular wire with radius R has uniform charge density −λ. Show that at all points along the “axis” of the semicircle (the line through the center, perpendicular to the plane of the semicircle, as shown in Fig. 1.43), the vectors of the electric field all point toward a common point in the plane of the semicircle. Where is this point? 1.54 Semicircle and wires ** (a) Two long, thin parallel rods, a distance 2b apart, are joined by a semicircular piece of radius b, as shown in Fig. 1.44. Charge of uniform linear density λ is deposited along the whole filament. Show that the field E of this charge distribution vanishes at the point C. Do this by comparing the contribution of the element at A to that of the element at B which is defined by the same values of θ and dθ . (b) Consider the analogous two-dimensional setup involving a cylinder and a hemispherical end cap, with uniform surface charge density σ . Using the result from part (a), do you think that the field at the analogous point C is directed upward, downward, or is zero? (No calculations needed!) 1.55 Field from a finite rod ** A thin rod 10 cm long carries a total charge of 24 esu = 8 · 10−9 C uniformly distributed along its length. Find the strength of the electric field at each of the two points A and B located as shown in Fig. 1.45.
−l R
Figure 1.43. A dq q C
q
l dq
B
1.56 Flux through a cube * (a) A point charge q is located at the center of a cube of edge d.
What is the value of E · da over one face of the cube? (b) The charge q is moved to one corner of the cube. Now what is the value of the flux of E through each of the faces of the cube? (To make things well defined, treat the charge like a tiny sphere.)
2b
Figure 1.44.
1.57 Escaping field lines ** Charges 2q and −q are located on the x axis at x = 0 and x = a, respectively. (a) Find the point on the x axis where the electric field is zero, and make a rough sketch of some field lines. (b) You should find that some of the field lines that start on the 2q charge end up on the −q charge, while others head off to infinity. Consider the field lines that form the cutoff between these two cases. At what angle (with respect to the x axis) do
52
Electrostatics: charges and fields
10 cm
these lines leave the 2q charge? Hint: Draw a wisely chosen Gaussian surface that mainly follows these lines.
A
3 cm 5 cm
B
Figure 1.45.
1.58 Gauss’s law at the center of a ring ** (a) A ring with radius R has total charge Q uniformly distributed around it. To leading order, find the electric field at a point along the axis of the ring, a very small distance z from the center. (b) Consider a small cylinder centered at the center of the ring, with small radius r0 and small height 2z0 , with z0 lying on either side of the plane of the ring. There is no charge in this cylinder, so the net flux through it must be zero. Using a result given in the solution to Problem 1.8, verify that this is indeed the case (to leading order in the small distances involved). 1.59 Zero field inside a cylindrical shell * Consider a distribution of charge in the form of a hollow circular cylinder, like a long charged pipe. In the spirit of Problem 1.17, show that the electric field inside the pipe is zero. 1.60 Field from a hollow cylinder * Consider the hollow cylinder from Exercise 1.59. Use Gauss’s law to show that the field inside the pipe is zero. Also show that the field outside is the same as if the charge were all on the axis. Is either statement true for a pipe of square cross section on which the charge is distributed with uniform surface density? 1.61 Potential energy of a sphere ** A spherical volume of radius R is filled with charge of uniform density ρ. We want to know the potential energy U of this sphere of charge, that is, the work done in assembling it. In the example in Section 1.15, we calculated U by integrating the energy density of the electric field; the result was U = (3/5)Q2 /4π 0 R. Derive U here by building up the sphere layer by layer, making use of the fact that the field outside a spherical distribution of charge is the same as if all the charge were at the center. 1.62 Electron self-energy * At the beginning of the twentieth century the idea that the rest mass of the electron might have a purely electrical origin was very attractive, especially when the equivalence of energy and mass was revealed by special relativity. Imagine the electron as a ball of charge, of constant volume density out to some maximum radius r0 . Using the result of Exercise 1.61, set the potential energy of this system equal to mc2 and see what you get for r0 . One defect of the model is rather obvious: nothing is provided to hold the charge together!
Exercises
1.63 Sphere and cones ** (a) Consider a fixed hollow spherical shell with radius R and surface charge density σ . A particle with mass m and charge −q that is initially at rest falls in from infinity. What is its speed when it reaches the center of the shell? (Assume that a tiny hole has been cut in the shell, to let the charge through.) (b) Consider two fixed hollow conical shells (that is, ice cream cones without the ice cream) with base radius R, slant height L, and surface charge density σ , arranged as shown in Fig. 1.46. A particle with mass m and charge −q that is initially at rest falls in from infinity, along the perpendicular bisector line, as shown. What is its speed when it reaches the tip of the cones? You should find that your answer relates very nicely to your answer for part (a).
53
(a) R
R
(b)
L
1.64 Field between two wires * Consider a high-voltage direct current power line that consists of two parallel conductors suspended 3 meters apart. The lines are oppositely charged. If the electric field strength halfway between them is 15,000 N/C, how much excess positive charge resides on a 1 km length of the positive conductor? 1.65 Building a sheet from rods ** An infinite uniform sheet of charge can be thought of as consisting of an infinite number of adjacent uniformly charged rods. Using the fact that the electric field from an infinite rod is λ/2π 0 r, integrate over these rods to show that the field from an infinite sheet with charge density σ is σ/20 . 1.66 Force between two strips ** (a) The two strips of charge shown in Fig. 1.47 have width b, infinite height, and negligible thickness (in the direction perpendicular to the page). Their charge densities per unit area are ±σ . Find the magnitude of the electric field due to one of the strips, a distance x away from it (in the plane of the page). (b) Show that the force (per unit height) between the two strips equals σ 2 b(ln 2)/π0 . Note that this result is finite, even though you will find that the field due to a strip diverges as you get close to it.
Figure 1.46.
b
b
s
−s
1.67 Field from a cylindrical shell, right and wrong ** Find the electric field outside a uniformly charged hollow cylindrical shell with radius R and charge density σ , an infinitesimal distance away from it. Do this in the following way. (a) Slice the shell into parallel infinite rods, and integrate the field contributions from all the rods. You should obtain the incorrect result of σ/20 .
Figure 1.47.
54
Electrostatics: charges and fields
(b) Why isn’t the result correct? Explain how to modify it to obtain the correct result of σ/0 . Hint: You could very well have performed the above integral in an effort to obtain the electric field an infinitesimal distance inside the cylinder, where we know the field is zero. Does the above integration provide a good description of what’s going on for points on the shell that are very close to the point in question?
A
r
a
B
Figure 1.48.
s s
s
Figure 1.49.
1.68 Uniform field strength * We know from the example in Section 1.11 that the electric field inside a solid sphere with uniform charge density is proportional to r. Assume instead that the charge density is not uniform, but depends only on r. What should this dependence be so that the magnitude of the field at points inside the sphere is independent of r (except right at the center, where it isn’t well defined)? What should the dependence be in the analogous case where we have a cylinder instead of a sphere? 1.69 Carved-out sphere ** A sphere of radius a is filled with positive charge with uniform density ρ. Then a smaller sphere of radius a/2 is carved out, as shown in Fig. 1.48, and left empty. What are the direction and magnitude of the electric field at A? At B? 1.70 Field from two sheets * Two infinite plane sheets of surface charge, with densities 3σ0 and −2σ0 , are located a distance apart, parallel to one another. Discuss the electric field of this system. Now suppose the two planes, instead of being parallel, intersect at right angles. Show what the field is like in each of the four regions into which space is thereby divided.
d
1.71 Intersecting sheets ** (a) Figure 1.49 shows the cross section of three infinite sheets intersecting at equal angles. The sheets all have surface charge density σ . By adding up the fields from the sheets, find the electric field at all points in space. (b) Find the field instead by using Gauss’s law. You should explain clearly why Gauss’s law is in fact useful in this setup. (c) What is the field in the analogous setup where there are N sheets instead of three? What is your answer in the N → ∞ limit? This limit is related to the cylinder in Exercise 1.68.
Figure 1.50.
1.72 A plane and a slab ** An infinite plane has uniform surface charge density σ . Adjacent to it is an infinite parallel layer of charge of thickness d and uniform volume charge density ρ, as shown in Fig. 1.50. All charges are fixed. Find E everywhere.
r s
Exercises
55
1.73 Sphere in a cylinder ** An infinite cylinder with uniform volume charge density ρ has its axis lying along the z axis. A sphere is carved out of the cylinder and then filled up with a material with uniform density −ρ/2. Assume that the center of the sphere is located on the x axis at position x = a. Show that inside the sphere the component of the field in the xy plane is uniform, and find its value. Hint: The technique used in Problem 1.27 will be helpful. 1.74 Zero field in a sphere ** In Fig. 1.51 a sphere with radius R is centered at the origin, an infinite cylinder with radius R has its axis along the z axis, and an infinite slab with thickness 2R lies between the planes z = − R and z = R. The uniform volume densities of these objects are ρ1 , ρ2 , and ρ3 , respectively. The objects are superposed on top of each other; the densities add where the objects overlap. How should the three densities be related so that the electric field is zero everywhere throughout the volume of the sphere? Hint: Find a vector expression for the field inside each object, and then use superposition. 1.75 Ball in a sphere ** We know that if a point charge q is located at radius a in the interior of a sphere with radius R and uniform volume charge density ρ, then the force on the point charge is effectively due only to the charge that is located inside radius a. (a) Consider instead a uniform ball of charge located entirely inside a larger sphere of radius R. Let the ball’s radius be b, and let its center be located at radius a in the larger sphere. Its volume charge density is such that its total charge is q. Assume that the ball is superposed on top of the sphere, so that all of the sphere’s charge is still present. Can the force on the ball be obtained by treating it like a point charge and considering only the charge in the larger sphere that is inside radius a? (b) Would the force change if we instead remove the charge in the larger sphere where the ball is? So now we are looking at the force on the ball due to the sphere with a cavity carved out, which is a more realistic scenario. 1.76 Hydrogen atom ** The neutral hydrogen atom in its normal state behaves, in some respects, like an electric charge distribution that consists of a point charge of magnitude e surrounded by a distribution of negative charge whose density is given by ρ(r) = −Ce−2r/a0 . Here a0 is the Bohr radius, 0.53 · 10−10 m, and C is a constant with the value required to make the total amount of negative charge exactly e.
r2 Cylinder
R
R r1
Sphere
Figure 1.51.
r3 Slab
56
Electrostatics: charges and fields
What is the net electric charge inside a sphere of radius a0 ? What is the electric field strength at this distance from the nucleus? 1.77 Electron jelly ** Imagine a sphere of radius a filled with negative charge of uniform density, the total charge being equivalent to that of two electrons. Imbed in this jelly of negative charge two protons, and assume that, in spite of their presence, the negative charge distribution remains uniform. Where must the protons be located so that the force on each of them is zero? (This is a surprisingly realistic caricature of a hydrogen molecule; the magic that keeps the electron cloud in the molecule from collapsing around the protons is explained by quantum mechanics!)
Figure 1.52.
1.78 Hole in a shell ** Figure 1.52 shows a spherical shell of charge, of radius a and surface density Ďƒ , from which a small circular piece of radius b a has been removed. What is the direction and magnitude of the field at the midpoint of the aperture? There are two ways to get the answer. You can integrate over the remaining charge distribution to sum the contributions of all elements to the field at the point in question. Or, remembering the superposition principle, you can think about the effect of replacing the piece removed, which itself is practically a little disk. Note the connection of this result with our discussion of the force on a surface charge – perhaps that is a third way in which you might arrive at the answer. 1.79 Forces on three sheets ** Consider three charged sheets, A, B, and C. The sheets are parallel with A above B above C. On each sheet there is surface charge of uniform density: −4 ¡ 10−5 C/m2 on A, 7 ¡ 10−5 C/m2 on B, and −3 ¡ 10−5 C/m2 on C. (The density given includes charge on both sides of the sheet.) What is the magnitude of the electrical force per unit area on each sheet? Check to see that the total force per unit area on the three sheets is zero. 1.80 Force in a soap bubble ** Like the charged rubber balloon described at the end of Section 1.14, a charged soap bubble experiences an outward electrical force on every bit of its surface. Given the total charge Q on a bubble of radius R, what is the magnitude of the resultant force tending to pull any hemispherical half of the bubble away from the other half? (Should this force divided by 2Ď€ R exceed the surface tension of the soap film, interesting behavior might be expected!) 1.81 Energy around a sphere * A sphere of radius R has a charge Q distributed uniformly over its surface. How large a sphere contains 90 percent of the energy stored in the electrostatic field of this charge distribution?
Exercises
1.82 Energy of concentric shells * (a) Concentric spherical shells of radius a and b, with a < b, carry charge Q and −Q, respectively, each charge uniformly distributed. Find the energy stored in the electric field of this system. (b) Calculate the stored energy in a second way: start with two neutral shells, and then gradually transfer positive charge from the outer shell to the inner shell in a spherically symmetric manner. At an intermediate stage when there is charge q on the inner shell, find the work required to transfer an additional charge dq. And then integrate over q. 1.83 Potential energy of a cylinder ** Problem 1.24 gives one way of calculating the energy per unit length stored in a solid cylinder with radius a and uniform volume charge density Ď . Calculate the energy here by using Eq. (1.53) to find the total energy per unit length stored in the electric field. Don’t forget to include the field inside the cylinder. You will find that the energy is infinite, so instead calculate the energy relative to the configuration where all the charge is initially distributed uniformly over a hollow cylinder with large radius R. (The field outside radius R is the same in both configurations, so it can be ignored when calculating the relative energy.) In terms of the total charge Îť per unit length in the final cylinder, show that the energy per unit length can be written as (Îť2 /4Ď€ 0 ) 1/4+ln(R/a) .
57
2 The electric potential
Overview The first half of this chapter deals mainly with the potential associated with an electric field. The second half covers a number of mathematical topics that will be critical in our treatment of electromagnetism. The potential difference between two points is defined to be the negative line integral of the electric field. Equivalently, the electric field equals the negative gradient of the potential. Just as the electric field is the force per unit charge, the potential is the potential energy per unit charge. We give a number of examples involving the calculation of the potential due to a given charge distribution. One important example is the dipole, which consists of two equal and opposite charges. We will have much more to say about the applications of dipoles in Chapter 10. Turning to mathematics, we introduce the divergence, which gives a measure of the flux of a vector field out of a small volume. We prove Gauss’s theorem (or the divergence theorem) and then use it to write Gauss’s law in differential form. The result is the first of the four equations known as Maxwell’s equations (the subject of Chapter 9). We explicitly calculate the divergence in Cartesian coordinates. The divergence of the gradient is known as the Laplacian operator. Functions whose Laplacian equals zero have many important properties, one of which leads to Earnshaw’s theorem, which states that it is impossible to construct a stable electrostatic equilibrium in empty space. We introduce the curl, which gives a measure of the line integral of a vector field around a small closed curve. We prove Stokes’ theorem and explicitly calculate the curl in Cartesian coordinates. The conservative nature of a static electric
2.1 Line integral of the electric field
59
field implies that its curl is zero. See Appendix F for a discussion of the various vector operators in different coordinate systems.
P2
P2
P2
2.1 Line integral of the electric field
E
h
ds
Pa t
Suppose that E is the field of some stationary distribution of electric charges. Let P1 and P2 denote two points anywhere in the field. The line
P integral of E between the two points is P12 E · ds, taken along some path that runs from P1 to P2 , as shown in Fig. 2.1. This means: divide the chosen path into short segments, each segment being represented by a vector connecting its ends; take the scalar product of the path-segment vector with the field E at that place; add these products up for the whole path. The integral as usual is to be regarded as the limit of this sum as the segments are made shorter and more numerous without limit. Let’s consider the field of a point charge q and some paths running from point P1 to point P2 in that field. Two different paths are shown in Fig. 2.2. It is easy to compute the line integral of E along path A, which is made up of a radial segment running outward from P1 and an arc of
P1
P1
P1
Figure 2.1. Showing the division of the path into path elements ds. E
Path B
E
Path
A
ds
E
E E
P2
ds
ds
r r2
P1
r1
q
Figure 2.2. The electric field E is that of a positive point charge q. The line integral of E from P1 to P2 along path A has the value (q/4π 0 )(1/r1 − 1/r2 ). It will have exactly the same value if calculated for path B, or for any other path from P1 to P2 .
60
The electric potential
radius r2 . Along the radial segment of path A, E and ds are parallel, the magnitude of E is q/4π 0 r2 , and E · ds is simply (q/4π 0 r2 ) ds. Thus the line integral on that segment is
r2 r1
q dr q = 2 4π 0 4π 0 r
1 1 − r1 r2
.
(2.1)
The second leg of path A, the circular segment, gives zero because E is perpendicular to ds everywhere on that arc. The entire line integral is therefore
P2
E · ds =
P1
q 4π 0
1 1 − r1 r2
.
(2.2)
Now look at path B. Because E is radial with magnitude q/4π 0 r2 , E·ds = (q/4π 0 r2 ) dr even when ds is not radially oriented. The corresponding pieces of path A and path B indicated in the diagram make identical contributions to the integral. The part of path B that loops beyond r2 makes a net contribution of zero; contributions from corresponding outgoing and incoming parts cancel. For the entire line integral, path B will give the same result as path A. As there is nothing special about path B, Eq. (2.1) must hold for any path running from P1 to P2 . Here we have essentially repeated, in different language, the argument in Section 1.5, illustrated in Fig. 1.5, concerning the work done in moving one point charge near another. But now we are interested in the total electric field produced by any distribution of charges. One more step will bring us to an important conclusion. The line integral of the sum of fields equals the sum of the line integrals of the fields calculated separately. Or, stated more carefully, if E = E1 + E2 + · · · , then
P2 P1
E · ds =
P2
P1
E1 · ds +
P2
E2 · ds + · · · ,
(2.3)
P1
where the same path is used for all the integrations. Now any electrostatic field can be regarded as the sum of a number (possibly enormous) of point-charge fields, as expressed in Eq. (1.20) or Eq. (1.22). Therefore if the line integral from P1 to P2 is independent of path for each of the point-charge fields E1 , E2 , . . . , the total field E must have this property:
P The line integral P12 E · ds for any given electrostatic field E has the same value for all paths from P1 to P2 .
2.2 Potential difference and the potential function
The points P2 and P1 may coincide. In that case the paths are all closed curves, among them paths of vanishing length. This leads to the following corollary: The line integral field is zero.
E · ds around any closed path in an electrostatic
By electrostatic field we mean, strictly speaking, the electric field of stationary charges. Later on, we shall encounter electric fields in which the line integral is not path-independent. Those fields will usually be associated with rapidly moving charges. For our present purposes we can say that, if the source charges are moving slowly enough, the field
E will be such that E · ds is practically
path-independent. Of course, if E itself is varying in time, the E in E · ds must be understood as the field that exists over the whole path at a given instant of time. With that understanding we can talk meaningfully about the line integral in a changing electrostatic field.
2.2 Potential difference and the potential function Because the line integral in the electrostatic field is path-independent, we can use it to define a scalar quantity φ21 , without specifying any particular path: φ21 = −
P2
E · ds.
(2.4)
P1
With the minus sign included here, φ21 is the work per unit charge done by an external agency in moving a positive charge from P1 to P2 in the field E. (The external agency must supply a force Fext = −qE to balance the electrical force Felec = qE; hence the minus sign.) Thus φ21 is a single-valued scalar function of the two positions P1 and P2 . We call it the electric potential difference between the two points. In our SI system of units, potential difference is measured in joule/ coulomb. This unit has a name of its own, the volt: joule . (2.5) coulomb One joule of work is required to move a charge of one coulomb through a potential difference of one volt. In the Gaussian system of units, potential difference is measured in erg/esu. This unit also has a name of its own, the statvolt (“stat” comes from “electrostatic”). As an exercise, you can use the 1 C ≈ 3 · 109 esu relation from Section 1.4 to show that one volt is equivalent to approximately 1/300 statvolt. These two relations are accurate to better than 0.1 percent, thanks to the accident that c is that 1 volt = 1
61
62
The electric potential close to 3 · 108 m/s. Appendix C derives the conversion factors between all of the corresponding units in the SI and Gaussian systems. Further discussion of the exact relations between SI and Gaussian electrical units is given in Appendix E, which takes into account the definition of the meter in terms of the speed of light. Suppose we hold P1 fixed at some reference position. Then φ21 becomes a function of P2 only, that is, a function of the spatial coordinates x, y, z. We can write it simply φ(x, y, z), without the subscript, if we remember that its definition still involves agreement on a reference point P1 . We can say that φ is the potential associated with the vector field E. It is a scalar function of position, or a scalar field (they mean the same thing). Its value at a point is simply a number (in units of work per unit charge) and has no direction associated with it. Once the vector field E is given, the potential function φ is determined, except for an arbitrary additive constant allowed by the arbitrariness in our choice of P1 . Example Find the potential associated with the electric field described in Fig. 2.3, the components of which are Ex = Ky, Ey = Kx, Ez = 0, with K a constant. This is a possible electrostatic field; we will see why in Section 2.17. Some field lines are shown. Solution Since Ez = 0, the potential will be independent of z and we need consider only the xy plane. Let x1 , y1 be the coordinates of P1 , and x2 , y2 the coordinates of P2 . It is convenient to locate P1 at the origin: x1 = 0, y1 = 0. To evaluate − E · ds from this reference point to a general point (x2 , y2 ) it is easiest to use a path like the dashed path ABC in Fig. 2.3: (x2 ,y2 ) (x2 ,0) (x2 ,y2 ) E · ds = − Ex dx − Ey dy. (2.6) φ(x2 , y2 ) = −
y
(0,0)
C
2
(0,0)
(x2 ,0)
The first of the two integrals on the right is zero because Ex is zero along the x axis. The second integration is carried out at constant x, with Ey = Kx2 : (x2 ,y2 ) y2 − Ey dy = − Kx2 dy = −Kx2 y2 . (2.7) (x2 ,0)
1
0
There was nothing special about the point (x2 , y2 ) so we can drop the subscripts: A
−1
B 1
2
φ(x, y) = −Kxy x
(2.8)
for any point (x, y) in this field, with zero potential at the origin. Any constant could be added to this. That would only mean that the reference point to which zero potential is assigned had been located somewhere else.
Ex = Ky Ey = Kx
Figure 2.3. A particular path, ABC, in the electric field Ex = Ky, Ey = Kx. Some field lines are shown.
Example (Potential due to a uniform sphere) A sphere has radius R and uniform volume charge density ρ. Use the results from the example in Section 1.11 to find the potential for all values of r, both inside and outside the sphere. Take the reference point P1 to be infinitely far away.
2.3 Gradient of a scalar function
63
Solution From the example in Section 1.11, the magnitude of the (radial) electric field inside the sphere is E(r) = ρr/30 , and the magnitude outside is E(r) = ρR3 /30 r2 . Equation (2.4) tells us that the potential equals the negative of the line integral of the field, from P1 (which we are taking to be at infinity) down to a given radius r. The potential outside the sphere is therefore r r 3 ρR3
= ρR . (2.9) E(r ) dr = − dr φout (r) = − 30 r ∞ ∞ 30 r 2 In terms of the total charge in the sphere, Q = (4π R3 /3)ρ, this potential is simply φout (r) = Q/4π 0 r. This is as expected, because we already knew that the potential energy of a charge q due to the sphere is qQ/4π 0 r. And the potential φ equals the potential energy per unit charge. To find the potential inside the sphere, we must break the integral into two pieces: R r R r
ρR3 ρr
− E(r ) dr − E(r ) dr = − dr dr
φin (r) = −
2 ∞ R ∞ 30 r R 30 ρ 2 ρR3 ρR2 ρr2 − = (r − R2 ) = − . 30 R 60 20 60
(2.10)
Note that Eqs. (2.9) and (2.10) yield the same value of φ at the surface of the sphere, namely φ(R) = ρR2 /30 . So φ is continuous across the surface, as it should be. (The field is everywhere finite, so the line integral over an infinitesimal interval must yield an infinitesimal result.) The slope of φ is also continuous, because E(r) (which is the negative derivative of φ, because φ is the negative integral of E) is continuous. A plot of φ(r) is shown in Fig. 2.4. The potential at the center of the sphere is φ(0) = ρR2 /20 , which is 3/2 times the value at the surface. So if you bring a charge in from infinity, it takes 2/3 of your work to reach the surface, and then 1/3 to go the extra distance of R to the center.
We must be careful not to confuse the potential φ associated with a given field E with the potential energy of a system of charges. The potential energy of a system of charges is the total work required to assemble it, starting with all the charges far apart. In Eq. (1.14), for example, we expressed U, the potential energy of the charge system in Fig. 1.6. The electric potential φ(x, y, z) associated with the field in Fig. 1.6 would be the work per unit charge required to move a unit positive test charge from some chosen reference point to the point (x, y, z) in the field of that structure of nine charges.
2.3 Gradient of a scalar function Given the electric field, we can find the electric potential function. But we can also proceed in the other direction; from the potential we can derive the field. It appears from Eq. (2.4) that the field is in some sense the derivative of the potential function. To make this idea precise we introduce the gradient of a scalar function of position. Let f (x, y, z) be
f(r) rR 2 2 0
a − br 2
rR 2 3 0 cr R
r
Figure 2.4. The potential due to a uniform sphere of charge.
64
The electric potential
(a)
some continuous, differentiable function of the coordinates. With its partial derivatives ∂f /∂x, ∂f /∂y, and ∂f /∂z we can construct at every point in space a vector, the vector whose x, y, z components are equal to the respective partial derivatives.1 This vector we call the gradient of f , written “grad f ,” or ∇f :
f(x, y)
y
∇f ≡ xˆ
(x1, y1)
Direction of steepest slope
x (b)
y
(x1, y1)
x
Figure 2.5. The scalar function f (x, y) is represented by the surface in (a). The arrows in (b) represent the vector function, grad f .
∂f ∂f ∂f + yˆ + zˆ . ∂x ∂y ∂z
(2.13)
∇f is a vector that tells how the function f varies in the neighborhood of a point. Its x component is the partial derivative of f with respect to x, a measure of the rate of change of f as we move in the x direction. The direction of the vector ∇f at any point is the direction in which one must move from that point to find the most rapid increase in the function f . Suppose we were dealing with a function of two variables only, x and y, so that the function could be represented by a surface in three dimensions. Standing on that surface at some point, we see the surface rising in some direction, sloping downward in the opposite direction. There is a direction in which a short step will take us higher than a step of the same length in any other direction. The gradient of the function is a vector in that direction of steepest ascent, and its magnitude is the slope measured in that direction. Figure 2.5 may help you to visualize this. Suppose some particular function of two coordinates x and y is represented by the surface f (x, y) sketched in Fig. 2.5(a). At the location (x1 , y1 ) the surface rises most steeply in a direction that makes an angle of about 80◦ with the positive x direction. The gradient of f (x, y), ∇f , is a vector function of x and y. Its character is suggested in Fig. 2.5(b) by a number of vectors at various points in the two-dimensional space, including the point (x1 , y1 ). The vector function ∇f defined in Eq. (2.13) is simply an extension of this idea to three-dimensional space. (Be careful not to confuse Fig. 2.5(a) with real three-dimensional xyz space; the third coordinate there is the value of the function f (x, y).) As one example of a function in three-dimensional space, suppose f is a function of r only, where r is the distance from some fixed point O. On a sphere of radius r0 centered about O, f = f (r0 ) is constant. On a slightly larger sphere of radius r0 + dr it is also constant, with the value f = f (r0 + dr). If we want to make the change from f (r0 ) to f (r0 + dr), 1 We remind the reader that a partial derivative with respect to x, of a function of x, y, z,
written simply ∂f /∂x, means the rate of change of the function with respect to x with the other variables y and z held constant. More precisely, f (x + x, y, z) − f (x, y, z) ∂f = lim . ∂x x→0 x
(2.11)
As an example, if f = x2 yz3 , ∂f = 2xyz3 , ∂x
∂f = x2 z3 , ∂y
∂f = 3x2 yz2 . ∂z
(2.12)
2.5 Potential of a charge distribution
the shortest step we can make is to go radially (as from A to B) rather than from A to C, in Fig. 2.6. The “slope” of f is thus greatest in the radial direction, so ∇f at any point is a radially pointing vector. In fact ∇f = rˆ (df /dr) in this case, rˆ denoting, for any point, a unit vector in the radial direction. See Section F.2 in Appendix F for further discussion of the gradient.
65
B C
A
r0
2.4 Derivation of the field from the potential
O
It is now easy to see that the relation of the scalar function f to the vector function ∇f is the same, except for a minus sign, as the relation of the potential φ to the field E. Consider the value of φ at two nearby points, (x, y, z) and (x + dx, y + dy, z + dz). The change in φ, going from the first point to the second, is, in first-order approximation, dφ =
∂φ ∂φ ∂φ dx + dy + dz. ∂x ∂y ∂z
(2.15)
The infinitesimal vector displacement ds is just xˆ dx + yˆ dy + zˆ dz. Thus if we identify E with −∇φ, where ∇φ is defined via Eq. (2.13), then Eqs. (2.14) and (2.15) become identical. So the electric field is the negative of the gradient of the potential: E = −∇φ
dr
(2.14)
On the other hand, from the definition of φ in Eq. (2.4), the change can also be expressed as dφ = −E · ds.
r0+
(2.16)
The minus sign came in because the electric field points from a region of greater potential toward a region of lesser potential, whereas the vector ∇φ is defined so that it points in the direction of increasing φ. To show how this works, we go back to the example of the field in Fig. 2.3. From the potential given by Eq. (2.8), φ = −Kxy, we can recover the electric field we started with: ∂ ∂ + yˆ (−Kxy) = K(ˆxy + yˆ x). (2.17) E = −∇(−Kxy) = − xˆ ∂x ∂y
2.5 Potential of a charge distribution We already know the potential that goes with a single point charge, because we calculated the work required to bring one charge into the neighborhood of another in Eq. (1.9). The potential at any point, in the field of an isolated point charge q, is just q/4π 0 r, where r is the distance
Figure 2.6. The shortest step for a given change in f is the radial step AB, if f is a function of r only.
66
The electric potential
z “Field” point (x, y, z) r
dx, dy, dz
(x, y, z)
Charge distribution
y
from the point in question to the source q, and where we have assigned zero potential to points infinitely far from the source. Superposition must work for potentials as well as fields. If we have several sources, the potential function is simply the sum of the potential functions that we would have for each of the sources present alone – providing we make a consistent assignment of the zero of potential in each case. If all the sources are contained in some finite region, it is always possible, and usually the simplest choice, to put zero potential at infinite distance. If we adopt this rule, the potential of any charge distribution can be specified by the integral ρ(x , y , z ) dx dy dz
, (2.18) φ(x, y, z) = all 4π 0 r sources
x x x
Figure 2.7. Each element of the charge distribution ρ(x , y , z ) contributes to the potential φ at the point (x, y, z). The potential at this point is the sum of all such contributions; see Eq. (2.18).
where r is the distance from the volume element dx dy dz to the point (x, y, z) at which the potential is being evaluated (Fig. 2.7). That is, r = [(x − x )2 + (y − y )2 + (z − z )2 ]1/2 . Notice the difference between this and the integral giving the electric field of a charge distribution; see Eq. (1.22). Here we have r in the denominator, not r2 , and the integral is a scalar not a vector. From the scalar potential function φ(x, y, z) we can always find the electric field by taking the negative gradient of φ, according to Eq. (2.16). In the case of a discrete distribution of source charges, the above integral is replaced by a sum over all the charges, indexed by i: φ(x, y, z) =
all sources
qi , 4π 0 r
(2.19)
where r is the distance from the charge qi to the point (x, y, z). Example (Potential of two point charges) Consider a very simple example, the potential of the two point charges shown in Fig. 2.8. A positive charge of 12 μC is located 3 m away from a negative charge, −6 μC. (The “μ” prefix stands for “micro,” or 10−6 .) The potential at any point in space is the sum of the potentials due to each charge alone. The potentials for some selected points in space are given in the diagram. No vector addition is involved here, only the algebraic addition of scalar quantities. For instance, at the point on the far right, which is 6 m from the positive charge and 5 m from the negative charge, the potential has the value 0.8 · 10−6 C/m 12 · 10−6 C −6 · 10−6 C 1 + = 4π 0 6m 5m 4π 0 = 7.2 · 103 J/C = 7.2 · 103 V,
(2.20)
where we have used 1/4π 0 ≈ 9 · 109 N m2 /C2 (and also 1 N m = 1 J). The potential approaches zero at infinite distance. It would take 7.2 · 103 J of work
2.5 Potential of a charge distribution
67
6m
Charge −6 C
3m
f=0
f=0
3m
−8 4p 0
3m
3m
f=
2m
1m
4m
0.5
5m
f = +0.8 4p 0
6m
f = +10 4p 0
Charge +12 C
to bring a unit positive charge in from infinity to a point where φ = 7.2 · 103 V. Note that two of the points shown on the diagram have φ = 0. The net work done in bringing in any charge to one of these points would be zero. You can see that there must be an infinite number of such points, forming a surface in space surrounding the negative charge. In fact, the locus of points with any particular value of φ is a surface – an equipotential surface – which would show on our two-dimensional diagram as a curve.
There is one restriction on the use of Eq. (2.18): it may not work unless all sources are confined to some finite region of space. A simple example of the difficulty that arises with charges distributed out to infinite distance is found in the long charged wire whose field E we studied in Section 1.12. If we attempt to carry out the integration over the charge distribution indicated in Eq. (2.18), we find that the integral diverges – we get an infinite result. No such difficulty arose in finding the electric field of the infinitely long wire, because the contributions of elements of the line charge to the field decrease so rapidly with distance. Evidently we had better locate the zero of potential somewhere close to home, in a system that has charges distributed out to infinity. Then it is simply a matter of calculating the difference in potential φ21 , between the general point (x, y, z) and the selected reference point, using the fundamental relation, Eq. (2.4).
Example (Potential of a long charged wire) To see how this goes in the case of the infinitely long charged wire, let us arbitrarily locate the reference point P1 at a distance r1 from the wire. Then to carry a charge from P1 to
Figure 2.8. The electric potential φ at various points in a system of two point charges. φ goes to zero at infinite distance and is given in units of volts, or joules per coulomb.
68
The electric potential
any other point P2 at distance r2 requires the work per unit charge, using Eq. (1.39): P2 r2 Îť dr E ¡ ds = − φ21 = − 2Ď€ 0 r P1 r1 Îť Îť ln r2 + ln r1 . (2.21) =− 2Ď€ 0 2Ď€ 0 This shows that the electric potential for the charged wire can be taken as φ=−
Îť ln r + constant. 2Ď€ 0
(2.22)
The constant, (Îť/2Ď€ 0 ) ln r1 in this case, has no effect when we take −grad φ to get back to the field E. In this case, E = âˆ’âˆ‡Ď† = −ˆr
Νˆr dφ = . dr 2π 0 r
(2.23)
2.6 Uniformly charged disk Let us now study the electric potential and field around a uniformly charged disk. This is a charge distribution like that discussed in Section 1.13, except that it has a limited extent. The flat disk of radius a in Fig. 2.9 carries a positive charge spread over its surface with the constant density Ďƒ , in C/m2 . (This is a single sheet of charge of infinitesimal thickness, not two layers of charge, one on each side. That is, the total charge in the system is Ď€ a2 Ďƒ .) We shall often meet surface charge distributions in the future, especially on metallic conductors. However, the object just described is not a conductor; if it were, as we shall soon see, the charge could not remain uniformly distributed but would redistribute itself, crowding more toward the rim of the disk. What we have is an insulating disk, like a sheet of plastic, upon which charge has been “sprayedâ€? so that every square meter of the disk has received, and holds fixed, the same amount of charge.
z
ds
a
s P2 x
(0, y, 0)
s (C/m2)
P1 y
Figure 2.9. Finding the potential at a point P1 on the axis of a uniformly charged disk.
Example (Potential on the axis) Let us find the potential due to our uniformly charged disk, at some point P1 on the axis of symmetry, which we have made the y axis. All charge elements in a thin, ring-shaped segment of the disk lie at the same distance from P1 . If s denotes the radius of such an annular segment and ds is its width, its area is 2Ď€ s ds. The amount of charge it contains, dq, is therefore dq = Ďƒ 2Ď€sds. Since all parts of this ring are the same distance away 2 , the contribution of the ring to the potential at from P1 , namely, r = y2 + s P1 is dq/4Ď€ 0 r = Ďƒ s ds 20 y2 + s2 . To get the potential due to the whole disk, we have to integrate over all such rings: a a Ďƒ Ďƒ s ds dq = = y2 + s2 . (2.24) φ(0, y, 0) = 2 2 4Ď€ 0 r 2 0 20 y + s 0 0
2.6 Uniformly charged disk
69
Putting in the limits, we obtain φ(0, y, 0) =
σ 20
y2 + a2 − y
for y > 0.
(2.25)
A minor point deserves a comment. The result we have written down in Eq. (2.25) holds for all points on the positive y axis. It is obvious from the physical symmetry of the system (there is no difference between one face of the disk and the other) that the potential must have the same value for negative and positive y, and this is reflected in Eq. (2.24), where only y2 appears. But in writing Eq. (2.25) we made a choice of sign in taking the square root of y2 , with the consequence that it holds only for positive y. The correct expression for y < 0 is obtained by the other choice of root and is given by σ y2 + a2 + y for y < 0. (2.26) φ(0, y, 0) = 20 In view of this, we should not be surprised to find a kink in the plot of φ(0, y, 0) at y = 0. Indeed, the function has an abrupt change of slope there, as we see in Fig. 2.10, where we have plotted as a function of y the potential on the axis. The potential at the center of the disk is φ(0, 0, 0) =
σa . 20
(2.27)
This much work would be required to bring a unit positive charge in from infinity, by any route, and leave it sitting at the center of the disk. The behavior of φ(0, y, 0) for very large y is interesting. For y a we can approximate Eq. (2.25) as follows: ⎡ ⎤
2 1/2 a a2 1 a2 2 2 ⎣ ⎦ 1+ 2 + · · · − 1 ≈ . −1 =y 1+ y +a −y=y 2 y2 2y y (2.28)
f
a2s 4 0y
f on axis
−2a
−a
0
a
2a
y
Figure 2.10. A graph of the potential on the axis. The dashed curve is the potential of a point charge q = π a2 σ .
70
The electric potential
Hence φ(0, y, 0) ≈
a2 σ 40 y
for y a.
(2.29)
Now π a2 σ is the total charge q on the disk, and Eq. (2.29), which can be written as π a2 σ/4π 0 y, is just the expression for the potential due to a point charge of this magnitude. As we should expect, at a considerable distance from the disk (relative to its diameter), it doesn’t matter much how the charge is shaped; only the total charge matters, in first approximation. In Fig. 2.10 we have drawn, as a dashed curve, the function a2 σ/40 y. You can see that the axial potential function approaches its asymptotic form pretty quickly.
It is not quite so easy to derive the potential for general points away from the axis of symmetry, because the definite integral isn’t so simple. It proves to be something called an elliptic integral. These functions are well known and tabulated, but there is no point in pursuing here mathematical details peculiar to a special problem. However, one further calculation, which is easy enough, may be instructive.
Example (Potential on the rim) We can find the potential at a point on the very edge of the disk, such as P2 in Fig. 2.11. To calculate the potential at P2 we can consider first the thin wedge of length R and angular width dθ, as shown. An element of the wedge, the black patch at distance r from P2 , contains an amount of charge dq = σ r dθ dr. Its contribution to the potential at P2 is therefore dq/4π 0 r = σ dθ dr/4π 0 . The contribution of the entire wedge is then R (σ dθ/4π 0 ) dr = (σ R/4π 0 ) dθ. Now R is 2a cos θ, from the geometry of
R
0
the right triangle, and the whole disk is swept out as θ ranges from −π/2 to π/2. Thus we find the potential at P2 :
dr dq q
φ=
r P2 a s
Figure 2.11. Finding the potential at a point P2 on the rim of a uniformly charged disk.
π/2 σa σa cos θ dθ = . 2π 0 −π/2 π 0
(2.30)
Comparing this with the potential at the center of the disk, σ a/20 , we see that, as we should expect, the potential falls off from the center to the edge of the disk. The electric field, therefore, must have an outward component in the plane of the disk. That is why we remarked earlier that the charge, if free to move, would redistribute itself toward the rim. To put it another way, our uniformly charged disk is not a surface of constant potential, which any conducting surface must be unless charge is moving.2
2 The fact that conducting surfaces have to be equipotentials will be discussed
thoroughly in Chapter 3.
2.6 Uniformly charged disk Let us now examine the electric field due to the disk. For y > 0, the field on the symmetry axis can be computed directly from the potential function given in Eq. (2.25): âˆ‚Ď† d Ďƒ 2 2 y +a −y =− Ey = − ∂y dy 20
Ďƒ y = 1− y > 0. (2.31) 20 y2 + a2 To be sure, it is not hard to compute Ey directly from the charge distribution, for points on the axis. We can again slice the disk into concentric rings, as we did prior to Eq. (2.24). But we must remember that E is a vector and that only the y component survives in the present setup, whereas we did not need to worry about components when calculating the scalar function φ above. As y approaches zero from the positive side, Ey approaches Ďƒ/20 . On the negative y side of the disk, which we shall call the back, E points in the other direction and its y component Ey is âˆ’Ďƒ/20 . This is the same as the field of an infinite sheet of charge of density Ďƒ , derived in Section 1.13. It ought to be, for at points close to the center of the disk, the presence or absence of charge out beyond the rim can’t make much difference. In other words, any sheet looks infinite if viewed from close up. Indeed, Ey has the value Ďƒ/20 not only at the center, but also all over the disk. For large y, we can find an approximate expression for Ey by using a Taylor series approximation as we did in Eq. (2.28). You can show that Ey approaches a2 Ďƒ/40 y2 , which can be written as Ď€a2 Ďƒ/4Ď€ 0 y2 . This is correctly the field due to a point charge with magnitude Ď€ a2 Ďƒ . In Fig. 2.12 we show some field lines for this system and also, plotted as dashed curves, the intersections on the yz plane of the surfaces of constant potential. Near the center of the disk these are lens-like surfaces, while at distances much greater than a they approach the spherical form of equipotential surfaces around a point charge. Figure 2.12 illustrates a general property of field lines and equipotential surfaces. A field line through any point and the equipotential surface through that point are perpendicular to one another, just as, on a contour map of hilly terrain, the slope is steepest at right angles to a contour of constant elevation. This must be so, because if the field at any point had a component parallel to the equipotential surface through that point, it would require work to move a test charge along a constant-potential surface. The energy associated with this electric field could be expressed as the integral over all space of (0 /2)E2 dv. It is equal to the work done in assembling this distribution, starting with infinitesimal charges far apart. In this particular example, as Exercise 2.56 will demonstrate, that work
71
72
The electric potential
ace Surf
of constant potentia l
e
d
el Fi
lin
y
Figure 2.12. The electric field of the uniformly charged disk. Solid curves are field lines. Dashed curves are intersections, with the plane of the figure, of surfaces of constant potential.
is not hard to calculate directly if we know the potential at the rim of a uniformly charged disk. There is a general relation between the work U required to assemble a charge distribution ρ(x, y, z) and the potential φ(x, y, z) of that distribution: U=
1 2
ρφ dv
(2.32)
Equation (1.15), which gives the energy of a system of discrete point charges, could have been written in this way: 1 1 qk qj . 2 4π 0 rjk N
U=
j=1
(2.33)
k=j
The second sum is the potential at the location of the jth charge, due to all the other charges. To adapt this to a continuous distribution we merely
2.7 Dipoles
73 y
replace qj with ρ dv and the sum over j by an integral, thus obtaining Eq. (2.32).
q
2.7 Dipoles
/2
Consider a setup with two equal and opposite charges ±q located at positions ± /2 on the y axis, as shown in Fig. 2.13. This configuration is called a dipole. The purpose of this section is to introduce the basics of dipoles. We save further discussion for Chapter 10, where we define the word “dipole” more precisely, derive things in more generality, and discuss examples of dipoles in actual matter. For now we just concentrate on determining the electric field and potential of a dipole. We have all of the necessary machinery at our disposal, so let’s see what we can find. We will restrict the treatment to points far away from the dipole (that is, points with r ). Although it is easy enough to write down an exact expression for the potential φ (and hence the field E = −∇φ) at any position, the result isn’t very enlightening. But when we work in the approximation of large distances, we obtain a result that, although isn’t exactly correct, is in fact quite enlightening. That’s how approximations work – you trade a little bit of precision for a large amount of clarity. Our strategy will be to find the potential φ in polar (actually spherical) coordinates, and then take the gradient to find the electric field E. We then determine the shape of the field-line and constant-potential curves. To make things look a little cleaner in the calculations below, we write 1/4π 0 as k in some intermediate steps.
First note that, since the dipole setup is rotationally symmetric around the line containing the two charges, it suffices to find the potential in an arbitrary plane containing this line. We will use spherical coordinates, which reduce to polar coordinates in a plane because the angle φ doesn’t come into play (but note that θ is measured down from the vertical axis). Consider a point P with coordinates (r, θ ), as shown in Fig. 2.14. Let r1 and r2 be the distances from P to the two charges. Then the exact expression for the potential at P is (with k ≡ 1/4π 0 ) kq kq − . r1 r2
/2
−q
Figure 2.13. Two equal and opposite charges form a dipole. P
r1 r q r2 /2
q
/2
−q
2.7.1 Calculation of φ and E
φP =
x
Figure 2.14. Finding the potential φ at point P. r1 ( /2) cos q P to
q
r
(2.34)
If desired, the law of cosines can be used to write r1 and r2 in terms of r, θ , and . Let us now derive an approximate form of this result, valid in the r limit. One way to do this is to use the law-of-cosines expressions for r1 and r2 ; this is the route we will take in Chapter 10. But for the present purposes a simpler method suffices. In the r limit, a closeup view of the dipole is shown in Fig. 2.15. The two lines from the charges to P are essentially parallel, so we see from the figure that the lengths of
r2 /2 q −q
( /2) cos q
Figure 2.15. Closeup view of Fig. 2.14.
74
The electric potential these lines are essentially r1 = r − ( /2) cos θ and r2 = r + ( /2) cos θ . Using the approximation 1/(1 ± ) ≈ 1 ∓ , Eq. (2.34) becomes ⎡ ⎤ 1 kq kq ⎢ 1 kq ⎥ − = − ⎣
cos θ
cos θ
cos θ
cos θ ⎦ r r− r+ 1− 1+ 2r 2 2 2r kq
cos θ
cos θ ≈ 1+ − 1− r 2r 2r
φ(r, θ ) =
=
−q
q
Figure 2.16. Two possible kinds of quadrupoles.
kq cos θ ≡ r2
q cos θ 4π 0 r2
p cos θ , 4π 0 r2
(2.35)
where p ≡ q is called the dipole moment. There are three important things to note about this result. First, φ(r, θ ) depends on q and only through their product, p ≡ q . This means that if we make q ten times larger and ten times smaller, the potential at a given point P stays the same (at least in the r approximation). An idealized dipole or point dipole is one where → 0 and q → ∞, with the product p = q taking on a particular finite value. In the other extreme, if we make q smaller and proportionally larger, the potential at P again stays the same. Of course, if we make too large, our r assumption eventually breaks down. Second, φ(r, θ ) is proportional to 1/r2 , in contrast with the 1/r dependence for a point-charge potential. We will see below that the present 1/r2 dependence in φ(r, θ ) leads to an E field that falls off like 1/r3 , in contrast with the 1/r2 dependence for a point-charge field. It makes sense that the potential (and field) falls off faster for a dipole, because the potentials from the two opposite point charges nearly cancel. The dipole potential is somewhat like the derivative of the point-charge potential, in that we are taking the difference of two nearby values. Third, there is angular dependence in φ(r, θ ), in contrast with the point-charge potential. This is expected, in view of the fact that the dipole has a preferred direction along the line joining the charges, whereas a point charge has no preferred direction. We will see in Chapter 10 that the q/r point-charge (or monopole) potential and the q /r2 dipole potential (just looking at the r dependence) are the first two pieces of what is called the multipole expansion. A general charge distribution also has a quadrupole term in the potential that goes like q 2 /r3 (where is some length scale of the system), and an octupole term that goes like q 3 /r4 , and so on. These pieces have more complicated angular dependences. Two examples of quadrupole arrangements are shown in Fig. 2.16. A quadrupole is formed by placing two oppositely charged dipoles near each other, just as a dipole is formed by placing two oppositely charged monopoles near each other. The various terms in the expansion are called the moments of the distribution.
2.7 Dipoles
Even the simple system of the dipole shown in Fig. 2.13 has higher terms in its multipole expansion. If you keep additional terms in the 1/(1 Âą ) Taylor series in Eq. (2.35), you will find that the quadrupole term is zero, but the octupole term is nonzero. It is easy to see that the terms with even powers of r are nonzero. However, in the limit of an idealized dipole ( → 0 and q → ∞, with q fixed), only the dipole potential survives, because the higher-order terms are suppressed by additional powers of /r. Along the same lines, we can back up a step in the expansion and consider the monopole term. If an object has a nonzero net charge (note that our dipole does not), then the monopole potential, q/r, dominates, and all higher-order terms are comparatively negligible in the r limit. The distribution of charge in an object determines which of the terms in the expansion is the first nonzero one, and it is this term that determines the potential (and hence field) at large distances. We label the object according to the first nonzero term; see Fig. 2.17. Let’s now find the electric field, E = âˆ’âˆ‡Ď†, associated with the dipole potential in Eq. (2.35). In spherical coordinates (which reduce to polar coordinates in this discussion) the gradient of φ is âˆ‡Ď† = rˆ (âˆ‚Ď†/∂r) + θˆ(1/r)(âˆ‚Ď†/∂θ ); see Appendix F. So the electric field is ∂ E(r, θ ) = −ˆr ∂r =
≥
≥
kq cos θ r2
1 ∂ − θˆ r ∂θ
kq cos θ r2
75
Monopole
q
−q Dipole
Quadrupole
kq 2 cos θ rˆ + sin θ θˆ 3 r q 2 cos θ rˆ + sin θ θˆ 3 4π 0 r p 2 cos θ rˆ + sin θ θˆ . 3 4π 0 r
Octupole
Figure 2.17. Examples of different objects in the multipole expansion.
(2.36)
A few field lines are shown in Fig. 2.18. Let’s look at some special cases for θ. Equation (2.36) says that E points in the positive radial direction for θ = 0 and the negative radial direction for θ = π. These facts imply that E points upward everywhere on the y axis. Equation (2.36) also says that E points in the positive tangential direction for θ = π/2 and the negative tangential direction for θ = 3π/2. In view of the local rˆ and θˆ basis vectors shown in Fig. 2.18 (which vary with position, unlike the Cartesian xˆ and yˆ basis vectors), this means that E points downward everywhere on the x axis. We haven’t drawn the lines for small r, to emphasize the fact that our results are valid only in the limit r . There is a field for small r, of course (and it diverges near each charge); it’s just that it doesn’t take the form given in Eq. (2.36).
76
The electric potential
r
(q = 0) q
q (q = 3p/2)
r
r q
q
(q = p/2)
(q = p)
r
Figure 2.18. Electric field lines for a dipole. Note that the rˆ and θˆ basis vectors depend on position.
q=0
q = p/2
2.7.2 The shapes of the curves Let us now be quantitative about the shape of the E and φ curves. More precisely, let us determine the equations that describe the field-line curves and the constant-potential curves. In the process we will also determine the slopes of the tangents to these curves. We know that the two classes of curves are orthogonal wherever they meet, because E is the (negative) gradientofφ,andbecausethegradientofafunctionisalwaysperpendicular to the level-surface curves. This orthogonality is evident in Fig. 2.19. Our task now is to derive the two expressions for r given in this figure. Let’s look at φ first. We will find the equation for the constantpotential curves and then use this to find the slope of the tangent at any point. The equation for the curves is immediately obtained from Eq. (2.35). The set of points for which φ takes on the constant value φ0 is given by kq cos θ = φ0 ⇒ r2 = r2
Figure 2.19. Field lines and constant-potential curves for a dipole. The two sets of curves are orthogonal at all intersections. The solid√lines show constant-φ curves (r = r0 cos θ ), and the dashed lines show E field lines (r = r0 sin2 θ ).
kq
cos θ ⇒ φ0
√ r = r0 cos θ
(2.37) √ where r0 ≡ kq /φ0 is the radius associated with the angle θ = 0. This result is valid in the upper half-plane where −π/2 < θ < π/2. In the negative, so we need to add lower half-plane, both φ0 and cos θ are √ √ in some absolute-value signs. That is, r = r0 | cos θ |, where r0 ≡ kq /|φ0 |. The constant-potential curves in Fig. 2.19 are the intersections of the constant-potential surfaces with the plane of the paper. These surfaces are generated by rotating the curves around the vertical axis. The curves are stretched horizontally compared with the circles described by the relation r = r0 cos θ (which you can verify is indeed a circle).
12.10 Chapter 10
We see that t = RC is independent of A, because R ∝ 1/A and C ∝ A. (Basically, if a given patch of the membrane leaks its charge on a given time scale, then putting a bunch of these patches together shouldn’t change the time scale, because each patch doesn’t care that there are others next to it.) Using the information given for 1 cm2 of the membrane, we have t = RC = (1000 )(10−6 F) = 10−3 s. Since R = ρs/A, the resistivity is given by ρ=
(1000 )(10−4 m2 ) RA = ≈ 4 · 107 ohm-m. s 2.7 · 10−9 m
(12.453)
From Fig. 4.8, this is a little more than 100 times the resistivity of pure water. 10.2 Force on a dielectric (a) The equivalent capacitance of two capacitors in parallel is simply the sum of the capacitances. (The rule is opposite to that for resistors; see Problem 3.18.) The capacitance of the part with the dielectric is κ times what it would be if there were vacuum there. So the total capacitance is given by κ A 0 A 1 + 0 2 C = C1 + C 2 = s s ! a 0 a(b − x) κ0 ax + = 0 b + (κ − 1)x . = s s s
(12.454)
The stored energy is then U=
Q2 s Q2 = . 2C 20 a[b + (κ − 1)x]
(12.455)
Note that as x changes, the charge stays constant (by assumption), but the potential does not. So the Qφ/2 and Cφ 2 /2 forms of the energy aren’t useful. (b) The force is F=−
Q2 s(κ − 1) dU = . dx 20 a[b + (κ − 1)x]2
(12.456)
The positive sign here means that the force points in the direction of increasing x. That is, the dielectric slab is pulled into the capacitor. But it’s risky to trust this sign blindly. Physically, the force points in the direction of decreasing energy. And we see from the above expression for U that the energy decreases as x increases (because κ > 1). The force F is correctly zero if κ = 1, because in that case we don’t actually have a dielectric. The κ → ∞ limit corresponds to a conductor. In that case, both U and F are zero. Basically, all of the charge on the plates shifts to the overlap x region, and compensating charge gathers there in the dielectric, so in the end there is no field anywhere. Note that F decreases as x increases. You should think about why this is the case. Hint: First convince yourself why the force
745
746
(a)
Solutions to the problems
d q
–q (b)
Figure 12.129.
d
should be proportional to the product of the charge densities (and not the total charges) on the two parts of the plates. And then look at Exercise 10.15. 10.3 Energy of dipoles The first configuration is shown in Fig. 12.129(a). There are four relevant (non-internal) pairs of charges, so the potential energy is (with d) q2 2q2 q2 1 1 2¡ = −2¡ 1− U= 4Ď€ 0 d 4Ď€ 0 d 1 + 2 /d2 d2 + 2 2 2 2 2 2 q
2q p = 1− 1− 2 ≈ ≥ , (12.457) 3 4Ď€ 0 d 2d 4Ď€ 0 d 4Ď€ 0 d3 √ where we have used 1/ 1 + ≈ 1 − /2. The second configuration is shown in Fig. 12.129(b). The potential energy is now q2 q2 q2 q2 1 1 1 2¡ − − = 2− − 4Ď€ 0 d d− d+
4Ď€ 0 d 1 − /d 1 + /d
2
2 q2 2− 1+ + 2 − 1− + 2 ≈ 4Ď€ 0 d d d d d p2 2 2 q2 − 2 =− = , (12.458) 4Ď€ 0 d d 2Ď€ 0 d3 where we have used 1/(1 + ) ≈ 1 − + 2 . Note that we needed to go to second order in the Taylor expansions here. By looking at the initial expressions for U for each setup, it is clear why the first U is positive, but not so clear why the second U is negative. However, in the limit where the dipoles nearly touch, the second U is certainly negative. 10.4 Dipole polar components Remember that our convention for the angle θ is that it is measured down from the z axis in Fig. 10.6. So the radial unit vector is given by rˆ = sin θ xˆ + cos θ zˆ . The tangential unit vector, which is perpendicular to rˆ , is then given by θˆ = cos θ xˆ − sin θ zˆ ; this makes the dot product of rˆ and θˆ equal to zero, and you can check that the overall sign is correct. Inverting these expressions for rˆ and θˆ gives xˆ = sin θ rˆ + cos θ θˆ
and
ˆ zˆ = cos θ rˆ − sin θ θ.
(12.459)
Therefore, E = Ex xˆ + Ez zˆ ˆ + Ez (cos θ rˆ − sin θ θ) ˆ = Ex (sin θ rˆ + cos θ θ) ˆ x cos θ − Ez sin θ) = rˆ (Ex sin θ + Ez cos θ) + θ(E + , p 2 θ − 1) cos θ ˆ = r (3 sin θ cos θ) sin θ + (3 cos 4Ď€ 0 r3 , + (12.460) + θˆ (3 sin θ cos θ) cos θ − (3 cos2 θ − 1) sin θ .
12.10 Chapter 10
Using sin2 θ + cos2 θ = 1 in the rˆ term, E quickly simplifies to E=
p 2 cos θ rˆ + sin θ θˆ , 3 4π 0 r
(12.461)
as desired. Alternatively, Er equals the projection of E = (Ex , Ez ) onto rˆ = (sin θ, cos θ ). Since rˆ is a unit vector, this projection equals the dot product E ¡ rˆ . Therefore, Er = E ¡ rˆ = (Ex , Ez ) ¡ (sin θ , cos θ ) = Ex sin θ + Ez cos θ,
(12.462)
in agreement with the third line in Eq. (12.460). Likewise, Eθ = E ¡ θˆ = (Ex , Ez ) ¡ (cos θ , − sin θ ) = Ex cos θ − Ez sin θ, (12.463) again in agreement with the third line in Eq. (12.460). 10.5 Average field (a) From part (c) of Problem 1.28 we know that the average electric field over the volume of a sphere of radius R, due to a given charge q at radius r < R, has magnitude qr/4Ď€ 0 R3 and points toward the center (if q is positive). In vector form, this average field can be written as over all the −qr/4Ď€ 0 R3 . If we sum this
charges inside the sphere, then the numerator becomes qi ri (or rĎ dv if we have a continuous charge distribution). But this sum is, by definition, the dipole moment p, where p is measured relative to the center. So the average field over the volume of the sphere is Eavg = −p/4Ď€ 0 R3 , as desired. Note that all that matters here is the dipole moment; the monopole moment (the total charge) doesn’t come into play. (b) Since Eavg is proportional to 1/R3 , and since volume is proportional to R3 , the total integral of E over the volume of a sphere is independent of R (provided that R is large enough to contain all the charges). This means that if we increase the radius by dR, we don’t change the integral of E. This implies that the average value of E over the surface of any sphere containing all the charges equals zero. (We actually already knew this from part (a) of Problem 1.28. Each individual charge yields zero average field over the surface.) A special case of this result is the centered point-dipole case in Exercise 10.25. So for the specific case shown in Fig. 10.32(a), the average value of the field over the surface of the sphere is zero. And since the dipole moment has magnitude p = 2q and points upward, the result from part (a) tells us that the average value over the volume of the sphere, Eavg = −p/4Ď€ 0 R3 , has magnitude q /2Ď€ 0 R3 and points downward. (c) The average value of the field over the surface of the sphere in Fig. 10.32(b) is not zero. From part (b) of Problem 1.28, the average field due to each charge has magnitude q/4Ď€ 0 2 and points downward. So the average field over the surface, due to both charges, has magnitude q/2Ď€ 0 2 and points downward. Since this is independent of the radius of the sphere, the average field over the volume of a sphere with R < also has magnitude q/2Ď€ 0 2 and points downward.
747
748
Solutions to the problems
The moral of all this is that “outside� the dipole, the field points in various directions and averages out over the surface of a sphere. But “inside� the dipole, the field points generally in one direction, so the average is nonzero over the surface of a sphere. Note that volume average of E is continuous as R crosses the R =
cutoff between the two cases in parts (a) and (b); in both cases it has magnitude q/2Ď€ 0 2 . If we multiply this by / and use p = q , we can write it as p/2Ď€ 0 3 . Multiplying by the volume 4Ď€ 3 /3 then tells us that the total volume integral of E, over a sphere of radius
, has magnitude 2p/30 and points downward. In other words, for a fixed value of p,
even the limit of an idealized dipole still has a nonzero value of E dv, despite the fact that the only shells yielding nonzero contributions are infinitesimal ones. 10.6 Quadrupole tensor Our goal is to find the potential φ(r) at the point r = (x1 , x2 , x3 ). As in Section 10.2, primed coordinates will denote the position of a point in the charge distribution. The distance from r to a particular point r = (x1 , x2 , x3 ) in the distribution is
(x1 − x1 )2 + (x2 − x2 )2 + (x3 − x3 )2 & & 2 xi xi
2 xˆ i xi
r 2 r 2 , =r 1+ 2 − =r 1+ 2 − r r r2 r
R=
(12.464)
where we have used xi2 = r2 and xi 2 = r 2 , and where (ˆx1 , xˆ 2 , xˆ 3 ) = (x1 , x2 , x3 )/r is the unit vector rˆ in the r direction. Assuming that r is much smaller than r, we can use the expansion (1 + δ)−1/2 = 1 − δ/2 + 3δ 2 /8 − ¡ ¡ ¡ to write (dropping terms of order 1/r4 and higher)
2
xˆ i xi 3 xˆ i xi 1 r 2 1 = 1+ + − 2 R r r 2r2 2r
2 2 2
xˆ i xi 3 xˆ i xi xˆ i r 1 . 1+ + − = 2 r r 2r 2r2
(12.465)
In the last term here, we have multiplied by 1 in the form of the square of the length of a unit vector, for future purposes. It is easier to understand this result for 1/R if we write it in terms of vectors and matrices: ⎛ ⎞ x1 1 1 1 ⎜ âŽ&#x; = + 2 (ˆx1 , xˆ 2 , xˆ 3 ) ¡ âŽ? x2 ⎠(12.466) R r r x3
⎛ ⎞⎛ ⎞ 3x1 2 − r 2 3x1 x2
3x1 x3
xˆ 1 ⎜ âŽ&#x;⎜ âŽ&#x; 1
2
2 + 3 (ˆx1 , xˆ 2 , xˆ 3 ) ¡ ⎜ 3x2 x3 âŽ&#x; âŽ? 3x2 x1 3x2 − r ⎠âŽ? xˆ 2 ⎠. 2r
2
2 xˆ 3 3x3 x1 3x3 x2 3x3 − r
12.10 Chapter 10
You should verify that this is equivalent to Eq. (12.465). If desired, the diagonal terms of this matrix can be written in a slightly different form. Since r 2 = x1 2 + x2 2 + x3 2 , the upper left entry equals 2x1 2 − x2 2 − x3 2 . Likewise for the other two diagonal entries. Note that there are only five independent entries in the matrix, because it is symmetric and has trace zero. To obtain φ(r), we must compute the integral, Ď (r )dv
1 . (12.467) φ(r) = 4Ď€ 0 R In other words, we must compute the volume integral of Eq. (12.466) times Ď (r ), and then tack on a 1/4Ď€ 0 . When the 1/r term is integrated, it simply gives q/r, where q is the total charge in the distribution. To write the other two terms in a cleaner way, define the vector p to be the vector whose entries are the Ď dv integrals of the entries in the above (x1 , x2 , x3 ) vector. And likewise define the matrix Q to be the Ď dv integral of the above matrix. For example, the first component of p and the upper-left entry of Q are 2 and Q11 = 3x1 − r 2 Ď (r )dv , p1 = x1 Ď (r )dv
(12.468) and so on. We can then write the result for the potential at an arbitrary point r in the compact form, 1 q rˆ ¡ p rˆ ¡ Qˆr φ(r) = + 2 + . (12.469) 4π 0 r r 2r3 The advantage of Eq. (12.469) over Eq. (10.9) in the text is the following. The latter gives the correct value of φ at points on the z axis. However, if we want to find φ at another point, we must redefine θ as the angle with respect to the direction to the new point, and then recalculate all the Ki . The present result in Eq. (12.469) has the benefit that, although it involves calculating a larger number of quantities, it is valid for any choice of the point r. The quantities q, p, and Q depend only on the distribution, and not on the point r at which we want to calculate the potential. Conversely, the quantities rˆ and r in Eq. (12.469) depend only on r and not on the distribution. So, for a given charge distribution, we can calculate (with respect to a given set of coordinate axes) p and Q once and for all. We then simply need to plug our choice of r into Eq. (12.469), and this correctly gives φ(r) up to order 1/r3 . In the special case where r lies on the z ≥ x3 axis, we have rˆ = (0, 0, 1). Since only xˆ 3 is nonzero, only Q33 (the lower right entry in Q) survives in the dot product rˆ ¡ Qˆr. Furthermore, if θ is the angle of r with respect to the x3 axis, then we have x3 = r cos θ. So Q33 =
2 r (3 cos2 θ −1)Ď dv . When the 1/2r3 factor in Eq. (12.469) is included, we correctly arrive at the result Eq. (10.9). For a spherical shell, which we know has only a monopole moment, you can quickly verify that all of the entries in Q are zero. The off-diagonal
749
750
Solutions to the problems
entries are zero from symmetry, and the diagonal elements are zero due to the example in Section 10.2 combined with the previous paragraph. Alternatively, the average value of, say, x1 2 over the surface of a sphere equals r 2 /3, because it has the same average value as x2 2 and x3 2 , and the sum of all three averages is r 2 . If you want to get some practice with Q, Exercise 10.26 deals with the quadrupole arrangement in Fig. 10.5. 10.7 Force on a dipole Let the dipole consist of a charge −q at position r and a charge q at position r + s. Then the dipole vector is p = qs. If the dipole is placed in an electric field E, the net force on it is F = (−q)E(r) + qE(r + s).
(12.470)
The x component of this is Fx = (−q)Ex (r)+qEx (r+s). Now, the change in a function f due to a small displacement s is ∇f · s, by the definition of the gradient (or at least that’s one way of defining it). So we can write Fx as ! Fx = q Ex (r + s) − Ex (r) = q∇Ex · s = (qs) · ∇Ex ≡ p · ∇Ex ,
(12.471)
as desired. Likewise for the other two components. 10.8 Force from an induced dipole If q is the charge of the ion, then the magnitude of the electric field of the ion at the location of the atom is E = q/4π 0 r2 . If the polarizability of the atom is α, then the induced dipole moment of the atom is p = αE = αq/4π 0 r2 . This dipole moment points along the line from the ion to the atom (see Fig. 12.130), so the magnitude of the field of the induced dipole at the location of the ion is Edipole = 2p/4π 0 r3 . The magnitude of the force on the ion is therefore F = qEdipole =
2pq 2(αq/4π 0 r2 )q 2αq2 = = . 3 3 4π 0 r 4π 0 r (4π 0 )2 r5
(12.472)
You can quickly show that the force is attractive for either sign of q. The potential energy relative to infinity is r r 2αq2 dr
αq2 F(r )dr = − − =− . U(r) = − 2
5 2(4π 0 )2 r4 ∞ ∞ (4π 0 ) r (12.473) Atom
Ion r
p
q
The polarizability of sodium is given by α/4π 0 = 27 · 10−30 m3 . If the magnitude of the potential energy equals |U| = 4 · 10−21 J, then solving for r and setting q = e gives ⎤1/4 ⎡ 1/4
2 −30 3 −19 2 (27 · 10 m )(1.6 · 10 C) (α/4π 0 )q ⎥ ⎢ =⎣ r= ⎦ 2 C2 s 2(4π 0 )|U| −12 −21 (4 · 10 2 · 4π 8.85 · 10 J) kg m3
Eion
Figure 12.130.
Edipole
= 9.4 · 10−10 m.
(12.474)
If r is larger than this, then (on average) the thermal energy is sufficient to kick the ion out to infinity.
12.10 Chapter 10
751
10.9 Polarized water We must determine the number, n, of molecules of water per cubic centimeter. A mole of something with molecular mass M has a mass of M grams. (Equivalently, since the proton mass is 1.67 ¡ 10−24 g, it takes 1/(1.67 ¡ 10−24 ) = 6 ¡ 1023 protons to make 1 gram, and this number is essentially Avogadro’s number.) Water has a molecular weight of 18, so the number of water molecules per gram (= cm3 ) is n = (6 ¡ 1023 /mole)/ (18 cm3 /mole) = 3.33 ¡ 1022 cm−3 . The dipole moment of water can be written as p = 6.13 ¡ 10−28 C-cm. Assuming the dipoles all point down, the polarization density is therefore P = np = (3.33 ¡ 1022 cm−3 )(6.13 ¡ 10−28 C-cm) = 2.04 ¡ 10−5 C/cm2 . (12.475) From the reasoning in Section 10.7, this is the surface charge density, Ďƒ . The number of electrons per square centimeter it corresponds to is Ďƒ/e = (2.04 ¡ 10−5 C/cm2 )/(1.6 ¡ 10−19 C) = 1.3 ¡ 1014 cm−2 . This is somewhat smaller than the number of surface molecules per square centimeter, which equals n2/3 = 1.0 ¡ 1015 cm−2 because each edge of the 1 cm3 cube is (approximately) n1/3 molecules long. 10.10 Tangent field lines Consider the Gaussian surface indicated by the heavy line in Fig. 12.131. The side part of the surface is constructed to follow the field lines, so there is no flux there. Likewise, there is no flux through the top circular face, because the field is zero outside the capacitor plates. So the only flux comes from the great circle inside the sphere. From Eq. (10.53) the field inside the sphere has the uniform value of 3E0 /(2 + Îş). So the flux out of the Gaussian surface equals âˆ’Ď€R2 ¡ 3E0 /(2 + Îş), where the minus arises because the flux is inward. The total charge enclosed in the Gaussian surface comes from two places: the negative charge in the circle on the upper capacitor plate, and the positive charge on the upper hemisphere. The former is simply qcap = (âˆ’Ďƒ )Ď€ r2 = (−0 E0 )Ď€ r2 , where we have used the fact that the charge densities on the capacitor plates are what cause the uniform field E0 ; hence E0 = Ďƒ/0 . The latter charge is just qsph = PĎ€ R2 , where P is the polarization, because the top patch of the column in Fig. 10.21(a) has a charge of P da (where da is the horizontal cross-sectional area), independent of the tilt angle of the actual end face. And all the da areas simply add up to the great-circle area, Ď€ R2 . (Or you could just integrate the P cos θ surface density over the hemisphere.) Using the value of P from Eq. (10.54), Gauss’s law gives 1 qcap + qsph 0 1 Îş −1 2 2 = 0 E0 ¡ Ď€ R −0 E0 Ď€ r + 3 0 Îş +2 Îş −1 = −r2 + 3R2 Îş +2 3Îş . (12.476) =R Îş +2
E=0 –s
=–
0E0
E0
3E0
Îş+2
= 3E0 Îş +2 1 ⇒ −3R2 Îş +2
⇒ âˆ’Ď€ R2
⇒ r
s
Figure 12.131.
=
0E0
752
Solutions to the problems
As a check, we have r = R when κ = 1. In this case, our dielectric is just vacuum, so the field remains E0 everywhere; the field lines are all √ straight. Also, we have r = √3R when κ → ∞. In this limit the sphere is a conductor. The factor of 3 isn’t so obvious. Note that, in the case of a conductor, a field line can’t actually be tangent to the surface, because field lines must always be perpendicular to the surface of a conductor. What happens is that the external field approaches zero along the equator (the zero vector is, in some sense, both parallel and perpendicular to the surface). But a tiny distance away from the equator, the field is nonzero, so it is meaningful to ask where that field line ends up on the distant capacitor plates.
(Inside S)
–q
s
(Outside S)
q s
Figure 12.132.
10.11 Bound charge and divergence of P If we take the volume integral of both sides of Eq. (10.61) and use the divergence theorem, we see that our goal is to show that S P · da = −qbound , where qbound is the bound charge enclosed within the surface S. Assume that the polarization P arises from N dipoles per unit volume, each with a dipole moment p = qs. Then P = Np = Nqs. If the dipoles point in random directions, so that P = 0, then there is no extra bound charge in a given volume. But if they are aligned, so that P = 0, and if additionally P varies with position, then there may be a net bound charge in the volume. The reasoning is as follows. Consider a collection of dipoles, as shown in Fig. 12.132. The vertical line represents a patch of the right-hand surface of S. How much extra negative charge is there inside S, that is, to the left of the line? If a given dipole lies entirely inside or outside S, then it contributes nothing to the net charge. But if a dipole is cut by the vertical line, then there is an extra charge of −q inside S. How many dipoles are cut by the line? Any dipole whose center lies within s/2 of the line gets cut by it. So the center must lie in a slab with thickness s, indicated by the shaded region in the figure. The two extreme dipole positions are indicated by the boxes. If the area of a given patch of the surface is da, then any dipole whose center lies in a slab of volume s da will contribute a charge of −q to S. Since there are N dipoles per unit volume, we see that N(s da) dipoles are cut by the line. The extra charge associated with the patch is therefore dqbound = N(s da)(−q), which can be written as dqbound = −(Nqs)da = −P da. If a dipole is tilted at an angle θ with respect to the normal to the patch, then the volume of the relevant slab is decreased by a factor of cos θ. If we tack this factor onto P, it simply turns P into the component P⊥ perpendicular to the surface. So in general the extra charge inside the volume, near a given patch with area da, equals dqbound = −P⊥ da, which can be written as the dot product, dqbound = −P · da. Integrating this over the entire surface gives the total enclosed bound charge as (12.477) qbound = − P · da, as desired. Although we motivated this result in Section 10.11 by considering dielectrics, this problem shows (as mentioned in the text) that this result is
12.10 Chapter 10
quite independent of dielectrics. No matter how the polarization P comes about, the result in Eq. (12.477) is still valid. (You can manually twist the dipoles in whatever way you want, provided that P changes slowly on the length scale of the dipoles, so that we can talk about smooth averages.) To emphasize what we said in the text, the logical route to Eq. (10.62) is to start with Eqs. (10.59) and (10.61), both of which are universally true, and then Eq. (10.62) immediately follows. No mention has been made of dielectrics. But if we are in fact dealing with a (linear) dielectric, then P = χe 0 E, and we can use 1 + χe = κ to say that additionally 0 E + P = 0 E + χe 0 E = κ0 E ≡ E.
(12.478)
In all cases the relation D ≡ 0 E + P holds, but that is just a definition. 10.12 Boundary conditions for D D⊥ is continuous. This follows from div D = ρfree ; there is no free charge in the setup, so the divergence of D is zero. The divergence theorem then tells us that D · da = 0 for any closed surface. That is, there is zero flux through any surface. So if we draw a pancake-like pillbox with one face just inside the slab and one face just outside, the inward flux through one face must equal the outward flux through the other. Hence Din ⊥A = in = Dout . That is, D is continuous across the boundary. Dout A ⇒ D ⊥ ⊥ ⊥ ⊥ For D , we know that E is continuous across the boundary, because all we have at the boundary is a layer of bound charge, which produces no discontinuity in E . So D ≡ 0 E+P tells us that the discontinuity in D is the same as the discontinuity in P . Since P = 0 outside, the discontinuity in P is simply −Pin . That is, the change in D when going from inside to outside is −Pin .
10.13 Q for a leaky capacitor From Exercise 10.42, the energy density in the electric field is E2 /2. √ And it is the same for the magnetic field, by plugging B = μ0 E into B2 /2μ0 . The total energy density is therefore E2 , or E02 cos2 ωt. But the time average of cos2 ωt is 1/2, so the average energy density is E02 /2. The energy in the fields will decay due to ohmic resistance. To calculate this power dissipation, consider a tube of cross-sectional area A and length L. The power dissipated in this tube is P = I 2 R = (JA)2 (ρL/A) = J 2 ρ(AL) 1 = (σ E)2 (volume) = σ E2 (volume). σ
(12.479)
The power dissipated per unit volume is therefore σ E2 . The time average of this is σ E02 /2. Hence Q=
ω(E02 /2) ω · (energy stored) ω = , = power loss σ σ E02 /2
(12.480)
753
754
Solutions to the problems
as desired. From Table 4.1, the conductivity of seawater is σ = 4 (ohm-m)−1 . And from Fig. 10.29, the dielectric constant κ is still about 80 at a frequency of 1000 MHz (109 Hz). Therefore, since = κ0 , we have 2 2 (2π · 109 s−1 ) 80 · 8.85 · 10−12 s C 3 kg m = 1.1. (12.481) Q= 4 (ohm-m)−1 Since Q equals the number of radians of ωt required for the energy to decrease by a factor of 1/e, we see that by the end of one cycle (2π radians) there is practically no energy left. The wavelength corresponding to √ 1000 MHz is (c/ κ)/ν = 0.033 m. So microwave radar won’t find submarines! 10.14 Boundary conditions on E and B With no free charges or currents, the equations describing the system are ∇ · D = 0,
∇ × E = −∂B/∂t;
∇ · B = 0,
∇ × B = μ0 ∂D/∂t.
(12.482)
The two equations involving D come from Eqs. (10.64) and (10.78) with ρfree and Jfree set equal to zero. The other two equations are two of Maxwell’s equations. We can now apply the standard arguments. For the perpendicular components, we can apply the divergence theorem to the two “div” equations, with the volume chosen to be a squat pillbox, of vanishing thickness, spanning the surface. Our equations tell us that the net flux out of the volume is zero, so the perpendicular field on one side must equal the perpendicular field on the other. And for the parallel components, we can apply Stokes’ theorem to the two “curl” equations, with the area chosen to be a thin rectangle, of vanishing area, spanning the surface. Our equations tell us that the line integral around the rectangle is zero, so the parallel field on one side must equal the parallel field on the other. (The finite non-zero entries on the right-hand sides of the curl equations are inconsequential, because they provide zero contribution when integrated over the area of an infinitesimally thin rectangle.) The above four equations therefore yield (with 1 and 2 labeling the two regions) D1,⊥ = D2,⊥ , B1,⊥ = B2,⊥ ,
E1, = E2, ; B1, = B2, .
(12.483)
Since D = E for a linear dielectric, the first of these equations gives 1 E1,⊥ = 2 E2,⊥ .
(12.484)
So E⊥ is discontinuous. But the other three components are continuous across the boundary. That is, the entire B field is continuous, as is the parallel component of E. Note that we are assuming that the materials aren’t magnetic. After reading Section 11.10, you can show that in magnetic materials there is a discontinuity in B .
12.11 Chapter 11
12.11 Chapter 11 11.1
Maxwell’s equations with magnetic charge Maxwell’s equations with only electric charge and electric current are given in Eq. (9.17). If magnetic charge existed, the last equation would have to be replaced, as discussed in Section 11.2, by ∇ · B = b1 η, where η is the magnetic charge density, and b1 is a constant that depends on how the unit of magnetic charge is chosen. With the conventional definition of the direction of B, a positive magnetic charge would be attracted to the north pole of the earth, so it would behave like the north pole of a compass. Magnetic charge in motion with velocity v would constitute a magnetic current. Let K be the magnetic current density. Then K = ηv, in analogy with J = ρv. Conservation of magnetic charge would then be expressed by the “continuity equation,” ∇ · K = −∂η/∂t, in analogy with ∇ · J = −∂ρ/∂t. A magnetic current would be the source of an electric field, just as an electric current is the source of a magnetic field. So we must add to the right side of the first Maxwell equation in Eq. (9.17) a term proportional to K. (Equivalently, if we didn’t add such a term, we would end up with a contradiction, similar to the one in Section 9.1, arising from the fact that ∇ · (∇ × E) = 0 is identically zero.) Let this new term be b2 K. Then we have ∇ ×E=−
∂B + b2 K. ∂t
(12.485)
To determine the constant b2 , we can take the divergence of both sides of this equation. The left-hand side is identically zero because ∇ · (∇ × E) = 0, so we have (using the continuity equation) ∂B + b2 ∇ · K 0 = −∇ · ∂t ∂η ∂ = − (∇ · B) + b2 − ∂t ∂t ∂ ∂η = − (b1 η) − b2 ∂t ∂t ∂η (12.486) = −(b1 + b2 ) . ∂t Therefore b2 must equal −b1 . So the generalized Maxwell’s equations take the form (with b ≡ b1 = −b2 ), ∂B − bK, ∂t ∂E + μ0 J, ∇ × B = μ0 0 ∂t ρ ∇ ·E= , 0
∇ ×E=−
∇ · B = bη.
(12.487)
The constant b can be chosen arbitrarily. Two common conventions are b = 1 and b = μ0 .
755
756
Solutions to the problems
11.2
Magnetic dipole If we treat the current loop like an exact dipole, then the dipole moment is m = Ia = IĎ€ b2 . Equation (11.15) gives the magnetic field at position z along the axis of the dipole as Îź0 m/2Ď€ z3 , which here equals Îź0 (IĎ€ b2 )/ 2Ď€z3 = Îź0 Ib2 /2z3 . If we treat the current loop (correctly) as a loop of finite size, then Eq. (6.53) gives the field at position z on the axis as Bz = Îź0 Ib2 /2(z2 + b2 )3/2 . For z b we can ignore the b2 term in the denominator, yielding Bz ≈ Îź0 Ib2 /2z3 , which agrees with the above result for the idealized dipole. The correct result is smaller than the idealized-dipole result by the factor z3 /(z2 + b2 )3/2 . This factor approaches 1 as z → ∞. It is larger than a given number Ρ (we are concerned with Ρ = 0.99) if z3 (z2 + b2 )3/2
> Ρ ⇒
z2 z2 + b2
> Ρ2/3 ⇒ z >
Ρ1/3 b 1 − Ρ2/3
.
(12.488) For Ρ = 0.99 this gives z > (12.2)b. You can show that if we want the factor to be larger than 1 − (so = 0.01 here), then √ to a good approx3/2. And indeed, imation (in the limit of small ) we need z/b > √ √ 3/2(0.01) = 150 = 12.2. 11.3
Dipole in spherical coordinates Using the ∇ Ă— (A Ă— B) vector identity from Appendix K, with m constant, we find (ignoring the Îź0 /4Ď€ for now) ! B âˆ? ∇ Ă— m Ă— (ˆr/r2 ) = m ∇ ¡ (ˆr/r2 ) − (m ¡ ∇)(ˆr/r2 ).
But the divergence of rˆ /r2 is zero (except at r = 0), because we know that the divergence of the Coulomb field is zero; alternatively we can just use the expression for the divergence in spherical coordinates. So we are left with only the second term. Therefore, using the expression for ∇ in spherical coordinates,
m sin q r m
q m cos q
q
q
Figure 12.133.
(12.489)
∂ 1 ∂ rˆ + mθ B � − mr . ∂r r ∂θ r2
(12.490)
In the ∂/∂r term here, the vector rˆ doesn’t depend on r, but r2 does, of course, so mr (∂/∂r)(ˆr/r2 ) = −2mr rˆ /r3 . In the ∂/∂θ term, r2 doesn’t depend of θ, but the vector rˆ does. If we increase θ by dθ, then rˆ changes direction by the angle dθ. Since rˆ has length 1, it therefore picks up a component with length dθ in the θˆ direction. See Fig. F.3 in Appendix F; that figure is relevant to the oppositely defined θ in cylindrical ˆ So we have coordinates, but the result is the same. Hence ∂ rˆ /∂θ = θ. ˆ 3. (mθ /r)(∂/∂θ )(ˆr/r2 ) = mθ θ/r Finally, in Fig. 12.133 we see that the components of the fixed vector m = mˆz relative to the local rˆ -θˆ basis are mr = m cos θ, and mθ = −m sin θ. The negative sign here comes from the fact that m points
12.11 Chapter 11
partially in the direction of decreasing θ (at least for the right half of the sphere). Putting this all together, and bringing the μ0 /4π back in, gives rˆ μ0 θˆ −2(m cos θ ) 3 + (−m sin θ) 3 B=− 4π r r μ μ0 m m cos θ + θˆ 0 3 sin θ, (12.491) = rˆ 2πr3 4πr in agreement with Eq. (11.15). 11.4
Force on a dipole (a) The expression (m · ∇)B is shorthand for ∂ ∂ ∂ + my + mz (Bx , By , Bz ). (m · ∇)B = mx ∂x ∂y ∂z
(12.492)
The operator in parentheses is to be applied to each of the three components of B, generating the three components of a vector. In the setup in Fig. 11.9 with the ring and diverging B field, mz is the only nonzero component of m. Also, Bx and By are identically zero on the z axis, so ∂Bx /∂z and ∂By /∂z are both zero (or negligibly small close to the z axis). Therefore only one of the nine possible terms in Eq. (12.492) survives, and we have ∂Bz , (12.493) (m · ∇)B = 0, 0, mz ∂z as desired. (b) The expression ∇(m · B) is shorthand for ∂ ∂ ∂ ∇(m · B) = , , (mx Bx + my By + mz Bz ). ∂x ∂y ∂z
(12.494)
Each derivative acts on the whole sum in the parentheses. But again, only mz is nonzero. Also, on the z axis, Bz doesn’t depend on x or y, to first order (because, by symmetry, Bz achieves a maximum or minimum on the z axis, so the slope as a function of x and y must be zero). Hence ∂Bz /∂x and ∂Bz /∂y are both zero (or negligibly small close to the z axis). So again only one term survives and we have ∂Bz , (12.495) ∇(m · B) = 0, 0, mz ∂z as desired. (c) Let’s first see what the two expressions yield for the force on the given square loop. Then we will calculate what the force actually is. The dipole moment m points out of the page with magnitude I(area), so we have m = zˆ Ia2 . Using the above expressions for (m · ∇)B and ∇(m · B) in Eqs. (12.492) and (12.494), we obtain ∂ (0, 0, B0 x) = (0, 0, 0) (12.496) (m · ∇)B = 0 + 0 + (Ia2 ) ∂z
757
758
Solutions to the problems
and
∇(m ¡ B) =
∂ ∂ ∂ , , 0 + 0 + (Ia2 )B0 x = (Ia2 B0 , 0, 0). ∂x ∂y ∂z (12.497)
We see that the first expression yields zero force on the loop, while the second yields a force of Ia2 B0 in the positive x direction. Let’s now explicitly calculate the force. We quickly find that the net force on the top side of the square is zero (the right half cancels the left half). Likewise for the bottom side. Alternatively, the corresponding pieces of the top and bottom sides have canceling forces. So we need only look at the left and right sides. By the right-hand rule, the force on the right side is directed to the right with magnitude IB = I(B0 a/2)(a) = IB0 a2 /2. The force on the left side also points to the right (both I and B switch sign) with the same magnitude. The total force is therefore F = IB0 a2 in the positive x direction, in agreement with Eq. (12.497). So ∇(m ¡ B) is the correct expression for the force. (Actually, all that we’ve done is rule out the (m ¡ ∇)B force. But ∇(m ¡ B) is in fact correct in all cases.) 11.5
Converting χm Consider a setup in which the SI quantities are M = 1 amp/m and B = 1 tesla. Then χm = Îź0 M/B = 4Ď€ ¡ 10−7 . You can verify that the units do indeed cancel so that χm is dimensionless. How would someone working with Gaussian units describe this setup? Since 1 amp/m equals (3 ¡ 109 esu/s)/(100 cm), this would be the value of M in Gaussian units if there weren’t the extra factor of c in the definition of m. This factor reduces the value of all dipole moments m (and hence all magnetizations M) by 3 ¡ 1010 cm/s. The value of M in Gaussian units is therefore M=
3 ¡ 109 esu/s esu 1 = 10−3 2 . 100 cm 3 ¡ 1010 cm/s cm
(12.498)
Both of the factors of 3 here are actually 2.998, so this result is exact. The magnetic field in Gaussian units that corresponds to 1 tesla is 104 gauss, so the susceptibility in Gaussian units for the given setup is χm =
10−3 esu/cm2 M esu = = 10−7 = 10−7 . B 104 gauss cm2 gauss
(12.499)
The units do indeed cancel, because the expression for the Lorentz force tells us that a gauss has the units of force per charge. So the units of χm are esu2 /(cm2 ¡force). And these units cancel, as you can see by looking at the units in Coulomb’s law. The above value of χm in SI units was 4Ď€ ¡ 10−7 , which is 4Ď€ times the Gaussian value, as desired. 11.6
Paramagnetic susceptibility of liquid oxygen Equation (11.20) gives the force on a magnetic moment as F = m(∂Bz /∂z). Using the data in Table 11.1, and taking upward to be positive for all quantities, the magnetic moment of a 10−3 kg sample is
12.11 Chapter 11
m=
−7.5 · 10−2 N F = = 4.4 · 10−3 J/T. ∂Bz /∂z −17 T/m
(12.500)
The magnetic susceptibility is defined via M = χm B/μ0 . (The accepted M = χm H definition would give essentially the same result, because χm will turn out to be very small. See Exercise 11.38.) The volume of 1 gram of liquid oxygen is V = (10−3 kg)/(850 kg/m3 ) = 1.18 · 10−6 m3 . So χm = =
M (m/V) mμ0 = = B/μ0 B/μ0 BV (4.4 · 10−3 J/T)(4π · 10−7 kg m/C2 ) = 2.6 · 10−3 . (1.8 T)(1.18 · 10−6 m3 )
(12.501)
11.7
Rotating shell For the magnetized sphere, we know from Eq. (11.55) that near the equator the surface current density is equal to M, because the sphere looks essentially like a cylinder there (the surface is parallel to M). But away from the equator, the surface is tilted with respect to M. From the example at the end of Section 11.8, the surface current density is given by J = M ⇒ J (θ ) = M sin θ , where θ is the angle down from the top of the sphere (assuming that M points up). Now consider a rotating sphere with uniform surface charge density σ . The surface current density at any point is J = σ v, where v = ω(R sin θ ) is the speed due to the rotation. Hence J (θ ) = σ ωR sin θ. The J (θ ) expressions for the magnetized and rotating spheres have the same functional dependence on θ, so they will be equal for all θ provided that M = σ ωR.
11.8
B inside a magnetized sphere (a) The field in Eq. (11.15) is obtained from the field in Eq. (10.18) by letting p → m and 0 → 1/μ0 . If we replace all the electric dipoles p in a polarized sphere with magnetic dipoles m, then at an external point, the field from each dipole is simply multiplied by (m/p)(μ0 0 ). The integral over all the dipole fields is multiplied by this same factor, so the new magnetic field at any external point equals (m/p)(μ0 0 ) times the old electric field. We know from Section 10.9 that the old external electric field is the same as the field due to an electric dipole with strength p0 = (4π R3 /3)P, with P = Np, located at the center. You can quickly check that (m/p)(μ0 0 ) times this field is the same as the magnetic field due to a magnetic dipole with strength m0 = (4π R3 /3)M, with M = Nm. (b) If m0 points in the z direction, then from Eq. (11.12) the Cartesian components of A at points (x, y, z) on the surface of the sphere are μ m y My , Ax = − 0 03 = −μ0 4π R 3 Ay =
μ0 m 0 x Mx , = μ0 4π R3 3
Az = 0.
(12.502)
759
760
Solutions to the problems
Note that the result from Problem 11.7 then tells us that the A on the surface of a spinning spherical shell equals (μ0 σ ωR/3)(−y, x, 0). This agrees with the A we found in a different manner in Problem 6.7. Recall from Section 6.3 that Ax satisfies ∇ 2 Ax = −μ0 Jx . And similarly for Ay . But J = 0 inside the sphere, so both Ax and Ay satisfy Laplace’s equation there. By the uniqueness theorem, this means that if we can find a solution to Laplace’s equation inside the sphere that satisfies the boundary conditions on the surface of the sphere, then we know that we have found the solution. And just as with the φ for the polarized sphere in Section 10.9, the solutions for Ax and Ay are easy to come by. They are simply the functions given in Eq. (12.502); their second derivatives are zero, so they each satisfy Laplace’s equation. The magnetic field inside the sphere is then xˆ yˆ zˆ 2μ0 M μ0 M ∂/∂x ∂/∂y ∂/∂z = zˆ . (12.503) B=∇ ×A= 3 3 −y x 0 Like the E inside the polarized sphere, this B is uniform and points vertically. But that is where the similarities end. This B field points upward, whereas the old E field pointed downward. Additionally, the numerical factor here is 2/3, whereas it was (negative) 1/3 in E. The 2/3 is exactly what is needed to make the component normal to the surface be continuous, and to make the tangential component have the proper discontinuity (see Exercise 11.31). Equation (12.503), combined with the result from Problem 11.7, tells us that the field throughout the interior of a spinning spherical shell is uniform and has magnitude 2μ0 σ ωR/3. This is consistent with the result from Problem 6.11 for the field at the center of the sphere. 11.9
B at the north pole of a spinning sphere From Problem 11.7, we know that the magnetic field due to a spinning shell with radius r and uniform surface charge density σ is the same (both inside and outside) as the field due to a sphere with uniform magnetization Mr = σ ωr. And then from Problem 11.8 we know that the external field of a magnetized sphere is that of a dipole with strength m = (4π r3 /3)Mr located at the center. So the (radial) field at radius R outside a spinning shell with radius r (at a point located above the north pole) is B=
2μ0 σ ωr4 μ0 4πr3 (σ ωr) μ0 m = = . 3 3 3 2πR 2πR 3R3
(12.504)
We can consider the solid spinning sphere to be the superposition of many spinning shells with radii ranging from r = 0 to r = R, with uniform surface charge density σ = ρ dr. The north pole of the solid sphere is outside all of the shells, so we can use the above dipole form of B for every shell. The total field at the north pole (that is, at radius R) is therefore R 2μ0 ρωR2 2μ0 (ρ dr)ωr4 . (12.505) = B= 3 15 3R 0
12.11 Chapter 11
This field is 2/5 as large as the field at the center of the sphere; see Exercise 11.32. In terms of the total charge Q = (4π R3 /3)ρ, we can write B as B = μ0 ωQ/10π R. 11.10 Surface current on a cube Equation (11.55) gives the surface current density as J = M. Since the units of magnetization (J/Tm3 ) can also be written as A/m, we have J = 4.8 · 105 A/m. This current density spans a ribbon that is = 0.05 m wide, so the current is I = J = (4.8 · 105 A/m)(0.05 m) = 24,000 A. The dipole moment of the cube is m = MV = (4.8 · 105 J T−1 m−3 )(0.05 m)3 = 60 J/T.
(12.506)
The field at a distance of 2 meters, along the axis, is given by Eq. (11.15) as B=
(4π · 10−7 kg m/C2 )(60 J/T) μ0 m = = 1.5 · 10−6 T, (12.507) 3 2π r 2π(2 m)3
or 0.015 gauss. This is about 30 times smaller than the earth’s field of ≈ 0.5 gauss, so it wouldn’t disturb a compass much. 11.11 An iron torus From Fig. 11.32, a B field of
1.2 tesla requires an H field of about 120 A/m. Consider the line integral H · dl around the “middle” circle of the solenoid, with diameter 11 cm. If I is the current in the wire, then NI = 20I is the free current enclosed by our circular loop. Therefore, H · dl = Ifree ⇒ (120 A/m) · π(0.11 m) = 20I ⇒ I = 2.1 A. (12.508)
761
A Differences between SI and Gaussian units
In this appendix we discuss the differences between the SI and Gaussian systems of units. First, we will look at the units in each system, and then we will talk about the clear and not so clear ways in which they differ.
A.1 SI units Consider the SI system, which is the one we use in this book. The four main SI units that we deal with are the meter (m), kilogram (kg), second (s), and coulomb (C). The coulomb actually isn’t a fundamental SI unit; it is defined in terms of the ampere (A), which is a measure of current (charge per time). The coulomb is a derived unit, defined to be 1 amperesecond. The reason why the ampere, and not the coulomb, is the fundamental unit involving charge is one of historical practicality. It is relatively easy to measure current via a galvanometer (see Section 7.1). More crudely, a current can be determined by measuring the magnetic force that two pieces of a current-carrying wire in a circuit exert on each other (see Fig. 6.4). Once we determine the current that flows onto an object during a given time, we can then determine the charge on the object. On the other hand, although it is possible to measure charge directly via the force that two equally charged objects exert on each other (imagine two balls hanging from strings, repelling each other, as in Exercise 1.36), the setup is a bit cumbersome. Furthermore, it tells us only what the product of the charges is, in the event that they aren’t equal. The point is that it is
A.1 SI units
easy to measure current by hooking up an ammeter (the main component of which is a galvanometer) to a circuit.1 The exact definition of an ampere is: if two parallel wires carrying equal currents are separated by 1 meter, and if the force per meter on one wire, due to the entirety of the other wire, is 2 · 10−7 newtons, then the current in each wire is 1 ampere. The power of 10 here is an arbitrary historical artifact, as is the factor of 2. This force is quite small, but by decreasing the separation the effect can be measured accurately enough with the setup shown in Fig. 6.4. Having defined the ampere in this manner, and then having defined the coulomb as 1 ampere-second (which happens to correspond to the negative of the charge of about 6.24 · 1018 electrons), a reasonable thing to do, at least in theory, is to find the force between two 1 coulomb charges located, say, 1 meter apart. Since the value of 1 coulomb has been fixed by the definition of the ampere, this force takes on a particular value. We are not free to adjust it by tweaking any definitions. It happens to be about 9 · 109 newtons – a seemingly arbitrary number, but in fact related to the speed of light. (It has the numerical value of c2 /107 ; we see why in Section 6.1.) This (rather large) number therefore appears out in front of Coulomb’s law. We could label this constant with one letter, such as “k,” but for various reasons it is labeled as 1/4π 0 , with 0 = 8.85 · 10−12 C2 s2 kg−1 m−3 . These units are what are needed to make the right-hand side of Coulomb’s law, F = (1/4π 0 )q1 q2 /r2 , have units of newtons (namely kg m s−2 ). In terms of the fundamental ampere unit, the units of 0 are A2 s4 kg−1 m−3 . The upshot of all this is that because we made the choice to define current via the Lorentz force (specifically, the magnetic part of the Lorentz force) between two wires carrying current I, the Coulomb force between two objects of charge q ends up being a number that we just have to accept. We can make the pre-factor be a nice simple number in either one of these force laws, but not both.2 The SI system gives preference to the Lorentz force, due to the historical matters of practicality mentioned above. It turns out that there are actually seven fundamental units in the SI system. They are listed in Table A.1. The candela isn’t relevant to our study of electromagnetism, and the mole and kelvin come up only occasionally. So for our purposes the SI system consists of essentially just the first four units.
1 If we know the capacitance of an object, then we can easily measure the charge on it
by measuring the voltage with a voltmeter. But the main component of a voltmeter is again a galvanometer, so the process still reduces to measuring a current. 2 The Biot–Savart law, which allows us to calculate the magnetic field that appears in the Lorentz force, contains what appears to be a messy pre-factor, namely μ0 /4π . But since μ0 is defined to be exactly 4π · 10−7 kg m/C2 , this pre-factor takes on the simple value of 10−7 kg m/C2 .
763
764
Differences between SI and Gaussian units
Table A.1. SI base units Quantity
Name
Symbol
Length Mass Time Electric current Thermodynamic temperature Amount of substance Luminous intensity
meter kilogram second ampere kelvin mole candela
m kg s A K mol cd
A.2 Gaussian units What do the units look like in the Gaussian system? As with the SI system, the last three of the above units (or their analogs) rarely come up, so we will ignore them. The first two units are the centimeter and gram. These differ from the SI units simply by a few powers of 10, so it is easy to convert from one system to the other. The third unit, the second, is the same in both systems. The fourth unit, that of charge, is where the two systems fundamentally diverge. The Gaussian unit of charge is the esu (short for “electrostatic unit”), which isn’t related to the coulomb by a simple power of 10. The reason for this non-simple relation is that the coulomb and esu are defined in different ways. The coulomb is a derivative unit of the ampere (which is defined via the Lorentz force) as we saw above, whereas the esu is defined via the Coulomb force. In particular, it is defined so that Coulomb’s law, q1 q2 rˆ , (A.1) r2 takes on a very simple form with k = 1. The price to pay for this simple form of the Coulomb force is the not as simple form of the Lorentz force between two current-carrying wires (although it isn’t so bad; like the Coulomb force in SI units, it just involves a factor of c2 ; see Eq. (6.16)). This is the opposite of the situation with the SI system, where the Lorentz force is the “nice” one. Again, in each system we are free to define things so that one, but not both, of the Lorentz force and Coulomb force takes on a nice form. F=k
A.3 Main differences between the systems In Section A.2 we glossed over what turns out to be the most important difference between the SI and Gaussian systems. In the SI system, the constant in Coulomb’s law, kSI ≡
N m2 1 = 8.988 · 109 , 4π 0 C2
(A.2)
A.3 Main differences between the systems
has nontrivial dimensions, whereas in the Gaussian system the constant kG = 1
(A.3)
is dimensionless. We aren’t just being sloppy and forgetting to write the units; k is simply the number 1. Although the first thing that may strike you about the two k constants is the large difference in their numerical values, this difference is fairly inconsequential. It simply changes the numerical size of various quantities. The truly fundamental and critical difference is that kSI has units whereas kG does not. We could, of course, imagine a system of units where k = 1 dyne-cm2 /esu2 . This definition would parallel the units of kSI , with the only difference being the numerical value. But this is not what the Gaussian system does. The reason why the dimensionlessness of kG creates such a profound difference between the two systems is that it allows us to solve for the esu in terms of other Gaussian units. In particular, from looking at the units in Coulomb’s law, we can write (using 1 dyne = 1 g · cm/s2 ) & esu2 g · cm3 dyne = (dimensionless) · ⇒ esu = . (A.4) 2 cm s2 The esu is therefore not a fundamental unit. It can be expressed in terms of the gram, centimeter, and second. In contrast, the SI unit of charge, the coulomb, cannot be similarly expressed. Since kSI has units of N m2 /C2 , the C’s (and everything else) cancel in Coulomb’s law, and we can’t solve for C in terms of other units. For our purposes, therefore, the SI system has four fundamental units (m, kg, s, A), whereas the Gaussian system has only three (cm, g, s). We will talk more about this below, but first let us summarize the three main differences between the SI and Gaussian systems. We state them in order of increasing importance. (1) The SI system uses kilograms and meters, whereas the Gaussian system uses grams and centimeters. This is the most trivial of the three differences, because all it does is introduce some easily dealt with powers of 10. (2) The SI unit of charge (the coulomb) is defined via the ampere, which in turn is defined in terms of the force between current-carrying wires. The Gaussian unit of charge (the esu) is defined directly in terms of Coulomb’s law. This latter definition is the reason why Coulomb’s law takes on a nicer form in Gaussian units. The differences between the two systems now involve more than simple powers of 10. However, although these differences can sometimes be a hassle, they aren’t terribly significant. They are just numbers – no different from powers of 10, except a little messier. All of the conversions you might need to use are listed in Appendix C.
765
766
Differences between SI and Gaussian units
(3) In Gaussian units, the k in Coulomb’s law is chosen to be dimensionless, whereas in SI units the k (which involves 0 ) has units.3 The result is that the esu can be expressed in terms of other Gaussian units, whereas the analogous statement is not true for the coulomb. This is the most important difference between the two systems.
A.4 Three units versus four Let us now discuss in more detail the issue of the number of units in each system. The Gaussian system has one fewer because the esu can be expressed in terms of other units via Eq. (A.4). This has implications with regard to checking units at the end of a calculation. In short, less information is gained when checking units in the Gaussian system, because the charge information is lost when the esu is written in terms of the other units. Consider the following example. In SI units the electric field due to a sheet of charge is given in Eq. (1.40) as Ďƒ/20 . In Gaussian units the field is 2Ď€ Ďƒ . Recalling the units of 0 in Eq. (1.3), the units of the SI field are kg m C−1 s−2 (or kg m A−1 s−3 if you want to write it in terms of amperes, but we use coulombs here to show analogies with the esu). This correctly has dimensions of (force)/(charge). The units of the Gaussian 2Ď€ Ďƒ field are simply esu/cm2 , but since the esu is given by Eq. (A.4), the units are g1/2 cm−1/2 s−1 . These are the true Gaussian units of the electric field when written in terms of fundamental units. Now let’s say that two students working in the Gaussian system are given a problem where the task is to find the electric field due to a thin sheet with charge density Ďƒ , mass m, volume V, moving with a nonrelativistic speed v. The first student realizes that most of this information is irrelevant and solves the problem correctly, obtaining the answer of 2Ď€ Ďƒ (ignoring relativistic corrections). The second student royally messes things up and obtains an answer of Ďƒ 3 Vm−1 v−2 . Since the fundamental Gaussian units of Ďƒ are g1/2 cm−1/2 s−1 , the units of this answer are 1/2 −1/2 −1 3 g cm s (cm)3 Ďƒ 3V g1/2 , (A.5) −→ = 2 2 mv (g)(cm/s) cm1/2 s which are the correct Gaussian units of electric field that we found above. More generally, in view of any answer with the Eq. (A.4) we seethat n units of (g1/2 cm−1/2 s−1 ) esu g−1/2 cm−3/2 s has the correct units for the field. The present example has n = 3. There are, of course, also many ways to obtain incorrect answers in the SI system that just happen by luck to have the correct units. Correctness of the units doesn’t guarantee correctness of the answer. But the 3 To draw a more accurate analogy: in SI units the defining equation for the ampere
(from which the coulomb is derived) contains the dimensionful constant Îź0 in the force between two wires.
A.5 The definition of B
point is that because the charge information is swept under the rug in Gaussian units, we have at our disposal the information of only three fundamental units instead of four. Compared with the SI system, there is therefore a larger class of incorrect answers in the Gaussian system that have the correct units.
A.5 The definition of B Another difference between the SI and Gaussian systems of units is the way in which the magnetic field is defined. In SI units the Lorentz force (or rather the magnetic part of it) is F = qv × B, whereas in Gaussian units it is F = (q/c)v × B. This means that wherever a B appears in an SI expression, a B/c appears in the corresponding Gaussian expression (among other possible modifications). Or equivalently, a Gaussian B turns into an SI cB. This difference, however, is a trivial definitional one and has nothing to do with the far more important difference discussed above, where the esu can be expressed in terms of other Gaussian units. In the Gaussian system, E and B have the same dimensions. In the SI system they do not; the dimensions of E are velocity times the dimensions of B. In this sense the Gaussian definition of B is more natural, because it makes sense for two quantities to have the same dimensions if they are related by a Lorentz transformation, as the E and B fields are; see Eq. (6.76) for the SI case and Eq. (6.77) for the Gaussian case. After all, the Lorentz transformation tells us that the E and B fields are simply different ways of looking at the same field, depending on the frame of reference. However, having a “cB” instead of a “B” in the SI Lorentz transformation can’t be so bad, because x and t are also related by a Lorentz transformation, and they don’t have the same dimensions (the direct correspondence is between x and ct). Likewise for p and E (where the direct correspondence is between pc and E). At any rate, this issue stems from the arbitrary choice of whether a factor of c is included in the expression for the Lorentz force. One can easily imagine an SI-type system (where charge is a distinct unit) in which the Lorentz force takes the form F = qE + (q/c)v × B, yielding the same dimensions for E and B.
A.6 Rationalized units You might wonder why there are factors of 4π in the SI versions of Coulomb’s law and the Biot–Savart law; see Eqs. (1.4) and (6.49). These expressions would certainly look a bit less cluttered without these factors. The reason is that the presence of 4π ’s in these laws leads to the absence of such factors in Maxwell’s equations. And for various reasons it is deemed more important to have Maxwell’s equations be the “clean” ones without the 4π factors. The procedure of inserting 4π into Coulomb’s law and the Biot–Savart law, in order to keep them out of Maxwell’s equations, is called “rationalizing” the units. Of course, for
767
768
Differences between SI and Gaussian units
people concerned more with applications of Coulomb’s law than with Maxwell’s equations, this procedure might look like a step in the wrong direction. But since Maxwell’s equations are the more fundamental equations, there is logic in this convention. It is easy to see why the presence of 4π factors in Coulomb’s law and the Biot–Savart law leads to the absence of 4π factors in Gauss’s law and Ampère’s law, which are equivalent to two of Maxwell’s equations (or actually one and a half; Ampère’s law is supplemented with another term). In the case of Gauss’s law, the absence of the 4π basically boils down to the area of a sphere being 4π r2 (see the derivation in Section 1.10). In the case of Ampère’s law, the absence of the 4π is a consequence of the reasoning in Sections 6.3 and 6.4, which again boils down to the area of a sphere being 4π r2 (because Eq. (6.44) was written down by analogy with Eq. (6.30)). Or more directly: the 1/4π in the Biot–Savart law turns into a 1/2π in the field from an infinite straight wire (see Eq. (6.6)), and this 2π is then canceled when we take the line integral around a circle with circumference 2π r. If there were no factors of 4π in Coulomb’s law or the Biot–Savart law, then there would be factors of 4π in Maxwell’s equations. This is exactly what happens in the Gaussian system, where the “curl B” and “div E” Maxwell equations each involve a 4π; see Eq. (9.20). Note, however, that one can easily imagine a Gaussian-type system (that is, one where the pre-factor in Coulomb’s law is dimensionless) that has factors of 4π in Coulomb’s law and the Biot–Savart law, and none in Maxwell’s equations. This is the case in a variation of Gaussian units called Heaviside–Lorentz units.
B We begin this appendix with the definitions of all of the derived SI units relevant to electromagnetism (for example, the joule, ohm, etc.). We then list the units of all of the main quantities that appear in this book (basically, anything that has earned the right to be labeled with its own letter). In SI units the ampere is the fundamental unit involving charge. The coulomb is a derived unit, being defined as one ampere-second. However, since most people find it more natural to think in terms of charge than current, we treat the coulomb as the fundamental unit in this appendix. The ampere is then defined as one coulomb/second. For each of the main quantities listed, we give the units in terms of the fundamental units (m, kg, s, C, and occasionally K), and then also in terms of other derived units in certain forms that come up often. For example, the units of electric field are kg m C−1 s−2 , but they are also newtons/coulomb and volts/meter. The various derived units are as follows: newton (N) =
kg m s2
joule (J) = newton-meter = ampere (A) = volt (V) =
kg m2 s2
coulomb C = second s kg m2 joule = coulomb C s2
SI units of common quantities
770
SI units of common quantities
farad (F) =
coulomb C2 s2 = volt kg m2
ohm () =
volt kg m2 = 2 ampere C s
watt (W) =
kg m2 joule = second s3
tesla (T) =
newton kg = coulomb · meter/second Cs
henry (H) =
kg m2 volt = ampere/second C2
The main quantities are listed by chapter. Chapter 1 charge q: C k in Coulomb’s law: 0 : E field (force per charge): flux (E field times area): charge density λ, σ , ρ:
N m2 kg m3 = 2 2 C s C2 C2 s2 C2 C F = = = Vm m kg m3 N m2 N V kg m = = 2 C m Cs N m2 kg m3 = = Vm C C s2 C C C , , m m2 m3
Chapter 2 potential φ (energy per charge):
kg m2 J = =V C C s2
dipole moment p: C m Chapter 3 capacitance C (charge per potential):
C C2 s2 = =F 2 V kg m
SI units of common quantities
Chapter 4 current I (charge per time): current density J (current per area):
C =A s A C = 2 2 m s m
conductivity σ (current density per field):
C2 s 1 = m kg m3
resistivity ρ (field per current density):
kg m3 = m C2 s
resistance R (voltage per current):
V kg m2 = = A C2 s
power P (energy per time):
J kg m2 = =W s s3
Chapter 5 speed of light c:
m s
Chapter 6 B field (force per charge-velocity):
kg =T Cs
μ0 :
kg m Tm = 2 A C
vector potential A:
kg m = Tm Cs
surface current density J (current per length):
A C = ms m
Chapter 7 electromotive force E: flux (B field times area): inductance M, L:
kg m2 J = = A = V 2 C Cs kg m2 = T m2 Cs kg m2 Vs = =H A C2
771
772
SI units of common quantities
Chapter 8 1 s
frequency ω:
quality factor Q: 1 (dimensionless) phase φ: 1 (dimensionless) admittance Y (current per voltage):
C2 s A 1 = = V kg m2
impedance Z (voltage per current):
V kg m2 = = A C2 s
Chapter 9 power density S (power per area):
W J kg = 2 = 2 s3 m s m
Chapter 10 dielectric constant κ: 1 (dimensionless) dipole moment p: C m torque N:
kg m2 = Nm s2
atomic polarizability α/4π 0 : m3 polarization density P:
C m2
electric susceptibility χe : 1 (dimensionless) permittivity : displacement vector D:
C2 C 2 s2 = 3 kg m N m2 C m2
temperature T: K Boltzmann’s constant k:
J kg m2 = K s2 K
SI units of common quantities
Chapter 11 magnetic moment m: angular momentum L: Planck’s constant h: magnetization M (m per volume):
C m2 J = A m2 = s T kg m2 s kg m2 = Js s A J C = = ms m T m3
magnetic susceptibility χm : 1 (dimensionless) H field: permeability μ:
C A = ms m Tm kg m = 2 A C
773
C Unit conversions
In this appendix we list, and then derive, the main unit conversions between the SI and Gaussian systems. As you will see below, many of the conversions involve simple plug-and-chug calculations involving conversions that are already known. However, a few of them (charge, B field, H field) require a little more thought, because the relevant quantities have different definitions in the two systems.
C.1 Conversions Except for the first five (nonelectrical) conversions below, we technically shouldn’t be using “=” signs, because they suggest that the units in the two systems are actually the same, up to a numerical factor. This is not the case. All of the electrical relations involve charge in one way or another, and a coulomb cannot be expressed in terms of an esu. This is a consequence of the fact that the esu is defined in terms of the other Gaussian units; see Appendix A for a discussion of how the coulomb and esu differ. The proper way to express, say, the sixth relation below is “1 coulomb is equivalent to 3 · 109 esu.” But we’ll generally just use the “=” sign, and you’ll know what we mean. The “[3]” in the following relations stands for the “2.998” that appears in the speed of light, c = 2.998 · 108 m/s. The coulomb-esu discussion below explains how this arises. time: length: mass:
1 second = 1 second 1 meter = 102 centimeter 1 kilogram = 103 gram
C.2 Derivations 1 newton = 105 dyne
force:
1 joule = 107 erg
energy:
B field:
1 coulomb = [3] · 109 esu 1 1 volt = statvolt [3] · 102 1 statvolt/cm 1 volt/meter = [3] · 104 1 farad = [3]2 · 1011 cm 1 1 ohm = s/cm [3]2 · 1011 1 s 1 ohm-meter = 2 [3] · 109 1 s2 /cm 1 henry = [3]2 · 1011 1 tesla = 104 gauss
H field:
1 amp/meter = 4π · 10−3 oersted
charge: E potential: E field: capacitance: resistance: resistivity: inductance:
C.2 Derivations C.2.1 Force: newton vs. dyne 1 newton = 1
kg m g cm (1000 g)(100 cm) = = 105 2 = 105 dynes. s2 s2 s (C.1)
C.2.2 Energy: joule vs. erg 1 joule = 1
2 (1000 g)(100 cm)2 kg m2 7 g cm = = 10 = 107 ergs. s2 s2 s2 (C.2)
C.2.3 Charge: coulomb vs. esu From Eqs. (1.1) and (1.2), two charges of 1 coulomb separated by a distance of 1 m exert a force on each other equal to 8.988 · 109 N ≈ 9 · 109 N, or equivalently 9 · 1014 dynes. How would someone working in Gaussian units describe this situation? In Gaussian units, Coulomb’s law gives the force simply as q2 /r2 . The separation is 100 cm, so if 1 coulomb equals N esu (with N to be determined), the 9 · 1014 dyne force between the charges can be expressed as 9 · 1014 dyne =
(N esu)2 ⇒ N 2 = 9 · 1018 ⇒ N = 3 · 109 . (100 cm)2 (C.3)
775
776
Unit conversions So 1 coulomb equals 3 ¡ 109 esu. If we had used the more exact√ value of k in Eq. (1.2), the “3â€? in this result would have been replaced by 8.988 = 2.998, which is precisely the 2.998 that appears in the speed of light, c = 2.998 ¡ 108 m/s. The reason for this is the following. If you follow through the above derivation while keeping things in terms of k ≥ 1/4Ď€ 0 , you will see that the number 3 ¡ 109 is actually {k} ¡ 105 ¡ 104 , where we have put the braces around k to signify that it is just the number 8.988 ¡ 109 without the SI units. (The factors of 105 and 104 come from the conversions to dynes and centimeters, respectively.) But we know from Eq. (6.8) that 0 = 1/Îź0 c2 , so we have k = Îź0 c2 /4Ď€. Furthermore, the numerical value of Îź0 is {Îź0 } = 4Ď€ ¡ 10−7 , so the numerical value of k is {k} = {c}2 ¡ 10−7 . Therefore, the number N that appears in Eq. (C.3) is really 9 N = {k} ¡ 10 = ({c}2 ¡ 10−7 )109 = {c} ¡ 10 = 2.998 ¡ 109 ≥ [3] ¡ 109 . (C.4) C.2.4 Potential: volt vs. statvolt 1 volt = 1
1 erg 107 erg 1 J = statvolt. = = C [3] ¡ 109 esu [3] ¡ 102 esu [3] ¡ 102 (C.5)
C.2.5 Electric field: volt/meter vs. statvolt/centimeter 1 statvolt statvolt 1 volt [3] ¡ 102 = = . 1 meter 100 cm [3] ¡ 104 cm
(C.6)
C.2.6 Capacitance: farad vs. centimeter 1 farad = 1
C = V
esu [3] ¡ 109 esu = [3]2 ¡ 1011 . 1 statvolt statvolt [3] ¡ 102
(C.7)
We can alternatively write these Gaussian units as centimeters. This is true because 1 statvolt = 1 esu/cm (because the potential from a point charge is q/r), so 1 esu/statvolt = 1 cm. We therefore have 1 farad = [3]2 ¡ 1011 cm.
(C.8)
C.2.7 Resistance: ohm vs. second/centimeter 1 statvolt 1 s V V [3] ¡ 102 = = 1 ohm = 1 = 1 A C/s [3] ¡ 109 esu/s [3]2 ¡ 1011 esu/statvolt 1 s = , (C.9) [3]2 ¡ 1011 cm where we have used 1 esu/statvolt = 1 cm.
C.2 Derivations
C.2.8 Resistivity: ohm-meter vs. second s 1 1 s. (100 cm) = 1 ohm-meter = [3]2 · 1011 cm [3]2 · 109
(C.10)
C.2.9 Inductance: henry vs. second2 /centimeter 1 statvolt V V [3] · 102 1 henry = 1 = =1 A/s C/s2 [3] · 109 esu/s2 2 s s2 1 1 = = , [3]2 · 1011 esu/statvolt [3]2 · 1011 cm
(C.11)
where we have used 1 esu/statvolt = 1 cm. C.2.10 Magnetic field B: tesla vs. gauss Consider a setup in which a charge of 1 C travels at 1 m/s in a direction perpendicular to a magnetic field with strength 1 tesla. Equation (6.1) tells us that the force on the charge is 1 newton. Let us express this fact in terms of the Gaussian force relation in Eq. (6.9), which involves a factor of c. We know that 1 N = 105 dyne and 1 C = [3] · 109 esu. If we let 1 tesla = N gauss, then the way that Eq. (6.9) describes the given situation is [3] · 109 esu cm (N gauss). (C.12) 100 105 dyne = s [3] · 1010 cm/s Since 1 gauss equals 1 dyne/esu, all the units cancel (as they must), and we end up with N = 104 , as desired. This is an exact result because the two factors of [3] cancel. C.2.11 Magnetic field H: ampere/meter vs. oersted The H field is defined differently in the two systems (there is a μ0 in the SI definition), so we have to be careful. Consider a B field of 1 tesla in vacuum. What H field does this B field correspond to in each system? In the Gaussian system, B is 104 gauss. But in Gaussian units H = B in vacuum, so H = 104 oersted, because an oersted and a gauss are equivalent units. In the SI system we have (you should verify these units) H=
1 tesla 107 A B = = . μ0 4π m 4π · 10−7 kg m/C2
(C.13)
Since this is equivalent to 104 oersted, we arrive at 1 amp/meter = 4π · 10−3 oersted. Going the other way, 1 oersted equals roughly 80 amp/meter.
777
D SI and Gaussian formulas
The following pages provide a list of all the main results in this book, in both SI and Gaussian units. After looking at a few of the corresponding formulas, you will discover that transforming from SI units to Gaussian units involves one or more of the three types of conversions discussed below. Of course, even if a formula takes exactly the same form in the two systems of units, it says two entirely different things. For example, the formula relating force and electric field is the same in both systems: F = qE. But in SI units this equation says that a charge of 1 coulomb placed in an electric field of 1 volt/meter feels a force of 1 newton, whereas in Gaussian units it says that a charge of 1 esu placed in an electric field of 1 statvolt/centimeter feels a force of 1 dyne. When we say that two formulas are the “same,” we mean that they look the same on the page, even though the various letters mean different things in the two systems. The three basic types of conversions from SI to Gaussian units are given in Sections D.1 to D.3. We then list the formulas in Section D.4 by chapter.
D.1 Eliminating 0 and μ0 Our starting point in this book was Coulomb’s law in Eq. (1.4). The SI expression for this law contains the factor 1/4π 0 , whereas the Gaussian expression has no factor (or rather just a 1). To convert from SI units to Gaussian units, we therefore need to set 4π 0 = 1, or equivalently 0 = 1/4π (along with possibly some other changes, as we will see below). That is, we need to erase all factors of 4π 0 that appear, or equivalently replace all 0 ’s with 1/4π’s. In many formulas this change
D.2 Changing B to B/c
is all that is needed. A few examples are: Gauss’s law, Eq. (1.31) in the list in Section D.4;1 the field due to a line or sheet, Eqs. (1.39) and (1.40); the energy in an electric field, Eq. (1.53); and the capacitance of a sphere or parallel plates, Eqs. (3.10) and (3.15). A corollary of the 0 → 1/4π rule is the μ0 → 4π/c2 rule. We introduced μ0 in Chapter 6 via the definition μ0 ≡ 1/0 c2 , so if we replace 0 with 1/4π, we must also replace μ0 with 4π/c2 . An example of this μ0 → 4π/c2 rule is the force between two current-carrying wires, Eq. (6.15). It is also possible to use these rules to convert formulas in the other direction, from Gaussian units to SI units, although the process isn’t quite as simple. The conversion must (at least for conversions where only 0 and μ0 are relevant) involve multiplying by some power of 4π 0 (or equivalently 4π/μ0 c2 ). And there is only one power that will make the units of the resulting SI expression correct, because 0 has units, namely C2 s2 kg−1 m−3 . For example, the Gaussian expression for the field due to a sheet of charge is 2π σ in Eq. (1.40) in the list below, so the SI expression must take the form of 2π σ (4π 0 )n . You can quickly show that 2π σ (4π 0 )−1 = σ/20 has the correct units of electric field (it suffices to look at the power of any one of the four units: kg, m, s, C).
D.2 Changing B to B/c If all quantities were defined in the same way in the two systems of units (up to factors of 4π 0 and 4π/μ0 c2 ), then the above rules involving 0 and μ0 would be sufficient for converting from SI units to Gaussian units. But unfortunately certain quantities are defined differently in the two systems, so we can’t convert from one system to the other without knowing what these arbitrary definitions are. The most notable example of differing definitions is the magnetic field. In SI units the Lorentz force (or rather the magnetic part of it) is F = qv × B, while in Gaussian units it is F = (q/c)v × B. To convert from an SI formula to a Gaussian formula, we therefore need to replace every B with a B/c (and likewise for the vector potential A). An example of this is the B field from an infinite wire, Eq. (6.6). In SI units we have B = μ0 I/2πr. Applying our rules for μ0 and B, the Gaussian B field is obtained as follows: μ0 I B 4π 2I I B= −→ = ⇒ B = , (D.1) 2 2π r c 2πr rc c which is the correct result. Other examples involving the B → B/c rule include Ampère’s law, Eqs. (6.19) and (6.25); the Lorentz transformations, Eq. (6.76); and the energy in a magnetic field, Eq. (7.79). 1 The “double” equations in the list in Section D.4, where the SI and Gaussian formulas
are presented side by side, are labeled according to the equation number that the SI formula has in the text.
779
780
SI and Gaussian formulas
D.3 Other definitional differences The above two conversion procedures are sufficient for all formulas up to and including Chapter 9. However, in Chapters 10 and 11 we encounter a number of new quantities (χe , D, H, etc.), and many of these quantities are defined differently in the two systems of units,2 mainly due to historical reasons. For example, after using the 0 → 1/4π rule in Eq. (10.41), we see that we need to replace χe by 4π χe in going from SI to Gaussian units. The Gaussian expression is then given by P −→ (4π χe ) = χe = 0 E
4π 1
P P ⇒ χe = , E E
(D.2)
which is correct. This χe → 4π χe rule is consistent with Eq. (10.42). Similarly, Eq. (10.63) shows that D is replaced by D/4π. On the magnetic side of things, a few examples are the following. Equation (11.9) shows that m (and hence M) is replaced by cm when going from SI to Gaussian units (because m = Ia → cm = Ia ⇒ m = Ia/c, which is the correct Gaussian expression). Also, Eqs. (11.69) and (11.70) show that H is replaced by (c/4π )H. Let’s check that Eq. (11.68) is consistent with these rules. The SI expression for H is converted to Gaussian as follows: c c2 B 1 B − M −→ H = − (cM) H= μ0 4π 4π c ⇒ H = B − 4π M,
(D.3)
which is the correct Gaussian expression. Although it is possible to remember all the different rules and then convert things at will, there are so many differing definitions in Chapters 10 and 11 that it is probably easiest to look up each formula as you need it. But for Chapters 1–9, you can get a lot of mileage out of the first two rules above, namely (1) 0 → 1/4π, μ0 → 4π/c2 , and (2) B → B/c.
D.4 The formulas In the pages that follow, the SI formula is given first, followed by the Gaussian equivalent.
2 The preceding case with B is simply another one of these differences, but we have
chosen to discuss it separately because the B field appears so much more often in this book than other such quantities.
D.4 The formulas
Chapter 1 Coulomb’s law (1.4):
F=
1 q1 q2 rˆ 4π 0 r2
F=
q1 q2 rˆ r2
potential energy (1.9):
U=
1 q1 q2 4Ď€ 0 r
U=
q1 q2 r
electric field (1.20):
E=
1 qˆr 4π 0 r2
E=
qˆr r2
force and field (1.21):
F = qE = E ¡ da
(same)
flux (1.26): Gauss’s law (1.31): field due to line (1.39): field due to sheet (1.40): E across sheet (1.41): field near shell (1.42): F/(area) on sheet (1.49): energy in E field (1.53):
E ¡ da =
q 0
Îť 2Ď€ 0 r Ďƒ E= 20 Ďƒ E = nˆ 0 Ďƒ Er = 0 F 1 = E1 + E2 Ďƒ A 2 0 U= E2 dv 2 Er =
Chapter 2 φ=−
field and potential (2.16):
E = âˆ’âˆ‡Ď† Ď dv φ= 4Ď€ 0 r 1 Ď Ď† dv U= 2
potential energy (2.32):
E ¡ da = 4π q Er =
2Îť r
E = 2Ď€ Ďƒ E = 4Ď€ Ďƒ nˆ Er = 4Ď€ Ďƒ (same) U=
1 8Ď€
E2 dv
electric potential (2.4):
potential and density (2.18):
(same)
E ¡ ds
q cos θ 4π 0 r2
dipole potential (2.35):
φ=
dipole moment (2.35):
p = q
(same) (same) Ď dv φ= r (same) φ=
q cos θ r2
(same)
781
782
SI and Gaussian formulas
dipole field (2.36):
E=
q 2 cos θ rˆ + sin θ θˆ 3 4π 0 r
F ¡ da =
divergence theorem (2.49):
div F dv
S
Ď 0
div E = 4Ď€Ď
div E =
E and φ (2.70):
div E = −∇ 2 φ
Stokes’ theorem (2.83):
(same)
V
E and Ď (2.52):
φ and Ď (2.72):
(same)
Ď 0 F ¡ ds = curl F ¡ da ∇ 2φ = −
C
∇ 2 φ = −4Ď€Ď (same)
S
Chapter 3 charge and capacitance (3.7):
Q = Cφ
(same)
sphere C (3.10):
C = 4Ď€ 0 a
C=a
parallel-plate C (3.15):
C=
energy in capacitor (3.29):
0 A s 1 U = Cφ 2 2
Chapter 4
C=
A 4Ď€ s
(same)
current, current density (4.7):
I=
J and Ď (4.10):
div J = −
conductivity (4.11):
J = ĎƒE
(same)
Ohm’s law (4.12):
V = IR 1 J= E Ď
(same)
resistivity (4.16):
q E = 3 2 cos θ rˆ + sin θ θˆ r
J ¡ da
(same)
âˆ‚Ď âˆ‚t
(same)
(same)
resistance, resistivity (4.17):
R=
Ď L A
(same)
power (4.31):
P = IV = I 2 R
(same)
R, C time constant (4.43):
Ď„ = RC
(same)
D.4 The formulas
Chapter 5
783
charge in a region (5.2):
F = qE + qv × B Q = 0 E · da
q F = qE + v × B c 1 E · da Q= 4π
E transformations (5.7):
E = E , E⊥ = γ E⊥
(same)
E from moving Q (5.15):
E =
F transformations (5.17):
dp dp⊥ dp 1 dp ⊥ = , = dt dt dt γ dt
F from current (5.28):
Fy =
Lorentz force (5.1):
Q 1 − β2
2 4π 0 r (1 − β 2 sin2 θ )3/2
1 μ0 0
(no analog)
speed of light (6.8):
c2 =
F on a wire (6.14):
F = IBl
vector potential (6.32): A and J (6.44):
2qvx I rc2
B = zˆ
B = zˆ
(differential form) (6.25):
Fy =
μ0 I I = zˆ 2π r 2π 0 rc2
B due to wire (6.3), (6.6):
Ampère’s law (6.19):
(same)
qvx I 2π 0 rc2
Chapter 6
F between wires (6.15):
Q 1 − β2 E = 2 r (1 − β 2 sin2 θ )3/2
μ 0 I1 I2 l F= 2πr B · ds = μ0 I
2I rc
IBl c 2I1 I2 l F= 2 c r 4π B · ds = I c
F=
curl B = μ0 J
curl B =
B = curl A J dv μ0 A= 4π r
(same)
μ0 I dl × rˆ 4π r2
Biot–Savart law (6.49):
dB =
B in solenoid (6.57):
Bz = μ0 nI
B across sheet (6.58):
B = μ0 J
F/(area) on sheet (6.63):
2 (B+ )2 − (B− F z ) = z A 2μ0
1 A= c
4π J c J dv r
I dl × rˆ c r2 4π nI Bz = c 4π J B = c dB =
2 (B+ )2 − (B− F z ) = z A 8π
784
SI and Gaussian formulas
E, B transforms (6.76):
Hall Et field (6.84):
E = E
(same)
B = B E ⊼ = Îł E⊼ + β Ă— cB⊼ cB ⊼ = Îł cB⊼ − β Ă— E⊼
(same)
Et =
−J Ă— B nq
Chapter 7 electromotive force (7.5):
1 E= q
Faraday’s law (7.26):
E =−
Et =
mutual inductance (7.37), (7.38): self-inductance (7.57), (7.58): L of toroid (7.62):
f ¡ ds d dt
∂B ∂t dI1 E21 = −M21 dt dI1 E11 = −L1 dt 2 b Îź0 N h ln L= 2Ď€ a
R, L time constant (7.69):
Ď„ = L/R
energy in inductor (7.74):
U=
1 2 LI 2 1 B2 dv U= 2Îź0
energy in B field (7.79):
−J Ă— B nqc
curl E = −
(differential form) (7.31):
E ⊼ = Îł E⊼ + β Ă— B⊼ B ⊼ = Îł B⊼ − β Ă— E⊼
(same) 1 d c dt 1 ∂B curl E = − c ∂t E =−
(same) (same) b 2N 2 h L = 2 ln a c (same) (same) U=
1 8Ď€
Chapter 8 RLC time constant (8.8):
RLC frequency (8.9): Q factor (8.12): I0 for series RLC (8.38):
1 2L = Îą R & 1 R2 ω= − 2 LC 4L energy Q=ω¡ power Ď„=
E0 I0 = R2 + (ωL − 1/ωC)2
(same)
(same) (same) (same)
B2 dv
D.4 The formulas
φ for series RLC (8.39): resonant ω (8.41):
1 ωL − RωC R 1 ω0 = √ LC tan φ =
(same) (same)
width of I curve (8.45):
1 2| ω| = ω0 Q
(same)
admittance (8.61):
I˜ = Y V˜
(same)
impedance (8.62):
V˜ = Z I˜
(same)
impedances (Table 8.1):
R, iωL, −i/ωC
(same)
average power in R (8.81):
PR =
average power (general) (8.85):
P = Vrms Irms cos φ
2 Vrms R
(same) (same)
Chapter 9 displacement current (9.15): Maxwell’s equations (9.17):
Jd = 0
∂E ∂t
∂B ∂t ∂E + μ0 J curl B = μ0 0 ∂t ρ div E = 0 curl E = −
div B = 0 1 =c μ0 0
1 ∂E 4π ∂t 1 ∂B curl E = − c ∂t 1 ∂E 4π curl B = + J c ∂t c Jd =
div E = 4πρ (same) v=c
speed of wave (9.26), (9.27):
v= √
E, B amplitudes (9.26), (9.27):
E0 = √
power density (9.34):
S = 0 E 2 c
Poynting vector (9.42):
S=
invariant 1 (9.51):
E · B = E · B
(same)
invariant 2 (9.51):
E 2 − c2 B 2 = E2 − c2 B2
E 2 − B 2 = E2 − B2
B0 = cB0 μ0 0
E×B μ0
E0 = B0 E2 c 4π c S= E×B 4π
S=
785
786
SI and Gaussian formulas
Chapter 10
dipole moment (10.13):
κ = Q/Q0 p = r ρ dv
dipole potential (10.14):
φ(r) =
dipole (Er , Eθ ) (10.18):
p (2 cos θ, sin θ ) 4π 0 r3
p (2 cos θ, sin θ ) r3
torque on dipole (10.21):
N=p×E
(same)
force on dipole (10.26):
Fx = p · grad Ex
(same)
polarizability (10.29):
p = αE
(same)
polarization density (10.31):
P = pN
φ due to column (10.34):
P da φ= 4π 0
surface density (10.35):
σ =P
average field (10.37):
E = −
susceptibility (10.41):
χe =
χe and κ (10.42):
χe = κ − 1
E in polar sphere (10.47):
Ein = −
permittivity (10.56):
= κ0
(no analog)
P divergence (10.61):
div P = −ρbound
(same)
displacement D (10.63):
D = 0 E + P
D = E + 4π P
D divergence (10.64):
div D = ρfree
div D = 4πρfree
D for linear (10.65):
D = E
D = κE
χe for weak E (10.73):
χe ≈
dielectric constant (10.3):
bound current J (10.74): curl of B (10.78):
(same) (same)
rˆ · p 4π 0 r2
1 1 − r2 r1
φ(r) =
(same)
1 1 − φ = P da r2 r1
(same) P 0
P 0 E
P 30
Np2 0 kT
∂P ∂t ∂D + μ0 J curl B = μ0 ∂t Jbound =
rˆ · p r2
E = −4π P χe =
P E
κ −1 4π 4π P Ein = − 3
χe =
χe ≈
Np2 kT
(same) curl B =
1 ∂D 4π + J c ∂t c
D.4 The formulas
speed of wave (10.83):
c v= √ κ
(same)
E, B amplitudes (10.83):
cB0 E0 = √ = vB0 κ
B0 E0 = √ κ
Chapter 11 dipole moment (11.9):
m = Ia
vector potential (11.10):
A=
dipole (Br , Bθ ) (11.15):
μ0 m (2 cos θ , sin θ ) 4πr3
Ia c m × rˆ A= r2 m (2 cos θ, sin θ ) r3
force on dipole (11.23):
F = ∇(m · B)
(same)
orbital m for e (11.29):
m=
polarizability (11.41):
e2 r2 m =− B 4me
m e2 r2 =− B 4me c2
torque on dipole (11.47):
N=m×B
(same)
polarization density (11.51):
M=
susceptibility χm (11.52):
μ0 m × rˆ 4π r2
−e L 2me
m volume B M = χm μ0 μ0 Nm2 kT
m=
m=
−e L 2me c
(same) M = χm B
χpm ≈
surface density J (11.55):
J =M
J = Mc
volume density J (11.56):
J = curl M
J = c curl M
H field (11.68):
H=
curl of H (11.69):
curl H = Jfree H · dl = Ifree
4π curl H = Jfree c 4π H · dl = Ifree c
χm (accepted def.) (11.72):
M = χm H
(same)
permeability (11.74):
μ = μ0 (1 + χm )
μ = 1 + 4π χm
B and H (11.74):
B = μH
(same)
(integrated form) (11.70):
B −M μ0
χpm ≈
Nm2 kT
χpm for weak B (11.53):
H = B − 4π M
787
788
SI and Gaussian formulas
Appendix H
qa sin θ 4π 0 c2 R
Eθ =
q2 a2 6π 0 c3
Prad =
tangential Eθ (H.3):
Eθ =
power (H.7):
Prad =
qa sin θ c2 R 2q2 a2 3c3
E In 1983 the General Conference on Weights and Measures officially redefined the meter as the distance that light travels in vacuum during a time interval of 1/299,792,458 of a second. The second is defined in terms of a certain atomic frequency in a way that does not concern us here. The nine-digit integer was chosen to make the assigned value of c agree with the most accurate measured value to well within the uncertainty in the latter. Henceforth the velocity of light is, by definition, 299,792,458 meters/second. An experiment in which the passage of a light pulse from point A to point B is timed is to be regarded as a measurement of the distance from A to B, not a measurement of the speed of light. While this step has no immediate practical consequences, it does bring a welcome simplification of the exact relations connecting various electromagnetic units. As we learn in Chapter 9, Maxwell’s equations for the vacuum fields, formulated in SI units, have a solution in the form of a traveling wave with velocity c = (μ0 0 )−1/2 . The SI constant μ0 has always been defined exactly as 4π · 10−7 kg m/C2 , whereas the value of 0 has depended on the experimentally determined value of the speed of light, any refinement of which called for adjustment of the value of 0 . But now 0 acquires a permanent and perfectly precise value of its own, through the requirement that (μ0 0 )−1/2 = 299,792,458 meters/second.
(E.1)
In the Gaussian system no such question arises. Wherever c is involved, it appears in plain view, and all other quantities are defined exactly, beginning with the electrostatic unit of charge, the esu, whose definition by Coulomb’s law involves no arbitrary factor.
Exact relations among SI and Gaussian units
790
Exact relations among SI and Gaussian units
With the adoption of Eq. (E.1) in consequence of the redefinition of the meter, the relations among the units in the systems we have been using can be stated with unlimited precision. These relations are listed at the beginning of Appendix C for the principal quantities we deal with. In the list the symbol [3] stands for the precise decimal 2.99792458. The exact numbers are uninteresting and for our work quite unnecessary. It is sheer luck that [3] happens to be so close to 3, an accidental consequence of the length of the meter and the second. When 0.1 percent accuracy is good enough we need only remember that “300 volts is a statvolt” and “3 · 109 esu is a coulomb.” Much less precisely, but still within 12 percent, a capacitance of 1 cm is equivalent to 1 picofarad. An important SI constant is (μ0 /0 )1/2 , which is a resistance in ohms. Since 0 = 1/μ0 c2 , this resistance equals μ0 c. Using the exact values of μ0 and c, we find (μ0 /0 )1/2 = 40π ·[3] ohms ≈ 376.73 ohms. One tends to remember it, and even refer to it, as “377 ohms.” It is the ratio of the electric field strength E, in volts/meter, in a plane wave in vacuum, to the strength, in amperes/meter, of the accompanying magnetic field H. For this reason the constant (μ0 /0 )1/2 is sometimes denoted by Z0 and called, rather cryptically, the impedance of the vacuum. In a plane wave in vacuum in which Erms is the rms electric field in volts/meter, the 2 /Z . mean density of power transmitted, in watts/m2 , is Erms 0 The logical relation of the SI electrical units to one another now takes on a slightly different aspect. Before the redefinition of the meter, it was customary to designate one of the electrical units as primary, in this sense: its precise value could, at least in principle, be established by a procedure involving the SI mechanical and metrical units only. Thus the ampere, to which this role has usually been assigned, was defined in terms of the force in newtons between parallel currents, using the relation in Eq. (6.15). This was possible because the constant μ0 in that relation has the precise value 4π · 10−7 kg m/C2 . Then with the ampere as the primary electrical unit, the coulomb was defined precisely as 1 amperesecond. The coulomb itself, owing to the presence of 0 in Coulomb’s law, was not eligible to serve as the primary unit. Now with 0 as well as μ0 assigned an exact numerical value, the system can be built up with any unit as the starting point. All quantities are in this sense on an equal footing, and the choice of a primary unit loses its significance. Never a very interesting question anyway, it can now be relegated to history.
F We begin this appendix by listing the main vector operators (gradient, divergence, curl, Laplacian) in Cartesian, cylindrical, and spherical coordinates. We then talk a little about each operator – define things, derive a few results, give some examples, etc. You will note that some of the expressions below are rather scary looking. However, you won’t have to use their full forms in this book. In the applications that come up, invariably only one or two of the terms in the expressions are nonzero.
F.1 Vector operators F.1.1 Cartesian coordinates ds = dx xˆ + dy yˆ + dz zˆ , ∇ = xˆ ∇f =
∂ ∂ ∂ + yˆ + zˆ , ∂x ∂y ∂z
∂f ∂f ∂f xˆ + yˆ + zˆ , ∂x ∂y ∂z
∂Ay ∂Ax ∂Az + + , ∂x ∂y ∂z ∂Ay ∂Ay ∂Ax ∂Az ∂Ax ∂Az xˆ + yˆ + zˆ , − − − ∇ ×A= ∂y ∂z ∂z ∂x ∂x ∂y ∇ ·A=
∇ 2f =
∂ 2f ∂ 2f ∂ 2f + + . ∂x2 ∂y2 ∂z2
(F.1)
Curvilinear coordinates
792
Curvilinear coordinates
F.1.2 Cylindrical coordinates ds = dr rˆ + r dθ θˆ + dz zˆ , ∇ = rˆ ∇f =
1 ∂ ∂ ∂ + θˆ + zˆ , ∂r r ∂θ ∂z
1 ∂f ˆ ∂f ∂f rˆ + θ+ zˆ , ∂r r ∂θ ∂z
∂Az 1 ∂(rAr ) 1 ∂Aθ + + , r ∂r r ∂θ ∂z 1 ∂Az ∂Aθ ∂Az ˆ ∂Ar ∇ ×A= − rˆ + − θ r ∂θ ∂z ∂z ∂r 1 ∂(rAθ ) ∂Ar zˆ , − + r ∂r ∂θ 1 ∂ ∂ 2f ∂f 1 ∂ 2f ∇ 2f = r + 2 2 + 2. r ∂r ∂r r ∂θ ∂z ∇ ·A=
(F.2)
F.1.3 Spherical coordinates ˆ ds = dr rˆ + r dθ θˆ + r sin θ dφ φ, ∇ = rˆ ∇f =
∂ 1 ∂ 1 ∂ + θˆ + φˆ , ∂r r ∂θ r sin θ ∂φ
∂f 1 ∂f ˆ 1 ∂f ˆ rˆ + θ+ φ, ∂r r ∂θ r sin θ ∂φ
1 ∂(Aθ sin θ ) 1 ∂Aφ 1 ∂(r2 Ar ) + + , 2 ∂r r sin θ ∂θ r sin θ ∂φ r ∂(Aφ sin θ ) ∂Aθ ∂(rAφ ) ˆ 1 1 ∂Ar 1 rˆ + − − θ, ∇ ×A= r sin θ ∂θ ∂φ r sin θ ∂φ ∂r 1 ∂(rAθ ) ∂Ar ˆ − φ, + r ∂r ∂θ ∂f 1 ∂ 1 ∂f 1 ∂ 2f ∂ . r2 + 2 sin θ + ∇ 2f = 2 2 ∂r ∂θ r ∂r r sin θ ∂θ r2 sin θ ∂φ 2 (F.3) ∇ ·A=
F.2 Gradient The gradient produces a vector from a scalar. The gradient of a function f , written as ∇f or grad f , may be defined1 as the vector with the 1 We used a different definition in Section 2.3, but we will show below that the two
definitions are equivalent.
F.2 Gradient
property that the change in f brought about by a small change ds in position is df = ∇f · ds.
(F.4)
The vector ∇f depends on position; there is a different gradient vector associated with each point in the parameter space. You might wonder whether a vector that satisfies Eq. (F.4) actually exists. We are claiming that if f is a function of, say, three variables, then at every point in space there exists a unique vector, ∇f , such that for any small displacement ds from a given point, the change in f equals ∇f · ds. It is not immediately obvious why a single vector gets the job done for all possible displacements ds from a given point. But the existence of such a vector can be demonstrated in two ways. First, we can explicitly construct ∇f ; we will do this below in Eq. (F.5). Second, any (well-behaved) function looks like a linear function up close, and for a linear function a vector ∇f satisfying Eq. (F.4) does indeed exist. We will explain why in what follows. However, before addressing this issue, let us note an important property of the gradient. From the definition in Eq. (F.4), it immediately follows (as mentioned in Section 2.3) that ∇f points in the direction of steepest ascent of f . This is true because we can write the dot product ∇f · ds as |∇f ||ds| cos θ, where θ is the angle between the vector ∇f and the vector ds. So for a given length of the vector ds, this dot product is maximized when θ = 0. We therefore want the displacement ds to point in the direction of ∇f , if we want to produce the maximum change in f . If we consider the more easily visualizable case of a function of two variables, the function can be represented by a surface above the xy plane. This surface is locally planar; that is, a sufficiently small bug walking around on it would think it is a (generally tilted) flat plane. If we look at the direction of steepest ascent in the local plane, and then project this line onto the xy plane, the resulting line is the direction of ∇f ; see Fig. 2.5. The function f is constant along the direction perpendicular to ∇f . The magnitude of ∇f equals the change in f per unit distance in the parameter space, in the direction of ∇f . Equivalently, if we restrict the parameter space to the one-dimensional line in the direction of steepest ascent, then the gradient is simply the standard single-variable derivative in that direction. We could alternatively work “backwards” and define the gradient as the vector that points in the direction (in the parameter space) of steepest ascent, with its magnitude equal to the rate of change in that direction. It then follows that the general change in f , for any displacement ds in the parameter space, is given by Eq. (F.4). This is true because the dot product picks out the component of ds along the direction of ∇f . This component causes a change in f , whereas the orthogonal component does not.
793
794
f (x, y)
Curvilinear coordinates ds associated with P (direction of gradient) P
y Q
x Components of ds associated with Q
Figure F.1. Only the component of ds in the direction of the gradient causes a change in f .
Figure F.1 shows how this works in the case of a function of two variables. We have assumed for simplicity that the local plane representing the surface of the function intersects the xy plane along the x axis. (We can always translate and rotate the coordinate system so that this is true at a given point.) The gradient then points in the y direction. The point P shown lies in the direction straight up the plane from the given point. The projection of this direction onto the xy plane lies along the gradient. The point Q is associated with a ds interval that doesn’t lie along the gradient in the xy plane. This ds can be broken up into an interval along the x axis, which causes no change in f , plus an interval in the y direction, or equivalently the direction of the gradient, which causes the change in f up to the point Q. The preceding two paragraphs explain why the vector ∇f defined by Eq. (F.4) does in fact exist; any well-behaved function is locally linear, and a unique vector ∇f at each point will get the job done in Eq. (F.4) if f is linear. But as mentioned above, we can also demonstrate the existence of such a vector by simply constructing it. Let’s calculate the gradient in Cartesian coordinates, and then in spherical coordinates. F.2.1 Cartesian gradient In Cartesian coordinates, a general change in f for small displacements can be written as df = (∂f /∂x)dx + (∂f /∂y)dy + (∂f /∂z)dz. This is just the start of the Taylor series in three variables. The interval ds is simply (dx, dy, dz), so if we want ∇f · ds to be equal to df , we need ∂f ∂f ∂f ∂f ∂f ∂f , , ≡ xˆ + yˆ + zˆ , (F.5) ∇f = ∂x ∂y ∂z ∂x ∂y ∂z in agreement with the ∇f expression in Eq. (F.1). In Section 2.3 we took Eq. (F.5) as the definition of the gradient and then discussed its other properties. F.2.2 Spherical gradient In spherical coordinates, a general change in f is given by df = (∂f /∂r)dr + (∂f /∂θ)dθ + (∂f /∂φ)dφ. However, the interval ds takes a more involved form compared with the Cartesian ds. It is ˆ ds = (dr, r dθ , r sin θ dφ) ≡ dr rˆ + r dθ θˆ + r sin θ dφ φ.
(F.6)
If we want ∇f · ds to be equal to df , then we need ∇f =
1 ∂f ∂f 1 ∂f , , ∂r r ∂θ r sin θ ∂φ
in agreement with Eq. (F.3).
≡
∂f 1 ∂f ˆ 1 ∂f ˆ rˆ + θ+ φ, (F.7) ∂r r ∂θ r sin θ ∂φ
F.3 Divergence
795
We see that the extra factors (compared with the Cartesian case) in the denominators of the gradient come from the coefficients of the unit vectors in the expression for ds. Similarly, the form of the gradient in cylindrical coordinates in Eq. (F.2) can be traced to the fact that the interval ds equals dr rˆ + r dθ θˆ + dz zˆ . Since the extra factors that appear in ds show up in the denominators of the ∇-operator terms, and since the ∇ operator determines all of the other vector operators, we see that every result in this appendix can be traced back to the form of ds in the different coordinate systems. For example, the big scary expression listed in Eq. (F.3) for the curl in spherical coordinates is a direct consequence of the ds = dr rˆ + r dθ θˆ + r sin θ dφ φˆ interval. Note that the consideration of units tells us that there must be a factor of r in the denominators in the ∂f /∂θ and ∂f /∂φ terms in the spherical gradient, and in the ∂f /∂θ term in the cylindrical gradient.
F.3 Divergence The divergence produces a scalar from a vector. The divergence of a vector function was defined in Eq. (2.47) as the net flux out of a given small volume, divided by the volume. In Section 2.10 we derived the form of the divergence in Cartesian coordinates, and it turned out to be the dot product of the ∇ operator with a vector A, that is, ∇ · A. We use the same method here to derive the form in cylindrical coordinates. We then give a second, more mechanical, derivation. A third derivation is left for Exercise F.2. F.3.1 Cylindrical divergence, first method Consider the small volume that is generated by taking the region in the r-θ plane shown in Fig. F.2 and sweeping it through a span of z values from a particular z up to z + z (the zˆ axis points out of the page). Let’s first look at the flux of a vector field A through the two faces perpendicular to the zˆ direction. As in Section 2.10, only the z component of A is relevant to the flux through these faces. In the limit of a small volume, the area of these faces is r r θ. The inward flux through the bottom face equals Az (z) r r θ, and the outward flux through the top face equals Az (z + z) r r θ . We have suppressed the r and θ arguments of Az for simplicity, and we have chosen points at the midpoints of the faces, as in Fig. 2.22. The net outward flux is therefore z faces = Az (z + z) r r θ − Az (z) r r θ Az (z + z) − Az (z) r r θ z = z =
∂Az r r θ z. ∂z
(F.8)
(r + Δr) Δq
Δr
r dq
r Δq
q
Figure F.2. A small region in the r-θ plane.
796
Curvilinear coordinates Upon dividing this net outward flux by the volume r r θ z, we obtain ∂Az /∂z, in agreement with the third term in ∇ ¡ A in Eq. (F.2). This was exactly the same argument we used in Section 2.10. The z coordinate in cylindrical coordinates is, after all, basically a Cartesian coordinate. However, things get more interesting with the r coordinate. Consider the flux through the two faces (represented by the curved lines in Fig. F.2) that are perpendicular to the rˆ direction. The key point to realize is that the areas of these two faces are not equal. The upper right one is larger. So the difference in flux through these faces depends not only on the value of Ar , but also on the ! area. The inward flux through the lower left face equals Ar (r) r θ z , and the outward ! flux through the upper right face equals Ar (r + r) (r + r) θ z . As above, we have suppressed the θ and z arguments for simplicity, and we have chosen points at the midpoints of the faces. The net outward flux is therefore r faces = (r + r)Ar (r + r) θ z − rAr (r) θ z (r + r)Ar (r + r) − rAr (r) r θ z = r =
∂(rAr ) r θ z. ∂r
(F.9)
Upon dividing this net outward flux by the volume r r θ z, we have a leftover r in the denominator, so we obtain (1/r) ∂(rAr )/∂r , in agreement with the first term in Eq. (F.2). For the last two faces, the ones perpendicular to the θˆ direction, we don’t have to worry about different areas, so we quickly obtain θ
faces
= Aθ (θ + θ ) r z − Aθ (θ ) r z Aθ (θ + θ ) − Aθ (θ ) r θ z = θ =
∂Aθ r θ z. ∂θ
(F.10)
Upon dividing this net outward flux by the volume r r θ z, we again have a leftover r in the denominator, so we obtain (1/r)(∂Aθ /∂θ), in agreement with the second term in Eq. (F.2). If you like this sort of calculation, you can repeat this derivation for the case of spherical coordinates. However, it’s actually not too hard to derive the general form of the divergence for any set of coordinates; see Exercise F.3. You can then check that this general formula reduces properly for spherical coordinates.
F.3 Divergence
797
F.3.2 Cylindrical divergence, second method Let’s determine the divergence in cylindrical coordinates by explicitly calculating the dot product, 1 ∂ ∂ ∂ ˆ θ + zˆ Az . + zˆ ¡ rˆ Ar + θA (F.11) ∇ ¡ A = rˆ + θˆ ∂r r ∂θ ∂z At first glance, it appears that ∇ ¡A doesn’t produce the form of the divergence given in Eq. (F.2). The second two terms work out, but it seems like the first term should simply be ∂Ar /∂r instead of (1/r) ∂(rAr )/∂r . However, the dot product does indeed correctly yield the latter term, because we must remember that, in contrast with Cartesian coordinates, in cylindrical coordinates the unit vectors themselves depend on position. This means that in Eq. (F.11) the derivatives in the ∇ operator also act on the unit vectors in A. This issue doesn’t come up in Cartesian coordinates because xˆ , yˆ , and zˆ are fixed vectors, but that is more the exception than the rule. Writing A in the abbreviated form (Ar , Aθ , Az ) tends to hide important information. The full expression for A is rˆ Ar + θˆAθ + zˆ Az . There are six quantities here (three vectors and three components), and if any of these quantities vary with the coordinates, then these variations cause A to change. The derivatives of the unit vectors that are nonzero are ∂ rˆ = θˆ ∂θ
and
∂ θˆ = −ˆr. ∂θ
(F.12)
To demonstrate these relations, we can look at what happens to rˆ and θˆ if we rotate them through an angle dθ . Since the unit vectors have length 1, we see from Fig. F.3 that rˆ picks up a component of length dθ in the θˆ direction, and θˆ picks up a component of length dθ in the −ˆr direction. The other seven of the nine possible derivatives are zero because none of the unit vectors depends on r or z, and furthermore zˆ doesn’t depend on θ. Due to the orthogonality of the unit vectors, we quickly see that, in addition to the three “correspondingâ€? terms that survive in Eq. (F.11), one more term is nonzero: 1 ∂ rˆ ∂Ar Ar 1 ˆ 1 ∂ (ˆrAr ) = θˆ ¡ Ar + rˆ = θˆ ¡ θA . θˆ ¡ r +0= r ∂θ r ∂θ ∂θ r r (F.13)
1 ∂Aθ ∂Az Ar ∂Ar + + + . ∂r r ∂θ ∂z r
q dq r q
q
r (Length = 1)
dq q
Figure F.3. How the rˆ and θˆ unit vectors depend on θ.
Equation (F.11) therefore becomes ∇ ¡A=
– r dq
(F.14)
The sum of the first and last terms here can be rewritten as the first term in ∇ ¡ A in Eq. (F.2), as desired.
798
Curvilinear coordinates
F.4 Curl The curl produces a vector from a vector. The curl of a vector function was defined in Eq. (2.80) as the net circulation around a given small area, divided by the area. (The three possible orientations of the area yield the three components.) In Section 2.16 we derived the form of the curl in Cartesian coordinates, and it turned out to be the cross product of the ∇ operator with the vector A, that is, ∇ Ă— A. We’ll use the same method here to derive the form in cylindrical coordinates, after which we derive it a second way, analogous to the above second method for the divergence. Actually, we’ll calculate just the z component; this should make the procedure clear. As an exercise you can calculate the other two components. F.4.1 Cylindrical curl, first method The z component of ∇ Ă— A is found by looking at the circulation around a small area in the r-θ plane (or more generally, in some plane parallel to the r-θ plane). Consider the upper right and lower left (curved) edges in Fig. F.2. Following the strategy in Section 2.16, the counterclockwise line integral along the upper right edge equals Aθ (r + r) (r + r) θ ], and the counterclockwise line integral along the lower left edge equals ! −Aθ (r) r θ . We have suppressed the θ and z arguments for simplicity, and we have chosen points at the midpoints of the edges. Note that we have correctly incorporated the fact that the upper right edge is longer than the lower left edge (the same issue that came up in the above calculation of the divergence). The net circulation along these two edges is Cθ
sides
= (r + r)Aθ (r + r) θ − rAθ (r) θ (r + r)Aθ (r + r) − rAθ (r) r θ = r
∂(rAθ ) r θ . (F.15) ∂r Upon dividing this circulation by the area r r θ,we have a leftover r in the denominator, so we obtain (1/r) ∂(rAθ )/∂r , in agreement with the first of the two terms in the z component of ∇ Ă— A in Eq. (F.2). Now consider the upper left and lower right (straight) edges. The counterclockwise line integral along the upper left edge equals −Ar (θ + θ ) r, and the counterclockwise line integral along the lower right edge equals Ar (θ ) r. The net circulation along these two edges is =
Cr sides = −Ar (θ + θ ) r + Ar (θ ) r Ar (θ + θ ) − Ar (θ ) r θ =− θ =−
∂Ar r θ . ∂θ
(F.16)
F.5 Laplacian Upon dividing this circulation by the area r r θ , we again have a leftover r in the denominator, so we obtain −(1/r)(∂Ar /∂θ), in agreement with Eq. (F.2). F.4.2 Cylindrical curl, second method Our goal is to calculate the cross product, 1 ∂ ∂ ∂ ˆ θ + zˆ Az , + zˆ × rˆ Ar + θA ∇ × A = rˆ + θˆ ∂r r ∂θ ∂z
(F.17)
while remembering that some of the unit vectors depend on the coordinates according to Eq. (F.12). As above, we’ll look at just the z component. This component arises from terms of the form rˆ × θˆ or θˆ × rˆ . In addition to the two obvious terms of this form, we also have the one involving θˆ × (∂ θˆ/∂θ), which from Eq. (F.12) equals θˆ × (−ˆr) = zˆ . The complete z component of the cross product is therefore ˆ θ) ∂(θˆAθ ) 1 ∂(ˆrAr ) 1 ∂(θA + θˆ × + θˆ × ∂r r ∂θ r ∂θ ∂Aθ 1 ∂Ar Aθ = zˆ − + . (F.18) ∂r r ∂θ r
(∇ × A)z = rˆ ×
The sum of the first and last terms here can be rewritten as the first term in the z component of ∇ × A in Eq. (F.2), as desired.
F.5 Laplacian The Laplacian produces a scalar from a scalar. The Laplacian of a function f (written as ∇ 2f or ∇·∇f ) is defined as the divergence of the gradient of f . Its physical significance is that it gives a measure of how the average value of f over the surface of a sphere compares with the value of f at the center of the sphere. Let’s be quantitative about this. Consider the average value of a function f over the surface of a sphere of radius r. Call it favg,r . If we choose the origin of our coordinate system to be the center of the sphere, then favg,r can be written as (with A being the area of the sphere) 1 1 1 2 f dA = f d, (F.19) f r d = favg,r = A 4π 4πr2 where d = sin θ dθ dφ is the solid-angle element. We are able to take the r2 outside the integral and cancel it because r is constant over the sphere. This expression for favg,r is no surprise, of course, because the integral of d over the whole sphere is 4π . But let us now take the d/dr derivative of both sides of Eq. (F.19), which will alow us to invoke
799
800
Curvilinear coordinates
the divergence theorem. On the right-hand side, the integration doesn’t involve r, so we can bring the derivative inside the integral. This yields (using rˆ · rˆ = 1) dfavg,r ∂f 1 ∂f 1 ∂f 1 rˆ · rˆ r2 d. = d = rˆ · rˆ d = 2 dr 4π ∂r 4π ∂r ∂r 4π r (F.20) (Again, we are able to bring the r2 inside the integral because r is constant over the sphere.) But rˆ r2 d is just the vector area element of the sphere, da. And rˆ (∂f /∂r) is the rˆ component of ∇f in spherical coordinates. The other components of ∇f give zero when dotted with da, so we can write dfavg,r 1 ∇f · da. (F.21) = dr 4π r2 The divergence theorem turns this into dfavg,r 1 = dr 4π r2
∇ · ∇f dV ⇒
dfavg,r 1 = dr 4π r2
∇ 2f dV (F.22)
There are two useful corollaries of this result. First, if ∇ 2f = 0 everywhere, then dfavg,r /dr = 0 for all r. In other words, the average value of f over the surface of a sphere doesn’t change as the sphere grows (while keeping the same center). So all spheres centered at a given point have the same average value of f . In particular, they have the same average value that an infinitesimal sphere has. But the average value over an infinitesimal sphere is simply the value at the center. Therefore, if ∇ 2f = 0, then the average value of f over the surface of a sphere (of any size) equals the value at the center: ∇ 2f = 0 ⇒ favg,r = fcenter .
(F.23)
This is the result we introduced in Section 2.12 and proved for the special case of the electrostatic potential φ. Second, we can derive an expression for how f changes, for small values of r. Up to this point, all of our results have been exact. We will now work in the small-r approximation. In this limit we can say that ∇ 2f is essentially constant throughout the interior of the sphere (assuming that f is well-enough behaved). So its value everywhere is essentially the value at the center. The volume integral in Eq. (F.22) then equals (4πr3 /3)(∇ 2f )center , and we have dfavg,r dfavg,r 1 4π r3 2 r = (∇ f )center ⇒ = (∇ 2f )center . (F.24) 2 dr dr 3 4π r 3
Exercises Since (∇ 2f )center is a constant, we can quickly integrate both sides of this relation to obtain r2 2 (for small r), (F.25) (∇ f )center 6 where the constant of integration has been chosen to give equality at r = 0. We see that the average value of f over a (small) sphere grows quadratically, with the quadratic coefficient being 1/6 times the value of the Laplacian at the center. Let’s check this result for the function f (r, θ , φ) = r2 , or equivalently f (x, y, z) = x2 + y2 + z2 . By using either Eq. (F.1) or Eq. (F.3) we obtain ∇ 2f = 6. If our sphere is centered at the origin, then Eq. (F.25) gives favg,r = 0 + (r2 /6)(6) = r2 , which is correct because f takes on the constant value of r2 over the sphere. In this simple case, the result is exact for all r. favg,r = fcenter +
F.5.1 Cylindrical Laplacian Let’s explicitly calculate the Laplacian in cylindrical coordinates by calculating the divergence of the gradient of f . As we’ve seen in a few cases above, we must be careful to take into account the position dependence of some of the unit vectors. We have 1 ∂ ∂ ∂f 1 ∂f ∂f ∂ + zˆ · rˆ + θˆ + zˆ . (F.26) ∇ · ∇f = rˆ + θˆ ∂r r ∂θ ∂z ∂r r ∂θ ∂z In addition to the three “corresponding” terms, we also have the term involving θˆ · (∂ rˆ /∂θ), which from Eq. (F.12) equals θˆ · θˆ = 1. So this fourth term reduces to (1/r)(∂f /∂r). The Laplacian is therefore ∂ ∂f 1 ∂ 1 ∂f ∂ ∂f 1 ∂f 2 + + + ∇f = ∂r ∂r r ∂θ r ∂θ ∂z ∂z r ∂r =
∂ 2f 1 ∂ 2f ∂ 2f 1 ∂f + + + . r ∂r ∂r2 r2 ∂θ 2 ∂z2
(F.27)
The sum of the first and last terms here can be rewritten as the first term in the ∇ 2f expression in Eq. (F.2), as desired.
Exercises F.1
Divergence using two systems ** (a) The vector A = x xˆ + y yˆ in Cartesian coordinates equals the vector A = r rˆ in cylindrical coordinates. Calculate ∇ · A in both Cartesian and cylindrical coordinates, and verify that the results are equal. (b) Repeat (a) for the vector A = x xˆ + 2y yˆ . You will need to find the cylindrical components of A, which you can do by using xˆ = rˆ cos θ − θˆ sin θ and yˆ = rˆ sin θ + θˆ cos θ. Alternatively,
801
802
Curvilinear coordinates you can project A onto the unit vectors, rˆ = xˆ cos θ + yˆ sin θ and θˆ = −ˆx sin θ + yˆ cos θ . F.2
Cylindrical divergence *** Calculate the divergence in cylindrical coordinates in the following way. We know that the divergence in Cartesian coordinates is ∇ · A = ∂Ax /∂x + ∂Ay /∂y + ∂Az /∂z. To rewrite this in terms of cylindrical coordinates, show that the Cartesian derivative operators can be written as (the ∂/∂z derivative stays the same) ∂ 1 ∂ ∂ = cos θ − sin θ , ∂x ∂r r ∂θ ∂ 1 ∂ ∂ = sin θ + cos θ , ∂y ∂r r ∂θ
(F.28)
and that the components of A can be written as (Az stays the same) Ax = Ar cos θ − Aθ sin θ , Ay = Ar sin θ + Aθ cos θ .
(F.29)
Then explicitly calculate ∇ · A = ∂Ax /∂x + ∂Ay /∂y + ∂Az /∂z. It gets to be a big mess, but it simplifies in the end. F.3
General expression for divergence *** Let xˆ 1 , xˆ 2 , xˆ 3 be the (not necessarily Cartesian) basis vectors of a coordinate system. For example, in spherical coordinates these ˆ Note that the ds line elements listed at the vectors are rˆ , θˆ, φ. beginning of this appendix all take the form of ds = f1 dx1 xˆ 1 + f2 dx2 xˆ 2 + f3 dx3 xˆ 3 ,
(F.30)
where the f factors are (possibly trivial) functions of the coordinates. For example, in Cartesian coordinates, f1 , f2 , f3 are 1, 1, 1; in cylindrical coordinates they are 1, r, 1; and in spherical coordinates they are 1, r, r sin θ . As we saw in Section F.2, these values of f determine the form of ∇ (the f factors simply end up in the denominators), so they determine everything about the various vector operators. Show, by applying the first method we used in Section F.3, that the general expression for the divergence is ∂(f2 f3 A1 ) ∂(f1 f3 A2 ) ∂(f1 f2 A3 ) 1 + + . (F.31) ∇ ·A= f1 f2 f3 ∂x1 ∂x2 ∂x3 Verify that this gives the correct result in the case of spherical coordinates. (The general expression for the curl can be found in a similar way.)
Exercises
F.4
Laplacian using two systems ** (a) The function f = x2 + y2 in Cartesian coordinates equals the function f = r2 in cylindrical coordinates. Calculate ∇ 2f in both Cartesian and cylindrical coordinates, and verify that the results are equal. (b) Repeat (a) for the function f = x4 + y4 . You will need to determine what f looks like in cylindrical coordinates.
F.5
“Sphere” averages in one and two dimensions ** Equation (F.25) holds for a function f in 3D space, but analogous results also hold in 2D space (where the “sphere” is a circle bounding a disk) and in 1D space (where the “sphere” is two points bounding a line segment). Derive those results. Although it is possible to be a little more economical in the calculations by stripping off some dimensions at the start, derive the results in a 3D manner exactly analogous to the way we derived Eq. (F.25). For the 2D case, the relevant volume is a cylinder, with f having no dependence on z. For the 1D case, the relevant volume is a rectangular slab, with f having no dependence on y or z. The 1D result should look familiar from the standard 1D Taylor series.
F.6
Average over a cube *** By using the second-order Taylor expansion for a function of three Cartesian coordinates, show that the average value of a function f over the surface of a cube of side 2 (with edges parallel to the coordinate axes) is 5 2 2 (F.32) (∇ f )center . 18 You should convince yourself why the factor of 5/18 here √ is correctly larger than the 1/6 in Eq. (F.25) and smaller than ( 3)2 /6. favg = fcenter +
803
G A short review of special relativity
G.1 Foundations of relativity We assume that the reader has already been introduced to special relativity. Here we shall review the principal ideas and formulas that are used in the text beginning in Chapter 5. Most essential is the concept of an inertial frame of reference for space-time events and the transformation of the coordinates of an event from one inertial frame to another. A frame of reference is a coordinate system laid out with measuring rods and provided with clocks. Clocks are everywhere. When something happens at a certain place, the time of its occurrence is read from a clock that was at, and stays at, that place. That is, time is measured by a local clock that is stationary in the frame. The clocks belonging to the frame are all synchronized. One way to accomplish this (not the only way) was described by Einstein in his great paper of 1905. Light signals are used. From a point A, at time tA , a short pulse of light is sent out toward a remote point B. It arrives at B at the time tB , as read on a clock at B, and is immediately reflected back toward A, where it arrives at tA . If tB = (tA + tA )/2, the clocks at A and B are synchronized. If not, one of them requires adjustment. In this way, all clocks in the frame can be synchronized. Note that the job of observers in this procedure is merely to record local clock readings for subsequent comparison. An event is located in space and time by its coordinates x, y, z, t in some chosen reference frame. The event might be the passage of a particle at time t1 , through the space point (x1 , y1 , z1 ). The history of the particle’s motion is a sequence of such events. Suppose the sequence has the special property that x = vx t, y = vy t, z = vz t, at every time t, with vx , vy , and vz constant. That describes motion in a straight line at
G.2 Lorentz transformations
constant speed with respect to this frame. An inertial frame of reference is a frame in which an isolated body, free from external influences, moves in this way. An inertial frame, in other words, is one in which Newton’s first law is obeyed. Behind all of this, including the synchronization of clocks, are two assumptions about empty space: it is homogeneous (that is, all locations in space are equivalent) and it is isotropic (that is, all directions in space are equivalent). Two frames, let us call them F and F , can differ in several ways. One can simply be displaced with respect to the other, the origin of coordinates in F being fixed at a point in F that is not at the F coordinate origin. Or the axes in F might not be parallel to the axes in F. As for the timing of events, if F and F are not moving with respect to one another, a clock stationary in F is stationary also in F . In that case we can set all F clocks to agree with the F clocks and then ignore the distinction. Differences in frame location and frame orientation only have no interesting consequences if space is homogeneous and isotropic. Suppose now that the origin of frame F is moving relative to the origin of frame F. The description of a sequence of events by coordinate values and clock times in F can differ from the description of the same events by space coordinate values in F and times measured by clocks in F . How must the two descriptions be related? In answering that we shall be concerned only with the case in which F is an inertial frame and F is a frame that is moving relative to F at constant velocity and without rotating. In that case F is also an inertial frame. Special relativity is based on the postulate that physical phenomena observed in different inertial frames of reference appear to obey exactly the same laws. In that respect one frame is as good as another; no frame is unique. If true, this relativity postulate is enough to determine the way a description of events in one frame is related to the description in a different frame of the same events. In that relation there appears a universal speed, the same in all frames, whose value must be found by experiment. Sometimes added as a second postulate is the statement that a measurement of the velocity of light in any frame of reference gives the same result whether the light’s source is stationary in that frame or not. One may regard this as a statement about the nature of light rather than an independent postulate. It asserts that electromagnetic waves in fact travel with the limiting speed implied by the relativity postulate. The deductions from the relativity postulate, expressed in the formulas of special relativity, have been precisely verified by countless experiments. Nothing in physics rests on a firmer foundation.
G.2 Lorentz transformations Consider two events, A and B, observed in an inertial frame F. Observed, in this usage, is short for “whose space-time coordinates are determined with the measuring rods and clocks of frame F.” (Remember
805
806
A short review of special relativity
that our observers are equipped merely with pencil and paper, and we must post an observer at the location of every event!) The displacement of one event from the other is given by the four numbers xB − xA ,
yB − yA ,
z B − zA ,
tB − tA .
(G.1)
The same two events could have been located by giving their coordinates in some other frame F . Suppose F is moving with respect to F in the manner indicated in Fig. G.1. The spatial axes of F remain parallel to those in F, while, as seen from F, the frame F moves with speed v in the positive x direction. This is a special case, obviously, but it contains most of the interesting physics. Event A, as observed in F , occurred at xA , y A , z A , tA , the last of these numbers being the reading of a clock belonging to (that is, stationary in) F . The space-time displacement, or interval between events A and B in F , is not the same as in F. Its components are related to those in F by the Lorentz transformation, xB − xA = Îł (xB − xA ) − βγ c(tB − tA ), y B − y A = yB − yA , z B − z A = zB − zA , tB − tA = Îł (tB − tA ) − βγ (xB − xA )/c.
(G.2)
In these equations c is the speed of light, β = v/c, and Îł = 1/ 1 − β 2 . The inverse transformation has a similar appearance – as it should if no frame is unique. It can be obtained from Eq. (G.2) simply by exchanging primed and unprimed symbols and reversing the sign of β, as you can verify by explicitly solving for the quantities xB − xA and tB − tA . Two events A and B are simultaneous in F if tB − tA = 0. But that does not make tB − tA = 0 unless xB = xA . Thus events that are simultaneous in one inertial frame may not be so in another. Do not confuse this fundamental “relativity of simultaneityâ€? with the obvious fact that an observer not equally distant from two simultaneous explosions will receive light flashes from them at different times. The times tA and tB are recorded by local clocks at each event, clocks stationary in F that have previously been perfectly synchronized. Consider a rod stationary in F that is parallel to the x axis and extends from xA to xB . Its length in F is just xB − xA . The rod’s length as measured in frame F is the distance xB − xA between two points in the frame F that its ends pass simultaneously according to clocks in F. For these two events, then, tB − tA = 0. With this condition the first of the Lorentz transformation equations above gives us at once xB − xA = (xB − xA )/Îł .
(G.3)
G.2 Lorentz transformations
807
(a) y y
v
4
F
F
2 3 1 2
1
1
1
(b)
2
3
y
2
4
3
4
5
6
5
6
x
x
Figure G.1. Two frames moving with relative speed v. The “E” is stationary in frame F. The “L” is stationary in frame F . In this example β = v/c = 0.866; γ = 2. (a) Where everything was, as determined by observers in F at a particular instant of time t according to clocks in F. (b) Where everything was, as determined by observers in F at a particular instant of time t according to clocks in F .
y
v F
F 2 3 1 2
1
1
1
2
3
4
5
6
2
3
4
x
x
This is the famous Lorentz contraction. Loosely stated, lengths between fixed points in F , if parallel to the relative velocity of the frames, are judged by observers in F to be shorter by the factor 1/γ . This statement remains true if F and F are interchanged. Lengths perpendicular to the relative velocity measure the same in the two frames.
Question: Suppose the clocks in the two frames happened to be set so that the left edge of the E touched the left edge of the L at t = 0 according to a local clock in F, and at t = 0 according to a local clock in F . Let the distances be in feet and take c as 1 foot/nanosecond. What is the reading t of all the F clocks in (a)? What is the reading t of all the F clocks in (b)? Answer: t = 4.62 nanoseconds; t = 4.04 nanoseconds. If you don’t agree, study the example again.
808
A short review of special relativity Consider one of the clocks in F . It is moving with speed v through the frame F. Let us record as tA its reading as it passes one of our local clocks in F; the local clock reads at that moment tA . Later this moving clock passes another F clock. At that event the local F clock reads tB , and the reading of the moving clock is recorded as tB . The two events are separated in the F frame by a distance xB − xA = v(tB − tA ). Substituting this into the fourth equation of the Lorentz transformation, Eq. (G.2), we obtain tB − tA = γ (tB − tA )(1 − β 2 ) = (tB − tA )/γ .
(G.4)
According to the moving clock, less time has elapsed between the two events than is indicated by the stationary clocks in F. This is the time dilation that figures in the “twin paradox.” It has been verified in many experiments, including one in which an atomic clock was flown around the world. Remembering that “moving clocks run slow, by the factor 1/γ ,” and that “moving graph paper is shortened parallel to its motion by the factor 1/γ ,” you can often figure out the consequences of a Lorentz transformation without writing out the equations. This behavior, it must be emphasized, is not a peculiar physical property of our clocks and paper, but is intrinsic in space and time measurement under the relativity postulate.
G.3 Velocity addition The formula for the addition of velocities, which we use in Chapter 5, is easily derived from the Lorentz transformation equations. Suppose an object is moving in the positive x direction in frame F with velocity ux . What is its velocity in the frame F ? To simplify matters let the moving object pass the origin at t = 0. Then its position in F at any time t is simply x = ux t. To simplify further, let the space and time origins of F and F coincide. Then the first and last of the Lorentz transformation equations become x = γ x − βγ ct
and
t = γ t − βγ x/c.
(G.5)
By substituting ux t for x on the right side of each equation, and dividing the first by the second, we get x
ux − βc = .
t 1 − βux /c
(G.6)
On the left we have the velocity of the object in the F frame, u x . The formula is usually written with v instead of βc. u x =
ux − v . 1 − ux v/c2
(G.7)
G.4 Energy, momentum, force
By solving Eq. (G.7) for ux you can verify that the inverse is ux =
u x + v , 1 + u x v/c2
(G.8)
and that in no case will these relations lead to a velocity, either ux or u x , larger than c. As with the inverse Lorentz transformation, you can also obtain Eq. (G.8) from Eq. (G.7) simply by exchanging primed and unprimed symbols and reversing the sign of v. A velocity component perpendicular to v, the relative velocity of the frames, transforms differently, of course. Analogous to Eq. (G.5), the second and last of the Lorentz transformation equations are y = y
t = γ t − βγ x/c.
and
(G.9)
If we have x = ux t and y = uy t in frame F (in general the object can be moving diagonally), then we can substitute these into Eq. (G.9) and divide the first equation by the second to obtain uy y
=
t γ (1 − βux /c)
⇒
u y =
uy . γ (1 − ux v/c2 )
(G.10)
In the special case where ux = 0 (which means that the velocity points in the y direction in frame F), we have u y = uy /γ . That is, the y speed is slower in the frame F where the object is flying by diagonally. In the special case where ux = v (which means that the object travels along with the F frame, as far as the x direction is concerned), you can show that Eq. (G.10) reduces to u y = γ uy ⇒ uy = u y /γ . This makes sense; the object has u x = 0, so this result is analogous to the preceding u y = uy /γ result for the ux = 0 case. In effect we have simply switched the primed and unprimed labels. These special cases can also be derived directly from time dilation.
G.4 Energy, momentum, force A dynamical consequence of special relativity can be stated as follows. Consider a particle moving with velocity u in an inertial frame F. We find that energy and momentum are conserved in the interactions of this particle with others if we attribute to the particle a momentum and an energy given by p = γ m0 u
and
E = γ m0 c2 ,
(G.11)
where m0 is a constant characteristic of that particle. We call m0 the rest mass (or just the mass) of the particle. It could have been determined in a frame in which the particle is moving so slowly that Newtonian mechanics applies – for instance, by bouncing the particle against some standard mass. The factor γ multiplying m0 is (1 − u2 /c2 )−1/2 , where u is the speed of the particle as observed in our frame F.
809
810
A short review of special relativity
Given p and E, the momentum and energy of a particle as observed in F, what is the momentum of that particle, and its energy, as observed in another frame F ? As before, we assume F is moving in the positive x direction, with speed v, as seen from F. The transformation turns out to be this: p x = γ px − βγ E/c, p y = py , p z = pz , E = γ E − βγ cpx .
(G.12)
Note that βc is here the relative velocity of the two frames, as it was in Eq. (G.2), not the particle velocity. Compare this transformation with Eq. (G.2). The resemblance would be perfect if we considered cp instead of p in Eq. (G.12), and ct rather than t in Eq. (G.2). A set of four quantities that transform in this way is called a four-vector. The meaning of force is rate of change of momentum. The force acting on an object is simply dp/dt, where p is the object’s momentum in the chosen frame of reference and t is measured by clocks in that frame. To find how forces transform, consider a particle of mass m0 initially at rest at the origin in frame F upon which a force f acts for a short time t. We want to find the rate of change of momentum dp /dt , observed in a frame F . As before, we shall let F move in the x direction as seen from F. Consider first the effect of the force component fx . In time t, px will increase from zero to fx t, while x increases by 1 fx x = (G.13) ( t)2 , 2 m0 and the particle’s energy increases by E = (fx t)2 /2m0 ; this is the kinetic energy it acquires, as observed in F. (The particle’s speed in F is still so slight that Newtonian mechanics applies there.) Using the first of Eqs. (G.12) we find the change in p x : p x = γ px − βγ E/c,
(G.14)
and using the fourth of Eqs. (G.2) gives t = γ t − βγ x/c.
(G.15)
Now both E and x are proportional to ( t)2 , so when we take the limit t → 0, the last term in each of these equations will drop out, giving p x γ (fx t) dp x = lim = = fx .
dt γ t t →0 t
(G.16)
G.4 Energy, momentum, force
Conclusion: the force component parallel to the relative frame motion has the same value in the moving frame as in the rest frame of the particle. A transverse force component behaves differently. In frame F, py = fy t. But now p y = py , and t = γ t, so we get dp y dt
=
fy t fy = . γ t γ
(G.17)
A force component perpendicular to the relative frame motion, observed in F , is smaller by the factor 1/γ than the value determined by observers in the rest frame of the particle. The transformation of a force from F to some other moving frame
F would be a little more complicated. We can always work it out, if we have to, by transforming to the rest frame of the particle and then back to the other moving frame. We conclude our review with a remark about Lorentz invariance. If you square both sides of Eq. (G.12) and remember that γ 2 − β 2 γ 2 = 1, you can easily show that
2
2
2 2 2 2 2 2 c2 (p 2 x + py + pz ) − E = c (px + py + pz ) − E .
(G.18)
Evidently this quantity c2 p2 − E2 is not changed by a Lorentz transformation. It is often called the invariant four-momentum (even though it has dimensions of energy squared). It has the same value in every frame of reference, including the particle’s rest frame. In the rest frame the particle’s momentum is zero and its energy E is just m0 c2 . The invariant four-momentum is therefore −m20 c4 . It follows that in any other frame E2 = c2 p2 + m20 c4 .
(G.19)
The invariant constructed in the same way with Eq. (G.2) is (xB − xA )2 + (yB − yA )2 + (zB − zA )2 − c2 (tB − tA )2 .
(G.20)
Two events, A and B, for which this quantity is positive are said to have a spacelike separation. It is always possible to find a frame in which they are simultaneous. If the invariant is negative, the events have a timelike separation. In that case a frame exists in which they occur at different times, but at the same place. If this “invariant interval” is zero, the two events can be connected by a flash of light.
811
H Radiation by an accelerated charge
A particle with charge q has been moving in a straight line at constant speed v0 for a long time. It runs into something, let us imagine, and in a short period of constant deceleration, of duration τ , the particle is brought to rest. The graph of velocity versus time in Fig. H.1 describes its motion. What must the electric field of this particle look like after that? Figure H.2 shows how to derive it. We shall assume that v0 is small compared with c. Let t = 0 be the instant the deceleration began, and let x = 0 be the position of the particle at that instant. By the time the particle has completely stopped it will have moved a little farther on, to x = v0 τ/2. That distance, indicated in Fig. H.2, is small compared with the other distances that will be involved. We now examine the electric field at a time t = T τ . Observers farther away from the origin than R = cT cannot have learned that the particle was decelerated. Throughout that region, region I in Fig. H.2, the field must be that of a charge that has been moving and is still moving at the constant speed v0 . That field, as we discovered in Section 5.7, appears to emanate from the present position of the charge, which for an observer anywhere in region I is the point x = v0 T on the x axis. That is where the particle would be now if it hadn’t been decelerated. On the other hand, for any observer whose distance from the origin is less than c(T − τ ), that is to say, for any observer in region II, the field is that of a charge at rest close to the origin (actually at x = v0 τ/2). What must the field be like in the transition region, the spherical shell of thickness cτ ? Gauss’s law provides the key. A field line such as AB lies on a cone around the x axis that includes a certain amount of flux from the charge q. If CD makes the same angle θ with the axis,
Radiation by an accelerated charge
the cone on which it lies includes that same amount of flux. (Because v0 is small, the relativistic compression of field lines visible in Fig. 5.15 and Fig. 5.19 is here negligible.) Hence AB and CD must be parts of the same field line, connected by a segment BC. This tells us the direction of the field E within the shell; it is the direction of the line segment BC. This field E within the shell has both a radial component Er and a transverse component Eθ . From the geometry of the figure their ratio is easily found: v0 T sin θ Eθ = . Er cτ
(H.1)
813 v v0 t=0 t=τ
t=T
Figure H.1. Velocity-time diagram for a particle that traveled at constant speed v0 until t = 0. It then experienced a constant negative acceleration of magnitude a = v0 /τ , which brought it to rest at time t = τ . We assume v0 is small compared with c.
Now Er must have the same value within the shell thickness that it does in region II near B. (Gauss’s law again!) Therefore Er = q/4π 0 R2 = q/4π 0 c2 T 2 , and substituting this into Eq. (H.1) we obtain v0 T sin θ qv0 sin θ . Er = cτ 4π 0 c3 Tτ
Eθ =
Region I
(H.2)
Er Shell E
Eq
D
Region II
− t)
B C
R = c(T
R = cT
ct
v0 T sin q
q
q A x=0 1 x = v0t (where 2 the particle is now at rest)
x
x = v0T (where the particle would be now if it hadn’t stopped)
Figure H.2. Space diagram for the instant t = T τ , a long time after the particle has stopped. For observers in region I, the field must be that of a charge located at the position x = v0 T; for observers in region II, it is that of a particle at rest close to the origin. The transition region is a shell of thickness cτ .
814
Radiation by an accelerated charge But v0 /τ = a, the magnitude of the (negative) acceleration, and cT = R, so our result can be written as follows: Eθ =
qa sin θ 4π 0 c2 R
(H.3)
A remarkable fact is here revealed: Eθ is proportional to 1/R, not to 1/R2 ! As time goes on and R increases, the transverse field Eθ will eventually become very much stronger than Er . Accompanying this transverse (that is, perpendicular to R) electric field will be a magnetic field of strength Eθ /c perpendicular to both R and E. This is a general property of an electromagnetic wave, explained in Chapter 9. Let us calculate the energy stored in the transverse electric field above, in the whole spherical shell. The energy density is 0 Eθ2 q2 a2 sin2 θ . = 2 32π 2 0 R2 c4
(H.4)
The volume of the shell is 4π R2 cτ , and the average value of sin2 θ over a sphere1 is 2/3. The total energy of the transverse electric field is therefore q2 a2 q2 a2 τ 2 = . 4π R2 cτ 3 32π 2 0 R2 c4 12π 0 c3
(H.5)
To this we must add an equal amount (see Section 9.6.1) for the energy stored in the transverse magnetic field: Total energy in transverse electromagnetic field =
q2 a2 τ . 6π 0 c3
(H.6)
The radius R has canceled out. This amount of energy simply travels outward, undiminished, with speed c from the site of the deceleration. Since τ is the duration of the deceleration, and is also the duration of the electromagnetic pulse a distant observer measures, we can say that the power radiated during the acceleration process was Prad =
q2 a2 6π 0 c3
(H.7)
As it is the square of the instantaneous acceleration that appears in Eq. (H.7), it doesn’t matter whether a is positive or negative. Of course it ought not to, for stopping in one inertial frame could be starting in 1 Our polar axis in Fig. H.2 is the x axis: cos2 θ = x2 /R2 . With a bar denoting an average over the sphere, x2 = y2 = z2 = R2 /3. Hence cos2 θ = 1/3, and
sin2 θ = 1 − cos2 θ = 2/3. Or you can just do an integral; the area of a circular strip around the x axis is proportional to sin θ , so you end up integrating sin3 θ .
Exercises
another. Speaking of different frames, Prad itself turns out to be Lorentzinvariant, which is sometimes very handy. That is because Prad is energy/ time, and energy transforms like time, each being the fourth component of a four-vector, as noted in Appendix G. We have here a more general result than we might have expected. Equation (H.7) correctly gives the instantaneous rate of radiation of energy by a charged particle moving with variable acceleration – for instance, a particle vibrating in simple harmonic motion. It applies to a wide variety of radiating systems from radio antennas to atoms and nuclei.
Exercises H.1 Ratio of energies * An electron moving initially at constant (nonrelativistic) speed v is brought to rest with uniform deceleration a lasting for a time t = v/a. Compare the electromagnetic energy radiated during the deceleration with the electron’s initial kinetic energy. Express the ratio in terms of two lengths, the distance light travels in time t and the classical electron radius r0 , defined as e2 /4Ď€ 0 mc2 . H.2 Simple harmonic moton ** An elastically bound electron vibrates in simple harmonic motion at frequency ω with amplitude A. (a) Find the average rate of loss of energy by radiation. (b) If no energy is supplied to make up the loss, how long will it take for the oscillator’s energy to fall to 1/e of its initial value? (Answer: 6Ď€ 0 mc3 /e2 ω2 .) H.3 Thompson scattering ** A plane electromagnetic wave with frequency ω and electric field amplitude E0 is incident on an isolated electron. In the resulting sinusoidal oscillation of the electron the maximum acceleration is E0 e/m (the maximum force divided by m). How much power is radiated by this oscillating charge, averaged over many cycles? (Note that it is independent of the frequency ω.) Divide this average radiated power by 0 E02 c/2, the average power density (power per unit area of wavefront) in the incident wave. This gives a constant Ďƒ with the dimensions of area, called a scattering cross section. The energy radiated, or scattered, by the electron, and thus lost from the plane wave, is equivalent to that falling on an area Ďƒ . (The case here considered, involving a free electron moving nonrelativistically, is often called Thomson scattering after J. J. Thomson, the discoverer of the electron, who first calculated it.) H.4 Synchrotron radiation ** Our master formula, Eq. (H.7), is useful for relativistically moving particles, even though we assumed v0 c in the derivation.
815
816
Radiation by an accelerated charge All we have to do is transform to an inertial frame F in which the particle in question is, at least temporarily, moving slowly, apply Eq. (H.7) in that frame, then transform back to any frame we choose. Consider a highly relativistic electron (Îł 1) moving perpendicular to a magnetic field B. It is continually accelerated perpendicular to the field, and must radiate. At what rate does it lose energy? To answer this, transform to a frame F moving momentarily along with the electron, find E in that frame, and P rad . Now show that, because power is (energy)/(time), Prad = P rad . This radiation is generally called synchrotron radiation. (Answer: Prad = Îł 2 e4 B2 /6Ď€ 0 m2 c.)
I The metal lead is a moderately good conductor at room temperature. Its resistivity, like that of other pure metals, varies approximately in proportion to the absolute temperature. As a lead wire is cooled to 15 K its resistance falls to about 1/20 of its value at room temperature, and the resistance continues to decrease as the temperature is lowered further. But as the temperature 7.22 K is passed, there occurs without forewarning a startling change: the electrical resistance of the lead wire vanishes! So small does it become that a current flowing in a closed ring of lead wire colder than 7.22 K – a current that would ordinarily die out in much less than a microsecond – will flow for years without measurably decreasing. This phenomenon has been directly demonstrated. Other experiments indicate that such a current could persist for billions of years. One can hardly quibble with the flat statement that the resistivity is zero. Evidently something quite different from ordinary electrical conduction occurs in lead below 7.22 K. We call it superconductivity. Superconductivity was discovered in 1911 by the great Dutch lowtemperature experimenter Kamerlingh Onnes. He observed it first in mercury, for which the critical temperature is 4.16 K. Since then hundreds of elements, alloys, and compounds have been found to become superconductors. Their individual critical temperatures range from roughly a millikelvin up to the highest yet discovered, 138 K. Curiously, among the elements that do not become superconducting are some of the best normal conductors such as silver, copper, and the alkali metals. Superconductivity is essentially a quantum-mechanical phenomenon, and a rather subtle one at that. The freely flowing electric current consists of electrons in perfectly orderly motion. Like the motion of an electron in an atom, this electron flow is immune to small disturbances – and for
Superconductivity
818
Superconductivity
a similar reason: a finite amount of energy would be required to make any change in the state of motion. It is something like the situation in an insulator in which all the levels in the valence band are occupied and separated by an energy gap from the higher energy levels in the conduction band. But unlike electrons filling the valence band, which must in total give exactly zero net flow, the lowest energy state of the superconducting electrons can have a net electron velocity, hence current flow, in some direction. Why should such a strange state become possible below a certain critical temperature? We can’t explain that here.1 It involves the interaction of the conduction electrons not only with each other, but also with the whole lattice of positive ions through which they are moving. That is why different substances can have different critical temperatures, and why some substances are expected to remain normal conductors right down to absolute zero. In the physics of superconductivity, magnetic fields are even more important than you might expect. We must state at once that the phenomena of superconductivity in no way violate Maxwell’s equations. Thus the persistent current that can flow in a ring of superconducting wire is a direct consequence of Faraday’s law of induction, given that the resistance of the ring is really zero. For if we start with a certain amount of flux 0 threading the ring, then because E · ds around the ring remains always zero (otherwise there would be infinite current due to the zero resistance), d/dt must be zero. The flux cannot change; the current I in the ring will automatically assume whatever value is necessary to maintain the flux at 0 . Figure I.1 outlines a simple demonstration of this, and shows how a persistent current can be established in an isolated superconducting circuit. Superconductors can be divided into two types. In Type 1 superconductors, the magnetic field inside the material itself (except very near the surface) is always zero. That is not a consequence of Maxwell’s equations, but a property of the superconducting state, as fundamental, and once as baffling, a puzzle as the absence of resistance. The condition B = 0 inside the bulk of a Type 1 superconductor is automatically maintained by currents flowing in a thin surface layer. In Type 2 superconductors, quantized magnetic flux tubes may exist for a certain range of temperature and external magnetic field. These tubes are surrounded by vortices of current (essentially little solenoids) which allow the magnetic field to be zero in the rest of the material. Outside the flux tubes the material is superconducting. A strong magnetic field destroys superconductivity, although Type 2 superconductors generally can tolerate much larger magnetic fields than 1 The abrupt emergence of a state of order at a certain critical temperature reminds us
of the spontaneous alignment of electron spins that occurs in iron below its Curie temperature (mentioned in Section 11.11). Such cooperative phenomena always involve a large number of mutually interacting particles. A more familiar cooperative phenomenon is the freezing of water, also characterized by a well-defined critical temperature.
Superconductivity
(a)
819
Ring of solder (lead–tin alloy); normal conductor; current zero; permanent magnet causes flux Φ0 through ring.
String
Magnet
Liquid helium 4.2 K
(b)
Ring cooled below its critical temperature. (Some helium has boiled away.) Flux through ring unchanged. Ring is now a superconductor.
(c)
I
Magnet removed. Persistent current I now flows in ring to maintain flux at value Φ0. Compass needle responds to field of persistent current.
Type 1. None of the superconductors known before 1957 could stand more than a few hundred gauss. That discouraged practical applications of zero-resistance conductors. One could not pass a large current through a superconducting wire because the magnetic field of the current itself would destroy the superconducting state. But then a number of Type 2 superconductors were discovered that could preserve zero resistance in fields up to 10 tesla or more. A widely used Type 2 superconductor is
Figure I.1. Establishing a persistent current in a superconducting ring. The ring is made of ordinary solder, a lead–tin alloy. (a) The ring, not yet cooled, is a normal conductor with ohmic resistance. Bringing up the permanent magnet will induce a current in the ring that will quickly die out, leaving the magnetic flux from the magnet, in amount , passing through the ring. (b) The helium bath is raised without altering the relative position of the ring and the permanent magnet. The ring, now cooled below its critical temperature, is a superconductor with resistance zero. (c) The magnet is removed. The flux through the zero resistance ring cannot change. It is maintained at the value by a current in the ring that will flow as long as the ring remains below the critical temperature. The magnetic field of the persistent current can be demonstrated with the compass.
820
Superconductivity
an alloy of niobium and tin that has a critical temperature of 18 K and if cooled to 4 K remains superconducting in fields up to 25 tesla. Type 2 superconducting solenoids are now common that produce steady magnetic fields of 20 tesla without any cost in power other than that incident to their refrigeration. Uses of superconductors include magnetic resonance imaging (MRI) machines (which are based on the physics discussed in Appendix J) and particle accelerators. There are also good prospects for the widespread use of superconductors in large electrical machinery, maglev trains, and the long-distance transmission of electrical energy. In addition to the critical magnetic field, the critical temperature is also a factor in determining the large-scale utility of a superconductor. In particular, a critical temperature higher than 77 K allows relatively cheap cooling with liquid nitrogen (as opposed to liquid helium at 4 K). Prior to 1986, the highest known critical temperature was 23 K. Then a new type of superconductor (a copper oxide, or cuprate) was observed with a critical temperature of 30 K. The record critical temperature was soon pushed to 138 K. These superconductors are called high-temperature superconductors. Unfortunately, although they are cheaper to cool, their utility is limited because they tend to be brittle and hence difficult to shape into wires. However, in 2008 a new family of high-temperature superconductors was discovered, with iron as a common element. This family is more ductile than cuprates, but the highest known critical temperature is 55 K. The hope is that this will eventually cross the 77 K threshold. The mechanism that leads to high-temperature superconductivity is more complex than the mechanism for low-temperature superconductivity. In contrast with the well-established BCS theory (named after Bardeen, Cooper, and Schrieffer; formulated in 1957) for low-temperature superconductors, a complete theory of high-temperature superconductors does not yet exist. All known high-temperature superconductors are Type 2, but not all Type 2 superconductors are high-temperature. Indeed, low-temperature Type 2 superconductors (being both ductile and tolerant of large magnetic fields) are the ones presently used in MRI machines and other large-scale applications. At the other end of the scale, the quantum physics of superconductivity makes possible electrical measurements of unprecedented sensitivity and accuracy – including the standardization of the volt in terms of an easily measured oscillation frequency. To the physicist, superconductivity is a fascinating large-scale manifestation of quantum mechanics. We can trace the permanent magnetism of the magnet in Fig. I.1 down to the intrinsic magnetic moment of a spinning electron – a kind of supercurrent in a circuit less than 10−10 m in size. The ring of solder wire with the persistent current flowing in it is, in some sense, like a gigantic atom, the motion of its associated electrons, numerous as they are, marshaled into the perfectly ordered behavior of a single quantum state.
J The electron has angular momentum of spin, J. Its magnitude is always the same, h/4π, or 5.273 · 10−35 kg m2 /s. Associated with the axis of spin is a magnetic dipole moment μ of magnitude 0.9285 · 10−23 joule/ tesla (see Section 11.6). An electron in a magnetic field experiences a torque tending to align the magnetic dipole in the field direction. It responds like any rapidly spinning gyroscope: instead of lining up with the field, the spin axis precesses around the field direction. Let us see why any spinning magnet does this. In Fig. J.1 the magnetic moment μ is shown pointing opposite to the angular momentum J, as it would for a negatively charged body like an electron. The magnetic field B (the field of some solenoid or magnet not shown) causes a torque equal to μ × B. This torque is a vector in the negative xˆ direction at the time of our picture. Its magnitude is given by Eq. (11.48); it is μB sin θ. In a short time t, the torque adds to the angular momentum of our top a vector increment J in the direction of the torque vector and of magnitude μB sin θ t. The horizontal component of J, in magnitude J sin θ , is thereby rotated through a small angle ψ given by ψ =
μB t J = . J sin θ J
(J.1)
As this continues, the upper end of the vector J will simply move around the circle with constant angular velocity ωp : ωp =
ψ μB = . t J
(J.2)
Magnetic resonance
822
Magnetic resonance z
B
J sin q q
ΔJ
Δf
J
y
m x
Figure J.1. The precession of a magnetic top in an external field. The angular momentum of spin J and the magnetic dipole moment μ are oppositely directed, as they would be for a negatively charged rotor.
B
m
This is the rate of precession of the axis of spin. Note that it is the same for any angle of tip; sin θ has canceled out. For the electron, μ/J has the value 1.761 · 1011 s−1 tesla−1 . In a field of 1 gauss (10−4 tesla) the spin vector precesses at 1.761 · 107 radians/s, or 2.80 · 106 revolutions per second. The proton has exactly the same intrinsic spin angular momentum as the electron, h/4π, but the associated magnetic moment is smaller. That is to be expected since the mass of the proton is 1836 times the mass of the electron; as in the case of orbital angular momentum (see Eq. (11.29)), the magnetic moment of an elementary particle with spin ought to be inversely proportional to its mass, other things being equal. Actually the proton’s magnetic moment is 1.411 · 10−26 joule/tesla, only about 660 times smaller than the electron moment, which shows that the proton is in some way a composite particle. In a field of 1 gauss the proton spin precesses at 4258 revolutions per second. About 40 percent of the stable atomic nuclei have intrinsic angular momenta and associated magnetic dipole moments. We can detect the precession of magnetic dipole moments through their influence on an electric circuit. Imagine a proton in a magnetic field B, with its spin axis perpendicular to the field, and surrounded by a small coil of wire, as in Fig. J.2. The precession of the proton causes some alternating flux through the coil, as would the end-over-end rotation of a little bar magnet. A voltage alternating at the precession frequency will be induced in the coil. As you might expect, the voltage thus induced by a single proton would be much too feeble to detect. But it is easy to provide more protons – 1 cm3 of water contains about 7 · 1022 protons (we’re concerned with the two hydrogen atoms in each water molecule), and all of them will precess at the same frequency. Unfortunately they will not all be pointing in the same direction at the same instant. In fact, their spin axes and magnetic moments will be distributed so uniformly over all possible directions that their fields will very nearly cancel one another. But not quite, if we introduce another step. If we apply a strong magnetic field B to water, for several seconds there will develop a slight excess of proton moments pointing in the direction of B, the direction they energetically favor. The fractional excess will be μB/kT in order of magnitude, as in ordinary paramagnetism. It may be no more than one in a million, but these uncanceled moments, if they are now caused to precess in our coil, will induce an observable signal. A simple method for observing nuclear spin precession in weak fields, such as the earth’s field, is described in Fig. J.3. Many other schemes are used to observe the spin precession of electrons and of Figure J.2. A precessing magnetic dipole moment at the center of a coil causes a periodic change in the flux through the coil, inducing an alternating electromotive force in the coil. Note that the flux from the dipole m that links the coil is that which loops around outside it. See Exercise J.1.
Magnetic resonance
z Be
Amplifier S2
m
B0 S1
nuclei. They generally involve a combination of a steady magnetic field and oscillating magnetic fields with frequency in the neighborhood of ωp . For electron spins (electron paramagnetic resonance, or EPR) the frequencies are typically several thousand megahertz, while for nuclear spins (nuclear magnetic resonance, or NMR) they are several tens of megahertz. The exact frequency of precession, or resonance, in a given applied field can be slightly shifted by magnetic interactions within a molecule. This has made NMR, in particular, useful in chemistry. The position of a proton in a complex molecule can often be deduced from the small shift in its precession frequency. Magnetic fields easily penetrate ordinary nonmagnetic materials, and that includes alternating magnetic fields if their frequency or the electric conductivity of the material is not too great. A steady field of 2000 gauss applied to the bottle of water in our example would cause any proton polarization to precess at a frequency of 8.516 · 106 revolutions per second. The field of the precessing moments would induce a signal of 8.516 MHz frequency in the coil outside the bottle. This applies as well to the human body, which, viewed as a dielectric, is simply an assembly of more or less watery objects. In NMR imaging (or magnetic resonance imaging, MRI) the interior of the body is mapped by means of nuclear magnetic resonance. The concentration of hydrogen atoms at a
823
Figure J.3. Apparatus for observing proton spin precession in the earth’s field Be . A bottle of water is surrounded by two orthogonal coils. With switch S2 open and switch S1 closed, the large solenoid creates a strong magnetic field B0 . As in ordinary paramagnetism (Section 11.6), the energy is lowered if the dipoles point in the direction of the field, but thermal agitation causes disorder. Our dipoles here are the protons (hydrogen nuclei) in the molecules of water. When thermal equilibrium has been attained, which in this case takes several seconds, the magnetization is what you would get by lining up with the magnetic field the small fraction μB0 /kT of all the proton moments. We now switch off the strong field B0 and close switch S2 to connect the coil around the bottle to the amplifier. The magnetic moment m now precesses in the xy plane around the remaining, relatively weak, magnetic field Be , with precession frequency given by Eq. (J.2). The alternating y component of the rotating vector m induces an alternating voltage in the coil which can be amplified and observed. From its frequency, Be can be very precisely determined. This signal itself will die away in a few seconds as thermal agitation destroys the magnetization the strong field B0 had brought about. Magnetic resonance magnetometers of this and other types are used by geophysicists to explore the earth’s field, and even by archaeologists to locate buried artifacts.
824
Magnetic resonance
particular location is revealed by the radiofrequency signal induced in an external coil by the precessing protons. The location of the source within the body can be inferred from the precise frequency of the signal if the steady field B, which determines the frequency according to Eq. (J.2), varies spatially with a known gradient.
Exercises J.1
Emf from a proton ** At the center of the four-turn coil of radius a in Fig. J.2 is a single proton, precessing at angular rate ωp . Derive a formula for the amplitude of the induced alternating electromotive force in the coil, given that the proton moment is 1.411 ¡ 10−26 joule/tesla.
J.2
Emf from a bottle *** (a) If the bottle in Fig. J.3 contains 200 cm3 of H2 O at room temperature, and if the field B0 is 1000 gauss, how large is the net magnetic moment m? (b) Using the result of Exercise J.1, make a rough estimate of the signal voltage available from a coil of 500 turns and 4 cm radius when the field strength Be is 0.4 gauss.
K K.1 Fundamental constants speed of light
c
2.998 · 108 m/s
elementary charge
e
1.602 · 10−19 C 4.803 · 10−10 esu
electron mass
me
9.109 · 10−31 kg
proton mass
mp
1.673 · 10−27 kg
Avogadro’s number
NA
6.022 · 10−23 mole−1
Boltzmann constant
k
1.381 · 10−23 J/K
Planck constant
h
6.626 · 10−34 J s
gravitational constant
G
6.674 · 10−11 m3 /(kg s2 )
electron magnetic moment
μe
9.285 · 10−24 J/T
proton magnetic moment
μp
1.411 · 10−26 J/T
permittivity of free space
0
8.854 · 10−12 C2 /(N m2 )
permeability of free space
μ0
1.257 · 10−6 T m/A
The exact numerical value of μ0 is 4π · 10−7 (by definition). The exact numerical value of 0 is (4π · [3]2 · 109 )−1 , where [3] ≡ 2.99792458 (see Appendix E).
Helpful formulas/facts
826
Helpful formulas/facts
K.2 Integral table
dx 1 −1 x = tan r r x2 + r 2
dx = sin−1 x √ 1 − x2
(K.2)
dx = ln x + x2 − 1 √ 2 x −1 dx = ln x2 + a2 + x √ x2 + a2 (a2
dx x = 2 2 2 3/2 +x ) a (a + x2 )1/2 ln x dx = x ln x − x
xn ln
a x
dx =
xn+1 a xn+1 + ln n+1 x (n + 1)2
xe−x dx = −(x + 1)e−x x2 e−x dx = −(x2 + 2x + 2)e−x
sin3 x dx = − cos x + cos3 x dx = sin x −
(K.4) (K.5) (K.6) (K.7) (K.8) (K.9) (K.10) (K.11) (K.12) (K.13) (K.14)
− cos x (1 − a2 ) 1 − a2 sin2 x
(K.15)
sin x dx
cos x dx
sin3 x 3
(K.3)
cos x dx sin x = √ 2 2 3/2 2 (1 − a cos x) (1 − a ) 1 − a2 cos2 x (1 − a2 sin2 x)3/2
cos3 x 3
dx 1 + sin x = ln cos x cos x dx 1 − cos x = ln sin x sin x
(K.1)
=
1 − b2 sin2 (x − a)
3/2 =
(2 − b2 ) sin x + b2 sin(2a − x) (K.16) 2(1 − b2 ) 1 − b2 sin2 (a − x)
sin x(a cos x − b) dx −a + b cos x = √ 2 2 (a2 + b2 − 2ab cos x)3/2 b a + b2 − 2ab cos x
(K.17)
K.4 Taylor series
K.3 Vector identities ∇ · (∇ × A) = 0 ∇ · (f A) = f ∇ · A + A · ∇f ∇ · (A × B) = B · (∇ × A) − A · (∇ × B) ∇ × (∇f ) = 0 ∇ × (f A) = f ∇ × A + (∇f ) × A ∇ × (∇ × A) = ∇(∇ · A) − ∇ 2 A ∇ × (A × B) = A(∇ · B) − B(∇ · A) + (B · ∇)A − (A · ∇)B A × (B × C) = B(A · C) − C(A · B) ∇(A · B) = (A · ∇)B + (B · ∇)A + A × (∇ × B) + B × (∇ × A)
K.4 Taylor series The general form of a Taylor series is f
(x0 ) 2 f
(x0 ) 3 x + x + · · · . (K.18) 2! 3! This equality can be verified by taking successive derivatives and then setting x = 0. For example, taking the first derivative and then setting x = 0 gives f (x0 ) on the left, and also f (x0 ) on the right, because the first term is a constant and gives zero when differentiated, the second term gives f (x0 ), and all the rest of the terms give zero once we set x = 0 because they all contain at least one power of x. Likewise, if we take the second derivative of each side and then set x = 0, we obtain f
(x0 ) on both sides. And so on for all derivatives. Therefore, since the two functions on each side of Eq. (K.18) are equal at x = 0 and also have their nth derivatives equal at x = 0 for all n, they must in fact be the same function (assuming that they are nicely behaved functions, which we generally assume in physics). Some specific Taylor series that come up often are listed below; they are all expanded around x0 = 0. We use these series countless times throughout this book when checking how expressions behave in the limit of some small quantity. The series are all derivable via Eq. (K.18), but sometimes there are quicker ways of obtaining them. For example, Eq. (K.20) is most easily obtained by taking the derivative of Eq. (K.19), which itself is simply the sum of a geometric series. f (x0 + x) = f (x0 ) + f (x0 )x +
1 = 1 + x + x2 + x 3 + · · · 1−x
(K.19)
1 = 1 + 2x + 3x2 + 4x3 + · · · (1 − x)2
(K.20)
ln(1 − x) = −x −
x2 x3 − − ··· 2 3
(K.21)
827
828
Helpful formulas/facts
ex = 1 + x +
x2 x3 + + ··· 2! 3!
(K.22)
cos x = 1 −
x2 x4 + − ··· 2! 4!
(K.23)
sin x = x −
x3 x5 + − ··· 3! 5!
(K.24)
√ x x2 1+x=1+ − + ··· 2 8
(K.25)
x 3x2 1 =1− + + ··· √ 2 8 1+x n 2 n 3 n x + x + ··· (1 + x) = 1 + nx + 2 3
(K.26) (K.27)
K.5 Complex numbers
The imaginary number i is defined to be the number for which i2 = −1. (Of course, −i also has its square equal to −1.) A general complex number z with both real and imaginary parts can be written in the form a + bi, where a and b are real numbers. Such a number can be described by the point (a, b) in the complex plane, with the x and y axes being the real and imaginary axes, respectively. The most important formula involving complex numbers is eiθ = cos θ + i sin θ .
(K.28)
This can quickly be proved by writing out the Taylor series for both sides. Using Eq. (K.22), the first, third, fifth, etc. terms on the left-hand side of Eq. (K.28) are real, and from Eq. (K.23) their sum is cos θ . Similarly, the second, fourth, sixth, etc. terms are imaginary, and from Eq. (K.24) their sum is i sin θ . Writing it all out, we have (iθ )2 (iθ )3 (iθ )4 (iθ )5 + + + + ··· 2! 3! 4! 5! θ2 θ4 θ3 θ5 = 1− + + ··· + i θ − + + ··· 2! 4! 3! 5!
eiθ = 1 + iθ +
= cos θ + i sin θ ,
(K.29)
as desired. Letting θ → −θ in Eq. (K.28) yields e−iθ = cos θ − i sin θ. Combining this with Eq. (K.28) allows us to solve for cos θ and sin θ in terms of the complex exponentials: cos θ =
eiθ + e−iθ , 2
sin θ =
eiθ − e−iθ . 2i
(K.30)
K.6 Trigonometric identities A complex number z described by the Cartesian coordinates (a, b) in the complex plane can also be described by the polar coordinates (r, θ ). The radius r and angle θ are given by the usual relation between Cartesian and polar coordinates (see Fig. K.1), r = a2 + b2 and θ = tan−1 (b/a). (K.31) Using Eq. (K.28), we can write z in polar form as a + bi = (r cos θ ) + (r sin θ )i = r(cos θ + i sin θ ) = re .
(K.32)
We see that the quantity in the exponent (excluding the i) equals the angle of the vector in the complex plane. The complex conjugate of z, denoted by z∗ (or by zÂŻ), is defined to ∗ be z ≥ a − bi, or equivalently z∗ ≥ re−iθ . It is obtained by reflecting the Cartesian point (a, b) across the real axis. Note that √ either of these expressions for z∗ implies that r can be written as r = zz∗ . The radius r is known as the magnitude or absolute value of z, and is commonly denoted by |z|. The complex conjugate of a product is the product of the complex conjugates, that is, (z1 z2 )∗ = z∗1 z∗2 . You can quickly verify this by writing z1 and z2 in polar form. The Cartesian form works too, but that takes a little longer. The same result holds for the quotient of two complex numbers. As an example of the use of Eq. (K.28), we can quickly derive the double-angle formulas for sine and cosine. We have 2 cos 2θ + i sin 2θ = ei2θ = eiθ = (cos θ + i sin θ )2 = (cos2 θ − sin2 θ ) + i(2 sin θ cos θ ).
(K.33)
Equating the real parts of the expressions on either end of this equation gives cos 2θ = cos2 θ − sin2 θ . And equating the imaginary parts gives sin 2θ = 2 sin θ cos θ . This method easily generalizes to other trig sum formulas.
K.6 Trigonometric identities cos 2θ = cos2 θ − sin2 θ
(K.34)
sin(ι + β) = sin ι cos β + cos ι sin β
(K.35)
cos(Îą + β) = cos Îą cos β − sin Îą sin β
(K.36)
tan(ι + β) =
tan Îą + tan β 1 − tan Îą tan β
y
2
2
a r=
+b
b
q iθ
sin 2θ = 2 sin θ cos θ,
829
(K.37)
a
x
Figure K.1. Cartesian and polar coordinates in the complex plane.
830
Helpful formulas/facts 1 + cos θ 1 − cos θ θ θ cos = ± , sin = ± 2 2 2 2 1 − cos θ 1 − cos θ sin θ θ = = tan = ± 2 1 + cos θ sin θ 1 + cos θ
(K.38) (K.39)
The hyperbolic trig functions are defined by analogy with Eq. (K.30), with the i’s omitted: ex + e−x ex − e−x , sinh x = 2 2 2 2 cosh x − sinh x = 1 d d cosh x = sinh x, sinh x = cosh x dx dx
cosh x =
(K.40) (K.41) (K.42)
Andrews, M. (1997). Equilibrium charge density on a conducting needle. Am. J. Phys., 65, 846–850. Assis, A. K. T., Rodrigues, W. A., Jr., and Mania, A. J. (1999). The electric field outside a stationary resistive wire carrying a constant current. Found. Phys., 29, 729–753. Auty, R. P. and Cole, R. H. (1952). Dielectric properties of ice and solid D2 O. J. Chem. Phys., 20, 1309–1314. Blakemore, R. P. and Frankel, R. B. (1981). Magnetic navigation in bacteria. Sci. Am., 245, (6), 58–65. Bloomfield, L.A. (2010). How Things Work, 4th edn. (New York: John Wiley & Sons). Boos, F. L., Jr. (1984). More on the Feynman’s disk paradox. Am. J. Phys., 52, 756–757. Bose, S. K. and Scott, G. K. (1985). On the magnetic field of current through a hollow cylinder. Am. J. Phys., 53, 584–586. Crandall, R. E. (1983). Photon mass experiment. Am. J. Phys., 51, 698–702. Crawford, F. S. (1992). Mutual inductance M12 = M21 : an elementary derivation. Am. J. Phys., 60, 186. Crosignani, B. and Di Porto, P. (1977). Energy of a charge system in an equilibrium configuration. Am. J. Phys., 45, 876. Davis, L., Jr., Goldhaber, A. S., and Nieto, M. M. (1975). Limit on the photon mass deduced from Pioneer-10 observations of Jupiter’s magnetic field. Phys. Rev. Lett., 35, 1402–1405. Faraday, M. (1839). Experimental Researches in Electricity (London: R. and J. E. Taylor). Feynman, R. P., Leighton, R. B., and Sands, M. (1977). The Feynman Lectures on Physics, vol. II (Reading, MA: Addision-Wesley). Friedberg, R. (1993). The electrostatics and magnetostatics of a conducting disk. Am. J. Phys., 61, 1084–1096.
References
832
References
Galili, I. and Goihbarg, E. (2005). Energy transfer in electrical circuits: a qualitative account. Am. J. Phys., 73, 141–144. Goldhaber, A. S. and Nieto, M. M. (1971). Terrestrial and extraterrestrial limits on the photon mass. Rev. Mod. Phys., 43, 277–296. Good, R. H. (1997). Comment on “Charge density on a conducting needle,” by David J. Griffiths and Ye Li [Am. J. Phys. 64(6), 706–714 (1996)]. Am. J. Phys., 65, 155–156. Griffiths, D. J. and Heald, M. A. (1991). Time-dependent generalizations of the Biot–Savart and Coulomb laws. Am. J. Phys., 59, 111–117. Griffiths, D. J. and Li, Y. (1996). Charge density on a conducting needle. Am. J. Phys., 64, 706–714. Hughes, V. W. (1964). In Chieu, H. Y. and Hoffman, W. F. (eds.), Gravitation and Relativity. (New York: W. A. Benjamin), chap. 13. Jackson, J. D. (1996). Surface charges on circuit wires and resistors play three roles. Am. J. Phys., 64, 855–870. Jefimenko, O. (1962). Demonstration of the electric fields of current-carrying conductors. Am. J. Phys., 30, 19–21. King, J. G. (1960). Search for a small charge carried by molecules. Phys. Rev. Lett., 5, 562–565. Macaulay, D. (1998). The New Way Things Work (Boston: Houghton Mifflin). Marcus, A. (1941). The electric field associated with a steady current in long cylindrical conductor. Am. J. Phys., 9, 225–226. Maxwell, J. C. (1891). Treatise on Electricity and Magnetism, vol. I, 3rd edn. (Oxford: Oxford University Press), chap. VII. (Reprinted New York: Dover, 1954.) Mermin, N. D. (1984a). Relativity without light. Am. J. Phys., 52, 119–124. Mermin, N. D. (1984b). Letter to the editor. Am. J. Phys., 52, 967. Nan-Xian, C. (1981). Symmetry between inside and outside effects of an electrostatic shielding. Am. J. Phys., 49, 280–281. O’Dell, S. L. and Zia, R. K. P. (1986). Classical and semiclassical diamagnetism: a critique of treatment in elementary texts. Am. J. Phys., 54, 32–35. Page, L. (1912). A derivation of the fundamental relations of electrodynamics from those of electrostatics. Am. J. Sci., 34, 57–68. Press, F. and Siever, R. (1978). Earth, 2nd edn. (New York: W. H. Freeman). Priestly, J. (1767). The History and Present State of Electricity, vol. II, London. Roberts, D. (1983). How batteries work: a gravitational analog. Am. J. Phys., 51, 829–831. Romer, R. H. (1982). What do “voltmeters” measure? Faraday’s law in a multiply connected region. Am. J. Phys., 50, 1089–1093. Semon, M. D. and Taylor, J. R. (1996). Thoughts on the magnetic vector potential. Am. J. Phys., 64, 1361–1369. Smyth, C. P. (1955). Dielectric Behavior and Structure (New York: McGrawHill). Varney, R. N. and Fisher, L. H. (1980). Electromotive force: Volta’s forgotten concept. Am. J. Phys., 48, 405–408. Waage, H. M. (1964). Projection of electrostatic field lines. Am. J. Phys., 32, 388. Whittaker, E. T. (1960). A History of the Theories of Aether and Electricity, vol. I (New York: Harper), p. 266. Williams, E. R., Faller, J. E., and Hill, H. A. (1971). New experimental test of Coulomb’s law: a laboratory upper limit on the photon rest mass. Phys. Rev. Lett., 26, 721–724.
Index Addition of velocities, relativistic, 808–809
orbital, relation to magnetic moment, 541
Boltzmann’s constant k, 202, 503
additivity of interactions, 10, 13
precession of, 822–823
Boos, F. L., 460
admittance, 408–414
anode of vacuum diode, 181
boost converter, 372
Alnico V, B-H curve for, 569
antimatter, 3
Bose, S. K., 305
alternating current, 394–418
antineutron, 3
bound and free charge, 497–498
representation by complex number, 406–408 alternating-current circuit, 405–414 power and energy in, 415–418
antiproton, 3
arbitrariness of the distinction, 506–507
Assis, A. K. T., 263
bound-charge current, 505–507
atom, electric current in, 540
bound-charge density, 498
alternating electromotive force, 395
atomic polarizability, 480–482
bound currents, 559–560
alternator, 371
aurora borealis, 318
boundary of dielectric, change in E at, 494–495
aluminum, doping of silicon with, 203–204
Auty, R. P., 505
ammeter, 224 ammonia molecule, dipole moment of, 483 ampere (unit of current), 178, 283, 762–763, 790
boundary-value problem, 132, 151–153 bridge network, 208, 233
B, magnetic field, 239, 278 and M, and H inside magnetized cylinder, 565
capacitance, 141–147
Ampère, Andre-Marie, 2, 236, 238, 259, 531
bacteria, magnetic, 571, 580
of cell membrane, 513
Ampère’s law, 288
battery, lead–sulfuric acid, 209–212
coefficients of, 148
B-H curve, 569–570
of prolate spheroid, 171
amplitude modulation (AM), 455
Biot–Savart law, 298, 435
units of, 142
Andrews, M., 640
Bitter plates, 320
angular momentum
Blakemore, R. P., 580
differential form, 291
illustrated, 145 capacitor, 141–147
conservation of, in changing magnetic field, 580
Bloomfield, L. A., 35
dielectric-filled, 489–492
Bohr radius a0 , 55, 481, 544
energy stored in, 149–151
of electron spin, 546–547
Boltzmann factor, 202
parallel-plate, 143–144, 467
834
capacitor (cont.) uses of, 153 vacuum, 467 capacitor plate, force on, 151, 162 carbon monoxide molecule, dipole moment of, 483 cartesian coordinates, 791 cassette tape, 570 cathode of vacuum diode, 181 Cavendish, Henry, 11 centimeter (as unit of capacitance), 145 CH3 OH (methanol) molecule, dipole moment of, 483 charge electric, see electric charge magnetic, absence of, 529 in motion, see moving charge charge density, linear, 28 charge distribution cylindrical, field of, 83 electric, 20–22 moments of, 74, 471–474 spherical, field of, 26–28 on a surface, 29 charged balloon, 32 charged disk, 68–71 field lines and equipotentials of, 72 potential of, 69 charged wire potential of, 68 circuit breaker, 320 circuit element, 205 circuits LR, 366–367 RC, 215–216 RLC, 389, 398, 410 alternating-current, 394–418 direct-current, 204–207 equivalent, 206 resonant, 388–394 circulation, 90 Clausius–Mossotti relation, 502 CO (carbon monoxide) molecule, dipole moment of, 483 coefficients of capacitance, 148 of potential, 148
Index
coil cylindrical (solenoid), magnetic field of, 300–303, 338 toroidal energy stored in, 369 inductance of, 364 Cole, R. H., 505 comets, 454 compass needle, 239 complex exponential solutions, 402–405 complex-number representation of alternating current, 406–408 complex numbers, review of, 828–829 conduction, electrical, 181–204 ionic, 189–195 in metals, 198–200 in semiconductors, 200–204 conduction band, 201–202 conductivity, electrical, 182–188 anisotropic, 182 of metals, 198–200 units for, 182 of various materials, 188, 195–197 conductors, electrical, 125–141 charged, system of, 128 properties of, 129 spherical, field around, 131 conformal mapping, 151 conservation of electric charge, 4–5, 180–181 distinguished from charge invariance, 242 conservative forces, 12 continuity equation, 181 copper, resistivity of, 188, 196–197 copper chloride, paramagnetism of, 526 corona discharge, 37 coulomb (SI unit of charge), 8, 762 relation to esu, 9 Coulomb, Charles de, 10 Coulomb’s law, 7–11, 259 tests of, 10–11 Crandall, R. E., 11 Crawford, F. S., 378 critical damping, 394 Crosignani, B., 590 cross product (vector product) of two vectors, 238
Curie, Pierre, 566 Curie point, 566 curl, 90–99, 798–799 in Cartesian coordinates, 93–95, 100 physical meaning of, 95 curlmeter, 96 current density J, 177–180 current loop magnetic dipole moment of, 534 magnetic field of, 531–535 torque on, 547 current ring, magnetic field of, 299 current sheet, 303–306 magnetic field of, 303–304 currents alternating, 394–418 bound and free, 559–560 bound-charge, 505–507 displacement, 433–436 electric, see electric currents fluctuations of, random, 195 curvilinear coordinates, 791–801 cylinder, magnetized, compared with cylinder polarized, 557 cylindrical coordinates, 792 damped harmonic oscillator, 389 damped sinusoidal oscillation, 392 damping of resonant circuit, 388–394 critical, 394 Davis, L., Jr., 11 decay of proton, 6 decay time for earth’s magnetic field, 386 deer, flying, 102 “del” notation, 83, 95, 100 detergent, 510 deuterium molecule, 242 Di Porto, P., 590 diamagnetic substances, 526 diamagnetism, 527, 540, 546 of electron orbits, 545 diamond crystal structure of, 200 wide band gap of, 203 dielectric constant κ, 468 of various substances, 469 dielectric sphere in uniform field, 495–496 dielectrics, 467–471
Index
diode, 219 silicon junction, 229 vacuum, 181 dipole comparison of electric and magnetic, 535–536 electric, see electric dipole magnetic, see magnetic dipole dipole moment electric, see electric dipole moment magnetic, see magnetic dipole moment disk conducting, field of, 140 charged, 68–72 displacement, electric, D, 499, 560–561 displacement current, 433–436 distribution of electric charge, 20–22 divergence, 78–79, 795–797 in Cartesian coordinates, 81–83, 100 divergence theorem, 79–80, 100 domains, magnetic, 567 doorbell, 321 doping of silicon, 203–204 dot product of two vectors, 12 dynamic random access memory (DRAM), 153 dynamo, 379, 386 dyne (Gaussian unit of force), 8 0 , permittivity of free space, 8 Earnshaw’s theorem, 87 earth’s magnetic field, 280, 577 decay time of, 386 possible source of, 380 eddy-current braking, 370 Edison, Thomas, 419 Einstein, Albert, 2, 236, 281, 314 electret, 558 electric charge, 1–11, 242 additivity of, 10, 13 conservation of, 4–5, 180–181 distribution of, 20–22 free and bound, 497–498, 506–507 fundamental quantum of, 8 invariance of, 241–243 quantization of, 5–7, 242 sign of, 4 electric currents, 177–189 and charge conservation, 180–181
energy dissipation in flow of, 207–208 parallel, force between, 283 variable in capacitors and resistors, 215–216 in inductors and resistors, 366–367 electric dipole potential and field of, 73–77, 474–476 torque and force on, in external field, 477–478 electric dipole moment, 74, 473, 475 induced, 479–482 permanent, 482–483 electric displacement D, 499, 560–561 electric eels, 219 electric field definition of, 17 in different reference frames, 243–246 of dipole, 75, 476 of Earth, 36 energy stored in, 33 of flat sheet of charge, 29 flux of, 22–26 Gauss’s law, 23–26 inside hollow conductor, 134 of line charge, 28 line integral of, 59–61 macroscopic, 488–489 in matter, spatial average of, 487 microscopic, 488 of point charge with constant velocity, 247–251 relation to φ and ρ, 89 transformation of, 245, 310 units of, 17 visualization of, 18–20 electric field lines, 18, 19, 71, 72, 76–77 electric generator, 370 electric guitar, 370 electric potential, see potential, electric electric quadrupole moment, 74, 473 electric susceptibility χe , 490, 501, 503 electrical breakdown, 36, 100 electrical conduction, see conduction, electrical electrical conductivity, see conductivity, electrical electrical conductors, see conductors, electrical electrical insulators, 125–126
835
electrical potential energy, 13–16 of a system of charges, 33, 63 electrical shielding, 135 electrodynamic tether, 369 electromagnet, 320 design of, 584 electromagnetic field components, transformation of, 310 electromagnetic force, range of, 11 electromagnetic induction, 343–357 electromagnetic wave, 254, 438–453 in dielectric, 507–509 in different reference frames, 452–453 energy transport by, 446–452 general properties of, 440–441 reflection of, 445, 447, 521 standing, 442–446 traveling pulse, 441 electromotive force, 209–211, 347, 357 alternating, 395 electron, 3, 5, 6, 198–204, 540–549 charge of, 8 magnetic moment of, 547 valence, 200 electron motion, wave aspect of, 199 electron orbit, 540–545 diamagnetism of, 545 magnetic moment of, 540–541 electron paramagnetic resonance (EPR), 823 electron radius, classical, 52, 545 electron spin, 546–549 angular momentum of, 546–547 electronic paper, 37 electrostatic field, 61, see also electric field equilibrium in, 88 electrostatic unit (esu) of charge, 8, 765 energy, see also potential energy, electrical in alternating-current circuit, 415–418 dissipation of, in resistor, 207–208 electrical, of ionic crystal, 14–16 stored in capacitor, 150 in electric field, 33 in inductor, 368 in magnetic field, 369 of system of charges, 11–14 energy gap, 201 equilibrium of charged particle, 88
836
equipotential surfaces, 71, 131 in field of conducting disk, 140 in field of dipole, 76 in field of uniformly charged disk, 72 equivalence of inertial frames, 237, 805 equivalent circuit, 206 for voltaic cell, 211 esu (electrostatic unit), 8, 765 Faller, J. E., 11 farad (unit of capacitance), 142 Faraday, Michael, 2, 236, 314 discovery of induction by, 343–345 reconstruction of experiment by, 384 Waterloo Bridge experiment by, 380 Faraday’s law of induction, 356–357 ferrofluid, 572 ferromagnetic substances, 526 ferromagnetism, 527, 565–568 Feynman, R. P., 37, 539 field electric, see electric field magnetic, see magnetic field meaning of, 245 Fisher, L. H., 348 fluctuations of current, random, 195 flux of electric field, definition of, 22–26 magnetic, 348–351 flux tube, 349, 351 force components, Lorentz transformation of, 810–811 application of, 255–257 force(s) between parallel currents, 283 on capacitor plate, 151, 162 conservative, 12 on electric dipole, 478 electromotive, 209–211, 347, 357, 395 with finite range, 88 on layer of charge, 30–32, 46 magnetic, 237–239 on magnetic dipole, 535–539 on moving charged particle, 255–267, 278 Foster’s theorem, 224 Frankel, R. B., 580 Franklin, Benjamin, 10, 516, 529
Index
free and bound charge, 497–498 arbitrariness of the distinction, 506–507 free currents, 559–560 frequency modulation (FM), 455 Friedberg, R., 639 fundamental constants, 825 fuse, 219 Galili, I., 452, 464 Galvani, Luigi, 209, 236 galvanic currents, 236 galvanometer, 224, 344 Gauss, C. F., 286 gauss (unit of magnetic field strength), 282 Gaussian units, 762–768 Gauss’s law, 23–26, 80, 88 applications of, 26–30, 88, 243–245, 254, 262, 266, 488, 812 and fields in a dielectric, 497–498 Gauss’s theorem, 79–80, 100 gecko, 510 generator, electric, 370 germanium, 202 conductivity of, 195 crystal structure of, 200 resistivity of, 188 Gilbert, William, 236 Goihbarg, E., 452, 464 golden ratio, 49, 168, 231, 665 Goldhaber, A. S., 11 Good, R. H., 157, 639, 640 gradient, 63–65, 792–795 graphite anisotropic conductivity of, 183 diamagnetism of, 546 gravitation, 3, 10, 28, 39, 163 gravitational field and Gauss’s law, 25 Gray, Stephen, 125 Griffiths, D. J., 298, 640 ground-fault circuit interrupter (GFCI), 371 gyromagnetic ratio, 541 H, magnetic field, 560–565 and B, and M inside magnetized cylinder, 565 relation to free current, 560, 561 H2 O molecule, dipole moment of, 483 hadron, 6
Hall, E. H., 317 Hall effect, 314–317 hard disk, 571 harmonic functions, 87, 152 harmonic oscillator, 389 HCl (hydrogen chloride) molecule, dipole moment of, 482, 483 Heald, M. A., 298 helical coil, magnetic field of, 302 helicopters, static charge on, 102 helium atom, neutrality of, 241 helix, handedness of, 279 Henry, Joseph, 361 henry (SI unit of inductance), 361 Hertz, Heinrich, 236, 281, 314, 394 hertz (unit of frequency), 394 Hill, H. A., 11 hole, 201 Hughes, V. W., 5 hybrid car, 371 hydrogen atom charge distribution in, 479 polarizability of, 481 hydrogen chloride molecule, dipole moment of, 482, 483 hydrogen ions, 189 hydrogen molecule, 5, 242 hydrogen negative ion, 328 hyperbolic functions, 830 hysteresis, magnetic, 569 ice, dielectric constant of, 505 ignition system coil, 372 image charge, 136–140 for a spherical shell, 159 impedance, 408–414 index of refraction, 509 inductance mutual, 359–364 reciprocity theorem for, 362–364 self-, 364–366 circuit containing, 366–367 induction electromagnetic, 343–357 Faraday’s law of, 356–357 inductive reactance, 396 insulators, electrical, 125–126 integral table, 826 internal resistance of electrolytic cell, 210
Index
interstellar magnetic field, 286, 386 invariance of charge, 241–243 distinguished from charge conservation, 242 evidence for, 241 ionic crystal, energy of, 14–16 ions, 189–198 in air, 190 in gases, 190 in water, 189–190 iron, B-H curve for, 569 Jackson, J. D., 189, 452 Jefimenko, O., 188 junction, silicon diode, 229 junkyard magnet, 321 Karlsruhe, University of, 394 King, J. G., 5 Kirchhoff’s loop rule, 207, 359 Kirchhoff’s rules, 206, 212 Laplace’s equation, 86–88, 132–134 Laplacian operator, 85–86, 799–801 lead superconductivity of, 197 resistivity of, 197 lead–sulfuric acid cell, 209–212 Leighton, R. B., 37, 539 Lenz’s law, 351 Leyden jar, 516 Li, Y., 640 Liénard–Wiechert potential, 707 light, velocity of, definition of, 789 light-emitting diode, 220 lightning, 37 lightning rod, 153 line charge density, 28 line integral of electric field, 59–61 of magnetic field, 287–291 linear dielectric, 490 linear physical system, 148 liquid oxygen, paramagnetism of, 525, 526, 548 lodestone (magnetite), 236, 526, 527, 565, 570 long straight wire, magnetic field of, 280 loop of a network, 207 Lorentz, H. A., 2, 236
Lorentz contraction, 261, 807 Lorentz force, 278 Lorentz invariants, 465, 811 Lorentz transformation applications of, 247–248, 255–257 of electric and magnetic field components, 310 of force components, 810–811 of momentum and energy, 810 of space-time coordinates, 806 LR circuits, 366–367 time constant of, 367 μ0 , permeability of free space, 281 M, magnetization, 550 and B, and H inside magnetized cylinder, 565 macroscopic description of matter, 470 macroscopic electric field in matter, 488–489 maglev train, 321 magnetic bottle, 318 magnetic charge, absence of, 529 magnetic dipole field of, 534–535 compared with electric dipole field, 535 force on, 535–539 torque on, 547 vector potential of, 531–534 magnetic dipole moment of current loop, 534 of electron orbit, 540–541 associated with electron spin, 547 magnetic domains, 567 magnetic field, 238, 278, see also earth’s magnetic field of current loop, 531–535 of current ring, 299 of current sheet, 303–304 of Earth, 373 energy stored in, 368–369 of helical coil, 302 interstellar, 386 line integral of, 287–291 of long straight wire, 280 of solenoid (coil), 300–303, 338 transformation of, 310 magnetic field B, see B, magnetic field magnetic field H, see H, magnetic field magnetic flux, 348–350
837
magnetic forces, 237–239 magnetic monopole, 529 magnetic permeability μ, 563 magnetic polarizability of electron orbit, 544 magnetic pressure, 306 magnetic susceptibility χm , 550, 563 magnetite (lodestone), 236, 526, 527, 565, 570 magnetization M, see M, magnetization magnetogyric ratio, 541 magnetohydrodynamics, 306 magnetomechanical ratio, orbital, 541 magnetron, 419 Mania, A. J., 263 Marcus, A., 188 mass spectrometer, 317 Maxwell, James Clerk, 2, 11, 141, 236, 436 Maxwell’s equations, 436–438 Mermin, N. D., 237 metal detector, 370 methane, structure and polarizability of, 481 methanol molecule, dipole moment of, 483 method of images, see image charge microphone condenser, 154 dynamic, 371 microscopic description of matter, 470 microscopic electric field in matter, 488 microwave background radiation, 454 microwave oven, 419, 510 mine-shaft problem, 601 moments of charge distribution, 74, 471–474 momentum, see angular momentum motor, electric, 319 moving charge force on, 255–267, 278 interaction with other moving charges, 259–267 measurement of, 239–240 multipole expansion, 74, 472 muon, trajectory in magnetized iron, 582 mutual inductance, 359–364 reciprocity theorem for, 362–364 Nan-Xian, C., 643 network alternating current, 405–414 bridge, 208, 233 direct-current, 205–207 ladder, 231
838
neurons, 102 neutron, 3, 6 Newton, Isaac, 27 NH3 (ammonia) molecule, dipole moment of, 483 nickel, Curie point of, 566 nickel sulfate, paramagnetism of, 526 Nieto, M. M., 11 niobium, 819 nitric oxide, paramagnetism of, 548 node of a network, 207 north pole, definition of, 280, 529 n-type semiconductor, 203–204 nuclear magnetic resonance (NMR), 823 nucleon, 39 nucleus, atomic, 3 octupole moment, 74, 473 O’Dell, S. L., 546 Oersted, Hans Christian, 236–237, 259, 331 oersted (unit of field H), 775 ohm (SI unit of resistance), 186 ohmmeter, 232 Ohm’s law, 181–183, 193 breakdown of, 198 deviations from, in metals, 200 Onnes, H. K., 817 orbital magnetic moment, 540–541 oscillator, harmonic, 389 oxygen, negative molecular ion, 190 Page, L., 237 paint sprayer, electrostatic, 37 pair creation, 4 parallel currents, force between, 283 Parallel-plate capacitor, 144 filled with dielectric, 467, 489–492 parallel RLC circuit, 410 paramagnetic substances, 526 paramagnetism, 527, 540, 548 partial derivative, definition of, 64 permanent magnet, field of, 557–559 permeability, magnetic, μ, 563 permittivity, , 497 pH value of hydrogen ion concentration, 189 phase angle in alternating-current circuit, 402, 404, 409
Index
phosphorous, doping of silicon with, 203 photocopiers, 37 photon, 4, 460 photovoltaic effect, 220 picofarad (unit of capacitance), 142 piezoelectric effect, 511 pion, 34 Planck, Max, 2 Planck’s constant h, 546 p–n junction, 219 point charge, 21 accelerated, radiation by, 812–815 moving with constant velocity, 247–251 near conducting disk, 139 starting or stopping, 251–255 Poisson’s equation, 86, 89 polar molecules, dipole moments of, 483 polarizability magnetic, of electron orbit, 544 of various atoms, 481–482 polarization, frequency dependence of, 504 polarization density P, 484, 498, 501, 503 polarized matter, 483–489 polarized sphere, electric field of, 492–495 pollination, by bees, 509 positron, 3 potential coefficients of, 148 electric, φ, 61–73, 86–89 of charged disk, 69 of charged wire, 67 derivation of field from, 65 of electric dipole, 73–74, 475 of two point charges, 66 vector, 293–296 of current loop, 531–534 potential energy, electrical, 13–16 of a system of charges, 33, 63 power in alternating-current circuit, 415–418 dissipated in resistor, 208 radiated by accelerated charge, 814 power adapter, 420 power-factor correction, 420 Poynting vector, 448–452 precession of magnetic top, 821, 822
Press, F., 380 Priestly, Joseph, 10 proton, 3 decay of, 6 and electron charge equality, 5 magnetic moment of, 822 p-type semiconductor, 203–204 Q, of resonant circuit, 392, 402 quadrupole moment, 74, 473 tensor, 514 quantization of charge, 5–7, 242 quantum electrodynamics, 2 quark, 6, 35 quartz clock, 511 radiation by accelerated charge, 812–815 radio frequency identification (RFID) tags, 454 railgun, 319 random fluctuations of current, 195 range of electromagnetic force, 11 rare-earth magnets, 573 rationalized units, 767 RC circuit, 215–216 time constant of, 216 reactance, inductive, 396 reciprocity theorem for mutual inductance, 362–364 recombination of ions, 190 refractive index, 509 regenerative braking, 371 relaxation method, 153, 174 relaxation of field in conductor, 217 relaxation time, 217 relay, electric, 320 remanence, magnetic, 569 resistance, electrical, 183–187 resistances in parallel and in series, 206 resistivity, 186 of various materials, 188, 196 resistor, 205, 207 resonance, 418 resonant circuit, 388–394 damping of, 391–394 critical, 394 energy transfer in, 392 resonant frequency, 400 retarded potential, 329 Roberts, D., 211
Index
Rodrigues, W. A. Jr., 263 Romer, R. H., 359 Rowland, Henry, 259, 314, 315, 317 Rowland’s experiment, 315 RLC circuit parallel, 410 series, 389, 398 Sands, M., 37, 539 saturation magnetization, 565 scalar product of two vectors, 12 Scott, G. K., 305 seawater, resistivity of, 188, 190, 196 second (as Gaussian unit of resistivity), 187 self-energy of elementary particles, 35 self-inductance, 364–366 circuit containing, 366–367 semiconductors, 126, 195, 200–204 n-type, 203–204 p-type, 203, 204 Semon, M. D., 296 series RLC circuit, 389, 398 shake flashlight, 370 sheets of charge, moving, electric field of, 243–245 shielding, electrical, 135 SI units, 762–768 derived, 769 Siever, R., 380 silicon, 195, 200–204 band gap in, 201 crystal structure of, 200 slope detection, 455 smoke detector, 219 Smyth, C. P., 505 sodium and chlorine ions in water, 190 sodium chloride crystal diamagnetism of, 526 electrical potential energy of, 14–16 free and bound charge in, 507 sodium metal, conductivity of, 198–199 solar cells, 220 solenoid (coil), magnetic field of, 300–303, 338 speakers, 321 spherical coordinates, 792 spin of electron, 546–549
sprites, 219 St. Elmo’s fire, 37 standing wave, electromagnetic, 442–446 Starfish Prime, 318 statvolt (Gaussian unit of electric potential), 61 Stokes’ theorem, 92–93, 100 storage battery, lead-sulfuric acid, 209–212 supercapacitor, 154 superconductivity, 197, 817–820 superposition, principle of, 10 applications of, 25, 147, 207, 245, 301, 442, 490, 492 surface charge on current-carrying wire, 188–189, 263, 452 density, 129 distribution, 29 surface current density, 303 surface integral, definition of, 23 surfaces, equipotential, see equipotential surfaces surfactant, 510 susceptibility electric χe , 490, 501, 503 magnetic χm , 550, 563 symmetry argument, 21 synchrotron radiation, 815
839
transistor, 220 triboelectric effect, 36 trigonometric identities, 829 uniqueness theorem, 132–133 units, SI and Gaussian, 762–768 conversions, 774–777, 789–790 formulas, 778–788 vacuum capacitor, 467 valence band, 201–204 valence electrons, 200 Van Allen belts, 318 Van de Graaff generator, 182, 209, 211 van der Waals force, 510 Varney, R. N., 348 vector identities, 827 vector potential, 293–296 of current loop, 531–534 vector product (cross product) of two vectors, 238 volt (SI unit of electric potential), 61 Volta, Alessandro, 209, 236 Voltaic cell, 209 equivalent circuit for, 211 voltmeter, 224 Waage, H. M., 530
Taylor, J. R., 296 Taylor series, 827–828 television set, 318 temperature, effect of on alignment of electron spins, 548–549 on alignment of polar molecules, 503 on conductivity, 195–197 Tesla, Nikola, 286, 419 tesla (SI unit of magnetic field strength), 280 Thévenin’s theorem, 213–215, 225 three-phase power, 419 torque on current loop, 332, 547 on electric dipole, 477, 478 transatlantic telegraph, 227 transatlantic telegraph cable, 217 transformation, see Lorentz transformation transformer, 372
Walker, J., 35 War of Currents, 419 water dielectric constant of, 505 ions in, 189–190 pure, resistivity of, 188, 196 water molecule, dipole moment of, 483 watt (SI unit of power), 208 wave, electromagnetic, see electromagnetic wave weber (SI unit of magnetic flux), 357 Whittaker, E., 500 Williams, E. R., 11 wire charged, potential of, 67 magnetic field of, 280 work, by magnetic force, 572 Zia, R. K. P., 546
Derived units
Maxwell’s equations
kg m newton (N) = 2 s
∂B ∂t ∂E curl B = μ0 0 + μ0 J ∂t ρ div E = 0 div B = 0 curl E = −
joule (J) = newton-meter = ampere (A) =
kg m2 s2
coulomb C = second s
volt (V) =
joule kg m2 = coulomb C s2
farad (F) =
coulomb C2 s2 = volt kg m2
ohm () =
volt kg m2 = 2 ampere C s
joule kg m2 = second s3 newton kg tesla (T) = = coulomb · meter/second Cs
watt (W) =
henry (H) =
volt kg m2 = ampere/second C2
Fundamental constants
Divergence theorem
speed of light
c
2.998 · 108
elementary charge
e
1.602 · 10−19 C
m/s
F · da = surface
4.803 · 10−10 esu
div F dv volume
electron mass
me
9.109 · 10−31 kg
proton mass
mp
1.673 · 10−27 kg
Avogadro’s number
NA
6.022 · 10−23
Boltzmann constant
k
1.381 · 10−23 J/K
Planck constant
h
6.626 · 10−34 J s
gravitational constant
G
6.674 · 10−11 m3 /(kg s2 )
Gradient theorem
electron magnetic moment
μe
9.285 · 10−24 J/T
φ 2 − φ1 =
proton magnetic moment
μp
1.411 · 10−26 J/T
permittivity of free space
0
8.854 · 10−12 C2 s2 /(kg m3 )
permeability of free space
μ0
1.257 · 10−6 kg m/C2
mole
Stokes’ theorem
−1
A · ds = curve
curl A · da surface
grad φ · ds curve
Vector operators Cartesian coordinates ds = dx xˆ + dy yˆ + dz zˆ ∂ ∂ ∂ + yˆ + zˆ ∂x ∂y ∂z
∇ = xˆ ∇f =
∂f ∂f ∂f xˆ + yˆ + zˆ ∂x ∂y ∂z
∂Ay ∂Az ∂Ax + + ∂x ∂y ∂z ∂Ay ∂Ay ∂Az ∂Ax ∂Az ∂Ax ∇ ×A= − xˆ + − yˆ + − zˆ ∂y ∂z ∂z ∂x ∂x ∂y ∇ ·A=
∇2f =
∂ 2f ∂ 2f ∂ 2f + 2 + 2 ∂x2 ∂y ∂z
Cylindrical coordinates ds = dr rˆ + r dθ θˆ + dz zˆ ∇ = rˆ ∇f =
∂ 1 ∂ ∂ + θˆ + zˆ ∂r r ∂θ ∂z
∂f 1 ∂f ˆ ∂f rˆ + θ+ zˆ ∂r r ∂θ ∂z
1 ∂(rAr ) 1 ∂Aθ ∂Az + + r ∂r r ∂θ ∂z 1 ∂Az ∂Ar ∂Aθ ∂Az ˆ 1 ∂(rAθ ) ∂Ar ∇ ×A= − rˆ + − θ+ − zˆ r ∂θ ∂z ∂z ∂r r ∂r ∂θ 1 ∂ ∂ 2f ∂f 1 ∂ 2f r + 2 2 + 2 ∇2f = r ∂r ∂r r ∂θ ∂z ∇ ·A=
Spherical coordinates ds = dr rˆ + r dθ θˆ + r sin θ dφ φˆ ∇ = rˆ ∇f =
∂ 1 ∂ 1 ∂ + θˆ + φˆ ∂r r ∂θ r sin θ ∂φ
∂f 1 ∂f ˆ 1 ∂f ˆ rˆ + θ+ φ ∂r r ∂θ r sin θ ∂φ
1 ∂(Aθ sin θ ) 1 ∂Aφ 1 ∂(r2 Ar ) + + ∇ ·A= 2 ∂r r sin θ ∂θ r sin θ ∂φ r ∂(Aφ sin θ ) ∂(rAφ ) 1 ∂Ar 1 ∂Aθ 1 1 ∂(rAθ ) ∂Ar ˆ ∇ ×A= − rˆ + − θˆ + − φ r sin θ ∂θ ∂φ r sin θ ∂φ ∂r r ∂r ∂θ ∂f ∂ 2f ∂ 1 ∂ 1 ∂f 1 r2 + 2 sin θ + ∇2f = 2 2 ∂r ∂θ r ∂r r sin θ ∂θ r2 sin θ ∂φ 2
Electricity and magnetism purcell 01 100 conif
Electricity and magnetism purcell 01 100 conif
Advertisement
|
__label__pos
| 0.861058 |
O'Reilly logo
Stay ahead with the world's most comprehensive technology and business learning platform.
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.
Start Free Trial
No credit card required
Developing and Applying Optoelectronics in Machine Vision
Book Description
Sensor technologies play a large part in modern life as they are present in security systems, digital cameras, smartphones, and motion sensors. While these devices are always evolving, research is being done to further develop this technology to help detect and analyze threats, perform in-depth inspections, and perform tracking services. Developing and Applying Optoelectronics in Machine Vision evaluates emergent research and theoretical concepts in scanning devices and 3D reconstruction technologies being used to measure their environment. Examining the development of the utilization of machine vision practices and research, optoelectronic devices, and sensor technologies, this book is ideally suited for academics, researchers, students, engineers, and technology developers.
Table of Contents
1. Cover
2. Title Page
3. Copyright Page
4. Book Series
1. Mission
2. Coverage
5. Editorial Advisory Board
6. List of Reviewers
7. Preface
1. HISTORY
2. IMPORTANCE OF OPTOELECTRONIC DEVICES AND MACHINE VISION
3. IMPACT OF THE BOOK
4. ORGANIZATION OF THE BOOK
8. Introduction
1. 3D OPTOELECTRONIC SCANNING TECHNOLOGIES
2. MACHINE VISION
3. TRENDS OF OPTOELECTRONIC SYSTEMS AND MACHINE VISION
4. SCOPE OF THE BOOK
5. REFERENCES
9. Chapter 1: Applying Optoelectronic Devices Fusion in Machine Vision
1. ABSTRACT
2. INTRODUCTION
3. BACKGROUND
4. OPTOELECTRONIC SENSORS FUSION IN MACHINE VISION
5. MACHINE VISION FOR SPATIAL COORDINATE MEASUREMENT
6. EXPERIMENTAL RESULTS
7. CONCLUSION
8. REFERENCES
10. Chapter 2: CMOS Image Sensor
1. ABSTRACT
2. INTRODUCTION
3. REVIEW OF THE STATE OF THE ART OF CMOS IMAGE SENSOR
4. SIMPLE ANALOG AND MIXED-SIGNAL CIRCUITS FOR CIS
5. FUTURE RESEARCH DIRECTION
6. CONCLUSION
7. REFERENCES
11. Chapter 3: Automated Visual Inspection System for Printed Circuit Boards for Small Series Production
1. ABSTRACT
2. INTRODUCTION
3. VISUAL SMD INSPECTION SYSTEM AND COMMUNICATION PROTOCOL BETWEEN AGENT AND MACHINE
4. FUTURE RESEARCH DIRECTIONS
5. CONCLUSION
6. REFERENCES
7. KEY TERMS AND DEFINITIONS
12. Chapter 4: Laser Scanners
1. ABSTRACT
2. INTRODUCTION
3. REFERENCES
13. Chapter 5: Machine Vision Application on Science and Industry
1. ABSTRACT
2. INTRODUCTION
3. DESIGN OF FACE SENSING AND RECOGNITION SYSTEMS
4. FUTURE RESEARCH DIRECTIONS
5. CONCLUSION
6. ACKNOWLEDGMENT
7. REFERENCES
14. Chapter 6: Theoretical Methods of Images Processing in Optoelectronic Systems
1. ABSTRACT
2. 1. PURPOSE AND METHODS OF IMPROVING OPTOELECTRONIC SYSTEMS
3. 2. FORMATION OF IMAGES IN OPTOELECTRONIC SYSTEMS
4. 3. STATISTICAL PROPERTIES OF SIGNALS IN OPTOELECTRONIC SYSTEMS
5. 4. IMAGE PROCESSING IN OPTOELECTRONIC SYSTEMS
6. 5. CONCLUSION
7. REFERENCES
15. Chapter 7: Machine Vision Optical Scanners for Landslide Monitoring
1. ABSTRACT
2. INTRODUCTION
3. 1. BACKGROUND
4. 2. OPTOELECTRONIC DEVICES FOR LANDSLIDE MONITORING
5. 3. TYPICAL OPTOELECTRONIC SCANNERS
6. 4. INCOHERENT VS. COHERENT LIGHT IN SCANNERS FOR LANDSLIDE MONITORING
7. 5. A NEW APPROACH BASED IN OPTICAL SCANNERS
8. 6. FUTURE RESEARCH DIRECTIONS
9. 7. CONCLUSION
10. REFERENCES
16. Chapter 8: 3D Imaging Systems for Agricultural Applications
1. ABSTRACT
2. INTRODUCTION
3. 3D USE FOR CROP CHARACTERIZATION
4. 3D USE FOR ROOT PHENOTYPING
5. FUTURE RESEARCH DIRECTIONS
6. CONCLUSION
7. REFERENCES
8. KEY TERMS AND DEFINITIONS
17. Chapter 9: Analysis of New Opotoelectronic Device for Detection of Heavy Metals in Corroded Soils
1. ABSTRACT
2. INTRODUCTION
3. INTRODUCTION
4. METHODOLOGY
5. RESULTS
6. DISCUSSION OF THE RESULTS
7. CONCLUSION
8. ACKNOWLEDGMENT
9. REFERENCES
18. Compilation of References
19. About the Contributors
|
__label__pos
| 0.817067 |
#!/usr/bin/perl -wT # # EMULAB-COPYRIGHT # Copyright (c) 2008-2009 University of Utah and the Flux Group. # All rights reserved. # package GeniCM; # # The server side of the CM interface on remote sites. Also communicates # with the GMC interface at Geni Central as a client. # use strict; use Exporter; use vars qw(@ISA @EXPORT); @ISA = "Exporter"; @EXPORT = qw ( ); # Must come after package declaration! use lib '@prefix@/lib'; use GeniDB; use Genixmlrpc; use GeniResponse; use GeniTicket; use GeniCredential; use GeniCertificate; use GeniSlice; use GeniAggregate; use GeniAuthority; use GeniSliver; use GeniUser; use GeniRegistry; use libtestbed; # Hate to import all this crap; need a utility library. use libdb qw(TBGetUniqueIndex TBcheck_dbslot TBGetSiteVar TBDB_CHECKDBSLOT_ERROR); use User; use Node; use libadminctrl; use Interface; use English; use Data::Dumper; use XML::Simple; use Date::Parse; use POSIX qw(strftime); use Time::Local; use Experiment; use Firewall; # Configure variables my $TB = "@prefix@"; my $TBOPS = "@TBOPSEMAIL@"; my $TBAPPROVAL = "@TBAPPROVALEMAIL@"; my $TBAUDIT = "@TBAUDITEMAIL@"; my $BOSSNODE = "@BOSSNODE@"; my $OURDOMAIN = "@OURDOMAIN@"; my $CREATEEXPT = "$TB/bin/batchexp"; my $ENDEXPT = "$TB/bin/endexp"; my $NALLOC = "$TB/bin/nalloc"; my $NFREE = "$TB/bin/nfree"; my $AVAIL = "$TB/sbin/avail"; my $PTOPGEN = "$TB/libexec/ptopgen"; my $TBSWAP = "$TB/bin/tbswap"; my $SWAPEXP = "$TB/bin/swapexp"; my $PLABSLICE = "$TB/sbin/plabslicewrapper"; my $NAMEDSETUP = "$TB/sbin/named_setup"; my $VNODESETUP = "$TB/sbin/vnode_setup"; my $GENTOPOFILE = "$TB/libexec/gentopofile"; # # Respond to a Resolve request. # sub Resolve($) { my ($argref) = @_; my $uuid = $argref->{'uuid'}; my $cred = $argref->{'credential'}; my $type = $argref->{'type'}; my $hrn; if (! defined($cred)) { return GeniResponse->MalformedArgsResponse(); } if (! (defined($type) && ($type =~ /^(Node)$/))) { return GeniResponse->MalformedArgsResponse(); } # Allow lookup by uuid or hrn. if (! defined($uuid)) { return GeniResponse->MalformedArgsResponse(); } if (defined($uuid) && !($uuid =~ /^[-\w]*$/)) { return GeniResponse->MalformedArgsResponse(); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } # # Make sure the credential was issued to the caller, but no special # permission required to resolve component resources. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } if ($type eq "Node") { my $node; if (defined($uuid)) { $node= Node->Lookup($uuid); } else { # # We only want the last token for node lookup. # if ($hrn =~ /\./) { ($hrn) = ($hrn =~ /\.(\w*)$/); } $node= Node->Lookup($hrn); } if (!defined($node)) { return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, "Nothing here by that name"); } # Return a blob. my $blob = { "hrn" => "${OURDOMAIN}." . $node->node_id(), "uuid" => $node->uuid(), "role" => $node->role(), }; # # Get the list of interfaces for the node. # my @interfaces; if ($node->AllInterfaces(\@interfaces) != 0) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not get interfaces for $uuid"); } my @iblobs = (); foreach my $interface (@interfaces) { next if (!defined($interface->switch_id())); my $iblob = { "uuid" => $interface->uuid(), "iface" => $interface->iface(), "type" => $interface->type(), "card" => $interface->card(), "port" => $interface->port(), "role" => $interface->role(), "IP" => $interface->IP() || "", "mask" => $interface->mask() || "", "MAC" => $interface->mac(), "switch_id" => "${OURDOMAIN}." . $interface->switch_id(), "switch_card" => $interface->switch_card(), "switch_port" => $interface->switch_port(), "wire_type" => $interface->wire_type(), }; push(@iblobs, $iblob); } $blob->{'interfaces'} = \@iblobs if (@iblobs); return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob); } return GeniResponse->Create(GENIRESPONSE_UNSUPPORTED); } # # Discover resources on this component, returning a resource availablity spec # sub DiscoverResources($) { my ($argref) = @_; my $credential = $argref->{'credential'}; my $user_uuid = $ENV{'GENIUSER'}; $credential = GeniCredential->CreateFromSigned($credential); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } # The credential owner/slice has to match what was provided. if ($user_uuid ne $credential->owner_uuid()) { return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "Invalid credentials for operation"); } # # A sitevar controls whether external users can get any nodes. # my $allow_externalusers = 0; if (!TBGetSiteVar('protogeni/allow_externalusers', \$allow_externalusers)){ # Cannot get the value, say no. $allow_externalusers = 0; } if (!$allow_externalusers) { my $user = GeniUser->Lookup($user_uuid, 1); # No record means the user is remote. if (!defined($user) || !$user->IsLocal()) { return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "External users temporarily denied"); } } # # Use ptopgen in xml mode to spit back an xml file. # if (! open(AVAIL, "$PTOPGEN -x -g -r -p GeniSlices |")) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not start avail"); } my $xml = ""; while () { $xml .= $_; } close(AVAIL); return GeniResponse->Create(GENIRESPONSE_SUCCESS, $xml); } # # Respond to a GetTicket request. # sub GetTicket($) { my ($argref) = @_; my $rspec = $argref->{'rspec'}; my $impotent = $argref->{'impotent'}; my $cred = $argref->{'credential'}; my $vtopo = $argref->{'virtual_topology'}; my $owner_uuid = $ENV{'GENIUSER'}; my $response = undef; if (! defined($cred)) { return GeniResponse->MalformedArgsResponse(); } if (! (defined($rspec) && ($rspec =~ /^[-\w]+$/))) { GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Improper rspec"); } $rspec = XMLin($rspec, ForceArray => ["node", "link", "linkendpoints"]); $impotent = 0 if (!defined($impotent)); my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # Create slice form the certificate. # my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { $slice = CreateSliceFromCertificate($credential); if (!defined($slice)) { print STDERR "Could not create $slice_uuid\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create slice"); } } # # Ditto the user. # my $user = GeniUser->Lookup($user_uuid); if (!defined($user)) { $user = CreateUserFromCertificate($credential->owner_cert()); if (!defined($user)) { print STDERR "No user $user_uuid in the ClearingHouse\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not get user info from ClearingHouse"); } } # # A sitevar controls whether external users can get any nodes. # my $allow_externalusers = 0; if (!TBGetSiteVar('protogeni/allow_externalusers', \$allow_externalusers)){ # Cannot get the value, say no. $allow_externalusers = 0; } if (!$allow_externalusers && !$user->IsLocal()) { return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "External users temporarily denied"); } # # For now all tickets expire very quickly (minutes), but once the # ticket is redeemed, it will expire according to the rspec request. # if (exists($rspec->{'valid_until'})) { my $expires = $rspec->{'valid_until'}; if (! ($expires =~ /^[-\w:.\/]+/)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Illegal valid_until in rspec"); } # Convert to a localtime. my $when = timegm(strptime($expires)); if (!defined($when)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Could not parse valid_until"); } # # No more then 24 hours out ... Needs to be a sitevar? # my $diff = $when - time(); if ($diff < (60 * 15) || $diff > (3600 * 24)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "valid_until out of range"); } } else { # Give it a reasonable default for later when the ticket is redeemed. $rspec->{'valid_until'} = POSIX::strftime("20%y-%m-%dT%H:%M:%S", gmtime(time() + (3600*1))); } # # # Lock the slice from further access. # if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # Shutdown slices get nothing. if ($slice->shutdown()) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "Slice has been shutdown"); } # # For now, there can be only a single toplevel aggregate per slice. # The existence of an aggregate means the slice is active here. # my $aggregate = GeniAggregate->SliceAggregate($slice); if (defined($aggregate)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Already have an aggregate for slice"); } # # Say a ticket already exists in the DB? Lets throw that ticket # away and generate a new one. This is partly a debugging # mechanism. To really do this correctly, would want to merge in # the existing resources with the new rspec request. Do not # want to go there yet. # my $existing_ticket = GeniTicket->LookupForSlice($slice); if (defined($existing_ticket)) { print STDERR "Releasing existing ticket $existing_ticket\n"; if ($existing_ticket->Release() != 0) { print STDERR "Error releasing existing ticket $existing_ticket\n"; $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } } # # Firewall hack; just a flag in the rspec for now. # if (exists($rspec->{'needsfirewall'}) && $rspec->{'needsfirewall'}) { print STDERR "firewall: " . $rspec->{'needsfirewall'} . "\n"; if ($slice->SetFirewallFlag($rspec->{'needsfirewall'}) != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } } my $experiment = GeniExperiment($slice); if (!defined($experiment)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Internal Error"); } # # An rspec is a structure that requests specific nodes. If those # nodes are available, then reserve it. Otherwise the ticket # cannot be granted. # # XXX Simpleminded. # my %namemap = (); my %uuidmap = (); my @nodeids = (); my @dealloc; my $pid = $experiment->pid(); my $eid = $experiment->eid(); foreach my $ref (@{$rspec->{'node'}}) { my $resource_uuid = $ref->{'uuid'}; my $node_nickname = $ref->{'nickname'}; my $virtualization_type = $ref->{'virtualization_type'}; my $node; # # Mostly for debugging right now, allow a wildcard. # if ($resource_uuid eq "*") { $node = FindFreeNode($virtualization_type, @nodeids); if (!defined($node)) { $response = GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "No free nodes for wildcard"); goto bad; } $resource_uuid = $node->uuid(); $ref->{'uuid'} = $node->uuid(); } else { $node = Node->Lookup($resource_uuid); if (!defined($node)) { $response = GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Bad resource $resource_uuid"); goto bad; } } # # Widearea nodes do not need to be allocated, but for now all # I allow is a plabdslice node. # if ($node->isremotenode()) { if (! $node->isplabphysnode()) { $response = GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Only plab widearea nodes"); goto bad; } next; } # # See if the node is already reserved. # my $reservation = $node->Reservation(); if (defined($reservation)) { $response = GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "$resource_uuid ($node) not available"); goto bad; } push(@nodeids, $node->node_id()); $uuidmap{$resource_uuid} = $node; # For wildcarded nodes in links. $namemap{$node_nickname} = $node if (defined($node_nickname)); } # # A sitevar controls how many total nodes external users can allocate. # # XXX All this policy stuff is a whack job for the initial release. # my $max_externalnodes = 0; if (!TBGetSiteVar('protogeni/max_externalnodes', \$max_externalnodes)){ # Cannot get the value, say none. $max_externalnodes = 0; } if (scalar(@nodeids) > $max_externalnodes) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "Too many nodes; limited to $max_externalnodes"); } # Check current usage by dipping into the libadminctrl library. my $curusage = libadminctrl::LoadCurrent($experiment->creator(), $experiment->pid(), $experiment->gid()); if (!defined($curusage)) { $slice->UnLock(); print STDERR "Could not get current usage from adminctl library\n"; return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "Temporarily unavailable"); } if ($curusage->{"nodes"}->{'project'} + scalar(@nodeids) >= $max_externalnodes) { $slice->UnLock(); my $nodesleft = $max_externalnodes - $curusage->{"nodes"}->{'project'}; return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "Too many nodes; limited to $nodesleft"); } # Nalloc might fail if the node gets picked up by someone else. if (@nodeids && !$impotent) { system("$NALLOC $pid $eid @nodeids"); if (($? >> 8) < 0) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Allocation failure"); goto bad; } elsif (($? >> 8) > 0) { $response = GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "Could not allocate node"); goto bad; } # In case the code below fails, before ticket is created. @dealloc = @nodeids; } # # Now deal with links for wildcarded nodes. We need to fill in the # node_uuid. # foreach my $linkname (keys(%{$rspec->{'link'}})) { my $linkref = $rspec->{'link'}->{$linkname}; foreach my $ref (@{$linkref->{'linkendpoints'}}) { my $node_uuid = $ref->{'node_uuid'}; my $node_nickname = $ref->{'node_nickname'}; my $iface_name = $ref->{'iface_name'}; my $node; if ($node_uuid eq "*" && !defined($node_nickname)) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Need nickname for wildcarded link"); goto bad; } # XXX No wildcarding for tunnels. if (exists($linkref->{'link_type'}) && $linkref->{'link_type'} eq "tunnel") { if ($node_uuid eq "*") { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Tunnels cannot be wildcarded"); goto bad; } next; } # # First map the node if its wildcarded. # if ($node_uuid eq "*") { if (!exists($namemap{$node_nickname})) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not map wildcarded link"); goto bad; } $node = $namemap{$node_nickname}; $ref->{'node_uuid'} = $node->uuid(); } elsif (!exists($uuidmap{$node_uuid})) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not map link node"); goto bad; } else { $node = $uuidmap{$node_uuid}; } # # Now do wildcarded interfaces. # if ($iface_name eq "*") { my @interfaces; if ($node->AllInterfaces(\@interfaces) != 0) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not get interfaces for $node"); goto bad; } foreach my $interface (@interfaces) { next if (!defined($interface->switch_id())); next if ($interface->role() ne "expt"); $ref->{'iface_name'} = $interface->iface(); last; } } } } # # Create the ticket. # my $ticket = GeniTicket->Create($slice, $user, $rspec); if (!defined($ticket)) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniTicket object"); goto bad; } if ($ticket->Sign() != 0) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not sign Ticket"); goto bad; } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS, $ticket->asString()); bad: # Release will free the nodes. if (defined($ticket)) { $ticket->Release(); } elsif (@dealloc) { system("export NORELOAD=1; $NFREE -x -q $pid $eid @dealloc"); } $slice->UnLock() if (defined($slice)); return $response; } # # Create a sliver. # sub RedeemTicket($) { my ($argref) = @_; my $ticket = $argref->{'ticket'}; my $impotent = $argref->{'impotent'}; my $keys = $argref->{'keys'}; my $extraargs = $argref->{'extraargs'}; $impotent = 0 if (!defined($impotent)); if (! (defined($ticket) && !TBcheck_dbslot($ticket, "default", "text", TBDB_CHECKDBSLOT_ERROR))) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "ticket: ". TBFieldErrorString()); } $ticket = GeniTicket->CreateFromSignedTicket($ticket); if (!defined($ticket)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniTicket object"); } # # Make sure the credential was issued to the caller. # if ($ticket->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $slice = GeniSlice->Lookup($ticket->slice_uuid()); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # # Do not redeem an expired ticket, kill it now. # if ($ticket->Expired()) { $ticket->Release(); $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_EXPIRED, undef, "Ticket has expired"); } # Shutdown slices get nothing. if ($slice->shutdown()) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "Slice has been shutdown"); } # # For now, ther can be only a single toplevel aggregate per slice. # my $aggregate = GeniAggregate->SliceAggregate($slice); if (defined($aggregate)) { $ticket->Release(); $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Already have an aggregate for slice"); } my $response = ModifySliver(undef, $slice, $ticket, $ticket->rspec(), $impotent, $keys); $slice->UnLock(); return $response; } # # Update a sliver with a different resource set. # sub UpdateSliver($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $rspec = $argref->{'rspec'}; my $impotent = $argref->{'impotent'}; my $keys = $argref->{'keys'}; my $extraargs = $argref->{'extraargs'}; $impotent = 0 if (!defined($impotent)); if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } if (! (defined($rspec) && ($rspec =~ /^[-\w]+$/))) { GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Improper rspec"); } $rspec = XMLin($rspec, ForceArray => ["node", "link", "linkendpoints"]); my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $sliver_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $sliver = GeniSliver->Lookup($sliver_uuid); if (defined($sliver)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Only aggregates for now"); } my $aggregate = GeniAggregate->Lookup($sliver_uuid); if (!defined($aggregate)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such aggregate $sliver_uuid"); } my $slice = GeniSlice->Lookup($aggregate->slice_uuid()); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # Shutdown slices get nothing. if ($slice->shutdown()) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "Slice has been shutdown"); } my $response = ModifySliver($aggregate, $slice, $credential, $rspec, $impotent, $keys); $slice->UnLock(); return $response; } # # Utility function for above routines. # sub ModifySliver($$$$$$) { my ($object, $slice, $credential, $rspec, $impotent, $keys) = @_; my $owner_uuid = $credential->owner_uuid(); my $message = "Error creating sliver/aggregate"; my $aggregate; # # Create the user. # my $owner = GeniUser->Lookup($owner_uuid); if (!defined($owner)) { $owner = CreateUserFromCertificate($credential->owner_cert()); if (!defined($owner)) { print STDERR "No user $owner_uuid in the ClearingHouse\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No user record for $owner_uuid"); } } if (!$owner->IsLocal() && defined($keys)) { $owner->Modify(undef, undef, $keys); } my $experiment = GeniExperiment($slice); if (!defined($experiment)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No local experiment for slice"); } print STDERR Dumper($rspec); # # Figure out what nodes to allocate or free. # my %nodelist = (); my %linklist = (); my %toalloc = (); my @allocated= (); my @tofree = (); my $pid = $experiment->pid(); my $eid = $experiment->eid(); my $needplabslice = 0; my $didfwsetup = 0; # # Find current nodes and record their uuids. # if (defined($object)) { if ($object->type() ne "Aggregate") { return GeniResponse->Create(GENIRESPONSE_UNSUPPORTED, undef, "Only node aggregates allowed"); } my @slivers; if ($object->SliverList(\@slivers) != 0) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef); } foreach my $s (@slivers) { if (ref($s) eq "GeniSliver::Node") { $nodelist{$s->resource_uuid()} = $s; } elsif (ref($s) eq "GeniAggregate::Link" || ref($s) eq "GeniAggregate::Tunnel") { $linklist{$s->uuid()} = $s; } else { return GeniResponse->Create(GENIRESPONSE_UNSUPPORTED, undef, "Only nodes or links allowed"); } } } # # Figure out new expiration time; this is the time at which we can # idleswap the slice out. # if (exists($rspec->{'valid_until'})) { my $expires = $rspec->{'valid_until'}; if (! ($expires =~ /^[-\w:.\/]+/)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Illegal valid_until in rspec"); } # Convert to a localtime. my $when = timegm(strptime($expires)); if (!defined($when)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Could not parse valid_until"); } # # No more then 24 hours out ... Needs to be a sitevar? # my $diff = $when - time(); if ($diff < (60 * 15) || $diff > (3600 * 24)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "valid_until out of range"); } if ($slice->SetExpiration($when) != 0) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not set expiration time"); } } # # Figure out what nodes need to be allocated. # foreach my $ref (@{$rspec->{'node'}}) { my $resource_uuid = $ref->{'uuid'}; my $node = Node->Lookup($resource_uuid); if (!defined($node)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Bad resource_uuid $resource_uuid"); } # # Widearea nodes do not need to be allocated, but for now all # I allow is a plabdslice node. # if ($node->isremotenode()) { if (! $node->isplabphysnode()) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Only plab widearea nodes"); } $needplabslice = 1; next; } # # See if the node is already reserved. # my $reservation = $node->Reservation(); if (defined($reservation)) { # Reserved during previous operation on the sliver. next if ($reservation->SameExperiment($experiment)); return GeniResponse->Create(GENIRESPONSE_UNAVAILABLE, undef, "$resource_uuid ($node) is not available"); } # # Sanity check on the list of already allocated nodes. # foreach my $s (values(%nodelist)) { if ($resource_uuid eq $s->resource_uuid()) { print STDERR "$resource_uuid is not supposed to be allocated\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef); } } $toalloc{$resource_uuid} = $node->node_id(); } # # What nodes need to be released? # foreach my $s (values(%nodelist)) { my $node_uuid = $s->resource_uuid(); my $node = Node->Lookup($node_uuid); my $needfree = 1; foreach my $ref (@{$rspec->{'node'}}) { my $resource_uuid = $ref->{'uuid'}; if ($node_uuid eq $resource_uuid) { $needfree = 0; last; } } if ($needfree) { # # Not yet. # my @dlist; if ($s->DependentSlivers(\@dlist) != 0) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not get DependentSlivers"); } if (@dlist) { return GeniResponse->Create(GENIRESPONSE_REFUSED, undef, "Must tear down dependent slivers first"); } push(@tofree, $s); } } # # Create an emulab nonlocal user for tmcd. # $owner->BindToSlice($slice) == 0 or return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Error binding user to slice"); # Bind the other users too. # XXX Need to figure out where these come from. my @userbindings = (); foreach my $otheruuid (@userbindings) { my $otheruser = GeniUser->Lookup($otheruuid); if (!defined($otheruser)) { $otheruser = CreateUserFromCertificate($otheruuid); if (!defined($otheruser)) { print STDERR "No user $otheruser, cannot bind to slice\n"; next; } } if ($otheruser->BindToSlice($slice) != 0) { print STDERR "Could not bind $otheruser to $slice\n"; } } # # We are actually an Aggregate, so return an aggregate of slivers, # even if there is just one node. This makes sliceupdate easier. # if (defined($object)) { $aggregate = $object; } else { # # Form the hrn from the slicename. # my $hrn = "${OURDOMAIN}." . $slice->slicename(); $aggregate = GeniAggregate->Create($slice, $owner, "Aggregate", $hrn, $slice->hrn()); if (!defined($aggregate)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniAggregate object"); } } # Nalloc might fail if the node gets picked up by someone else. if (values(%toalloc) && !$impotent) { my @list = values(%toalloc); system("$NALLOC $pid $eid @list"); if ($?) { # Nothing to deallocate if this fails. %toalloc = undef; $message = "Allocation failure"; goto bad; } } # # We need to tear down links that are no longer in the rspec or # have changed. # foreach my $s (values(%linklist)) { if (! exists($rspec->{'link'}->{$s->hrn()})) { $s->UnProvision(); $s->Delete(); next; } my $delete = 0; my @interfaces = (); if ($s->SliverList(\@interfaces) != 0) { $message = "Failed to get sliverlist for $s"; goto bad; } foreach my $i (@interfaces) { my $node_uuid = $i->resource_uuid(); my $iface_name = $i->rspec()->{'iface_name'}; my $linkendpoints = $rspec->{'link'}->{$s->hrn()}->{'linkendpoints'}; } } # # Now for each resource (okay, node) in the ticket create a sliver and # add it to the aggregate. # my %slivers = (); my @plabnodes = (); foreach my $ref (@{$rspec->{'node'}}) { my $resource_uuid = $ref->{'uuid'}; # Already in the aggregate? next if (grep {$_ eq $resource_uuid} keys(%nodelist)); my $node = Node->Lookup($resource_uuid); if (!defined($node)) { $message = "Unknown resource_uuid in ticket: $resource_uuid"; goto bad; } my $sliver = GeniSliver::Node->Create($slice, $owner->uuid(), $resource_uuid, $ref); if (!defined($sliver)) { $message = "Could not create GeniSliver object for $resource_uuid"; goto bad; } $slivers{$resource_uuid} = $sliver; # # Remove this from %toalloc; if there is an error, the slivers are # deleted and the node released there. We only delete nodes that # have not turned into slivers yet. Ick. # delete($toalloc{$resource_uuid}); # Used below. push(@allocated, $node); # See below; setup all pnodes at once. if ($node->isremotenode()) { my $vnode = Node->Lookup($sliver->uuid()); if (!defined($vnode)) { print STDERR "Could not locate vnode $sliver\n"; goto bad; } push(@plabnodes, $vnode); } } # # Now do the links. For each link, we have to add a sliver for the # interfaces, and then combine those two interfaces into an aggregate, # and then that aggregate goes into the aggregate for toplevel sliver. # goto skiplinks if (!exists($rspec->{'link'})); foreach my $linkname (keys(%{$rspec->{'link'}})) { my @linkslivers = (); if (! ($linkname =~ /^[-\w]*$/)) { $message = "Bad name for link: $linkname"; goto bad; } my $linkref = $rspec->{'link'}->{$linkname}; # # XXX Tunnels are a total kludge right now ... # if (exists($linkref->{'link_type'}) && $linkref->{'link_type'} eq "tunnel") { my $node1ref = (@{$linkref->{'linkendpoints'}})[0]; my $node2ref = (@{$linkref->{'linkendpoints'}})[1]; my $node1sliver = $slivers{$node1ref->{'node_uuid'}} || $nodelist{$node1ref->{'node_uuid'}}; my $node2sliver = $slivers{$node2ref->{'node_uuid'}} || $nodelist{$node2ref->{'node_uuid'}}; my $tunnel = GeniAggregate::Tunnel->Create($slice, $owner, $node1sliver, $node2sliver, $linkref); if (!defined($tunnel)) { $message = "Could not create tunnel aggregate for $linkname"; goto bad; } $slivers{$tunnel->uuid()} = $tunnel; next; } my $linkaggregate = GeniAggregate::Link->Create($slice, $owner, $linkname); if (!defined($linkaggregate)) { $message = "Could not create link aggregate for $linkname"; goto bad; } $slivers{$linkaggregate->uuid()} = $linkaggregate; foreach my $ref (@{$rspec->{'link'}->{$linkname}->{'linkendpoints'}}) { my $node_uuid = $ref->{'node_uuid'}; my $iface_name = $ref->{'iface_name'}; my $nodesliver = $slivers{$node_uuid} || $nodelist{$node_uuid}; if (!defined($nodesliver)) { $message = "Link $linkname specifies a non-existent node"; goto bad; } my $nodeobject= Node->Lookup($node_uuid); if (!defined($nodeobject)) { $message = "Could not find node object for $node_uuid"; goto bad; } my $interface = Interface->LookupByIface($nodeobject, $iface_name); if (!defined($interface)) { $message = "No such interface $iface_name on node $nodeobject"; goto bad; } my $sliver = GeniSliver::Interface->Create($slice, $owner->uuid(), $interface->uuid(), $nodeobject, $ref); if (!defined($sliver)) { $message = "Could not create GeniSliver ". "$interface in $linkname"; goto bad; } if ($sliver->SetAggregate($linkaggregate) != 0) { $message = "Could not add link sliver $sliver to $aggregate"; goto bad; } } } skiplinks: # # Create a planetlab slice before provisioning (which creates nodes). # if ($needplabslice && !$impotent) { system("$PLABSLICE create $pid $eid"); if ($?) { $message = "Plab Slice creation failure"; goto bad; } } # # Now do the provisioning (note that we actually allocated the # node above when the ticket was granted). Then add the sliver to # the aggregate. # foreach my $sliver (values(%slivers)) { if (!$impotent && $sliver->Provision() != 0) { $message = "Could not provision $sliver"; goto bad; } if ($sliver->SetAggregate($aggregate) != 0) { $message = "Could not set aggregate for $sliver to $aggregate"; goto bad; } } # # We want to do this stuff only once, not for each node. # # Must have the topofile for node boot. Might need locking on this. if (system("$GENTOPOFILE $pid $eid")) { print STDERR "$GENTOPOFILE failed\n"; goto bad; } # The nodes will not boot locally unless there is a DNS record. if (system("$NAMEDSETUP")) { print STDERR "$NAMEDSETUP failed\n"; goto bad; } # Do firewall stuff. if ($slice->needsfirewall()) { my $experiment = $slice->GetExperiment(); my @node_ids = map { $_->node_id() } @allocated; if (@node_ids && doFWlans($experiment, FWADDNODES, \@node_ids) != 0) { print STDERR "FireWall setup failed\n"; goto bad; } $didfwsetup = 1; } # Set up plab nodes all at once. if ($needplabslice && @plabnodes && !$impotent) { my @node_ids = map { $_->node_id() } @plabnodes; system("$VNODESETUP -p -q -m $pid $eid @node_ids"); if ($?) { print STDERR "$VNODESETUP failed\n"; goto bad; } } # # The API states we return a credential to control the aggregate. # if (ref($credential) eq "GeniTicket") { my $ticket = $credential; $credential = $aggregate->NewCredential($owner); if (!defined($credential)) { $message = "Could not create credential"; goto bad; } # # The last step is to delete the ticket, since it is no longer needed. # and will cause less confusion if it is not in the DB. # if ($ticket->Delete() != 0) { print STDERR "Error deleting $ticket for $slice\n"; } return GeniResponse->Create(GENIRESPONSE_SUCCESS, $credential->asString()); } # # Free any slivers that were no longer wanted. # if (@tofree) { } return GeniResponse->Create(GENIRESPONSE_SUCCESS); bad: # Do firewall stuff. if ($slice->needsfirewall() && $didfwsetup) { my $experiment = $slice->GetExperiment(); my @node_ids = map { $_->node_id() } @allocated; if (@node_ids && doFWlans($experiment, FWDELNODES, \@node_ids) != 0) { print STDERR "FireWall cleanup failed\n"; } } foreach my $sliver (values(%slivers)) { $sliver->UnProvision() if (! $impotent); $sliver->Delete(); } if (values(%toalloc)) { my @list = values(%toalloc); system("export NORELOAD=1; $NFREE -x -q $pid $eid @list"); } $aggregate->Delete() if (defined($aggregate) && !defined($object)); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, $message); } # # Release a ticket. # sub ReleaseTicket($) { my ($argref) = @_; my $ticket = $argref->{'ticket'}; if (! (defined($ticket) && !TBcheck_dbslot($ticket, "default", "text", TBDB_CHECKDBSLOT_ERROR))) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "ticket: ". TBFieldErrorString()); } $ticket = GeniTicket->CreateFromSignedTicket($ticket); if (!defined($ticket)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniTicket object"); } # # Make sure the credential was issued to the caller. # if ($ticket->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # Lock the slice to avoid concurrent operation. # my $slice = GeniSlice->Lookup($ticket->slice_uuid()); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } if ($ticket->Release() != 0) { print STDERR "Error releasing $ticket\n"; $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Start a sliver (not sure what this means yet, so reboot for now). # sub StartSliver($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $impotent = $argref->{'impotent'}; $impotent = 0 if (!defined($impotent)); if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $sliver_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $sliver = GeniSliver->Lookup($sliver_uuid); if (!defined($sliver)) { # Might be an aggregate instead. $sliver = GeniAggregate->Lookup($sliver_uuid); if (!defined($sliver)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such sliver/aggregate $sliver_uuid"); } } # # Lock the slice to avoid concurrent operation. # my $slice = GeniSlice->Lookup($sliver->slice_uuid()); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # Shutdown slices get nothing. if ($slice->shutdown()) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "Slice has been shutdown"); } if (!$impotent && $sliver->Start() != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not start sliver/aggregate"); } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Destroy a sliver/aggregate. # sub DeleteSliver($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $impotent = $argref->{'impotent'}; my $response; $impotent = 0 if (!defined($impotent)); if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $sliver_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # For now, only allow top level aggregate to be deleted. # my $aggregate = GeniAggregate->Lookup($sliver_uuid); if (!defined($aggregate)) { my $sliver = GeniSliver->Lookup($sliver_uuid); if (defined($sliver)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Must supply toplevel sliver"); } else { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such sliver"); } } elsif ($aggregate->type() ne "Aggregate") { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Must supply toplevel sliver"); } my $slice_uuid = $aggregate->slice_uuid(); my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } if (!$impotent) { # # A firewalled slice gets special treatment. # if ($slice->needsfirewall()) { my $experiment = $slice->GetExperiment(); if (undoFWNodes($experiment, 1) != 0) { print STDERR "FireWall cleanup failed\n"; $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not tear down firewall"); goto bad; } } if ($aggregate->UnProvision() != 0) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not unprovision sliver"); goto bad; } if ($aggregate->Delete() != 0) { $response = GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not delete sliver"); goto bad; } } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS); bad: return $response; } # # Remove a record, specifically a slice on this component. # sub DeleteSlice($) { my ($argref) = @_; my $credential = $argref->{'credential'}; if (! defined($credential)) { return GeniResponse->MalformedArgsResponse(); } $credential = GeniCredential->CreateFromSigned($credential); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # See if we have a record of this slice in the DB. If not, then we have # to go to the ClearingHouse to find its record, so that we can find out # who the SA for it is. # my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such slice on this component: $slice_uuid"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } if (CleanupDeadSlice($slice) != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not cleanup slice"); } return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Split an aggregated sliver into its separate parts and return a list. # sub SplitSliver($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $impotent = $argref->{'impotent'}; $impotent = 0 if (!defined($impotent)); if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $sliver_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $user = GeniUser->Lookup($user_uuid); if (!defined($user)) { $user = CreateUserFromCertificate($credential->owner_cert()); if (!defined($user)) { print STDERR "No user $user_uuid in the ClearingHouse\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No user record for $user_uuid"); } } my $aggregate = GeniAggregate->Lookup($sliver_uuid); if (!defined($aggregate)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such aggregate $sliver_uuid"); } my $slice = GeniSlice->Lookup($aggregate->slice_uuid()); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such slice on this component"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } my @sliver_list = (); if ($aggregate->SliverList(\@sliver_list) != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not get slivers for $aggregate"); } my @credentials = (); foreach my $sliver (@sliver_list) { my $credential = $sliver->NewCredential($user); if (!defined($credential)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create credential for $sliver"); } push(@credentials, $credential->asString()); } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS, \@credentials); } # # Return the top level aggregate (sliver) for a slice. # sub GetSliver($) { my ($argref) = @_; my $cred = $argref->{'credential'}; if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $user = GeniUser->Lookup($user_uuid); if (!defined($user)) { $user = CreateUserFromCertificate($credential->owner_cert()); if (!defined($user)) { print STDERR "Could not create user from certificate\n"; return GeniResponse->Create(GENIRESPONSE_ERROR); } } my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } my $aggregate = GeniAggregate->SliceAggregate($slice); if (!defined($aggregate)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, "No slivers here for slice"); } my $new_credential = $aggregate->NewCredential($user); if (!defined($new_credential)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS, $new_credential->asString()); } # # Bind additional user to a slice, including keys. This is allowed because # the user has a slice credential, which came from the SA for the slice. # Note that this call can also be used to update your keys. # sub BindToSlice($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $keys = $argref->{'keys'}; if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, "Slice does not exist here"); } # # Find or create the user. # my $user = GeniUser->Lookup($user_uuid); if (!defined($user)) { $user = CreateUserFromCertificate($credential->owner_cert()); if (!defined($user)) { print STDERR "Could not create user from certificate\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create/find user"); } } if (!$user->IsLocal() && defined($keys)) { $user->Modify(undef, undef, $keys); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # Bind for future slivers. if ($slice->BindUser($user) != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Error binding slice to user"); } # Bind for existing slivers. if ($user->BindToSlice($slice) != 0) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Error binding user to slice"); } $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Shutdown a slice. This is brutal at present; kill it completely. # sub Shutdown($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $clear = $argref->{'clear'}; if (! (defined($cred))) { return GeniResponse->MalformedArgsResponse(); } $clear = (defined($clear) ? $clear : 0); my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # Create the slice record, since we do not want a request to come # in later. # my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { $slice = CreateSliceFromCertificate($credential); if (!defined($slice)) { print STDERR "Could not create $slice_uuid\n"; return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create slice"); } # No point in doing anything else ... $slice->SetShutdown(1); return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Do not worry about locking when setting the shutdown time. # This can lead to race though, if a clear shutdown comes in first. # Seems unlikely though. # if (!$clear) { # Do not overwrite original shutdown time $slice->SetShutdown(1) if (!defined($slice->shutdown()) || $slice->shutdown() eq ""); } else { $slice->SetShutdown(0); } # Always make sure the slice is shutdown. if ($slice->shutdown()) { # The expire daemon is going to look for this, so it will get # taken care of shortly. if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } if (CleanupDeadSlice($slice, 0) != 0) { SENDMAIL($TBOPS, "Failed to shutdown slice", "Failed to shutdown slice $slice\n"); print STDERR "Could not shutdown $slice!\n"; # Lets call this a non-error since the local admin person # is going to have to deal with it anyway. } $slice->UnLock(); } return GeniResponse->Create(GENIRESPONSE_SUCCESS); } # # Return a list of resources currently in use. # This is used by the clearinghouse to get a global sense of usage. # Currently, only the ClearingHouse will be allowed to make this call, # but eventually I think it should be opened up to any of federation # roots # sub ListUsage($) { my ($argref) = @_; my $cred = $argref->{'credential'}; if (! (defined($cred))) { return GeniResponse->MalformedArgsResponse(); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # And that the target of the credential is this registry. # if ($credential->target_uuid() ne $ENV{'MYUUID'}) { return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef, "This is not your authority!"); } # Just one of these, at Utah. my $GENICH_PEMFILE = "@prefix@/etc/genich.pem"; my $certificate = GeniCertificate->LoadFromFile($GENICH_PEMFILE); if (!defined($certificate)) { print STDERR "Could not load certificate from $GENICH_PEMFILE\n"; return GeniResponse->Create(GENIRESPONSE_ERROR); } # The caller has to match the clearinghouse. if ($credential->owner_uuid() ne $certificate->uuid()) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Only the clearinghouse can do this!"); } my @slices; if (GeniSlice->ListAll(\@slices) != 0) { return GeniResponse->Create(GENIRESPONSE_ERROR); } my @result = (); foreach my $slice (@slices) { # # Grab all the slivers for this slice, and then # look for just the nodes. # my @slivers = (); my @components = (); if (GeniSliver->SliceSlivers($slice, \@slivers) != 0) { print STDERR "Could not slice slivers for $slice\n"; return GeniResponse->Create(GENIRESPONSE_ERROR); } foreach my $sliver (@slivers) { next if ($sliver->resource_type() ne "Node"); my $node = {"sliver_gid" => $sliver->cert(), "sliver_hrn" => $sliver->hrn() }; my $component = GeniComponent->Lookup($sliver->resource_uuid()); if (defined($component)) { $node->{"component_gid"} = $component->cert(); $node->{"component_hrn"} = $component->hrn(); } else { print STDERR "No component in DB for resource ". $sliver->resource_uuid() . "\n"; } push(@components, $node); } next if (!@components); my $blob = {"slice_gid" => $slice->cert(), "slice_hrn" => $slice->hrn(), "slivers" => \@components }; push(@result, $blob); } return GeniResponse->Create(GENIRESPONSE_SUCCESS, \@result); } # # Slice Status # sub SliceStatus($) { my ($argref) = @_; my $cred = $argref->{'credential'}; my $mode = $argref->{'mode'}; $mode = "summary" if (!defined($mode)); if (! (defined($cred))) { return GeniResponse->MalformedArgsResponse(); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $slice_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, "No such slice here"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } my $aggregate = GeniAggregate->SliceAggregate($slice); if (!defined($aggregate)) { $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef, "No slivers here for slice"); } # # Grab all the slivers for this slice, and then # look for just the nodes. # my $summary = "ready"; my %details = (); my @slivers = (); if (GeniSliver->SliceSlivers($slice, \@slivers) != 0) { print STDERR "Could not get slivers for $slice\n"; $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } foreach my $sliver (@slivers) { next if ($sliver->resource_type() ne "Node"); my $node_uuid = $sliver->resource_uuid(); my $node = Node->Lookup($node_uuid); if (!defined($node)) { $slice->UnLock(); print STDERR "Cannot find node by uuid $node_uuid\n"; return GeniResponse->Create(GENIRESPONSE_ERROR); } if ($node->IsUp()) { $details{$node_uuid} = "ready"; } else { $details{$node_uuid} = "notready"; $summary = "notready"; } } $slice->UnLock(); my $blob = {"status" => $summary, "details" => \%details}; return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob); } # # Sliver status. # sub SliverStatus($) { my ($argref) = @_; my $cred = $argref->{'credential'}; if (!defined($cred)) { return GeniResponse->Create(GENIRESPONSE_BADARGS); } my $credential = GeniCredential->CreateFromSigned($cred); if (!defined($credential)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "Could not create GeniCredential object"); } my $sliver_uuid = $credential->target_uuid(); my $user_uuid = $credential->owner_uuid(); # # Make sure the credential was issued to the caller. # if ($credential->owner_uuid() ne $ENV{'GENIUUID'}) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "This is not your credential!"); } # # For now, only allow top level aggregate to be deleted. # my $aggregate = GeniAggregate->Lookup($sliver_uuid); if (!defined($aggregate)) { my $sliver = GeniSliver->Lookup($sliver_uuid); if (defined($sliver)) { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Must supply toplevel sliver"); } else { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "No such sliver"); } } elsif ($aggregate->type() ne "Aggregate") { return GeniResponse->Create(GENIRESPONSE_BADARGS, undef, "Must supply toplevel sliver"); } my $slice_uuid = $aggregate->slice_uuid(); my $slice = GeniSlice->Lookup($slice_uuid); if (!defined($slice)) { return GeniResponse->Create(GENIRESPONSE_ERROR, undef, "No slice record for slice"); } if ($slice->Lock() != 0) { return GeniResponse->BusyResponse(); } # # Grab all the slivers for this slice, and then # look for just the nodes. # my $summary = "ready"; my %details = (); my @slivers = (); if ($aggregate->SliverList(\@slivers) != 0) { print STDERR "Could not get slivers for $aggregate\n"; $slice->UnLock(); return GeniResponse->Create(GENIRESPONSE_ERROR); } foreach my $sliver (@slivers) { next if ($sliver->isa("GeniAggregate")); next if ($sliver->resource_type() ne "Node"); my $node_uuid = $sliver->resource_uuid(); my $node = Node->Lookup($node_uuid); if (!defined($node)) { $slice->UnLock(); print STDERR "Cannot find node by uuid $node_uuid\n"; return GeniResponse->Create(GENIRESPONSE_ERROR); } if ($node->IsUp()) { $details{$node_uuid} = "ready"; } else { $details{$node_uuid} = "notready"; $summary = "notready"; } } $slice->UnLock(); my $blob = {"status" => $summary, "details" => \%details}; return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob); } # # Utility Routines. # # Create a slice from the a certificate (GID). # sub CreateSliceFromCertificate($) { my ($credential) = @_; my $certificate = $credential->target_cert(); my $owner_uuid = $credential->owner_uuid(); my $authority = GeniAuthority->LookupByPrefix($certificate->uuid()); if (!defined($authority)) { $authority = CreateAuthorityFromRegistry($certificate->uuid()); if (!defined($authority)) { print STDERR "Could not create new authority record\n"; return undef; } } # # The problem with HRNs is that people will tend to reuse them. # So check to see if we have a slice with the hrn, and if so # we need to check with the registry to see if its still active. # Destroy it locally if not active. # my $slice = GeniSlice->Lookup($certificate->hrn()); if (defined($slice)) { return $slice if ($slice->uuid() eq $certificate->uuid()); if ($slice->Lock() != 0) { print STDERR "Could not lock $slice\n"; return undef; } if (CleanupDeadSlice($slice) != 0) { print STDERR "Could not cleanup dead slice $slice\n"; $slice->UnLock(); return undef; } } $slice = GeniSlice->Create($certificate, $owner_uuid, $authority); return undef if (!defined($slice)); return $slice; } # # Create a user from a certificate. # sub CreateUserFromCertificate($) { my ($certificate) = @_; # # Check Emulab users table first. # my $user = User->LookupByUUID($certificate->uuid()); if (defined($user)) { my $geniuser = GeniUser->CreateFromLocal($user); if (!defined($geniuser)) { print STDERR "Could not create geniuser from $user\n"; return undef; } return $geniuser; } my $authority = GeniAuthority->LookupByPrefix($certificate->uuid()); if (!defined($authority)) { $authority = CreateAuthorityFromRegistry($certificate->uuid()); if (!defined($authority)) { print STDERR "Could not create new authority record\n"; return undef; } } return GeniUser->Create($certificate, $authority); } # # Create authority from the ClearingHouse, by looking up the info. # sub CreateAuthorityFromRegistry($) { my ($uuid) = @_; my ($prefix) = ($uuid =~ /^\w+\-\w+\-\w+\-\w+\-(\w+)$/); my $clearinghouse = GeniRegistry::ClearingHouse->Create(); return undef if (!defined($clearinghouse)); my $blob; return undef if ($clearinghouse->Resolve("P${prefix}", "SA", \$blob) != 0); my $certificate = GeniCertificate->LoadFromString($blob->{'gid'}); return undef if (!defined($certificate)); my $authority = GeniAuthority->Create($certificate, $blob->{'url'}, $blob->{'type'}); $certificate->Delete() if (!defined($authority)); return $authority; } # # Cleanup a dead slice, releasing all the stuff associated with it. # sub CleanupDeadSlice($;$) { my ($slice, $purge) = @_; # Default to full purge. $purge = 1 if (!defined($purge)); # print "Cleaning up dead slice $slice\n"; # # A firewalled slice gets special treatment. # if ($slice->needsfirewall()) { my $experiment = $slice->GetExperiment(); print "Calling undoFWNodes ...\n"; if (undoFWNodes($experiment) != 0) { print STDERR "FireWall cleanup failed\n"; return -1; } } # # Find any aggregates and tear them down. # my @aggregates; if (GeniAggregate->SliceAggregates($slice, \@aggregates) != 0) { print STDERR "Could not get dead aggregates for $slice.\n"; return -1; } # # Link aggregates first. # my @nonlinks = (); foreach my $aggregate (@aggregates) { if (! ($aggregate->type() eq "Link" || $aggregate->type() eq "Tunnel")) { push(@nonlinks, $aggregate); next; } if ($aggregate->UnProvision() != 0) { print STDERR "Could not UnProvision $aggregate\n"; return -1; } if ($aggregate->Delete() != 0) { print STDERR "Could not delete $aggregate\n"; return -1; } } foreach my $aggregate (@nonlinks) { if ($aggregate->UnProvision() != 0) { print STDERR "Could not UnProvision $aggregate\n"; return -1; } if ($aggregate->Delete() != 0) { print STDERR "Could not delete $aggregate\n"; return -1; } } # # Are there any slivers left after killing the aggregates? # my @slivers; if (GeniSliver->SliceSlivers($slice, \@slivers) != 0) { print STDERR "Could not get dead slivers for $slice.\n"; return -1; } foreach my $sliver (@slivers) { if ($sliver->UnProvision() != 0) { print STDERR "Could not UnProvision $sliver\n"; return -1; } if ($sliver->Delete() != 0) { print STDERR "Could not delete $sliver\n"; return -1; } } # # And lastly, any tickets that were not instantiated. # my @tickets; if (GeniTicket->SliceTickets($slice, \@tickets) != 0) { print STDERR "Could not get dead tickets for $slice.\n"; return -1; } foreach my $ticket (@tickets) { # print STDERR "Releasing $ticket\n"; if ($ticket->Release() != 0) { print STDERR "Could not delete $ticket\n"; return -1; } } return 0 if (!$purge); my $experiment = $slice->GetExperiment(); if (defined($experiment)) { $experiment->LockDown(0); my $pid = $experiment->pid(); my $eid = $experiment->eid(); system("$PLABSLICE destroy $pid $eid"); system("$ENDEXPT -q $pid,$eid"); return -1 if ($?); } if ($slice->Delete() != 0) { print STDERR "Could not delete $slice\n"; return -1; } return 0; } # # If the underlying experiment does not exist, need to create # a holding experiment. All these are going to go into the same # project for now. Generally, users for non-local slices do not # have local accounts or directories. # sub GeniExperiment($) { my ($slice) = @_; my $uuid = $slice->uuid(); my $needsfirewall = $slice->needsfirewall(); my $experiment = Experiment->Lookup($uuid); if (!defined($experiment)) { # # Form an eid for the experiment. # my $eid = "slice" . TBGetUniqueIndex('next_sliceid', 1); my $nsfile = ""; # # Need a way to can experiments. # if ($needsfirewall) { $nsfile = "/tmp/$$.ns"; open(NS, "> $nsfile") or return undef; print NS "source tb_compat.tcl\n"; print NS "set ns [new Simulator]\n"; print NS "tb-set-security-level Yellow\n"; print NS "\$ns run\n"; close(NS); } # Note the -h option; allows experiment with no NS file. system("$CREATEEXPT -q -i -k -w ". "-S 'Geni Slice Experiment -- DO NOT SWAP OR TERMINATE' ". "-E 'Geni Slice Experiment -- DO NOT SWAP OR TERMINATE' ". "-L 'Geni Slice Experiment -- DO NOT SWAP OR TERMINATE' ". "-h '$uuid' -p GeniSlices -e $eid $nsfile"); if ($?) { return undef; } $experiment = Experiment->Lookup($uuid); $experiment->Update({"geniflags" => 1}); } return $experiment; } # # # sub FindFreeNode($@) { # Already going to allocate these. my $vtype = shift(@_); my $type = "pc"; my @nodeids = @_; if (defined($vtype)) { # XXX Need to implement this. ; } my $query_result = DBQueryWarn("select uuid from geni_components"); return undef if (!$query_result || !$query_result->numrows); while (my ($uuid) = $query_result->fetchrow_array()) { my $node = Node->Lookup($uuid); next if (!defined($node)); next if ($node->isremotenode()); next if (grep {$_ eq $node->node_id()} @nodeids); # # See if the node is already reserved. # my $reservation = $node->Reservation(); return $node if (!defined($reservation)); } return undef; } # _Always_ make sure that this 1 is at the end of the file... 1;
|
__label__pos
| 0.847954 |
Optica Open
Browse
arXiv.svg (5.58 kB)
Download file
Sub-picoliter Traceability of Microdroplet Gravimetry and Microscopy
Download (5.58 kB)
preprint
posted on 2023-01-12, 14:02 authored by Lindsay C. C. Elliott, Adam L. Pintar, Craig R. Copeland, Thomas B. Renegar, Ronald G. Dixson, B. Robert Ilic, R. Michael Verkouteren, Samuel M. Stavis
Gravimetry typically lacks the resolution to measure single microdroplets, whereas microscopy is often inaccurate beyond the resolution limit. To address these issues, we advance and integrate these complementary methods, introducing simultaneous measurements of the same microdroplets, comprehensive calibrations that are independently traceable to the International System of Units (SI), and Monte-Carlo evaluations of volumetric uncertainty. We achieve sub-picoliter agreement of measurements of microdroplets in flight with volumes of approximately 70 pL, with ensemble gravimetry and optical microscopy both yielding 95% coverage intervals of +/- 0.6 pL, or relative uncertainties of +/- 0.9%, and root-mean-square deviations of mean values between the two methods of 0.2 pL or 0.3%. These uncertainties match previous gravimetry results and improve upon previous microscopy results by an order of magnitude. Gravimetry precision depends on the continuity of droplet formation, whereas microscopy accuracy requires that optical diffraction from an edge reference matches that from a microdroplet. Applying our microscopy method, we jet and image water microdroplets suspending fluorescent nanoplastics, count nanoplastic particles after deposition and evaporation, and transfer volumetric traceability to number concentration. We expect that our methods will impact diverse fields involving dimensional metrology and volumetric analysis of microdroplets, including inkjet microfabrication, disease transmission, and industrial sprays.
History
Disclaimer
This arXiv metadata record was not reviewed or approved by, nor does it necessarily express or reflect the policies or opinions of, arXiv.
Usage metrics
Categories
Licence
Exports
|
__label__pos
| 0.843171 |
Convert PNG to PDF using Java
Convert PNG to PDF using Java
PNG and PDF are popular and the most widely used file formats at the current point in time. PNG is an image file format whereas PDF(Portable Document Format) offers reliable and efficient data representation. You need to convert the image file format to PDF in some scenarios. Therefore, in this blog post, we will learn how to convert PNG to PDF using Java PDF API. We will write the code snippet and the steps to perform this conversion in a Java application.
We will cover the following topics in this article:
Java PDF library
This Java PDF library is easy to install and offers documentation regarding installation. It is an enterprise-level API that offers robust conversion and manipulation features. However, you can download the JAR or install it using the following Maven configurations:
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>21.11</version>
<type>pom</type>
</dependency>
Convert PNG to PDF using Java
We are going to use the classes and methods exposed by this Java PDF library. It lets you perform PNG to PDF conversion by writing a few lines of source code in Java.
You may follow the steps and the code snippet mentioned below:
1. Instantiate an instance of the Document class.
2. Create an object of DocumentBuilder class to make it simple to add content to the document.
3. Load the input image file by calling the createImageInputStream method and assign it to the object of ImageInputStream.
4. Invoke the getImageReaders method that returns an Iterator containing all currently registered ImageReaders and assigns it to the object of ImageReader class.
5. Call the setInput method that sets the input source to use to the given ImageInputStream.
6. Get the number of frames in the image by calling the getNumImages method.
7. Loop through all frames.
8. Select an active frame and assign it to the object of BufferedImage class.
9. Invoke the getPageSetup method to access the current page setup and assign it to the object of the PageSetup class.
10. Set the page height by calling the setPageWidth method.
11. Invoke the setPageHeight method to set the width of the page.
12. Insert the image into the document and position it at the top left corner of the page by calling the insertImage method.
13. Save the file as a PDF file format by calling the save method.
You can see the output in the image below:
PNG to PDF conversion
PNG to PDF conversion
Get a Free License
You can get a free temporary license to try the API beyond evaluation limitations.
Summing up
We can end this blog post here. We have demonstrated the implementation of the Java PDF library to convert PNG to PDF using Java programmatically. This library lets you build a PNG to PDF converter using a few lines of code. In addition, you may visit the documentation of this PNG to PDF conversion API. conholdate.com is continuously writing on new interesting topics. Therefore, please stay connected for the latest updates.
Ask a question
You can let us know about your questions or queries on our forum.
FAQs
How do you convert a PNG to a PDF?
You can use this library to convert PNG to PDF in Java programmatically. It offers comprehensive documentation regarding its usage.
How do I save a PNG as a PDF without losing quality?
Go through this section to learn how to save a PNG as a PDF file using a Java library. You can invoke the save method to save a PNG file as a PDF file.
See Also
|
__label__pos
| 0.789614 |
firststep
The fact is, I am quite busy recently. But I don’t want to break the streak. So how about I write a quick one.
I have looked into bayesian statistics for few times in this blog. And I think most of you might know that the traditional frequentist statistical inference, for example, the P-value, is actually relying on P(X|H). Therefore, it is the conditional probability of having the data(X) as such or more extreme, when the null hypothesis(H) is true. Therefore, it is not correct to say thing like: because our p-value is very small, so our theory is true. The reason for this statement is wrong, is that p-value says nothing about how correct is your theory. It is all about the probability of observing such data, when the null is true.
Instead, what we usually want, is P(H|X), i.e. what is the probability of our hypothesis to be true, when we have the data as such. Such probability can be inferred by bayesian statistics.
A classical example in statistics is about flipping coin. For example, we flipped a coin for 20 times and observed 15 tails. Is this coin biased?
The traditional way of doing this, is to use the binomial test to calculate p-value. e.g.
binom.test(15, 20, p = 0.5, alternative = 'two.sided')
## 95%CI
## 0.5089541 0.9134285
By doing that we got a P-value of 0.0414. Using the traditional alpha < 0.05 criteria, we reject the null hypothesis. A correct conclusion from this binomial test is: when the null hypothesis is true, we have a probability of 0.0414 to have 15 tails or a more extreme version of the observation. Once again, it is P(X|H).
How about the P(H|X)? Well, it is actually not that difficult to compute that using R. To do bayesian statistics, we need three elements: prior, generative model and data.
Data is easy. Our “15 tails out of 20” is our data. Priors quantify our belief about the situation. For example, we don’t know exactly the probability of generating tails of our coin (Pt). It is equally likely to be from 0 to 1. The generative model is difficult to explain in word. I think it is easier for me to just do a simulation.
require(tidyverse)
n_samples <- 100000
prior_proportion_tails <- runif(n_samples, min = 0, max = 1)
n_tails <- rbinom(n = n_samples, size = 20, prob = prior_proportion_tails)
prior <- tibble(proportion_tails = prior_proportion_tails, n_tails)
posterior <- prior %>% filter(n_tails == 15)
par(mfrow = c(1,2))
hist(prior$proportion_tails)
hist(posterior$proportion_tails)
quantile(posterior$proportion_tails, c(0.025, 0.975))
What we are trying to do here, is to simulate the possible outcomes (no of tails) with our prior belief (the Pt can be 0 to 1). With our data, select the outcomes from the prior fit our data. And then we study the posterior probability distribution of Pt. As we can see, the distribution of Pt shifts from a uniform distribution to a (log)normal distribution with the mean around 0.75. The beauty of bayesian statistics is that, we can say something like: given our data, it is 95% chance that Pt is from 0.53 to 0.89. Rather than saying, as in the (tedious) interpretation of confident interval: Upon replication of this experiment for many times and calculate the 95% CI for each replication, 95% of the time the true Pt is in those CIs. That is the difference between P(H|X) and P(X|H).
It is actually possible to do the bayesian inference more elegantly with out that large amount of simulated values.
prior_proportion_tails <- seq(0, 1, by = 0.01)
n_tails <- seq(0, 20, by = 1)
pars <- expand.grid(proportion_tails = prior_proportion_tails,
n_tails = n_tails) %>% as_tibble
pars$prior <- dunif(pars$proportion_tails, min = 0, max = 1)
pars$likelihood <- dbinom(pars$n_tails,
size = 20, prob = pars$proportion_tails)
pars$probability <- pars$likelihood * pars$prior
pars$probability <- pars$probability / sum(pars$probability)
pars %>% filter(n_tails == 15) %>% mutate(probability = probability / sum(probability)) -> posterior
plot(y = posterior$probability, x = posterior$proportion_tails, type = 'l')
R is great as a tool to build this kind of bayesian intuition.
8 down, 44 to go.
|
__label__pos
| 0.757411 |
What is LED panel light? Is there any use?
The shape of LED panel lights is similar to ordinary panel lights, but the main difference is the light source. For ordinary panel lights, the light source is a fluorescent lamp, and the LED panel light source is an LED tube or LED lamp module or LED lamp beads. The following is a simple analysis of the role of LED panel lights.
1. LED panel lights belong to the category of lamps and lanterns, which have strong anti-vibration ability.
In the LED panel light, the LED light source is a high-hardness resin, not a light-emitting body such as tungsten glass, which is not easily damaged, so its vibration resistance is high and its environmental temperature adaptability is strong.
2. The LED panel light has strong control ability.
The LED panel light can be connected to an external controller for a variety of dynamic program control, and can adjust the color temperature and brightness.
led panel light
3. Low power consumption of LED panel lights.
At the same time, the lighting technology of LED panel lights is an energy-saving lighting technology. The product does not contain mercury in the production process, has less waste, and basically has no pollution; semiconductor lighting is recyclable and reproducible, and is sustainable for the social and economic development. It plays an important role.
4. The LED panel light is a very flexible technology in the initial stage of product design. LED is a point light source. The engineering designers of LED products can flexibly combine points, lines, and surfaces to design various light sources with different shapes and different particles according to customer needs. The design is very flexible.
5. The luminous intensity of the LED panel light is higher and more powerful.
The LED panel light adopts a reflective plate sealing design, and uses high-efficiency light guide plates and aluminum alloy materials. The luminous effect is uniform and the light intensity is higher.
|
__label__pos
| 0.984715 |
Eating Two Larger Meals a Day (Breakfast and Lunch) Is More Effective Than Six Smaller Meals in a Reduced-Energy Regimen for Patients With Type 2 Diabetes: A Randomised Crossover Study
Study Questions:
Are two meals per day (breakfast and lunch) better for body weight, hepatic fat content, insulin resistance, and beta cell function compared to six meals per day?
Methods:
This was a randomized, open, crossover study, which included 54 patients (ages 30-70 years) with type 2 diabetes. All were treated with oral hypoglycemic agents, had body mass index (BMI) between 27-50 kg/m2, and glycated hemoglobin 6-11.8% (42-105 mmol/mol). Subjects were randomized to 12 weeks of either six meals per day (breakfast, lunch, dinner, and three snacks) or two meals per day (breakfast and lunch). Composition of the diets followed Association for the Study of Diabetes guidelines, with the same caloric restriction of 500 kcal/day, based on each subject’s resting energy expenditure. The diets derived 50-55% of total energy from carbohydrates, 20-25% from protein, and <30% from fat, with 30-40 g/day of fiber. All meals were provided to half of each group, while the other half prepared their own meals. The primary outcomes included BMI, hepatic fat content (measured with proton magnetic resonance spectroscopy), insulin resistance, and beta cell function.
Results:
The intention-to-treat analysis included all participants (n = 54). Body weight decreased in both regimens (p < 0.001), but was more pronounced in the two meals/day group (−2.3 kg; 95% confidence interval [CI] −2.7 to −2.0 kg for six-meals/day group vs. −3.7 kg; 95% CI, −4.1 to −3.4 kg for two meals/day group; p < 0.001). Hepatic fat content decreased in response to both regimens (p < 0.001), more for two meals/day group (−0.03%; 95% CI, −0.033% to −0.027% for six-meals/day group vs. −0.04%; 95% CI, −0.041% to −0.035% for two meals/day group; p = 0.009). Fasting plasma glucose and C-peptide levels decreased in both regimens (p < 0.001), more for two meals/day group (p = 0.004 and p = 0.04, respectively). Fasting plasma glucagon decreased with the two meals/day regimen (p < 0.001), whereas it increased (p = 0.04) for six-meals/day regimen (p < 0.001). Oral glucose insulin sensitivity increased in both regimens (p < 0.01), more for two meals/day group (p = 0.01). No adverse events were observed for either regimen.
Conclusions:
The investigators concluded that eating only breakfast and lunch reduced body weight, hepatic fat content, fasting plasma glucose, C-peptide, and glucagon, and increased oral glucose insulin sensitivity more than the same caloric restriction split into six meals. These results suggest that, for type 2 diabetic patients on a hypoenergetic diet, eating larger breakfasts and lunches may be more beneficial than six smaller meals during the day.
Perspective:
These data suggest that the number of meals per day has clinical impact on diabetic control. Further research in a larger cohort, including research on the mechanisms for such a difference, is warranted.
Keywords: Meals, Hemoglobin A, Glycosylated, Eating, Diabetes Mellitus, Type 2, Breakfast, Lunch
< Back to Listings
|
__label__pos
| 0.81895 |
Aktör yapısına dayalı paralel programlama ortamının tasarımı ve gerçeklenmesi
thumbnail.default.alt
Tarih
1992
Yazarlar
Kandemir, Mahmut Taylan
Süreli Yayın başlığı
Süreli Yayın ISSN
Cilt Başlığı
Yayınevi
Fen Bilimleri Enstitüsü
Özet
Çok görevlilik çalışmakta olan bir işlevden bir diğerinin ortasına ikisinin de durumlarını bozmadan geçmektir. Burada amaç aynı anda birden fazla olayın denetlenmesidir. Görev bıraktırmalı sistemlerde, görev düzenleyici o anda yapılan iş ne olursa olsun onu keserek başka bir görevi çalıştırabilir. Düzenleyici, elindeki görevlerin ne zaman ve hangi sırayla çalıştırılacağına da karar verir. Bu çalışmada asenkron mesaj aktarımına dayalı, dinamik görev oluşturmaya uygun bir dil olan ACT++'a ilişkin ilkeller C++ nesneye yönelik programlama dili kullanılarak gerçekleştirilmiştir.
Concurrent programming makes it possible to use a computer where many things need attention at the same time which may be people at terminals or temperatures in an industrial plant. A concurrent program specifies two or more sequential programs that may be executed concurrently as parallel processes. A concurrent program can be executed either by allowing processes to share one or more processors or by running each process on its own processor. The first approach is referred to as multiprogramming. The second one is referred to as multiprocessing if the processors share a common memory or as distributed processing if the processors are connected by a communications network. Hybrid approaches also exist -for example, processors in a distributed system are often multiprogrammed. Object oriented programming (OOP) on the other hand is a method of programming that seeks to mimic the way we form models of the world. To cope with the complexities of life, we have evolved a wonderful capacity to generalize, classify, and generate abstractions. Almost every noun in our vocabulary represents a class of objects sharing some set of attributes or behavioral traits. From the world of individual dogs, we distill an* abstract class called 'dog'. This allows us to develop and process ideas about canines without being distracted by the details concerning any particular dog. The OOP extensions in C++ exploit this natural tendency we have to classify and abstract things. Three main properties characterize an OOP language : Encapsulation : Combining a data structure with the functions (actions or methods) dedicated to manipulating the data. Encapsulation is achieved by means of new structuring and data- typing mechanism called 'class'. -vi- Inheritance : Building new, derived classes that inherit the data and functions from one or more previously- def ined base classes, while possibly redefining or adding new data and actions. This produces a hierarchy of classes. Polymorphisms : Giving an action one name or symbol that is shared up and down a class hierarchy, with each class in the hierarchy implementing the action in a way appropriate to itself. In object-oriented concurrent programming (OOCP), a problem is modeled as a set of cooperating objects and solved by these objects communicating with each other. This programming provides us with a higher level and more unified abstraction of objects and processes. By modelling a problem as a set of cooperating objects, we can obtain higher descriptivity and understandability. In OOCP objects are defined in terms of two main properties : 1. An object is the unit not only of protection but also of execution. 2. An object has its own computing facility. According to the first property, an object is a new module which encapsulates processes and the data which is accessed only by those processes. Last item indicates that an object can proceed with the computation by itself. From this, someone can say that object-oriented concurrent computing is a model by which all problems are described in terms of communicating objects. Embedded systems programming presents some interesting challenges. A typical application might involve juggling a variety of sampling, processing, control, and communication functions simultaneously on a very small system. Such applications are inherently parallel and are best implemented by small tasks working together. In preemptive multitasking, an interrupt timer periodically executes an executive program. The executive determines if the current task has been running too long, and if so forces a context switch to the next scheduled task. If the task still has time, it updates a counter and returns from interrupt. Because an interrupt can occur and force a context switch at any point in the program, the system must save and restore the processor's entire state. Resource sharing between tasks requires routines to lock and unlock common data structures. Further, operating system calls must be re-entrant (which Ms-Dos is not). Cooperative multitasking, on the other hand, has no executive overhead and does not rely on interrupts. Instead, when a task is ready to give up control, calls a routine (pause) which switches context to the next task. -vii- Because the point of switch is always the same, only the stack pointer and a few registers are saved and stored. This makes the context switch simple and potentially very fast. This sort of tasking greatly simplifies resource sharing since other tasks cannot sneak in during updating of common structures. System calls can be performed in any operating system because a context switch cannot occur unexpectedly during the call. But that is not a real multitasking. In implementing ACT++, preemptive method has been adopted. Critical regions, monitors, and path expressions are one outgrowth of semaphores; they all provide structured ways to control access to shared variables. A different outgrowth is 'message passing' which can be viewed as extending semaphores to convey data as well as to implement synchronization. When message passing is used for communication and synchronization processes send and receive messages instead of reading and writing shared variables. Communication is accomplished because a process, upon receiving a message, obtains values from some sender process. Synchronization is accomplished because a message can be received only after it has been sent, which constrains the order in which these two events can occur. A message is sent by executing: SEND expression. list TO destination. designator; The message contains the values of the expressions in 'expression. list' at the time send is executed. The 'destination. designator' gives the programmer to control over where the message goes, and hence over which statements can receive it. A message is received by executing : RECEIVE variable.list FROM source. designator; where 'variable.list' is a list of variables. The 'source.designator gives the programmer control over where the message came from, and hence over which statements could have send it. Receipt of a message causes, first, assignment of the values in the message to the variables in the 'variable list' and, second, subsequent destruction of the message. Designing message-passing primitives involves making choices about the form and semantics of these general commands. Taken together, the destination and source designators define a communications channel. Various schemes have been proposed for naming channels. Then simplest channel- naming scheme -viii- is for process names to serve as source and destination designators. That sort of naming is called 'direct naming'. Direct naming is easy to implement and to use. It makes it possible for a process to control the times at which it receives messages from each other processes. But one of the very important paradigms for process interaction is the client/server relationship. Some server processes render a service to some client processes. A client can request that a service be performed by sending a message to one of these servers. A server repeatedly receives a request for service from a client, performs that service, and (if necessary) returns a completion message to that client. Unfortunately, direct naming is not always well-suited for client/server interaction. Ideally, the receive in a server should allow receipt of a message from any client. If there is only one client, then direct naming will work well; the difficulties arise if there is more than one client because, at the very least, a receive would be required for each. Similarly, if there is more than one server (and all servers are identical), then the send in a client should produce a message that can be received by any server. Again, this cannot be accomplished easily by direct naming. A more sophisticated scheme for defining communications channels is based on the use of 'global names', sometimes called 'mail-boxes'. A mailbox can appear as the destination designator in any process 'send statements and as the source designator in any process 'receive statements. Thus messages sent to a given mail-box can be received by any process that executes a receive naming that mail box. As easily seen, this scheme is particularly well-suited for programming client/server interactions. A special case of mail- boxes, in which a mail-box name can appear as the source designator in receive statements in one process only, does not suffer any implementation difficulty. Such mail-boxes are often called as 'ports'. ACT++ is a concurrent OOP language being developed as a part of a research project on concurrent real time systems. The Actor model is a concurrent computation model in which computation is achieved by actors communicating via message passing. The model consists of five basic elements : actors, mail queues, messages, behaviors, and acquaintances. An actor is a self-contained active object. Interaction among actors can occur only through message passing. Each actor is associated with a unique mail queue, whose address serves as the IX- identifier of the actor. The messages send to actor are buffered by its mail queue. Messages buffered in a mail queue are read one at a time in a strict FIFO order. The behavior of an actor determines how the actor reacts to a request specified in the message processed. A behavior is defined by a code body called the behavior script. The script contains method definitions, and acquaintances. Acquaintances are the names of other actors *to which an actor can send messages. A behavior script corresponds to a class definition in other OOP languages while acquaintances correspond to instance variables. In processing a message, an actor can do three things: make new actors, send messages to actors, and specify a replacement behavior. Actors are dynamically produced at run-time as needed during the course of computation. A new actor is produced by the 'New' operation. The send operation is the primitive used for asynchronous message passing. A message consists of the address of the target actor, the name of the method to be invoked, and parameters for the method invocation. The last primitive operation is the specification of a replacement behavior. The 'become' operation is used for that. This operation requires a behavior script name and a list of acquaintances. The operation produces a thread. The newly produced thread is the current behavior of the actor. The replacement behavior determines how to handle the next unprocessed message. Since a thread can specify a replacement only once in its life, there is at most one behavior waiting for a message at any time. Concurrency in ACT++ comes from two sources: making a new actor and specification of a replacement behavior. The former results in inter - object concurrency, while the latter yields intra-object concurrency. Two kinds of objects are distinguished in ACT++, namely active objects and passive objects. An active objects proceeds concurrently with other objects. An active object, processing its own thread of control, is an actor. All objects that are not actors are passive objects. The invocation of a method of a passive object is performed using the thread of the requesting -x- object. Each object is an instance of some class. A class defines the properties of its instance objects. A class can inherit from another existing class by declaring itself as a subclass of existing class. A subclass can redefine, restrict, or extends the definition of its superclass. Active objects are instances of classes which are direct or indirect subclasses of a special class called ACTOR. Passive objects are instances of classes which are not subclasses of ACTOR. The language supports the primitive operations of the Agha's actor kernel language : New, Send and Become. Invoking methods of a passive object has the semantics of a function call. Invoking a method of an actor on the other hand, is via asynchronous message passing. Two types of messages are distinguished in ACT++, namely, request messages and reply messages. A request message is used for invoking a method while a reply message is used for delivery of the result of a method invocation. Two types of mail boxes are available to support these two different kinds of messages : 'MBox' and 'CBox'. A request message is used for sending a request to another actor. Request messages are buffered in the mail queue (MBox) of the receiving actor. An actor can refer to its own MBox using the pseudo variable 'self. Each behavior of actor can process only one request message in the MBox. If the sender of a request wants to receive the result of the method invocation, it may provide a CBox name in the request message. The 'reply' operation is used to transmit a reply message containing the result. The name of a CBox specified in a request message is called the reply destination. Technically, ACT++ is a language design which supports both class inheritance and the actor model of concurrency. As an expedient implementation strategy, C++ is used as the base language, extending it with the concurrency abstraction of the actor model. In ACT++, actors represent active objects. All non-actor objects are passive. A passive object represents a C++ object, which is local to a single active object. A shared object must be actor. Like passive objects, an actor class can inherit properties from- an existing actor class by defining itself to be a subclass of it. ACT++ distributes concurrency control into each method. The New operation for making a new actor MBox is a function which takes the name of an actor class as an argument. The operation is implemented as a conventional function without being a member of any class. The become operation is a friend member of ACTOR. The operation is overloaded to allow an actor to specify self as the replacement behavior. The send operation is implemented as a method of the class (struct) MBox. The -xi- syntax for sending a message is written as a series of stream like output operations (<<). For example, the following statement sends to an MBox called myMBox a message consisting of aMethod, replyDestination, ant two method invocation parameters, namely, firstinteger and second integer: myMBox << aMethod << replyDestination << firsinteger << second integer; An actor can read a request message from its MBox using the operation >> on the pseudo. variable self. Since the method name argument of a request message is used by the mail queue for selecting the method to invoke, the method name is not read by the >> operation. The >> operation is only used to read the values for the parameters of the method. Each method of a behaviour script contains with a >> statement. For example, contiuning the example above, the definition of a method aMethod of an actor myMBox uses the following for reading the message from the MBox: self >> first integer Arg >> second in tegerArg; The class CBox supports the 'reply' method for transmitting a reply message. The following statement sends a reply message containing 53 to the replyDestination. reply (53); Two other methods are provided by a CBox : In and receive. The method In() is used to check whether or not the reply has arrived in a CBox. The receive operation denoted by '»' reads a reply from a CBox. The use of these methods are illustrated in the following: if (myCBoxl.InO) then myCBoxl >> result else myCBox2 >> result; If myCBoxl has not yet received a reply, then myCBox2 is read, in which case the actor executing the statement may be blocked depending on the presence of a reply message in rayCBox2..
Açıklama
Tez (Yüksek Lisans) -- İstanbul Teknik Üniversitesi, Fen Bilimleri Enstitüsü, 1992
Anahtar kelimeler
Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol, Paralel programlama, Tasarım, Computer Engineering and Computer Science and Control, Parallel programs, Design
Alıntı
|
__label__pos
| 0.892888 |
[Previous][Contents] [Marketing Needed -- Can You Help?]
Copyright © 1996-2005 jsd
Previous Up Next
19 The Laws of Motion
There is no gravity.
The earth sucks.
— Physicist’s bumper sticker
This chapter pulls together some basic physics ideas that are used in several places in the book.
We will pay special attention to rotary motion, since it is less familiar to most people than ordinary straight-line motion. Gyroscopes, in particular, behave very differently from ordinary non-spinning objects. It is amazing how strong the gyroscopic effects can be.
19.1 Straight-Line Motion
Let’s start by reviewing the physical laws that govern straight-line motion.
19.1.1 First Law
The first law of motion states: “A body at rest will remain at rest, and a body in motion will remain in motion, namely uniform straight-line motion, unless it is subjected to an outside force”. Although that may not sound like a very deep idea, it is one of the most revolutionary statements in the history of science. Before Galileo’s time, people omitted frictional forces from their calculations. They considered friction “natural” and ubiquitous, not requiring explanation; if an object continued in steady motion, the force required to overcome friction was the only thing that required explanation. Galileo dramatically changed the viewpoint. Absence of friction is now considered the “natural” state, and frictional forces must be explained and accounted for just like any others.
The first law applies in the absence of outside forces. Any situation involving outside forces is covered by the second law, as we now discuss.
This is often called Newton’s first law of motion, which is quite unfair to Galileo. Newton was the first to set this law at the top of a numbered list, but he did not originate the law itself.
19.1.2 Second Law
The second law of motion says that if there is any change in the velocity of an object, the force (Fu) is proportional to the mass (m) of the object, and proportional to the acceleration vector (a). In symbols,
Fu = m a (19.1)
The acceleration vector is defined to be the rate-of-change of velocity. See below for more about accelerations. Here Fu is the force exerted upon the object by its surroundings, not vice versa.
The following restatement of the second law is often useful: since momentum is defined to be mass times velocity, and since the mass is not supposed to be changing, we conclude that the force is equal to the rate-of-change of the momentum. To put it the other way, change in momentum is force times time.
19.1.3 Third Law
The third law of motion expresses the idea that momentum can neither be created nor destroyed. It can flow from one region to an adjoining region, but the total momentum does not change in the process. This is called conservation of momentum. As a corollary, it implies that the total momentum of the world cannot change. An application of this principle appears in section 19.2. Conservation of momentum is one of the most fundamental principles of physics, on a par with the conservation of energy discussed in chapter 1.
In simple situations, the third law implies that if object A exerts a force on object B, then object B exerts an equal and opposite1 force on object A.2 (In complicated situations, keeping track of equal-and-opposite forces may be impractical or impossible, in which case you must rely on the vastly more fundamental notion of conservation of momentum.)
Note the contrast:
The third law implies that if we add the force exerted by object A on object B plus the force exerted by object B on object A, the two forces add to zero. These are two forces acting on two different objects. They always balance. Equilibrium means that if we add up all the forces exerted on object A by its surroundings, it all adds up to zero. These forces all act on the same object. They balance in equilibrium and not otherwise.
There is also a law of conservation of angular momentum. This is so closely related to conservation of ordinary linear momentum that some people incorporate it into the third law of motion. Other people leave it as a separate, unnumbered law of motion. We will discuss this starting in section 19.3.
19.1.4 Two Notions of Acceleration
The quantity a = F/m that appears in equation 19.1 was carefully named the acceleration vector. Care was required, because there is another, conflicting notion of acceleration:
Alas, everyone uses both of these conflicting notions, usually calling both of them “the” acceleration. It is sometimes a struggle to figure out which meaning is intended. One thing is clear, though: the quantity a = F/m that appears in the second law of motion is a vector, namely the rate-of-change of velocity.
Do not confuse velocity with speed. Velocity is a vector, with magnitude and direction. Speed is the magnitude of the velocity vector. Speed is not a vector.
Suppose you are in a steady turn, and your copilot asks whether you are accelerating. It’s ambiguous. You are not speeding up, so no, there is no scalar acceleration. However, the direction of the velocity vector is changing, so yes, there is a very significant vector acceleration, directed sideways toward the inside of the turn.
If you wish, you can think of the scalar acceleration as one component of the vector acceleration, namely the projection in the forward direction.
Try to avoid using ambiguous terms such as “the” acceleration. Suggestion: often it helps to say “speeding up” rather than talking about scalar acceleration.
19.1.5 Force is Not Motion
As simple as these laws are, they are widely misunderstood. For example, there is a widespread misconception that an airplane in a steady climb requires increased upward force and a steady descent requires reduced upward force.3 Remember, lift is a force, and any unbalanced force would cause an acceleration, not steady flight.
In unaccelerated flight (including steady climbs and steady descents), the upward forces (mainly lift) must balance the downward forces (mainly gravity). If the airplane had an unbalanced upward force, it would not climb at a steady rate — it would accelerate upwards with an ever-increasing vertical speed.
Of course, during the transition from level flight to a steady climb an unbalanced vertical force must be applied momentarily, but the force is rather small. A climb rate of 500 fpm corresponds to a vertical velocity component of only 5 knots, so there is not much momentum in the vertical direction. The kinetic energy of ordinary (non-aerobatic) vertical motion is negligible.
In any case, once a steady climb is established, all the forces are in balance.
19.2 Momentum in the Air
We know from the third law of motion that if object A exerts a force on object B, then object B exerts an equal and opposite force on object A, as discussed in section 19.1.
There are many such force-pairs in a typical flight situation, as shown in figure 19.1 and figure 19.2.
momentum-budget-straight
Figure 19.1: Force and Momentum in Straight Flight
momentum-budget-arc
Figure 19.2: Force and Momentum in Curved Flight
In each of these numbered force-pairs, the “a” part always balances the “b” part exactly, in accordance with the third law of motion, whether or not the system is in equilibrium. In fact, figure 19.2 shows a non-equilibrium situation: the weight (1b) exceeds the lift (2a), so there is an unbalanced downward force, and the airplane is following a downward-curving flight path.
Note: In reality, these forces are all nearly aligned, all acting along nearly the same vertical line. (In the figure, they are artificialy spread out horizontally to improve readability.) Also, for simplicity, we are neglecting the effect of gravity on the air mass itself.
The arrows representing forces are color-coded according to which item they act upon: Blue arrows act upon the wing; brown arrows act upon the ground; green arrows act upon the light-green air parcel, et cetera.
For simplicity, we choose to analyze this from the viewpoint of an unaccelerated bystander. This means there will be no centrifugal field associated with the curved flight path in figure 19.2.
Let us now return to the scenario of unaccelerated flight, as shown by figure 19.1. In this scenario, the airplane weighs less than the airplane in figure 19.2, while all the other forces remain the same. The weight (1b) now equals the lift (2a), as it should for unaccelerated flight.
Since force is just momentum per unit time, the same process can be described by a big “closed circuit” of momentum flow. The earth transfers downward momentum to the airplane (by gravity). The airplane transfers downward momentum to the air (by pressure near the wings). The momentum is then transferred from air parcel to air parcel to air parcel. Finally the momentum is transferred back to the earth (by pressure at the surface), completing the cycle. In steady flight, there is no net accumulation of momentum anywhere.
You need to look at figure 3.29 to really understand the momentum budget. Looking only at figure 3.2 doesn’t suffice, because that figure isn’t large enough to show everything that is going on. You might be tempted to make the following erroneous argument:
To solve this paradox, remember that figure 3.2 shows only the flow associated with the bound vortex that runs along the wing, and does not show the flow associated with the trailing vortices. Therefore it is only valid relatively close to the wing and relatively far from the wingtips.
Look at that figure and choose a point somewhere about half a chord ahead of the wing. You will see that the air has some upward momentum at that point. All points above and below that point within the frame of the figure also have upward momentum. However, it turns out that if you go up or down from that point more than a wingspan or so, you will find that all the air has downward momentum. This downward flow is associated with the trailing vortices. Near the wing the bound vortex dominates, but if you go higher or lower the trailing vortices dominate. If you are wondering how this is possible, consider the following contrast. It helps to think carefully about what we mean by “vortex”:
A vortex line or vortex core is just a line, with zero thickness. The core of the trailing vortex extends behind the wing only. The flow pattern of the vortex extends throughout all space. The speed of flow falls off only gradually as a function of distance from the vortex core. The trailing vortex flow pattern affects the air ahead of the wing.
If you know the location and strength of the core, you can determine the entire flow pattern ... but the core and the flow are two different concepts.
If you add up all the momentum in an entire column of air, for any vertical column ahead of the wing, you will find that the total vertical momentum is zero. The total momentum associated with the trailing vortices exactly cancels the total momentum associated with the bound vortex.
If you consider points directly ahead of the wing (not above or below), a slightly different sort of cancellation occurs. The flow associated with the trailing vortices is never enough to actually reverse the flow associated with the bound vortex; there is always some upwash directly ahead of the wing, no matter how far ahead. However, the contribution associated with the trailing vortices greatly reduces the magnitude, so the upwash pretty soon becomes negligible. Therefore, to a reasonable approximation, we can speak of “undisturbed” air ahead of the airplane.
Behind the wing there is no cancellation of any kind; the downwash of the wing is only reinforced by the downward flow associated with the trailing vortices. There is plenty of downward momentum in any air column behind the wing.
This gives us a simple picture of the airplane’s interaction with the air: There is downward momentum in any air column that passes through the vortex loop (such as the loop shown in figure 3.29). There is no such momentum in any air column that is ahead of the wing, outboard of the trailing vortices, or aft of the starting vortex.
So now we can understand the momentum balance:
1. As the airplane flies along minute by minute, it imparts more and more downward momentum to the air, by enlarging the region of downward-moving air behind it.
2. The air imparts downward momentum to the earth.
3. The gravitational interaction between earth and airplane completes the circuit.
19.3 Sitting in a Rotating Frame
If we measure motion relative to a rotating observer, we cannot directly apply the laws of motion in the simple form that Newton published in the late 1600s. In this section and the next, we will use what we know about non-rotating reference frames to deduce the correct laws for rotating frames.
Suppose Moe is riding on a turntable; that is, a large, flat, smooth, horizontal rotating disk, as shown in figure 19.3. Moe has painted an X, Y grid on the turntable, so he can easily measure positions, velocities, and accelerations relative to the rotating coordinate system. His friend Joe is nearby, observing Moe’s adventures and measuring things relative to a nonrotating coordinate system.
turntable
Figure 19.3: Rotating and Non-Rotating Coordinate Systems
We will assume that friction between the puck and the turntable is negligible.
The two observers analyze the same situation in different ways:
Moe immediately observes that the first law of motion, it its simplest form, does not apply in rotating reference frames. In Joe’s nonrotating frame, the simple laws do apply.
Relative to the turntable, an unconstrained hockey puck initially at rest (anywhere except right at the center) does not remain at rest; it accelerates outwards. This is called centrifugal acceleration. In a nonrotating frame, there is no such thing as centrifugal acceleration. The puck moves in a straight line, maintaining its initial velocity, as shown in figure 19.4.
To oppose the centrifugal acceleration, Moe holds the puck in place with a rubber band, which runs horizontally from the puck to an attachment point on the turntable. By measuring how much the rubber band stretches, Moe can determine the magnitude of the force. Joe can observe the same rubber band. Moe and Joe agree about the magnitude and direction of the force.
Moe says the puck is not moving relative to his reference frame. The rubber band compensates for the centrifugal force. Joe says that the puck’s momentum is constantly changing due to the rotation. The rubber band provides the necessary force.
There are additional contributions to the acceleration if the rate of rotation and/or direction of rotation are unsteady. For simplicity, we will consider only cases where the rotation is steady enough that these terms can be ignored.
The centrifugal acceleration varies from place to place, so we call it a field. Section 19.5.1 discusses the close analogy between the centrifugal field and the familiar gravitational field.
The centrifugal field exists in a rotating reference frame
and not otherwise.
It must be emphasized that what matters is the motion of the reference frame, not the motion of the airplane. You are free to choose whatever reference frame you like, but others are free to choose differently. Pilots usually find it convenient to choose a reference frame comoving with the aircraft, in which case there will be a centrifugal field during turns. Meanwhile, however, an engineer standing on the ground might find it convenient to analyze the exact same maneuver using a non-rotating reference frame, in which case there will be no centrifugal field.
The centrifugal field comes from
the rotation of the reference frame
not the rotation of any particular object(s).
19.4 Moving in a Rotating Frame
We now consider what happens to an object that is moving relative to a rotating reference frame.
Suppose Moe has another hockey puck, which he attaches by means of a rubber band to a tiny tractor. He drives the tractor in some arbitrary way. We watch as the puck passes various marks (A, B, etc.) on the turntable.
Moe sees the puck move from mark A to mark B. The marks obviously are not moving relative to his reference frame. Joe agrees that the puck moves from mark A to mark B, but he must account for the fact that the marks themselves are moving.
So let’s see what happens when Joe analyzes the compound motion, including both the motion of the marks and the motion of the puck relative to the marks.
So far, we have identified four or five contributions (which we will soon collapse to three):
Description Scaling Properties
1. Suppose the puck is accelerating relative to Moe’s rotating frame (not just moving, but accelerating). Joe sees this and counts it as one contribution to the acceleration. This “F=ma” contribution is completely unsurprising. Both observers agree on how much force is required for this part of the acceleration. It is independent of position, independent of velocity, and independent of the frame’s rotation rate.
2. From Joe’s point of view, mark A is not only moving; its velocity is changing. Changing this component of the puck’s velocity requires a force. From Moe’s point of view, this is the force needed to oppose centrifugal acceleration, as discussed previously. This “centrifugal” contribution depends on position, but is independent of the velocity that Moe measures relative to his rotating reference frame. It is also independent of any acceleration created by Moe’s tractor. It is proportional to the square of the frame’s rotation rate.
3. The velocity of mark B is different from the velocity of mark A. As the puck is towed along the path from point A to point B, the rubber band must provide a force in order to change the velocity so the puck can “keep up with the Joneses”. This contribution is independent of position. It is proportional to the velocity that Moe measures, and is always perpendicular to that velocity. It is also proportional to the first power of the frame’s rotation rate.
4. The velocity of the puck relative to the marks is also a velocity, and it must also rotate as the system rotates. This change in velocity also requires a force. Just like contribution #3, this contribution is independent of position, proportional to the velocity relative to the rotating frame, perpendicular to that velocity, and proportional to the first power of the frame’s rotation rate.
5. We continue to assume that the frame’s rotation rate is not changing, and its plane of rotation is not changing. Otherwise there would be additional contributions to the equations of motion in the rotating frame.
Contribution #3 is numerically equal to contribution #4. The total effect is just twice what you would get from either contribution separately. We lump these two contributions together and call them the Coriolis effect.4
The Coriolis effect can be described as an acceleration (proportional to the object’s velocity), and equivalently it can be described as a force (proportional to the object’s momentum).
Let’s consider a reference frame attached to an eastward-rotating rotating planet, such as the earth. Near the north pole, the Coriolis acceleration is always toward your right, if you are facing forward along the direction of motion. Northward motion produces a Coriolis acceleration to the east; a very real westward force is necessary to oppose it if you want to follow a straight line painted on the earth. Eastward motion produces a Coriolis acceleration to the south; a very real northward force is necessary to oppose it.
The Coriolis argument only applies to motion in the plane of rotation. Momentum in the other direction (parallel to the axis of rotation) is unaffected. In all cases the Coriolis acceleration lies in the plane of rotation and perpendicular to the motion.
Near the equator, we have to be careful, because the plane of rotation is not horizontal. In this region, eastward motion produces a Coriolis acceleration in the upward direction, while westward motion produces a Coriolis acceleration in the downward direction. In this region, north/south motions are perpendicular to the plane of rotation and produce no Coriolis effects.
To reiterate: The Coriolis effect and the centrifugal field are two separate contributions to the story. The Coriolis effect applies only to objects that are moving relative to the rotating reference frame. The centrifugal field affects all objects in the rotating frame, whether they are moving or not.
The Corilois effect exists when there is motion
in the plane of rotation of the reference frame
and not otherwise.
* Magnitude of the Effect
Suppose you are in an airplane, flying straight ahead at 120 knots along the shortest path between two points on the earth’s surface. Because of the rotation of the earth, the airplane will be subject to a Coriolis acceleration of about 0.001G. This is too small to be noticeable.
Now suppose you and a friend are standing 60 feet apart, playing catch in the back of a cargo airplane while it is performing a standard-rate turn (three degrees per second). If your friend throws you the ball at 60 mph, it will be subject to a horizontal Coriolis acceleration of more than a quarter G. That means the ball will be deflected sideways about 2½ feet before it gets to you — which is enough to be quite noticeable. In normal flying, though, we don’t often throw things far enough to produce large Coriolis effects.
The wind, moving relative to the rotating earth, is subject to a Coriolis acceleration that is small but steady; the cumulative effect is tremendously important, as discussed in section 20.1.
19.5 Centrifuges with and without Gravity
19.5.1 The Centrifugal Field is as Real as Gravity
An airplane in a turn, especially a steep turn, behaves like a centrifuge. There are profound analogies between centrifugal and gravitational fields:
The gravitational field at any given point is an acceleration. It acts on objects, producing a force in proportion to the object’s mass. The centrifugal field at any given point is also an acceleration. It, too, acts on objects, producing a force in proportion to the object’s mass.
Strictly speaking, neither gravity nor centrifugity is a “force” field. Each is really an acceleration field. There is often a force involved, but it is always a force per unit mass, which is properly called an acceleration.
Einstein’s principle of equivalence states that at any given point, the gravitational field is indistinguishable from an acceleration of the reference frame.5 Relative to a freely-falling reference frame, such as a freely-orbiting space station, everything is weightless.
My laboratory is not a free-falling inertial frame. It is being shoved skyward as the earth pushes on its foundations. If you measure things relative to the laboratory walls, you will observe gravitational accelerations. Similarly, the cabin of a centrifuge is clearly not an inertial frame. If you measure things relative to the cabin, you will observe centrifugal accelerations.
From a modern-physics point of view, both local gravity and local centrifugity emerge as consequences of working in an accelerated frame. There is nothing wrong with doing so, provided the work is done carefully. Accounting for centrifugal effects is not much trickier than accounting for gravitational effects. When people think this can’t be done, it is just because they don’t know how to do it. To paraphrase Harry Emerson Fosdick:
Person saying it can’t be done
is liable to be interrupted by persons doing it.
For a ground-bound observer analyzing the flight of an airplane, it may be convenient to use a reference frame where gravity exists and centrifugity does not. However, the pilot and passengers usually find it convenient to use a frame that includes both gravity and centrifugity.
The centrifugal field is not crude or informal or magical. (The problem with magic is that it can explain false things just as easily as true things.) Like the gravitational field, it is a precise way of accounting for what happens when you work in a non-freely-falling reference frame.
19.5.2 Centrifuge
To get a better understanding of the balance of forces in a turning and/or slipping airplane, consider the centrifuge shown in figure 19.4. For the moment we will neglect the effects of gravity; imagine this centrifuge is operating in the weightless environment of a space station. We are riding inside the centrifuge cabin, which is shown in red. We have a supply of green tennis balls. At point A (the southernmost point of our path) we drop a tennis ball, whereupon it flies off as a free particle. Our centrifuge continues to follow its circular path.
centri-newt
Figure 19.4: An Object Departing a Centrifuge
Case 1a: Consider the point of view of a bystander (not riding in the centrifuge). The dropped tennis ball moves in a straight line, according to the first law of motion. Contrary to a common misconception, the bystander does not see the ball fly radially away from the center of the centrifuge. It just continues with the purely eastward velocity it had at point A, moving tangentially.
Case 1b: Consider our point of view as we ride in the centrifuge. At point A, the tennis ball has no velocity relative to us. For the first instant, it moves along with us, but then gradually it starts moving away. We do see the ball accelerate away in the purely radial direction. The tennis ball — like everything else in or near the centrifuge — seems to be subjected to a centrifugal acceleration field.
Einstein’s principle of equivalence guarantees that our viewpoint and the bystander’s viewpoint are equally valid. The bystander says that the centrifuge cabin and its occupants accelerate away from the freely moving tennis ball, while we say that the tennis ball accelerates away from us under the influence of the centrifugal field.
There is one pitfall that must be avoided: you can’t freely mix the two viewpoints. It would be a complete fallacy for the bystander to say “The folks in the cabin told me the tennis ball accelerated outward; therefore it must move to the south starting from point A”. In fact, the free-flying ball does not accelerate relative to the bystander. It will not wind up even one millimeter south of point A. It will indeed wind up south of our centrifuge cabin, but only because we have peeled off to the north.
Case 2a: Consider from the bystander’s point of view what happens to a ball that has not been released, but is just sitting on a seat in the centrifuge. The bystander sees the ball subjected to an unbalanced force, causing it to move in a non-straight path relative to the earth.
Case 2b: Consider the seated ball from the centrifuge-riders’ point of view. The force on the ball exerted by the seat is just enough to cancel the force due to centrifugal acceleration, so the forces are in balance and the ball does not move.
When analyzing unsteady motion, or when trying to calculate the motion of the centrifuge itself, it is often simpler to analyze everything from the bystander’s point of view, in which the centrifugal field will not appear. On the other hand, in a steady turn, is often easy and natural to use the centrifuge-riders’ point of view; in which all objects will be subject to centrifugal accelerations.
19.5.3 Centrifuge and Gravity
Now that we understand the basic idea, let’s see what happens when our centrifuge operates in the normal gravitational field of the earth. This is shown in figure 19.5. When the tennis ball departs the centrifuge, it once again travels in a purely easterly direction, but this time it also accelerates downward under the influence of gravity.
centri-eins
Figure 19.5: An Object Departing a Centrifuge, with Gravity
Once again, from inside the cabin we observe that the tennis ball initially accelerates away in the direction exactly away from the pivot of the centrifuge. This is no coincidence; it is because the only difference between our motion and the free-particle motion comes from the force in the cable that attaches us to the pivot.
Remember, the equivalence principle says that at each point in space, a gravitational field is indistinguishable from an accelerated reference frame. Therefore we need not know or care whether the tennis ball initially moves away from us because we are being accelerated, or because there is a gravitating planet in the vicinity, or both.
(The previous two paragraphs apply only to the initial acceleration of the dropped ball. As soon as it picks up an appreciable velocity relative to us, we need to account for Coriolis acceleration as well as gravitational and centrifugal acceleration.)
19.6 Centrifugal Effects in a Turning Airplane
Let’s examine the forces felt by the pilot in a turning airplane. We start with a coordinated turn, as shown in figure 19.6.
coord-plane-ball
Figure 19.6: Airplane in a Coordinated Turn
slip-plane-ball
Figure 19.7: Airplane in a Nonturning Slip
boat-plane-ball
Figure 19.8: Airplane in a Boat Turn
In figures such as this, whenever I am analysing things using the pilot’s point of view, the figure will include a rectangular “frame” with a little stick figure (the observer) standing in it. It is important to carefully specify what frame is being used, because even simple questions like “which way is down” can have answers that depend on which observer you ask. In particular, I define L-down (Lab-frame down) to mean the downward direction as observed some nearby terrestrial laboratory frame. In contrast, I define A-down (aircraft down) to be the downward direction in the reference frame attached to the aircraft. When the aircraft is turning, the two directions are not the same.
Using your inner ear, the seat of your pants, and/or the inclinometer ball, you can tell which way is A-down. Using the natural horizon and/or the artificial horizon, you can tell which way is L-down.
In figure 19.6, assume the airplane’s mass is one ton. Real gravity exerts a force of one ton, straight down toward the center of the earth. The airplane is an a 45 bank, so there is one ton of centrifugal force, sideways, parallel to the earth’s horizon. All in all, the wings are producing 1.41 tons of lift, angled as shown in the figure.
The lower part of figure 19.6 analyzes the forces on the inclinometer ball. Real gravity exerts a downward force on the ball, and centrifugity exerts a sideways force. The tubular race that contains the ball exerts a force perpendicular to the wall of the race (whereas the ball is free to roll in the direction along the race). The race-force balances the other forces when the ball is in the middle, confirming that this is a coordinated turn.
Next, we consider the forces on the airplane in an ordinary nonturning slip, as shown in figure 19.7. The right rudder pedal is depressed, and the port wing has been lowered just enough that the horizontal component of lift cancels the horizontal force due to the crossflow over the fuselage. The airplane is not turning. Everybody agrees there is no centrifugal field.
As a third example, we consider what happens if you make a boat turn, as shown in figure 19.8. (For more about boat turns in general, see section 8.11.) Because the airplane is turning, it and everything in it will be subjected to a centrifugal acceleration (according to the viewpoint of the centrifuge riders).
The lower part of figure 19.8 shows how the inclinometer ball responds to a boat turn. Gravity still exerts a force on the ball, straight down. Centrifugity exerts a force sideways toward the outside of the turn. The ball is subject to a force of constraint, perpendicular to the walls of the race. (It is free to roll in the other direction.) The only place in the race where this constraint is in a direction to balance the other forces is shown in the figure. The ball has been “centrifuged” toward the outside of the turn. This is a quantitative indication that the A-down direction is not perpendicular to the wings, and some force other than wing-lift is acting on the plane.
19.7 Angles and Rotations
19.7.1 Axes and Planes of Rotation: Yaw, Pitch, and Roll
Any rotation can be described by specifying the plane of rotation and the amount of rotation in that plane. (Note that in this chapter, the word “airplane” is always spelled out, using eight letters. In contrast, the word “plane” will be reserved to refer to the thin, flat abstraction you learned about in geometry class.)
rotations
Figure 19.9: Rotations: Yaw, Pitch and Roll
Three particularly simple planes of rotation are yaw, pitch, and roll, as shown in figure 19.9. If you want a really precise definition of these three planes, proceed as follows: First: The airplane has a left-right mirror symmetry, and it is natural to choose the plane of symmetry as the plane of pitch-wise rotations. Secondly: Within the symmetry plane, we somewhat-arbitrarily choose a reference vector, attached to the airplane, that corresponds to zero pitch angle. It is conventional to choose this so that level cruising flight corresponds to zero pitch. The exact choice is unimportant. The roll-wise plane is perpendicular to this vector. Thirdly: The yaw-wise plane is perpendicular to the other two planes.
Any plane of rotation – not just the three planes shown in figure 19.9 – can be quantified in terms of bivectors, as discussed in section 19.8.
Older books often speak in terms of the axis of rotation, as defined in figure 19.10. In the end, it comes to the same thing: for example, yaw-wise rotation is synonymous with a rotation about the Z axis.
We prefer to speak in terms of the plane of rotation. This is more modern, more sophisticated, and more in accord with the way things look when you’re in the cockpit: For example, in normal flight, when the airplane yaws, it is easy to picture the nose moving left or right in a horizontal plane. This is easier than thinking about the Z axis.
axes
Figure 19.10: Axes: X, Y and Z
Beware that older books give peculiar names to some of the axes. They refer to the Y axis as the lateral axis and the X axis as the longitudinal axis, which are sensible enough, but then they refer to Y-axis stability as longitudinal stability and X-axis stability as lateral stability — which seems completely reversed and causes needless confusion. Reference 17 calls the Z axis the normal axis, since it is normal (i.e. perpendicular) to the other axes — but that isn’t very helpful since every one of the axes is normal to each of the others. Other references call the Z axis the vertical axis, but that is very confusing since if the bank attitude or pitch attitude is not level, the Z axis will not be vertical. The situation is summarized in the following table.
This BookOlder Terminology
yaw bivector vertical axis
XY plane Z axis
yaw-wise stability directional stability
pitch bivector lateral axis
ZX plane Y axis
pitch-wise stability longitudinal stability
roll bivector longitudinal axis
YZ plane X axis
roll-wise stability lateral stability
19.7.2 Attitude: Heading, Pitch, Bank
The term attitude describes the orientation of the airplane relative to the earth. Attitude is specified in terms of three angles: heading, pitch, and bank. (These are sometimes called the Euler angles.)
Oddly enough, it turns out that heading, pitch attitude, and bank angle are not always equivalent to rotations around the yaw, pitch, and roll axes, although they are intimately related. The relationship can be established by following a simple recipe, as we now discuss.
To construct a specified attitude, imagine that the airplane starts in level flight attitude with the X axis pointed due north; then:
For reasons discussed in section 19.7.4, it is important to perform these rotations in the order specified: yaw, then pitch, then roll.
We have just seen how, given a set of angles, we can put the airplane into a specified attitude. We now consider the reverse question: given an airplane in some attitude, how do we determine the angles that describe that attitude?
Answer: just figure out what it would take to return the airplane to level northbound attitude. The rotations must be undone in the reverse of the standard order:
If you do not follow the recipes given above, all bets are off, as you can see from the following example: Suppose you start out in level flight, and then roll 90 degrees. This is sometimes called the knife-edge attitude. Then:
See section 19.7.4 and section 19.7.5 for more about this.
19.7.3 Angle Terminology
The following table summarizes the various nouns and verbs that apply to angles and motions in the three principal directions:
XY planeZX planeYZ plane
Motionit yawsit pitchesit rolls
Anglethe headingthe pitch attitudethe bank attitude
Here are a few more fine points of angle-related terminology:
* Other Angles
To define the angle of attack of the fuselage, take the direction of flight (or its reciprocal, the relative wind) and project it onto the XZ plane. The angle of attack is the angle between this projection and the X axis or some other convenient reference.
To define the slip angle, take the direction of flight (or the relative wind) and project it onto the XY plane. The slip angle is the angle between this projection and the X axis. It can be most easily perceived with the help of a slip string, as discussed in section 11.3.
Some aerodynamics texts use the term sideslip angle, which is synonymous with slip angle. Don’t forget the somewhat-subtle distinction, as discussed in section 11.5.1:
The sideslip angle is exactly the same thing as the slip angle. The sideslip maneuver is different from the forward slip maneuver.
19.7.4 Yaw Does Not Commute with Pitch
It is a fundamental fact of geometry that the result of a sequence of rotations depends on the order in which the rotations are performed.
Note that for a sequence of ordinary non-rotational movements, the ordering does not matter. That is, suppose I have two small objects that start out at the same place on a flat surface. I move one object move two feet north, and then three feet west. I move the other object the same distances in the other order: three feet west and then two feet north. Assuming there are no obstructions, both objects will arrive at the same destination. The ordering of the movements does not matter.
However, angles don’t play by the same rules as distances. For instance, there are ways of changing the yaw angle (i.e., the heading) by 37 degrees (or any other amount) without ever yawing the airplane. That is, starting from straight and level flight:
If the aircraft (and its occupants) can tolerate heavy G loads, such maneuvers are perfectly fine ways to make tight turns at high airspeed.
In non-aerobatic flight, a less-extreme statement applies: a rotation in a purely horizontal plane is not a pure yaw when the aircraft is not in a level attitude. For instance, suppose you are in level flight, steadily turning to the left. This is, of course, a turn in a purely horizontal plane. Further suppose that you have a nose-up pitch attitude, while still maintaining a level flight path, as could happen during slow flight. This means that the plane of yaw-wise rotations is is not exactly horizontal. You could, in principle, perform the required heading change by pitching down to level pitch attitude, performing a pure yaw, and then pitching back up, but since rotations are not commutative this is not equivalent to maintaining your pitch attitude and performing a pure yaw. Performing the required change of heading without pitching down requires mostly pure leftward yaw, but involves some rightward roll-wise rotation also.
The analysis in the previous paragraph is 100% accurate, but completely irrelevant when you are piloting the airplane.6 Arguing about whether the heading change is a pure yaw or a yaw plus roll is almost like arguing about whether a glass of water is half full or half empty — the physics is the same. In this case the physics is simple: the inside (left) wing follows a horizontal circular path, while the outside (right) wing follows a slightly longer horizontal path around a larger circle.
It is easy to see why that is so: The turn requires a rotation in a horizontal plane. Such a rotation moves the wingtips (and everything else) in purely horizontal directions. As long as the airplane’s center-of-mass motion is also horizontal, the rotation can only change the speeds, not the angles, of the airflow.
Now, things get more interesting when the direction of flight is not horizontal. Therefore let us consider a new example in which you are climbing while turning. That means your flight path is inclined above the horizontal. As before, you are turning to the left at a steady rate.
In any halfway-reasonable situation, the direction of flight will very nearly lie in the plane of yaw-wise rotations. Having it not exactly in the plane is just a distraction from the present topic, so I hereby define a new plane of “yaw-like” rotations which is defined by the direction of flight and the good old Y axis (the wingtip-to-wingtip direction). The pitch-wise rotations remain the same, and we define a new plane of “roll-like” rotations perpendicular to the other two. We assume zero slip angle for simplicity.
As the airplane flies from point to point along its curving path, its heading must change. This is a rotatation in a purely horizontal plane. In climbing flight, the yaw-like direction is not exactly horizontal, so the turn is not pure yaw. The turn moves the inside wingtip horizontally backwards, relative to where it would be if there were no heading change. In contrast, a pure yaw-like rotation would have moved the wing back and down. Therefore we need not just leftward yaw-like rotation but also some rightward roll-like rotation to keep the wingtip moving along the actual flight path.
This roll-like motion means that (other things being equal) the inside wingtip would fly at a lower angle of attack during a climbing turn. Less lift would be produced. You need to deflect the ailerons to the outside to compensate.
Note that I said less lift “would be” produced, not “is” produced. That’s because I’m assuming you have compensated with the ailerons, so that both wings are producing the same amount of lift, as they should. Remember that this is a steady turn, so no force is required to maintain the steady roll rate. (Remember, according to the laws of motion, an unbalanced force would create an acceleration in the roll-wise direction, which is not what is happening here.) There are widespread misconceptions about this. Because of the roll-like motion, the air will arrive at the two wings from two different directions. You deflect the ailerons, not in order to create a wing-versus-wing difference in the magnitude of lift, but rather to avoid creating such a difference.
The best you can do is to keep the magnitude of the lift the same. The direction of the lift will be twisted, as discussed in section 8.9.5; see in particular figure 8.7. You will need to deflect the rudder to overcome the resulting yawing moment. This will be in the usual direction: right rudder in proportion to right aileron deflection, and left rudder in proportion to left aileron deflection.
In a climbing turn, the differential relative wind combines with the differential wingtip velocity to create a large overbanking tendency. In an ordinary descending turn, the relative wind effect tends to oppose the velocity effect. In a spin, the differential relative wind is a key ingredient, as discussed in section 18.6.1, including figure 18.6. Also, section 9.7 analyzes climbing and descending turns in slightly different words and gives a numerical example.
19.7.5 Yaw Does Not Commute with Bank
As stated above, a rotation in a purely horizontal plane is not a pure yaw when the aircraft is not in a level attitude. In the previous section we considered the consequences of a non-level pitch attitude, but the same logic applies to a non-level bank attitude. The latter case is in some sense more significant, since although not all turns involve a non-level pitch attitude, they almost always involve a bank.
You could perform the required rotation by rolling to a level attitude, performing a pure yaw, and then rolling back to the banked attitude. This is not equivalent to performing a pure yaw while maintaining constant bank. For modest bank angles, the constant-bank maneuver is mostly pure yaw, but involves some rotation in the pitch-wise direction as well. Because of this pitch-wise rotation, the relative wind hits the wing and the tail at slightly different angles. You will need to pull back on the yoke slightly to compensate. This pull is in addition to whatever pull you might use for controlling airspeed during the turn. You can see that the two phenomena are definitely distinct, by the following argument: suppose that you maintain constant angle of attack during the turn, so that the required load factor is produced by increased airspeed not increased angle of attack. You would still need to pull back a little bit, to overcome the noncommutativity.
19.8 Torque and Moment
Just as the first law of motion says that to start an object moving byou have to apply a force, there is a corresponding law that says to start an object turning you need to apply a torque.
You may have heard of the word “torque” in conjunction with left-turning tendency on takeoff, and you may have heard of the word “moment” in conjunction with weight & balance problems. When pilots talk about moment, they usually mean a particular type of moment that is equal to a torque. In other contexts, there exist other types of moments that are not equal to torque; examples include moment of inertia and dipole moment. We don’t need to discuss such things in detail, but you should be aware that they exist. In the present context, you can more-or-less assume that moment means torque. In particular,
A familiar example: fuel and cargo cause a pitching moment, depending on how far forward or aft they are loaded. By the same token, they will cause a rolling moment if they are loaded asymmetrically left or right.
Another familiar example: gyroscopic effects are known for causing yaw-wise torques. By the same token, they can cause pitch-wise torques as well.
Torque is not the same as force. Of the two, force is the more familiar concept. In introductory physics courses, they focus attention on zero-sized pointlike particles, in which case there is only one place where the force can be applied, and you don’t need to worry about torque.
To apply a torque, you need a force and a lever-arm. The amount of torque is defined by the following formula:
torque = arm ∧ force (19.2)
where the arm (also called lever arm) is a vector representing the separation between the pivot-point7
and the point where the force is applied. In this formula, we are multiplying vectors using the geometric wedge product, denoted “∧”.8 The wedge product of two vectors is called a bivector, and is represented by an area, namely the area of the parallelogram spanned by the two vectors, as shown in figure 19.11. All five bivectors in the figure are equivalent, as you can confirm by counting squares.
bivector-equiv
Figure 19.11: Torque: Equivalent Bivectors
A vector (such as force) has geometric extent in one dimension. The drawing of a vector has a certain length. This is in contrast to scalars, which have no geometric extent. They are zero-dimensional, and are drawn as points with no size. A bivector (such as torque) has geometric extent in two dimensions. The drawing of a bivector has a certain area. In particular, the torque in figure 19.13 is represented by an area in the plane of the paper.
A vector points in a definite direction. It is drawn with an arrowhead on one end. A bivector has a definite direction of circulation. It is drawn with arrowheads on its edges.
When constructing a bivector from two vectors, such as A ∧ F, you determine the direction of circulation by going in the A direction then going in the F direction, not vice versa. In particular, F ∧ A = − A ∧ F, which tells us the two bivectors are equal-and-opposite.
When the force and the lever-arm are perpendicular, the magnitude of the torque is equal to the magnitude of the force times the length of the lever-arm, which makes things simple. If the two vectors are not perpendicular, pick one of them. Then keep the component of that vector perpendicular to the other vector, throwing away the non-perpendicular component. What remains is two perpendicular vectors, and you can just multiply their magnitudes.
Torque is measured not in pounds but in footpounds (that is, feet times pounds); the corresponding metric unit is newtonmeters. 9
Figure 19.12 shows a situation where all the forces and torques are in balance. On the right side of the bar, a group of three springs is exerting a force of 30 pounds. On the left side of the bar, there is a group of two springs (exerting a force of 20 pounds) and a single spring (exerting a force of 10 pounds). Since the total leftward force equals the total rightward force, the forces are in balance.
torque-balance
Figure 19.12: Forces and Torques in Balance
To show that the torques are in balance requires a separate check. Let’s choose the point marked “x” as our pivot point. The rightward force produces no torque, because it is attached right at the pivot point — it has a zero-length lever arm. The group of two springs produces a counterclockwise torque, and the single spring produces a clockwise torque of the same magnitude, because even though it has half as much force it has twice the lever arm. The torques cancel. The system is in equilibrium.
torque-unbalance
Figure 19.13: Forces in Balance but Torques NOT in Balance
Figure 19.13 shows a different situation. The forces are in balance (20 pounds to the right, 20 pounds total to the left) but the torques are not in balance. One of the left-pulling springs has twice the lever arm, producing a net clockwise torque. If you tried to set up a system like this, the bar would immediately start turning clockwise. The system is out of equilibrium.
19.9 Angular Momentum
The notion of angular momentum is the key to really understanding rotating objects.
Angular momentum is related to ordinary straight-line momentum in the same way that torque is related to ordinary straight-line force. Here is a summary of the correspondences:
Straight-line concept
Angular concept
Force Torque (equals force times lever arm)
Momentum Angular momentum (equals ordinary momentum times lever arm)
The ordinary momentum of a system won’t change unless a force is applied. The angular momentum of a system won’t change unless a torque is applied.
Force equals momentum per unit time. Torque equals angular momentum per unit time.
When I give lectures, I illustrate conservation of angular momentum using a demo you can easily set up for yourself. As illustrated in figure 19.14, tie some kite string to a small bean-bag and swing it in a circle. When you pull on the free end of the string (reducing the radius of the circle) the bean-bag speeds up. When you let out the string (increasing the radius of the circle) the bean-bag slows down.10
angular-pull
Figure 19.14: Conservation of Angular Momentum
In typical textbooks, conservation of angular momentum is exemplified by spinning ice skaters, but I find it easier to travel with a bean-bag (rather than an ice skater) in my luggage.
In the demonstration, there are some minor torques due to friction than will eventually slow down the bean-bag whether or not you shorten or lengthen the string, but if you perform the experiment quickly enough the torques can be neglected, and the angular momentum of the system is more or less constant. Therefore, if you decrease the lever arm by a factor of N, the straight-line momentum must increase by a factor of N (since their product cannot change).11
Since the tangential velocity increases by a factor of N, and the radius decreases by a factor of N, the rate of turn (degrees per second) increases by a factor of N squared.
The energy of the system also increases by a factor of N squared. You can feel that you added energy to the system when you pull on the string, pulling against tension.
So far we have analyzed the situation from the point of view of a bystander in a non-rotating reference frame. You can reach the same conclusion by analyzing the situation in the rotating reference frame, as would apply to an ant riding on the bean-bag. The ant would say that as the string is pulled in, the bean-bag accelerates sideways because of the Coriolis effect, as discussed in section 19.4.
Conservation of angular momentum applies to airplanes as well as bean-bags. For instance, consider an airplane in a flat spin, as discussed in section 18.6.4. In order to recover from the spin, you need to push the nose down. This means whatever mass is in the nose and tail will move closer to the axis of rotation. The angular momentum of the airplane doesn’t change (in the short run), so the rotation will speed up (in the short run). More rotation may seem like the opposite of what you wanted, but remember you are trying to get rid of angular momentum, not just angular rate. You should persevere and force the nose down. Then the aerodynamic forces (or, rather, torques) will carry angular momentum out of the system and the rotation will decrease.
Angular momentum is a bivector, like torque (section 19.8). It lies more-or-less12 in the plane of rotation.
19.10 Gyroscopes
19.10.1 Precession
For any normal object (such as a book) if you apply a force in a given direction, it will respond with motion in that direction. People are so accustomed to this behavior that they lose sight of the fact that force and motion are not exactly the same thing, and they don’t always go together.
In particular, for a gyroscope, if you apply a torque in one direction it will respond with motion in a different direction. When I give my “See How It Flies” lectures, I carry around a bicycle wheel with handles, as shown in figure 19.15. The indicated direction of spin corresponds to a normal American engine and propeller, if the nose of the airplane is toward the left side of the diagram.
wheel
Figure 19.15: Bicycle Wheel with Handles
To demonstrate the remarkable behavior of a gyroscope, I stand behind the “propeller” (on the right side of the diagram) and support its weight by lifting the rear handle only. The force of gravity acts on the center of the system, so there is a pure nose-down / tail-up pitching moment. If this were a normal, non-spinning object, it would respond by pitching in the obvious way, but the gyroscope actually responds with a pure yawing motion. I have to turn around and around to my left to stay behind the wheel.
It is really quite amazing that the wheel does not pitch down. Even though I am applying a pitch-wise torque, the wheel doesn’t pitch down; it just yaws around and around.
gyro-precession
Figure 19.16: Gyroscopic Precession
This phenomenon, where a gyro responds to a torque in one direction with a motion in another direction, is called gyroscopic precession.
For a gyroscope, a torque in the pitch-wise direction produces a motion in the yaw-wise direction. If you try to raise the tail of a real airplane using flippers alone, it will yaw to the left because of precession.
This effect is particularly noticeable early in the takeoff roll in a taildragger, when you raise the tail to keep the airplane on the ground while you build up speed. If the airplane were an ordinary non-spinning object, you could raise the tail just by pushing on the yoke. However, note that airflow over the flippers does not actually dictate the motion of the airplane; it just produces a torque in the pitch-wise direction. When you combine this torque to the angular momentum of the engine, the result is pronounced precession to the left. You need to apply right rudder to compensate.
Another place where this is noticeable is during power-on stall demonstrations. You need a downward pitch-wise torque to make the non-rotating parts of the airplane pitch down. However, this same pitch-wise torque, when added to the angular momentum of the engine, causes yaw-wise precession to the left. You need right rudder to compensate.
To get a gyroscope to actually move in the pitch-wise direction, you need to apply a torque in the yaw-wise direction — using the rudder.
Of course, an airplane has some ordinary non-rotating mass in addition to its gyroscopic properties. In order to lift this ordinary mass you need to use the flippers. Therefore, the tail-raising maneuver requires both flippers and rudder — flippers to change the pitch of the ordinary mass, and rudder to change the pitch of the gyroscope.
19.10.2 Precession: Which Way and How Much
Let’s try to understand what causes precession, so we can predict which way the airplane will precess, and how much. Consider what happens when a torque is applied for a certain small time interval (one second or so). This will contribute some angular momentum to the system. Remember: torque is angular momentum per unit time. Then we just add this contribution to the initial angular momentum, and the result is the final angular momentum.
Angular momentum is a bivector. Figure 19.17 shows the bivectors involved in the precession, and figure 19.18 is an exploded view showing how to add bivectors. We add bivectors edge-to-edge, in analogy to the way we add ordinary vectors tip-to-tail. In this example, edge b adds tip-to-tail to edge x to form the top edge of the sum. Similarly, edge z adds tip-to-tail to edge d to form the bottom edge of the sum. Edge c cancels13 edge w since they are equal and opposite. Edges a and y survive unchanged to become the vertical edges of the sum.
angular-precession
Figure 19.17: Angular Momentum Explains Precession
bivector-expl
Figure 19.18: Addition of Bivectors – Exploded View
We see that the new angular momentum differs from the old angular momentum by a yaw to the left. That’s the correct answer.
During subsequent time intervals, the torque will be a new direction because the whole system has rotated. The successive changes will cause the system (wheel, axle, and everything attached to it) to keep turning in the horizontal plane, yawing to the left.
Beware: This gyroscope law might seem roughly similar to the Coriolis effect (force in one direction, motion in a perpendicular direction) but they do not represent the same physics. The Coriolis law only applies to objects that are moving relative to a rotating observer. In contrast, the gyroscope law applies to a stationary observer, and a wheel precesses even though no part of the wheel is moving relative to other parts.
Gyroscopic effects only occur when the there is a change in the orientation of the gyro’s plane of rotation. You can take a gyro and transport it north/south, east/west, or up/down, without causing any precession, as long as the gyro’s plane of rotation remains parallel to the original plane of rotation. You can even roll an airplane without seeing gyroscopic effects due to engine rotation, since the roll leaves the engine’s plane of rotation undisturbed.
You can figure it out by adding the bivectors. Right rudder deflection will cause a pitch-wise precession in the nose-down / tail-up direction. Pushing on the yoke causes a yaw-wise precession to the left.
If you have a lightweight airframe and a heavy, rapidly spinning propeller, watch out: the flippers will cause yawing motion and the rudder will cause pitching motion.
If you want to make a gyro change orientation quickly, it will take more torque than doing it slowly.
19.10.3 Inertial Platform
We now consider what happens when a gyro is not subjected to any large torques.
Suppose we support a gyroscope on gimbals. The gimbals support its weight but do not transmit any torques to it, even if the airplane to which the gimbals are mounted is turning. We call this a free gyro since it is free to not turn when the airplane turns.
Even though the gyro is small, it has a huge amount of angular momentum, because it is spinning so rapidly. Any small torque applied to the gyro (because of inevitable imperfections in the gimbals) will, over time, change the angular momentum — but over reasonably short times the change is negligible compared to the total.
In such a situation, the gyro will tend to maintain fixed orientation in space. We say that the gyro is an inertial platform with respect to rotations.14 Other books say the gyro exhibits rigidity in space but that expression seems a bit odd to me.
19.11 Gyroscopic Instruments
We now discuss the principles of operation of the three main gyroscopic instruments: artificial horizon (attitude indicator), directional gyro (heading indicator), and rate of turn gyro (turn needle or turn coordinator).
19.11.1 Heading Indicator
The directional gyro is a free gyro. It establishes an inertial platform.
The gyro spins in some vertical plane; that is, its angular momentum vector points in some arbitrary horizontal direction. A system of gears measures the angle that the angular momentum vector makes in the XY plane15 and displays it to the pilot. The trick is to measure the angle and support the gyro while minimizing the accidental torques on it. Imperfections in the mechanism cause the gyro to precess; therefore, every so often the heading indication must be corrected, typically by reference to a magnetic compass.
19.11.2 Artificial Horizon
The artificial horizon (also known as the attitude indicator) is another free gyro. This gyro’s plane of rotation is horizontal; that is, its angular momentum vector is vertical. A mechanical linkage measures the angle that this vector makes in the YZ (bank) and XZ (pitch) planes, and displays it to the pilot.
It is instructive to compare the horizon gyro (which tells you which way is “down”) with the inclinometer ball or a plumb-bob on a string (which has a different notion of which way is “down”). The distinction is that the plumb-bob tells you which way is A-down, while the gyro is designed to tell you which way is L-down (toward the center of the earth). Whenever the airplane is being accelerated (e.g. during the takeoff roll or during a turn), the two directions are quite different. As seen in figure 19.19, during a turn the A-down vector gets centrifuged to the outside of the turn; the L-down vector always points to the center of the earth.
a-l-down
Figure 19.19: A-Down versus L-down During a Turn
As you can see in figure 19.19,
To a first approximation, the horizon gyro works just by remembering which way is L-down. However, no gyro can remember anything forever, so the instrument contains an “erecting mechanism” that makes continual small adjustments. You would like it to align the gyro axis with L-down — but the mechanism doesn’t know which way is L-down! It knows which way is A-down (the same way the plumb-bob does), but according to Einstein’s principle of equivalence, it cannot possibly know what components of A-down are due to gravity and what components are due to acceleration. The erecting mechanism does, in fact, continually nudge the gyro axis toward A-down, but the result is a good approximation to L-down, for the following reason: if you average the A-down vectors over an entire turn, they average out to L-down.
If you average the discrepancies over an entire turn, they cancel. This is why a gyro is vastly more valuable than a plumb-bob: The gyro can perform long-term averaging, whereas a plumb-bob can’t.
Technical note: Even in the ordinary terrestrial lab frame, you need to account for a small amount of centrifugal field, because the earth itself is rotating. That means that the conventional notion of “down” does not point toward the center of the earth. At temperate latitudes, it’s off by about a tenth of a degree. This is not immediately noticeable, for several reasons:
On the other hand, the earth’s rotation is certainly noticeable if you look closely enough: (a) You can easily see that the earth rotates relative to the stars. (b) Centrifugal forces cause the earth to be ellipsoidal rather than spherical, and you can notice this if you have a good-enough map: A degree of latitude is about 1% longer at the pole than at the equator. (c) Consider the directional gyro in an aircraft. A simple gyroscope will drift relative to the earth – or, rather, the earth will drift relative to the gyro – even if the aircraft is sitting on the taxiway, with the brakes set. This is most obvious at the north pole, where the earth rotates 15 per hour, while the simple gyro does not.
A real directional gyro instrument is not so simple. For one thing, it is only sensitive to rotation in the aicraft’s XY plane, which is normally horizontal. Therefore, at the equator it doesn’t respond to the earth’s rotation at all. More generally, the effect is proportional to the sine of the latitude. Secondly, the instrument has a so-called latitude nut that can be adjusted to cancel the rotation of the earth, for some chosen latitude. However, if you fly somewhere else, the cancellation will be imperfect.
* Artificial Horizon Errors
Let’s look again at figure 19.19. If you only make half a turn, the discrepancies don’t average to zero, and the attitude indicator will be slightly inaccurate for a while. Analogous errors occur during takeoff, because the gyro’s estimate of “down” gets dragged backwards by the acceleration, so the artificial horizon will be a little bit below the true forward horizon for a while thereafter. The averaging time for a typical instrument is about five minutes.
Sometimes you find an old, worn-out instrument in which the gyro isn’t spinning as fast as it should. As a result, its memory gets shorter, and the systematic errors become larger.
19.11.3 Rate-of-Turn Gyro
There are two slightly different types of rate-of-turn gyro: (a) the rate-of-turn needle, and (b) the turn coordinator.
In both cases, the gyro is not free; it is a rate gyro. That is, its plane of rotation is more-or-less firmly attached to the airplane. It does not have gimbals. It is forced to change orientation when the airplane yaws.16 The instrument measures how much torque is required to re-orient the gyro.
Sometimes the rate-of-turn needle is built to spin in the pitch-wise (ZX) plane, in which case the airplane’s yawing motion requires a torque in the roll-wise (YZ) direction. Other models spin in the roll-wise (YZ) plane, in which case yaw requires a torque in the pitch-wise (ZX) direction. In principle, the spin and the torque could be in any pair of planes perpendicular each other and perpendicular to the yaw-wise (XY) plane.17
The required torque is proportional to (a) the rate of change of orientation, and (b) the angular momentum of the gyro. Therefore an accurate rate-of-turn gyro must spin at exactly the right speed, not too fast or too slow. (This is in contrast to the directional gyro and the artificial horizon gyro, which just have to spin “fast enough”.)
Many rate gyros incorporate a sneaky trick. They spin around the pitch-wise (ZX) plane, with the top of the gyro spinning toward the rear. They also use a spring that is weak enough to allow the gyro to precess a little in the roll-wise (YZ) direction. In a turn to the left, precession will tilt the gyro a little to the right. That means that during a turn, the gyro’s tilt compensates for the airplane’s bank, leaving the gyro somewhat more aligned with the earth’s vertical axis. The goal, apparently, is to create an instrument that more nearly indicates heading change (relative to the earth’s vertical axis) rather than simply rotation in the airplane’s yaw-wise (XY) plane, which is not exactly horizontal during the turn. Since the relationship between bank angle and rate of turn depends on airspeed, load factor, et cetera, this trick can’t possibly achieve the goal except under special conditions.
The turn coordinator is very similar to the rate-of-turn needle. It displays a miniature airplane instead of a needle. The key operational difference is that it is slightly sensitive to rate of roll as well as rate of heading change. To create such an instrument, all you have to do is take a rate-of-turn instrument, tilt the mechanism nose-up by 20 or 30 degrees, and change the display.
The advantage of a turn coordinator is that it helps you anticipate what actions you need to take. That is, if the airplane has its wings level but is rolling to the right, it will probably be turning to the right pretty soon, so you might want to apply some aileron deflection. The disadvantage has to do with turbulence. Choppy air oftentimes causes the airplane to roll continually left and right. The roll rate can be significant, even if the bank angle never gets very large. The chop has relatively little effect on the heading. In such conditions a plain old rate-of-turn needle gives a more stable indication than a turn coordinator does.
It is rather unfortunate that the display on a turn coordinator is a miniature airplane that banks left and right. This leads some people to assume, incorrectly, that the instrument indicates bank angle, which it most definitely does not, as you can demonstrate by performing a boat turn (section 8.11).
19.12 Some Fine Points about Energy and Conservation
The main discussion of energy is in chapter 1 and chapter 7. This section clarifies a few fine points, for the benefit of experts.
19.12.1 Vernacular «Energy»
Beware that the physics notion of energy differs from the vernacular notion of «energy».
Physics Energy Vernacular «Energy»
The physics energy is simple, well-defined, and well-behaved. When the Department of Energy talks about «energy», they are referring to some vernacular notion of «available» energy or «useful» energy. This is super-important, but very hard to define.
In this book, when we use the word energy (except within scare quotes) we are talking about the physics energy. Questions of «usefulness» belong more to economics or philosophy than to physics, and the answers tend to be highly subjective and context-dependent.
The physics energy cannot be created or destroyed. There are no sources. There are no sinks. The laws of nature guarantee it. The DoE is always looking for new sources of «energy». Obviously they’re not talking about the physics energy.
It must be emphasized that the vernacular notion of «energy» is not wrong; it’s just different from the physics energy. You should not try to unlearn the vernacular notion, but you must learn the physics notion also. This is confusing, but there’s no alternative. It has nothing to do with physics; it’s just how the language works. Words have multiple meanings. For example, a lap in the swimming pool is quantitatively, qualitatively, and conceptually different from a lap on the race track. Context matters. In physics context, you have to use the physics definition.
19.12.2 Vernacular «Conservation»
Beware that the physics notion of conservation differs from the vernacular notion of «conservation».
Physics Conservation Vernacular «Conservation»
Physics conservation (such as conservation of energy or conservation of electric charge) means that something can flow from place to place, but can never be created or destroyed. Vernacular «conservation» (such as «conservation» of endangered wildlife) means to protect something from waste or loss.
Combining this with section 19.12.1, we see that when the DoE asks you to «Conserve Energy» they are using neither the physics notion of energy nor the physics notion of conservation. If you’re not careful, you can suffer from two profound misconceptions in a single two-word phrase.
19.12.3 Energy versus Entropy
Loosely speaking, we sometimes say that energy is “dissipated” during an irreversible process. That’s not entirely wrong, but if you’re not careful it can be misleading. The fact is, in all cases, dissipation and irreversibility can be understood in terms of entropy and not otherwise.
Energy and entropy are two different things. Energy is governed by the first law of thermodynamics (i.e. conservation of energy), while entropy is governed by the second law of thermodynamics. Energy is not defined in terms of entropy, nor vice versa.
In particular, you should avoid any notion of «degraded» energy. In a steam engine, there are three things to keep track of: energy, water, and entropy. Dissipation does not «degrade» the energy any more than it «degrades» the water. Dissipation leaves you with the same energy, the same water, and extra newly-created entropy.
Dissipation and irreversibility can be understood
in terms of entropy and not otherwise.
The details of what entropy is and how it behaves are beyond the scope of this book. Qualitative, intuitive notions of irreversibilty are adequate for present purposes.
1
The expression “equal and opposite” refers to vectors that are equal in magnitude and opposite in direction.
2
In the olden days, this was expressed in terms of an “action” and an “equal and opposite reaction”, but the meaning of those words has drifted over the centuries. Momentum is the modern term.
3
Troublemakers sometimes point out that lift actually is slightly reduced in a steady descent, since part of the weight is being supported by drag. To this I retort: (a) this is an obscure technicality, based on details of the definitions of the four forces (as given in section 4.1); (b) the magnitude of the reduction is negligible in ordinary flying, (c) the lift is reduced for climbs as well as descents — so this technicality certainly does not explain the motion, and (d) when we consider the total upward force, there is no reduction.
4
It is easy to find hand-waving explanations of the Coriolis effect that overlook one or the other of the two contributions, and are therefore off by a factor of two. Beware.
5
If you consider multiple widely-separated points, you can distinguish gravity versus centrifugity versus straight-line acceleration by checking for nonuniformities in the fields. However, an airplane is so small compared to the planet, and so small compared to its turning radius, that these nonuniformities do not provide a very practical way of telling one field from another.
6
It might be relevant if you are designing an airplane or a flight simulator.
7
The pivot-point is also known as the datum. Force is measured in pounds or newtons; torque is measured in inch·pounds or newton·meters.
In some cases you already know the forces are in balance and you are just trying to figure out whether the torques are in balance. In such a case, it doesn’t matter what point in the airplane you choose as the pivot-point, provided you measure all lever arms from the same point.
8
Some other books try to calculate the torque using a “cross product” but the wedge product is much nicer. The wedge product is in some sense complimentary to the dot product used in section 4.5.
9
Sometimes you see these written as hyphenated words (foot-pounds or newton-meters) in which case the hyphen should not be mistaken for a minus sign. A foot-pound is a foot times a pound, not a foot minus a pound.
10
It is best to feed the string through a small smooth tube, rather than just your bare hand. You might use a poultry baster, or the axial hole in a spool of thread.
11
The bean-bag acquires the necessary straight-line momentum, and energy, via the string. It cannot acquire angular momentum from the string, since that would require a lever arm perpendicular to the force. Since the string can only exert a force parallel to itself, the lever arm is zero, so the torque is zero.
12
For an object rotating around an axis of symmetry, the angular momentum lies exactly in the plane of rotation; for odd off-axis rotations this might not be true.
13
As we have just discussed, it is OK join c to w. Alternatively, you could join a to y and get the same answer. In contrast, it would not make sense to join c to y, for the following reasons: Edge y is not opposite to c, so this pair would not drop out of the sum. Also, this would make us unable to add z to d tip-to-tail; they woud be tail-to-tail. Similarly, it would make us unable to add x to b tip-to-tail; they would be tip-to-tip.
14
An even fancier inertial platform would keep a position (not just orientation) independent of straight-line accelerations.
15
See figure 19.10 for the definition of the X, Y, and Z directions.
16
The instrument is not directly sensitive to any change in the direction the airplane is going, just to changes in the direction it is pointing.
17
The X, Y, and Z directions are defined in figure 19.10.
Previous Up Next
[Previous][Contents] [Marketing Needed -- Can You Help?]
Copyright © 1996-2005 jsd
|
__label__pos
| 0.92583 |
Run methode simultaneously
my question refer to gol libp2p
i want to create three peers : two peers exucute a function in parallèle and the result must be send to another peer the cordinator (or the validator).
any help please to start implementig my network with libp2p
You can set up a pub/sub chanel for tasks. When the validator emits a task a worker answer with “i’ll take that” with a timstamp. The other nodes see that the task was taken. If they answered at the same time, they compare the timestamp to see if they answered just before the ither peer, or just after. The first one gets the task. The validator sends the task direcrly to this peer. When it finishes, it sents it to the validator(no need to polute the chanel).
You might want to set up peering agreements between all the peers.
|
__label__pos
| 0.934814 |
Felhasználói eszközök
Eszközök a webhelyen
Munkafüzetlisták
Djeeni allows you to work with a set of workbooks by repeating steps for a worksheet of each workbook in the set. You should use WBook List Start and WBook List Next to create a loop:
WBook List Start <workbook list>
...Process Steps repeated for a worksheet in each workbook from <workbook list>...
WBook List Next
All workbooks in a workbook list are either source or target workbooks. You can nest workbook lists to use multiple source and target workbooks at the same time:
WBook List Start <source workbooks>
... Process steps for each source worksheet...
WBook List Start <target workbooks>
...Process Steps repeated for each source-target worksheet pair...
WBook List Next
WBook List Next
Please note that if in the above example we have 3 source files and 2 target files then the steps in the inner workbook list are executed 6 times (source1-target1, source2-target1, source3-target1, source1-target2, source2-target2, source3-target2).
The filenames in a source file list can contain wildcard characters ? (1 character in the filename of the workbook) and * (several characters in the filename of the workbook). The workbook list can contain several filenames separated by semicolons (;). Examples:
c:\reports\jan2020.xlsx 'one file
c:\reports\jan201?.xlsx 'all January reports 2010-2019
c:\inputs\*.xlsx 'all files from the inputs folder
c:\company1\report.xlsx; c:\company2\report.xlsx 'workbooks from different folders
|
__label__pos
| 0.999918 |
One ________ Equals About 768 Pages Of Text. – (FIND THE ANSWER)
One Megabyte Equals About 768 Pages Of Text
A megabyte is a unit of digital storage used to measure computer memory or storage capacity. It is usually referred to as MB, and it is usually used as a measure of a computer’s RAM capacity. Many people wonder exactly how many pages of text one megabyte is equal to. The answer is that one megabyte is equal to approximately 768 pages of text.
To understand how this works, you need to understand that a megabyte is equal to 1,024 kilobytes (KB). And each kilobyte is equal to 1,024 bytes. Each byte of computer data is the equivalent of one character of text. A page of text is usually around 1,500 characters. Therefore, it stands to reason that 1,500 characters will take up approximately 1 kilobyte of space. So, if you multiply 1,500 characters by 1,024 kilobytes, you get 1,536,000 characters, which is the same as 1 megabyte, or 768 pages of text.
This means that 1 megabyte is quite a lot of data. It is enough space to store hundreds of pages of text, thousands of pictures, or hundreds of songs. If you are looking for a way to store large amounts of information, then a megabyte is a great option.
The amount of pages of text that one megabyte can store will also depend on the type and size of the font used. For example, if you use larger fonts, then it will take up more space and therefore fewer pages of text can be stored in one megabyte. On the other hand, if you use smaller fonts, then more pages of text can be stored in one megabyte.
To summarize, one megabyte is equal to approximately 768 pages of text. This is a great way to store large amounts of information without having to worry about running out of space. Moreover, the exact number of pages of text stored in one megabyte will depend on the type and size of font used.
Leave a Comment
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.95333 |
原创
noip2016普及组 题解
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lrj124/article/details/69055886
GX蒟蒻第一次参加noip,考下来310分,请诸位神犇多包容
T1
大水题,不解释
上考场代码
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
freopen("pencil.in","r",stdin);
freopen("pencil.out","w",stdout);
int n,Min = 0x7fffffff;
scanf("%d",&n);
for (int i = 1;i <= 3;i++) {
int number,money,count;
scanf("%d%d",&number,&money);
count = n/number;
if (n%number) count++; //count为需要买的包数
Min = min(Min,count*money); //取最小的
}
printf("%d",Min);
return 0;
}
T2
简单的模拟,生成date1到date2的所有日期,判断是否回文
上考场代码
#include <cstdio>
int m[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
inline bool check(int date) { //判断是否回文
int t[9];
t[0] = 0;
while (date) {
t[++t[0]] = date%10;
date /= 10;
}
for (int i = 1;i <= 4;i++)
if (t[i] != t[8-i+1]) return false;
return true;
}
inline int next(int i) { //生成下一个日期
int year,month,day;
day = (i%10)+((i/10%10)*10); //取出日
i /= 100;
month = (i%10)+((i/10%10)*10); //取出月
i /= 100;
year = (i%10)+((i/10%10)*10)+((i/100%10)*100)+i/1000*1000; //取出年
if ((!(year%4) && year%100) || !(year%400)) m[2] = 29; //判断是否为闰年
day++; //下一天
if (day == m[month]+1) { //若到了月底,则变到下一月
day = 1;
month++;
}
if (month == 13) { //若到了年底,则变到下一年
month = 1;
year++;
}
return day+month*100+year*10000; //把年月日变成8位数字
}
int main() {
freopen("date.in","r",stdin);
freopen("date.out","w",stdout);
int date1,date2,ans = 0;
scanf("%d%d",&date1,&date2);
for (int i = date1;i <= date2;i = next(i)) //生成date1到date2的所有日期
if (check(i)) ans++; //判断是否回文
printf("%d",ans);
return 0;
}
T3
考场上写了个暴力模拟,70分......出来后发现还是可以做的,写个队列就行了,超出86400s的就出队
70分考场代码
#include <cstring>
#include <cstdio>
#include <map>
using namespace std;
int n,t[100001],k[100001];
bool tmp[100001];
map<int,int> x[100001];
int main() {
freopen("port.in","r",stdin);
freopen("port.out","w",stdout);
scanf("%d",&n);
for (int i = 1;i <= n;i++) {
scanf("%d%d",&t[i],&k[i]);
for (int j = 1;j <= k[i];j++) scanf("%d",&x[i][j]);
int L = 1,R = i,pos = i;
while (L <= R) {
int mid = (L+R)>>1;
if (t[mid] > t[i]-86400) {
pos = mid;
R = mid-1;
} else L = mid+1;
}
int ans = 0;
memset(tmp,false,sizeof(tmp));
for (int j = pos;j <= i;j++)
for (int l = 1;l <= k[j];l++)
if (!tmp[x[j][l]]) {
ans++;
tmp[x[j][l]] = true;
}
printf("%d\n",ans);
}
return 0;
}
100分代码
#include <cstdio>
#include <queue>
#include <map>
using namespace std;
int n,ans = 0,vis[100001];
struct Queue { int t,x; };
queue<Queue> Q;
inline int read(int &x) { //读入优化
char ch;
while ((ch = getchar()) < '0' || ch > '9');
x = ch-'0';
while ((ch = getchar()) >= '0' && ch <= '9') x = x*10+ch-'0';
}
int main() {
freopen("port.in","r",stdin);
freopen("port.out","w",stdout);
read(n);
for (int i = 1;i <= n;i++) {
int t,k;
read(t),read(k);
for (int i = 1,x;i <= k;i++) {
read(x);
if (!vis[x]) ans++; //若这个乘客是其他国籍,则统计
vis[x]++; //统计
Q.push((Queue){t,x}); //加入队列
}
while (true) { //把86400以外的排除
Queue head = Q.front();
if (t-86400+1 <= head.t && head.t <= t) break;
else {
vis[head.x]--;
if (!vis[head.x]) ans--;
Q.pop();
}
}
printf("%d\n",ans);
}
return 0;
}
T4
考场上想不出,于是打了个暴力,40分......
40分考场暴力代码
#include <cstdio>
int main() {
int n,m,x[40001],ans[40001][4];
scanf("%d%d",&n,&m);
for (int i = 1;i <= m;i++) scanf("%d",&x[i]);
for (int a = 1;a <= m;a++)
for (int b = 1;b <= m;b++)
if (a != b)
for (int c = 1;c <= m;c++)
if (c != a && c != b && (double)x[b]-(double)x[a] < (double)((double)x[c]-(double)x[b])/3.0)
for (int d = 1;d <= m;d++)
if (d != a && d != b && d != c && x[a] < x[b] && x[b] < x[c] && x[c] < x[d] && x[b]-x[a] == 2*(x[d]-x[c])) {
ans[a][0]++;
ans[b][1]++;
ans[c][2]++;
ans[d][3]++;
}
for (int i = 1;i <= m;i++) printf("%d %d %d %d\n",ans[i][0],ans[i][1],ans[i][2],ans[i][3]);
return 0;
}
4重循环是用不到n的,没有白给的条件,没有没用的数据!!!
我们可以把这4个数看作是个数轴上的点,根据题目给的条件,可知AB=2*CD,BC>6*CD,AD>9*CD
那么,我们只需要确定D,就可以确定C点,然后再找AB。我们也可以通过找C来确定ABD。
100分代码
#include <cstdio>
int n,m,x[40001],vis[15001],a[15001],b[15001],c[15001],d[15001];
int main() {
freopen("magic.in","r",stdin);
freopen("magic.out","w",stdout);
scanf("%d%d",&n,&m);
for (int i = 1;i <= m;i++) {
scanf("%d",&x[i]);
vis[x[i]]++; //把所有数记在数轴上
}
for (int i = 1;i <= n/9;i++) { //枚举CD的长度
int sum = 0;
for (int j = i*9+2;j <= n;j++) {
sum += vis[j-(9*i+1)]*vis[j-(9*i+1)+2*i];
d[j] += sum*vis[j-i];
c[j-i] += sum*vis[j];
}
sum = 0;
for (int j = n-(9*i+1);j >= 1;j--) { //枚举CD两点,确定AB的个数
sum += vis[j+(9*i+1)]*vis[j+(9*i+1)-i];
a[j] += sum*vis[j+2*i];
b[j+2*i] += sum*vis[j];
}
}
for (int i = 1;i <= m;i++) printf("%d %d %d %d\n",a[x[i]],b[x[i]],c[x[i]],d[x[i]]);
return 0;
}
文章最后发布于: 2017-04-04 10:53:00
展开阅读全文
0 个人打赏
没有更多推荐了,返回首页
©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客
分享到微信朋友圈
×
扫一扫,手机浏览
|
__label__pos
| 0.971664 |
Primary key, PL-SQL Programming
PRIMARY KEY:
PRIMARY KEY indicates that the table is subject to a key constraint, in this case declaring that no two rows in the table assigned to ENROLMENT can ever have the same combination of StudentId and CourseId fields (i.e., we cannot enrol the same student on the same course more than once, so to speak). We will learn more about SQL constraints in general and SQL's key constraints.
Posted Date: 1/11/2013 5:22:39 AM | Location : United States
Related Discussions:- Primary key, Assignment Help, Ask Question on Primary key, Get Answer, Expert's Help, Primary key Discussions
Write discussion on Primary key
Your posts are moderated
Related Questions
Literals A literal is an explicit numeric, string, character, or Boolean value not represented by an identifier. Numeric literal 147 and the Boolean literal FALSE are some of
Explicit Cursor Attributes The cursor variable or each cursor has four attributes: %FOUND, %ISOPEN, %ROWCOUNT, and %NOTFOUND. When appended to the cursor or cursor variable, th
Package STANDARD The package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available
Using TRIM This process has two forms. The TRIM removes an element from the end of the collection. The TRIM(n) removes the n elements from the end of the collection. For e.g.
Majority of Differences among 9i, 10G, 11G :- These are some combine feature which has differences among others. Automatic Workload Repository (AWR) Drop database' s
Architecture The PL/SQL run-time system and compilation is a technology, not an independent product. Consider this technology as an engine that compiles and executes the PL/SQL
Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".
The SQL ‘CREATE TABLE' scripts for all the tables you have implemented. Note that your tables must correspond exactly to the ERD you have provided in 1. above, or you will lose ma
Procedures The procedure is a subprogram which can take parameters and be invoked. Normally, you can use a procedure to perform an action. The procedure has 2 sections: the spe
Updating Variables For assignment, SQL uses the key word SET, as in SET X = X + 1 (read as "set X equal to X+1") rather than X: = X + 1 as found in many computer languages.
|
__label__pos
| 0.969722 |
PT - JOURNAL ARTICLE AU - Madan, Ivan AU - Buh, Jože AU - Baranov, Vladimir V. AU - Kabanov, Viktor V. AU - Mrzel, Aleš AU - Mihailovic, Dragan TI - Nonequilibrium optical control of dynamical states in superconducting nanowire circuits AID - 10.1126/sciadv.aao0043 DP - 2018 Mar 01 TA - Science Advances PG - eaao0043 VI - 4 IP - 3 4099 - http://advances.sciencemag.org/content/4/3/eaao0043.short 4100 - http://advances.sciencemag.org/content/4/3/eaao0043.full SO - Sci Adv2018 Mar 01; 4 AB - Optical control of states exhibiting macroscopic phase coherence in condensed matter systems opens intriguing possibilities for materials and device engineering, including optically controlled qubits and photoinduced superconductivity. Metastable states, which in bulk materials are often associated with the formation of topological defects, are of more practical interest. Scaling to nanosize leads to reduced dimensionality, fundamentally changing the system’s properties. In one-dimensional superconducting nanowires, vortices that are present in three-dimensional systems are replaced by fluctuating topological defects of the phase. These drastically change the dynamical behavior of the superconductor and introduce dynamical periodic long-range ordered states when the current is driven through the wire. We report the control and manipulation of transitions between different dynamically stable states in superconducting δ3-MoN nanowire circuits by ultrashort laser pulses. Not only can the transitions between different dynamically stable states be precisely controlled by light, but we also discovered new photoinduced hidden states that cannot be reached under near-equilibrium conditions, created while laser photoexcited quasi-particles are outside the equilibrium condition. The observed switching behavior can be understood in terms of dynamical stabilization of various spatiotemporal periodic trajectories of the order parameter in the superconductor nanowire, providing means for the optical control of the superconducting phase with subpicosecond control of timing.
|
__label__pos
| 0.989647 |
j3d.org Code
org.j3d.util.interpolator
Class ScalarInterpolator
java.lang.Object
extended by org.j3d.util.interpolator.Interpolator
extended by org.j3d.util.interpolator.ScalarInterpolator
public class ScalarInterpolator
extends Interpolator
An interpolator that works with scalar values.
The interpolation routine is either a stepwise or simple linear interpolation between each of the points. The interpolator may take arbitrarily spaced keyframes and compute correct values.
Version:
$Revision: 1.3 $
Author:
Justin Couch
Field Summary
Fields inherited from class org.j3d.util.interpolator.Interpolator
allocatedSize, ARRAY_INCREMENT, currentSize, DEFAULT_SIZE, interpolationType, keys, LINEAR, STEP
Constructor Summary
ScalarInterpolator()
Create a new linear interpolator instance with the default size for the number of key values.
ScalarInterpolator(int size)
Create a linear interpolator with the given basic size.
ScalarInterpolator(int size, int type)
Create a interpolator with the given basic size using the interpolation type.
Method Summary
void addKeyFrame(float key, float value)
Add a key frame set of values at the given key point.
float floatValue(float key)
Get the interpolated value of the point at the given key value.
java.lang.String toString()
Create a string representation of this interpolator's values
Methods inherited from class org.j3d.util.interpolator.Interpolator
clear, findKeyIndex
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail
ScalarInterpolator
public ScalarInterpolator()
Create a new linear interpolator instance with the default size for the number of key values.
ScalarInterpolator
public ScalarInterpolator(int size)
Create a linear interpolator with the given basic size.
Parameters:
size - The starting number of items in interpolator
ScalarInterpolator
public ScalarInterpolator(int size,
int type)
Create a interpolator with the given basic size using the interpolation type.
Parameters:
size - The starting number of items in interpolator
type - The type of interpolation scheme to use
Method Detail
addKeyFrame
public void addKeyFrame(float key,
float value)
Add a key frame set of values at the given key point. This will insert the values at the correct position within the array for the given key. If two keys have the same value, the new key is inserted before the old one.
Parameters:
key - The value of the key to use
value - The scalar value at this key
floatValue
public float floatValue(float key)
Get the interpolated value of the point at the given key value. If the key lies outside the range of the values defined, it will be clamped to the end point value. For speed reasons, this will return a reusable float array. Do not modify the values or keep a reference to this as it will change values between calls.
Parameters:
key - The key value to get the position for
Returns:
An array of the values at that position [x, y, z]
toString
public java.lang.String toString()
Create a string representation of this interpolator's values
Overrides:
toString in class java.lang.Object
Returns:
A nicely formatted string representation
j3d.org Code
Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org
|
__label__pos
| 0.998701 |
%0 Journal Article %T The Most Efficient Sealing Factors with Attention to the Effective Factors in Classified Earth Dams %A Alireza Salehi %A Mehdi Aghdari Moghadam %A Gholamreza Azizian %A Gholamhossein Akbar %J specialty journal of architecture and construction %@ 2412-740X %D 2018 %V 4 %N 3 %P 27-33 %X Water molecules flow through the porous soil environment due to potential energy. Leaking is always one of the important topics in dam design. Due to the presence of cavities among the soil grain solids, it is possible to move water in the soil mass that may endanger the stability of the dam, so the effects of this movement should be considered. In this research, which uses a nonlinear permeability function, the water escaping dimming elements include a seal wall in the core axis; a seal wall in heel; a seal wall in heel and paw; a clay blanket with variable thickness and length; the combination of two seal walls, one on the axis and the other on the heel, the combination of clay blanket with variable thickness and length along with a seal wall in the core axis, which is compared to the non-sealing state due to the most important effective factors in leaking, including Debi, velocity, and gradient in Bashar's zoned dam. The Geo-Studio software is used and hydraulic tilt changes are also considered at the core of the dam. %U https://sciarena.com/en/article/the-most-efficient-sealing-factors-with-attention-to-the-effective-factors-in-classified-earth-dams
|
__label__pos
| 0.853721 |
A Detailed Account of Palm Frond Types
Types Of Palm Tree Leaves
Whether you use them as indoor plants or grow them out in your garden or backyard, palm trees can add a classy, tropical touch to any space. Palm is a wide category that includes thousands of species.
One of the most common ways to differentiate between different palm varieties is on the basis of palm leaves types.
Jump To
Here is all you need to know about different kinds of palm leaves, their significance, and their uses.
What Are Palm Fronds?
The quintessential postcard image that strikes our minds as soon as we hear ‘palm tree’ is that of a thick, texture trunk topped by a cluster of large, majestic foliage. These palm tree leaves, that grow at the top of the palm stem, are called fronds.
Palm has over 3,000 different species, all of which share a few common anatomical characteristics. Out of these features, one of the major ones is the palm fronds. Different types of palm leaves also act as identifying devices for the variety of palms outdoors & indoors.
A Palm Tree Frond Typically Consists of The Following Parts:
• Leaflets: These are the different sections of a palm frond that are attached to the rachis.
• Petiole: Petiole or leaf stalk connects the palm leaves to the palm trunk.
• Rachis: Ranchis is part of the leaf stalk, which extends from the petiole’s end to the tip of the leaves.
• Leaf-sheath: Leaf-sheath or frond midrib refers to the base of a palm frond. The fronds attach to the main stem here.
• Palm spines: Thorns or prickles found along the petiole are known as palm spines.
Types of Palm Leaves and Their Distinguishing Features
Types of Palm Leaves and Their Distinguishing Features
Mainly, there are 4 kinds of palm leaves. Out of these, the first two categories mentioned below are the most common ones.
1. Pinnate Leaves
This is perhaps the most common among the palm leaves types. The pinnate foliage appears to be feather-like.
Pinnate leaves feature a thick, central rib and leaflets that are attached to the rachis perpendicularly but are entirely separated from each other.
The size of the pinnate palm leaf varieties differs widely. While some varieties have only foot-long leaves, others come with leaves as long as 70 feet.
Varieties like coconutqueen palm, and date palm have pinnate palm leaves.
2. Palmate Leaves
While pinnate palm fronds look like a feather, palmate leaves resemble a fan. This is why the varieties featuring this type of leaves are known as fan palms.
Here, the adjacent leaflets (or segments) are joined laterally, forming a circle. These segments appear from a point located at the tip of the petiole and radiate outward.
Palmate leaves can be as small as the size of your palm and as large as 5 meters.
Mexican fan palm, sugar palm, and windmill palm are a few common varieties that feature palmate palm frond types.
3. Bipinnate or Costapalmate Fronds
These unusual and rare palm leaves types are akin to a fishtail! The leaf structure looks quite similar to pinnate leaves but bipinnate leaves are divided into 2 sections.
The overall leaf blade varies from oval to round in shape. Some or most part of the leaflets’ length is joined together. These leaflets are further attached along a costa (an extension of the petiole).
These can be as long as 4 meters and as wide as 3 meters. Sabal palm species feature bipinnate types of palm tree leaves.
4. Entire Leaves
Lastly, on our list of different types of palm leaves, we have this rare palm leaf structure, which looks quite similar to pinnate leaves.
However, while pinnate leaves are divided into individual leaf sections, the entire leaf does not divide into separate sections. Out of 3,000 palm species, only 5 varieties feature entire leaves.
The Significance of Palm Fronds
Palm leaves hold a lot of significance across various cultures and religions. These are known to symbolize noble things like a victory with integrity, peace, triumph, and eternal life.
Mesopotamian religions considered palm leaves to be sacred while in ancient Egypt, they stood as a symbol of immortality.
Palm fronds were the symbol of the winged goddess of victory, Nike, in ancient Greek mythology.
In ancient times, the branches of the palm were considered to be tokens of joy and triumph. They were used to welcome back kings and conquerors and on other festive occasions.
Palm branches also have significance in Christian history and Jewish tradition. In Christianity, palm branches are important during Palm Sunday and signify the victory of Christ over death.
Uses of Palm Leaf Varieties
One of the most useful byproducts of the versatile palm tree is the different kinds of palm leaves. From building material to clothing fiber, palm leaves have an impressive list of uses.
Sturdy types of palm tree leaves are used for the following:
• Roof thatch and garden fencing.
• For making hats, woven baskets, and other woven craft items.
• Fuel for the fire.
• Making long-wearing mulch for garden beds.
• As nutritional feed for livestock.
• Spines from palm leaves can also be used as garden stakes.
Related: Brown Spots on Palm Leaves
FAQs About Palm Leaves Types
Q. What is the difference between a leaf and a frond?
A. To put it simply, frond refers to the leaf of a fern or palm. On the other hand, a leaf is a green, flat organ you see in most vegetative plants. A palm mainly has 4 palm frond types – pinnate, palmate, bipinnate and entire.
Q. What is the leaf arrangement for a palm tree?
A. In palm trees, the foliage is found in clusters at the top of a long trunk. Palm leaves and fruits are produced at the meristem, which is located at the top of the palm stem (trunk). Based on the arrangement, listed below are the various kinds of palm leaves:
• Pinnate leaves that resemble a feather
• Palmate leaves that resemble a fan
• Bipinnate leaves are like pinnate leaves but are divided into 2 sections.
• Entire leaves that are not divided into different sections.
Q. What is the margin of the leaf?
A.The boundary area of a leaf, that extends along its edge is known as the margin. There are different kinds of palm leaves with different margins and knowing about them can aid in plant identification.
Q. Is a palm leaf a simple or compound leaf?
A. That depends on the different types of palm leaves. Most palm varieties come with either palmate or pinnate compound leaves.
Bipinnate palm leaf varieties are also considered to be compound leaves. However, entire palm leaves are undivided and are categorized as simple.
Q. What is the Venation of palm leaf?
A. Palm leaves usually have parallel venation.
Q. How long is a palm tree leaf?
A. The length of a palm tree leaf depends on its variety and can range anywhere from less than a few inches to over 70 feet. For instance, the fronds of the Coontie palm are usually between 2 to 3 feet whereas those of Raffia palms can grow up to be over 80 feet long.
Q. Do all palm trees have heart of palm?
A . No. Heart of palm can only be obtained from certain palm varieties. Coconut, peach palm, acai palm, jucara palm, and palmetto, are the few main varieties that have the heart of palm.
|
__label__pos
| 0.775642 |
繁体 English 中英
类型错误:<<:'str' 和 'int' 的操作数类型不受支持
[英]TypeError: unsupported operand type(s) for <<: 'str' and 'int'
谁能给我一些关于我 10 岁儿子正在尝试的 Python 项目的广泛指导? 我很少寻找特定的编码解决方案,但我希望这是一个提出问题的好地方。 我想看看我儿子是否正在着手对他的编码项目进行实际操作,以及是否有一种相对简单的方法可以让他学习正确的步骤。 或者,这对于一个喜欢阅读和尝试各种编码项目只是为了好玩的 10 岁孩子来说是不合时宜的? 如您所见,我不是编码员,对此类项目知之甚少,因此将不胜感激!
我儿子喜欢密码学,他告诉我他尝试了下面的 Python 代码。 他希望构建一个类似海绵的功能来加密按摩,使其无法被解密。 这受到他的书“Serious Cryptography”(J. Aumasson 着)中标题为“基于排列的哈希函数:海绵函数”的部分的启发。 当他运行他编写的代码时,他收到错误消息“类型错误:<<:'str'和'int'不受支持的操作数类型”(请参阅他在代码下方终端中的交互)。
非常感谢! 亚历山大
这是他的代码:
import math
import textwrap
plaintext = raw_input("The value to be hashed: ") # Get the user to input the data to be hashed
nonce = raw_input("The nonce to be used: ") # Get the user to input the nonce to be used
key = raw_input("The key to be used: ") # Get the user to input the key to be used
blocks = textwrap.wrap(plaintext, 16) # Split the string into 128-bit blocks
if len(blocks[len(blocks)-1]) < 16: # Check if the last block is less than 128 bits
while len(blocks[len(blocks)-1]) < 16: # Keep iterating the following code
blocks[len(blocks)-1] += "." # Add padding to the end of the block to make it 128-bit
sponge = nonce # Set the sponge's initial state to that of the nonce
for j in blocks: # Absorb all of the blocks
sponge = (sponge << 128) + j # Concatenate the current sponge value and the block
sponge = textwrap.wrap(sponge, 128) # Convert the sponge into 128-bit blocks
for z in sponge: # Keep iterating the following code
z = z^j # XOR the sponge block with the message block
sponge = join(sponge) # Convert the blocks back into a string
sponge = textwrap.wrap(sponge, len(key)*8) # Convert the sponge into blocks with the same length of the key
output = sponge # Create a new variable to save space
del nonce, blocks # Delete variables to save space
while len(output) > 1: # Keep iterating the following code
output[1] = output[1]^output[0] >> output[0] # XOR the second element with the first, then shift forward
del output[0] # Delete the first element, so it can repeat again
tag = ((output^plaintext) <<< sponge) + output # Generate an authentication tag. That's not overkill, is it?
print output # Oh yeah, just print it in hexadecimal, I dunno how to
当他在终端运行脚本时,这是交互:
• 要散列的值:abcioagdsbvasizfuvbosuif
• 要使用的随机数:iugzaliuglieas
• 要使用的密钥:asljdgadskj
例外:
Traceback (most recent call last):
File "DarkKnight-Sponge.py", line 13, in <module>
sponge = (sponge << 128) + j # Concatenate the current sponge value and the block
TypeError: unsupported operand type(s) for <<: 'str' and 'int'
恭喜你儿子! 这个项目对我来说看起来很现实。 我能想到的唯一雄心勃勃的事情是直接钻研像<<^这样的按位运算符,而不是尝试对字符序列实现相应的操作。 位运算符有时看起来像算术黑魔法,因为它们操纵数字的内部二进制表示,我们不像数字的十进制表示或文本那样熟悉。
了解错误信息
TypeError: unsupported operand type(s) for <<: 'str' and 'int'
这个错误非常简单:它表示无法执行sponge << 128操作,因为sponge是一个str ,即(字符)字符串,即文本,而 128 是一个 int,即整数。
想象一下,如果您让计算机计算"three" + 2 它会返回一个错误,因为+需要两个数字,但"three"是一个字符串,而不是一个数字。 同样,如果你让计算机计算"327" + 173 ,它会返回一个错误,因为"327"是文本,而不是数字。
了解发生错误的线路
运算符<<左移运算符。 它将一个数字向左移动一定数量的位。 计算机以二进制表示形式存储数字; 我们人类更习惯于十进制表示,所以让我们用“左移数字”操作来做一个比喻。 “向左移动一个数字”意味着将它乘以 10 的幂。例如,138 向左移动两次就是 13800。我们在右边用零填充。 在二进制表示中,bitshift 的工作原理相同,但改为乘以 2 的幂。 二进制表示的 138 是1110110 将它向左移动两次给出111011000 ,这与将其乘以100 (即 4)相同。
如果spongej都是数字,并且j小于 2^128,则该行:
sponge = (sponge << 128) + j # Concatenate the current sponge value and the block
sponge向左移动 128 位,然后将小于 128 位的数字添加到结果中。 实际上,这是将sponge位与j位连接起来。 回到我们的十进制类比:如果x是一个数字,而y是一个小于 100 的数字,那么数字x * 100 + y是通过连接xy的数字获得的数字。 例如, 1374 * 100 + 56 = 137456
解决问题
我没有读过启发这段代码的密码学书籍,所以我只是从这里开始猜测。
我的理解是这本书期望plaintextnoncekey是数字。 但是,在您儿子的代码中,它们都是文本。 这两种类型的对象之间的区别并非不可调和。 无论如何,在计算机的内存中,所有内容都存储为位序列。 数字是位序列; 一个字符串是一个字符序列,每个字符本身就是一个短的位序列。
我看到三种可能性:(1)在执行操作之前将所有文本转换为数字; (2) 调整操作,使它们可以应用于字符串而不是整数; (3) 将所有文本转换为仅包含字符01字符串并调整操作,以便将它们应用于此类序列。 密码算法在现实世界中的高效实现肯定都选择了第二个选项。 第三个选项显然是三个选项中效率较低的一个,但出于学习目的,这是一个可能的选项。
看看你的代码,我注意到所有使用的操作都是关于序列的操作,而不是关于算术运算。 正如我提到的, (sponge << 128) + j是两个位序列的串联。 稍后在代码^使用的按位异或运算期望两个长度相同的位序列,并返回一个长度相同的序列,在两个序列具有不同位的每个位置处为1 ,在两个序列具有不同位的每个位置处返回0序列具有相同的位。 例如, 00010110 ^ 00110111 = 00100001因为第三位和第八位不同,但所有其他位都相等。
将文本转换为 int
要将文本转换为数字(我称之为选项 2),您可以用这些行替换代码的前三行:
plaintext_string = raw_input("The value to be hashed: ") # Get the user to input the data to be hashed
nonce_string = raw_input("The nonce to be used: ") # Get the user to input the nonce to be used
key_string = raw_input("The key to be used: ") # Get the user to input the key to be used
def string_to_int(txt):
number = 0
for c in txt:
number = (number << 8) + ord(c)
return number
plaintext = string_to_int(plaintext_string)
nonce = string_to_int(plaintext_string)
key = string_to_int(key_string)
这是如何工作的:python 函数ord每个 ascii 字符c映射到一个 8 位数字。 8 位块使用公式number = (number << 8) + ord(c) ,您可以从上面的讨论中识别出来。
这不足以使您的代码正常工作,因为之后直接使用的textwrap.wrap()函数需要一个字符串,而不是一个 int。 一种可能性是用自定义函数text_to_intblocks()替换textwrap.wrap()函数:
def string_to_intblocks(txt, blocksize):
blocks = []
block_number = 0
for i,c in enumerate(txt):
block_number = (block_number << 8) + ord(c)
if i % blocksize == 0:
blocks.append(block_number)
block_number = 0
return blocks
然后将blocks = textwrap.wrap(plaintext, 16)替换为blocks = string_to_intblocks(plaintext_string, 16)
这仍然不足以修复您儿子的代码。 我确信以下六行中存在逻辑错误,尽管修复它需要比我目前对算法有更好的理解:
sponge = nonce # Set the sponge's initial state to that of the nonce
for j in blocks: # Absorb all of the blocks
sponge = (sponge << 128) + j # Concatenate the current sponge value and the block
sponge = textwrap.wrap(sponge, 128) # Convert the sponge into 128-bit blocks
for z in sponge: # Keep iterating the following code
z = z^j # XOR the sponge block with the message block
sponge = join(sponge)
暂无
暂无
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:[email protected].
粤ICP备18138465号 © 2020-2024 STACKOOM.COM
|
__label__pos
| 0.895417 |
ERROR: type should be string, got "https://insu.hal.science/insu-02539763Bernard, MaximeMaximeBernardGR - Géosciences Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - OSUR - Observatoire des Sciences de l'Univers de Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - UR2 - Université de Rennes 2 - CNRS - Centre National de la Recherche Scientifique - INRAE - Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement - CNRS - Centre National de la Recherche ScientifiqueSteer, PhilippePhilippeSteerGR - Géosciences Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - OSUR - Observatoire des Sciences de l'Univers de Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - UR2 - Université de Rennes 2 - CNRS - Centre National de la Recherche Scientifique - INRAE - Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement - CNRS - Centre National de la Recherche ScientifiqueGallagher, KerryKerryGallagherGR - Géosciences Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - OSUR - Observatoire des Sciences de l'Univers de Rennes - UR - Université de Rennes - INSU - CNRS - Institut national des sciences de l'Univers - UR2 - Université de Rennes 2 - CNRS - Centre National de la Recherche Scientifique - INRAE - Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement - CNRS - Centre National de la Recherche ScientifiqueEgholm, David L.David L.EgholmDepartment of Earth Sciences [Aarhus] - Aarhus University [Aarhus]The effects of ice and hillslope erosion and detrital transport on the form of detrital thermochronological age probability distributions from glacial settingsHAL CCSD2020[SDU.STU.GC] Sciences of the Universe [physics]/Earth Sciences/Geochemistry[SDU.STU.GM] Sciences of the Universe [physics]/Earth Sciences/GeomorphologyDubigeon, Isabelle2020-04-10 12:37:192023-07-12 05:16:272020-04-10 12:37:19enConference papers1The impact of glaciers on the Quaternary evolution of mountainous landscapes remains controversial. While in-situ low-temperature thermochronology offers insights on past rock exhumation and landscape erosion, it also suffers from biases due to the difficulty of sampling bedrocks buried under the ice of glaciers. Detrital thermochronology attempts to bypass this issue by sampling sediments at, e.g. the catchment outlet, that may originate from beneath the ice. However, the age distribution resulting from detrital thermochronology does not only inform on the catchment exhumation, but also on the patterns and rates of surface erosion and sediment transport. In this study, we use a new version of a glacial landscape evolution model, iSOSIA to address the role of erosion and sediment transport by the ice on the form of synthetic detrital age distributions and thus, for inferred catchment erosion from such data. Sediments are tracked as Lagrangian particles that can be formed by bedrock erosion, transported by ice or hillslope processes and deposited. We apply our model to the Tiedemann glacier (British Columbia, Canada), which has simple morphological characteristics, such as a straight form and no connectivity with large tributary glaciers. Synthetic detrital age distributions are generated by specifying an erosion history, then sampling sediment particles at the frontal moraine of the modelled glacier. The detrital ages are represented as synoptic probability density functions (SPDFs).A characterization of sediment transport shows that 1500 years are required to reach an equilibrium for detrital particles age distributions, due to the large range of particle transport times from their sources to the frontal moraine. Second, varying sampling locations and strategies at the glacier front lead to varying detrital SPDFs, even at equilibrium. These discrepancies are related to (i) the selective storage of a large proportion of sediments in small tributary glaciers and in lateral moraines, (ii) the large range of particle transport times, due to varying transport lengths and to a strong variability of glacier ice velocity, (iii) the heterogeneous pattern of erosion, (iv) the advective nature of glacier sediment transport along ice streamlines that leads to a poor lateral mixing of particle detrital signatures inside the frontal moraine. Third, systematic comparisons between (U-Th)/He and fission track detrital ages, with different age-elevation profiles and relative age uncertainties, show that (i) the age increasing rate with elevation largely controls the ability to track sediment sources, and (ii) qualitative first-order information about distribution of erosion may still be extracted from thermochronological system with high variable uncertainties (> 30 %). Overall, our distributions in glaciated catchments are strongly impacted by erosion and transport processes and by their spatial variability. Combined with bedrock age distributions, detrital thermochronology can offer a means to constrain the transport pattern and time of sediment particles. However, results also suggest that detrital age distributions of glacial features like frontal moraines, are likely to reflect a transient case as the time required to reach detrital thermochronological equilibrium is of the order of the short-timescale glaciers dynamic variability, as little ice ages or recent glaciers recessions." |
__label__pos
| 0.902861 |
OSJOY
How To Fix The Garbled Code On Notepad Files?
How To Fix The Garbled Code On Notepad Files
5
(22)
Summary: Usually, we will record some information in a notepad, such as passwords, keys, ideas, notes, etc. But sometimes, when we open it after a while, we find many garbled characters inside. What should we do? This article will show how to fix the garbled code on notepad files.
When working extensively with Plain Text files with the TXT file extension, individuals may encounter documents with garbled text instead of the expected content. This issue often occurs when the corrupted text document is written in a non-Latin alphabet-based foreign language. Still, it can happen with any file if there are inconsistencies in the settings used during the file’s saving process.
To solve the garbled code on notepad files, you must first understand the cause of the problem. The primary reason is the wrong document format. Generally, there are several reasons for garbled characters:
Methods to Fix the Garbled Code on Notepad Files
Method 1: Convert the File Extension
First, let’s solve the problem caused by the file format disorder. Just change the file extension back to the original format. For example, if your file is originally a word file, you can change its file extension to .doc or .docx. If it is a web page file, change it to .html, etc. Then open these files with the appropriate program.
Method 2: Change the Encoding Option
Mismatched encoding formats for text files can also lead to garbled code. In such case, you need to change the encoding form as follows:
1. Open the garbled file with Notepad and select Save>Save As.
2. Choose ANSI or UTF-8 as encoding format and click Save.
Method 3: Change the System Locale
When opening various text documents with Notepad results in gibberish, it’s typically a system issue. The problem could be that the encoding used for the file is not compatible with the native character encoding used by the version of Windows you have.
So if the previous method doesn’t work, we can change the default system language in Windows.
1. Search control panel in the search bar and open it.
2. Click on Change date, time or number formats under Clock and Region.
3. Select the Administrative tab and click on Change system locale option.
4. In the next window, choose the language you need from the drop-down menu and click OK.
5. Close Control Panel and restart your computer to make the changes effective.
Method 4: Use Restore Previous Version
You will also get a Notepad garbled codes issue when a Notepad file gets corrupted. Several common reasons can cause Notepad file corruption or damage, such as file header corruption, improper system shutdown, virus attacks, and incomplete download and compression issues.
Many Windows users enable Windows backup tools such as file history to protect data security and regularly back up their files. If this is the case for you, here are some steps you can take when the above two methods fail:
1. Go to the location where the Notepad file is stored.
2. Right-click on the corrupted file and select Previous Version from the context menu.
3. Choose the correct previous version and click on Restore.
4. Now, open the Notepad file to see if the problem is fixed.
Method 5: Use Microsoft Word to Repair Notepad Files
1. Open the Word app, then click File and select Options.
2. Shift to the Advanced tab and navigate to the General section.
3. Check Confirm file format conversion on open and click OK to save changes.
4. Click File and select Open.
5. When the Open window appears, hit the Browse button.
6. Choose All Files and select Recover Text from Any File (*.*).
7. Select the corrupted notepad file from the list and click Open.
8. Now, you can check whether this method helps to repair the text file.
Method 6: Open Notepad Files in the Browser
The simplest and most effective way to view the original file is by opening it with a web browser. Web browsers are designed to translate data between encoding schemes. You can use either Microsoft Edge or Google Chrome to open the text file, and it will display the language correctly.
Conclusion
The garbled code of the Notepad file is not a big problem. When you encounter garbled code on Notepad files, the six recommended methods in this article should solve the problem in no time. If you have any other valuable methods or suggestions, welcome to leave a comment below.
How useful was this post?
Click on a star to rate it!
Average rating 5 / 5. Vote count: 22
No votes so far! Be the first to rate this post.
Exit mobile version
|
__label__pos
| 0.878224 |
The Benefits of Delta-9 Gummies: A Comprehensive Guide
Table of Contents
1. Table of Contents
2. What Are Delta-9 Gummies?
3. How Delta-9 Gummies Work
4. Health Benefits of Delta-9 Gummies
5. Potential Side Effects
6. How to Choose Quality Delta-9 Gummies
7. Usage Tips and Dosages
8. Are Delta-9 Gummies Legal?
9. Closing Thoughts
With its main psychoactive ingredient, delta-9 gummies are a well-liked substitute for more conventional cannabis intake techniques like smoking or vaping. New and seasoned users will find these edibles intriguing since they offer accurate dosage, simplicity of usage, and a wide range of tastes. Delta-9 gummies may affect mood, hunger, and pain perception by promoting homeostasis through interactions with the body’s endocannabinoid system. Although they provide advantages like reduced stress, pain management, and better sleep, buying high-quality goods is essential, and being mindful of potential adverse effects is necessary. Recognizing their legal status and using Delta-9 gummies responsibly can improve your overall experience with them.
What Are Delta-9 Gummies?
The main psychoactive ingredient in cannabis, delta-9-tetrahydrocannabinol (THC), is found in popular edible forms such as Delta 9 gummies. In contrast to conventional delivery techniques like vaping or smoking, gummies provide a discrete and palatable substitute. Because of their exact dose and ease of usage, Delta 9 gummies are highly recommended and may be used by both rookie and expert users. These candies are available in various flavors and intensities, so customers may choose from various possibilities to fit their tastes.
How Delta-9 Gummies Work
After consumption, Delta-9 gummies engage the body’s endocannabinoid system, which is essential to preserving homeostasis. Numerous physiological functions, such as mood, hunger, pain perception, and immunological response, are regulated by this system. When you ingest Delta-9 gummies, the THC is broken down in the liver to produce an even more powerful substance known as 11-hydroxy-THC. Compared to smoking or vaping, this change may have a more substantial and more persistent effect. For a more thorough explanation of the functioning of the endocannabinoid system, please read this study paper.
Health Benefits of Delta-9 Gummies
Delta-9 gummies offer numerous health benefits, including stress and anxiety relief, pain management, improved sleep, and appetite stimulation. They provide:
• A calming effect.
• Promoting relaxation and well-being.
• Making them a popular choice for those with daily pressures.
Delta-9 THC interacts with neural pathways, providing relief from chronic and acute pain, especially for conditions like arthritis, fibromyalgia, and migraines. The relaxing properties of Delta-9 gummies help individuals fall asleep faster and enjoy a more restful sleep. Additionally, Delta-9 THC increases hunger, aiding in nutritional intake for individuals with conditions like cancer or HIV/AIDS.
Potential Side Effects
Even though Delta-9 gummies provide several health advantages, it’s essential to be aware of any possible negative effects. Frequent adverse effects include transient anxiety, vertigo, and dry mouth. These can be lessened by beginning with a low dosage and monitoring your body’s reaction. Drinking lots of water and eating the gummies in a cozy, familiar setting is also advised. Furthermore, especially at larger dosages, some users may suffer minor hallucinations or an elevated heart rate. If you are concerned about any pre-existing problems, always get medical advice.
How to Choose Quality Delta-9 Gummies
Selecting top-notch Delta-9 gummies will significantly improve your experience. Seek out goods undergoing independent laboratory testing to guarantee purity and efficacy. The presence of no dangerous pollutants in the product may be reliably determined by looking at the certificate of analysis (COA). Examine the findings of microbiological, heavy metal, and pesticide tests while examining COAs. Choose products that do not utilize artificial additives and instead use natural substances. Examining consumer feedback and learning more about the producer can also give important information about the product’s quality.
Usage Tips and Dosages
It is advised that first-time users begin with a modest dose of Delta-9 THC, often 5–10 mg. You should then monitor your reactions and progressively raise the amount if needed. Gummies should be consumed in a comfortable environment, mainly if you are new to THC edibles. It’s also crucial to exercise patience since, depending on your metabolism and previous eating habits, the effects of edibles may take anywhere from 30 minutes to 2 hours to manifest.
Are Delta-9 Gummies Legal?
The legality of Delta-9 gummies varies by location. In some regions, they are completely legal, while in others, they may face restrictions or be entirely prohibited. The 2018 Farm Bill legalized hemp-derived Delta-9 THC products with a THC concentration of less than 0.3%. However, state laws can be more restrictive. It’s essential to check your local laws before purchasing or consuming Delta-9 THC products to ensure compliance. Keeping updated on changes in legislation can also help you stay informed about your legal rights and responsibilities.
Closing Thoughts
Gummies made from delta-9 provide a practical and efficient approach to benefit from THC. You may improve your experience and make an educated choice by knowing how they operate, their possible advantages and disadvantages, and how to select high-quality items. Always remember to start with a small dosage, research the laws, and use them responsibly. Adding Delta-9 gummies to your health regimen can help you reduce discomfort, manage stress, and have a more peaceful evening.
Leave a Comment
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.836067 |
Home » Computer Graphics Introduction of Shading
Computer Graphics Introduction of Shading
by
Introduction of Shading
Shading is referred to as the implementation of the illumination model at the pixel points or polygon surfaces of the graphics objects.
Shading model is used to compute the intensities and colors to display the surface. The shading model has two primary ingredients: properties of the surface and properties of the illumination falling on it. The principal surface property is its reflectance, which determines how much of the incident light is reflected. If a surface has different reflectance for the light of different wavelengths, it will appear to be colored.
An object illumination is also significant in computing intensity. The scene may have to save illumination that is uniform from all direction, called diffuse illumination.
Shading models determine the shade of a point on the surface of an object in terms of a number of attributes. The shading Mode can be decomposed into three parts, a contribution from diffuse illumination, the contribution for one or more specific light sources and a transparency effect. Each of these effects contributes to shading term E which is summed to find the total energy coming from a point on an object. This is the energy a display should generate to present a realistic image of the object. The energy comes not from a point on the surface but a small area around the point.
Introduction of Shading
The simplest form of shading considers only diffuse illumination:
Epd=Rp Id
where Epd is the energy coming from point P due to diffuse illumination. Id is the diffuse illumination falling on the entire scene, and Rp is the reflectance coefficient at P which ranges from shading contribution from specific light sources will cause the shade of a surface to vary as to its orientation concerning the light sources changes and will also include specular reflection effects. In the above figure, a point P on a surface, with light arriving at an angle of incidence i, the angle between the surface normal Np and a ray to the light source. If the energy Ips arriving from the light source is reflected uniformly in all directions, called diffuse reflection, we have
Eps=(Rp cos i)Ips
This equation shows the reduction in the intensity of a surface as it’s tipped obliquely to the light source. If the angle of incidence i exceeds90°, the surface is hidden from the light source and we must set Epsto zero.
You may also like
|
__label__pos
| 0.98902 |
VLSI CMOS Logic MCQ Quiz – Objective Question with Answer for VLSI CMOS Logic MCQ
1. In Pseudo-nMOS logic, n transistor operates in
A. cut off region
B. saturation region
C. resistive region
D. non-saturation region
Answer: B
In Pseudo-nMOS logic, n transistor operates in a saturation region and the p transistor operates in a resistive region.
2. The power dissipation in Pseudo-nMOS is reduced to about ________ compared to nMOS device.
A. 50%
B. 30%
C. 60%
D. 70%
Answer: C
The power dissipation in Pseudo-nMOS is reduced to about 60% compared to nMOS devices.
3. Pseudo-nMOS has higher pull-up resistance than nMOS devices.
A. true
B. false
Answer: A
Pseudo-nMOS has higher pull-up resistance than nMOS devices and thus inverter pair delay is larger.
4. In dynamic CMOS logic _____ is used.
A. two-phase clock
B. three-phase clock
C. one phase clock
D. four-phase clock
Answer: D
In dynamic CMOS logic, a four-phase clock is used in which actual signals are used to derive the clocks.
5. In clocked CMOS logic, output in evaluated in
A. on period
B. off period
C. both periods
D. half of on period
Answer: A
In clocked CMOS logic, the logic is evaluated only in on the period of the clock. And owing to the extra transistor in series, slower rise time and fall times are expected.
6. In clocked CMOS logic, rise time and fall time are
A. faster
B. slower
C. faster first and then slows down
D. slower first and then speeds up
Answer: B
In clocked CMOS logic, rise time and fall time are slower because of more number of transistors in series.
7. In CMOS domino logic _____ is used.
A. two-phase clock
B. three-phase clock
C. one phase clock
D. four-phase clock
Answer: C
In CMOS domino logic, a single-phase clock is used. Clock signals distributed on one wire are called a single or one-phase clock.
8. CMOS domino logic is the same as ______ with an inverter at the output line.
A. clocked CMOS logic
B. dynamic CMOS logic
C. gate logic
D. switch logic
Answer: B
CMOS domino logic is the same as that of the dynamic CMOS logic with an inverter at the output line.
9. CMOS domino logic occupies
A. smaller area
B. larger area
C. smaller & larger area
D. none of the mentioned
Answer: A
CMOS domino logic structure occupies a smaller area than conventional CMOS logic as only n-block is used.
10. CMOS domino logic has
A. smaller parasitic capacitance
B. larger parasitic capacitance
C. low operating speed
D. very large parasitic capacitance
Answer: A
CMOS domino logic has smaller parasitic capacitance and higher operating speed.
Scroll to Top
|
__label__pos
| 0.971605 |
1244
A company named RT&T has a network of n switching stations connected by m high-speed communication links. Each customer’s phone is directly connected to one station in his or her area. The engineers of RT&T have developed a prototype video-phone system that allows two customers to see each other during a phone call. In order to have acceptable image quality, however, the number of links used to transmit video signals between the two parties cannot exceed 4. Suppose that RT&T’s network is represented by a graph. Design an efficient algorithm that computes, for each station, the set of stations it can reach using no more than 4 links.
|
__label__pos
| 0.988211 |
Banner Health
Making healthcare easier
INSTALL
Common Cold
What is the common cold?
The common cold is a viral infection that affects the upper respiratory tract, primarily the nose and throat. It is one of the most frequent illnesses people experience, with millions of cases occurring each year.
The common cold is typically not severe and symptoms, while unpleasant, usually improve on their own without medical treatment.
Most people recover within seven to ten days. However, symptoms may last longer for children, older adults and individuals with weakened immune systems.
What are symptoms of a cold?
A common cold can cause different symptoms, and they can be more or less severe for each person. The most common cold symptoms include:
• Stuffy or runny nose
• Sore throat
• Cough
• Sneezing
• Mild body aches or a mild headache
• Low-grade fever
• General feeling of being unwell (malaise)
Cold symptoms typically come on slowly and can linger for a week or more. They're usually uncomfortable but not serious. However, you should see a doctor if they get worse or don't go away.
Causes of common colds
Viruses cause the common cold, with rhinoviruses being the most common. Other viruses that can cause colds include coronaviruses, respiratory syncytial virus (RSV) and adenoviruses. These viruses also infect the upper respiratory tract, causing typical cold symptoms.
Colds are highly contagious and can spread easily from person to person. Viruses primarily transmit through these ways:
• Airborne droplets: When someone who is sick coughs, sneezes or talks, they release small drops into the air with the virus. Others nearby can breathe in these drops and get sick too.
• Direct contact: Touching objects with the virus on them, like doorknobs or phones, and then touching your face can spread it.
Who is at higher risk for colds?
Several factors can increase your risk of catching the common cold. These include:
• Age: Infants and young children under six years old are at the greatest risk for colds. Their immune systems are still developing, and they often have close contact with other children in daycare or school settings.
• Weakened immune system: People with weak immune systems, from chronic health conditions or poor nutrition, are more likely to get infections like colds.
• Time of year: Colds are more common during the fall and winter months. People spending more time indoors and close to others helps viruses spread easily.
• Smoking: Smokers and those exposed to secondhand smoke have a higher risk of catching colds. Smoking damages the respiratory tract and weakens the immune system, making it easier for viruses to take hold.
• Exposure to infected individuals: Close contact with someone who has a cold increases your risk of catching it. This includes living in the same household, working in close quarters or being in crowded places.
Practicing good hygiene and avoiding exposure to known sources of infection can help protect you and make it less likely you will get sick. This is especially important for individuals with conditions like cancer, high blood pressure and heart disease.
How to prevent colds
Here are some effective strategies to prevent getting colds:
• Wash your hands frequently with soap and water. Make sure to wash for at least 20 seconds. Hand washing is especially important after being in public places, touching surfaces or being near someone who is sick. If soap and water are not available, use an alcohol-based hand sanitizer.
• Try to avoid close contact with people who have colds. This includes keeping a safe distance and avoiding physical contact such as handshakes and hugs.
• Stay home if you are sick to avoid spreading the virus to others.
• Clean and disinfect frequently touched surfaces like doorknobs, light switches, keyboards and phones to prevent the spread of viruses through touch.
• Avoid touching your eyes, nose and mouth with unwashed hands, as this is a common way for viruses to enter your body.
• When you cough or sneeze, use a tissue or the inside of your elbow to cover your mouth and nose. Throw away tissues immediately and wash your hands to prevent spreading the virus to others.
Conditions often confused with a cold
Since several illnesses have similar signs and symptoms with the common cold, it can be easy to confuse them. Here's how to know if you may have a cold or another conditions:
Flu (influenza)
• Similarities: Fever, cough, sore throat, runny or stuffy nose, body aches
• Differences: Flu symptoms are usually more severe and can include high fever, chills and extreme fatigue. The flu often comes on suddenly and can lead to more serious health problems like pneumonia.
Allergies
• Similarities: Runny or stuffy nose, sneezing, coughing
• Differences: Allergies often cause itchy eyes, nose, or throat, and symptoms persist longer. Allergies do not typically cause a fever. They are triggered by allergens such as pollen, dust or pet dander.
Sinus infection (sinusitis)
• Similarities: Runny or stuffy nose, headache, cough
• Differences: Sinus infections may cause facial pain or pressure, thick yellow or green mucus, and can last longer than a cold. Sinusitis may also cause bad breath and a reduced sense of smell.
COVID-19
• Similarities: Fever, cough, sore throat, fatigue
• Differences: COVID-19 can cause unique symptoms such as loss of taste or smell, shortness of breath and has the potential for more serious complications like severe respiratory issues. Testing is necessary to confirm COVID-19, as symptoms can overlap with both colds and flu.
Understanding these differences can help you determine whether you are dealing with a common cold or another condition that may require different treatment or medical attention. If you're unsure, it's always best to consult a health care provider.
How do you treat a cold?
Treating a cold means relieving symptoms and helping your body's immune system as it fights off the virus. Here are some effective ways to treat a cold:
• Rest and hydration: Get plenty of rest. Sleep helps your body heal and recover. Drink lots of fluids like water, herbal teas and clear broths to stay hydrated. Proper hydration helps thin mucus and keep your throat moist.
• Use over-the-counter (OTC) medications to relieve symptoms: You can use over-the-counter medications, also known as cold medicines, to alleviate symptoms. Pain relievers such as acetaminophen or ibuprofen can reduce fever and ease aches. Decongestants can help with nasal congestion and cough syrups or lozenges can soothe a sore throat and suppress coughs.
• Take medication as directed: Be sure to follow the dosage instructions and be aware of any side effect each medicine may cause. Also, people who have high blood pressure need to take extra precautions when choosing cold medicine to avoid potential complications.
• Use a humidifier or saline nasal spray: A humidifier adds moisture to the air, which can help ease congestion and soothe irritated nasal passages. Saline nasal sprays can also help by moisturizing the nasal passages and loosening mucus.
• Drink warm fluids like tea or soup: Drinking warm fluids, such as herbal tea, broth, or soup, can provide comfort and help soothe a sore throat. The steam from hot liquids can also help ease congestion.
Remember, antibiotics treat bacterial infections and are not effective against viral infections like the common cold. If your symptoms persist or worsen, or if you have any concerns, consult a health care provider.
When to see a doctor for a cold
While the common cold is usually mild, there are times when you should seek medical attention. Here are some signs that it's time to see a doctor:
• Symptoms that worsen or don’t improve after 7 to 10 days.
• A high fever (over 102°F or 39°C) or a fever that lasts more than a few days.
• Severe symptoms like difficulty breathing, chest pain, persistent headaches or confusion.
• Symptoms that suggest a secondary infection, such as an ear infection or sinusitis, including severe ear pain, facial pain or pressure, thick yellow or green nasal discharge, or a significant change in symptoms after initial improvement.
If you're ever in doubt about your symptoms, it's always best to consult with a health care provider.
Key points
It's important to remember that while the common cold can be uncomfortable, most cases are mild and manageable at home with rest and self-care measures. However, if you experience severe or persistent symptoms, it's essential to seek medical advice to rule out more serious conditions and receive appropriate treatment.
Comprehensive care and support
At Banner Health, our team of health care professionals is dedicated to providing compassionate care and personalized treatment to help you feel better and recover from cold and flu symptoms. Whether you need to schedule an appointment with a primary care provider or require immediate care at one of our urgent care locations, we're here to meet your health care needs.
We understand that convenience is important when seeking health care services. That's why we offer online scheduling for appointments with primary care providers or you can save your spot at a nearby Banner Urgent Care.
|
__label__pos
| 0.945274 |
Standard library header <typeindex> (C++11)
This header is part of the types support library.
Includes
(C++20)
Three-way comparison operator support
Classes
(C++11)
wrapper around a type_info object, that can be used as index in associative and unordered associative containers
(class)
(C++11)
hash support for std::type_index
(class template specialization)
Forward declarations
Defined in header <functional>
(C++11)
hash function object
(class template)
Synopsis
#include <compare>
namespace std {
class type_index;
template<class T> struct hash;
template<> struct hash<type_index>;
}
Class std::type_index
namespace std {
class type_index {
public:
type_index(const type_info& rhs) noexcept;
bool operator==(const type_index& rhs) const noexcept;
bool operator< (const type_index& rhs) const noexcept;
bool operator> (const type_index& rhs) const noexcept;
bool operator<=(const type_index& rhs) const noexcept;
bool operator>=(const type_index& rhs) const noexcept;
strong_ordering operator<=>(const type_index& rhs) const noexcept;
size_t hash_code() const noexcept;
const char* name() const noexcept;
private:
const type_info* target; // exposition only
// Note that the use of a pointer here, rather than a reference,
// means that the default copy/move constructor and assignment
// operators will be provided and work as expected.
};
}
C++
|
__label__pos
| 0.840783 |
×
results found in ( seconds)
Code
Description
We are looking for ways to improve. If you have an suggestion for how ICD.Codes could be better, submit your idea!
ICD-10-CM Code D59
Acquired hemolytic anemia
NON-BILLABLE
Non-Billable Code
Non-Billable means the code is not sufficient justification for admission to an acute care hospital when used a principal diagnosis. Use a child code to capture more detail.
| ICD-10 from 2011 - 2016
ICD Code D59 is a non-billable code. To code a diagnosis of this type, you must use one of the nine child codes of D59 that describes the diagnosis 'acquired hemolytic anemia' in more detail.
The ICD code D59 is used to code Anemia
Anemia, also spelt anaemia, is usually defined as a decrease in the amount of red blood cells (RBCs) or hemoglobin in the blood. It can also be defined as a lowered ability of the blood to carry oxygen. When anemia comes on slowly the symptoms are often vague and may include: feeling tired, weakness, shortness of breath or a poor ability to exercise. Anemia that comes on quickly often has greater symptoms which may include: confusion, feeling like one is going to pass out, loss of consciousness, or increased thirst. Anemia must be significant before a person becomes noticeably pale. Additional symptoms may occur depending on the underlying cause.
Specialty: Hematology
MeSH Codes: D000740, D000740, D000740, D000740, D000740, D000740
ICD 9 Codes: 280, 281, 283, 282, 284, 285
Human blood from a case of iron-deficiency anemia
Source: Wikipedia
ICD-10-CM Alphabetical Index References for 'D59 - Acquired hemolytic anemia'
The ICD-10-CM Alphabetical Index links the below-listed medical terms to the ICD code D59. Click on any term below to browse the alphabetical index.
** This Document Provided By ICD.Codes **
Source: http://icd.codes/icd10cm/D59
|
__label__pos
| 0.89508 |
Google Play Services for Location and Activity Recognition
Android Development with Google Play Services
This article was peer reviewed by Marc Towler. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!
People like to take their mobile devices everywhere and use them constantly. Some apps take advantage of this and change their behaviour according to the users location and/or current activity to provide a better individualized service.
To get the user’s current location on Android, you can use the Location API that has been part of the Android framework since API level 1, or you can use the Google Location Services API, which is part of Google Play Services. The latter is the recommended method for accessing Android location.
The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automates tasks such as location provider choice and power management. Location Services provides new features such as activity detection that aren’t available in the framework API.
Developers using the framework API, as well as those now adding location-awareness to their apps, are strongly advised to use the Location Services API and this is what we will look at in this article. We will create different apps that show how to get a users current location, update it periodically and detecting the user’s current activity. For example, are they walking, running, on a bicycle, in a vehicle, etc.
Note: The device you use for testing during this tutorial must have support for Google Play Services. You should have a device that runs Android 2.3 or higher and includes the Google Play Store. If you are using an emulator, you need an emulator image with the Google APIs platform based on Android 4.2.2 or higher.
Getting the Last Known Location
The Google Play Services Location API can request the last known location of the user’s device, this is equivalent to the user’s current location.
To get the device’s last known location, use the FusedLocationProviderApi which allows you to specify requirements such as the location accuracy required. High accuracy means more battery power used.
Create a new Android project, name it Example01, set the Minimum SDK version to 2.3.3 (Gingerbread) and select Empty Activity on the next window, leave the default settings in the last window and click on Finish.
Note: I’m assuming that you are using Android Studio 1.4 or later, where the Activity templates have changed. The Blank Activity template in previous versions resulted in an app with an almost empty view, but it now includes a Floating Action Button. We’ll use the Empty Activity for our project, if you are using a previous version, then select Blank Activity.
Include the following dependency in the build.gradle (Module: app) file and sync the gradle files.
compile 'com.google.android.gms:play-services:8.1.0'
To use location services, the app must request permission to do so. Android offers two location permissions: ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION. The permission you choose determines the accuracy of the location returned by the API. Fine Location uses the device GPS, cellular data and WiFi to get the most accurate position but it costs battery life. Coarse Location uses the device cellular data and WiFi to get the location. It wont be as accurate as Fine but uses a lot less battery power, returning a location with an accuracy equivalent to a city block.
Add the following permission to the AndroidManifest.xml file as a child of the manifest tag.
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Note: If you have used Google Play Services in an app before, you might be used to adding the following to the manifest file which sets the version number of Google Play Services your app uses.
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
As of version 7.0 of Google Play Services, if you are using Gradle, it’s included automatically..
We’ll be using the fused location provider to get the device’s location. This information will be presented as a Location object from which you can retrieve the latitude, longitude, timestamp, and other information such as bearing, altitude and velocity of a location.
The apps we’ll create, will display the raw latitude and longitude data of the retrieved Location. In a real app, you might use this information to, for instance, get the location Address, plot the location on a map, change the UI or fire a notification.
Let’s create the UI that will display the latitude and longitude values. Change activity_main.xml as shown.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:id="@+id/latitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Latitude:"
android:textSize="18sp" />
<TextView
android:id="@+id/latitude_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/latitude"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/latitude"
android:textSize="16sp" />
<TextView
android:id="@+id/longitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Longitude:"
android:layout_marginTop="24dp"
android:textSize="18sp" />
<TextView
android:id="@+id/longitude_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/longitude"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/longitude"
android:textSize="16sp"/>
</RelativeLayout>
Add the following in MainActivity.java.
private static final String TAG = "MainActivity";
private TextView mLatitudeTextView;
private TextView mLongitudeTextView;
Instantiate the two TextViews by adding the following at the end of onCreate(Bundle).
mLatitudeTextView = (TextView) findViewById((R.id.latitude_textview));
mLongitudeTextView = (TextView) findViewById((R.id.longitude_textview));
When you want to connect to one of the Google APIs provided in the Google Play services library, you need to create an instance of GoogleApiClient. The Google API Client provides a common entry point to all Google Play services and manages the network connection between the user’s device and each Google service.
Before making the connection, you must always check for a compatible Google Play services APK. To do this either use the isGooglePlayServicesAvailable() method or attach a GoogleApiClient.OnConnectionFailedListener object to your client and implement its onConnectionFailed() callback method. We’ll use the latter approach.
If the connection fails due to a missing or out-of-date version of the Google Play APK, the callback receives an error code such as SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED or SERVICE_DISABLED.
Change the class definition as shown.
public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener
Add the necessary imports and implement the following methods from the two interfaces.
@Override
public void onConnected(Bundle bundle) {
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
}
The ConnectionCallbacks interface provides callbacks that called when the client connects or disconnects from the service (onConnected() and onConnectionSuspended()) and the OnConnectionFailedListener interface provides callbacks for scenarios that result in a failed attempt to connect the client to the service (onConnectionFailed()).
Before any operation executes, the GoogleApiClient must connect using the connect() method. The client is not considered connected until the onConnected(Bundle) callback has been called.
When your app finishes using this client, call disconnect() to free up resources.
You should instantiate the client object in your Activity’s onCreate(Bundle) method and then call connect() in onStart() and disconnect() in onStop().
Add the following class variables that will hold the GoogleApiClient and Location objects.
private GoogleApiClient mGoogleApiClient;
private Location mLocation;
At the end of onCreate() method, create an instance of the Google API Client using GoogleApiClient.Builder. Use the builder to add the LocationServices API.
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
Change the previously added callback methods as shown.
@Override
public void onConnected(Bundle bundle) {
mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
if (mLocation != null) {
mLatitudeTextView.setText(String.valueOf(mLocation.getLatitude()));
mLongitudeTextView.setText(String.valueOf(mLocation.getLongitude()));
} else {
Toast.makeText(this, "Location not Detected", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onConnectionSuspended(int i) {
Log.i(TAG, "Connection Suspended");
mGoogleApiClient.connect();
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(TAG, "Connection failed. Error: " + connectionResult.getErrorCode());
}
In the onConnected() method, we get the Location object by calling getLastLocation() and then update the UI with the latitude and longitude values from the object. The Location object returned may in rare cases be null when the location is not available, so we check for this.
onConnectionSuspended() is called if the connection is lost for whatever reason and here we attempt to re-establish the connection. If the connection fails, onConnectionFailed() is called and we just log the error code. You can view the available error codes here.
Override the onStart() and onStop() methods as shown.
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
}
These start and disconnect the connection to the service when appropriate.
Run the app and you should see the latitude and longitude displayed.
Example 1 Demo
You can download the completed Example01 project here.
Getting Periodic Location Updates
Some apps, for example fitness or navigation apps, might need to continuously track location data. While you can get a device’s location with getLastLocation(), a more direct approach is to request periodic updates from the fused location provider. The API will then update your app periodically with the best available location, based on the currently-available location providers such as WiFi and GPS. The accuracy of the location is determined by the providers, the location permissions you’ve requested, and the options you set in the location request.
Create another project with similar settings to the last projects and name it Example02.
Add the play services dependency to the build.gradle(Module: app) file.
compile 'com.google.android.gms:play-services:8.1.0'
Add the permission to the manifest file.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Change activity_main.xml as below.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<TextView
android:id="@+id/latitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Latitude:"
android:textSize="18sp" />
<TextView
android:id="@+id/latitude_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/latitude"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/latitude"
android:textSize="16sp" />
<TextView
android:id="@+id/longitude"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Longitude:"
android:layout_marginTop="24dp"
android:textSize="18sp" />
<TextView
android:id="@+id/longitude_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/longitude"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/longitude"
android:textSize="16sp"/>
</RelativeLayout>
Change the class definition of MainActivity.
public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener
Make the necessary imports. For the LocationListener import import com.google.android.gms.location.LocationListener and not the other suggested import.
LocationListener is used for receiving notifications from the FusedLocationProviderApi when the location has changed.
Implement the methods from the three interfaces.
@Override
public void onConnected(Bundle bundle) {
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
}
The onLocationChanged() method is called when the location changes.
Add the following class variables.
private static final String TAG = "MainActivity";
private GoogleApiClient mGoogleApiClient;
private LocationRequest mLocationRequest;
private String mLastUpdateTime;
private TextView mLatitudeTextView;
private TextView mLongitudeTextView;
LocationRequest is a data object that contains quality of service parameters for requests to the FusedLocationProviderApi. We’ll see its use soon.
Change onCreate() as shown below to override the onStart() and onPause() methods.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mLatitudeTextView = (TextView) findViewById((R.id.latitude_textview));
mLongitudeTextView = (TextView) findViewById((R.id.longitude_textview));
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
}
This is similar to what we did in the previous example, so there is no need for explanation.
Change the previously implemented interface methods as below.
@Override
public void onConnected(Bundle bundle) {
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(5000);
mLocationRequest.setFastestInterval(3000);
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
}
@Override
public void onConnectionSuspended(int i) {
Log.i(TAG, "Connection Suspended");
mGoogleApiClient.connect();
}
@Override
public void onLocationChanged(Location location) {
mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());
mLatitudeTextView.setText(String.valueOf(location.getLatitude()));
mLongitudeTextView.setText(String.valueOf(location.getLongitude()));
Toast.makeText(this, "Updated: " + mLastUpdateTime, Toast.LENGTH_SHORT).show();
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(TAG, "Connection failed. Error: " + connectionResult.getErrorCode());
}
In onConnected() we create the LocationRequest object which stores parameters for requests to the fused location provider. The parameters determine the levels of accuracy requested. To find out about all the options available in the location request, see the LocationRequest class reference. In our example, we set the priority, update interval and the fastest update interval.
setPriority() sets the priority of the request, which gives the Google Play services location services a strong hint about which location sources to use. The following values are supported:
• PRIORITY_BALANCED_POWER_ACCURACY: Use this setting to request location precision to within a city block, which is an accuracy of approximately 100 meters. This is considered a coarse level of accuracy, and is likely to consume less power. With this setting, the location services will probably use WiFi and cell tower positioning. Note that the choice of location provider depends on other factors, such as which sources are available.
• PRIORITY_HIGH_ACCURACY: Use this setting to request the most precise location possible. With this setting, the location services are more likely to use GPS to determine the location.
• PRIORITY_LOW_POWER: Use this setting to request city-level precision, which is an accuracy of approximately 10 kilometers. This is considered a coarse level of accuracy, and is likely to consume less power.
• PRIORITY_NO_POWER: Use this setting if you need negligible impact on power consumption but want to receive location updates when available. With this setting, your app does not trigger any location updates, but receives locations triggered by other apps.
The setInterval() method sets the desired interval in milliseconds for active location updates. This interval is inexact. You may not receive updates at all if no location sources are available, or you may receive them slower than requested. You may receive updates faster than requested if other applications are requesting locations at a faster interval.
The setFastestInterval() method sets the fastest rate for active location updates. This interval is exact, and your application will never receive updates faster than this value. You need to set this rate because other apps will affect the rate at which updates are sent. The Google Play services location APIs send out updates at the fastest rate that any app has requested with setInterval(). If this rate is faster than your app can handle, you may encounter problems with UI flicker or data overflow. To prevent this, you set an upper limit to the update rate.
With the location request set up, we call requestLocationUpdates() to start the regular updates.
The onLocationChanged() method is called with the updated location. Here, we update the UI with the location information. We also set off a Toast message showing the time of update.
Run the app and you should see the updating location data if you move far enough for the readings to change.
Example 2 Demo
The completed Example02 project can be downloaded here.
Activity Recognition
Other than detecting the location of your Android device, the Google Location Services API can also be used to detect the activities that the device, and thus the user, might be undertaking. It can detect activities such as the user being on foot, in a vehicle, on a bicycle or still. It doesn’t give definite data, just the probability of the possibility that an activity is happening. It’s up to the programmer to read this data and decide what to do with it.
To get started, create a new project named Example03 with the same settings as the previous two projects.
Include the dependency in build.gradle (Module: app) file and sync the gradle files.
compile 'com.google.android.gms:play-services:8.1.0'
In the manifest file, include the following activity recognition permission as a child of the manifest tag.
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
Change activity_main.xml as below.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context=".MainActivity">
<Button
android:id="@+id/request_updates_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="requestActivityUpdates"
android:text="Request Activity Updates" />
<Button
android:id="@+id/remove_updates_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="removeActivityUpdates"
android:text="Remove Activity Updates" />
<TextView
android:id="@+id/detected_activities_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"/>
</LinearLayout>
Usually, applications that make use of Activity Recognition monitor activities in the background and perform an action when a specific activity is detected. To do this without needing a service that is always running in the background consuming resources, detected activities are delivered via an Intent. The application specifies a PendingIntent callback (typically an IntentService) which will be called with an intent when activities are detected. The intent recipient can extract the ActivityRecognitionResult using extractResult(android.content.Intent).
Before the IntentService class, create a class called Constants and change it as shown. It will hold some constant values we’ll use later.
package com.echessa.example03; // Change as appropriate
/**
* Created by echessa on 10/14/15.
*/
public class Constants {
private Constants(){
}
public static final String PACKAGE_NAME = "com.echessa.activityexample"; // Change as appropriate
public static final String STRING_ACTION = PACKAGE_NAME + ".STRING_ACTION";
public static final String STRING_EXTRA = PACKAGE_NAME + ".STRING_EXTRA";
}
Next we create an IntentService. Create a class called ActivitiesIntentService and make it extend IntentService. Change the contents as shown.
package com.echessa.example03; // Change as appropriate
import android.app.IntentService;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;
import com.google.android.gms.location.ActivityRecognitionResult;
import com.google.android.gms.location.DetectedActivity;
import java.util.ArrayList;
/**
* Created by echessa on 10/14/15.
*/
public class ActivitiesIntentService extends IntentService {
private static final String TAG = "ActivitiesIntentService";
public ActivitiesIntentService() {
super(TAG);
}
@Override
protected void onHandleIntent(Intent intent) {
ActivityRecognitionResult result = ActivityRecognitionResult.extractResult(intent);
Intent i = new Intent(Constants.STRING_ACTION);
ArrayList<DetectedActivity> detectedActivities = (ArrayList) result.getProbableActivities();
i.putExtra(Constants.STRING_EXTRA, detectedActivities);
LocalBroadcastManager.getInstance(this).sendBroadcast(i);
}
}
In the above class, the constructor is required. It calls the super IntentService(String) constructor with the name of a worker thread.
In onHandleIntent(), we get the ActivityRecognitionResult from the Intent by using extractResult(). We then use this result to get an array list of DetectedActivity objects. Each activity is associated with a confidence level, which is an int between 0 and 100. Then we create a new Intent on which we are going to send the detected activities. Finally we broadcast the Intent so that it can be picked up.
Paste the following into the manifest file so that the Android system knows about the service. It should be a child of the application tag.
<service
android:name=".ActivitiesIntentService"
android:exported="false" />
In MainActivity implement the ConnectionCallbacks and OnConnectionFailedListener interfaces.
public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener
Make the necessary imports and implement their methods.
@Override
public void onConnected(Bundle bundle) {
Log.i(TAG, "Connected");
}
@Override
public void onConnectionSuspended(int i) {
Log.i(TAG, "Connection suspended");
mGoogleApiClient.connect();
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
Log.i(TAG, "Connection failed. Error: " + connectionResult.getErrorCode());
}
You will see an error as we haven’t created the mGoogleApiClient variable yet.
Add the following variables to MainActivity.
private static final String TAG = "MainActivity";
private GoogleApiClient mGoogleApiClient;
private TextView mDetectedActivityTextView;
Paste the following at the end of onCreate().
mDetectedActivityTextView = (TextView) findViewById(R.id.detected_activities_textview);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(ActivityRecognition.API)
.build();
Note that we add the ActivityRecognition.API when creating the Google Api Client and not the location API as we did in the previous examples.
Include the onStart() and onStop() methods to connect and disconnect the client.
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
}
In the ActivitiesIntentService class, we broadcast an Intent that has an array of detected activities and we need a receiver class to receive this. Before we create that, Include the following strings in the strings.xml. file.
<string name="in_vehicle">In a vehicle</string>
<string name="on_bicycle">On a bicycle</string>
<string name="on_foot">On foot</string>
<string name="running">Running</string>
<string name="walking">Walking</string>
<string name="still">Still</string>
<string name="tilting">Tilting</string>
<string name="unknown">Unknown activity</string>
<string name="unidentifiable_activity">Unidentifiable activity: %1$d</string>
In MainActivity, add the following method which we’ll use later in our BroadcastReciever. This takes the code for the detected activity type and returns a relevant string related to the activity.
public String getDetectedActivity(int detectedActivityType) {
Resources resources = this.getResources();
switch(detectedActivityType) {
case DetectedActivity.IN_VEHICLE:
return resources.getString(R.string.in_vehicle);
case DetectedActivity.ON_BICYCLE:
return resources.getString(R.string.on_bicycle);
case DetectedActivity.ON_FOOT:
return resources.getString(R.string.on_foot);
case DetectedActivity.RUNNING:
return resources.getString(R.string.running);
case DetectedActivity.WALKING:
return resources.getString(R.string.walking);
case DetectedActivity.STILL:
return resources.getString(R.string.still);
case DetectedActivity.TILTING:
return resources.getString(R.string.tilting);
case DetectedActivity.UNKNOWN:
return resources.getString(R.string.unknown);
default:
return resources.getString(R.string.unidentifiable_activity, detectedActivityType);
}
}
Add the following subclass to MainActivity that extends BroadcastReceiver.
public class ActivityDetectionBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
ArrayList<DetectedActivity> detectedActivities = intent.getParcelableArrayListExtra(Constants.STRING_EXTRA);
String activityString = "";
for(DetectedActivity activity: detectedActivities){
activityString += "Activity: " + getDetectedActivity(activity.getType()) + ", Confidence: " + activity.getConfidence() + "%\n";
}
mDetectedActivityTextView.setText(activityString);
}
}
Above, we get the array of detected activities and iterate through them getting the type and confidence of each. We then append this to a string and update the UI with the string.
In MainActivity add the following variable.
private ActivityDetectionBroadcastReceiver mBroadcastReceiver;
Then instantiate it in onCreate() after the statement that instantiates mDetectedActivityTextView
mBroadcastReceiver = new ActivityDetectionBroadcastReceiver();
Add the following methods to MainActivity.
public void requestActivityUpdates(View view) {
if (!mGoogleApiClient.isConnected()) {
Toast.makeText(this, "GoogleApiClient not yet connected", Toast.LENGTH_SHORT).show();
} else {
ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(mGoogleApiClient, 0, getActivityDetectionPendingIntent()).setResultCallback(this);
}
}
public void removeActivityUpdates(View view) {
ActivityRecognition.ActivityRecognitionApi.removeActivityUpdates(mGoogleApiClient, getActivityDetectionPendingIntent()).setResultCallback(this);
}
private PendingIntent getActivityDetectionPendingIntent() {
Intent intent = new Intent(this, ActivitiesIntentService.class);
return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
Then change the class definition to implement ResultCallback since in the code above we set the result callback to this.
public class MainActivity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener, ResultCallback<Status>
The first method above uses requestActivityUpdates() to register for activity recognition updates, while the second unregisters. The activities are detected by periodically waking up the device and reading short bursts of sensor data. It makes use of low power sensors to keep the power usage to a minimum. The activity detection update interval can be controlled with the second parameter. Larger values will result in fewer activity detections while improving battery life. Smaller values will result in more frequent activity detections but will consume more power since the device must be woken more frequently. Activities may arrive several seconds after the requested interval if the activity detection service requires more samples to make a more accurate prediction.
Implement the following ResultCallback method which takes the status and logs out different messages depending on it.
public void onResult(Status status) {
if (status.isSuccess()) {
Log.e(TAG, "Successfully added activity detection.");
} else {
Log.e(TAG, "Error: " + status.getStatusMessage());
}
}
Add the following to MainActivity.
@Override
protected void onResume() {
super.onResume();
LocalBroadcastManager.getInstance(this).registerReceiver(mBroadcastReceiver, new IntentFilter(Constants.STRING_ACTION));
}
@Override
protected void onPause() {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mBroadcastReceiver);
super.onPause();
}
This registers and unregisters the broadcast receiver when the activity resumes and pauses respectively.
Run the app, and on pressing the Request Activity Updates button, you should start getting activity updates. You might need to wait a few seconds for the updates to start showing.
Example 3 Demo
The completed Example03 project can be downloaded here.
Conclusion
We have not exhausted all the capabilities of the Google Play Services Location APIs, there are some topics we haven’t covered such as Geofencing, getting the address of the Location and mapping the Location on a map. We’ll look into the topic in the Maps article that will be part of this Google Play Services series.
Please let me know if you have any questions or comments below.
Sponsors
|
__label__pos
| 0.822487 |
Gdpr Record Of Processing Activities Example
A closer look at Commissioner...
Sweet Home 3d Example Files
Sweet Home 3D Roof Tutorial YouTube...
Example Of Text That Enumerates
Upload Enumerate text fields in a form....
Example Of Phenomenological Research In Education
A PHENOMENOLOGICAL STUDY OF THE LIVED EXPERIENCES OF...
Design And Construct Contract Example
Design and Build Contract The Joint Contracts Tribunal (JCT)...
Certificate Of Origin Example Canada
Electronic Certificate of Origin (eCO)...
Rc4 Algorithm Explanation With Example
Encryption Types media.datadirect.com...
Cover Letter Example For Teacher With No Experience
Cover Letter Sample Teacher No Experience...
Slack Real Time Messaging Api Example
How to make custom trigger with Azure Functions Medium...
Science Experiment Write Up Example
Science Experiment Recording Sheet Science experiment...
Chemical of equation an example a
23.12.2019 | Saskatchewan
an example of a chemical equation
Chemical Equation Definition & Example - Chemistry
Chemistry Chemical Equations Shmoop Chemistry. Balancing chemical equations - phet interactive simulations, definitions of acids and bases. arrhenius represented in their ionized form in chemical the k a or k b equation as you did earlier. example.
Balancing Chemical Reactions Practice Chemical calculator. 14/11/2018в в· how to balance chemical equations. a chemical equation is a written symbolic representation of a chemical reaction. the reactant chemical(s) are given on the left, chemistry: how to balance equations with polyatomic ions, examples and step by step solutions, three helpful tips and tricks that make balancing chemical equations.
The following diagram shows how to write a chemical equation. scroll down the page for more examples and solutions. conversion of word equation to chemical equation example of balancing the combustion reaction of ethylene, cв‚‚hв‚„. some tips on how to balance more complicated reactions.
Definitions of acids and bases. arrhenius represented in their ionized form in chemical the k a or k b equation as you did earlier. example 11/06/2011в в· mr. causey shows you how to write chemical equations. mr. causey discusses the parts of a chemical equation, the symbols involved and the steps required
When you write an equation for a chemical reaction, for example, if you write the following, it means you have two water molecules: balancing chemical equation with substitution. practice: balancing chemical equations 1. this is the currently selected item. next tutorial. stoichiometry
A chemical equation is a way to predict the way that two or more chemicals will work together. using what chemists know about the way chemicals act, we add the letter an acidвђ“base reaction is a chemical reaction that occurs between an acid and a base, which can be used to determine ph. several theoretical frameworks provide
an example of a chemical equation
Chemical Equation Definition & Example - Chemistry
Balancing more complex chemical equations (video) Khan. Let's take the reaction of hydrogen with oxygen to form water as an example. to write the chemical equation for this in writing chemical equations,, balancing chemical equations - phet interactive simulations); balancing chemical equations - phet interactive simulations, over 250 chemical reaction equations to balance - with the key to check your answers..
an example of a chemical equation
Balancing Chemical Equations Online Math Learning
Balancing Chemical Equations Online Math Learning. Formulas and equations. types of chemical formulas. in earlier topics, example in equation writing, by their empirical formula. being elements, the, let's take the reaction of hydrogen with oxygen to form water as an example. to write the chemical equation for this in writing chemical equations,.
an example of a chemical equation
Chemical Equation Definition & Example - Chemistry
Writing and Balancing Chemical Equations Chemistry for. Reactions can be represented by a chemical equation. chemical equations. fire, for example, is not a chemical - it is infact a form of energy,, example 1. write and balance the chemical equation for each given chemical reaction. hydrogen and chlorine react to make hcl. ethane, c 2 h 6, reacts with oxygen to.
Balancing chemical equation with substitution. practice: balancing chemical equations 1. this is the currently selected item. next tutorial. stoichiometry balancing chemical equations - phet interactive simulations
Write the complete ionic equation by describing water-soluble ionic compounds as separate ions and insoluble example 1 вђ“ predicting precipitation 12/11/2018в в· how to write a chemical equation. practice with some examples. the best way to learn formula writing is to practice with lots of examples.
Balancing of a chemical equation is based on the principle of atom what are balanced chemical equations? what are 6 examples of balanced chemical equations? example of balancing the combustion reaction of ethylene, cв‚‚hв‚„. some tips on how to balance more complicated reactions.
Example 1. write and balance the chemical equation for each given chemical reaction. hydrogen and chlorine react to make hcl. ethane, c 2 h 6, reacts with oxygen to examples of the chemical equations reagents give us feedback about your experience with chemical equation balancer. chemical equations balanced today:
EXCEL PIVOT TABLE David Geffen School think of a list as a simple database, The following table is a sample report which shows summarized expense for three Pivot table simple example pdf Pivot Tables/Charts (Microsoft Excel 2010) You can use pivot tables whenever you want to summarize a large amount of data, For example, click the boxes next
Example 1. write and balance the chemical equation for each given chemical reaction. hydrogen and chlorine react to make hcl. ethane, c 2 h 6, reacts with oxygen to, i. the meaning of a chemical equation a chemical equation is a chemistвђ™s shorthand expression for describing a chemical change. as an example, -).
an example of a chemical equation
Differential Equation Modeling - Chemical Reactions
Read the next post: smart products are an example of the internet of things
Read the previous post: example of direct presentation in literature
|
__label__pos
| 1 |
Handwritten Digit Recognition using TensorFlow with Python-2
In this tensorlfow project, our goal is to correctly identify digits from a dataset of tens of thousands of handwritten images.
explanation image
Videos
Each project comes with 2-5 hours of micro-videos explaining the solution.
ipython image
Code & Dataset
Get access to 102+ solved projects with iPython notebooks and datasets.
project experience
Project Experience
Add project experience to your Linkedin/Github profiles.
Customer Love
What will you learn
Understanding the problem statement
Directly downloading and using MNIST dataset
Understanding complete Flowchart of how a Neural Network works
Understanding One-hot encoded vectors
Converting encoded vector to images using helper function
What is Tensorflow and how does it works
What are Placeholder variables
Understanding a deep learning model and terms associated with it
Softmax activation function
"Gradient Descent Optimizer " and "Cross_entropy" loss function
Defining and Initiating a Tensorflow session
Plotting graphs after each epoch
Ensembling different Neural Networks to create a sequence instead of the best Neural Network
Plotting graphs for weights after each optimization iteration
Making function for plotting graphs for each Convolution layer
Saving and Restoring variables of a Neural Networks
Visualization of Weights and Optimization iteration using Confusion Matrix
Using Seaborn's heatmap function for visualizing Confusion Matrix
Project Description
Start here if...
you’re new to computer vision. This project is the perfect introduction to techniques like neural networks using a classic dataset including pre-extracted features.
Project Description:
MNIST ("Modified National Institute of Standards and Technology") is the de facto “hello world” dataset of computer vision. Since its release in 1999, this classic dataset of handwritten images has served as the basis for benchmarking classification algorithms. As new machine learning techniques emerge, MNIST remains a reliable resource for researchers and learners alike.
In this TensorFlow project, our goal is to correctly identify digits from a dataset of tens of thousands of handwritten images. We encourage you to experiment with different algorithms to learn first-hand what works well and how techniques compare.
Practice Skills:
Computer vision fundamentals including simple neural networks
Data Introduction:
Each image is 28 pixels in height and 28 pixels in width, for a total of 784 pixels in total. Each pixel has a single pixel-value associated with it, indicating the lightness or darkness of that pixel, with higher numbers meaning darker. This pixel-value is an integer between 0 and 255, inclusive.
The training data set, (train.csv), has 785 columns. The first column, called "label", is the digit that was drawn by the user. The rest of the columns contain the pixel-values of the associated image.
Each pixel column in the training set has a name like pixelx, where x is an integer between 0 and 783, inclusive. To locate this pixel on the image, suppose that we have decomposed x as x = i * 28 + j, where i and j are integers between 0 and 27, inclusive. Then pixelx is located on row i and column j of a 28 x 28 matrix, (indexing by zero).
Acknowledgements:
More details about the dataset, including algorithms that have been tried on it and their levels of success, can be found at http://yann.lecun.com/exdb/mnist/index.html. The dataset is made available under a Creative Commons Attribution-Share Alike 3.0 license.
New Projects
Curriculum For This Mini Project
7-July-2017
02h 17m
8-July-2017
01h 31m
Latest Blogs
|
__label__pos
| 0.753177 |
stream_get_line
(PHP 5, PHP 7)
stream_get_lineGets line from stream resource up to a given delimiter
Descrierea
stream_get_line ( resource $handle , int $length [, string $ending ] ) : string
Gets a line from the given handle.
Reading ends when length bytes have been read, when the string specified by ending is found (which is not included in the return value), or on EOF (whichever comes first).
This function is nearly identical to fgets() except in that it allows end of line delimiters other than the standard \n, \r, and \r\n, and does not return the delimiter itself.
Parametri
handle
A valid file handle.
length
The number of bytes to read from the handle.
ending
An optional string delimiter.
Valorile întoarse
Returns a string of up to length bytes read from the file pointed to by handle.
If an error occurs, returns FALSE.
A se vedea și
• fread() - Binary-safe file read
• fgets() - Gets line from file pointer
• fgetc() - Gets character from file pointer
|
__label__pos
| 0.829976 |
Pedal Power Showdown: Alloy Cranks vs. Carbon – Which is Right for You?
When it comes to choosing the right cranks for your bike, there are a lot of factors to consider. One of the most significant decisions is whether to go with alloy or carbon cranks. Both materials have their advantages and disadvantages, and it’s essential to understand the differences to make an informed decision.
Alloy cranks are made from a blend of metals, typically aluminum, and are the most common type of cranks on the market. They are known for their durability, affordability, and ease of maintenance. Carbon cranks, on the other hand, are made from carbon fiber, a lightweight and strong material that is commonly used in high-performance applications. Carbon cranks are known for their stiffness, weight savings, and vibration dampening properties.
Key Takeaways
• Alloy cranks are durable, affordable, and easy to maintain.
• Carbon cranks are lightweight, stiff, and have vibration dampening properties.
• The choice between alloy and carbon cranks ultimately comes down to personal preference and the intended use of the bike.
Understanding Alloy Cranks
Composition of Alloy Cranks
Alloy cranks are made from a combination of metals, usually aluminum, magnesium, and/or zinc. These metals are melted down and cast into molds to create the shape of the crank. The resulting alloy is then heat-treated to increase its strength and durability.
Aluminum is the most common metal used in alloy cranks. It is lightweight, strong, and resistant to corrosion. Magnesium is also used in some alloy cranks because it is even lighter than aluminum, but it is more expensive and can be more brittle. Zinc is sometimes added to alloy cranks to improve their strength and durability.
Benefits of Alloy Cranks
One of the biggest benefits of alloy cranks is their affordability. They are generally less expensive than carbon cranks, which makes them a popular choice for budget-conscious riders. Alloy cranks are also more durable than carbon cranks and can withstand more abuse without cracking or breaking.
Alloy cranks are also easier to maintain than carbon cranks. They are less likely to get damaged during transport or storage, and they can be repaired if they do get damaged. Carbon cranks, on the other hand, are more fragile and can be more difficult to repair if they are damaged.
Another benefit of alloy cranks is their versatility. They can be used for a variety of riding styles, from road cycling to mountain biking. They are also available in a wide range of sizes and styles, so you can find the perfect crank for your bike and your riding style.
Overall, alloy cranks are a great choice for riders who want a durable, affordable, and versatile crankset that can handle a variety of riding styles and conditions.
Understanding Carbon Cranks
Composition of Carbon Cranks
Carbon cranks are made from a combination of carbon fiber and resin. The carbon fiber is a strong, lightweight material that is used to make the crank arm, while the resin is used to bond the fibers together. The resulting composite material is both lightweight and strong, making it a popular choice for high-performance bike components.
The manufacturing process for carbon cranks involves laying up the carbon fibers in a specific pattern, then coating them with resin. The resulting composite material is then cured in an oven to create a solid, rigid structure. The pattern of the carbon fibers can be adjusted to provide different levels of stiffness and strength, which allows manufacturers to tailor the cranks to specific applications.
Advantages of Carbon Cranks
One of the biggest advantages of carbon cranks over alloy cranks is their weight. Carbon cranks are significantly lighter than alloy cranks, which can help reduce the overall weight of your bike. This can make a big difference in terms of performance, particularly when it comes to climbing and acceleration.
Another advantage of carbon cranks is their stiffness. Carbon fiber is an incredibly stiff material, which means that carbon cranks are able to transfer power more efficiently than alloy cranks. This can result in a more responsive and efficient ride, particularly when you’re putting down a lot of power.
Finally, carbon cranks are also more durable than alloy cranks. While alloy cranks can be prone to cracking and breaking over time, carbon cranks are able to withstand more punishment without failing. This means that they can last longer and require less maintenance over time.
Overall, carbon cranks are a great choice for anyone looking to improve the performance of their bike. They offer a number of advantages over alloy cranks, including reduced weight, increased stiffness, and improved durability. If you’re looking to upgrade your bike, carbon cranks are definitely worth considering.
Comparative Analysis
When it comes to choosing between alloy cranks and carbon cranks, there are several factors that you need to consider. In this section, we will provide a comparative analysis of these two types of cranks to help you make an informed decision.
Durability Comparison
One of the most important factors to consider when choosing cranks is durability. In general, alloy cranks are more durable than carbon cranks. Alloy cranks can withstand more impact and abuse, and they are less likely to crack or break under stress. Carbon cranks, on the other hand, are more prone to damage from impacts and may crack or break if subjected to excessive stress.
Weight Comparison
Another important factor to consider is weight. Carbon cranks are generally lighter than alloy cranks. This can be an advantage for riders who are looking to shave off weight from their bikes. However, the weight difference between the two types of cranks may not be significant enough to make a noticeable difference in performance for most riders.
The table below compares the weight of alloy and carbon cranks:
Crank TypeWeight
Alloy700g
Carbon485g
Stiffness Comparison
Stiffness is another factor that can affect performance. In general, carbon cranks are stiffer than alloy cranks. This means that they transfer power more efficiently from the pedals to the chainring, resulting in better acceleration and more responsive handling. However, some riders may prefer the slightly more forgiving feel of alloy cranks, especially on rough terrain.
In conclusion, both alloy and carbon cranks have their advantages and disadvantages. Alloy cranks are generally more durable, while carbon cranks are lighter and stiffer. Ultimately, the choice between the two types of cranks will depend on your personal preferences and riding style.
Application Scenarios
Alloy Cranks in Racing
Alloy cranks are an excellent choice for racing scenarios. They are lightweight, durable, and can handle high power output. The stiffness of the alloy cranks makes them ideal for sprinting and accelerating quickly. They are also cost-effective, making them a great option for those on a budget.
In addition to their performance benefits, alloy cranks are also easy to maintain. They do not require special care or attention, and they can withstand harsh riding conditions. This makes them an ideal choice for racing scenarios where time is of the essence, and you need to focus on your performance rather than maintenance.
Carbon Cranks in Mountain Biking
Carbon cranks are an excellent choice for mountain biking scenarios. They are lightweight, which makes them ideal for climbing and maneuvering through technical terrain. The stiffness of carbon cranks also provides excellent power transfer, making them ideal for aggressive riding styles.
Carbon cranks are also known for their durability. They can withstand harsh riding conditions, such as rocks, roots, and drops. This makes them an ideal choice for mountain biking scenarios where you need a crankset that can handle whatever the trail throws at you.
However, carbon cranks do require special care and attention. They cannot handle the same level of abuse as alloy cranks, and they can be more expensive. If you are a serious mountain biker who wants the best performance and is willing to invest in your equipment, carbon cranks are an excellent choice.
Overall, the choice between alloy and carbon cranks depends on your specific needs and riding style. Alloy cranks are ideal for racing scenarios, while carbon cranks are ideal for mountain biking scenarios. Consider your budget, riding style, and maintenance preferences when choosing between the two.
User Preferences
When it comes to choosing between alloy and carbon cranks, user preferences play a significant role. Some riders prefer the traditional look and feel of aluminum, while others prefer the futuristic and modern look of carbon. Here are a few factors that may influence your preference:
Aesthetics
Some people prefer the aesthetics of carbon components and buy them for the looks rather than functional quality. Carbon cranks can give your bike a high-end look, while aluminum cranks may look more traditional. If you’re someone who values aesthetics, carbon cranks may be the way to go.
Stiffness
Some riders claim that carbon cranks are stiffer and thus result in a more efficient transfer of power. However, this claim is not universally accepted, and some riders may not notice a significant difference in stiffness between alloy and carbon cranks. If you’re someone who values stiffness, you may want to consider carbon cranks.
Weight
Weight is another factor that may influence your preference. Carbon cranks are generally lighter than aluminum cranks, which can make a significant difference in the overall weight of your bike. However, the weight difference may not be significant enough to justify the higher cost of carbon cranks. If you’re someone who values weight, you may want to consider carbon cranks.
Durability
Durability is another factor to consider when choosing between alloy and carbon cranks. Carbon cranks can be more brittle than aluminum cranks and may be more prone to damage from impacts. However, carbon cranks are generally more resistant to corrosion than aluminum cranks. If you’re someone who values durability, you may want to consider aluminum cranks.
Ultimately, the choice between alloy and carbon cranks comes down to personal preference. Consider your priorities and choose the option that best meets your needs.
Final Thoughts
When it comes to choosing between alloy and carbon cranks, there are several factors to consider. Both materials have their pros and cons, and the right choice for you will depend on your personal preferences and riding style.
If you’re looking for a lightweight option, carbon cranks are the clear winner. On average, carbon cranks are 27% lighter than their alloy counterparts, making them a popular choice among competitive riders. However, if you’re a recreational rider, the weight difference may not be as significant.
One advantage of alloy cranks is their durability. Alloy is a strong and reliable material that can withstand heavy use and abuse. Carbon, on the other hand, can be more fragile and prone to damage from impacts or over-tightening.
Another factor to consider is cost. Carbon cranks are generally more expensive than alloy cranks, and may not be worth the investment for casual riders. However, if you’re looking for the best performance and are willing to pay a premium, carbon cranks may be the way to go.
Ultimately, the choice between alloy and carbon cranks comes down to personal preference and priorities. If you prioritize weight and performance, carbon cranks may be the better choice. If you prioritize durability and affordability, alloy cranks may be the way to go.
Leave a Comment
RSS
Follow by Email
|
__label__pos
| 0.882995 |
답변 있음
How to draw 2D graph of 4 variables
try this function: quiver(X,Y,VX,Vy); you can add this graph to the previously created graph by using hold on statement. ht...
약 2년 전 | 0
| 수락됨
답변 있음
Help With Graphing on the Same Plot
% Trohpic Cascade to calculate the changes in population in scallops and % cownose rays based on interactions with each other ...
약 2년 전 | 0
답변 있음
Help With Graphing on the Same Plot
The second figure command, creates a new figure, you can comment it out: % The second graph %figure; plot(R); xlabel('time ...
약 2년 전 | 0
답변 있음
Topographic map with gradient vector
You can look at this: https://www.mathworks.com/help/matlab/creating_plots/display-quiver-plot-over-contour-plot.html
약 2년 전 | 0
답변 있음
Using DisplayName Within a Loop
col_sim = {'-ro', '-bs', '-*k','-gx'}; % symbols for each curve of the plot (simulated data) col_exp = {'ro', 'bs', '*k',...
약 2년 전 | 0
답변 있음
finding the mean based on a specific value in other column
You can find the rows with the first condition and the other rows for the second condition. The intersection of the two rows, ar...
약 2년 전 | 0
| 수락됨
답변 있음
Why does my output turn out like this certain times I run my code?
in the first if statement, add a simi-colon ath the end: if (a>b) limit = b; end Also, you can simplify the firs...
약 2년 전 | 0
답변 있음
Function is not working
coror = relor + (relor - 180).*(relor > 90) + (relor + 180) .* (relor < -90);
약 2년 전 | 0
| 수락됨
답변 있음
frequency based on dictionary
you can use unique function along with badOfWords https://www.mathworks.com/help/textanalytics/ref/bagofwords.html
약 2년 전 | 0
답변 있음
What is the process in converting 45 mps to mph on matlab?
x = input('MPH value? '); % check 3.6? is it correct? y= x*3.6; printf ('kilometer per second %f\n',y) z=x.*2.23694; fprint...
약 2년 전 | 0
답변 있음
How can I assign a value to variable using buttons?
fig = uifigure; Bolt1 = uibutton(fig,'Text', 'Bolt 1','Position',[50,380, 100, 22],'ButtonPushedFcn', 'button_state=1;button_st...
약 2년 전 | 0
답변 있음
Loop Updating Vectors for Number of Iterations
Simply use A = [3 2 3; 5 5 6; 9 8 9]; b = [1; 2; 3]; x=b; for k=1:200 x=A\x; end
약 2년 전 | 0
답변 있음
how to correctly get values for stress for Y >82 values should be close to zero at Y = 88.25
You can use vectorized if statement: Q = Q2 .* (Y >= 82) + Q1 .* (Y < 82); stress = abs(V.*Q)/(i*t);
약 2년 전 | 0
| 수락됨
답변 있음
How do I write a script that calculates and prints all values for N according to the following expressions and limits?
N=1; % sum function uses an internal loop % find the first N that sum is >= 1.6 while sum(1./[1:N].^2) < 1.6 N = N+1; e...
약 2년 전 | 0
답변 있음
After a certain time for loop speed slow down?
You can create A without having two nested loops: E0=10; [km, jm] = meshgrid(1:1000, 1:1000); A= E0*exp(-65*((km - 500).^2 +...
약 2년 전 | 0
답변 있음
Setting up equation with variables without values
Use (1/2)*Lp % instead of 1/2Lp
약 2년 전 | 1
답변 있음
Bisection method in matlab
clc clear lc=3; lp=3; w=160; T= 700; f=@(d) (w*lc*lp/(d*sqrt(lp^2-d^2)))-T; xl=input('enter the value for Xl '); xu=input(...
약 2년 전 | 0
답변 있음
How to find the index of the variable in my For Loop when a condition is met
[~,ind] = find(diff(nr)==0) % print indices for i = ind fprintf("%d is adjacent to a number of equal value\n", i) end
약 2년 전 | 0
| 수락됨
답변 있음
How to find the index of the variable in my For Loop when a condition is met
Use [nf, ind] = find(nr == i); ind contains the index with the given condition
약 2년 전 | 0
문제를 풀었습니다
Relative ratio of "1" in binary number
Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...
약 2년 전
문제를 풀었습니다
Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...
약 2년 전
문제를 풀었습니다
Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.
약 2년 전
문제를 풀었습니다
Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...
약 2년 전
문제를 풀었습니다
Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.
약 2년 전
문제를 풀었습니다
Find the maximum number of decimal places in a set of numbers
Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...
약 2년 전
문제를 풀었습니다
Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...
약 2년 전
문제를 풀었습니다
Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...
약 2년 전
문제를 풀었습니다
Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000
약 2년 전
문제를 풀었습니다
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346
약 2년 전
문제를 풀었습니다
Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...
약 2년 전
더 보기
|
__label__pos
| 0.999283 |
How to Add a Word to the Dictionary in Python
Python is a programming language that is widely used in data science, machine learning, and artificial intelligence. It is a versatile language that allows developers to create powerful and efficient applications. One of the most useful features of Python is its ability to manipulate text. In this article, we are going to discuss how to add a word to the dictionary in Python. The dictionary is a built-in data type in Python, and it is essentially a collection of key-value pairs. It is used to store data in a way that is easy to search and retrieve.
Table of Contents
What is a Dictionary in Python?
Before we dive into how to add a word to the dictionary in Python, it is important to understand what a dictionary is. As mentioned earlier, a dictionary is a collection of key-value pairs. The key is like an index in a list, and the value is the data that is associated with that key. In Python, dictionaries are denoted by curly braces {}. Each key-value pair is separated by a colon, and each pair is separated by a comma. Here is an example of a dictionary:
my_dict = {"apple": 1, "orange": 2, "banana": 3}
In this example, "apple", "orange", and "banana" are the keys, and 1, 2, and 3 are the values. We can access the values in the dictionary by using the keys. For example, if we want to access the value associated with the key "apple", we can do so like this:
print(my_dict["apple"])
This will output the value 1 to the console.
Adding a Word to the Dictionary in Python
Now that we understand what a dictionary is in Python, let’s move on to how to add a word to the dictionary. To add a key-value pair to a dictionary, we simply assign the value to the key. Here is an example:
my_dict = {"apple": 1, "orange": 2, "banana": 3}
my_dict["pear"] = 4
print(my_dict)
In this example, we added the key-value pair "pear": 4 to the dictionary. This is done by assigning the value 4 to the key "pear". The output of this program will be:
{"apple": 1, "orange": 2, "banana": 3, "pear": 4}
As you can see, the new key-value pair has been added to the dictionary.
Updating a Value in the Dictionary
Sometimes we may need to update the value associated with a key in the dictionary. To do this, we simply assign a new value to the key. Here is an example:
my_dict = {"apple": 1, "orange": 2, "banana": 3}
my_dict["apple"] = 5
print(my_dict)
In this example, we updated the value associated with the key "apple" to 5. The output of this program will be:
{"apple": 5, "orange": 2, "banana": 3}
As you can see, the value associated with the key "apple" has been updated to 5.
Checking if a Key Exists in the Dictionary
Before we add a new key-value pair to the dictionary, we may want to check if the key already exists. We can do this using the "in" keyword. Here is an example:
my_dict = {"apple": 1, "orange": 2, "banana": 3}
if "pear" in my_dict:
print("The key 'pear' already exists.")
else:
my_dict["pear"] = 4
print(my_dict)
In this example, we check if the key "pear" already exists in the dictionary. If it does, we print a message to the console. If it does not, we add the key-value pair "pear": 4 to the dictionary and print the updated dictionary to the console.
Conclusion
In conclusion, adding a word to the dictionary in Python is a simple task. We can do this by assigning a value to a key. We can also update a value associated with a key by assigning a new value to the key. Before adding a new key-value pair to the dictionary, we can check if the key already exists using the "in" keyword. Dictionaries are a powerful data type in Python, and they are essential for many applications. By understanding how to manipulate dictionaries, we can create efficient and powerful Python programs.
Leave a Comment
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.971747 |
florida-scrub-jay.jpg
The trails offer pleasant exploration through several of the dominant plant communities. Florida scrub-jay and gopher tortoise are common in the oak scrub. Seasonal wetlands host wading birds and provide critical breeding habitat for gopher frogs, one of the many upland species found in gopher tortoise burrows. Listen for Bachman’s sparrows in the pine flatwoods and watch for the occasional deer, turkey, and fox squirrel. Open areas, such as former pastures, may host southeastern American kestrels, northern harriers (winter) and other raptors. Diverse wildflowers attract numerous butterfly species.
Wildlife Spotlight: Florida Scrub Jay
Distant cousin to the blue jay, the Florida scrub-jay is the only bird species unique to Florida and is found only in very specific scrub oak habitat. Scrub-jays are about 11 inches long and mostly blue, with pale gray on the back and belly. The plumage of males and females does not differ, but only the female incubates eggs and utters the “hic-cup” call.
Scrub jays are found only in the relict patches of oak scrub, where four low-growing oak species provide acorns, the birds’ most important winter food. From August to November, each bird buries (caches) several thousand acorns just beneath the sand and retrieves them when other foods are scarce. Scrub-jays also eat a variety of insects and other small animals.
Check out other species recorded from Moody Branch WEA, or add observations of your own, by visiting the Moody Branch WEA Nature Trackers project.
Scrub-jays form family groups of 2 to 8 birds that include some young from previous breeding seasons. Family groups defend a specific territory and each bird takes a turn as sentry, sitting atop an exposed perch to watch for predators or intruders. Nesting occurs from March through June. Scrub-jays build their nests about a yard off the ground in shrubs, mostly low-growing oak species, and construct a platform of twigs lined with palmetto or cabbage palm fibers.
Since the early 1900s, the number of Florida scrub-jays has declined by as much as 90%, primarily due to habitat loss from residential development, citrus production and the exclusion of periodic fires necessary to maintain the oak scrub plant community in the low, open conditions favored by the birds and other scrub species. As a result, the Florida scrub-jay is listed as Threatened. Biologists are trying to help scrub-jays by restoring and maintaining quality habitat using prescribed fire and other management methods. Learn more about these birds and what you can do to help.
FWC Facts:
Whooping cranes mate for life, but they will take a new mate after the loss of the original. The pair will return to use and defend the same nesting and wintering territory year after year.
Learn More at AskFWC
|
__label__pos
| 0.814775 |
Seth Woolley's Man Viewer
tcldot(n) - tcldot - graph manipulation in tcl - man n tcldot
([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title
TCLDOT(N) TCLDOT(N)
NAME
tcldot - graph manipulation in(1,8) tcl
SYNOPSIS
#!/usr/local/bin/tclsh
package require Tcldot
USAGE
Requires the dynamic loading facilities of tcl7.6 or later.
INTRODUCTION
tcldot is a tcl dynamically loaded extension that incorporates the
directed graph facilities of dot(1), and the undirected graph facili-
ties of neato(1), into tcl and provides a set(7,n,1 builtins) of commands to control
those facilities. tcldot converts dot and neato from batch processing
tools to an interpreted and, if(3,n) needed, interactive set(7,n,1 builtins) of graph manip-
ulation facilities.
COMMANDS
tcldot initially adds only three commands to tcl, namely dotnew,
dotread, and dotstring. These commands return a handle for the graph
that has just been created and that handle can then be used as a com-
mand for further actions on the graph.
All other "commands" are of the form:
handle <method> parameters
Many of the methods return further handles of graphs, nodes of edges,
which are themselves registered as commands.
The methods are described in(1,8) detail below, but in(1,8) summary:
Graph methods are:
addedge, addnode, addsubgraph, countedges, countnodes, layout,
listattributes, listedgeattributes, listnodeattributes, list-
edges, listnodes, listsubgraphs, render, rendergd, queryat-
tributes, queryedgeattributes, querynodeattributes, queryat-
tributevalues, queryedgeattributevalues, querynodeattributeval-
ues, setattributes, setedgeattributes, setnodeattributes, show-
name, write.
Node methods are:
addedge, listattributes, listedges, listinedges, listoutedges,
queryattributes, queryattributevalues, setattributes, showname.
Edge methods are:
delete, listattributes, listnodes, queryattributes, queryat-
tributevalues, setattributes, showname.
dotnew graphType ?attributeName attributeValue? ?...?
creates a new empty graph and returns its graphHandle.
graphType can be any supported by dot(1) namely: "graph,"
"digraph," "graphstrict," or "digraphstrict." (In digraphs
edges have a direction from tail to head. "Strict" graphs or
digraphs collapse multiple edges between the same pair of nodes
into a single edge.)
Following the mandatory graphType parameter the dotnew command
will accept(2,8) an arbitrary number of attribute name/value pairs
for the graph. Certain special graph attributes and permitted
values are described in(1,8) dot(1), but the programmer can arbitrar-
ily invent and assign values to additional attributes beyond
these. In dot the attribute name is separated from the value by
an "=" character. In tcldot the "=" has been replaced by a " "
(space) to be more consistent with tcl syntax. e.g.
set(7,n,1 builtins) g [dotnew digraph rankdir LR]
dotread fileHandle
reads in(1,8) a dot-language description of a graph from a previously
opened file(1,n) identified by the fileHandle. The command returns
the graphHandle of the newly read(2,n,1 builtins) graph. e.g.
set(7,n,1 builtins) f [open(2,3,n) test.dot r]
set(7,n,1 builtins) g [dotread $f]
dotstring string(3,n)
reads in(1,8) a dot-language description of a graph from a Tcl
string(3,n); The command returns the graphHandle of the newly read(2,n,1 builtins)
graph. e.g.
set(7,n,1 builtins) g [dotread $dotsyntaxstring]
graphHandle addnode ?nodeName? ?attributeName attributeValue? ?...?
creates a new node in(1,8) the graph whose handle is graphHandle and
returns its nodeHandle. The handle of a node is a string(3,n) like:
"node0" where the integer value is different for each node.
There can be an arbitrary number of attribute name/value pairs
for the node. Certain special node attributes and permitted
values are described in(1,8) dot(1), but the programmer can arbitrar-
ily invent and assign values to additional attributes beyond
these. e.g.
set(7,n,1 builtins) n [$g addnode "N" label "Top\nNode" shape triangle eggs easyover]
A possible cause of confusion in(1,8) tcldot is the distinction
between handles, names, labels, and variables. The distinction
is primarily in(1,8) who owns them. Handles are owned by tcldot and
are guaranteed to be unique within one interpreter session.
Typically handles are assigned to variables, like "n" above, for
manipulation within a tcl script. Variables are owned by the
programmer. Names are owned by the application that is using
the graph, typically names are important when reading in(1,8) a graph
from an external program or file. Labels are the text that is
displayed with the node (or edge) when the graph is displayed,
labels are meaningful to the reader of the graph. Only the han-
dles and variables are essential to tcldot's ability to manipu-
late abstract graphs. If a name is not specified then it
defaults to the string(3,n) representation of the handle, if(3,n) a label
is not specified then it defaults to the name.
graphHandle addedge tailNode headNode ?attributeName attributeValue?
?...?
creates a new edge in(1,8) the graph whose handle is graphHandle and
returns its edgeHandle. tailNode and headNode can be specified
either by their nodeHandle or by their nodeName. e.g.
set(7,n,1 builtins) n [$g addnode]
set(7,n,1 builtins) m [$g addnode]
$g addedge $n $m label "NM"
$g addnode N
$g addnode M
$g addedge N M label "NM"
The argument is recognized as a handle if(3,n) possible and so it is
best to avoid names like "node6" for nodes. If there is poten-
tial for conflict then use findnode to translate explicitly from
names to handles. e.g.
$g addnode "node6"
$g addnode "node99"
$g addedge [$g findnode "node6"] [$g findnode "node99"]
There can be an arbitrary number of attribute name/value pairs
for the edge. Certain special edge attributes and permitted
values are described in(1,8) dot(1), but the programmer can arbitrar-
ily invent and assign values to additional attributes beyond
these.
graphHandle addsubgraph ?graphName? ?attributeName attributeValue?
?...?
creates a new subgraph in(1,8) the graph and returns its graphHandle.
If the graphName is omitted then the name of the subgraph
defaults to it's graphHandle. There can be an arbitrary number
of attribute name/value pairs for the subgraph. Certain special
graph attributes and permitted values are described in(1,8) dot(1),
but the programmer can arbitrarily invent and assign values to
additional attributes beyond these. e.g.
set(7,n,1 builtins) sg [$g addsubgraph dinglefactor 6]
Clusters, as described in(1,8) dot(1), are created by giving the sub-
graph a name that begins with the string: "cluster". Cluster
can be labelled by using the label attibute. e.g.
set(7,n,1 builtins) cg [$g addsubgraph cluster_A label dongle dinglefactor 6]
nodeHandle addedge headNode ?attributeName attributeValue? ?...?
creates a new edge from the tail node identified by tha nodeHan-
dle to the headNode which can be specified either by nodeHandle
or by nodeName (with preference to recognizing the argument as a
handle). The graph in(1,8) which this is drawn is the graph in(1,8) which
both nodes are members. There can be an arbitrary number of
attribute name/value pairs for the edge. These edge attributes
and permitted values are described in(1,8) dot(1). e.g.
[$g addnode] addedge [$g addnode] label "NM"
graphHandle delete
nodeHandle delete
edgeHandle delete
Delete all data structures associated with the graph, node or
edge from the internal storage of the interpreter. Deletion of
a node also results in(1,8) the the deletion of all subtending edges
on that node. Deletion of a graph also results in(1,8) the deletion
of all nodes and subgraphs within that graph (and hence all
edges too). The return from these delete commands is a null
string.
graphHandle countnodes
graphHandle countedges
Returns the number of nodes, or edges, in(1,8) the graph.
graphHandle listedges
graphHandle listnodes
graphHandle listsubgraphs
nodeHandle listedges
nodeHandle listinedges
nodeHandle listoutedges
edgeHandle listnodes
Each return a list of handles of graphs, nodes or edges, as
appropriate.
graphHandle findnode nodeName
graphHandle findedge tailnodeName headNodeName
nodeHandle findedge nodeName
Each return the handle of the item if(3,n) found, or an error(8,n) if(3,n) none
are found. For non-strict graphs when there are multiple edges
between two nodes findedge will return an arbitrary edge from
the set.
graphHandle showname
nodeHandle showname
edgeHandle showname
Each return the name of the item. Edge names are of the form:
"a->b" where "a" and "b" are the names of the nodes and the con-
nector "->" indicates the tail-to-head direction of the edge. In
undirected graphs the connector "--" is used.
graphHandle setnodeattributes attributeName attributeValue ?...?
graphHandle setedgeattributes attributeName attributeValue ?...?
Set one or more default attribute name/values that are to apply
to all nodes (edges) unless overridden by subgraphs or per-node
(per-edge) attributes.
graphHandle listnodeattributes
graphHandle listedgeattributes
Return a list of attribute names.
graphHandle querynodeattributes attributeName ?...?
graphHandle queryedgeattributes attributeName ?...?
Return a list of default attribute value, one value for each of
the attribute names provided with the command.
graphHandle querynodeattributes attributeName ?...?
graphHandle queryedgeattributes attributeName ?...?
Return a list of pairs of attrinute name and default attribute
value, one pair for each of the attribute names provided with
the command.
graphHandle setattributes attributeName attributeValue ?...?
nodeHandle setattributes attributeName attributeValue ?...?
edgeHandle setattributes attributeName attributeValue ?...?
Set one or more attribute name/value pairs for a specific graph,
node, or edge instance.
graphHandle listattributes
nodeHandle listattributes
edgeHandle listattributes
Return a list of attribute names (attribute values are provided
by queryattribute
graphHandle queryattributes attributeName ?...?
nodeHandle queryattributes attributeName ?...?
edgeHandle queryattributes attributeName ?...?
Return a list of attribute value, one value for each of the
attribute names provided with the command.
graphHandle queryattributevalues attributeName ?...?
nodeHandle queryattributevalues attributeName ?...?
edgeHandle queryattributevalues attributeName ?...?
Return a list of pairs or attribute name and attribute value,
one value for each of the attribute names provided with the com-
mand.
graphHandle layout ?DOT|NEATO?
Annotate the graph with layout information. This commands takes
an abstract graph add shape and position information to it
according to dot's or neato's rules of eye-pleasing graph lay-
out. If the layout engine is unspecified then it defaults to DOT
for directed graphs, and NEATO otherwise. The result of the
layout is stored as additional attributes name/value pairs in(1,8)
the graph, node and edges. These attributes are intended to be
interpreted by subsequent write(1,2) or render commands.
graphHandle write(1,2) fileHandle format ?DOT|NEATO?
Write a graph to the open(2,3,n) file(1,n) represented by fileHandle in(1,8) a
specific format. Possible formats are: "ps" "mif" "hpgl"
"plain" "dot" "gif" "ismap" If the layout hasn't been already
done, then it will be done as part of this operation using the
same rules for selecting the layout engine as for the layout
command.
graphHandle rendergd gdHandle
Generates a rendering of a graph to a new or existing gifImage
structure (see gdTcl(1) ). Returns the gdHandle of the image.
If the layout hasn't been already done, then it will be done as
part of this operation using the same rules for selecting the
layout engine as for the layout command.
graphHandle render ?canvas ?DOT|NEATO??
If no canvas argument is provided then render returns a string(3,n)
of commands which, when evaluated, will render the graph to a Tk
canvas whose canvasHandle is available in(1,8) variable $c
If a canvas argument is provided then render produces a set(7,n,1 builtins) of
commands for canvas instead of $c.
If the layout hasn't been already done, then it will be done as
part of this operation using the same rules for selecting the
layout engine as for the layout command.
#!/usr/local/bin/wish
package require Tcldot
set(7,n,1 builtins) c [canvas .c]
pack(3,n,n pack-old) $c
set(7,n,1 builtins) g [dotnew digraph rankdir LR]
$g setnodeattribute style filled color white
[$g addnode Hello] addedge [$g addnode World!]
$g layout
if(3,n) {[info(1,5,n) exists debug]} {
puts(3,n) [$g render] ;# see what render produces
}
eval [$g render]
Render generates a series of canvas commands for each graph ele-
ment, for example a node typically consist of two items on the
canvas, one for the shape and the other for the label. The can-
vas items are automatically tagged (See canvas(n) ) by the com-
mands generated by render. The tags take one of two forms: text
items are tagged with 0<handle> and shapes and lines are ren-
dered with 1<handle>.
The tagging can be used to recognize when a user wants to inter-
act with a graph element using the mouse. See the script in(1,8)
examples/disp of the tcldot distribution for a demonstration of
this facility.
BUGS
Still batch-oriented. It would be nice(1,2) if(3,n) the layout was maintained
incrementally. (The intent is to address this limitation in(1,8)
graphviz_2_0.)
AUTHOR
John Ellson ([email protected])
ACKNOWLEDGEMENTS
John Ousterhout, of course, for tcl and tk. Steven North and Elefthe-
rios Koutsofios for dot. Karl Lehenbauer and Mark Diekhans of NeoSoft
for the handles.c code which was derived from tclXhandles.c. Tom
Boutell of the Quest Center at Cold Spring Harbor Labs for the gif
drawing routines. Spencer Thomas of the University of Michigan for
gdTcl.c. Dayatra Shands for coding much of the initial implementation
of tcldot.
KEYWORDS
graph, tcl, tk, dot, neato.
02 December 1996 TCLDOT(N)
References for this manual (incoming links)
|
__label__pos
| 0.912984 |
70-697題庫 70-483學習指南 70-697 Exam Prep
NO.1 You are developing a C# application. The application includes the following code segment, (Line
numbers are included for reference only.)
The application fails at line 17 with the following error message: "An item with the same key
has already been added."
You need to resolve the error.
Which code segment should you insert at line 16?
A. Option A
B. Option D
C. Option B
D. Option C
Answer: A
NO.2 You are testing an application. The application includes methods named CalculateInterest and
LogLine.
The CalculateInterest() method calculates loan interest. The LogLine()
method sends diagnostic messages to a console window.
The following code implements the methods. (Line numbers are included for reference only.)
You have the following requirements:
- The Calculatelnterest() method must run for all build configurations.
- The LogLine() method must run only for debug builds.
You need to ensure that the methods run correctly.
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution.
Choose two.)
A. Insert the following code segment at line 05:
#if DEBUG
Insert the following code segment at line 07:
#endif
B. Insert the following code segment at line 01:
[Conditional(MDEBUG")]
C. Insert the following code segment at line 05:
#region DEBUG
Insert the following code segment at line 07:
#endregion
D. Insert the following code segment at line 01:
#if DE30G
Insert the following code segment at line 10:
#endif
E. Insert the following code segment at line 10:
[Conditional(MDEBUG")]
F. Insert the following code segment at line 01:
#region DEBUG
Insert the following code segment at line 10:
#endregion
G. Insert the following code segment at line 10: [Conditional("RELEASE")]
Answer: A,E
70-483學習指南 70-483考試指南
Explanation:
#if DEBUG: The code in here won't even reach the IL on release.
[Conditional("DEBUG")]: This code will reach the IL, however the calls to the method will not execute
unless DEBUG is on.
http://stackoverflow.com/questions/3788605/if-debug-vs-conditionaldebug
NO.3 You plan to store passwords in a Windows Azure SQL Database database.
You need to ensure that the passwords are stored in the database by using a hash algorithm,
Which cryptographic algorithm should you use?
A. RSA-768
B. AES-256
C. ECDSA
D. SHA-256
Answer: D
70-483證照考試
NO.4 You are developing an application by using C#. The application includes the following code
segment. (Line numbers are included for reference only.)
The DoWork() method must throw an InvalidCastException exception if the obj object is not of type
IDataContainer when accessing the Data property.
You need to meet the requirements. Which code segment should you insert at line 07?
A. var dataContainer = obj as IDataContainer;
B. var dataContainer = (IDataContainer) obj;
C. var dataContainer = obj is IDataContainer;
D. dynamic dataContainer = obj;
Answer: B
70-483 免費DEMO下載: http://www.testpdf.net/70-483.html
你正在為了怎樣通過Microsoft的70-483學習指南考試絞盡腦汁嗎?Microsoft的70-483學習指南考試的認證資格是當代眾多IT認證考試中最有價值的資格之一。在近幾十年裏,IT已獲得了世界各地人們的關注,它已經成為了現代生活中不可或缺的一部分。其中,Microsoft的認證資格已經獲得了國際社會的廣泛認可。所以很多IT人士通過Microsoft的考試認證來提高自己的知識和技能。70-483學習指南就是最重要的考試之一。這個認證資格能為大家帶來很大的好處。
你可以選擇我們的TestPDF.NET為你提供的培訓資料。如果你選擇了TestPDF.NET,通過Microsoft 70-697題庫不再是一個夢想。
70-697考古題代碼: 70-697
題庫名稱: Configuring Windows Devices
一年免費更新,沒有通過全額返還!
70-697題庫 問答數: 52
最近更新: 05-30,2016
70-697 認證考試: >>70-697題庫
70-483考古題代碼: 70-483
題庫名稱: Programming in C#
一年免費更新,沒有通過全額返還!
70-483學習指南 問答數: 236
最近更新: 05-30,2016
70-483 考試指南: >>70-483學習指南
While preparing for Microsoft 70-697 Material exam ", dumps and practice exam in PDF 70-697 Material created by Lotus experts, Free Latest Exam Questions for Citrix 70-697 Material Test, Cisco TelePresence IX5000 Immersive Solutions consist of top quality material 70-697 Material, Because Dumps Study Guide 70-697 Material exam dumps contain all, Guaranteed Adobe Photoshop 70-697 Material Certified, Multi Platform 70-697 Material PDF.
TestPDF.NET的70-483學習指南是一個保證你一次及格的資料。這個考古題的命中率非常高,所以你只需要用這一個資料就可以通過考試。如果不相信就先試用一下。因為如果考試不合格的話TestPDF.NET會全額退款,所以你不會有任何損失。用過以後你就知道70-483學習指南的品質了,因此趕緊試一下吧。問題有提供demo,點擊TestPDF.NET的網站去下載吧。
目前很熱門的Microsoft 70-483學習指南 認證證書就是其中之一。雖然通過Microsoft 70-483學習指南 認證考試不是很容易,但是還是有很多通過Microsoft 70-483學習指南 認證考試的辦法。你可以選擇花大量的時間和精力來鞏固考試相關知識,也可以選擇一些有效的培訓課程。TestPDF.NET提供的針對性模擬測試就很有效,能節約你的寶貴的時間和精力就能達到你想要目標,TestPDF.NET會是你很好的選擇。
|
__label__pos
| 0.870939 |
Centralizing Users For Multiple Laravel Apps Using SSO And Laravel Passport
Mark Caggiano
4 min readMar 22, 2023
Centralizing users for multiple Laravel apps can be achieved using a Single Sign-On (SSO) approach. This approach allows users to authenticate once and gain access to multiple applications without having to log in again. Here are the steps to centralize users for multiple Laravel apps using SSO:
Step 1: Create a new Laravel app for the Authentication Server
Create a new Laravel app that will serve as the authentication server. This app will handle the user authentication and authorization logic. You can create a new Laravel app by running the following command:
composer create-project --prefer-dist laravel/laravel auth-server
Step 2: Install and configure the Laravel Passport package
Laravel Passport is a package that allows you to create a full OAuth2 server implementation. This package will be used to handle authentication and authorization for the various applications. Install Laravel Passport using the following command:
composer require laravel/passport
After installing the package, you need to run the migration to create the necessary database tables:
--
--
|
__label__pos
| 0.883404 |
home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam
Book HomePHP CookbookSearch this book
4.26. Finding All Permutations of an Array
4.26.2. Solution
Use one of the two permutation algorithms discussed next.
4.26.3. Discussion
The pc_permute() function shown in Example 4-6 is a PHP modification of a basic recursive function.
Example 4-6. pc_permute( )
function pc_permute($items, $perms = array( )) {
if (empty($items)) {
print join(' ', $perms) . "\n";
} else {
for ($i = count($items) - 1; $i >= 0; --$i) {
$newitems = $items;
$newperms = $perms;
list($foo) = array_splice($newitems, $i, 1);
array_unshift($newperms, $foo);
pc_permute($newitems, $newperms);
}
}
}
For example:
pc_permute(split(' ', 'she sells seashells'));
she sells seashells
she seashells sells
sells she seashells
sells seashells she
seashells she sells
seashells sells she
However, while this recursion is elegant, it's inefficient, because it's making copies all over the place. Also, it's not easy to modify the function to return the values instead of printing them out without resorting to a global variable.
The pc_next_permutation( ) function shown in Example 4-7, however, is a little slicker. It combines an idea of Mark-Jason Dominus from Perl Cookbook by Tom Christianson and Nathan Torkington (O'Reilly) with an algorithm from Edsger Dijkstra's classic text A Discipline of Programming (Prentice-Hall).
Example 4-7. pc_next_permutation( )
function pc_next_permutation($p, $size) {
// slide down the array looking for where we're smaller than the next guy
for ($i = $size - 1; $p[$i] >= $p[$i+1]; --$i) { }
// if this doesn't occur, we've finished our permutations
// the array is reversed: (1, 2, 3, 4) => (4, 3, 2, 1)
if ($i == -1) { return false; }
// slide down the array looking for a bigger number than what we found before
for ($j = $size; $p[$j] <= $p[$i]; --$j) { }
// swap them
$tmp = $p[$i]; $p[$i] = $p[$j]; $p[$j] = $tmp;
// now reverse the elements in between by swapping the ends
for (++$i, $j = $size; $i < $j; ++$i, --$j) {
$tmp = $p[$i]; $p[$i] = $p[$j]; $p[$j] = $tmp;
}
return $p;
}
$set = split(' ', 'she sells seashells'); // like array('she', 'sells', 'seashells')
$size = count($set) - 1;
$perm = range(0, $size);
$j = 0;
do {
foreach ($perm as $i) { $perms[$j][] = $set[$i]; }
} while ($perm = pc_next_permutation($perm, $size) and ++$j);
foreach ($perms as $p) {
print join(' ', $p) . "\n";
}
Dominus's idea is that instead of manipulating the array itself, you can create permutations of integers. You then map the repositioned integers back onto the elements of the array to calculate the true permutation — a nifty idea.
However, this technique still has some shortcomings. Most importantly, to us as PHP programmers, it frequently pops, pushes, and splices arrays, something that's very Perl-centric. Next, when calculating the permutation of integers, it goes through a series of steps to come up with each permutation; because it doesn't remember previous permutations, it therefore begins each time from the original permutation. Why redo work if you can help it?
Dijkstra's algorithm solves this by taking a permutation of a series of integers and returning the next largest permutation. The code is optimized based upon that assumption. By starting with the smallest pattern (which is just the integers in ascending order) and working your way upwards, you can scroll through all permutations one at a time, by plugging the previous permutation back into the function to get the next one. There are hardly any swaps, even in the final swap loop in which you flip the tail.
There's a side benefit. Dominus's recipe needs the total number of permutations for a given pattern. Since this is the factorial of the number of elements in the set, that's a potentially expensive calculation, even with memoization. Instead of computing that number, it's faster to return false from pc_next_permutation( ) when you notice that $i == -1. When that occurs, you're forced outside the array, and you've exhausted the permutations for the phrase.
Two final notes of implementation. Since the size of the set is invariant, you capture it once using count( ) and pass it into pc_next_permutation( ); this is faster than repeatedly calling count( ) inside the function. Also, since the set is guaranteed by its construction to have unique elements, i.e., there is one and only one instance of each integer, we don't need to need to check for equality inside the first two for loops. However, you should include them in case you want to use this recipe on other numeric sets, in which duplicates might occur.
4.26.4. See Also
Recipe 4.25 for a function that finds the power set of an array; Recipe 4.19 in the Perl Cookbook (O'Reilly); Chapter 3, A Discipline of Programming (Prentice-Hall).
Library Navigation Links
Copyright © 2003 O'Reilly & Associates. All rights reserved.
|
__label__pos
| 0.935365 |
lymphostromal interactions in the thymic aging
Project Details
Description
DESCRIPTION (provided by applicant): Aging causes thymic involution which decreases thymic lymphopoiesis and exhausts the naive T-cell pool, constricting diversity of T-cell receptor repertoire and inducing immunosenescence. However, the mechanisms related to cellular compartments underlying thymic involution are unclear. The two main cellular compartments in the thymus are lymphohematopoietic progenitor cells (LPCs) and thymic epithelial cells (TECs). Currently, it is controversial if LPCs develop a cumulative intrinsic defect with age to trigger thymic involution, or whether aging results in dysfunction of TECs, causing secondary changes in thymocytes and thymic involution. Based on our preliminary studies, we hypothesize that the primary/dominant defect in aging is dysfunction of TECs, which in turn causes age-related thymopoietic insufficiency, in part through inadequate Notch gene signals that affect early stages of T-cell development. We will test these hypotheses through the following specific aims: 1). Compare the capacity of LPCs from middle-aged/aged and young animals to competitively develop in thymic stromal niches of young animals. We will measure competitive repopulation of unirradiated young IL-7R-/- recipient thymi by LPCs from old and young mice, to determine if the former have any intrinsic and irreversible defects. We will use a second competitive model, transplanting a fetal TEC network from RAG-/- mice to the kidney capsule of young RAG-/- mice, followed by intravenous administration of LPCs from old and young mice. 2). To determine whether the thymic microenvironment in aging provides inadequate Notch signals, resulting in reduced thymic lymphopoiesis. We will analyze expression of Notch ligands in TECs, and Notch receptors and Notch target genes in early stage thymocytes from aged mice. Then, we will provide enhanced Notch signaling to aged thymus in vivo by infusing Notch ligand-expressing thymic epithelial cell lines. We will then determine whether the enhanced Notch signaling can improve early stages of T-cell development in the aged thymus. The proposed studies will improve our understanding of the mechanism(s) of aging-related decreased T-lymphopoiesis and lay the groundwork for development of practical strategies to combat thymopoietic failure due to aging. PUBLIC HEALTH RELEVANCE: This proposal will identify the cellular compartment which has the dominant/primary defect that causes aging-related thymic involution, and determine whether inadequate Notch signals contribute to this defect by impairing early T-cell development and T-lymphopoiesis in the elderly.
StatusFinished
Effective start/end date1/04/1130/11/11
|
__label__pos
| 0.724255 |
Trending
What is the coefficient in a linear equation?
What is the coefficient in a linear equation? If a, b, and r are real numbers (and if a and b are...
What is the coefficient in a linear equation?
If a, b, and r are real numbers (and if a and b are not both equal to 0) then ax+by = r is called a linear equation in two variables. (The “two variables” are the x and the y.) The numbers a and b are called the coefficients of the equation ax+by = r. The number r is called the constant of the equation ax + by = r.
Herein, what are the coefficients in an equation?
coefficient. Mathematics: Number or other known factor (usually a constant) by which another number or factor (usually a variable) is multiplied. For example, in the equation ax2 + bx + c = 0, ‘a’ is the coefficient of x2, and ‘b’ is the coefficient of x.
Also, what are coefficients? In math and science, a coefficient is a constant term related to the properties of a product. In the equation that measures friction, for example, the number that always stays the same is the coefficient. In algebra, the coefficient is the number that you multiply a variable by, like the 4 in 4x=y.
Likewise, what is linear equation with example?
The definition of a linear equation is an algebraic equation in which each term has an exponent of one and the graphing of the equation results in a straight line. An example of linear equation is y=mx + b.
What is an example of coefficient?
A number used to multiply a variable. Example: 6z means 6 times z, and “z” is a variable, so 6 is a coefficient. Sometimes a letter stands in for the number. Example: In ax2 + bx + c, “x” is a variable, and “a” and “b” are coefficients.
25 Related Question Answers Found
What is Y in algebra?
It’s just a variable that is commonly used I equations. This means that Y can mean any number, or anything else you might ever want to solve, like the amount of kittens in a house. In that case, the amount of kittens would be y. Y is also commonly used in Slope Intercept form. Y = mx+b.
What is a formula in algebra?
A formula is a mathematical rule or relationship that uses letters to represent amounts which can be changed – these are called variables. For example, the formula to work out the area of a triangle. The plural of formula is formulae or formulas.
What is coefficient form?
A polynomial is an expression that can be written in the form. anxn+⋯+a2x2+a1x+a0. Each real number aiis called a coefficient. The number a0? that is not multiplied by a variable is called a constant.
What does 5x mean in math?
anyway, 5x means 5 times x.
Why do we use coefficients?
In other words, the coefficients in the equation tells us the molar ratio of each substance in the reaction to every other substance. This ratio is important when calculating the quantities of reactant(s) which will produce a certain quantity of product(s).
What is the coefficient of the 3rd term?
Algebra Help A coefficient is a number in front of a variable. For example, in the expression x 2-10x+25, the coefficient of the x 2 is 1 and the coefficient of the x is -10. The third term, 25, is called a constant.
What is called linear equation?
A linear equation looks like any other equation. It is made up of two expressions set equal to each other. When you find pairs of values that make the linear equation true and plot those pairs on a coordinate grid, all of the points for any one equation lie on the same line. Linear equations graph as straight lines.
What is non linear equation?
NonLinear Equations It forms a straight line or represents the equation for the straight line. It does not form a straight line, but form a curve. It has only one degree. Or we can also define it as an equation having the maximum order of 1. A nonlinear equation has the degree as 2 or more than 2, but not less than 2.
What is linear equation in algebra?
A linear equation is any equation that can be written in the form. ax+b=0. where a and b are real numbers and x is a variable. This form is sometimes called the standard form of a linear equation. Note that most linear equations will not start off in this form.
How do you identify a linear equation?
There are actually multiple ways to check if an equation or graph is a linear function or not . First make sure that graph fits the equation y = mx + b . y = the point for y ; x = the point for x ; m = slope ; b = y intercept . By using this equation you’ll be able to tell if it is a linear line or not .
What are the types of linear equation?
There are three major forms of linear equations: point-slope form, standard form, and slope-intercept form.
What is linear relationship?
A linear relationship (or linear association) is a statistical term used to describe a straight-line relationship between a variable and a constant.
What is an example of an equation?
An equation is a mathematical sentence that has two equal sides separated by an equal sign. 4 + 6 = 10 is an example of an equation. For example, 12 is the coefficient in the equation 12n = 24. A variable is a letter that represents an unknown number.
What is linear function in math?
Linear functions are those whose graph is a straight line. A linear function has the following form. y = f(x) = a + bx. A linear function has one independent variable and one dependent variable. The independent variable is x and the dependent variable is y.
How do I create a linear equation?
Use a line already drawn on a graph and its demonstrated points before creating a linear equation. Follow this formula in making slope-intercept linear equations: y = mx + b. Determine the value of m, which is the slope (rise over run). Find the slope by finding any two points on a line.
What is the coefficient of 5?
The coefficients are the numbers that multiply the variables or letters. Thus in 5x + y – 7, 5 is a coefficient. It is the coefficient in the term 5x. Also the term y can be thought of as 1y so 1 is also a coefficient.
What is another word for coefficient?
Words nearby coefficient coed, coedit, coeditor, coeducation, coeducational, coefficient, coefficient of correlation, coefficient of elasticity, coefficient of expansion, coefficient of friction, coefficient of performance.
Leave a Reply
Your email address will not be published. Required fields are marked *
|
__label__pos
| 0.999999 |
CodeGym /Java Blog /Java Classes /Java Inner Classes
Author
Alex Vypirailenko
Java Developer at Toshiba Global Commerce Solutions
Java Inner Classes
Published in the Java Classes group
In Java some classes can contain other classes within them. Such classes are called nested classes. Classes defined within other classes generally fall into two categories — static and non-static. Nested non-static classes are called inner. Nested classes that are declared static are called static nested classes. In fact, there is nothing complicated here, although the terminology looks somewhat fuzzy and can sometimes confuse even a professional software developer.
Nested and inner classes
So all classes located inside other classes are called Nested classes.
class OuterClass {
...
class NestedClass {
...
}
}
Nested Classes that are not static are called Inner Classes, and those that are static are called static Nested Classes. Java Inner Classes - 1
class OuterClass {
...
static class StaticNestedClass {
...
}
class InnerClass {
...
}
}
Thus, all Inner Classes are Nested, but not all Nested are Inner. These are the main definitions. Inner classes are a kind of security mechanism in Java. We know that an ordinary class cannot be associated with a private access modifier. However, if our class is a member of another class, then the inner class can be made private. This feature is also used to access private class members.
Inner Class Example
So, let's try to create some class, and inside it — another class. Imagine some kind of modular game console. There is a “box” itself, and certain modules can be connected to it. For example, a game controller, a steering wheel, a VR helmet, which, as a rule, do not work without the console itself. Here we have the GameConsole class. It has 2 fields and 1 method — start(). The difference between GameCosole and the class we are used to is that it has an internal GameController class.
public class GameConsole {
private String model;
private int weight;
public void run() {
System.out.println("Game console is on");
}
public class GameController {
private String color;
public void start() {
System.out.println("start button is pressed");
}
public void x() {
System.out.println("x button is pressed");
}
public void y() {
System.out.println("y button is pressed");
}
public void a() {
System.out.println("a button is pressed");
}
public void b() {
System.out.println("b button is pressed");
}
public void mover() {
System.out.println("mover button is pressed");
}
}
}
At this point, you might be wondering: why not make these classes "separate"? It is not necessary to make them nested. Indeed it is possible. Rather, it is about the correct design of classes in terms of their use. Inner classes are created to highlight in the program an entity that is inextricably linked with another entity. A controller or, for example, a VR helmet are components of the console. Yes, they can be bought separately from the console, but cannot be used without it. If we made all these classes separate public classes, our program could have, for example, the following code:
public class Main {
public static void main(String[] args) {
GameController controller = new GameController();
controller.x();
}
}
What happens in this case isn’t clear, since the controller itself does not work without a console. We have created a game console object. We created its sub-object — the game controller. And now we can play, just press the right keys. The methods we need are called on the right objects. Everything is simple and convenient. In this example, extracting the game controller enhances the encapsulation (we hide the details of the console parts inside the corresponding class), and allows for a more detailed abstraction. But if we, for example, create a program that simulates a store where you can separately buy a VR helmet or controller, this example will fail. There it is better to create a game controller separately. Let's take another example. We mentioned above that we can make the inner class private and still call it from the outer class. Below is an example of such classes.
class OuterClass {
// inner class
private class InnerClass {
public void print() {
System.out.println("We are in the inner class...");
}
}
// method of outer class. We are create an inner class from the method of outer one
void display() {
InnerClass inner = new InnerClass();
inner.print();
}
}
Here the OuterClass is the outer class, InnerClass is the inner class, display() is the method inside which we are creating an object of the inner class. Now let’s write a demo class with a main method where we are going to invoke the display() method.
public class OuterDemoMain {
public static void main(String args[]) {
// create an object of the outer class
OuterDemo outer = new OuterDemo();
outer.display();
}
}
If you run this program, you will get the following result:
We are in the inner class...
Inner classes classification
The inner classes themselves or nested non-static classes fall into three groups.
• Inner class as is. Just one non-static class inside the other one as we demonstrated above with GameConsole and GameController example.
• Method-local Inner class is a class inside a method.
• Anonymous Inner class.
Java Inner Classes - 2
Method local Inner class
In Java you can write a class inside a method and it’s a local type. Like local variables, the scope of an inner class is limited within a method. A method-local inner class can only be created within the method where the inner class is defined. Let's demonstrate how to use the local method inner class.
public class OuterDemo2 {
//instance method of the outer class OuterDemo2
void myMethod() {
String str = "and it's a value from OuterDemo2 class' myMethod ";
// method-local inner class
class methodInnerDemo {
public void print() {
System.out.println("Here we've got a method inner class... " );
System.out.println(str);
}
}
// Access to the inner class
methodInnerDemo inn = new methodInnerDemo();
inn.print();
}
}
Now we are going to write a demo class with a main method where we are going to invoke the outer() method.
public class OuterDemoMain {
public static void main(String args[]) {
OuterDemo2 outer = new OuterDemo2();
outer.myMethod();
}
}
The output is:
Here we've got a method inner class... and it's a value from OuterDemo2 class' myMethod
Java Inner Classes - 3
Anonymous inner class
An inner class declared without a class name is called an anonymous inner class. When we declare an anonymous inner class, we immediately instantiate it. Typically, such classes are used whenever you need to override a class or interface method.
abstract class OuterDemo3 {
public abstract void method();
}
class outerClass {
public static void main(String args[]) {
OuterDemo3 inner = new OuterDemo3() {
public void method() {
System.out.println("Here we've got an example of an anonymous inner class");
}
};
inner.method();
}
}
The output is here:
Here we've got an example of an anonymous inner class...
Anonymous Inner Class as Argument
You can also pass an anonymous inner class as an argument to the method. Here is an example.
interface OuterDemo4 {
String hello();
}
class NewClass {
// accepts the object of interface
public void displayMessage(OuterDemo4 myMessage) {
System.out.println(myMessage.hello());
System.out.println("example of anonymous inner class as an argument");
}
public static void main(String args[]) {
NewClass newClass = new NewClass();
//here we pass an anonymous inner class as an argument
newClass.displayMessage(new OuterDemo4() {
public String hello() {
return "Hello!";
}
});
}
}
The output is here:
Hello! example of anonymous inner class as an argument
To reinforce what you learned, we suggest you watch a video lesson from our Java Course
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
|
__label__pos
| 0.950984 |
Torr to Pounds Per Square Inch Conversion
Enter the pressure in torr below to get the value converted to pounds per square inch.
SWAP UNITS
Results in Pounds Per Square Inch:
Loading content.
1 Torr = 0.019337 psi
How to Convert Torr to Pounds Per Square Inch
Calculators can be used to convert measurements from one unit to another
To convert a torr measurement to a pound per square inch measurement, multiply the pressure by the conversion ratio. One torr is equal to 0.019337 pounds per square inch, so use this simple formula to convert:
pounds per square inch = torr × 0.019337
The pressure in pounds per square inch is equal to the torr multiplied by 0.019337.
For example, here's how to convert 5 torr to pounds per square inch using the formula above.
5 Torr = (5 × 0.019337) = 0.096684 psi
Torr and pounds per square inch are both units used to measure pressure. Keep reading to learn more about each unit of measure.
Torr
The torr is a measure of pressure equal to 1/760 of an atmosphere. Torr is based on an absolute scale of pressure, which is equivalent to the atmospheric pressure plus the gauge pressure.
The torr is a non-SI metric unit for pressure. Torr can be abbreviated as Torr; for example, 1 torr can be written as 1 Torr.
Pounds Per Square Inch
One pound per square inch is the pressure of equal to one pound-force per square inch.
The pound per square inch is a US customary and imperial unit of pressure. A pound per square inch is sometimes also referred to as a pound-force per square inch. Pounds per square inch can be abbreviated as psi; for example, 1 pound per square inch can be written as 1 psi.
PSI can be expressed using the formula:
1 psi = 1 lbfin2
Pressure in pounds per square inch are equal to the pound-force divided by the area in square inches.
Torr to Pound Per Square Inch Conversion Table
Torr measurements converted to pounds per square inch
Torr Pounds Per Square Inch
1 Torr 0.019337 psi
2 Torr 0.038674 psi
3 Torr 0.05801 psi
4 Torr 0.077347 psi
5 Torr 0.096684 psi
6 Torr 0.116021 psi
7 Torr 0.135358 psi
8 Torr 0.154694 psi
9 Torr 0.174031 psi
10 Torr 0.193368 psi
11 Torr 0.212705 psi
12 Torr 0.232042 psi
13 Torr 0.251378 psi
14 Torr 0.270715 psi
15 Torr 0.290052 psi
16 Torr 0.309389 psi
17 Torr 0.328726 psi
18 Torr 0.348062 psi
19 Torr 0.367399 psi
20 Torr 0.386736 psi
21 Torr 0.406073 psi
22 Torr 0.425409 psi
23 Torr 0.444746 psi
24 Torr 0.464083 psi
25 Torr 0.48342 psi
26 Torr 0.502757 psi
27 Torr 0.522093 psi
28 Torr 0.54143 psi
29 Torr 0.560767 psi
30 Torr 0.580104 psi
31 Torr 0.599441 psi
32 Torr 0.618777 psi
33 Torr 0.638114 psi
34 Torr 0.657451 psi
35 Torr 0.676788 psi
36 Torr 0.696125 psi
37 Torr 0.715461 psi
38 Torr 0.734798 psi
39 Torr 0.754135 psi
40 Torr 0.773472 psi
|
__label__pos
| 0.999716 |
Methotrexate inhibits osteoclastogenesis by decreasing RANKL-induced calcium influx into osteoclast progenitors
Hiroya Kanagawa, Ritsuko Masuyama, Mayu Morita, Yuiko Sato, Yasuo Niki, Tami Kobayashi, Eri Katsuyama, Atsuhiro Fujie, Wu Hao, Toshimi Tando, Ryuichi Watanabe, Kana Miyamoto, Hideo Morioka, Morio Matsumoto, Yoshiaki Toyama, Hideyuki Saya, Takeshi Miyamoto
Research output: Contribution to journalArticlepeer-review
16 Citations (Scopus)
Abstract
The increasing number of osteoporosis patients is a pressing issue worldwide. Osteoporosis frequently causes fragility fractures, limiting activities of daily life and increasing mortality. Many osteoporosis patients take numerous medicines due to other health issues; thus, it would be preferable if a single medicine could ameliorate osteoporosis and other conditions. Here, we screened 96 randomly selected drugs targeting various diseases for their ability to inhibit differentiation of osteoclasts, which play a pivotal role in development of osteoporosis, and identified methotrexate (MTX), as a potential inhibitor. MTX is currently used to treat sarcomas or leukemic malignancies or auto-inflammatory diseases such as rheumatoid arthritis (RA) through its anti-proliferative and immunosuppressive activities; however, a direct effect on osteoclast differentiation has not been shown. Here, we report that osteoclast formation and expression of osteoclastic genes such as NFATc1 and DC-STAMP, which are induced by the cytokine RANKL, are significantly inhibited by MTX. We found that RANKL-dependent calcium (Ca) influx into osteoclast progenitors was significantly inhibited by MTX. RA patients often develop osteoporosis, and osteoclasts are reportedly required for joint destruction; thus, MTX treatment could have a beneficial effect on RA patients exhibiting high osteoclast activity by preventing both osteoporosis and joint destruction.
Original languageEnglish
Pages (from-to)526-531
Number of pages6
JournalJournal of Bone and Mineral Metabolism
Volume34
Issue number5
DOIs
Publication statusPublished - 01-09-2016
Externally publishedYes
All Science Journal Classification (ASJC) codes
• Endocrinology, Diabetes and Metabolism
• Orthopedics and Sports Medicine
• Endocrinology
Fingerprint Dive into the research topics of 'Methotrexate inhibits osteoclastogenesis by decreasing RANKL-induced calcium influx into osteoclast progenitors'. Together they form a unique fingerprint.
Cite this
|
__label__pos
| 0.823726 |
前言
20 号参加 pycon, 发现有个招聘公司 知道创宇 , 正好换工作,就去公司网站转了下,发现挺有意思:投简历需要一个网站爬虫程序,基本要求如下 (可以直接点开上面网页去看):
使用python编写一个网站爬虫程序,支持参数如下:
spider.py -u url -d deep -f logfile -l loglevel(1-5) --testself -thread number --dbfile filepath --key=”HTML5”
参数说明:
-u 指定爬虫开始地址
-d 指定爬虫深度
--thread 指定线程池大小,多线程爬取页面,可选参数,默认10
--dbfile 存放结果数据到指定的数据库(sqlite)文件中
--key 页面内的关键词,获取满足该关键词的网页,可选参数,默认为所有页面
-l 日志记录文件记录详细程度,数字越大记录越详细,可选参数,默认spider.log
--testself 程序自测,可选参数
功能描述:
1、指定网站爬取指定深度的页面,将包含指定关键词的页面内容存放到sqlite3数据库文件中
2、程序每隔10秒在屏幕上打印进度信息
3、支持线程池机制,并发爬取网页
4、代码需要详尽的注释,自己需要深刻理解该程序所涉及到的各类知识点
5、需要自己实现线程池
搞了 2 天,根据研究,弄了一个版本 (友情提示,仅供学习参考,要是面试这个职位,建议大家用其它方法实现,因为我投递过了,不要拿来主义额 ^.^)
代码如下 (隐藏了个人信息用 'XXX' 代替)
#!/usr/bin/env python
#coding=utf-8
import urllib2
import Queue
import sys
import traceback
import threading
import re
import datetime
import lxml
import chardet
import logging
import logging.handlers
from time import sleep
from urlparse import urlparse
from lxml import etree
from optparse import OptionParser
try:
from sqlite3 import dbapi2 as sqlite
except:
from pysqlite2 import dbapi2 as sqlite
#__doc__注释 执行脚本 -h 或者 --help 打印输出的内容
'''
This script is used to crawl analyzing web!
The Feature:
1 可以指定抓取的深度
2 将抓取到的关键字数据存放在sqlite
3 使用logging记录日志
4 并发线程池
Required dependencies:
1 chardet #分析抓取页面的字符集
sudo easy_install chardet
Usage:
spider.py -u url -d deep -f logfile -l loglevel(1-5) --testself -thread number --dbfile filepath --key=”HTML5”
Writer: Dongweiming
Date: 2012.10.22
'''
lock = threading.Lock() #设置线程锁
LOGGER = logging.getLogger('Crawler') #设置logging模块的前缀
LEVELS={ #日志级别
1:'CRITICAL',
2:'ERROR',
3:'WARNING',
4:'INFO',
5:'DEBUG',#数字越大记录越详细
}
formatter = logging.Formatter('%(name)s %(asctime)s %(levelname)s %(message)s') #自定义日志格式
class mySqlite(object):
def __init__(self, path, logger, level):
'''初始化数据库连接.
>>> from sqlite3 import dbapi2 as sqlite
>>> conn = sqlite.connect('testdb')
'''
try:
self.conn = sqlite.connect(path) #连接sqlite
self.cur = self.conn.cursor() #cursor是一个记录游标,用于一行一行迭代的访问查询返回的结果
except Exception, e:
myLogger(logger, self.loglevel, e, True)
return -1
self.logger = logger
self.loglevel = level
def create(self, table):
'''创建table,我这里创建包含2个段 ID(数字型,自增长),Data(char 128字符)'''
try:
self.cur.execute("CREATE TABLE IF NOT EXISTS %s(Id INTEGER PRIMARY KEY AUTOINCREMENT, Data VARCHAR(40))"% table)
self.done()
except sqlite.Error ,e: #异常记录日志并且做事务回滚,以下相同
myLogger(self.logger, self.loglevel, e, True)
self.conn.rollback()
if self.loglevel >3: #设置在日志级别较高才记录,这样级别高的详细
myLogger(self.logger, self.loglevel, '创建表%s' % table)
def insert(self, table, data):
'''插入数据,指定表名,设置data的数据'''
try:
self.cur.execute("INSERT INTO %s(Data) VALUES('%s')" % (table,data))
self.done()
except sqlite.Error ,e:
myLogger(self.logger, self.loglevel, e, True)
self.conn.rollback()
else:
if self.loglevel >4:
myLogger(self.logger, self.loglevel, '插入数据成功')
def done(self):
'''事务提交'''
self.conn.commit()
def close(self):
'''关闭连接'''
self.cur.close()
self.conn.close()
if self.loglevel >3:
myLogger(self.logger, self.loglevel, '关闭sqlite操作')
class Crawler(object):
def __init__(self, args, app, table, logger):
self.deep = args.depth #指定网页的抓取深度
self.url = args.urlpth #指定网站地址
self.key = args.key #要搜索的关键字
self.logfile = args.logfile #日志文件路径和名字
self.loglevel = args.loglevel #日志级别
self.dbpth = args.dbpth #指定sqlite数据文件路径和名字
self.tp = app #连接池回调实例
self.table = table #每次请求的table不同
self.logger = logger #logging模块实例
self.visitedUrl = [] #抓取的网页放入列表,防止重复抓取
def _hasCrawler(self, url):
'''判断是否已经抓取过这个页面'''
return (True if url in self.visitedUrl else False)
def getPageSource(self, url, key, deep):
''' 抓取页面,分析,入库.
'''
headers = { #设计一个用户代理,更好防止被认为是爬虫
'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; \
rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6' }
#if urlparse(url).scheme == 'https':
#pass
if self._hasCrawler(url): #发现重复直接return
return
else:
self.visitedUrl.append(url) #发现新地址假如到这个列表
try:
request = urllib2.Request(url = url, headers = headers) #创建一个访问请求,指定url,并且把访问请求保存在request
result = urllib2.urlopen(request).read() #打开这个请求,并保存读取数据
except urllib2.HTTPError, e: #触发http异常记录日志并返回
myLogger(self.logger, self.loglevel, e, True)
return -1
try:
encoding = chardet.detect(result)['encoding'] #判断页面的编码
if encoding.lower() == 'gb2312':
encoding = 'gbk' #今天我抓取新浪是gb2312,但是其中有个'蔡旻佑'不能被识别,所以用gbk去解码gb2312的页面
if encoding.lower() != 'utf-8': #发现不是默认编码就用应该的类型解码
result = result.decode(encoding)
except Exception, e:
myLogger(self.logger, self.loglevel, e, True)
return -1
else:
if self.loglevel >3:
myLogger(self.logger, self.loglevel, '抓取网页 %s 成功' % url)
try:
self._xpath(url, result, ['a'], unicode(key, 'utf8'), deep) #分析页面中的连接地址,以及它的内容
self._xpath(url, result, ['title', 'p', 'li', 'div'], unicode(key, "utf8"), deep) #分析这几个标签的内容
except TypeError: #对编码类型异常处理,有些深度页面和主页的编码不同
self._xpath(url, result, ['a'], key, deep)
self._xpath(url, result, ['title', 'p', 'li', 'div'], key, deep)
except Exception, e:
myLogger(self.logger, self.loglevel, e, True)
return -1
else:
if self.loglevel >3:
myLogger(self.logger, self.loglevel, '分析网页 %s 成功' % url)
return True
def _xpath(self, weburl, data, xpath, key, deep):
sq = mySqlite(self.dbpth, self.logger, self.loglevel)
page = etree.HTML(data)
for i in xpath:
hrefs = page.xpath(u"//%s" % i) #根据xpath标签
if deep >1:
for href in hrefs:
url = href.attrib.get('href','')
if not url.startswith('java') and not \
url.startswith('mailto'): #过滤javascript和发送邮件的链接
self.tp.add_job(self.getPageSource,url, key, deep-1) #递归调用,直到符合的深度
for href in hrefs:
value = href.text #抓取相应标签的内容
if value:
m = re.compile(r'.*%s.*' % key).match(value) #根据key匹配相应内容
if m:
sq.insert(self.table, m.group().strip()) #将匹配的数据插入到sqlite
sq.close()
def work(self):
'''主方法调用.
>>> import datetime
>>> logger = configLogger('test.log')
>>> time = datetime.datetime.now().strftime("%m%d%H%M%S")
>>> sq = mySqlite('test.db', logger, 1)
>>> table = 'd' + str(time)
>>> sq.create(table)
>>> tp = ThreadPool(5)
>>> def t():pass
>>> t.depth=1
>>> t.urlpth='http://www.baidu.com'
>>> t.logfile = 'test.log'
>>> t.loglevel = 1
>>> t.dbpth = 'test.db'
>>> t.key = 'test'
>>> d = Crawler(t, tp, table, logger)
>>> d.getPageSource(t.urlpth, t.key, t.depth)
True
'''
if not self.url.startswith('http://'): #支持用户直接写域名,当然也支持带前缀
self.url = 'http://' + self.url
self.tp.add_job(self.getPageSource, self.url, self.key, self.deep)
self.tp.wait_for_complete() #等待线程池完成
class MyThread(threading.Thread):
def __init__(self, workQueue, timeout=30, **kwargs):
threading.Thread.__init__(self, kwargs=kwargs)
self.timeout = timeout #线程在结束前等待任务队列多长时间
self.setDaemon(True) #设置deamon,表示主线程死掉,子线程不跟随死掉
self.workQueue = workQueue
self.start() #初始化直接启动线程
def run(self):
'''重载run方法'''
while True:
try:
lock.acquire() #线程安全上锁
callable, args = self.workQueue.get(timeout=self.timeout) #从工作队列中获取一个任务
res = callable(*args) #执行的任务
lock.release() #执行完,释放锁
except Queue.Empty: #任务队列空的时候结束此线程
break
except Exception, e:
myLogger(self.logger, self.loglevel, e, True)
return -1
class ThreadPool(object):
def __init__(self, num_of_threads):
self.workQueue = Queue.Queue()
self.threads = []
self.__createThreadPool(num_of_threads)
def __createThreadPool(self, num_of_threads):
for i in range(num_of_threads):
thread = MyThread(self.workQueue)
self.threads.append(thread)
def wait_for_complete(self):
'''等待所有线程完成'''
while len(self.threads):
thread = self.threads.pop()
if thread.isAlive(): #判断线程是否还存活来决定是否调用join
thread.join()
def add_job( self, callable, *args):
'''增加任务,放到队列里面'''
self.workQueue.put((callable, args))
def configLogger(logfile):
'''配置日志文件和记录等级'''
try:
handler = logging.handlers.RotatingFileHandler(logfile,
maxBytes=10240000, #文件最大字节数
backupCount=5, #会轮转5个文件,共6个
)
except IOError, e:
print e
return -1
else:
handler.setFormatter(formatter) #设置日志格式
LOGGER.addHandler(handler) #增加处理器
logging.basicConfig(level=logging.NOTSET) #设置,不打印小于4级别的日志
return LOGGER #返回logging实例
def myLogger(logger, lv, mes, err=False):
'''记录日志函数'''
getattr(logger, LEVELS.get(lv, 'WARNING').lower())(mes)
if err: #当发现是错误日志,还会记录错误的堆栈信息
getattr(logger, LEVELS.get(lv, 'WARNING').lower())(traceback.format_exc())
def parse():
parser = OptionParser(
description="This script is used to crawl analyzing web!")
parser.add_option("-u", "--url", dest="urlpth", action="store",
help="Path you want to fetch", metavar="www.sina.com.cn")
parser.add_option("-d", "--deep", dest="depth", action="store",type="int",
help="Url path's deep, default 1", default=1)
parser.add_option("-k", "--key", dest="key", action="store",
help="You want to query keywords, For example 'test'")
parser.add_option("-f", "--file", dest="logfile", action="store",
help="Record log file path and name, default spider.log",
default='spider.log')
parser.add_option("-l", "--level", dest="loglevel", action = "store",
type="int",help="Log file level, default 1(CRITICAL)",
default=1)
parser.add_option("-t", "--thread", dest="thread", action="store",
type="int",help="Specify the thread pool, default 10",
default=10)
parser.add_option("-q", "--dbfile", dest="dbpth", action="store",
help="Specify the the sqlite file directory and name, \
default test.db", metavar='test.db')
parser.add_option("-s", "--testself", dest="testself", action="store_true",
help="Test myself", default=False)
(options, args) = parser.parse_args()
return options
def main():
'''主函数'''
options = parse()
if options.testself: #如果testself,执行doctest
import doctest
print doctest.testmod()
return
if not options.urlpth or not options.key or not options.dbpth: #判断必选项是否存在
print 'Need to specify the parameters option "-u " or "-k" or "-q"!'
return
if '-h' in sys.argv or '--help' in sys.argv: #选择帮助信息,打印__doc__
print __doc__
logger = configLogger(options.logfile) #实例化日志调用
time = datetime.datetime.now().strftime("%m%d%H%M%S") #每次请求都会根据时间创建table
tp = ThreadPool(options.thread)
sq = mySqlite(options.dbpth, logger, options.loglevel)
table = 'd' + str(time)
sq.create(table) #创建table
sq.close()
crawler = Crawler(options, tp, table, logger)
crawler.work() #主方法
if __name__ == '__main__':
main()
|
__label__pos
| 0.975644 |
Anna Scheller’s Insights: Winter Wellness – Nurturing Your Well-being During Your Temporary Stay
Introduction: Embark on a wellness journey this winter with Anna Scheller, the CEO and Founder of Capri Temporary Housing. In this exclusive interview, Anna shares her expert advice on maintaining well-being, both mentally and physically, during your temporary stay. Tips for Winter Wellness Discover essential tips from Anna Scheller to ensure your winter stay is […]
Introduction:
Embark on a wellness journey this winter with Anna Scheller, the CEO and Founder of Capri Temporary Housing. In this exclusive interview, Anna shares her expert advice on maintaining well-being, both mentally and physically, during your temporary stay.
Tips for Winter Wellness
Discover essential tips from Anna Scheller to ensure your winter stay is a time of well-being and balance.
• Mindful Moments: Incorporate moments of mindfulness into your daily routine.
• Indoor Exercise: Explore indoor exercises to stay active during the colder months.
• Nutritional Balance: Maintain a balanced and nutritious diet to support your overall health.
Creating a Cozy Haven
Anna Scheller provides insights into transforming your temporary space into a cozy and nurturing haven.
• Warm Ambiance: Add cozy elements like blankets, cushions, and warm lighting.
• Personal Retreat: Carve out a space for relaxation and personal time.
• Nature Connection: Bring in elements of nature to enhance your well-being.
Nourishing Your Body
Explore tips from Anna on nourishing your body during the winter season.
• Healthy Eating Habits: Make mindful food choices to support your well-being.
• Warm Beverages: Enjoy a variety of warm beverages for comfort and hydration.
• Immune Boosters: Incorporate immune-boosting foods into your diet.
Mind-Body Balance
Anna Scheller emphasizes the importance of maintaining a harmonious mind-body balance.
• Relaxation Techniques: Explore relaxation methods such as meditation or deep breathing.
• Quality Sleep: Prioritize restful sleep for overall well-being.
• Holistic Wellness: Consider holistic approaches like yoga or aromatherapy.
Conclusion:
In this insightful guide, Anna Scheller invites you to prioritize your well-being during the winter months. With her expert tips, your temporary stay can become a time of rejuvenation and self-care. Wishing you a season of wellness and tranquility!
|
__label__pos
| 0.78351 |
Advanced Metering Infrastructure
From RECESSIM, A Reverse Engineering Community
Jump to navigation Jump to search
Advanced Metering Infrastructure (AMI)[1] refers to systems that measure, collect, and analyze energy usage, and communicate with metering devices such as electricity meters, gas meters, heat meters, and water meters, either on request or on a schedule.
Landis+Gyr Residential Power Meter
There are various methods used to report power usage back to the utility including cellular, power-line and mesh networked power meters operating in the ISM bands[2].
Electricity Metering Systems
Landis+Gyr GridStream Protocol
Landis+Gyr Residential Meter
Landis+Gyr Commercial Meter
Landis+Gyr Collector
Landis+Gyr Integrated WanGate Radio (IWR)
Silver Spring Networks Access Point
|
__label__pos
| 0.870894 |
Can we sort a list with Lambda in Java?
Java 8Object Oriented ProgrammingProgramming
Yes, we can sort a list with Lambda. Let us first create a String List:
List<String> list = Arrays.asList("LCD","Laptop", "Mobile", "Device", "LED", "Tablet");
Now, sort using Lambda, wherein we will be using compareTo():
Collections.sort(list, (String str1, String str2) -> str2.compareTo(str1));
The following is an example to sort a list with Lambda in Java:
Example
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Demo {
public static void main(String... args) {
List<String> list = Arrays.asList("LCD","Laptop", "Mobile", "Device", "LED", "Tablet");
System.out.println("List = "+list);
Collections.sort(list, (String str1, String str2) -> str2.compareTo(str1));
System.out.println("Sorted List = "+list);
}
}
Output
List = [LCD, Laptop, Mobile, Device, LED, Tablet]
Sorted List = [Tablet, Mobile, Laptop, LED, LCD, Device]
raja
Published on 02-May-2019 10:10:22
Advertisements
|
__label__pos
| 1 |
• Join over 1.2 million students every month
• Accelerate your learning by 29%
• Unlimited access from just £6.99 per month
The aim of this experiment is to investigate the relationship between the current, voltage and resistance through the use of a fixed resistor and a filament lamp.
Extracts from this document...
Introduction
Abdul Mufti Centre Number: 13329 Candidate Number: 4138
10. F
Aim
The aim of this experiment is to investigate the relationship between the current, voltage and resistance through the use of a fixed resistor and a filament lamp.
Hypothesis
Based on knowledge of Ohm’s law it can be hypothesised that when increasing voltage and current is passed through a filament lamp the resistance would increase in a non-linear fashion, such that a graph similar to the one given below would be obtained (figure 1). This non-linear graph would be expected due to temperature increases in the filament lamp.
It can also be hypothesised that when current is passed through a fixed resistor the relationship between V and I would be expected to be linear such that a straight line through the origin would be obtained (figure 2). In addition the readings on the ammeter and voltmeter would both change accordingly as expected.
image00.pngimage01.png
The shape of a fixed resistor current-voltage graph (I-V graph) is explained in figure 3 since the three variables are related through Ohm’s law.
image09.pngimage10.pngimage11.pngimage02.pngimage03.png
Circuit Diagrams
image04.png
image05.png
image06.png
Equipment
Fixed resistor &
Filament Lamp to impede and obstruct current flowing through circuit
Ammeter to measure current flowing through the circuit
Voltmeter– to measure the voltage present in the circuit and to make sure the power supply is correctly calibrated.
Power Supply– to act as the adjustable power source for the circuit
Wiresto connect the circuit components.
...read more.
Middle
In order to apply Ohm’s law we need to know two of the 3 variables. In this experiment we will know the voltage and current. Therefore by rearranging Ohm’s law we can calculate the resistance.
• A steady increase in resistance, in a circuit with constant voltage, produces a progressively (not a straight-line if graphed) weaker current.
• A steady increase in voltage, in a circuit with constant resistance, produces a constant linear rise in current.
In this case, Ohm’s law is needed to calculate the resistance of the fixed resistor and the change in resistance as the filament lamp gets hot. For each case gradient from the appropriate graphs will be used. Resistance can be varied by using a variable resistor, by altering the gauge or by length of the wire or by changing the temperature. If a longer wire is being used then the resistance increases as the electrons have to travel further than in a short wire. If a thicker wire is being used then the electrons have more space to move and therefore resistance is decreased. If a thinner wire is used then the resistance will increase as the electrons cannot get around the circuit easily.
Method
The work surface was insured to be dry and clean. Bags, stools and other possible obstacles were removed from the work area. The equipment was collected according to the list given and verified by close inspection to be clean, non-corroded and undamaged.
...read more.
Conclusion
It would have been practical in the interest of conducting a fair test to use averages for series of current readings. This could be done using two different sets of equipment, conducting the experiment on each set and averaging the values. This could help us reduce error margin in any anomalies found. It may have been interesting to investigate the same aim with a wider range and more sensitive set of equipment. Smaller graduations of voltage on the PSU would have allowed us to plot the graphs with more accuracy. If possible it would have been interesting to use a diode. However given the amount of time we had, it would not have been possible to further complicate the experimental design.
We may also have adjusted variables such as the gauge, length and type of wire used to investigate the effect these factors have on ohms law. It may also have been of interest to us if we investigated how adjusting the circuit diagram would have affected our results. However this may have been a little advanced for our level at present.
Bibliography
GCSE double Science Physics – CGP – ISBN: 1-84146-401-5
New Modular Science for GCSE, (Vol 1), - Heinemann (1996) – ISBN: 0-43557-196-6
AQA GCSE Science syllabus (2001).
...read more.
This student written piece of work is one of many that can be found in our University Degree Physics section.
Found what you're looking for?
• Start learning 29% faster today
• 150,000+ documents available
• Just £6.99 a month
Not the one? Search for your essay title...
• Join over 1.2 million students every month
• Accelerate your learning by 29%
• Unlimited access from just £6.99 per month
See related essaysSee related essays
Related University Degree Physics essays
1. How is the internal resistance of a standard battery affected by Temperature
Voltmeter * Plastic waterproof bag * Wires * Crocodile clips * Beaker / Water bath * Thermometer Method * Connect two crocodile clips to each end of the resistors * place the battery connected to the appropriate wires in a water bath filled with water straight from a boiling kettle
2. The Heating Effect of An Electrical Current
a known current flowing through the wire for a 30 minute period. By varying the current and the length of the wire he deduced that the heat produced was proportional to the electrical resistance of the wire multiplied by the square of the current.
1. The relationship between wire length, width, area and resistance.
Turn the apparatus on and then turn the dial on the lab pack so that the volt meter reads 1. Then read and record the reading on the ammeter. 6. Repeat this process for each length. 7. Repeat the above two a further two times to give 3 sets of results 8.
2. Torque Physics Lab Report. The purpose of this experiment was to help understand ...
If the clamp were to have been inverted, where the bar is supported at a point above the center of gravity, you wouldn't een be able to balance the meter bar because it is not in the center of gravity it would just be slack and hang down.
1. Double Slit Interference
Then the paper was removed and the distances between the central maximum and the other maximums were measured with meter stick. Also the distance between the screen and the slit disk was measured and recorded. After that, the slit disk was rotated to a new double slit with 0.04 mm
2. The purpose of this experiment was to find the normal force and the lift ...
Hence from the lift curve slope it can be seen that from angle of attack 1 to 11 the lift was because of low pressure on the upper surface and high pressure on the lower surface while during the angle of attack 16 due to high pressure on the upper
1. Experiment to find how the Length of the Wire affects the Resistance of the ...
The diameter of the wire must be kept the same because if the thickness were different each time, there would be more or less atoms that the electrons would have to travel through therefore it would decrease or increase the resistance making my results unreliable.
2. Investigating factors which affect the period time of a simple pendulum
taken the results to 2 decimal places because this was the limit of accuracy on the stopwatch. These results show that over a 50� increase in angle of release, the period of oscillation increases by 0.06. This is an unreliable measurement because the stopwatch does not have this degree of accuracy.
• Over 160,000 pieces
of student written work
• Annotated by
experienced teachers
• Ideas and feedback to
improve your own work
|
__label__pos
| 0.989251 |
Skip to Content
OpenStax Logo
Precalculus
2.3 Modeling with Linear Functions
Precalculus2.3 Modeling with Linear Functions
1. Preface
2. 1 Functions
1. Introduction to Functions
2. 1.1 Functions and Function Notation
3. 1.2 Domain and Range
4. 1.3 Rates of Change and Behavior of Graphs
5. 1.4 Composition of Functions
6. 1.5 Transformation of Functions
7. 1.6 Absolute Value Functions
8. 1.7 Inverse Functions
9. Key Terms
10. Key Equations
11. Key Concepts
12. Review Exercises
13. Practice Test
3. 2 Linear Functions
1. Introduction to Linear Functions
2. 2.1 Linear Functions
3. 2.2 Graphs of Linear Functions
4. 2.3 Modeling with Linear Functions
5. 2.4 Fitting Linear Models to Data
6. Key Terms
7. Key Equations
8. Key Concepts
9. Review Exercises
10. Practice Test
4. 3 Polynomial and Rational Functions
1. Introduction to Polynomial and Rational Functions
2. 3.1 Complex Numbers
3. 3.2 Quadratic Functions
4. 3.3 Power Functions and Polynomial Functions
5. 3.4 Graphs of Polynomial Functions
6. 3.5 Dividing Polynomials
7. 3.6 Zeros of Polynomial Functions
8. 3.7 Rational Functions
9. 3.8 Inverses and Radical Functions
10. 3.9 Modeling Using Variation
11. Key Terms
12. Key Equations
13. Key Concepts
14. Review Exercises
15. Practice Test
5. 4 Exponential and Logarithmic Functions
1. Introduction to Exponential and Logarithmic Functions
2. 4.1 Exponential Functions
3. 4.2 Graphs of Exponential Functions
4. 4.3 Logarithmic Functions
5. 4.4 Graphs of Logarithmic Functions
6. 4.5 Logarithmic Properties
7. 4.6 Exponential and Logarithmic Equations
8. 4.7 Exponential and Logarithmic Models
9. 4.8 Fitting Exponential Models to Data
10. Key Terms
11. Key Equations
12. Key Concepts
13. Review Exercises
14. Practice Test
6. 5 Trigonometric Functions
1. Introduction to Trigonometric Functions
2. 5.1 Angles
3. 5.2 Unit Circle: Sine and Cosine Functions
4. 5.3 The Other Trigonometric Functions
5. 5.4 Right Triangle Trigonometry
6. Key Terms
7. Key Equations
8. Key Concepts
9. Review Exercises
10. Practice Test
7. 6 Periodic Functions
1. Introduction to Periodic Functions
2. 6.1 Graphs of the Sine and Cosine Functions
3. 6.2 Graphs of the Other Trigonometric Functions
4. 6.3 Inverse Trigonometric Functions
5. Key Terms
6. Key Equations
7. Key Concepts
8. Review Exercises
9. Practice Test
8. 7 Trigonometric Identities and Equations
1. Introduction to Trigonometric Identities and Equations
2. 7.1 Solving Trigonometric Equations with Identities
3. 7.2 Sum and Difference Identities
4. 7.3 Double-Angle, Half-Angle, and Reduction Formulas
5. 7.4 Sum-to-Product and Product-to-Sum Formulas
6. 7.5 Solving Trigonometric Equations
7. 7.6 Modeling with Trigonometric Equations
8. Key Terms
9. Key Equations
10. Key Concepts
11. Review Exercises
12. Practice Test
9. 8 Further Applications of Trigonometry
1. Introduction to Further Applications of Trigonometry
2. 8.1 Non-right Triangles: Law of Sines
3. 8.2 Non-right Triangles: Law of Cosines
4. 8.3 Polar Coordinates
5. 8.4 Polar Coordinates: Graphs
6. 8.5 Polar Form of Complex Numbers
7. 8.6 Parametric Equations
8. 8.7 Parametric Equations: Graphs
9. 8.8 Vectors
10. Key Terms
11. Key Equations
12. Key Concepts
13. Review Exercises
14. Practice Test
10. 9 Systems of Equations and Inequalities
1. Introduction to Systems of Equations and Inequalities
2. 9.1 Systems of Linear Equations: Two Variables
3. 9.2 Systems of Linear Equations: Three Variables
4. 9.3 Systems of Nonlinear Equations and Inequalities: Two Variables
5. 9.4 Partial Fractions
6. 9.5 Matrices and Matrix Operations
7. 9.6 Solving Systems with Gaussian Elimination
8. 9.7 Solving Systems with Inverses
9. 9.8 Solving Systems with Cramer's Rule
10. Key Terms
11. Key Equations
12. Key Concepts
13. Review Exercises
14. Practice Test
11. 10 Analytic Geometry
1. Introduction to Analytic Geometry
2. 10.1 The Ellipse
3. 10.2 The Hyperbola
4. 10.3 The Parabola
5. 10.4 Rotation of Axes
6. 10.5 Conic Sections in Polar Coordinates
7. Key Terms
8. Key Equations
9. Key Concepts
10. Review Exercises
11. Practice Test
12. 11 Sequences, Probability and Counting Theory
1. Introduction to Sequences, Probability and Counting Theory
2. 11.1 Sequences and Their Notations
3. 11.2 Arithmetic Sequences
4. 11.3 Geometric Sequences
5. 11.4 Series and Their Notations
6. 11.5 Counting Principles
7. 11.6 Binomial Theorem
8. 11.7 Probability
9. Key Terms
10. Key Equations
11. Key Concepts
12. Review Exercises
13. Practice Test
13. 12 Introduction to Calculus
1. Introduction to Calculus
2. 12.1 Finding Limits: Numerical and Graphical Approaches
3. 12.2 Finding Limits: Properties of Limits
4. 12.3 Continuity
5. 12.4 Derivatives
6. Key Terms
7. Key Equations
8. Key Concepts
9. Review Exercises
10. Practice Test
14. A | Basic Functions and Identities
15. Answer Key
1. Chapter 1
2. Chapter 2
3. Chapter 3
4. Chapter 4
5. Chapter 5
6. Chapter 6
7. Chapter 7
8. Chapter 8
9. Chapter 9
10. Chapter 10
11. Chapter 11
12. Chapter 12
16. Index
Learning Objectives
In this section, you will:
• Identify steps for modeling and solving.
• Build linear models from verbal descriptions.
• Build systems of linear models.
Figure 1 (credit: EEK Photography/Flickr)
Emily is a college student who plans to spend a summer in Seattle. She has saved $3,500 for her trip and anticipates spending $400 each week on rent, food, and activities. How can we write a linear model to represent her situation? What would be the x-intercept, and what can she learn from it? To answer these and related questions, we can create a model using a linear function. Models such as this one can be extremely useful for analyzing relationships and making predictions based on those relationships. In this section, we will explore examples of linear function models.
Identifying Steps to Model and Solve Problems
When modeling scenarios with linear functions and solving problems involving quantities with a constant rate of change, we typically follow the same problem strategies that we would use for any type of function. Let’s briefly review them:
1. Identify changing quantities, and then define descriptive variables to represent those quantities. When appropriate, sketch a picture or define a coordinate system.
2. Carefully read the problem to identify important information. Look for information that provides values for the variables or values for parts of the functional model, such as slope and initial value.
3. Carefully read the problem to determine what we are trying to find, identify, solve, or interpret.
4. Identify a solution pathway from the provided information to what we are trying to find. Often this will involve checking and tracking units, building a table, or even finding a formula for the function being used to model the problem.
5. When needed, write a formula for the function.
6. Solve or evaluate the function using the formula.
7. Reflect on whether your answer is reasonable for the given situation and whether it makes sense mathematically.
8. Clearly convey your result using appropriate units, and answer in full sentences when necessary.
Building Linear Models
Now let’s take a look at the student in Seattle. In her situation, there are two changing quantities: time and money. The amount of money she has remaining while on vacation depends on how long she stays. We can use this information to define our variables, including units.
• Output: M, M, money remaining, in dollars
• Input: t, t, time, in weeks
So, the amount of money remaining depends on the number of weeks: M(t) M(t)
We can also identify the initial value and the rate of change.
• Initial Value: She saved $3,500, so $3,500 is the initial value for M. M.
• Rate of Change: She anticipates spending $400 each week, so –$400 per week is the rate of change, or slope.
Notice that the unit of dollars per week matches the unit of our output variable divided by our input variable. Also, because the slope is negative, the linear function is decreasing. This should make sense because she is spending money each week.
The rate of change is constant, so we can start with the linear model M( t )=mt+b. M( t )=mt+b. Then we can substitute the intercept and slope provided.
To find the x- x- intercept, we set the output to zero, and solve for the input.
0=400t+3500 t= 3500 400 =8.75 0=400t+3500 t= 3500 400 =8.75
The x- x- intercept is 8.75 weeks. Because this represents the input value when the output will be zero, we could say that Emily will have no money left after 8.75 weeks.
When modeling any real-life scenario with functions, there is typically a limited domain over which that model will be valid—almost no trend continues indefinitely. Here the domain refers to the number of weeks. In this case, it doesn’t make sense to talk about input values less than zero. A negative input value could refer to a number of weeks before she saved $3,500, but the scenario discussed poses the question once she saved $3,500 because this is when her trip and subsequent spending starts. It is also likely that this model is not valid after the x- x- intercept, unless Emily will use a credit card and goes into debt. The domain represents the set of input values, so the reasonable domain for this function is 0t8.75. 0t8.75.
In the above example, we were given a written description of the situation. We followed the steps of modeling a problem to analyze the information. However, the information provided may not always be the same. Sometimes we might be provided with an intercept. Other times we might be provided with an output value. We must be careful to analyze the information we are given, and use it appropriately to build a linear model.
Using a Given Intercept to Build a Model
Some real-world problems provide the y- y- intercept, which is the constant or initial value. Once the y- y- intercept is known, the x- x- intercept can be calculated. Suppose, for example, that Hannah plans to pay off a no-interest loan from her parents. Her loan balance is $1,000. She plans to pay $250 per month until her balance is $0. The y- y- intercept is the initial amount of her debt, or $1,000. The rate of change, or slope, is -$250 per month. We can then use the slope-intercept form and the given information to develop a linear model.
f(x)=mx+b =250x+1000 f(x)=mx+b =250x+1000
Now we can set the function equal to 0, and solve for x x to find the x- x- intercept.
0=250x+1000 1000=250x 4=x x=4 0=250x+1000 1000=250x 4=x x=4
The x- x- intercept is the number of months it takes her to reach a balance of $0. The x- x- intercept is 4 months, so it will take Hannah four months to pay off her loan.
Using a Given Input and Output to Build a Model
Many real-world applications are not as direct as the ones we just considered. Instead they require us to identify some aspect of a linear function. We might sometimes instead be asked to evaluate the linear model at a given input or set the equation of the linear model equal to a specified output.
How To
Given a word problem that includes two pairs of input and output values, use the linear function to solve a problem.
1. Identify the input and output values.
2. Convert the data to two coordinate pairs.
3. Find the slope.
4. Write the linear model.
5. Use the model to make a prediction by evaluating the function at a given x- x- value.
6. Use the model to identify an x- x- value that results in a given y- y- value.
7. Answer the question posed.
Example 1
Using a Linear Model to Investigate a Town’s Population
A town’s population has been growing linearly. In 2004 the population was 6,200. By 2009 the population had grown to 8,100. Assume this trend continues.
1. Predict the population in 2013.
2. Identify the year in which the population will reach 15,000.
Try It #1
A company sells doughnuts. They incur a fixed cost of $25,000 for rent, insurance, and other expenses. It costs $0.25 to produce each doughnut.
1. Write a linear model to represent the cost C C of the company as a function of x, x, the number of doughnuts produced.
2. Find and interpret the y-intercept.
Try It #2
A city’s population has been growing linearly. In 2008, the population was 28,200. By 2012, the population was 36,800. Assume this trend continues.
1. Predict the population in 2014.
2. Identify the year in which the population will reach 54,000.
Using a Diagram to Model a Problem
It is useful for many real-world applications to draw a picture to gain a sense of how the variables representing the input and output may be used to answer a question. To draw the picture, first consider what the problem is asking for. Then, determine the input and the output. The diagram should relate the variables. Often, geometrical shapes or figures are drawn. Distances are often traced out. If a right triangle is sketched, the Pythagorean Theorem relates the sides. If a rectangle is sketched, labeling width and height is helpful.
Example 2
Using a Diagram to Model Distance Walked
Anna and Emanuel start at the same intersection. Anna walks east at 4 miles per hour while Emanuel walks south at 3 miles per hour. They are communicating with a two-way radio that has a range of 2 miles. How long after they start walking will they fall out of radio contact?
Q&A
Should I draw diagrams when given information based on a geometric shape?
Yes. Sketch the figure and label the quantities and unknowns on the sketch.
Example 3
Using a Diagram to Model Distance between Cities
There is a straight road leading from the town of Westborough to Agritown 30 miles east and 10 miles north. Partway down this road, it junctions with a second road, perpendicular to the first, leading to the town of Eastborough. If the town of Eastborough is located 20 miles directly east of the town of Westborough, how far is the road junction from Westborough?
Analysis
One nice use of linear models is to take advantage of the fact that the graphs of these functions are lines. This means real-world applications discussing maps need linear functions to model the distances between reference points.
Try It #3
There is a straight road leading from the town of Timpson to Ashburn 60 miles east and 12 miles north. Partway down the road, it junctions with a second road, perpendicular to the first, leading to the town of Garrison. If the town of Garrison is located 22 miles directly east of the town of Timpson, how far is the road junction from Timpson?
Building Systems of Linear Models
Real-world situations including two or more linear functions may be modeled with a system of linear equations. Remember, when solving a system of linear equations, we are looking for points the two lines have in common. Typically, there are three types of answers possible, as shown in Figure 5.
Figure 5
How To
Given a situation that represents a system of linear equations, write the system of equations and identify the solution.
1. Identify the input and output of each linear model.
2. Identify the slope and y-intercept of each linear model.
3. Find the solution by setting the two linear functions equal to one another and solving for x, x,or find the point of intersection on a graph.
Example 4
Building a System of Linear Models to Choose a Truck Rental Company
Jamal is choosing between two truck-rental companies. The first, Keep on Trucking, Inc., charges an up-front fee of $20, then 59 cents a mile. The second, Move It Your Way, charges an up-front fee of $16, then 63 cents a mile9. When will Keep on Trucking, Inc. be the better choice for Jamal?
Media
Access this online resource for additional instruction and practice with linear function models.
Footnotes
• 9 Rates retrieved Aug 2, 2010 from http://www.budgettruck.com and http://www.uhaul.com/
2.3 Section Exercises
Verbal
1.
Explain how to find the input variable in a word problem that uses a linear function.
2.
Explain how to find the output variable in a word problem that uses a linear function.
3.
Explain how to interpret the initial value in a word problem that uses a linear function.
4.
Explain how to determine the slope in a word problem that uses a linear function.
Algebraic
5.
Find the area of a parallelogram bounded by the y-axis, the line x=3, x=3, the line f(x)=1+2x, f(x)=1+2x, and the line parallel to f(x) f(x) passing through ( 2, 7 ). ( 2, 7 ).
6.
Find the area of a triangle bounded by the x-axis, the line f(x)=12 1 3 x, f(x)=12 1 3 x, and the line perpendicular to f(x) f(x) that passes through the origin.
7.
Find the area of a triangle bounded by the y-axis, the line f(x)=9 6 7 x, f(x)=9 6 7 x, and the line perpendicular to f(x) f(x) that passes through the origin.
8.
Find the area of a parallelogram bounded by the x-axis, the line g(x)=2, g(x)=2, the line f(x)=3x, f(x)=3x, and the line parallel to f(x) f(x) passing through (6,1). (6,1).
For the following exercises, consider this scenario: A town’s population has been decreasing at a constant rate. In 2010 the population was 5,900. By 2012 the population had dropped 4,700. Assume this trend continues.
9.
Predict the population in 2016.
10.
Identify the year in which the population will reach 0.
For the following exercises, consider this scenario: A town’s population has been increased at a constant rate. In 2010 the population was 46,020. By 2012 the population had increased to 52,070. Assume this trend continues.
11.
Predict the population in 2016.
12.
Identify the year in which the population will reach 75,000.
For the following exercises, consider this scenario: A town has an initial population of 75,000. It grows at a constant rate of 2,500 per year for 5 years.
13.
Find the linear function that models the town’s population P P as a function of the year, t, t, where t t is the number of years since the model began.
14.
Find a reasonable domain and range for the function P. P.
15.
If the function P P is graphed, find and interpret the x- and y-intercepts.
16.
If the function P P is graphed, find and interpret the slope of the function.
17.
When will the output reached 100,000?
18.
What is the output in the year 12 years from the onset of the model?
For the following exercises, consider this scenario: The weight of a newborn is 7.5 pounds. The baby gained one-half pound a month for its first year.
19.
Find the linear function that models the baby’s weight W W as a function of the age of the baby, in months, t. t.
20.
Find a reasonable domain and range for the function WW.
21.
If the function W W is graphed, find and interpret the x- and y-intercepts.
22.
If the function W is graphed, find and interpret the slope of the function.
23.
When did the baby weight 10.4 pounds?
24.
What is the output when the input is 6.2? Interpret your answer.
For the following exercises, consider this scenario: The number of people afflicted with the common cold in the winter months steadily decreased by 205 each year from 2005 until 2010. In 2005, 12,025 people were afflicted.
25.
Find the linear function that models the number of people inflicted with the common cold C C as a function of the year, t. t.
26.
Find a reasonable domain and range for the function C. C.
27.
If the function C C is graphed, find and interpret the x- and y-intercepts.
28.
If the function C C is graphed, find and interpret the slope of the function.
29.
When will the output reach 0?
30.
In what year will the number of people be 9,700?
Graphical
For the following exercises, use the graph in Figure 7, which shows the profit, y, y, in thousands of dollars, of a company in a given year, t, t, where t t represents the number of years since 1980.
Graph of a line from (15, 150) to (25, 130).
Figure 7
31.
Find the linear function y, y, where y y depends on t, t, the number of years since 1980.
32.
Find and interpret the y-intercept.
33.
Find and interpret the x-intercept.
34.
Find and interpret the slope.
For the following exercises, use the graph in Figure 8, which shows the profit, y, y, in thousands of dollars, of a company in a given year, t, t, where t t represents the number of years since 1980.
Graph of a line from (15, 150) to (25, 450).
Figure 8
35.
Find the linear function y, y, where y y depends on t, t, the number of years since 1980.
36.
Find and interpret the y-intercept.
37.
Find and interpret the x-intercept.
38.
Find and interpret the slope.
Numeric
For the following exercises, use the median home values in Mississippi and Hawaii (adjusted for inflation) shown in Table 2. Assume that the house values are changing linearly.
Year Mississippi Hawaii
1950 $25,200 $74,400
2000 $71,400 $272,700
Table 2
39.
In which state have home values increased at a higher rate?
40.
If these trends were to continue, what would be the median home value in Mississippi in 2010?
41.
If we assume the linear trend existed before 1950 and continues after 2000, the two states’ median house values will be (or were) equal in what year? (The answer might be absurd.)
For the following exercises, use the median home values in Indiana and Alabama (adjusted for inflation) shown in Table 3. Assume that the house values are changing linearly.
Year Indiana Alabama
1950 $37,700 $27,100
2000 $94,300 $85,100
Table 3
42.
In which state have home values increased at a higher rate?
43.
If these trends were to continue, what would be the median home value in Indiana in 2010?
44.
If we assume the linear trend existed before 1950 and continues after 2000, the two states’ median house values will be (or were) equal in what year? (The answer might be absurd.)
Real-World Applications
45.
In 2004, a school population was 1,001. By 2008 the population had grown to 1,697. Assume the population is changing linearly.
1. How much did the population grow between the year 2004 and 2008?
2. How long did it take the population to grow from 1,001 students to 1,697 students?
3. What is the average population growth per year?
4. What was the population in the year 2000?
5. Find an equation for the population, P, P, of the school t years after 2000.
6. Using your equation, predict the population of the school in 2011.
46.
In 2003, a town’s population was 1,431. By 2007 the population had grown to 2,134. Assume the population is changing linearly.
1. How much did the population grow between the year 2003 and 2007?
2. How long did it take the population to grow from 1,431 people to 2,134 people?
3. What is the average population growth per year?
4. What was the population in the year 2000?
5. Find an equation for the population, PP of the town tt years after 2000.
6. Using your equation, predict the population of the town in 2014.
47.
A phone company has a monthly cellular plan where a customer pays a flat monthly fee and then a certain amount of money per minute used on the phone. If a customer uses 410 minutes, the monthly cost will be $71.50. If the customer uses 720 minutes, the monthly cost will be $118.
1. Find a linear equation for the monthly cost of the cell plan as a function of x, the number of monthly minutes used.
2. Interpret the slope and y-intercept of the equation.
3. Use your equation to find the total monthly cost if 687 minutes are used.
48.
A phone company has a monthly cellular data plan where a customer pays a flat monthly fee of $10 and then a certain amount of money per megabyte (MB) of data used on the phone. If a customer uses 20 MB, the monthly cost will be $11.20. If the customer uses 130 MB, the monthly cost will be $17.80.
1. Find a linear equation for the monthly cost of the data plan as a function of xx, the number of MB used.
2. Interpret the slope and y-intercept of the equation.
3. Use your equation to find the total monthly cost if 250 MB are used.
49.
In 1991, the moose population in a park was measured to be 4,360. By 1999, the population was measured again to be 5,880. Assume the population continues to change linearly.
1. Find a formula for the moose population, P since 1990.
2. What does your model predict the moose population to be in 2003?
50.
In 2003, the owl population in a park was measured to be 340. By 2007, the population was measured again to be 285. The population changes linearly. Let the input be years since 1990.
1. Find a formula for the owl population, P.P. Let the input be years since 2003.
2. What does your model predict the owl population to be in 2012?
51.
The Federal Helium Reserve held about 16 billion cubic feet of helium in 2010 and is being depleted by about 2.1 billion cubic feet each year.
1. Give a linear equation for the remaining federal helium reserves, R,R, in terms of t,t, the number of years since 2010.
2. In 2015, what will the helium reserves be?
3. If the rate of depletion doesn’t change, in what year will the Federal Helium Reserve be depleted?
52.
Suppose the world’s oil reserves in 2014 are 1,820 billion barrels. If, on average, the total reserves are decreasing by 25 billion barrels of oil each year:
1. Give a linear equation for the remaining oil reserves, R,R, in terms of t,t, the number of years since now.
2. Seven years from now, what will the oil reserves be?
3. If the rate at which the reserves are decreasing is constant, when will the world’s oil reserves be depleted?
53.
You are choosing between two different prepaid cell phone plans. The first plan charges a rate of 26 cents per minute. The second plan charges a monthly fee of $19.95 plus 11 cents per minute. How many minutes would you have to use in a month in order for the second plan to be preferable?
54.
You are choosing between two different window washing companies. The first charges $5 per window. The second charges a base fee of $40 plus $3 per window. How many windows would you need to have for the second company to be preferable?
55.
When hired at a new job selling jewelry, you are given two pay options:
• Option A: Base salary of $17,000 a year with a commission of 12% of your sales
• Option B: Base salary of $20,000 a year with a commission of 5% of your sales
How much jewelry would you need to sell for option A to produce a larger income?
56.
When hired at a new job selling electronics, you are given two pay options:
• Option A: Base salary of $14,000 a year with a commission of 10% of your sales
• Option B: Base salary of $19,000 a year with a commission of 4% of your sales
How much electronics would you need to sell for option A to produce a larger income?
57.
When hired at a new job selling electronics, you are given two pay options:
• Option A: Base salary of $20,000 a year with a commission of 12% of your sales
• Option B: Base salary of $26,000 a year with a commission of 3% of your sales
How much electronics would you need to sell for option A to produce a larger income?
58.
When hired at a new job selling electronics, you are given two pay options:
• Option A: Base salary of $10,000 a year with a commission of 9% of your sales
• Option B: Base salary of $20,000 a year with a commission of 4% of your sales
How much electronics would you need to sell for option A to produce a larger income?
Citation/Attribution
Want to cite, share, or modify this book? This book is Creative Commons Attribution License 4.0 and you must attribute OpenStax.
Attribution information
• If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
Access for free at https://openstax.org/books/precalculus/pages/1-introduction-to-functions
• If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
Access for free at https://openstax.org/books/precalculus/pages/1-introduction-to-functions
Citation information
© Feb 10, 2020 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution License 4.0 license. The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.
|
__label__pos
| 0.997772 |
Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How to use jing
337 views
Published on
Jing is a software that allows users to capture images, webpages, videos, share and store them easily.
• Be the first to comment
• Be the first to like this
How to use jing
1. 1. Use Jing
2. 2. http://screencast.com/t/SVnPUziK1D
3. 3. http://screencast.com/t/08viK6OKMb
4. 4. E n j o y !
×
|
__label__pos
| 0.983048 |
Table of Contents
Search
1. About the Security Guide
2. Introduction to Informatica Security
3. User Authentication
4. LDAP Security Domains
5. Kerberos Authentication
6. Domain Security
7. SAML Authentication for Informatica Web Applications
8. Security Management in Informatica Administrator
9. Users and Groups
10. Privileges and Roles
11. Permissions
12. Audit Reports
13. Command Line Privileges and Permissions
14. Custom Roles
15. Default List of Cipher Suites
Security Guide
Security Guide
Writing and Viewing User Activity Log Events
Writing and Viewing User Activity Log Events
You can write user activity log events to a file or display it in the command line when you use the infacmd isp getUserActivityLog command. Write the user activity log events to the format based on how you plan to use the exported log events file.
Writing and Viewing Log Files
To write the user activity log events to a file, run the command with the output file parameter -lo:
-lo output_file_name
If you do not specify an output format, the command writes the log events to a text file. For example, run the following command to write log events to a file named log.txt:
infacmd isp getUserActivityLog -dn TestDomain -un Administrator -pd Administrator -lo log.txt
To specify an output format, run the command with the format parameter -fm:
-fm output_format_BIN_TEXT_XML
Valid formats include:
• Bin (binary). Use binary format to back up the log events in binary format. You might need to use this format to send log events to Informatica Global Customer Support
• Text. Use text format if you want to analyze the log events in a text editor.
• XML. Use XML format if you want to analyze log events in an external tool that uses XML or if you want to use XML tools, such as XSLT.
If you specify text or XML as the output format, but you do not specify an output file, the command displays the text or XML log on the command line.
If you specify binary as the output format, you must provide an output file name.
For example, run the following command to print log events to a file named log.xml:
infacmd isp getUserActivityLog -dn TestDomain -un Administrator -pd Administrator -fm xml -lo log.xml
Converting Log Files
If you use the getUserActivity command to write log events to a binary file, you can convert the file to text or XML format.
Run the following command to convert a binary log you retrieved to text or XML format:
infacmd isp convertUserActivityLogFile -in BIN_input_file_name -fm output_format_TEXT_XML -lo output_file_name
For example, run the following command to convert a binary input file named log.bin to XML format and output it to a file named convertedLog.xml:
infacmd isp convertUserActivityLogFile -in log.bin -fm XML -lo convertedLog.xml
To display the log on the command line, omit the output file name.
If you omit the format, the command uses the text format.
Updated October 10, 2019
Explore Informatica Network
|
__label__pos
| 0.994817 |
Ogilby’s Duiker
Ogilbys Duiker in the forest
Photo by: Julie Dewilde
Ogilby’s Duiker, also known as the, White-legged Duiker, Cephalophus ogilbyi, is a little known small antelope found in the southeastern end of Nigeria, distinguished among other duikers by its paler coloration and long legs with powerful hindquarters. It weighs up to 20 kg and has a shoulder height of up to 56 cm. Head and body length is between 85- 115 cm. The animal’s stocky body and arched back allows it to move easily through dense undergrowth. This diurnal duiker is likely to be found either alone or in pairs, just like other diver antelopes. No Ogilby’s duikers are known to be kept in captivity.
The Ogilby’s Duiker is a trim orange to mahogany-colured duiker with chunky hindquarter and a bold black dorsal stripe that tapers to a point just above the tail. Body colour extends down relatively long, slender body. The horns which occur in both sexes are short but peculiarly incurved and heavily corrugated. Tail tuft is very large. Skull is with an extreme inflation of the forehead behind the frontal structure of the nose., making a protruded frontal boss which is reduced laterally. Species found in the island have more extreme frontal boss than the one in neighboring Nigeria.
The C. o. ogilbyi subspecies, which has its stripes continuing into the tail as a thin line, occurs on Bioko Island, and then on the mainland in southeast Nigeria. Population remains high in the Cross Rivers National Park. However, it is the only Nigerian forest antelope on the 1994 IUCN Red list. This species has been reduced to relict populations in the Niger-delta.
Contributor:
Tope Apoola
Profession: Writer
|
__label__pos
| 0.714443 |
Groovy app internationalization and localization
Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries.
Created by
James Strachan
Released
2003
Links
https://groovy-lang.org
Wikipedia
Groovy applications are usually translated these file formats
Related Platforms
Best way to localize Groovy apps
The first step is to extract the text to translate into language files. This process is called internationalization. The built-in libraries can be used to extract out the text to translate into Java Properties or Java XML files.
Once you have internationalized your Groovy app, use a translation software localization tool such as WebTranslateIt to manage your localization workflow.
It is easy to translate a Groovy app with WebTranslateIt. Create a project, upload your source language file in the File Manager and translate it on the Translation Interface.
The tools included in WebTranslateIt, such as Batch Operations, the Translation Memory or Machine Translation can help you translate that file automatically, faster and cost effectively.
Links of interest
Do you know an interesting library for that platform? Have you found an error? Let us know at [email protected]
|
__label__pos
| 0.948249 |
Menu Close
Author: Benjamin Clark
Exploring the Types of Plumbing Pipes Used In Homes: An Analysis of Pros and Cons
When it comes to plumbing in homes, not all pipes are created equal. Each type has its own unique characteristics, benefits, and drawbacks. It’s important to understand these differences when considering your options for a plumbing project or repair.
Copper Pipes
They are ideal for both hot and cold water supplies.
• Pros: Long-lasting, resistant to corrosion, can withstand high temperatures.
• Cons: Expensive, installation requires soldering.
Galvanized Steel Pipes
While not as common today, galvanized steel pipes were once popular in older homes. Made from steel coated with a layer of zinc, these pipes are known for being incredibly durable.
• Pros: Very strong.
• Cons: Can rust over time causing reduced water pressure, heavy in weight.
PEX (Cross-linked Polyethylene) Pipes
PEX is a flexible plastic piping that has become popular in modern homes due to its low cost and easy installation.
• Cons: Cannot be used outdoors because it degrades under UV light exposure.
• Pros: Lightweight and easy to work with.
• Cons: Not suitable for hot water supply as they can warp under heat.
They’re similar in many ways to PVC pipes but have a few key differences.
• Pros: Stronger than PVC; good for underground exterior use.
• Cons: Can deform under continuous hot water use; may not be allowed by code in some areas.
Understanding the pros and cons of each type of pipe can help you make informed decisions about which ones are best suited for your specific needs when planning a plumbing project or overhaul. The ideal pipe type depends on various factors such as the specific use case (water supply vs drainage), local building codes, temperature considerations (hot vs cold water), your budget constraints among others. Always consult with a professional plumber or contractor before making your final decision.
PEX, an acronym for cross-linked polyethylene, is one of the most commonly used types of pipes in residential plumbing. This material has gained popularity over traditional copper and PVC pipes due to its flexibility, cost-effectiveness, and ease of installation.
What Are PEX Pipes?
PEX pipes are made from a type of flexible plastic called cross-linked polyethylene. Unlike rigid pipe options, PEX tubing is flexible and can be routed around corners without the need for elbow fittings, reducing potential points for leaks.
PEX tubes come in different colors (usually white, red, or blue) which can be used to identify the purpose of the tubing; hot water lines, cold water lines or central heating pipes.
Advantages of PEX Plumbing Pipes
PEX plumbing pipes offer several significant benefits:
• Cost-effective: PEX is generally less expensive than copper or metal plumbing alternatives.
• Easy to install: Due to its flexibility, PEX can be installed quickly and with fewer connections and fittings.
• Resistant to scale build-up: Unlike copper piping which has a high potential for mineral build-up, PEX resists scale build-up which can increase the lifespan of your plumbing system.
• low thermal conductivity: It means that hot water lines will lose less heat and cold water lines will accumulate less condensation.
Disadvantages of PEX Plumbing Pipes
While having many advantages, there are some disadvantages associated with PEX plumbing pipes:
• Vulnerability to UV light: Exposure to sunlight can degrade the material over time. Hence it’s not an ideal option for outdoor use.
• Potential chemical leakage: Some studies have suggested that certain types of PEX could leach chemicals into the water supply.
• Limited recyclability: Unlike copper and other metals which are highly recyclable, recycling options for PEX are relatively few.
How to Install PEX Plumbing Pipes
Installing PEX plumbing pipes is fairly straightforward, particularly when compared to the process for installing copper or PVC pipes.
1. Measure and Cut: After determining the length of pipe you need, cut the PEX tubing with a special PEX cutter.
2. Slide on the Ring: Slide a PEX crimp ring over the end of the pipe.
3. Insert Fitting: Insert a fitting, either metal or plastic into the end of a tube.
4. Crimp It: Make sure your crimp ring is around 1/8″-1/4″ from the end of the tubing to ensure it’s in position and then use your PEX crimp tool to squeeze the ring until it secures both the pipe and fitting together.
5. Check Your Work: Once you’ve completed your connections, use a go/no-go gauge to confirm that they’re correctly made.
The versatility and user-friendly nature of PEX make it an attractive choice for homeowners and professionals alike. However, like any material, it’s important to understand its advantages and limitations before making a decision on your home’s plumbing system.
In contemporary residential and commercial buildings, Cross-Linked Polyethylene (PEX) has become a common choice for plumbing systems. But like any other material, PEX has its advantages and disadvantages which we shall unravel in this section.
Advantages of Using PEX Pipe in Plumbing Systems
One of the most significant benefits of PEX pipes is their flexibility. Unlike their rigid counterparts, such as copper or PVC pipes, PEX pipes can curve around corners without the need for elbow fittings. This unique property lets plumbers install them with relative ease which reduces installation time and labor costs as well.
PEX pipes have a high resistance to cold temperatures, decreasing their likelihood to freeze or burst compared to traditional metal pipes when exposed to low temperatures.
Compared with copper and other materials, PEX is generally less expensive. Costs associated with installation are also reduced owing to its flexibility and lightweight nature which makes it easier to handle.
Due to their flexible properties, PEX pipes tend not to make as much noise as rigid piping when hot water runs through them.
Disadvantages of Using PEX Pipe in Plumbing Systems
However, the use of PEX pipe also comes with a few drawbacks that should be considered before making a decision.
Direct exposure to sunlight can degrade the material properties of PEX pipe rapidly. Hence they are not suitable for outdoor plumbing systems where direct sunlight exposure is inevitable.
Another disadvantage is that once installed, it’s nearly impossible to recycle used or waste PEX pipe due to its cross-linked nature unlike other materials like copper or PVC which can be recycled extensively.
PEX is vulnerable to certain chemicals including petroleum products and oxygen which can result in degradation or permeation, respectively.
In summary, PEX has emerged as a popular choice for plumbing systems primarily due to its flexibility, cost-effectiveness, resistance to freezing, and quiet operation. At the same time, its drawbacks include vulnerability to sunlight and certain chemicals, along with issues related to recycling. It is vital for homeowners and contractors to weigh these pros and cons before deciding on whether PEX pipe is the most suitable choice for their specific plumbing project needs.
Polyvinyl Chloride, more commonly known as PVC, is a widely used material in the plumbing industry. Being one of the most versatile types of plastic, it has found extensive utilization in various applications. This article aims to delve into the primary function of PVC pipes in plumbing, along with their benefits and potential limitations.
Hiring a Plumber in Beaver Falls PA for Your PVC Pipe Issues
PVC pipes are primarily utilized for transporting water from one place to another. They are often found in residential homes and commercial buildings for supplying drinking water and as sewage lines. The inherent characteristics of PVC such as its resistance to environmental degradation and corrosion make it suitable for this purpose.
Exploring the Advantages of Plumbing in Beaver Falls PA
Tru Plumbing & Excavating
+17242515430
Snakes R Us Drain Service
724-630-3376
Evans Electric Drain Services
2909 12th Ave, Beaver Falls, PA 15010, United States
724-843-6340
There are several benefits associated with the use of PVC pipes in plumbing systems.
• Durability:PVC pipes have an impressive lifespan because they resist rusting and corrosion, unlike other materials such as copper or steel.
• Cost-effectiveness:Compared to other pipe materials like copper or stainless steel, PVC is significantly cheaper while maintaining an acceptable level of quality.
• Easy Installation:The lightweight nature of PVC makes it easier to transport and install compared to metal pipes.
• Low Maintenance:The durability and resistance that PVC has against damage equate to less need for repairs or replacements.
Discovering the Best Plumbers in Beaver Falls PA
Despite their numerous advantages, there are also limitations associated with using PVC pipes in plumbing systems:
• Temperature Sensitivity:One major drawback is their sensitivity to temperature. They can warp or bend when exposed to high temperatures which limit their use in hot water supply lines.
• Environmental Concerns:The production process of PVC releases harmful toxins that contribute to environmental pollution. Furthermore, they aren’t easily recyclable compared with metals.
Choosing the Best Beaver Falls PA Plumber: Advantages and Drawbacks Explained
Given these factors, it becomes evident that PVC pipes have their own set of strengths and weaknesses. On one hand, they provide a cost-effective, durable, and low maintenance solution for water transportation. On the other hand, their susceptibility to high temperatures and the environmental concerns tied to their production process present some challenges.
Homeowners and contractors should carefully consider these factors when deciding on the type of plumbing pipe to use. As with any material choice in construction or renovation projects, the ideal option depends on a multitude of factors including budget, local climate conditions, and specific use case scenarios.
By understanding the function, benefits, and limitations of PVC plumbing pipes, we can make more informed decisions when it comes to our home’s plumbing system. Consequently, this understanding may lead to better home maintenance practices and potentially significant savings.
Understanding Plumbing Services in Beaver Falls, PA
Widely used for residential and commercial purposes, these pipes have become a staple in many contemporary plumbing systems.
Characteristics of ABS Plastic Plumbing Pipes
Before delving into the role of ABS pipes in modern plumbing infrastructure, it’s essential to understand its distinctive characteristics:
• Durability: ABS pipes are extremely robust and resistant to physical impact. They can withstand high-pressure flow, making them ideal for both potable water supply and wastewater drainage.
• Temperature Resistance: These pipes can endure extreme temperature fluctuations without any deformation or loss of function.
• Chemical Resistance: ABS plastic is non-reactive with most chemicals, preventing pipe corrosion and ensuring a longer lifespan.
• Lightweight: Comparatively lighter than metal pipes, ABS pipes are easy to handle during installation.
Role of ABS Plastic Plumbing Pipes in Modern Infrastructure
The decisive role that ABS plastic plumbing pipes play in today’s construction world cannot be downplayed:
1. Residential Plumbing Systems:In residential setups, ABS plastic plumbing pipes are extensively used for drainage, waste, and vent (DWV) systems. These systems require robust materials that can withstand the harsh conditions typically associated with waste disposal operations.
2. Commercial Infrastructure:In commercial settings such as office complexes or shopping malls, these pipes are used not just for DWV systems but also in HVAC systems. Their lightweight nature makes them easier to install on a large scale.
3. Industrial Use:Industries that deal with corrosive substances often opt for ABS plastic plumbing due to its chemical resistance.
4. Agricultural Applications:
Advantages & Limitations of Using ABS Plastic Plumbing Pipes
Before opting for any material in construction infrastructure, it’s crucial to balance out its advantages against its limitations:
Advantages Highly durable with an excellent lifespan. Resistant to chemicals hence less prone to corrosion. Lightweight hence easier installation process No need for protective layers against rusting or galvanic corrosion.
Limitations Sunlight exposure can degrade the quality of these plastic pipes over time. Not suitable for hot water supply as they may warp over time under high temperatures * While resistant to many chemicals, certain specialized industrial chemicals may cause damage.
To summarize, the role of ABS plastic plumbing pipes in modern infrastructure is significant owing to their durability and versatility. However, while choosing them as your preferred plumbing material consider both their pros and cons for optimal usage.
Understanding Plumbing in Beaver Falls PA: Different Materials Used in Water Supply Pipes
Water supply pipes are integral to any building’s plumbing system. They serve as the main conduits through which water is delivered from the source to various outlets in a building. Over the decades, various materials have been used to manufacture water supply pipes, each with its specific features, advantages, and disadvantages.
Copper Pipes
Copper is one of the most traditional materials used for water supply pipes. This metal is durable, resistant to corrosion and can withstand high temperatures. Additionally, copper pipes are also known for their long service life and excellent thermal conductivity.
Pros: – High resistance to heat – Long service life – Excellent thermal conductivity
Cons: – More expensive than most other materials – Requires professional installation
Galvanized Steel Pipes
Galvanized steel pipes were popular in homes built before 1960. Despite being strong and durable, these pipes have been known to suffer from eventual rust and corrosion leading to reduced water quality and flow.
Pros: – Strong and durable – Affordable
Cons: – Tendency to rust over time – Affects water quality negatively when corroded
Lead Pipes
Historically, lead was used widely due to its malleability making it easy to install. However, due to the health risks associated with lead consumption, lead pipes have mostly been phased out of residential applications.
Pros: – Highly malleable – Durable
Cons: – Health risks associated with lead consumption – Not suitable for drinking water supply
Polyvinyl Chloride (PVC) Pipes
PVC is a widely used material in modern plumbing systems. These types of pipes are known for their flexibility and resistance against breaks or leaks making them ideal for main water lines.
Pros: – Highly resistant against breaks or leaks – Flexible
Cons: – Can warp when exposed to hot water – Not suitable for interior applications due its sensitivity towards UV rays
Chlorinated Polyvinyl Chloride (CPVC) Pipes
CPVC is similar to PVC but has undergone additional chlorination processes that make it more resistant against heat, making it suitable for hot water supply lines.
Pros: – Heat resistant – Does not warp under exposure to hot water
Cons: – Slightly more expensive than PVC – More brittle than PVC
PEX piping has become a popular choice in modern residential plumbing systems due to its flexibility, durability and affordability.
Pros: – Easy installation due its flexibility – Resistant against corrosion & scale build-up
Cons: – Cannot be directly exposed sunlight as UV rays can damage the material – May not be compatible with older plumbing systems
In selecting materials for your plumbing system’s supply lines, consider factors such as durability, cost-effectiveness, compatibility with existing systems and specific requirements like heat resistance or flexibility. Remember that a professional plumber can provide helpful advice based on their expertise and experience.
Galvanized steel is one of the many materials utilized in plumbing systems. This type of steel has been treated with a protective layer of zinc to help resist corrosion and rust. It has been widely used for water supply systems, particularly in older homes and commercial buildings. However, it presents both pros and cons that homeowners and contractors should know before deciding on using it.
Benefits of Galvanized Steel Pipes
Galvanized steel pipes have several advantages that make them an attractive choice for certain plumbing applications:
• Durability: The primary advantage of galvanized pipes is their durability. They are designed to resist rust and corrosion, enhancing their lifespan compared to other types of pipes.
• Cost-efficiency: While the upfront cost is more than PVC pipes, galvanized steel pipes could be a more cost-efficient choice in the long run due to their durability.
• High strength: These pipes can withstand high water pressure levels, making them suitable for main water lines.
• Wide availability: Galvanized steel pipes are readily available in most hardware stores and plumbing supply shops.
Drawbacks of Galvanized Steel Pipes
While they offer several benefits, galvanized steel pipes also come with some potential drawbacks:
• Corrosion over time: Despite the anti-corrosive layer, these pipes can still corrode over time from within due to constant exposure to water. This could lead to restricted water flow or leaks.
• Lead contamination: Older galvanized steel pipes may have been constructed with an inner layer containing lead, posing potential health hazards if this contaminates drinking water supplies.
• Difficulty in replacement: Replacing corroded galvanized steel can be challenging as it requires specialized tools and expertise. It can also be costly if large sections need replacement.
To summarize the information above:
Pros of Galvanized Steel Cons of Galvanzied Steel
Durability Corrosion over time
Cost-efficiency Lead contamination
High strength Difficulty in replacement
Wide availability
Deciding on whether to use galvanized steel pipes depends on the specific needs and circumstances of each project. It is recommended to consult a plumbing professional to discuss the best option for your plumbing system.
Polyvinyl chloride, commonly known as PVC, plays an integral role in the realm of modern plumbing systems. It is a type of plastic that is widely used for producing pipes and fittings due to its high level of durability, cost-effectiveness, and easy installation process.
Characteristics of PVC
Several characteristics make PVC a preferred material in the plumbing sector:
• Durability: PVC pipes have an impressive lifespan, often exceeding 50 years. Furthermore, they are corrosion-resistant and can withstand harsh chemical substances.
• Cost-effectiveness: Compared to other materials like copper or iron, PVC pipes are significantly cheaper.
• Ease of Installation: These pipes are lightweight and easy to install. They can be joined using solvent cement rather than needing to be soldered or welded together.
Common Applications of PVC in Plumbing
PVC has found its place in various aspects of plumbing. Here’s where you’ll typically find it:
• Drain Lines: Because of their smooth interior surface that prevents blockages and build-up over time, PVC pipes are often used for drain lines.
• Irrigation Systems: Their resistance to sunlight degradation makes them ideal for outdoor applications like irrigation systems.
• Potable Water Supply Systems: Due to its non-toxic nature when not heated or burnt, PVC is also used for potable water supply systems.
Limitations of PVC
Despite having several advantages, there are some limitations associated with the use of PVC in plumbing systems:
• Temperature Sensitivity: PVC pipes can warp or melt under high temperatures and aren’t suitable for hot water lines.
• Environmental Impact: The production and disposal process of PVC can release harmful chemicals into the environment.
It’s beneficial to understand these pros and cons when considering different materials for your plumbing needs.
The Evolution of PVC Use
The use of PVC in modern plumbing has evolved significantly with time. In the past, due to concerns about potential health impact from chemicals leaching into drinking water supplies from these plastic pipes, their use was limited. However, over time studies have shown that when not exposed to extreme heat or burn conditions, these concerns largely diminish.
Plumbing codes now widely recognize it as a reliable pipe material which has boosted its acceptance among both professional plumbers and DIY enthusiasts alike. Today’s innovations include improvements such as cellular core construction that provides higher rigidity at lesser weights expanding their application reach further.
In summary, the prevalence of Polyvinyl Chloride (PVC) in current day plumbing systems speaks volumes about its beneficial properties despite certain limitations. It is expected that with continued research and innovation efforts will further enhance its performance parameters strengthening its role even more so within this industry.
Chlorinated Polyvinyl Chloride, commonly known by its abbreviation CPVC, is a popular material used in plumbing systems around the world. Developed in the 1950s, CPVC is a thermoplastic produced by chlorinating polyvinyl chloride (PVC) resin. Over the years, it has garnered substantial recognition for its performance and functionality.
Advantages of Using CPVC in Plumbing
CPVC offers a plethora of benefits that make it an ideal choice for plumbing applications. Here are some of the key advantages:
• Resistance to Corrosion and Scale Build-up: Unlike metal pipes which are prone to corrosion and scale build-up, CPVC pipes resist these detriments. This makes them more durable and increases their life span.
• Heat-Tolerance: CPVC can handle hot water applications due to its high heat resistance. It can withstand temperatures up to 200 degrees Fahrenheit, making it suitable for residential and commercial hot water supply.
• Ease of Installation: Being lightweight, CPVC pipes are easy to install. They require fewer tools as compared with traditional metal pipes and can be cut using basic equipment such as a hacksaw or PVC cutter.
• Cost-effective: In comparison with copper or other metal-based plumbing materials, CPVC is an economical choice as it requires less labor for installation and demands minimal maintenance over time.
Potential Limitations of Using CPVC in Plumbing
Despite many advantages, there are certain factors that could limit the use of CPVC in plumbing:
• Chemical Resistance: Although resistant to many chemicals, there are certain solvents and oils that can cause damage to these pipes over time.
• Brittleness: Over time under certain conditions like exposure to UV rays or extreme cold temperatures, these pipes can become brittle which may lead to cracks or breaks.
• Thermal Expansion: CPVC expands more than metallic pipe materials when exposed to heat which needs proper accounting during its installation process.
Applications of CPVC Pipes
CPVC is extensively used for both residential and commercial plumbing due to its aforementioned traits. Some common applications include:
1. Hot & Cold Water Distribution: Due to its high temperature handling capacity, it is used in hot water systems besides regular cold water distribution channels.
2. Industrial Liquid Handling: It’s often used in industries where corrosive liquids need transportation.
3. Fire Sprinkler Systems: They meet standards for fire sprinkler systems as they retain structural integrity even at elevated temperatures.
In summary, while considering material options for plumbing purposes one must take into account factors like cost-effectiveness, durability, ease-of-use and application-specific requirements. With an array of advantageous characteristics at hand such as corrosion-resistance, heat-tolerance etc., coupled with few manageable limitations like brittleness and thermal expansion; CPVC presents itself as a favourable contender especially when thinking about modern-day-plumbing needs.
Comprehensive Guide to Hiring a Plumber in Beaver Falls PA
PEX, or cross-linked polyethylene, is a versatile plumbing material that has gained considerable popularity in the industry due to its flexibility and durability. This guide aims to provide a comprehensive understanding of PEX’s application in plumbing.
Hiring Expert Plumbers in Beaver Falls PA
PEX is made from a high-density polyethylene (HDPE) that’s been cross-linked through one of three processes: peroxide, silane, or radiation. The cross-linking makes the material incredibly durable under extreme temperatures (both high and low), pressures, and pH levels.
Beaver Falls PA Plumber: Advantages of PEX Plumbing Services
There are several benefits to using PEX in plumbing systems:
• Ease of Installation: PEX is easier to install than copper and some other types of pipes due to its flexibility. It can curve around corners without needing elbow joints.
• Durability: PEX pipes resist scale buildup and don’t pit or corrode like copper pipes can. They also perform well under freezing conditions as they can expand and contract without cracking.
• Energy Efficiency: Due to their thermal resistance property, PEX pipes reduce heat loss in hot water lines and prevent condensation on cold ones.
• Cost-Effective: Compared to copper, installation costs for PEX are typically lower given fewer connections are required, which also shortens the time taken for installation.
Top Quality Plumbing Services in Beaver Falls, PA
PEX pipe has numerous applications within both commercial and residential plumbing:
1. Water Supply Lines: This is one of the most common uses for PEX due to its resistance against corrosion and bursting due to freezing.
2. Radiant Floor Heating Systems: The flexibility of this material makes it a good choice for radiant floor heating systems.
3. Snow Melting Applications: In colder climates where snow accumulation is common, it’s used in radiant heating systems designed for sidewalks, driveways, and other areas.
4. Refrigeration and Air Conditioning: For cooling systems, PEX provides an effective solution due to its inert nature that prevents it from reacting with refrigerant.
Limitations of PEX
While PEX has many benefits, it’s important to understand its limitations:
• Direct Sunlight Damage: Direct exposure to sunlight can degrade PEX over time, limiting its use in outdoor applications unless adequately protected.
• Cannot Be Recycled: Unlike some other plastics, PEX cannot be recycled due to the cross-linking process used in its production.
• Potential Chemical Leaching: While generally considered safe, there have been concerns about potential chemical leaching from the pipe into the water supply.
While PEX has become a popular choice for plumbing applications due to its flexibility, durability and cost-effectiveness, it is important to consider both its benefits and limitations when planning a project. As with any material choice in plumbing projects, professional advice is crucial for making informed decisions based on specific needs and conditions.
Discovering the Best Plumber in Beaver Falls PA: A Comprehensive Guide
Plumbing pipes are an integral part of any residential or commercial building. They provide a network for the flow of water and other fluids. With advancements in technology, a variety of plumbing pipes are now available, each with its own distinct advantages and disadvantages. This article will explore these differences in depth.
Plumbing Services in Beaver Falls PA
These are made from steel or iron, coated with a layer of zinc to prevent rusting. They were commonly used in homes built before 1980.
Advantages– Long-lasting. – Highly resistant to leaks due to joint strength.
Disadvantages– Prone to internal rust over time which can affect water quality. – Heavy and challenging to work with.
Plumbers in Beaver Falls PA Specializing in Copper Pipes
Advantages– Lightweight yet sturdy. – Highly resistant to corrosion.
Disadvantages– Expensive compared to other options. – Requires expert skill for installation as it involves soldering.
Your Go-To Beaver Falls PA Plumber
Polyvinyl Chloride (PVC) pipes, made from plastic, are often used for waste or drain lines although they can also be used for main water lines.
Advantages– Resistant to rust and corrosion. – Easy to work with due to lightness.
Disadvantages– Potentially contains harmful toxins that may leach into water supply over time if not handled properly.
Plumbing Services in Beaver Falls, PA
Cross-linked polyethylene (PEX) pipes are a versatile option commonly used in modern construction projects.
Advantages– Flexible, reducing need for fittings. – Easy installation process as it requires no glue or soldering.
Disadvantages– Cannot be used outdoors as it degrades when exposed to UV light. – May not be suitable for areas with highly chlorinated water.
ABS Pipes
Acrylonitrile butadiene styrene (ABS) pipes are a type of plastic pipe mostly used in residential drain, waste and vent pipes.
Advantages– Highly durable and strong. – Suitable for cold temperatures.
Disadvantages– Cannot withstand high temperatures. – Not allowed in some jurisdictions due to its brittle nature.
In the ever-evolving world of plumbing, each type of pipe has its unique place. It’s important to choose the optimal pipe based on specific project requirements and local regulations. By considering the advantages and disadvantages of different types of plumbing pipes, homeowners and professionals can make informed decisions that will optimize performance and longevity.
PEX piping, also known as cross-linked polyethylene piping, is a versatile plumbing material that has been extensively used in various applications due to its unique properties. This section will delve into the properties of PEX pipes and how they contribute to its wide range of applications in plumbing.
Properties of PEX Pipes
PEX pipes have a range of unique properties that make them a favored choice for many plumbing applications:
• Flexibility: One of the most significant properties of PEX piping is its flexibility. Unlike rigid pipes made from materials such as copper or PVC, PEX pipes can bend around corners and snake through walls without the need for elbow joints, reducing installation time and costs.
• Durability: The durability of PEX pipes is another appealing factor. These pipes can withstand freezing temperatures better than copper or PVC, reducing concerns about pipe bursts during cold weather.
• Resistance to Scale Build-Up: Unlike copper and steel, PEX doesn’t corrode or develop scale build-up, ensuring smooth water flow.
• Heat Retention: Another beneficial property is heat retention.
Applications of PEX Pipes in Plumbing
Given these advantageous properties, the use-cases for PEX piping are vast:
• Residential Plumbing: Due to its flexibility and ease-of-use, PEX is commonly used for home plumbing networks. It’s especially beneficial when retrofitting older homes where maneuverability can be challenging.
• Radiant Floor Heating Systems
• Water Service Lines: Given their resistance to freeze-breakage and corrosion, these are ideal for water service lines exposed to various elements outside homes or commercial buildings.
• Fire Sprinkler Systems
PEX piping’s characteristics and the benefits they bring make it an attractive choice for various plumbing applications. However, as with all materials, it’s important to consider the specific requirements of each plumbing project before selecting the most suitable type of pipe. Factors such as local building codes, climate conditions, or the water’s chemical composition can all influence the choice of piping material. Despite its benefits, keep in mind that PEX pipes aren’t suited for outdoor usage due to UV sensitivity and aren’t recyclable, which might be a consideration for environmentally concerned homeowners.
Its flexibility, durability, heat resistance and cost-effectiveness make it an excellent alternative to more traditional materials like copper or PVC. This section delves into the properties of PEX piping and its numerous applications in plumbing.
Properties of PEX Piping
PEX pipes are known for their unique properties that make them stand out from other piping materials:
• Flexibility:The flexibility of PEX pipes reduces the need for fittings and allows the pipes to bend around corners without breaking.
• Durability:Unlike other materials, PEX is resistant to scale build-up, chlorine and pitting.
• Heat Resistance:
• Color-Coding:
• Cost-effectiveness:
Applications of PEX Pipes in Plumbing
The properties mentioned above give PEX pipes a wide range of applications:
1. Residential Plumbing Systems:Their flexibility makes them ideal for use in tight spaces within homes.
2. Commercial Plumbing Systems:
3. Retrofitting Older Pipes:
4. Outdoor Applications:
When considering a material for your plumbing system – whether it’s residential or commercial – understanding all aspects is vital. However, each situation demands a careful evaluation of all options before making a decision as there might be local codes that govern the type of material used or certain situations where another type might perform better.
Polyvinyl Chloride, commonly known as PVC, is a type of plastic that has been used extensively in the modern plumbing industry. The versatility, durability, and affordability of PVC piping make it a popular choice for residential, commercial, and industrial applications.
The Uses of PVC Piping
PVC piping is used in a wide range of plumbing tasks.
The Advantages of PVC Piping
PVCpipes have multiple benefits that contribute to their widespread use in the modern plumbing industry:
• Corrosion resistance:Unlike metal pipes, PVC pipes are resistant to corrosion from both inside and outside. This quality extends their lifespan significantly.
• Cost-effectiveness:Compared to other materials such as copper or iron, PVC is relatively cheaper. This affordability makes it an excellent option for large-scale projects.
• Ease of installation:Lightweight but sturdy, these pipes can be easily installed with minimal labor power.
• Chemical resistance:They can withstand exposure to various chemicals making them suitable for industrial use.
Potential Drawbacks of PVC Piping
Despite its distinct advantages, it’s also crucial to acknowledge some potential drawbacks associated with these materials:
• Temperature limitations:One significant drawback is its inability to withstand high temperatures.
• Environmental concerns:Disposal can be challenging since they’re non-biodegradable and can potentially release toxic chemicals when burned.
• Brittleness:They can become brittle over time, especially when exposed to sunlight for prolonged periods.
Comparing PVC with Other Plumbing Pipes
When compared to other plumbing pipes like PEX or copper, PVC has its own distinct advantages and disadvantages. For instance, while PEX is more flexible and ideal for tight spaces, PVC stands out with its resistance to corrosion.
Pipe Type Advantages Disadvantages
PVC Corrosion resistance, cost-effective Temperature limitations
PEX Flexibility, heat resistance Not suitable for outdoor use
Copper Durability, heat resistance Costly
From this discussion, it’s evident that although PVC piping has some limitations, its benefits make it a popular choice in many plumbing applications. Therefore it’s essential to consider all factors before deciding on the best plumbing pipe for any given purpose.
Copper pipes have been utilized in the plumbing industry for many years, owing to their superior qualities. Their durability, reliability, and versatility make them one of the top choices for both residential and commercial plumbing. This article will dissect the role of copper piping in the plumbing industry, with a special comparison focus on rigid and soft copper pipes.
Copper Pipes: An Overview
This material has excellent resistance against corrosion, providing long-term performance with minimal maintenance.
Rigid Copper Pipes
They are known for their strength and durability, being able to withstand high pressure over a long period.
• High carrying capacity due to thick walls
• Suitable for underground installation
• Resistant to damage from sunlight or direct heat
• Can be resized or reshaped without compromising integrity
Soft Copper Pipes
It’s important to note that while they’re more malleable than rigid ones, they possess similar corrosion-resistance qualities.
Advantages of Using Copper Piping
Copper piping brings many advantages that make them an attractive choice in various applications:
1. Durability
2. Corrosion Resistance
3. Heat Tolerance
4. Pressure Tolerance
Disadvantages of Using Copper Piping
Despite its benefits, there are a few downsides to using copper piping:
1. Cost: Copper is more expensive than other materials like PVC or PEX.
2. Difficulty in Installation: Due to their rigidity, copper pipes often require professional installation.
Despite these drawbacks, the long-term benefits of copper often outweigh the initial higher cost and installation complexity.
|
__label__pos
| 0.965832 |
AWSSDK を使用して Amazon Polly の音声合成タスクを開始する - AWSSDK コードサンプル
AWSDocAWS SDKGitHub サンプルリポジトリには、さらに多くの SDK サンプルがあります
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
AWSSDK を使用して Amazon Polly の音声合成タスクを開始する
次のコード例は、Amazon Polly 音声合成タスクを開始する方法を示しています。
Python
SDK for Python (Boto3)
注記
他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。
class PollyWrapper: """Encapsulates Amazon Polly functions.""" def __init__(self, polly_client, s3_resource): """ :param polly_client: A Boto3 Amazon Polly client. :param s3_resource: A Boto3 Amazon Simple Storage Service (Amazon S3) resource. """ self.polly_client = polly_client self.s3_resource = s3_resource self.voice_metadata = None def do_synthesis_task( self, text, engine, voice, audio_format, s3_bucket, lang_code=None, include_visemes=False, wait_callback=None): """ Start an asynchronous task to synthesize speech or speech marks, wait for the task to complete, retrieve the output from Amazon S3, and return the data. An asynchronous task is required when the text is too long for near-real time synthesis. :param text: The text to synthesize. :param engine: The kind of engine used. Can be standard or neural. :param voice: The ID of the voice to use. :param audio_format: The audio format to return for synthesized speech. When speech marks are synthesized, the output format is JSON. :param s3_bucket: The name of an existing Amazon S3 bucket that you have write access to. Synthesis output is written to this bucket. :param lang_code: The language code of the voice to use. This has an effect only when a bilingual voice is selected. :param include_visemes: When True, a second request is made to Amazon Polly to synthesize a list of visemes, using the specified text and voice. A viseme represents the visual position of the face and mouth when saying part of a word. :param wait_callback: A callback function that is called periodically during task processing, to give the caller an opportunity to take action, such as to display status. :return: The audio stream that contains the synthesized speech and a list of visemes that are associated with the speech audio. """ try: kwargs = { 'Engine': engine, 'OutputFormat': audio_format, 'OutputS3BucketName': s3_bucket, 'Text': text, 'VoiceId': voice} if lang_code is not None: kwargs['LanguageCode'] = lang_code response = self.polly_client.start_speech_synthesis_task(**kwargs) speech_task = response['SynthesisTask'] logger.info("Started speech synthesis task %s.", speech_task['TaskId']) viseme_task = None if include_visemes: kwargs['OutputFormat'] = 'json' kwargs['SpeechMarkTypes'] = ['viseme'] response = self.polly_client.start_speech_synthesis_task(**kwargs) viseme_task = response['SynthesisTask'] logger.info("Started viseme synthesis task %s.", viseme_task['TaskId']) except ClientError: logger.exception("Couldn't start synthesis task.") raise else: bucket = self.s3_resource.Bucket(s3_bucket) audio_stream = self._wait_for_task( 10, speech_task['TaskId'], 'speech', wait_callback, bucket) visemes = None if include_visemes: viseme_data = self._wait_for_task( 10, viseme_task['TaskId'], 'viseme', wait_callback, bucket) visemes = [json.loads(v) for v in viseme_data.read().decode().split() if v] return audio_stream, visemes
• API の詳細については、「AWSSDK for Python (Boto3) API リファレンス」のを参照してくださいStartSpeechSynthesisTask
|
__label__pos
| 0.9682 |
CNCSimulator Pro
user guide
×
Menu
Index
11.2. Variables
A variable is like a box that you can put numbers in. The box has a name that cannot be changed once given. The inside of the box, the value of the variable, can be changed though.
A variable is named using a hash sign (#) followed by a number.
This is a variable:
#100
If we want to assign a value to the variable (put a number in the box) we write like this:
#100=12.5
From now on, we can use the variable instead of a fixed number in our CNC program.
Like this:
G00 X50 Y#100
Besides numbers, a variable can also be NULL. It means it has not got a value assigned to it. NULL and 0 is not the same thing.
There are different ranges of variables.
Variable range
Type
Function
#0
NULL
#0 is read-only and cannot be given another value than NULL. It is used to set other variables to NULL or to compare variables.
#1 - #33
Local variables
These are used to pass arguments to macros and are local to the macro only.
#100 - #199
Common variables
These are common variables that are shared between macros and main programs. They will be cleared to NULL when a new program starts or when you exit the simulator.
#500 - #999
Common permanent variables
These variables are remembered between runs and even when you exit the simulator.
#300 - #399
Simulator specific reserved range
In this range, which is not used by the Fanuc controller, we store some system values specific to the simulator.
#1000 - #9999
System variables
These variables contain information from the CNC controller or in this case, the simulator. We have made them empty so users can assign simulator values to any numbers for maximal flexibility. On a Fanuc controller, they are fixed.
In your programs, you typically use the common variables. Only use the local ones when you fully understand their behavior. For example, how they change when using nested macros. Be very careful with system variables if you are going to run the program on a real machine, as they can change things in the CNC controller in unexpected ways. In the simulator, you normally use these to read values like the current position, feed and tools for example.
|
__label__pos
| 0.999842 |
README.md
# Cldr for Units

[](https://hex.pm/packages/ex_cldr_units)
[](https://hex.pm/packages/ex_cldr_units)
[](https://hex.pm/packages/ex_cldr_units)
## Installation
Note that `:ex_cldr_units` requires Elixir 1.6 or later.
Add `ex_cldr_units` as a dependency to your `mix` project:
defp deps do
[
{:ex_cldr_units, "~> 3.0"}
]
end
then retrieve `ex_cldr_units` from [hex](https://hex.pm/packages/ex_cldr_units):
mix deps.get
mix deps.compile
## Getting Started
`ex_cldr_units` is an add-on library for [ex_cldr](https://hex.pm/packages/ex_cldr) that provides localisation and formatting for units such as weights, lengths, areas, volumes and so on. It also provides unit conversion and simple arithmetic for compatible units.
### Configuration
From [ex_cldr](https://hex.pm/packages/ex_cldr) version 2.0, a backend module must be defined into which the public API and the [CLDR](https://cldr.unicode.org) data is compiled. See the [ex_cldr documentation](https://hexdocs.pm/ex_cldr/readme.html) for further information on configuration.
In the following examples we assume the presence of a module called `MyApp.Cldr` defined as:
```elixir
defmodule MyApp.Cldr do
use Cldr,
locales: ["en", "fr"],
default_locale: "en",
providers: [Cldr.Number, Cldr.Unit, Cldr.List]
end
```
### Supporting the String.Chars protocol
The `String.Chars` protocol underpins `Kernel.to_string/1` and is also used in string interpolation such as `#{my_unit}`. In order for this to be supported by `Cldr.Unit`, a default backend module must be configured in `config.exs`. For example:
```
config :ex_cldr_units,
default_backend: MyApp.Cldr
```
## Public API
The primary api is defined by three functions:
* `MyApp.Cldr.Unit.to_string/2` for formatting units
* `MyApp.Cldr.Unit.new/2` to create a new `Unit.t` struct that encapsulated a unit and a value that can be used for arithmetic, comparison and conversion
* `MyApp.Cldr.Unit.convert/2` to convert one compatible unit to another
* `MyApp.Cldr.Unit.localize/3` to localize a unit by converting it to units customary for a given territory
* `MyApp.Cldr.Unit.add/2`, `MyApp.Cldr.Unit.sub/2`, `MyApp.Cldr.Unit.mult/2`, `MyApp.Cldr.Unit.div/2` provide basic arithmetic operations on compatible `Unit.t` structs.
### Creating a new unit
A `Cldr.Unit.t()` struct is created with the `Cldr.Unit.new/2` function. The two parameters are a unit name and a number (expressed as a `float`, `integer`, `Decimal` or `Ratio`) in either order.
Naming units is quite flexible combining:
* One or more base unit names. These are the names returned from `Cldr.Unit.known_units/0`
* An optional SI prefix (from `yokto` to `yotta`)
* An optional power prefix of `square` or `cubic`
Names can be expressed as strings with any of `-`, `_` or ` ` as separators between words.
Some examples:
```elixir
iex> Cldr.Unit.new :meter, 1
{:ok, #Cldr.Unit<:meter, 1>}
iex> Cldr.Unit.new "square meter", 1
{:ok, #Cldr.Unit<:square_meter, 1>}
iex> Cldr.Unit.new "square liter", 1
{:ok, #Cldr.Unit<"square_liter", 1>}
iex> Cldr.Unit.new "square yottaliter", 1
{:ok, #Cldr.Unit<"square_yottaliter", 1>}
iex> Cldr.Unit.new "cubic light year", 1
{:ok, #Cldr.Unit<"cubic_light_year", 1>}
iex> Cldr.Unit.new "squre meter", 1
{:error,
{Cldr.UnknownUnitError, "Unknown unit was detected at \"squre_meter\""}}
```
You will note that the unit make not make logical sense (`cubic light-year`?) but they do make mathematical sense.
Units can also be described as the product of one or more base units. For example:
```elixir
iex> Cldr.Unit.new "liter ampere", 1
{:ok, #Cldr.Unit<"ampere_liter", 1>}
iex> Cldr.Unit.new "mile lux", 1
{:ok, #Cldr.Unit<"mile_lux", 1>}
```
Again, this may not have a logical meaning but they do have an arithmetic meaning and they can be formatted as strings:
```elixir
iex> Cldr.Unit.new!("liter ampere", 1) |> Cldr.Unit.to_string
{:ok, "1 ampere⋅litre"}
iex> Cldr.Unit.new!("mile lux", 3) |> Cldr.Unit.to_string
{:ok, "3 miles⋅lux"}
```
Lastly, there are units formed by division where are called "per" units. For example:
```elixir
iex> Cldr.Unit.new "mile per hour", 1
{:ok, #Cldr.Unit<:mile_per_hour, 1>}
iex> Cldr.Unit.new "liter per second", 1
{:ok, #Cldr.Unit<"liter_per_second", 1>}
iex> Cldr.Unit.new "cubic gigalux per inch", 1
{:ok, #Cldr.Unit<"cubic_gigalux_per_inch", 1>}
```
### Unit formatting and localization
`MyApp.Cldr.Unit.to_string/2` provides localized unit formatting. It supports two arguments:
* `number` is any number (integer, float or Decimal) or a `Unit.t` struct returned by `Cldr.Unit.new/2`
* `options` which are:
* `:unit` is any unit returned by `Cldr.Unit.known_units/0`. This option is required unless a `Unit.t` is passed as the first argument.
* `:locale` is any configured locale. See `Cldr.known_locale_names/0`. The default
is `locale: Cldr.get_current_locale()`
* `:style` is one of those returned by `Cldr.Unit.available_styles`.
The current styles are `:long`, `:short` and `:narrow`. The default is `style: :long`
* Any other options are passed to `Cldr.Number.to_string/2` which is used to format the `number`
```elixir
iex> MyApp.Cldr.Unit.to_string 123, unit: :gallon
{:ok, "123 gallons"}
iex> MyApp.Cldr.Unit.to_string 1234, unit: :gallon, format: :long
{:ok, "1 thousand gallons"}
iex> MyApp.Cldr.Unit.to_string 1234, unit: :gallon, format: :short
{:ok, "1K gallons"}
iex> MyApp.Cldr.Unit.to_string 1234, unit: :megahertz
{:ok, "1,234 megahertz"}
iex> MyApp.Cldr.Unit.to_string 1234, unit: :foot, locale: "fr"
{:ok, "1 234 pieds"}
iex> MyApp.Cldr.Unit.to_string Cldr.Unit.new(:ampere, 42), locale: "fr"
{:ok, "42 ampères"}
iex> Cldr.Unit.to_string 1234, MyApp.Cldr, unit: "foot_per_second", style: :narrow, per: :second
{:ok, "1,234′/s"}
iex> Cldr.Unit.to_string 1234, MyApp.Cldr, unit: "foot_per_second"
{:ok, "1,234 feet per second"}
```
### Unit decomposition
Sometimes its a requirement to decompose a unit into one or more subunits. For example, if someone is 6.3 feet heigh we would normally say "6 feet, 4 inches". This can be achieved with `Cldr.Unit.decompose/2`. Using our example:
```elixir
iex> height = Cldr.Unit.new(:foot, 6.3)
#Cldr.Unit<:foot, 6.3>
iex(2)> Cldr.Unit.decompose height, [:foot, :inch]
[#Cldr.Unit<:foot, 6.0>, #Cldr.Unit<:inch, 4.0>]
```
A localised string representing this decomposition can also be produced. `Cldr.Unit.to_string/3` will process a unit list, using the function `Cldr.List.to_string/2` to perform the list combination. Again using the example:
```elixir
iex> c = Cldr.Unit.decompose height, [:foot, :inch]
[#Cldr.Unit<:foot, 6.0>, #Cldr.Unit<:inch, 4.0>]
iex> Cldr.Unit.to_string c, MyApp.Cldr
"6 feet and 4 inches"
iex> Cldr.Unit.to_string c, MyApp.Cldr, list_options: [format: :unit_short]
"6 feet, 4 inches"
# And of course full localisation is supported
iex> Cldr.Unit.to_string c, MyApp.Cldr, locale: "fr"
"6 pieds et 4 pouces"
```
### Converting Units
`t:Unit` structs can be converted to other compatible units. For example, `feet` can be converted to `meters` since they are both of the `length` unit type.
```elixir
# Test for unit compatibility
iex> Cldr.Unit.compatible? :foot, :meter
true
iex> Cldr.Unit.compatible? :foot, :liter
false
# Convert a unit
iex> Cldr.Unit.convert Cldr.Unit.new!(:foot, 3), :meter
{:ok, #Cldr.Unit<:meter, 16472365997070327 <|> 18014398509481984>}
```
### Localising units for a give locale or territory
Differnent locales or territories use different measurement systems and sometimes different measurement scales that also vary based upon usage. For example, in the US a person's height is considered in `inches` up to a certain point and `feet and inches` after that. For distances when driving, the length is considered in `yards` for certain distances and `miles` after that. For most other countries the same quantity would be expressed in `centimeters` or `meters` or `kilometers`.
`ex_cldr_units` makes it easy to take a unit and convert it to the units appropriate for a given locale and usage.
Consider this example:
```elixir
iex> height = Cldr.Unit.new!(1.81, :meter)
#Cldr.Unit<:meter, 1.81>
iex> us_height = Cldr.Unit.localize height, usage: :person_height, territory: :US
[#Cldr.Unit<:foot, 5>,
#Cldr.Unit<:inch, 1545635392113553812 <|> 137269716642252725>]
iex> Cldr.Unit.to_string us_height
{:ok, "5 feet and 11.26 inches"}
```
Note that conversion is dependent on context. The context above is `:person_height` reflecting that we are referring to the height of a person. For units of `length` category, the other contexts available are `:rainfall`, `:snowfall`, `:vehicle`, `:visibility` and `:road`. Using the above example with the context of `:rainfall` we see
```elixir
iex> length = Cldr.Unit.localize height, usage: :rainfall, territory: :US
[#Cldr.Unit<:inch, 9781818390648717312 <|> 137269716642252725>]
iex> Cldr.Unit.to_string length
{:ok, "71.26 inches"}
```
See `Cldr.Unit.preferred_units/3` to see what mappings are available, in particular what context usage is supported for conversion.
### Unit arithmetic
Basic arithmetic is provided by `Cldr.Unit.add/2`, `Cldr.Unit.sub/2`, `Cldr.Unit.mult/2`, `Cldr.Unit.div/2` as well as `Cldr.Unit.round/3`
```elixir
iex> Cldr.Unit.Math.add Cldr.Unit.new!(:foot, 1), Cldr.Unit.new!(:foot, 1)
#Cldr.Unit<:foot, 2>
iex> Cldr.Unit.Math.add Cldr.Unit.new!(:foot, 1), Cldr.Unit.new!(:mile, 1)
#Cldr.Unit<:foot, 5280.945925937846>
iex> Cldr.Unit.Math.add Cldr.Unit.new!(:foot, 1), Cldr.Unit.new!(:gallon, 1)
{:error, {Cldr.Unit.IncompatibleUnitError,
"Operations can only be performed between units of the same type. Received #Cldr.Unit<:foot, 1> and #Cldr.Unit<:gallon, 1>"}}
iex> Cldr.Unit.round Cldr.Unit.new(:yard, 1031.61), 1
#Cldr.Unit<:yard, 1031.6>
iex> Cldr.Unit.round Cldr.Unit.new(:yard, 1031.61), 1, :up
#Cldr.Unit<:yard, 1031.7>
```
### Available units
Available units are returned by `Cldr.Unit.known_units/0`.
```elixir
iex> Cldr.Unit.known_units
[:acre, :acre_foot, :ampere, :arc_minute, :arc_second, :astronomical_unit, :bit,
:bushel, :byte, :calorie, :carat, :celsius, :centiliter, :centimeter, :century,
:cubic_centimeter, :cubic_foot, :cubic_inch, :cubic_kilometer, :cubic_meter,
:cubic_mile, :cubic_yard, :cup, :cup_metric, :day, :deciliter, :decimeter,
:degree, :fahrenheit, :fathom, :fluid_ounce, :foodcalorie, :foot, :furlong,
:g_force, :gallon, :gallon_imperial, :generic, :gigabit, :gigabyte, :gigahertz,
:gigawatt, :gram, :hectare, :hectoliter, :hectopascal, :hertz, :horsepower,
:hour, :inch, ...]
```
### Unit categories
Units are grouped by unit category which defines the convertibility of different types. In general, units of the same category are convertible to each other. The function `Cldr.Unit.known_unit_categories/0` returns the unit categories.
```elixir
iex> Cldr.Unit.known_unit_categories
[:acceleration, :angle, :area, :concentr, :consumption, :coordinate, :digital,
:duration, :electric, :energy, :frequency, :length, :light, :mass, :power,
:pressure, :speed, :temperature, :volume]
```
See also `Cldr.Unit.known_units_by_category/0` and `Cldr.Unit.known_units_for_category/1`.
### Measurement systems
Units generally fall into one of three measurement systems in use around the world. In CLDR these are known as `:metric`, `:ussystem` and `:uksystem`. The following functions allow identifying measurement systems for units, territories and locales.
* The measurement systems are returned with `Cldr.Unit.known_measurement_systems/0`.
* The measurement systems for a given unit are returned by `Cldr.Unit.measurement_systems_for_unit/1`.
* A boolean indicating membership in a given measurement system is returned by `Cldr.Unit.measurement_system?/2`.
* All units belonging to a measurement system are returned by `Cldr.Unit.measurement_system_units/1`.
* The measurement system in use for a given territory is returned by `Cldr.Unit.measurement_system_for_territory/1`.
* The measurement system in use for a given locale is returned by `Cldr.Unit.measurement_system_from_locale/1`.
#### Localisation with measurement systems
Knowledge of the measurement system in place for a given user helps create a better user experience. For example, a user who prefers units of measure in the US system can be shown different but compatible units from a user who prefers metric units.
In this example, the list of units in the volume category are filtered based upon the users preference as expressed by their locale.
```elixir
# For a user preferring US english
iex> system = Cldr.Unit.measurement_system_from_locale "en"
:ussystem
iex> {:ok, units} = Cldr.Unit.known_units_for_category(:volume)
iex> Enum.filter(units, &Cldr.Unit.measurement_system?(&1, system))
[:dessert_spoon, :cup, :drop, :dram, :cubic_foot, :teaspoon, :tablespoon,
:cubic_inch, :bushel, :quart, :pint, :cubic_yard, :cubic_mile, :fluid_ounce,
:pinch, :barrel, :jigger, :gallon, :acre_foot]
# For a user preferring australian english
iex> system = Cldr.Unit.measurement_system_from_locale "en-AU"
:metric
iex> Enum.filter(units, &Cldr.Unit.measurement_system?(&1, system))
[:cubic_centimeter, :centiliter, :cubic_meter, :pint_metric, :megaliter,
:cubic_kilometer, :hectoliter, :milliliter, :deciliter, :liter, :cup_metric]
# For a user expressing an explicit measurement system
iex> system = Cldr.Unit.measurement_system_from_locale "en-AU-u-ms-uksystem"
:uksystem
iex> Enum.filter(units, &Cldr.Unit.measurement_system?(&1, system))
[:quart_imperial, :cubic_foot, :cubic_inch, :dessert_spoon_imperial,
:cubic_yard, :cubic_mile, :fluid_ounce_imperial, :acre_foot, :gallon_imperial]
## Additional units (custom units)
Additional domain-specific units can be defined to suit application requirements. In the context
of `ex_cldr` there are two parts to configuring additional units.
1. Configure the unit, base unit and conversion in `config.exs`. This is a requirement since units are compiled into code.
2. Configure the localizations for the additional unit in a CLDR backend module. Once configured, additional units act and behave like any of the predefined units of measure defined by CLDR.
### Configuring a unit in config.exs
Under the application `:ex_cldr_units`, define a key `:additional_units` with the required unit
definitions.
For example:
```elixir
config :ex_cldr_units, :additional_units,
vehicle: [base_unit: :unit, factor: 1, offset: 0, sort_before: :all],
person: [base_unit: :unit, factor: 1, offset: 0, sort_before: :all]
```
This example defines two additional units: `:vehicle` and `:person`.
* The keys `:base_unit`, and `:factor` are required. The key `:offset` is optional and defaults to `0`.
* The key `:sort_before` is optional and defaults to `:none`.
### Configuration keys
* `:base_unit` is the common denominator that is used to support conversion between like units. It can be any atom value. For example `:liter` is the base unit for volume units, `:meter` is the base unit for length units.
* `:factor` is used to convert a unit to its base unit in order to support conversion. When converting a unit to another compatible unit, the unit is first multiplied by this units factor then divided by the target units factor.
* `:offset` is added to a unit after applying its base factor in order to convert to another unit.
* `:sort_before` determines where in this *base unit* sorts relative to other base units. Typically this is set to `:all` in which case this base unit sorts before all other base units or`:none` in which case this base unit sorted after all other base units. The default is `:none`. If in doubt, leave this key to its default.
* `:systems` is list of measurement systems to which this unit belongs. The known measurement systems are `:metric`, `:uksystem` and `:ussystem`. The default is `[:metric, :ussystem, :uksystem]`.
### Defining localizations
Although defining a unit in `config.exs` is enough to create, operate on and serialize an additional unit, it cannot be localised without defining localizations in an `ex_cldr` backend module. For example:
```elixir
defmodule MyApp.Cldr do
use Cldr.Unit.Additional
use Cldr,
locales: ["en", "fr", "de", "bs", "af", "af-NA", "se-SE"],
default_locale: "en",
providers: [Cldr.Number, Cldr.Unit, Cldr.List]
unit_localization(:person, "en", :long,
one: "{0} person",
other: "{0} people",
display_name: "people"
)
unit_localization(:person, "en", :short,
one: "{0} per",
other: "{0} pers",
display_name: "people"
)
unit_localization(:person, "en", :narrow,
one: "{0} p",
other: "{0} p",
display_name: "p"
)
end
```
Note the additions to a typical `ex_cldr` backend module:
* `use Cldr.Unit.Additional` is required to define additional units
* use of the `Cldr.Unit.Additional.unit_localization/4` macro in order to define a localization.
* The use templates for the localization. Templates are a string with both a placeholder (for units it is always `{0}`) and some fixed text that reflects the grammatical requirements of the particular locale.
One invocation of `Cldr.Unit.Additional.unit_localization/4` should made for each combination of unit, locale and style.
#### Parameters to unit_localization/4
* `unit` is the name of the additional unit as an `atom`.
* `locale` is the locale name for this localization. It should be one of the locale configured in this backend although this cannot currently be confirmed at compile tiem.
* `style` is one of `:long`, `:short`, or `:narrow`.
* `localizations` is a keyword like of localization strings. Two keys - `:display_name` and `:other` are mandatory. They represent the localizations for a non-count display name and `:other` is the localization for a unit when no other pluralization is defined.
#### Localisation definition
Localization keyword list defines localizations that match the plural rules for a given locale. Plural rules for a given number in a given locale resolve to one of
six keys:
* `:zero`
* `:one` (singular)
* `:two` (dual)
* `:few` (paucal)
* `:many` (also used for fractions if they have a separate class)
* `:other` (required — general plural form. Also used if the language only has a single form)
Only the `:other` key is required. For english, providing keys for `:one` and `:other` is enough. Other languages have different grammatical requirements.
The key `:display_name` is used by the function `Cldr.Unit.display_name/1` which is primarly used to support UI applications.
### Sorting Units
From Elixir 1.10, `Enum.sort/2` supports module-based comparisons to provide a simpler API for sorting structs. `ex_cldr_units` supports Elixir 1.10 as the following example shows:
```
iex> alias Cldr.Unit
Cldr.Unit
iex> unit_list = [Unit.new!(:millimeter, 100), Unit.new!(:centimeter, 100), Unit.new!(:meter, 100), Unit.new!(:kilometer, 100)]
[#Unit<:millimeter, 100>, #Unit<:centimeter, 100>, #Unit<:meter, 100>,
#Unit<:kilometer, 100>]
iex> Enum.sort unit_list, Cldr.Unit
[#Unit<:millimeter, 100>, #Unit<:centimeter, 100>, #Unit<:meter, 100>,
#Unit<:kilometer, 100>]
iex> Enum.sort unit_list, {:desc, Cldr.Unit}
[#Unit<:kilometer, 100>, #Unit<:meter, 100>, #Unit<:centimeter, 100>,
#Unit<:millimeter, 100>]
iex> Enum.sort unit_list, {:asc, Cldr.Unit}
[#Unit<:millimeter, 100>, #Unit<:centimeter, 100>, #Unit<:meter, 100>,
#Unit<:kilometer, 100>]
```
Note that the items being sorted must be all of the same unit category (length, volume, ...). Where units are of the same category but different units, conversion to a common unit will occur before the comparison. If units of different categories are encountered an exception will be raised as the following example shows:
```elixir
iex> unit_list = [Unit.new!(:millimeter, 100), Unit.new!(:centimeter, 100), Unit.new!(:meter, 100), Unit.new!(:liter, 100)]
[#Cldr.Unit<:millimeter, 100>, #Cldr.Unit<:centimeter, 100>,
#Cldr.Unit<:meter, 100>, #Cldr.Unit<:liter, 100>]
iex> Enum.sort unit_list, Cldr.Unit
** (Cldr.Unit.IncompatibleUnitsError) Operations can only be performed between units with the same category and base unit. Received :liter and :meter
```
|
__label__pos
| 0.980844 |
Grignard reaction
From Wikipedia, the free encyclopedia
Jump to: navigation, search
A solution of a carbonyl compound is added to a Grignard reagent. (See gallery below)
The Grignard reaction (pronounced /ɡriɲar/) is an organometallic chemical reaction in which alkyl- or aryl-magnesium halides (Grignard reagents) attack electrophilic carbon atoms that are present within polar bonds (for example, in a carbonyl group as in the example shown below). Grignard reagents act as nucleophiles. The Grignard reaction produces a carbon–carbon bond. It alters hybridization about the reaction center.[1] The Grignard reaction is an important tool in the formation of carbon–carbon bonds.[2][3] It also can form carbon–phosphorus, carbon–tin, carbon–silicon, carbon–boron and other carbon–heteroatom bonds.
An example of a Grignard reaction
It is a nucleophilic organometallic addition reaction. The high pKa value of the alkyl component (pKa = ~45) makes the reaction irreversible. Grignard reactions are not ionic. The Grignard reagent exists as an organometallic cluster (in ether).
The disadvantage of Grignard reagents is that they readily react with protic solvents (such as water), or with functional groups with acidic protons, such as alcohols and amines. Atmospheric humidity can alter the yield of making a Grignard reagent from magnesium turnings and an alkyl halide. One of many methods used to exclude water from the reaction atmosphere is to flame-dry the reaction vessel to evaporate all moisture, which is then sealed to prevent moisture from returning. Chemists then use ultrasound to activate the surface of the magnesium so that it consumes any water present. This can allow Grignard reagents to form with less sensitivity to water being present.[4]
Another disadvantage of Grignard reagents is that they do not readily form carbon–carbon bonds by reacting with alkyl halides by an SN2 mechanism.
François Auguste Victor Grignard discovered Grignard reactions and reagents. They are named after this French chemist (University of Nancy, France) who was awarded the 1912 Nobel Prize in Chemistry for this work.
Reaction mechanism[change | change source]
The addition of the Grignard reagent to a carbonyl typically proceeds through a six-membered ring transition state.[5]
The mechanism of the Grignard reaction.
However, with steric hindered Grignard reagents, the reaction may proceed by single-electron transfer.
Grignard reactions will not work if water is present; water causes the reagent to rapidly decompose. So, most Grignard reactions occur in solvents such as anhydrous diethyl ether or tetrahydrofuran (THF), because the oxygen in these solvents stabilizes the magnesium reagent. The reagent may also react with oxygen present in the atmosphere. This will insert an oxygen atom between the carbon base and the magnesium halide group. Usually, this side-reaction may be limited by the volatile solvent vapors displacing air above the reaction mixture. However, chemists may perform the reactions in nitrogen or argon atmospheres. In small scale reactions, the solvent vapors do not have enough space to protect the magnesium from oxygen.
Making a Grignard reagent[change | change source]
Grignard reagents are formed by the action of an alkyl or aryl halide on magnesium metal.[6] The reaction is conducted by adding the organic halide to a suspension of magnesium in an ether, which provides ligands required to stabilize the organomagnesium compound. Typical solvents are diethyl ether and tetrahydrofuran. Oxygen and protic solvents such as water or alcohols are not compatible with Grignard reagents. The reaction proceeds through single electron transfer.[7][8]
R−X + Mg → R−X•− + Mg•+
R−X•− → R + X
X + Mg•+ → XMg
R + XMg → RMgX
Grignard reactions often start slowly. First, there is an induction period during which reactive magnesium becomes exposed to the organic reagents. After this induction period, the reactions can be highly exothermic. Alkyl and aryl bromides and iodides are common substrates. Chlorides are also used, but fluorides are generally unreactive, except with specially activated magnesium, such as Rieke magnesium.
Many Grignard reagents, such as methylmagnesium chloride, phenylmagnesium bromide, and allylmagnesium bromide are available commercially in tetrahydrofuran or diethyl ether solutions.
Using the Schlenk equilibrium, Grignard reagents form varying amounts of diorganomagnesium compounds (R = organic group, X = halide):
2 RMgX is in equilibrium with R2Mg + MgX2
Initiation[change | change source]
Many methods have been developed to initiate Grignard reactions that are slow to start. These methods weaken the layer of MgO that covers the magnesium. They expose the magnesium to the organic halide to start the reaction that makes the Grignard reagent.
Mechanical methods include crushing of the Mg pieces in situ, rapid stirring, or using ultrasound (sonication) of the suspension. Iodine, methyl iodide, and 1,2-dibromoethane are commonly employed activating agents. Chemists use 1,2-dibromoethane because its action can be monitored by the observation of bubbles of ethylene. Also, the side-products are innocuous:
Mg + BrC2H4Br → C2H4 + MgBr2
The amount of Mg consumed by these activating agents is usually insignificant.
The addition of a small amount of mercuric chloride will amalgamate the surface of the metal, allowing it to react.
Industrial production[change | change source]
Grignard reagents are produced in industry for use in place, or for sale. As with at bench-scale, the main problem is that of initiation. A portion of a previous batch of Grignard reagent is often used as the initiator. Grignard reactions are exothermic; this exothermicity must be considered when a reaction is scaled-up from laboratory to production plant.[9]
Reactions of Grignard reagents[change | change source]
Reactions with carbonyl compounds[change | change source]
Grignard reagents will react with a variety of carbonyl derivatives.[10]
Reactions of Grignard reagents with carbonyls
The most common application is for alkylation of aldehydes and ketones, as in this example:[11]
Reaction of CH3C(=O)CH(OCH3)2 with H2C=CHMgBr
Note that the acetal function (a masked carbonyl) does not react.
Such reactions usually involve a water-based (aqueous) acidic workup, though this is rarely shown in reaction schemes. In cases where the Grignard reagent is adding to a prochiral aldehyde or ketone, the Felkin-Anh model or Cram's Rule can usually predict which stereoisomer will form.
Reactions with other electrophiles[change | change source]
In addition, Grignard reagents will react with electrophiles.
Reactions of Grignard reagents with various electrophiles
Another example is making salicylaldehyde (not shown above). First, bromoethane reacts with Mg in ether. Second, phenol in THF converts the phenol into Ar-OMgBr. Third, benzene is added in the presence of paraformaldehyde powder and triethylamine. Fourth, the mixture is distilled to remove the solvents. Next, 10% HCl is added. Salicylaldehyde will be the major product as long as everything is very dry and under inert conditions. The reaction works also with iodoethane instead of bromoethane.[12][13][14]
Formation of bonds to B, Si, P, Sn[change | change source]
The Grignard reagent is very useful for forming carbon–heteroatom bonds.
Reactions of Grignard reagents with non carbon electrophiles
Carbon–carbon coupling reactions[change | change source]
A Grignard reagent can also be involved in coupling reactions. For example, nonylmagnesium bromide reacts with methyl p-chlorobenzoate to give p-nonylbenzoic acid, in the presence of Tris(acetylacetonato)iron(III), often symbolized as Fe(acac)3, after workup with NaOH to hydrolyze the ester, shown as follows. Without the Fe(acac)3, the Grignard reagent would attack the ester group over the aryl halide.[15]
4-nonylbenzoicacid synthesis using a grignard reagent
For the coupling of aryl halides with aryl Grignards, nickel chloride in tetrahydrofuran (THF) is also a good catalyst. Additionally, an effective catalyst for the couplings of alkyl halides is dilithium tetrachlorocuprate (Li2CuCl4), prepared by mixing lithium chloride (LiCl) and copper(II) chloride (CuCl2) in THF. The Kumada-Corriu coupling gives access to [substituted] styrenes.
Oxidation[change | change source]
The oxidation of a Grignard reagent with oxygen takes place through a radical intermediate to a magnesium hydroperoxide. Hydrolysis of this complex yields hydroperoxides and reduction with an additional equivalent of Grignard reagent gives an alcohol.
Grignard oxygen oxidation pathways
A reaction of Grignards with oxygen in presence of an alkene makes an ethylene extended alcohol. These are useful in synthesizing larger compounds.[16] This modification requires aryl or vinyl Grignard reagents. Adding just the Grignard and the alkene does not result in a reaction, showing that the presence of oxygen is essential. The only drawback is the requirement of at least two equivalents of Grignard reagent in the reaction. This can addressed by using a dual Grignard system with a cheap reducing Grignard reagent such as n-butylmagnesium bromide.
Grignard oxygen oxidation example
Nucleophilic aliphatic substitution[change | change source]
Grignard reagents are nucleophiles in nucleophilic aliphatic substitutions for instance with alkyl halides in a key step in industrial Naproxen production:
Naproxen synthesis
Elimination[change | change source]
In the Boord olefin synthesis, the addition of magnesium to certain β-haloethers results in an elimination reaction to the alkene. This reaction can limit the utility of Grignard reactions.
Boord olefin synthesis, X = Br, I, M = Mg, Zn
Grignard degradation[change | change source]
Grignard degradation[17][18] at one time was a tool in structure identification (elucidation) in which a Grignard RMgBr formed from a heteroaryl bromide HetBr reacts with water to Het-H (bromine replaced by a hydrogen atom) and MgBrOH. This hydrolysis method allows the determination of the number of halogen atoms in an organic compound. In modern usage, Grignard degradation is used in the chemical analysis of certain triacylglycerols.[19]
Industrial use[change | change source]
An example of the Grignard reaction is a key step in the industrial production of Tamoxifen.[20] (Tamoxifen is currently used for the treatment of estrogen receptor positive breast cancer in women.):[21]
Tamoxifen production
Gallery[change | change source]
Other pages[change | change source]
References[change | change source]
1. Grignard, V. (1900), "Sur quelques nouvelles combinaisons organométaliques du magnésium et leur application à des synthèses d'alcools et d'hydrocabures", Compt. Rend., 130: 1322–1325
2. Shirley, D. A. (1954), Org. React, 8: 28–58 Missing or empty |title= (help)
3. Huryn, D. M. (1991), Comp. Org. Syn, 1: 49–75 Missing or empty |title= (help)
4. Smith, David H. (1999), "Grignard Reactions in "Wet" Ether", Journal of Chemical Education, 76: 1427, doi:10.1021/ed076p1427
5. Maruyama, K.; Katagiri, T. (1989), "Mechanism of the Grignard reaction", J. Phys. Org. Chem, 2: 205, doi:10.1002/poc.610020303
6. Lai Yee Hing (1981), "Grignard Reagents from Chemically Activated Magnesium", Synthesis, 1981: 585–604, doi:10.1055/s-1981-29537
7. Garst, J. F.; Ungvary, F. "Mechanism of Grignard reagent formation". In Grignard Reagents; Richey, R. S., Ed.; John Wiley & Sons: New York, 2000; pp 185–275. ISBN 0-471-99908-3.
8. Advanced Organic chemistry Part B: Reactions and Synthesis F.A. Carey, R.J. Sundberg 2nd Ed. 1983
9. Philip E. Rakita (1996). "5. Safe Handling Practices of Industrial Scale Grignard Ragents". In Gary S. Silverman, Philip E. Rakita. Handbook of Grignard reagents (Google Books excerpt). CRC Press. pp. 79–88. ISBN 0824795458.
10. Henry Gilman and R. H. Kirby (1941), "Butyric acid, α-methyl-", Org. Synth. ; Coll. Vol., 1: 361 Missing or empty |title= (help)
11. Haugan, Jarle André; Songe, Pål; Rømming, Christian; Rise, Frode; Hartshorn, Michael P.; Merchán, Manuela; Robinson, Ward T.; Roos, Björn O.; Vallance, Claire (1997), "Total Synthesis of C31-Methyl Ketone Apocarotenoids 2: The First Total Synthesis of (3R)-Triophaxanthin." (PDF), Acta Chimica Scandinavica, 51: 1096–1103, doi:10.3891/acta.chem.scand.51-1096, retrieved 2009-11-26
12. Wang, R. X et al. Synth. Commun. 1994, 24, 1757-1760.
13. C. Ji ; Peters, D. G. Tetrahedron Letters, Volume 42, Issue 35, 27 August 2001, Pages 6065-6067 http://www.sciencedirect.com/science/article/pii/S0040403901011789
14. Peters, D. G.; C. Ji. J. Chem. Educ., 2006, 83 (2), p 290 http://pubs.acs.org/doi/abs/10.1021/ed083p290
15. A. Fürstner, A. Leitner, G. Seidel (2004), "4-Nonylbenzoic Acid", Org. Synth., 81: 33–42
16. Youhei Nobe, Kyohei Arayama, and Hirokazu Urabe (2005), "Air-Assisted Addition of Grignard Reagents to Olefins. A Simple Protocol for a Three-Component Coupling Process Yielding Alcohols", J. Am. Chem. Soc., 127 (51): 18006–18007, doi:10.1021/ja055732b, PMID 16366543
17. Steinkopf, Wilhelm; Jacob, Hans; Penz, Herbert (1934), "Studien in der Thiophenreihe. XXVI. Isomere Bromthiophene und die Konstitution der Thiophendisulfonsäuren", Justus Liebig s Annalen der Chemie, 512: 136, doi:10.1002/jlac.19345120113
18. Steinkopf, Wilhelm; V. Petersdorff, Hans-JüRgen (1940), "Studien in der Thiophenreihe. LI. Atophanartige Derivate des Dithienyls und Diphenyls", Justus Liebig s Annalen der Chemie, 543: 119, doi:10.1002/jlac.19405430110
19. Myher JJ, Kuksis A (1979), "Stereospecific analysis of triacylglycerols via racemic phosphatidylcholines and phospholipase C", Can. J. Biochem., 57 (2): 117–24, doi:10.1139/o79-015, PMID 455112 Unknown parameter |month= ignored (help)
20. "Grignard Reagents: New Developments", ISBN: 0–471
21. Jordan VC (1993), "Fourteenth Gaddum Memorial Lecture. A current view of tamoxifen for the treatment and prevention of breast cancer", Br J Pharmacol, 110 (2): 507–17, PMC 2175926Freely accessible, PMID 8242225
Further reading[change | change source]
• ed. by Gary S. Silverman .... (1996), Rakita, Philip E.; Silverman, Gary, ed., Handbook of Grignard reagents, New York, N.Y: Marcel Dekker, ISBN 0-8247-9545-8
• Grignard knowledge: Alkyl coupling chemistry with inexpensive transition metals by Larry J. Westrum, Fine Chemistry November/December 2002, pp. 10–13 [1]
|
__label__pos
| 0.781775 |
Computer Programming
Software development process
Core activities
Paradigms and models
Methodologies and frameworks
Supporting disciplines
Tools
Standards and BOKs
Computer programming (often shortened to programming) is a process that leads from an original formulation of a computing problem to executable computer programs. Programming involves activities such as analysis, developing understanding, generating algorithms, verification of requirements of algorithms including their correctness and resources consumption, and implementation (commonly referred to as coding[1][2]) of algorithms in a target programming language. Source code is written in one or more programming languages. The purpose of programming is to find a sequence of instructions that will automate performing a specific task or solving a given problem. The process of programming thus often requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms, and formal logic.
Related tasks include testing, debugging, and maintaining the source code, implementation of the build system, and management of derived artifacts such as machine code of computer programs. These might be considered part of the programming process, but often the term software development is used for this larger process with the term programming, implementation, or coding reserved for the actual writing of source code. Software engineering combines engineering techniques with software development practices.
Overview
Within software engineering, programming (the implementation) is regarded as one phase in a software development process.
There is an ongoing debate on the extent to which the writing of programs is an art form, a craft, or an engineering discipline.[3] In general, good programming is considered to be the measured application of all three, with the goal of producing an efficient and evolvable software solution (the criteria for "efficient" and "evolvable" vary considerably). The discipline differs from many other technical professions in that programmers, in general, do not need to be licensed or pass any standardized (or governmentally regulated) certification tests in order to call themselves "programmers" or even "software engineers" - but note that use of the term "engineer" is tighty regulated in many parts of the world.
Because the discipline covers many areas, which may or may not include critical applications, it is debatable whether licensing is required for the profession as a whole. In most cases, the discipline is self-governed by the entities which require the programming, and sometimes very strict environments are defined (e.g. United States Air Force use of AdaCore and security clearance). Another ongoing debate is the extent to which the programming language used in writing computer programs affects the form that the final program takes.[] This debate is analogous to that surrounding the Sapir-Whorf hypothesis[4] in linguistics and cognitive science, which postulates that a particular spoken language's nature influences the habitual thought of its speakers. Different language patterns yield different patterns of thought. This idea challenges the possibility of representing the world perfectly with language because it acknowledges that the mechanisms of any language condition the thoughts of its speaker community.
History
Ada Lovelace, whose notes added to the end of Luigi Menabrea's paper included the first algorithm designed for processing by an Analytical Engine. She is often recognized as history's first computer programmer.
Programmable devices have existed at least as far back as 1206 AD, when the automata of Al-Jazari were programmable, via pegs and cams, to play various rhythms and drum patterns;[5] and the 1801 Jacquard loom could produce entirely different weaves using different used by changing the "program" - a series of pasteboard cards with holes punched in them.
However, the first computer program is generally dated to 1843, when mathematician Ada Lovelace published an algorithm to calculate a sequence of Bernoulli numbers, intended to be carried out by Charles Babbage's Analytical Engine.[6]
Data and instructions were once stored on external punched cards, which were kept in order and arranged in program decks.
In the 1880s Herman Hollerith invented the concept of storing data in machine-readable form.[7] Later a control panel (plugboard) added to his 1906 Type I Tabulator allowed it to be programmed for different jobs, and by the late 1940s, unit record equipment such as the IBM 602 and IBM 604, were programmed by control panels in a similar way; as were the first electronic computers. However, with the concept of the stored-program computers introduced in 1949, both programs and data were stored and manipulated in the same way in computer memory.
Machine code was the language of early programs, written in the instruction set of the particular machine, often in binary notation. Assembly languages were soon developed that let the programmer specify instruction in a text format, (e.g., ADD X, TOTAL), with abbreviations for each operation code and meaningful names for specifying addresses. However, because an assembly language is little more than a different notation for a machine language, any two machines with different instruction sets also have different assembly languages.
Wired control panel for an IBM 402 Accounting Machine.
High-level languages allow the programmer to write programs in terms that are more abstract, and less bound to the underlying hardware. They harness the power of computers to make programming easier[8] by allowing programmers to specify calculations by entering a formula directly (e.g., ). FORTRAN, the first widely used high-level language to have a functional implementation, came out in 1957[9] and many other languages were soon developed - in particular, COBOL aimed at commercial data processing, and Lisp for computer research.
Programs were mostly still entered using punched cards or paper tape. See computer programming in the punch card era. By the late 1960s, data storage devices and computer terminals became inexpensive enough that programs could be created by typing directly into the computers. Text editors were developed that allowed changes and corrections to be made much more easily than with punched cards.
Modern programming
Quality requirements
Whatever the approach to development may be, the final program must satisfy some fundamental properties. The following properties are among the most important:
• Reliability: how often the results of a program are correct. This depends on conceptual correctness of algorithms, and minimization of programming mistakes, such as mistakes in resource management (e.g., buffer overflows and race conditions) and logic errors (such as division by zero or off-by-one errors).
• Robustness: how well a program anticipates problems due to errors (not bugs). This includes situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources such as memory, operating system services and network connections, user error, and unexpected power outages.
• Usability: the ergonomics of a program: the ease with which a person can use the program for its intended purpose or in some cases even unanticipated purposes. Such issues can make or break its success even regardless of other issues. This involves a wide range of textual, graphical and sometimes hardware elements that improve the clarity, intuitiveness, cohesiveness and completeness of a program's user interface.
• Portability: the range of computer hardware and operating system platforms on which the source code of a program can be compiled/interpreted and run. This depends on differences in the programming facilities provided by the different platforms, including hardware and operating system resources, expected behavior of the hardware and operating system, and availability of platform specific compilers (and sometimes libraries) for the language of the source code.
• Maintainability: the ease with which a program can be modified by its present or future developers in order to make improvements or customizations, fix bugs and security holes, or adapt it to new environments. Good practices[10] during initial development make the difference in this regard. This quality may not be directly apparent to the end user but it can significantly affect the fate of a program over the long term.
• Efficiency/performance: Measure of system resources a program consumes (processor time, memory space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less, the better. This also includes careful management of resources, for example cleaning up temporary files and eliminating memory leaks.
Readability of source code
In computer programming, readability refers to the ease with which a human reader can comprehend the purpose, control flow, and operation of source code. It affects the aspects of quality above, including portability, usability and most importantly maintainability.
Readability is important because programmers spend the majority of their time reading, trying to understand and modifying existing source code, rather than writing new source code. Unreadable code often leads to bugs, inefficiencies, and duplicated code. A study[11] found that a few simple readability transformations made code shorter and drastically reduced the time to understand it.
Following a consistent programming style often helps readability. However, readability is more than just programming style. Many factors, having little or nothing to do with the ability of the computer to efficiently compile and execute the code, contribute to readability.[12] Some of these factors include:
The presentation aspects of this (such as indents, line breaks, color highlighting, and so on) are often handled by the source code editor, but the content aspects reflect the programmer's talent and skills.
Various visual programming languages have also been developed with the intent to resolve readability concerns by adopting non-traditional approaches to code structure and display. Integrated development environments (IDEs) aim to integrate all such help. Techniques like Code refactoring can enhance readability.
Algorithmic complexity
The academic field and the engineering practice of computer programming are both largely concerned with discovering and implementing the most efficient algorithms for a given class of problem. For this purpose, algorithms are classified into orders using so-called Big O notation, which expresses resource use, such as execution time or memory consumption, in terms of the size of an input. Expert programmers are familiar with a variety of well-established algorithms and their respective complexities and use this knowledge to choose algorithms that are best suited to the circumstances.
Methodologies
The first step in most formal software development processes is requirements analysis, followed by testing to determine value modeling, implementation, and failure elimination (debugging). There exist a lot of differing approaches for each of those tasks. One approach popular for requirements analysis is Use Case analysis. Many programmers use forms of Agile software development where the various stages of formal software development are more integrated together into short cycles that take a few weeks rather than years. There are many approaches to the Software development process.
Popular modeling techniques include Object-Oriented Analysis and Design (OOAD) and Model-Driven Architecture (MDA). The Unified Modeling Language (UML) is a notation used for both the OOAD and MDA.
A similar technique used for database design is Entity-Relationship Modeling (ER Modeling).
Implementation techniques include imperative languages (object-oriented or procedural), functional languages, and logic languages.
Measuring language usage
It is very difficult to determine what are the most popular of modern programming languages. Methods of measuring programming language popularity include: counting the number of job advertisements that mention the language,[13] the number of books sold and courses teaching the language (this overestimates the importance of newer languages), and estimates of the number of existing lines of code written in the language (this underestimates the number of users of business languages such as COBOL).
Some languages are very popular for particular kinds of applications, while some languages are regularly used to write many different kinds of applications. For example, COBOL is still strong in corporate data centers[14] often on large mainframe computers, Fortran in engineering applications, scripting languages in Web development, and C in embedded software. Many applications use a mix of several languages in their construction and use. New languages are generally designed around the syntax of a prior language with new functionality added, (for example C++ adds object-orientation to C, and Java adds memory management and bytecode to C++, but as a result, loses efficiency and the ability for low-level manipulation).
Debugging
The bug from 1947 which is at the origin of a popular (but incorrect) etymology for the common term for a software defect.
Debugging is a very important task in the software development process since having defects in a program can have significant consequences for its users. Some languages are more prone to some kinds of faults because their specification does not require compilers to perform as much checking as other languages. Use of a static code analysis tool can help detect some possible problems. Normally the first step in debugging is to attempt to reproduce the problem. This can be a non-trivial task, for example as with parallel processes or some unusual software bugs. Also, specific user environment and usage history can make it difficult to reproduce the problem.
After the bug is reproduced, the input of the program may need to be simplified to make it easier to debug. For example, a bug in a compiler can make it crash when parsing some large source file. However, after simplification of the test case, only few lines from the original source file can be sufficient to reproduce the same crash. Such simplification can be done manually, using a divide-and-conquer approach. The programmer will try to remove some parts of original test case and check if the problem still exists. When debugging the problem in a GUI, the programmer can try to skip some user interaction from the original problem description and check if remaining actions are sufficient for bugs to appear.
Debugging is often done with IDEs like Eclipse, Visual Studio, Xcode, Kdevelop, NetBeans and Code::Blocks. Standalone debuggers like GDB are also used, and these often provide less of a visual environment, usually using a command line. Some text editors such as Emacs allow GDB to be invoked through them, to provide a visual environment.
Programming languages
Different programming languages support different styles of programming (called programming paradigms). The choice of language used is subject to many considerations, such as company policy, suitability to task, availability of third-party packages, or individual preference. Ideally, the programming language best suited for the task at hand will be selected. Trade-offs from this ideal involve finding enough programmers who know the language to build a team, the availability of compilers for that language, and the efficiency with which programs written in a given language execute. Languages form an approximate spectrum from "low-level" to "high-level"; "low-level" languages are typically more machine-oriented and faster to execute, whereas "high-level" languages are more abstract and easier to use but execute less quickly. It is usually easier to code in "high-level" languages than in "low-level" ones.
Allen Downey, in his book How To Think Like A Computer Scientist, writes:
The details look different in different languages, but a few basic instructions appear in just about every language:
• Input: Gather data from the keyboard, a file, or some other device.
• Output: Display data on the screen or send data to a file or other device.
• Arithmetic: Perform basic arithmetical operations like addition and multiplication.
• Conditional Execution: Check for certain conditions and execute the appropriate sequence of statements.
• Repetition: Perform some action repeatedly, usually with some variation.
Many computer languages provide a mechanism to call functions provided by shared libraries. Provided the functions in a library follow the appropriate run-time conventions (e.g., method of passing arguments), then these functions may be written in any other language.
Programmers
Computer programmers are those who write computer software. Their jobs usually involve:
General Programming Reference Sheet
Everyone is free to edit. Please comment for suggestions, including new languages and categories.
Link: https://docs.google.com/spreadsheets/d/1vwUTaxkENXLYdyV1bYElCNL8r1b66ghzQxnOSSgG_bE/edit#gid=0
See also
References
1. ^ Shaun Bebbington (2014). "What is coding". Retrieved .
2. ^ Shaun Bebbington (2014). "What is programming". Retrieved .
3. ^ Paul Graham (2003). "Hackers and Painters". Retrieved .
4. ^ Kenneth E. Iverson, the originator of the APL programming language, believed that the Sapir-Whorf hypothesis applied to computer languages (without actually mentioning the hypothesis by name). His Turing award lecture, "Notation as a tool of thought", was devoted to this theme, arguing that more powerful notations aided thinking about computer algorithms. Iverson K.E.,"[dead link]", Communications of the ACM, 23: 444-465 (August 1980).
5. ^ Fowler, Charles B. (October 1967). "The Museum of Music: A History of Mechanical Instruments". Music Educators Journal. Music Educators Journal, Vol. 54, No. 2. 54 (2): 45-49. JSTOR 3391092. doi:10.2307/3391092.
6. ^ Fuegi, J.; Francis, J. (2003). "Lovelace & babbage and the creation of the 1843 'notes'". IEEE Annals of the History of Computing. 25 (4): 16. doi:10.1109/MAHC.2003.1253887.
7. ^ "Columbia University Computing History - Herman Hollerith". Columbia.edu. Retrieved .
8. ^ "Fortran creator John Backus dies". msnbc.com. Retrieved 2014.
9. ^ "Fortran creator John Backus dies - Tech and gadgets- msnbc.com". MSNBC. 2007-03-20. Retrieved .
10. ^ "Programming 101: Tips to become a good programmer - Wisdom Geek". Wisdom Geek. 2016-05-19. Retrieved .
11. ^ James L. Elshoff, Michael Marcotty, Improving computer program readability to aid modification, Communications of the ACM, v.25 n.8, p.512-521, Aug 1982.
12. ^ Multiple (wiki). "Readability". Docforge. Retrieved .
13. ^ Survey of Job advertisements mentioning a given language
14. ^ Mitchell, Robert. "The Cobol Brain Drain". Computer World. Retrieved 2015.
Further reading
• A.K. Hartmann, Practical Guide to Computer Simulations, Singapore: World Scientific (2009)
• A. Hunt, D. Thomas, and W. Cunningham, The Pragmatic Programmer. From Journeyman to Master, Amsterdam: Addison-Wesley Longman (1999)
• Brian W. Kernighan, The Practice of Programming, Pearson (1999)
• Weinberg, Gerald M., The Psychology of Computer Programming, New York: Van Nostrand Reinhold (1971)
• Edsger W. Dijkstra, A Discipline of Programming, Prentice-Hall (1976)
• O.-J. Dahl, E.W.Dijkstra, C.A.R. Hoare, Structured Pogramming, Academic Press (1972)
• David Gries, The Science of Programming, Springer-Verlag (1981)
External links
This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.
Computer_programming
Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.
Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your IT knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.
Contact Us
|
__label__pos
| 0.801574 |
@article{ordonez_bromine_and_2012, author={Ordonez, C. and Lamarque, J.-F. and Kinnison, D.E. and Atlas, E.L. and Blake, D.R. and Sousa Santos, G. and Brasseur, G.P. and Saiz-Lopez, A. and Tilmes, S.}, title={Bromine and iodine chemistry in a global chemistry-climate model: description and evaluation of very short-lived oceanic sources}, year={2012}, journal = {Atmospheric Chemistry and Physics}, volume = {12}, number = {3}, pages = {1423 - 1447}, doi = {http://dx.doi.org/10.5194/acp-12-1423-2012}, abstract = {The global chemistry-climate model CAM-Chem has been extended to incorporate an expanded bromine and iodine chemistry scheme that includes natural oceanic sources of very short-lived (VSL) halocarbons, gas-phase photochemistry and heterogeneous reactions on aerosols. Ocean emissions of five VSL bromocarbons (CHBr3, CH2Br2, CH2BrCl, CHBrCl2, CHBr2Cl) and three VSL iodocarbons (CH2ICl, CH2IBr, CH2I2) have been parameterised by a biogenic chlorophyll-a (chl-a) dependent source in the tropical oceans (20° N–20° S). Constant oceanic fluxes with 2.5 coast-to-ocean emission ratios are separately imposed on four different latitudinal bands in the extratropics (20°–50° and above 50° in both hemispheres). Top-down emission estimates of bromocarbons have been derived using available measurements in the troposphere and lower stratosphere, while iodocarbons have been constrained with observations in the marine boundary layer (MBL). Emissions of CH3I are based on a previous inventory and the longer lived CH3Br is set to a surface mixing ratio boundary condition. The global oceanic emissions estimated for the most abundant VSL bromocarbons – 533 Gg yr−1 for CHBr3 and 67.3 Gg yr−1 for CH2Br2 – are within the range of previous estimates. Overall the latitudinal and vertical distributions of modelled bromocarbons are in good agreement with observations. Nevertheless, we identify some issues such as the reduced number of aircraft observations to validate models in the Southern Hemisphere, the overestimation of CH2Br2 in the upper troposphere – lower stratosphere and the underestimation of CH3I in the same region. Despite the difficulties involved in the global modelling of the shortest lived iodocarbons (CH2ICl, CH2IBr, CH2I2), modelled results are in good agreement with published observations in the MBL. Finally, sensitivity simulations show that knowledge of the diurnal emission cycle for these species, in particular for CH2I2, is key to assess their global source strength.}, note = {Online available at: \url{http://dx.doi.org/10.5194/acp-12-1423-2012} (DOI). Ordonez, C.; Lamarque, J.-F.; Kinnison, D.E.; Atlas, E.L.; Blake, D.R.; Sousa Santos, G.; Brasseur, G.P.; Saiz-Lopez, A.; Tilmes, S.: Bromine and iodine chemistry in a global chemistry-climate model: description and evaluation of very short-lived oceanic sources. In: Atmospheric Chemistry and Physics. Vol. 12 (2012) 3, 1423 - 1447. (DOI: 10.5194/acp-12-1423-2012)}}
|
__label__pos
| 0.769471 |
ethanoic acid and 1-butanol can react to produce water and a compound classified as an
Regents Chemistry Exam Descriptions June 2017
As a course, esters function as shielding teams for carboxylic acids. Shielding a carboxylic acid is useful in peptide synthesis, to stop self-reactions of the bifunctional amino acids. Methyl and ethyl esters are generally available for lots of amino acids; the t-butyl ester often tends to be extra pricey. Contrasted to ketones and also aldehydes, esters are fairly resistant to decrease.
Palmitic acid [CH314COOH], with its large nonpolar hydrocarbon element, is essentially insoluble in water. The carboxylic acids generally are soluble in such organic solvents as ethanol, toluene, and also diethyl ether. The carboxyl team easily engages in hydrogen bonding with water particles (Figure 4.2 “Hydrogen Bonding between an Acetic Acid Particle and also Water Particles”). Esters are extra polar than ethers, but much less so than alcohols. They participate in hydrogen bonds as hydrogen bond acceptors, yet can not act as hydrogen bond donors, unlike their parent alcohols as well as carboxylic acids. This capability to take part in hydrogen bonding provides some water-solubility, depending on the length of the alkyl chains attached. Considering that they have no hydrogens bound to oxygens, as alcohols and carboxylic acids do, esters do not self-associate.
As well as the diffusion pressures, there will likewise be destinations between the irreversible dipoles on neighboring particles. That implies that the boiling points will be greater than those of in a similar way sized hydrocarbons– which only have diffusion pressures. It interests compare three similarly sized molecules. They have comparable sizes, as well as comparable numbers of electrons. In ketones, the carbonyl group has two carbon groups affixed.
A general anesthetic acts on the brain to create unconsciousness and also a basic insensitivity to sensation or discomfort. Diethyl ether was the first general anesthetic to be generally used. Number 9.7 Phenol is still utilized in reduced focus in some clinical solutions such as chloraseptic. Ethylene glycol is often utilized as a cooling agent in antifreeze mixes as a result of its reduced freezing factor and high boiling factor. Alcohols can be considered derivatives of water (WATER; likewise written as HOH).
ethanoic acid and 1-butanol can react to produce water and a compound classified as an
Which compound of each set has the greater boiling point? Which compound is more soluble in water, CH3CH2CH2CH2CH3 or CH3CH2NHCH2CH3? Which substance has the greater boiling point, CH3CH2CH2CH2CH2NH2 or CH3CH2CH2CH2CH2CH3?
admwp
|
__label__pos
| 0.710451 |
Weight Loss Surgery Options
What You Need to Know
Weight loss surgery, also known as bariatric surgery, is a viable option for individuals who struggle with severe obesity and have been unable to achieve significant weight loss through diet and exercise alone. This article explores the various weight loss surgery options, their benefits, risks, and who might be a candidate for these procedures. Understanding your options can help you make an informed decision about your weight loss journey.
Types of Weight Loss Surgery
Gastric Bypass Surgery
Gastric bypass surgery, also known as Roux-en-Y gastric bypass, is one of the most common types of weight loss surgery. It involves creating a small pouch at the top of the stomach and connecting it directly to the small intestine.
Benefits: Significant and sustained weight loss, improved obesity-related conditions (such as type 2 diabetes and high blood pressure).
Risks: Nutrient deficiencies, dumping syndrome, surgical complications.
Sleeve Gastrectomy
Sleeve gastrectomy, or gastric sleeve surgery, involves removing a large portion of the stomach, leaving a tube-like structure. This smaller stomach limits the amount of food you can eat.
Benefits: Significant weight loss, fewer complications than gastric bypass, reduced hunger.
Risks: Potential for nutrient deficiencies, surgical risks, gastroesophageal reflux.
Adjustable Gastric Banding
Adjustable gastric banding involves placing a silicone band around the upper part of the stomach to create a small pouch. The band can be adjusted to control the rate of food passage.
Benefits: Adjustable and reversible, shorter recovery time, less invasive.
Risks: Slower weight loss, band slippage, potential for reoperation.
Biliopancreatic Diversion with Duodenal Switch (BPD/DS)
BPD/DS is a more complex procedure that involves two steps: a sleeve gastrectomy followed by rerouting the intestines to reduce calorie absorption.
Benefits: Significant weight loss, effective for severe obesity, improved obesity-related conditions.
Risks: Higher risk of complications, nutrient deficiencies, longer recovery time.
Intragastric Balloon
The intragastric balloon procedure involves placing a deflated balloon into the stomach and then inflating it to reduce the amount of food the stomach can hold.
Learn More: Intragastric Balloon Procedure
Benefits: Non-surgical, temporary, quick recovery.
Risks: Nausea, vomiting, balloon deflation.
Who is a Candidate for Weight Loss Surgery?
Weight loss surgery is typically considered for individuals who:
Have a BMI of 40 or higher, or a BMI of 35 or higher with obesity-related health conditions.
Have tried other weight loss methods without long-term success.
Are committed to making lifestyle changes and follow-up care.Do not have medical conditions that make surgery too risky.
Benefits of Weight Loss Surgery
Significant and sustained weight loss: Helps in achieving and maintaining a healthy weight.
Improvement in obesity-related conditions: Conditions such as type 2 diabetes, high blood pressure, sleep apnea, and heart disease can improve or resolve.
Enhanced quality of life: Increased mobility, improved mental health, and better overall well-being.
Risks and Considerations
Weight loss surgery, like any surgical procedure, carries risks. These may include:
Surgical complications: Infection, blood clots, and adverse reactions to anesthesia.
Nutrient deficiencies: Due to reduced food intake and absorption.
Long-term lifestyle changes: Commitment to a healthy diet, regular exercise, and follow-up care is essential for success.
Weight loss surgery can be a life-changing option for those struggling with severe obesity. By understanding the different types of surgery, their benefits, and risks, you can make an informed decision. Consult with a healthcare provider to determine if weight loss surgery is right for you and to discuss the best surgical option based on your individual needs and health condition.
|
__label__pos
| 0.999876 |
Natural number
From Infogalactic: the planetary knowledge core
(Redirected from Non-negative integer)
Jump to: navigation, search
Natural numbers can be used for counting (one apple, two apples, three apples, …)
In mathematics, the natural numbers are those used for counting (as in "there are six coins on the table") and ordering (as in "this is the third largest city in the country"). In common language, words used for counting are "cardinal numbers" and words used for ordering are "ordinal numbers".
Some authors begin the natural numbers with 0, corresponding to the non-negative integers 0, 1, 2, 3, …, whereas others start with 1, corresponding to the positive integers 1, 2, 3, ….[1][2][3][4] Texts that exclude zero from the natural numbers sometimes refer to the natural numbers together with zero as the whole numbers, but in other writings, that term is used instead for the integers (including negative integers).
The natural numbers are the basis from which many other number sets may be built by extension: the integers, by including an additive inverse (-n) for each natural number n (and zero, if it is not there already, as its own additive inverse); the rational numbers, by including a multiplicative inverse (1/n) for each integer number n; the real numbers by including with the rationals the (converging) Cauchy sequences of rationals; the complex numbers, by including with the real numbers the unresolved square root of minus one; and so on.[5][6] These chains of extensions make the natural numbers canonically embedded (identified) in the other number systems.
Properties of the natural numbers, such as divisibility and the distribution of prime numbers, are studied in number theory. Problems concerning counting and ordering, such as partitioning and enumerations, are studied in combinatorics.
In common language, for example in primary school, natural numbers may be called counting numbers[7] to contrast the discreteness of counting to the continuity of measurement, established by the real numbers.
The natural numbers can, at times, appear as a convenient set of names (labels), that is, as what linguists call nominal numbers, foregoing many or all of the properties of being a number in a mathematical sense.
History
Ancient roots
The Ishango bone (on exhibition at the Royal Belgian Institute of Natural Sciences)[8][9][10] is believed to have been used 20,000 years ago for natural number arithmetic.
The most primitive method of representing a natural number is to put down a mark for each object. Later, a set of objects could be tested for equality, excess or shortage, by striking out a mark and removing an object from the set.
The first major advance in abstraction was the use of numerals to represent numbers. This allowed systems to be developed for recording large numbers. The ancient Egyptians developed a powerful system of numerals with distinct hieroglyphs for 1, 10, and all the powers of 10 up to over 1 million. A stone carving from Karnak, dating from around 1500 BC and now at the Louvre in Paris, depicts 276 as 2 hundreds, 7 tens, and 6 ones; and similarly for the number 4,622. The Babylonians had a place-value system based essentially on the numerals for 1 and 10, using base sixty, so that the symbol for sixty was the same as the symbol for one, its value being determined from context.[11]
A much later advance was the development of the idea that 0 can be considered as a number, with its own numeral. The use of a 0 digit in place-value notation (within other numbers) dates back as early as 700 BC by the Babylonians, but they omitted such a digit when it would have been the last symbol in the number.[12] The Olmec and Maya civilizations used 0 as a separate number as early as the 1st century BC, but this usage did not spread beyond Mesoamerica.[13][14] The use of a numeral 0 in modern times originated with the Indian mathematician Brahmagupta in 628. However, 0 had been used as a number in the medieval computus (the calculation of the date of Easter), beginning with Dionysius Exiguus in 525, without being denoted by a numeral (standard Roman numerals do not have a symbol for 0); instead nulla (or the genitive form nullae) from nullus, the Latin word for "none", was employed to denote a 0 value.[15]
The first systematic study of numbers as abstractions is usually credited to the Greek philosophers Pythagoras and Archimedes. Some Greek mathematicians treated the number 1 differently than larger numbers, sometimes even not as a number at all.[16]
Independent studies also occurred at around the same time in India, China, and Mesoamerica.[17]
Modern definitions
In 19th century Europe, there was mathematical and philosophical discussion about the exact nature of the natural numbers. A school of Naturalism stated that the natural numbers were a direct consequence of the human psyche. Henri Poincaré was one of its advocates, as was Leopold Kronecker who summarized "God made the integers, all else is the work of man".
In opposition to the Naturalists, the constructivists saw a need to improve the logical rigor in the foundations of mathematics.[18] In the 1860s, Hermann Grassmann suggested a recursive definition for natural numbers thus stating they were not really natural but a consequence of definitions. Later, two classes of such formal definitions were constructed; later, they were shown to be equivalent in most practical applications.
Set-theoretical definitions of natural numbers were initiated by Frege and he initially defined a natural number as the class of all sets that are in one-to-one correspondence with a particular set, but this definition turned out to lead to paradoxes including Russell's paradox. Therefore, this formalism was modified so that a natural number is defined as a particular set, and any set that can be put into one-to-one correspondence with that set is said to have that number of elements.[19]
The second class of definitions was introduced by Giuseppe Peano and is now called Peano arithmetic. It is based on an axiomatization of the properties of ordinal numbers: each natural number has a successor and every non-zero natural number has a unique predecessor. Peano arithmetic is equiconsistent with several weak systems of set theory. One such system is ZFC with the axiom of infinity replaced by its negation. Theorems that can be proved in ZFC but cannot be proved using the Peano Axioms include Goodstein's theorem.[20]
With all these definitions it is convenient to include 0 (corresponding to the empty set) as a natural number. Including 0 is now the common convention among set theorists[21] and logicians.[22] Other mathematicians also include 0[4] although many have kept the older tradition and take 1 to be the first natural number.[23] Computer scientists often start from zero when enumerating items like loop counters and string- or array- elements.[24][25]
Notation
The double-struck capital N symbol, often used to denote the set of all natural numbers (see List of mathematical symbols).
Mathematicians use N or (an N in blackboard bold) to refer to the set of all natural numbers. This set is countably infinite: it is infinite but countable by definition. This is also expressed by saying that the cardinal number of the set is aleph-naught 0.[26]
To be unambiguous about whether 0 is included or not, sometimes an index (or superscript) "0" is added in the former case, and a superscript "*" or subscript "1" is added in the latter case:[citation needed]
0 = ℕ0 = {0, 1, 2, …}
* = ℕ+ = ℕ1 = ℕ>0 = {1, 2, …}.
Properties
Addition
One can recursively define an addition on the natural numbers by setting a + 0 = a and a + S(b) = S(a + b) for all a, b. Here S should be read as "successor". This turns the natural numbers (ℕ, +) into a commutative monoid with identity element 0, the so-called free object with one generator. This monoid satisfies the cancellation property and can be embedded in a group (in the mathematical sense of the word group). The smallest group containing the natural numbers is the integers.
If 1 is defined as S(0), then b + 1 = b + S(0) = S(b + 0) = S(b). That is, b + 1 is simply the successor of b.
Multiplication
Analogously, given that addition has been defined, a multiplication × can be defined via a × 0 = 0 and a × S(b) = (a × b) + a. This turns (ℕ*, ×) into a free commutative monoid with identity element 1; a generator set for this monoid is the set of prime numbers.
Relationship between addition and multiplication
Addition and multiplication are compatible, which is expressed in the distribution law: a × (b + c) = (a × b) + (a × c). These properties of addition and multiplication make the natural numbers an instance of a commutative semiring. Semirings are an algebraic generalization of the natural numbers where multiplication is not necessarily commutative. The lack of additive inverses, which is equivalent to the fact that is not closed under subtraction, means that is not a ring; instead it is a semiring (also known as a rig).
If the natural numbers are taken as "excluding 0", and "starting at 1", the definitions of + and × are as above, except that they begin with a + 1 = S(a) and a × 1 = a.
Order
In this section, juxtaposed variables such as ab indicate the product a × b, and the standard order of operations is assumed.
A total order on the natural numbers is defined by letting ab if and only if there exists another natural number c with a + c = b. This order is compatible with the arithmetical operations in the following sense: if a, b and c are natural numbers and ab, then a + cb + c and acbc. An important property of the natural numbers is that they are well-ordered: every non-empty set of natural numbers has a least element. The rank among well-ordered sets is expressed by an ordinal number; for the natural numbers this is expressed as ω.
Division
In this section, juxtaposed variables such as ab indicate the product a × b, and the standard order of operations is assumed.
While it is in general not possible to divide one natural number by another and get a natural number as result, the procedure of division with remainder is available as a substitute: for any two natural numbers a and b with b ≠ 0 there are natural numbers q and r such that
a = bq + r and r < b.
The number q is called the quotient and r is called the remainder of division of a by b. The numbers q and r are uniquely determined by a and b. This Euclidean division is key to several other properties (divisibility), algorithms (such as the Euclidean algorithm), and ideas in number theory.
Algebraic properties satisfied by the natural numbers
The addition (+) and multiplication (×) operations on natural numbers as defined above have several algebraic properties:
• Closure under addition and multiplication: for all natural numbers a and b, both a + b and a × b are natural numbers.
• Associativity: for all natural numbers a, b, and c, a + (b + c) = (a + b) + c and a × (b × c) = (a × b) × c.
• Commutativity: for all natural numbers a and b, a + b = b + a and a × b = b × a.
• Existence of identity elements: for every natural number a, a + 0 = a and a × 1 = a.
• Distributivity of multiplication over addition for all natural numbers a, b, and c, a × (b + c) = (a × b) + (a × c).
• No nonzero zero divisors: if a and b are natural numbers such that a × b = 0, then a = 0 or b = 0.
Generalizations
Two generalizations of natural numbers arise from the two uses:
• A natural number can be used to express the size of a finite set; more generally a cardinal number is a measure for the size of a set also suitable for infinite sets; this refers to a concept of "size" such that if there is a bijection between two sets they have the same size. The set of natural numbers itself and any other countably infinite set has cardinality aleph-null (0).
• Linguistic ordinal numbers "first", "second", "third" can be assigned to the elements of a totally ordered finite set, and also to the elements of well-ordered countably infinite sets like the set of natural numbers itself. This can be generalized to ordinal numbers which describe the position of an element in a well-ordered set in general. An ordinal number is also used to describe the "size" of a well-ordered set, in a sense different from cardinality: if there is an order isomorphism between two well-ordered sets they have the same ordinal number. The first ordinal number that is not a natural number is expressed as ω; this is also the ordinal number of the set of natural numbers itself.
Many well-ordered sets with cardinal number 0 have an ordinal number greater than ω (the latter is the lowest possible). The least ordinal of cardinality 0 (i.e., the initial ordinal) is ω.
For finite well-ordered sets, there is one-to-one correspondence between ordinal and cardinal numbers; therefore they can both be expressed by the same natural number, the number of elements of the set. This number can also be used to describe the position of an element in a larger finite, or an infinite, sequence.
A countable non-standard model of arithmetic satisfying the Peano Arithmetic (i.e., the first-order Peano axioms) was developed by Skolem in 1933. The hypernatural numbers are an uncountable model that can be constructed from the ordinary natural numbers via the ultrapower construction.
Georges Reeb used to claim provocatively that The naïve integers don't fill up . Other generalizations are discussed in the article on numbers.
Formal definitions
Peano axioms
Many properties of the natural numbers can be derived from the Peano axioms.[27][28]
• Axiom One: 0 is a natural number.
• Axiom Two: Every natural number has a successor.
• Axiom Three: 0 is not the successor of any natural number.
• Axiom Four: If the successor of x equals the successor of y, then x equals y.
• Axiom Five (the Axiom of Induction): If a statement is true of 0, and if the truth of that statement for a number implies its truth for the successor of that number, then the statement is true for every natural number.
These are not the original axioms published by Peano, but are named in his honor. Some forms of the Peano axioms have 1 in place of 0. In ordinary arithmetic, the successor of x is x + 1. Replacing Axiom Five by an axiom schema one obtains a (weaker) first-order theory called Peano Arithmetic.
Constructions based on set theory
von Neumann construction
In the area of mathematics called set theory, a special case of the von Neumann ordinal construction [29] defines the natural numbers as follows:
• Set 0 = { }, the empty set,
• Define S(a) = a ∪ {a} for every set a. S(a) is the successor of a, and S is called the successor function.
• By the axiom of infinity, there exists a set which contains 0 and is closed under the successor function. Such sets are said to be 'inductive'. The intersection of all such inductive sets is defined to be the set of natural numbers. It can be checked that the set of natural numbers satisfies the Peano axioms.
• It follows that each natural number is equal to the set of all natural numbers less than it:
• 0 = { },
• 1 = 0 ∪ {0} = {0} = {{ }},
• 2 = 1 ∪ {1} = {0, 1} = {{ }, {{ }}},
• 3 = 2 ∪ {2} = {0, 1, 2} = {{ }, {{ }}, {{ }, {{ }}}},
• n = n−1 ∪ {n−1} = {0, 1, …, n−1} = {{ }, {{ }}, …, {{ }, {{ }}, …}}, etc.
With this definition, a natural number n is a particular set with n elements, and nm if and only if n is a subset of m.
Also, with this definition, different possible interpretations of notations like n (n-tuples versus mappings of n into ) coincide.
Even if one does not accept the axiom of infinity and therefore cannot accept that the set of all natural numbers exists, it is still possible to define any one of these sets.
Other constructions
Although the standard construction is useful, it is not the only possible construction. Zermelo's construction goes as follows:
• Set 0 = { }
• Define S(a) = {a},
• It then follows that
• 0 = { },
• 1 = {0} = {{ }},
• 2 = {1} = {{{ }}},
• n = {n−1} = {{{…}}}, etc.
Each natural number is then equal to the set of the natural number preceding it.
See also
Notes
1. Weisstein, Eric W., "Natural Number", MathWorld.
2. "natural number", Merriam-Webster.com, Merriam-Webster, retrieved 4 October 2014<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
3. Carothers (2000) says: "ℕ is the set of natural numbers (positive integers)" (p. 3)
4. 4.0 4.1 Mac Lane & Birkhoff (1999) include zero in the natural numbers: 'Intuitively, the set ℕ = {0, 1, 2, …} of all natural numbers may be described as follows: contains an "initial" number 0; …'. They follow that with their version of the Peano Postulates. (p. 15)
5. Mendelson (2008) says: "The whole fantastic hierarchy of number systems is built up by purely set-theoretic means from a few simple assumptions about natural numbers." (Preface, p. x)
6. Bluman (2010): "Numbers make up the foundation of mathematics." (p. 1)
7. Weisstein, Eric W., "Counting Number", MathWorld.
8. Introduction, Royal Belgian Institute of Natural Sciences, Brussels, Belgium.
9. Flash presentation, Royal Belgian Institute of Natural Sciences, Brussels, Belgium.
10. The Ishango Bone, Democratic Republic of the Congo, on permanent display at the Royal Belgian Institute of Natural Sciences, Brussels, Belgium. UNESCO's Portal to the Heritage of Astronomy
11. Georges Ifrah, The Universal History of Numbers, Wiley, 2000, ISBN 0-471-37568-3
12. "A history of Zero". MacTutor History of Mathematics. Retrieved 2013-01-23. … a tablet found at Kish … thought to date from around 700 BC, uses three hooks to denote an empty place in the positional notation. Other tablets dated from around the same time use a single hook for an empty place<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
13. Mann, Charles C. (2005), 1491: New Revelations Of The Americas Before Columbus, Knopf, p. 19, ISBN 9781400040063<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>.
14. Evans, Brian (2014), "Chapter 10. Pre-Columbian Mathematics: The Olmec, Maya, and Inca Civilizations", The Development of Mathematics Throughout the Centuries: A Brief History in a Cultural Context, John Wiley & Sons, ISBN 9781118853979<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>.
15. Michael L. Gorodetsky (2003-08-25). "Cyclus Decemnovennalis Dionysii – Nineteen year cycle of Dionysius". Hbar.phys.msu.ru. Retrieved 2012-02-13.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
16. This convention is used, for example, in Euclid's Elements, see Book VII, definitions 1 and 2.
17. Morris Kline, Mathematical Thought From Ancient to Modern Times, Oxford University Press, 1990 [1972], ISBN 0-19-506135-7
18. "Much of the mathematical work of the twentieth century has been devoted to examining the logical foundations and structure of the subject." (Eves 1990, p. 606)
19. Eves 1990, Chapter 15
20. L. Kirby; J. Paris, Accessible Independence Results for Peano Arithmetic, Bulletin of the London Mathematical Society 14 (4): 285. doi:10.1112/blms/14.4.285, 1982.
21. Bagaria, Joan. "Set Theory". The Stanford Encyclopedia of Philosophy (Winter 2014 Edition).<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
22. Goldrei, Derek (1998). "3". Classic set theory : a guided independent study (1. ed., 1. print ed.). Boca Raton, Fla. [u.a.]: Chapman & Hall/CRC. p. 33. ISBN 0-412-60610-0.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
23. This is common in texts about Real analysis. See, for example, Carothers (2000, p. 3) or Thomson, Bruckner & Bruckner (2000, p. 2).
24. Brown, Jim (1978). "In Defense of Index Origin 0". ACM SIGAPL APL Quote Quad. 9 (2): 7–7. doi:10.1145/586050.586053. Retrieved 19 January 2015.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
25. Hui, Roger. "Is Index Origin 0 a Hindrance?". http://www.jsoftware.com. JSoftware / Roger Hui. Retrieved 19 January 2015. External link in |website= (help)<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
26. Weisstein, Eric W., "Cardinal Number", MathWorld.
27. G.E. Mints (originator), "Peano axioms", Encyclopedia of Mathematics, Springer, in cooperation with the European Mathematical Society, retrieved 8 October 2014<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
28. Hamilton (1988) calls them "Peano's Postulates" and begins with "1. 0 is a natural number." (p. 117f)
Halmos (1960) uses the language of set theory instead of the language of arithmetic for his five axioms. He begins with "(I) 0 ∈ ω (where, of course, 0 = ∅" (ω is the set of all natural numbers). (p. 46)
Morash (1991) gives "a two-part axiom" in which the natural numbers begin with 1. (Section 10.1: An Axiomatization for the System of Positive Integers)
29. Von Neumann 1923
References
External links
|
__label__pos
| 0.969738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.