text
stringlengths 14
5.77M
| meta
dict | __index_level_0__
int64 0
9.97k
⌀ |
|---|---|---|
{"url":"http:\/\/mymathforum.com\/geometry\/341075-spherical-triangle.html","text":"My Math Forum Spherical triangle\n\n Geometry Geometry Math Forum\n\n July 2nd, 2017, 12:13 PM #1 Newbie \u00a0 Joined: Jul 2017 From: moscow Posts: 2 Thanks: 0 Spherical triangle I want to find angles of spherical traingle. The geographical coordinated of the points are 0, 0 0.000001, 0 0, 0.000001 I expect that agnles will be 90, a bit more than 45 and a bit more than 45 degrees. I use great circule distance formula and spherical cosine formula https:\/\/en.wikipedia.org\/wiki\/Great-circle_distance https:\/\/en.wikipedia.org\/wiki\/Spherical_law_of_cosines The central angles are pretty small and they seems correct. They are 2,46827E-8 1,74533E-8 1,74533E-8 But spherical law of cosines give strange results. I got the following angles in radians 0,687 0,687 1,9438 or in degrees 39,3627 39,3627 111,3746 It seems there is a mistake. Could you please help me.\n July 2nd, 2017, 02:02 PM #2 Global Moderator \u00a0 Joined: May 2007 Posts: 6,256 Thanks: 508 It would be helpful if you showed intermediate results.\nJuly 3rd, 2017, 05:03 PM \u00a0 #3\nGlobal Moderator\n\nJoined: May 2007\n\nPosts: 6,256\nThanks: 508\n\nYou need to specify the radius of the sphere.\n\nQuote:\n The central angles are pretty small and they seems correct. They are 2,46827E-8 1,74533E-8 1,74533E-8\nWhat are these quantities ? Central angles?\n\n July 4th, 2017, 12:06 PM #4 Newbie \u00a0 Joined: Jul 2017 From: moscow Posts: 2 Thanks: 0 Yes. They are central agnles in radians\nJuly 4th, 2017, 12:40 PM \u00a0 #5\nGlobal Moderator\n\nJoined: May 2007\n\nPosts: 6,256\nThanks: 508\n\nQuote:\n Originally Posted by zock Yes. They are central agnles in radians\nCentral angles of what? Try to be specific.\n\nAlso you need a radius for the sphere (1?).\n\nLast edited by mathman; July 4th, 2017 at 12:49 PM.\n\n July 5th, 2017, 05:21 PM #6 Global Moderator \u00a0 Joined: May 2007 Posts: 6,256 Thanks: 508 I will assume the central angle is with reference to center of the sphere with radius 1. In that case the two equal sides have angles exactly equal to the sides (0.000001). The third side is very slightly less than sqrt(2) times other side length.\n\n Thread Tools Display Modes Linear Mode\n\n Similar Threads Thread Thread Starter Forum Replies Last Post Kinroh Calculus 3 March 29th, 2015 07:28 AM jhartc Differential Equations 0 December 6th, 2014 03:37 PM Shamieh Calculus 17 September 25th, 2013 05:39 PM proglote Physics 7 August 17th, 2011 11:29 PM TTB3 Real Analysis 2 February 16th, 2009 10:42 PM\n\n Contact - Home - Forums - Cryptocurrency Forum - Top","date":"2017-07-24 14:30:01","metadata":"{\"extraction_info\": {\"found_math\": false, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.8108038902282715, \"perplexity\": 5205.742828978391}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2017-30\/segments\/1500549424884.51\/warc\/CC-MAIN-20170724142232-20170724162232-00399.warc.gz\"}"}
| null | null |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Fri Jun 20 06:34:21 EDT 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.core.CoreContainer (Solr 4.9.0 API)</title>
<meta name="date" content="2014-06-20">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.core.CoreContainer (Solr 4.9.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/core/class-use/CoreContainer.html" target="_top">Frames</a></li>
<li><a href="CoreContainer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.solr.core.CoreContainer" class="title">Uses of Class<br>org.apache.solr.core.CoreContainer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.client.solrj.embedded">org.apache.solr.client.solrj.embedded</a></td>
<td class="colLast">
<div class="block">
SolrJ client implementations for embedded solr access.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.solr.cloud">org.apache.solr.cloud</a></td>
<td class="colLast">
<div class="block">
Classes for dealing with ZooKeeper when operating in <a href="http://wiki.apache.org/solr/SolrCloud">SolrCloud</a> mode.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.core">org.apache.solr.core</a></td>
<td class="colLast">
<div class="block">
Core classes implementin Solr internals and the management of <a href="../../../../../org/apache/solr/core/SolrCore.html" title="class in org.apache.solr.core"><code>SolrCore</code></a>s</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.solr.handler.admin">org.apache.solr.handler.admin</a></td>
<td class="colLast">
<div class="block">
<a href="../../../../../org/apache/solr/request/SolrRequestHandler.html" title="interface in org.apache.solr.request"><code>SolrRequestHandler</code></a> implementations for powering he Solr Admin UI</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.servlet">org.apache.solr.servlet</a></td>
<td class="colLast">
<div class="block">
Servlet related classes for powering the Solr HTTP API</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.solr.update">org.apache.solr.update</a></td>
<td class="colLast">
<div class="block">
APIs and classes for managing index updates</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.solr.client.solrj.embedded">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/client/solrj/embedded/package-summary.html">org.apache.solr.client.solrj.embedded</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../org/apache/solr/client/solrj/embedded/package-summary.html">org.apache.solr.client.solrj.embedded</a> declared as <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">EmbeddedSolrServer.</span><code><strong><a href="../../../../../org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html#coreContainer">coreContainer</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/client/solrj/embedded/package-summary.html">org.apache.solr.client.solrj.embedded</a> that return <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">EmbeddedSolrServer.</span><code><strong><a href="../../../../../org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html#getCoreContainer()">getCoreContainer</a></strong>()</code>
<div class="block">Getter method for the CoreContainer</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../org/apache/solr/client/solrj/embedded/package-summary.html">org.apache.solr.client.solrj.embedded</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html#EmbeddedSolrServer(org.apache.solr.core.CoreContainer, java.lang.String)">EmbeddedSolrServer</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> coreContainer,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> coreName)</code>
<div class="block">Creates a SolrServer.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.cloud">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> declared as <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">LeaderInitiatedRecoveryThread.</span><code><strong><a href="../../../../../org/apache/solr/cloud/LeaderInitiatedRecoveryThread.html#coreContainer">coreContainer</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><span class="strong">ZkController.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkController.html#bootstrapConf(org.apache.solr.common.cloud.SolrZkClient, org.apache.solr.core.CoreContainer, java.lang.String)">bootstrapConf</a></strong>(<a href="../../../../../../solr-solrj/org/apache/solr/common/cloud/SolrZkClient.html?is-external=true" title="class or interface in org.apache.solr.common.cloud">SolrZkClient</a> zkClient,
<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> solrHome)</code>
<div class="block">If in SolrCloud mode, upload config sets for each SolrCore in solr.xml.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/cloud/LeaderInitiatedRecoveryThread.html#LeaderInitiatedRecoveryThread(org.apache.solr.cloud.ZkController, org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String, org.apache.solr.common.cloud.ZkCoreNodeProps, int)">LeaderInitiatedRecoveryThread</a></strong>(<a href="../../../../../org/apache/solr/cloud/ZkController.html" title="class in org.apache.solr.cloud">ZkController</a> zkController,
<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> collection,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> shardId,
<a href="../../../../../../solr-solrj/org/apache/solr/common/cloud/ZkCoreNodeProps.html?is-external=true" title="class or interface in org.apache.solr.common.cloud">ZkCoreNodeProps</a> nodeProps,
int maxTries)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/cloud/RecoveryStrategy.html#RecoveryStrategy(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.cloud.RecoveryStrategy.RecoveryListener)">RecoveryStrategy</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd,
<a href="../../../../../org/apache/solr/cloud/RecoveryStrategy.RecoveryListener.html" title="interface in org.apache.solr.cloud">RecoveryStrategy.RecoveryListener</a> recoveryListener)</code> </td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/cloud/SyncStrategy.html#SyncStrategy(org.apache.solr.core.CoreContainer)">SyncStrategy</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/cloud/ZkController.html#ZkController(org.apache.solr.core.CoreContainer, java.lang.String, int, int, java.lang.String, java.lang.String, java.lang.String, int, int, boolean, org.apache.solr.cloud.CurrentCoreDescriptorProvider)">ZkController</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> zkServerAddress,
int zkClientTimeout,
int zkClientConnectTimeout,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> localHost,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> locaHostPort,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> localHostContext,
int leaderVoteWait,
int leaderConflictResolveWait,
boolean genericCoreNodeNames,
<a href="../../../../../org/apache/solr/cloud/CurrentCoreDescriptorProvider.html" title="class in org.apache.solr.cloud">CurrentCoreDescriptorProvider</a> registerOnReconnect)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.core">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/core/package-summary.html">org.apache.solr.core</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/core/package-summary.html">org.apache.solr.core</a> that return <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CoreContainer.</span><code><strong><a href="../../../../../org/apache/solr/core/CoreContainer.html#createAndLoad(java.lang.String, java.io.File)">createAndLoad</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> solrHome,
<a href="http://download.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> configFile)</code>
<div class="block">Create a new CoreContainer and load its cores</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CoreDescriptor.</span><code><strong><a href="../../../../../org/apache/solr/core/CoreDescriptor.html#getCoreContainer()">getCoreContainer</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/core/package-summary.html">org.apache.solr.core</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a></code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#buildCoreDescriptor(java.io.File, org.apache.solr.core.CoreContainer)">buildCoreDescriptor</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> propertiesFile,
<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#create(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">create</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#create(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">create</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code>
<div class="block">Make new cores available for discovery</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#create(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">create</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#delete(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">delete</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#delete(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">delete</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code>
<div class="block">Ensure that the core definitions from the passed in CoreDescriptors
are not available for discovery</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#delete(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">delete</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>></code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#discover(org.apache.solr.core.CoreContainer)">discover</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>></code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#discover(org.apache.solr.core.CoreContainer)">discover</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code>
<div class="block">Load all the CoreDescriptors from persistence store</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>></code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#discover(org.apache.solr.core.CoreContainer)">discover</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">ZkContainer.</span><code><strong><a href="../../../../../org/apache/solr/core/ZkContainer.html#initZooKeeper(org.apache.solr.core.CoreContainer, java.lang.String, org.apache.solr.core.ConfigSolr)">initZooKeeper</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> solrHome,
<a href="../../../../../org/apache/solr/core/ConfigSolr.html" title="class in org.apache.solr.core">ConfigSolr</a> config)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">ZkContainer.</span><code><strong><a href="../../../../../org/apache/solr/core/ZkContainer.html#initZooKeeper(org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, int, int, boolean)">initZooKeeper</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> solrHome,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> zkHost,
int zkClientTimeout,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> hostPort,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> hostContext,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> host,
int leaderVoteWait,
int leaderConflictResolveWait,
boolean genericCoreNodeNames)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html" title="class in org.apache.solr.handler.admin">CoreAdminHandler</a></code></td>
<td class="colLast"><span class="strong">SolrResourceLoader.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrResourceLoader.html#newAdminHandlerInstance(org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String...)">newAdminHandlerInstance</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> coreContainer,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> cname,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>... subpackages)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#persist(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">persist</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#persist(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">persist</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code>
<div class="block">Ensure that the core definitions from the passed in CoreDescriptors
will persist across container restarts.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#persist(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor...)">persist</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a>... coreDescriptors)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#rename(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">rename</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> oldCD,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> newCD)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#rename(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">rename</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> oldCD,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> newCD)</code>
<div class="block">Persist the new name of a renamed core</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#rename(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">rename</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> oldCD,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> newCD)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrXMLCoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/SolrXMLCoresLocator.html#swap(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">swap</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd1,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd2)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CoresLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CoresLocator.html#swap(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">swap</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd1,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd2)</code>
<div class="block">Swap two core definitions</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CorePropertiesLocator.</span><code><strong><a href="../../../../../org/apache/solr/core/CorePropertiesLocator.html#swap(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor, org.apache.solr.core.CoreDescriptor)">swap</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd1,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd2)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../org/apache/solr/core/package-summary.html">org.apache.solr.core</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/core/CoreDescriptor.html#CoreDescriptor(org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String)">CoreDescriptor</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> container,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceDir)</code>
<div class="block">Create a new CoreDescriptor with a given name and instancedir</div>
</td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/core/CoreDescriptor.html#CoreDescriptor(org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String, java.util.Properties)">CoreDescriptor</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> container,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceDir,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> coreProps)</code>
<div class="block">Create a new CoreDescriptor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/core/CoreDescriptor.html#CoreDescriptor(org.apache.solr.core.CoreContainer, java.lang.String, java.lang.String, java.util.Properties, org.apache.solr.common.params.SolrParams)">CoreDescriptor</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> container,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceDir,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a> coreProps,
<a href="../../../../../../solr-solrj/org/apache/solr/common/params/SolrParams.html?is-external=true" title="class or interface in org.apache.solr.common.params">SolrParams</a> params)</code>
<div class="block">Create a new CoreDescriptor.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.handler.admin">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/handler/admin/package-summary.html">org.apache.solr.handler.admin</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../org/apache/solr/handler/admin/package-summary.html">org.apache.solr.handler.admin</a> declared as <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CollectionsHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CollectionsHandler.html#coreContainer">coreContainer</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CoreAdminHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html#coreContainer">coreContainer</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">InfoHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/InfoHandler.html#coreContainer">coreContainer</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/handler/admin/package-summary.html">org.apache.solr.handler.admin</a> that return <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CollectionsHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CollectionsHandler.html#getCoreContainer()">getCoreContainer</a></strong>()</code>
<div class="block">The instance of CoreContainer this handler handles.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">CoreAdminHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html#getCoreContainer()">getCoreContainer</a></strong>()</code>
<div class="block">The instance of CoreContainer this handler handles.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">InfoHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/InfoHandler.html#getCoreContainer()">getCoreContainer</a></strong>()</code>
<div class="block">The instance of CoreContainer this handler handles.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/handler/admin/package-summary.html">org.apache.solr.handler.admin</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected static <a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a></code></td>
<td class="colLast"><span class="strong">CoreAdminHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html#buildCoreDescriptor(org.apache.solr.common.params.SolrParams, org.apache.solr.core.CoreContainer)">buildCoreDescriptor</a></strong>(<a href="../../../../../../solr-solrj/org/apache/solr/common/params/SolrParams.html?is-external=true" title="class or interface in org.apache.solr.common.params">SolrParams</a> params,
<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> container)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../solr-solrj/org/apache/solr/common/util/NamedList.html?is-external=true" title="class or interface in org.apache.solr.common.util">NamedList</a><<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>></code></td>
<td class="colLast"><span class="strong">CoreAdminHandler.</span><code><strong><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html#getCoreStatus(org.apache.solr.core.CoreContainer, java.lang.String, boolean)">getCoreStatus</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cores,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> cname,
boolean isIndexInfoNeeded)</code>
<div class="block">Returns the core status for a particular core.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../org/apache/solr/handler/admin/package-summary.html">org.apache.solr.handler.admin</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/handler/admin/CollectionsHandler.html#CollectionsHandler(org.apache.solr.core.CoreContainer)">CollectionsHandler</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> coreContainer)</code>
<div class="block">Overloaded ctor to inject CoreContainer into the handler.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/handler/admin/CoreAdminHandler.html#CoreAdminHandler(org.apache.solr.core.CoreContainer)">CoreAdminHandler</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> coreContainer)</code>
<div class="block">Overloaded ctor to inject CoreContainer into the handler.</div>
</td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/handler/admin/InfoHandler.html#InfoHandler(org.apache.solr.core.CoreContainer)">InfoHandler</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> coreContainer)</code>
<div class="block">Overloaded ctor to inject CoreContainer into the handler.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/handler/admin/LoggingHandler.html#LoggingHandler(org.apache.solr.core.CoreContainer)">LoggingHandler</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../org/apache/solr/handler/admin/SystemInfoHandler.html#SystemInfoHandler(org.apache.solr.core.CoreContainer)">SystemInfoHandler</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.servlet">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/servlet/package-summary.html">org.apache.solr.servlet</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../org/apache/solr/servlet/package-summary.html">org.apache.solr.servlet</a> declared as <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">SolrDispatchFilter.</span><code><strong><a href="../../../../../org/apache/solr/servlet/SolrDispatchFilter.html#cores">cores</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/servlet/package-summary.html">org.apache.solr.servlet</a> that return <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">SolrDispatchFilter.</span><code><strong><a href="../../../../../org/apache/solr/servlet/SolrDispatchFilter.html#createCoreContainer()">createCoreContainer</a></strong>()</code>
<div class="block">Override this to change CoreContainer initialization</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></code></td>
<td class="colLast"><span class="strong">SolrDispatchFilter.</span><code><strong><a href="../../../../../org/apache/solr/servlet/SolrDispatchFilter.html#getCores()">getCores</a></strong>()</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.update">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> in <a href="../../../../../org/apache/solr/update/package-summary.html">org.apache.solr.update</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/update/package-summary.html">org.apache.solr.update</a> with parameters of type <a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><span class="strong">SolrCoreState.</span><code><strong><a href="../../../../../org/apache/solr/update/SolrCoreState.html#doRecovery(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor)">doRecovery</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">DefaultSolrCoreState.</span><code><strong><a href="../../../../../org/apache/solr/update/DefaultSolrCoreState.html#doRecovery(org.apache.solr.core.CoreContainer, org.apache.solr.core.CoreDescriptor)">doRecovery</a></strong>(<a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">CoreContainer</a> cc,
<a href="../../../../../org/apache/solr/core/CoreDescriptor.html" title="class in org.apache.solr.core">CoreDescriptor</a> cd)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/apache/solr/core/CoreContainer.html" title="class in org.apache.solr.core">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/solr/core/class-use/CoreContainer.html" target="_top">Frames</a></li>
<li><a href="CoreContainer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 1,479
|
{"url":"https:\/\/www.tutorialspoint.com\/python-elements-with-same-index","text":"# Python \u2013 Elements with same index\n\nPythonServer Side ProgrammingProgramming\n\n#### Beyond Basic Programming - Intermediate Python\n\nMost Popular\n\n36 Lectures 3 hours\n\n#### Practical Machine Learning using Python\n\nBest Seller\n\n91 Lectures 23.5 hours\n\n#### Practical Data Science using Python\n\n22 Lectures 6 hours\n\nWhen it is required to display elements with same index, a simple iteration and the \u2018enumerate\u2019 attribute is used.\n\nBelow is a demonstration of the same \u2212\n\n## Example\n\nLive Demo\n\nmy_list = [33, 1, 2, 45, 41, 13, 6, 9]\n\nprint(\"The list is :\")\nprint(my_list)\n\nmy_result = []\nfor index, element in enumerate(my_list):\nif index == element:\nmy_result.append(element)\n\nprint(\"The result is :\")\nprint(my_result)\n\n## Output\n\nThe list is :\n[33, 1, 2, 45, 41, 13, 6, 9]\nThe result is :\n[1, 2, 6]\n\n## Explanation\n\n\u2022 A list is defined and displayed on the console.\n\n\u2022 An empty list is defined.\n\n\u2022 The list is iterated over, and the element is compared with the index.\n\n\u2022 If it is equal, it is appended to the empty list.\n\n\u2022 This is the output that is displayed on the console.\n\nUpdated on 06-Sep-2021 08:04:04","date":"2022-11-28 08:23:26","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.19046269357204437, \"perplexity\": 4968.562803744633}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 20, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2022-49\/segments\/1669446710488.2\/warc\/CC-MAIN-20221128070816-20221128100816-00371.warc.gz\"}"}
| null | null |
Memo to Tokyo Olympics: Purdue Boilermakers are on their way
The Purdue Boilermakers' top medal hopes are in diving, which opens its World Championships Friday in South Korea.
Memo to Tokyo Olympics: Purdue Boilermakers are on their way The Purdue Boilermakers' top medal hopes are in diving, which opens its World Championships Friday in South Korea. Check out this story on IndyStar.com: https://www.indystar.com/story/sports/2019/07/09/purdue-boilermakers-have-strong-delegation-tokyo-olympics/1683326001/
David Woods, Indianapolis Star Published 5:00 p.m. ET July 9, 2019 | Updated 4:34 p.m. ET July 10, 2019
Four-time Olympic medalist David Boudia goes for U.S. title in Indy David Woods, david.woods@indystar.com
INDIANAPOLIS -- Largely because of Doc Counsilman's swim dynasty, Indiana University has one of the strongest Olympic legacies of any college. The Hoosiers have collected 55 gold medals for the United States, a figure exceeded by just seven schools.
And while IU inevitably will add to its medal count at the 2020 Tokyo Olympics, Purdue also will have a strong delegation.
In basketball, volleyball, swimming and track and field, the Boilermakers have spent the past month showing they will have an Olympic presence. And their top medal hopes are in diving, which opens its World Championships Friday at Gwangju, South Korea.
Most recently, former Purdue outside hitter Annie Drews led Team USA to volleyball's Nations League championship. Drews scored 33 points, 32 on kills, to lead a U.S. comeback that beat Brazil 20-25, 22-25, 25-15, 25-21, 15-13 Sunday at Nanjing, China.
The U.S. team was 12-3 during stops in Bulgaria, Italy, Nebraska, China and Russia over five weeks, then won three more times in the final round.
The 6-4 Drews, a 25-year-old from Elkhart and Penn High School, was MVP of the tournament.
Another former Purdue volleyball player, Danielle Cuttino, a Ben Davis High School graduate, was named to the U.S. team for next month's Pan American Games in Lima, Peru.
Drews' exploits followed those of Robbie Hummel, who led the United States to its first 3x3 World Cup championship at Amsterdam, The Netherlands. The oft-injured Hummel, 30, retired from basketball in October 2017 but was lured back to 3x3. The United States cannot qualify for the Olympics until fall at the earliest, but Hummel is a candidate to be one of four players on the Tokyo team.
Robbie Hummel, seen shooting during the 2018 Purdue Alumni basketball game, is a candidate to be one of four players on the Tokyo team. (Photo: John Terhune/Journal & Courier,)
Then how about this credential?
Waseem Williams is the fastest man in Big Ten history.
Granted, he benefited from 5,970-foot altitude last week in Queretaro, Mexico. He won the 100 meters in 10.01 seconds, beating Purdue teammate Samson Colebrooke by two-thousandths of a second (10.002 to 10.004). That gave Williams, of Jamaica, and Colebrooke, of the Bahamas, the gold and silver medals in the under-23 North American, Central American and Caribbean (NACAC) Championships.
Williams and Colebrooke tied the Big Ten record set by Illinois' Devin Quinn in June 5 semifinals of the NCAA Championships at Austin, Texas. In the final, Williams was fourth in 10.04 and Quinn seventh. Colebrooke won gold in the NACAC 200 in 20.58 after a wind-aided semifinal of 20.41.
Purdue graduate Kara Winger, 33, will be favored to win a ninth national title in the javelin later this month at Des Moines, Iowa.
Two golds were won by former Purdue swimmer Kaersten Meitz at the World University Games in Naples, Italy. She won Wednesday's 400-meter freestyle in 4:05.80 -- ranking No. 3 in the United States and 10th in the world this year -- after a 1:58.23 leadoff sent the U.S. women on their way to victory in the 800 freestyle relay Sunday.
At the diving worlds, Purdue has four-time Olympic medalist David Boudia on 3-meter, Brandon Loschiavo on 10-meter, Steele Johnson and Ben Bramley on synchronized 10-meter, and defending world champion Steven LoBue in high diving (27-meter).
At the World University Games, former IU swimmer Zach Apple increased his haul to five gold medals Wednesday. His 47.55 anchor leg brought the United States from behind to beat Russia in the 400 medley relay. Earlier, he won the 100 and 200 freestyles in 48.01 and 1:46.80, and he took golds in the 400 and 800 freestyle relays. Another Hoosier, Ian Finnerty, set a Games record of 59.49 in winning gold in the 100 breaststroke, took bronze in the 50 breaststroke and was in the medley relay with Apple. Veronica Burchill and Claire Adams, both of Carmel, won golds in the women's 400 freestyle relay. Burchill took bronze in the 100 free in 55.05. IU signee Emily Weiss, a national high school record-holder from Yorktown, was eighth in the 100 breaststroke.
Brownsburg's Chloe Dygert Owen finished second in the individual time trial in the road nationals at Knoxville, Tennessee. The Olympic silver medalist was also fourth in the road race and sixth in the criterium. Coryn Rivera, a Marian University graduate, was second in the road race and fourth in the criterium.
Lawrence North graduate Ashley Spencer ranks No. 5 in the world in the 400-meter hurdles at 54.11. The Olympic bronze medalist finished third at Lausanne, Switzerland, last week and won Tuesday at Budapest, Hungary in 55.36.
Contact IndyStar reporter David Woods at david.woods@indystar.com or call 317-444-6195. Follow him on Twitter: @DavidWoods007.
Home to the greatest pick-up basketball in Indiana
Pacers certainly in Mike Conley's thoughts
Colts a Top 5 team? ESPN projections say yes
10 area under-the-radar teams for 2019
Will Colts take anyone in supplemental draft?
Memo to Tokyo Olympics: Boilermakers on their way
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 3,105
|
{"url":"http:\/\/tex.stackexchange.com\/questions\/87032\/horizontal-array-of-enumerated-equations?answertab=active","text":"# Horizontal array of enumerated equations\n\nThis is for use in work assignments for math students. I'd like to post multiple parts for a given question, without sacrificing too much space for this. So I want a bunch of equations arrayed horizontally. Each equation should be labeled as a), b) and so on. The labels should be aligned with the top of (the largest of) the boxes. And it would be nice if the space between equations were maximized to fill the whole width of the page.\n\nAt the moment, I use a single align* environment, with the spacing between colums that this provides. I use a \\raisebox with a manually tuned length to create place the labels in front of each. I haven't managed to span the whole width yet. The result looks like this:\n\nI thought that maybe the adjustbox package might be able to help me automate the vertical alignment, and allow me to put \\hfill between boxes to use the whole width, but so far I haven't managed to get my equations into such boxes.\n\nDo you have any experience in putting display math into an adjustbox?\nDo you know of any other package or environment which might help me in this task?\n\n-\n\nThe flalign environment, with some help if you want a padding on either side show to be useful; I have hardcode \\footnotesize for the matrices, it's easily modifiable.\n\n\\documentclass{article}\n\\usepackage{geometry}\n\\usepackage{lipsum} % just for the example\n\n\\newenvironment{exercise}[1]\n{\\text{#1) }\n\\begin{adjustbox}{valign=t}\\footnotesize$\\displaystyle} {$\\end{adjustbox}}\n\n\\begin{document}\n\\lipsum*[2]\n\\begin{flalign*}\n\\begin{exercise}{a}\n\\begin{pmatrix}\n3 & 4 & 1 & 3\\\\\n2 & 1 & 2 & 1\\\\\n2 & 6 &-2 & 1\\\\\n5 & 5 & 2 & 3\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n3\\\\9\\\\-9\\\\11\n\\end{pmatrix}\n\\end{exercise}\n&&\n\\begin{exercise}{b}\n\\begin{pmatrix}\n3 & 3 & 0 & 0\\\\\n2 & 4 & 2 & 0\\\\\n5 & 4 &-1 & 0\\\\\n3 & 6 & 1 & 2\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n0\\\\10\\\\-5\\\\11\n\\end{pmatrix}\n\\end{exercise}\n&&\n\\begin{exercise}{c}\n\\begin{pmatrix}\n2 & 0 & 0 & 2\\\\\n4 & 4 & 0 & 0\\\\\n3 & 2 & 1 &-1\\\\\n5 & 4 & 0 & 1\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n2\\\\0\\\\3\\\\1\n\\end{pmatrix}\n\\end{exercise}\n\\begin{exercise}{d}\n\\begin{pmatrix}\n3 & 4 & 1 & 3\\\\\n2 & 1 & 2 & 1\\\\\n2 & 6 &-2 & 1\\\\\n5 & 5 & 2 & 3\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n3\\\\9\\\\-9\\\\11\n\\end{pmatrix}\n\\end{exercise}\n&&\n\\begin{exercise}{e}\n\\begin{pmatrix}\n3 & 3 & 0 & 0\\\\\n2 & 4 & 2 & 0\\\\\n5 & 4 &-1 & 0\\\\\n3 & 6 & 1 & 2\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n0\\\\10\\\\-5\\\\11\n\\end{pmatrix}\n\\end{exercise}\n&&\n\\begin{exercise}{f}\n\\begin{pmatrix}\n2 & 0 & 0 & 2\\\\\n4 & 4 & 0 & 0\\\\\n3 & 2 & 1 &-1\\\\\n5 & 4 & 0 & 1\n\\end{pmatrix}\n\\cdot x =\n\\begin{pmatrix}\n2\\\\0\\\\3\\\\1\n\\end{pmatrix}\n\\end{exercise}\n\nI thought your way of putting the math into the adjustbox was what I had tried, but apparently not, as this does work. Probably forgot a \\$ somewhere. But I'm glad I asked, because flalign* is really useful for more than one row. Thanks a lot! For reference: that environment is shipped and documented with amsmath. Although the documentation doesn't look much more than a single example, but that's enough. \u2013\u00a0 MvG Dec 14 '12 at 16:41","date":"2014-09-01 11:23:35","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.7345344424247742, \"perplexity\": 252.1606190413737}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2014-35\/segments\/1409535917663.12\/warc\/CC-MAIN-20140901014517-00362-ip-10-180-136-8.ec2.internal.warc.gz\"}"}
| null | null |
{"url":"https:\/\/www.semanticscholar.org\/paper\/The-Atacama-Cosmology-Telescope%3A-A-Catalog-of-%3E4000-Hilton-Sif'on\/7c0016253223bbf5d1a6a3a64eb52b896ea3a29c","text":"# The Atacama Cosmology Telescope: A Catalog of >4000 Sunyaev\u2013Zel\u2019dovich Galaxy Clusters\n\n@article{Hilton2020TheAC,\ntitle={The Atacama Cosmology Telescope: A Catalog of >4000 Sunyaev\u2013Zel\u2019dovich Galaxy Clusters},\nauthor={M. Hilton and C. Sif'on and S. Naess and M. Madhavacheril and M. Oguri and E. Rozo and E. Rykoff and T. Abbott and S. Adhikari and M. Aguena and S. Aiola and S. Allam and S. Amodeo and A. Amon and J. Annis and B. Ansarinejad and C. Aros-Bunster and J. Austermann and S. {\\'A}vila and D. Bacon and N. Battaglia and J. Beall and D. Becker and G. Bernstein and E. Bertin and T. Bhandarkar and S. Bhargava and J. Bond and D. Brooks and D. Burke and E. Calabrese and J. Carretero and S. K. Choi and A. Choi and C. Conselice and L. Costa and M. Costanzi and D. Crichton and K. Crowley and R. Dunner and E. Denison and M. Devlin and S. Dicker and H. Diehl and J. Dietrich and P. Doel and S. Duff and A. Duivenvoorden and J. Dunkley and S. Everett and S. Ferraro and I. Ferrero and A. Fert'e and B. Flaugher and J. Frieman and P. Gallardo and J. Garc'ia-Bellido and E. Gazta{\\~n}aga and D. Gerdes and P. Giles and J. Golec and M. Gralla and S. Grandis and D. Gruen and R. Gruendl and J. Gschwend and G. Guti{\\'e}rrez and D. Han and W. Hartley and M. Hasselfield and J. Hill and G. Hilton and A. Hincks and S. Hinton and S. Ho and K. Honscheid and B. Hoyle and J. Hubmayr and K. Huffenberger and J. Hughes and A. Jaelani and B. Jain and D. James and T. Jeltema and S. Kent and M. Kind and K. Knowles and B. Koopman and K. Kuehn and O. Lahav and M. Lima and Y-T. Lin and M. Lokken and S. I. Loubser and N. MacCrann and M. Maia and T. Marriage and J. Mart{\\'i}n and J. McMahon and Peter Melchior and F. Menanteau and R. Miquel and H. Miyatake and K. Moodley and R. Morgan and T. Mroczkowski and F. Nati and L. Newburgh and M. Niemack and A. Nishizawa and R. Ogando and J. Orlowski-Scherer and L. Page and A. Palmese and B. Partridge and F. Paz-Chinch'on and P. Phakathi and A. Plazas and N. Robertson and A. Romer and A. Rosell and M. Salatino and E. S{\\'a}nchez and E. Schaan and A. Schillaci and N. Sehgal and S. Serrano and T. Shin and S. Simon and M. Smith and M. Soares-Santos and D. Spergel and S. Staggs and E. Storer and E. Suchyta and M. Swanson and G. Tarl{\\'e} and D. Thomas and C. To and H. Trac and J. Ullom and L. Vale and J. Lanen and E. Vavagiakis and J. Vicente and R. Wilkinson and Edward J. Wollack and Z. Xu and Y. Zhang},\njournal={The Astrophysical Journal Supplement Series},\nyear={2020},\nvolume={253}\n}\n\u2022 M. Hilton, +146 authors Y. Zhang\n\u2022 Published 2020\n\u2022 Physics\n\u2022 The Astrophysical Journal Supplement Series\nWe present a catalog of 4195 optically confirmed Sunyaev\u2013Zel\u2019dovich (SZ) selected galaxy clusters detected with signal-to-noise ratio >4 in 13,211 deg2 of sky surveyed by the Atacama Cosmology Telescope (ACT). Cluster candidates were selected by applying a multifrequency matched filter to 98 and 150 GHz maps constructed from ACT observations obtained from 2008 to 2018 and confirmed using deep, wide-area optical surveys. The clusters span the redshift range 0.04 < z < 1.91 (median z = 0.52). The\u2026\u00a0Expand\n9 Citations\nExploring the hydrostatic mass bias in MUSIC clusters: application to the NIKA2 mock sample\nClusters of galaxies are useful tools to constrain cosmological parameters, only if their masses can be correctly inferred from observations. In particular, X-ray and Sunyaev-Zeldovich (SZ) effectExpand\nCosmological implications of the anisotropy of ten galaxy cluster scaling relations\nThe hypothesis that the late Universe is isotropic and homogeneous is adopted by most cosmological studies. The expansion rate $H_0$ is thought to be spatially constant, while bulk flows are oftenExpand\nExploring the contamination of the DES-Y1 cluster sample with SPT-SZ selected clusters\nWe perform a cross validation of the cluster catalog selected by the red-sequence Matched-filter Probabilistic Percolation algorithm (redMaPPer) in Dark Energy Survey year 1 (DES-Y1) data by matchingExpand\nHundreds of weak lensing shear-selected clusters from the Hyper Suprime-Cam Subaru Strategic Program S19A data\nWe use the Hyper Suprime-Cam Subaru Strategic Program S19A shape catalog to construct weak lensing shear-selected cluster samples. From aperture mass maps covering \u223c 510 deg created using a truncatedExpand\nLensed CMB power spectrum biases from masking extragalactic sources\n\u2022 Physics\n\u2022 2021\nThe cosmic microwave background (CMB) is gravitationally lensed by large-scale structure, which distorts observations of the primordial anisotropies in any given direction. Averaged over the sky,Expand\nMERGHERS pilot: MeerKAT discovery of diffuse emission in nine massive Sunyaev\u2013Zel\u2019dovich-selected galaxy clusters from ACT\nThe MeerKAT Exploration of Relics, Giant Halos, and Extragalactic Radio Sources (MERGHERS) survey is a planned project to study a large statistical sample of galaxy clusters with the MeerKATExpand\nMultiwavelength view of SPT-CL J2106-5844\nContext. SPT-CL J2106-5844 is among the most massive galaxy clusters at z > 1 yet discovered. While initially used in cosmological tests to assess the compatibility with \u039b Cold Dark Matter cosmologyExpand\nThe Clusters Hiding in Plain Sight (CHiPS) Survey: Complete Sample of Extreme BCG Clusters\n\u2022 Physics\n\u2022 2021\nWe present optical follow-up observations for candidate clusters in the Clusters Hiding in Plain Sight survey, which is designed to find new galaxy clusters with extreme central galaxies that wereExpand\nMass calibration of distant SPT galaxy clusters through expanded weak-lensing follow-up observations with HST, VLT, & Gemini-South\nExpanding from previous work we present weak lensing measurements for a total sample of 30 distant ($z_\\mathrm{median}=0.93$) massive galaxy clusters from the South Pole Telescope Sunyaev-Zel'dovichExpand\n\n#### References\n\nSHOWING 1-10 OF 184 REFERENCES\namico galaxy clusters in KiDS-DR3: sample properties and selection function\nWe present the first catalogue of galaxy cluster candidates derived from the third data release of the Kilo Degree Survey (KiDS-DR3). The sample of clusters has been produced using the AdaptiveExpand\nA catalog of 132,684 clusters of galaxies identified from Sloan Digital Sky Survey III\n\u2022 Physics\n\u2022 2012\nUsing the photometric redshifts of galaxies from the Sloan Digital Sky Survey III (SDSS-III), we identify 132,684 clusters in the redshift range of 0.05 ? z 1.0 ? 1014 M ? in the redshift range ofExpand\nThe Massive and Distant Clusters of WISE Survey. I: Survey Overview and a Catalog of >2000 Galaxy Clusters at z~1.\nWe present the Massive and Distant Clusters of WISE Survey (MaDCoWS), a search for galaxy clusters at 0.7 -30 degrees) and the remainder of the southern extragalactic sky at Dec<-30 degrees for whichExpand\nCoMaLit \u2013 III. Literature catalogues of weak lensing clusters of galaxies (LC$^2$)\nThe measurement of the mass of clusters of galaxies is crucial for their use in cosmology and astrophysics. Masses can be efficiently determined with weak lensing (WL) analyses. I compiled LiteratureExpand\nTHE WIDE-FIELD INFRARED SURVEY EXPLORER (WISE): MISSION DESCRIPTION AND INITIAL ON-ORBIT PERFORMANCE\nThe all sky surveys done by the Palomar Observatory Schmidt, the European Southern Observatory Schmidt, and the United Kingdom Schmidt, the InfraRed Astronomical Satellite, and the Two Micron AllExpand\nA z = 0.9 Supercluster of X-Ray Luminous, Optically Selected, Massive Galaxy Clusters\nWe report the discovery of a compact supercluster structure at . The structure comprises three optically z p 0.9 selected clusters, all of which are detected in X-rays and spectroscopically confirmedExpand\nMeasures of location and scale for velocities in clusters of galaxies. A robust approach\n\u2022 Physics\n\u2022 1990\nThe novel estimators proposed for the kinematical properties of clusters of galaxies are both resistant in the presence of outliers and robust for a broad range of non-Gaussian underlyingExpand\nThe Atacama Cosmology Telescope: The Two-season ACTPol Sunyaev\u2013Zel\u2019dovich Effect Selected Cluster Catalog\nU.S. National Science Foundation [AST-1440226, AST-0965625, AST-0408698]; Princeton University; University of Pennsylvania; Canada Foundation for Innovation (CFI); Comision Nacional de InvestigacionExpand\nThe SPTpol Extended Cluster Survey\nWe describe the observations and resultant galaxy cluster catalog from the 2770 deg$^2$ SPTpol Extended Cluster Survey (SPT-ECS). Clusters are identified via the Sunyaev-Zel'dovich (SZ) effect, andExpand\nCluster Cosmology Constraints from the 2500 deg2 SPT-SZ Survey: Inclusion of Weak Gravitational Lensing Data from Magellan and the Hubble Space Telescope\nWe derive cosmological constraints using a galaxy cluster sample selected from the 2500 deg2 SPT-SZ survey. The sample spans the redshift range 0.25 < z 5. The sample is supplemented with opticalExpand","date":"2021-09-22 05:51:51","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.4454919099807739, \"perplexity\": 9376.538590317281}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-39\/segments\/1631780057329.74\/warc\/CC-MAIN-20210922041825-20210922071825-00056.warc.gz\"}"}
| null | null |
Ян Ка́рский (, настоящее имя Ян Ромуальд Козеле́вский (); 24 июня 1914, Лодзь, Царство Польское, Российская империя, — 13 июля 2000, Вашингтон, США) — участник польского движения Сопротивления, Праведник мира.
Биография
Родился в доме № 71, по улице Килинского, в 1914 году, в городе, который тогда называли «Красная Лодзь». Получил домашнее образование, как он сам написал, по программе своей матери Валентины Козелевской, урожденной Гуравской. Его старшие братья и сестры жили отдельно от них. Поступил в гимназию. После окончания факультета права и дипломатии львовского университета в 1935 году был отличником в артиллерийском училище подхорунжих во Владимире-Волынском. В январе 1939 года начал работу в Министерстве иностранных дел Польши.
После нападения Германии на Польшу в сентябре 1939 года Козелевский был мобилизован и направлен в уланский полк. Его полк был наголову разбит танковыми частями вермахта. Ян был ранен и затем был пленён советскими войсками, вторгнувшимися в Польшу с востока, и в результате обмена военнопленными оказался уже в немецком плену. В ноябре бежал из немецкого поезда для военнопленных, вступил в польскую подпольную организацию и совершил тайную поездку во Францию с рапортами для правительства Польши в изгнании, тогда располагавшегося во Франции. В подполье Козелевский принял псевдоним «Карский», который он позднее стал использовать как официальную фамилию.
В июне 1940 года был арестован гестапо в Словакии. После попытки самоубийства (перерезал себе вены бритвой) Карский был переведён в больницу в Новы-Сонче, откуда бежал в результате операции Союза вооружённой борьбы. Позднее он нелегально пробрался в Польшу и работал в Бюро пропаганды и информации Главного штаба партизанской Армии Крайовой.
В 1942 году Роман Кнолл, глава отдела внешних сношений Армии Крайовой, бывший министром иностранных дел Польши, направил Карского в Лондон. Перед поездкой Роман Кнолл познакомил Карского с Леоном Файнером, активистом Бунда. Файнер сказал Карскому: «Польша снова обретет независимость после войны. Но польских евреев к тому времени не останется. Поезжайте в Лондон. Мы должны сделать всё, чтобы никто из союзников после войны не смог сказать, что ничего не знал об истреблении евреев… Я отправил десятки писем, сотни раз, прорвавшись к телефону, разговаривал с евреями в Швейцарии и Франции. Никто мне не поверил…». По просьбе Файнера Карский тайно посетил варшавское гетто и, переодевшись немецким солдатом, гетто в Избице Любельской, из которого заключённых направляли в лагеря уничтожения Белжец и Собибор.
Через Германию и Францию Карский добрался до нейтральной Испании, откуда он через Гибралтар попал в Лондон. Генерал Владислав Сикорский, глава правительства Польши в изгнании, решил передать доклад Карского правительствам Великобритании и США.
В июле 1943 года Карский был принят президентом США Франклином Рузвельтом и рассказал ему о судьбе жертв Холокоста. Карский умолял об оказании помощи гибнущим. Президент США продемонстрировал недоверие и равнодушие.
Позднее Карский встретился с многими лицами из мира политики и культуры — но все они оказались неспособны поверить ему.
В 1944 году Карский написал книгу «Курьер из Польши: История тайного государства» («Courier from Poland: Story of a Secret State»), напечатанную тиражом 360 тыс. экз.
После войны Карский остался в США и стал профессором Джорджтаунского университета. Он защитил докторскую диссертацию по политологии, в 1954 году получил американское гражданство.
В 1965 году он женился на польской еврейке Полине Ниренской, известной танцовщице и хореографе, все родственники которой погибли во время Холокоста.
В 1978 году он участвовал в фильме «Шоа», что способствовало осознанию мировой общественностью его усилий с целью остановить Холокост. В 2010 году режиссером ленты Клодом Ланцманом был смонтирован ещё один фильм о Карском под названием «Доклад Карского».
В 1982 году получил звание Праведника мира от института Яд ва-Шем, в 1994 году почётное гражданство государства Израиль.
На пресс-конференции в Вашингтоне в 1982 году Карский сказал: «Бог выбрал меня, чтобы Запад узнал о трагедии в Польше. Тогда мне казалось, что эта информация поможет спасти миллионы людей. Это не помогло, я ошибался. В 1942 году, в Варшавском гетто и в Избице Любельской я стал польским евреем…
Семья моей жены (все они погибли в гетто и в лагерях смерти), все замученные евреи Польши стали моей семьей. При этом я остаюсь католиком. Я католический еврей. Моя вера говорит мне: второй первородный грех, которое человечество совершило в отношении евреев в годы Второй мировой войны в Европе, будет преследовать его до конца времен…»
В 1995 году Карский был награждён польским орденом Белого Орла.
Он почётный доктор восьми университетов США и Польши. В 1996 году в Польше о нём был снят документальный фильм «Моя миссия».
В 1998 году он был номинирован на Нобелевскую премию мира.
На похороны Карского прибыли президент США Клинтон и президент Польши Квасьневский.
В 2012 году президент США Барак Обама наградил Яна Карского Президентской медалью Свободы посмертно.
Память
Памятники Карскому в виде его фигуры в натуральный рост, сидящей на скамейке, находятся напротив польского консульства в Нью-Йорке, в кампусе Джорджтаунского университета, а также в польских городах: Варшава, Кельце, Лодзь, Краков и в кампусе Тель-Авивского университета.
В 2015 году вышел документальный кинофильм польско-американско-русского производства «Ян Карский. Праведник мира»
В 2009 году в издательстве «Галлимар» вышел роман «Ян Карский» французского писателя Янника Хаэнеля. Режиссер Клод Ланцман выступил с резкой критикой этого романа, назвав его «фальсификацией истории».
Примечания
Литература
J. Korczak, Misja ostatniej nadziei, Warszawa 1992.
E. T. Wood, Karski: opowieść o emisariuszu, Kraków 1996.
E. Thomas Wood & Stanisław M. Jankowski (1994). Karski: How One Man Tried to Stop the Holocaust. John Wiley & Sons Inc. стр. 316; ISBN 0-471-01856-2.
J. Korczak, Karski, Warszawa 2001.
Y. Haenel, Jan Karski, 2009.
S. M. Jankowski, Karski: raporty tajnego emisariusza, Poznań 2009.
Ссылки
Интервью с Яном Карским на «Новой Польше»
Томашевская Ю. Герой, потерпевший поражение
Духин Л. Ян Карский: жизнь и судьба польского праведника, пытавшегося остановить Холокост
М.Дор. Ян Карский: «Все замученные евреи Польши стали моей семьей»
Последняя беседа с Яном Карским // katyn.ru
Сиротин А. Ян Карский пытался остановить Холокост
Политологи по алфавиту
Праведники народов мира в Польше
Персоналии:Холокост в Польше
Участники польского Сопротивления
Почётные граждане Лодзи
Информаторы Польши
Почётные доктора Джорджтаунского университета
Почётные доктора Лодзинского университета
Почётные доктора университета Марии Склодовской-Кюри
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 5,623
|
{"url":"https:\/\/www.physicsforums.com\/threads\/how-much-is-the-ideal-rocket-equation-affected-by-air-drag.665076\/","text":"# How much is the ideal rocket equation affected by air drag?\n\n#### vjk2\n\nRelated Aerospace and Astronautics Engineering News on Phys.org\n\n#### Travis_King\n\nthat's why it's called the ideal rocket equation...Drag is a tremendous factor in real applications.\n\n#### tfr000\n\nDepends on:\nsize and shape of the rocket (obviously, bigger and flatter have more drag)\nwhere in the atmosphere (higher up, thinner air, less drag)\nhow fast the rocket is moving (non-trivial function due to compressibility of the air)\n\nsee http:\/\/en.wikipedia.org\/wiki\/Drag_(physics [Broken])\n\nLast edited by a moderator:\n\n#### vjk2\n\nWell, how to calculate?\n\n#### mfb\n\nMentor\nWith a numerical simulation.\nIn addition to air drag, you have to consider gravity as well.\n\n#### vjk2\n\nWith a numerical simulation.\nIn addition to air drag, you have to consider gravity as well.\ner, actually the ideal rocket equation is entirely about gravity....\n\n#### mfb\n\nMentor\nThere is no gravity in the ideal rocket equation.\nThere is a way to re-write the equation to get the gravitational acceleration on earth into it, but that is just a unit conversion. In a similar way, the distance to moon does not depend on the length of my monitor, but I can express it as multiple of that length if I like.\n\n#### tfr000\n\n$\\textbf F = \\textbf F_{gravity} + \\textbf F_{thrust} + \\textbf F_{drag}$\n\nDepends how complicated you want to get. For a full simulation, you have to start with the rotation of the Earth at the launch site, and use this as the rocket's initial motion. Gravity drops off slowly (${1\\over r^{2}}$), thrust increases slightly as the atmospheric pressure is no longer \"bottling it up\", and drag peaks and falls off as the rocket reaches the speed of sound, which varies with air temperature.\n\nYou can simplify a lot of that - flat, non-rotating Earth, constant thrust, drag as some simple, approximate function - but there is still no simple equation to say, \"after 30 seconds, the rocket has velocity v at altitude h.\" Rocket science...","date":"2019-11-12 10:33:30","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.7359502911567688, \"perplexity\": 1575.1218697170107}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.3, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2019-47\/segments\/1573496665521.72\/warc\/CC-MAIN-20191112101343-20191112125343-00551.warc.gz\"}"}
| null | null |
Q: How to use a single Spring ApplicationContext across the whole TestNG suite? We have a separate Java project completely dedicated to functional testing of our web application with TestNG and Selenium (we refer to it as the Test Suite). It is pretty sophisticated and uses Spring for dependency injection extensively.
The entry point, where Application context is initialized and the beans used to initialize other beans are defined, is the AbstractTest class, which is a base class for all test classes in the suite, and is declared like this:
@ContextConfiguration("classpath*:applicationContext*.xml")
public class AbstractTest extends AbstractTestNGSpringContextTests {
...
Now I need to add two listeners:
*
*public class CustomSuiteListener implements ISuiteListener — to perform some actions before our tests run (e.g. log in to the web application and set it up via Web UI), and
*public class CustomTestMethodInterceptor implements IMethodInterceptor — to filter away those methods that should not run this time based on external decision mechanism (e.g. known open bugs).
Both these listeners require to load the application context because all settings (web application URL, credentials, database etc) are declared there; also bean autowiring would be of much help there.
For now, in both listeners I have to explicitly create a new application context in this fashion:
public class CustomSuiteListener implements ISuiteListener {
@Override
public void onStart(ISuite suite) {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath*:applicationContext*.xml");
WebDriverProvider provider = (WebDriverProvider) applicationContext.getBean("webDriverProvider");
ObjectInitializer objectInitializer = (ObjectInitializer) applicationContext.getBean("objectInitializer");
// other beans...
The problem is that, in addition to application context init in AbstractTest, every such call results in application context being loaded again and again; given that the suite is already big and is promising to grow fast, this results in a huge time waste.
The question is: is there any way to initialize application context once and then use it universally within our Test Suite?
A: Spring-test provides some annotation that do what you need. I used it with Junit, but I am almost sure it works in the same way with testNg. Here an example:
@ContextConfiguration("classpath:pu-testContext.xml")
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
By default, the context is in a cache and it can be reused between two tests. If you have a side effect, you have to change the value of "dirtiesContext" as I did above.
A: Why not place the the applicationcontext in the setup method of your test and reference it from there. An example would be like this in Junit
Blockquote
ApplicaitonContext ctx;
setup()
{
ctx = new Class...
}
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 2,751
|
Ming Architects
Tom Koh is widely recognised as a leading SEO consultant in Asia who has worked to transform the online visibility of the leading organisations such as SingTel, Capitaland, Maybank, P&G, WWF, etc. Recently he was instrumental in consulting for a New York-based US$30B fund in an US$4Bn acquisition. Tom is a Computational Science graduate of the National University of Singapore. In his free time he performs pro-bono community work and traveling.
Digital Marketing Analytics Tools to Up Your Marketing Game in 2022
A Guide To LinkedIn Marketing
How To Get Started With Content Analytics?
Top 3 Features Of Shopify That Make It Suitable For E-commerce
13 Tactics To Drive Sales With Video Content
23 Best Lead Generation Tools to Help You Get More Traffic and Sales
5 Steps To Build Organic Instagram Marketing Strategy
Top Loans for the Unemployed Service Providers
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 7,163
|
Nib appoints new head of marketing and products for Arhi
Chris Donald has been appointed following Ed Close's promotion
Nib has appointed a new marketer following Ed Close's promotion to group executive last month.
Chris Donald has been appointed head of marketing and products for Australian Residents Health Insurance (arhi) business, effective as of this week.
Donald has been a part of Nib's marketing team for five years, most recently as group manager of acquisition and brand strategy working across Arhi's brand positioning, media, creative, and acquisition strategies.
Previously, Donald had various marketing roles at Frucor Suntory, with responsibilities spanning across product development, store marketing and brand communication, sponsorship and activations for high-profile beverage brands.
The former head of marketing and products, Close, was appointed group executive of Nib on 1 January 2020. His appointment followed Rhod McKensey stepping down from the role to lead a new joint venture initiative between Nib and Cigna Corporation, announced in December.
Follow CMO on Twitter: @CMOAustralia, take part in the CMO conversation on LinkedIn: CMO ANZ, follow our regular updates via CMO Australia's Linkedin company page, or join us on Facebook: https://www.facebook.com/CMOAustralia.
Stockland to appoint new group exec overseeing tech and marketing
Batch shifted to chief strategy and innovation officer of IAG
Tags: marketing careersNIBmarketing leadershiparhi
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 742
|
{"url":"https:\/\/www.europlop.co.uk\/2019\/07\/tegan-sara-ill-be-back-someday\/","text":"# Tegan & Sara \u2013 I\u2019ll Be Back Someday\n\n\u201cNormally repeating one note annoys me, but it doesn\u2019t here\u201d\n\nTom: Whenever we talk about a Tegan & Sara track, we tend to conclude in roughly the same way: it\u2019s good synthpop, it\u2019s quite enjoyable, and then we can\u2019t remember any of it afterwards.\n\nTim: Harsh, and I\u2019m not entirely sure that\u2019s as true for me as it might be for you, but okay. The new one, then?\n\nTom: And I guess it\u2019s business as usual.\n\nTim: Well, maybe, yeah.\n\nTom: It\u2019s a really good song with a chorus that seems to have been crushed into oblivion by overcompression. As for the chorus itself \u2014 well, while it was playing, I wrote \u201cnormally repeating one note annoys me, but it doesn\u2019t here\u201d. But I had to go back and listen again before I knew what that one note was.\n\nTim: Oh, you\u2019re too cruel. Or just saddled with a poor memory \u2013 I like the melody, the notes (and yes, there\u2019s more than one), the rhythm. It\u2019s good, and it\u2019s memorable.","date":"2019-11-22 05:36:01","metadata":"{\"extraction_info\": {\"found_math\": false, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.8014211058616638, \"perplexity\": 2301.2447994860017}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2019-47\/segments\/1573496671239.99\/warc\/CC-MAIN-20191122042047-20191122070047-00298.warc.gz\"}"}
| null | null |
La Cooper T73, évolution de la T66 de 1963, est une monoplace engagée en Formule 1 en 1964. Etrennée par Bruce McLaren lors des 200 miles d'Aintree (hors championnat), elle n'y effectue que quelques tours avant qu'un problème de surchauffe n'entraîne son abandon.
Utilisée durant la saison 1964 par l'équipe officielle, la T73 ne remportera cependant aucune course, ses meilleurs résultats en championnat du monde étant les deux secondes places obtenues par McLaren aux Grands Prix de Belgique (la victoire lui échappant à cause d'une panne électrique juste avant l'arrivée) et d'Italie.
En 1965, la T73, remplacée par la T77, ne courut qu'à une seule reprise au sein de l'équipe officielle Cooper, mais certaines écuries privées l'utilisèrent jusqu'en 1966.
Notes et références
73
Formule 1 en 1964
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 3,060
|
Directions: Exit A1(M), junction 35 onto M18 and follow signs for Doncaster Racecourse. Exit M18, junction 3 - continuing to follow signs for Doncaster racecourse. Go straight across the roundabout and across the traffic lights. Go past the Doncaster Lakeside Premier Inn and to the next roundabout - turn right. Follow the road around the lake. Go straight over two roundabouts. At the third roundabout, turn right onto Gliwice Way. Take your first left onto Herten Way. Take your first left into the car park. Doncaster Central East Premier Inn is in Doncaster Leisure Park. Sat Nav postcode: DN4 7NW.
"in a great location for our needs"
The staff were friendly and helpful and the position was ideal for our needs (near to the Dome)and the room for a family of four was a perfect size.The hotel is on a retail park where there are still some new buildings being built and there is a cinema and park nearby too.
Lovely hotel with lovely friendly staff that welcomed us on arrival just a shame about the noise through the night as our room was next to the lift so all night as people were returning from their night out we were woken from banging of doors and loud talking and laughing from guests as they passed our room .
I have stayed here previously in the past, and the standards have not changed since my last visit. This hotel is quiet and is close to the retail park and the lake. My room was clean and quiet, and i had one of the best nights sleep in their comfy beds. There are houses being built behind the hotel, but i heard no noise from this. I did not eat in the restaurant next door, and i hope that the new restaurants being built across the road will be open the next time i visit.
We were attending an event at Doncaster Dome and this hotel was ideally located as it was only 5 minutes walk to the dome. Room was overlooking the car park but was very quiet with no noise to be heard from outside. Breakfast was at the adjacent Brewers Fayre restaurant and as always was excellent. Will definitely be staying here again.
Great hotel and very friendly and helpful staff. Rooms are comfortable and clean , the wi if was east to connect to . A great nights sleep had by all, will definitely stay here again on our next trip to Doncaster.
Hotel description Want the best of both worlds: a tranquil setting with fun on your doorstep? The Premier Inn Hotel Doncaster Central East, with its lakeside location and buzzing leisure complex a short stroll away, ticks all the boxes. Have a flutter on the horses at Doncaster Racecourse, or make a mini-break of it during St Leger Festival race week. Spend a memorable musical evening at The Dome, or watch the footy at the Keepmoat Stadium. For a blast of fresh air, explore the beautiful South Yorkshire countryside. When you're ready to relax, our onsite restaurant, spacious rooms and super-comfy beds are waiting.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 2,771
|
__author__ = 'tri'
class Subject:
"""Abstract class"""
def __init__(self):
self.__subject_units = {}
return
def add_subject_unit(self, subject_unit, type_key):
self.__subject_units[type_key] = subject_unit
def set_change(self, type_key, data):
self.__subject_units[type_key].notice_all(type_key, data)
def register_service(self, observer, type_key):
self.__subject_units[type_key].attach(observer)
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 2,168
|
Street View of Conwy Quay Conwy North Wales
Street View of Conwy Quay Conwy County North Wales
Nearby Attractions Smallest House in Britain - The smallest house in Great Britain is situated on the Quayside at Conwy, North Wales. The house is only 6ft wide by 8ft deep by 10ft high, approx. 1...... Queen Victoria Boat Trips - Cruises on the Conwy River aboard Queen Victoria. 90 seat all weather riverbus. Full commentary and refreshments available. schools and groups welcome...... Conwy Town Walls - Conwy Town Walls surround the town of Conwy and are located on the banks of the River Conwy in North Wales. Conwy Castle and the town walls were buil...... Galleon Fish and Chip Shop - The Galleon Fish and Chip Shop stands on the corner at the bottom of High Street in Conwy, North Wales. If you are paying a visit to the World Heritag...... Conwy Civic Hall - Situated in the centre of historic Conwy, by the Quay, the Civic Hall building was constructed in the nineteenth century, in red stone with Bath stone...... Aberconwy House - This is the only medieval merchant's house in Conwy to have survived the turbulent history of the walled town over nearly six centuries. Furnished roo...... Potters Gallery - The Potters' Gallery opened in 2003 in the medieval town of Conwy. It is a co-operative, organised and run by members of "North Wales Potters" t...... Conwy Quay - Conwy Quay is the name given to the harbour and waterfront to the medieval town of Conwy, Conwy County, North Wales. Conwy Quay is both a working harb...... The Harbour Gallery - ...... Royal Cambrian Academy - The Gallery is located in the centre of Conwy just off the High Street behind Plas Mawr. The nearest train station is at Llandudno Junction, 3km f......
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 1,833
|
var INPUT_URLS = "input-urls.txt";
var OUTPUT_DIR = "outputs/";
var request = require('request');
var fs = require('fs');
var tidy = require('htmltidy').tidy;
var path = require('path');
var lineReader = require('readline').createInterface({
input: fs.createReadStream(INPUT_URLS)
});
// read urls
lineReader.on('line', function (line) {
console.log(line);
// get html from url
request(line, function(err, res, body){
labelDecode = body.replace(/&/g,'&').replace(/ /g,' ');
// normalize html source
tidy(labelDecode, function(err, html) {
if (err){
console.log(err);
}
// write to file
var file = "sample.html";
if (line.indexOf("dailymed") > 0){ // dailymed label
if (line.indexOf("setid=") > 0)
file = OUTPUT_DIR + line.replace("http://dailymed.nlm.nih.gov/dailymed/lookup.cfm?setid=","") + ".html";
else if (line.indexOf("archives") > 0) // dailymed archive
file = OUTPUT_DIR + line.replace("http://dailymed.nlm.nih.gov/dailymed/archives/fdaDrugInfo.cfm?archiveid=","archiveid-") + ".html";
else
console.log("[ERROR] dailymed url not resolved!");
} else if(line.match(/pmc\/articles/g)){
file = OUTPUT_DIR + line.replace("http://www.ncbi.nlm.nih.gov/pmc/articles/","") + ".html";
} else {
file = OUTPUT_DIR + line + ".html";
}
fs.writeFile(path.join(__dirname, file), html, function(err) {
if(err) {
return console.log(err);
}
console.log("Saved " + file);
});
});
});
});
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 6,264
|
Les Cinq catégories noires sont des catégories de classement de la population chinoise sous l'ère maoïste : elles regroupent les propriétaires fonciers, les paysans riches, les contre-révolutionnaires, les (c'est-à-dire essentiellement le monde de la pègre) et les . Cette classification des individus s'étend à leurs familles et enfants. Ils sont considérés comme des parias et exclus de la société. Les cinq catégories noires contrastaient avec les « cinq catégories rouges », favorisées par le Parti communiste chinois et bénéficiant de privilèges sociaux. Ces cinq catégories noires ont ensuite été sept, puis neuf, jusqu'à englober la totalité de la classe des .
Historique
Le régime communiste chinois, qui remporte en 1949 la guerre civile chinoise, met en place un classement de la population chinoise. D'une part les bons éléments ou catégories dites rouges constitués de et d'autre part les catégories qualifiées de noires . Cette classification concerne directement les individus mais aussi leurs familles et leurs descendants. Les enfants des catégories noires, traités de rebuts de la société ou de petits chiens, sont des parias souvent battus et humiliés, empêchés de participer à la Révolution culturelle. Pendant la Révolution culturelle, la lutte contre les cinq catégories noires se développe essentiellement de 1967 à 1969, elle conduit à la mort et à la persécution de millions d'individus. Des tortures sont pratiquées sur ces exclus de la société maoïste .
Ce classement permettait ou pas . Pour l'anthropologue Karine Gatelier, l'individu, défini par sa classe sociale, est alors nié : .
Les Cinq catégories noires sont évoquées pour expliquer l'origine des faillites du régime. Ainsi durant le Grand Bond en avant, la région de Xinyang a été le cadre d'un épisode particulièrement aigu de la Grande famine : plus d'un million de personnes y sont mortes de faim entre 1959 et le printemps 1960. Un cadre du parti, Xu Zirong, explique cette situation comme suit : . Pour Yang Jisheng, l'idéologie de l'époque permettait d'expliquer que les problèmes avaient pour origine des personnes issues des mauvaises classes sociales.
Avec l'ajout des espions, des traîtres au Parti communiste, des capitalistes et des intellectuels, les Cinq catégories noires deviennent les neuf puanteurs. Ces ajouts ont des origines plus « populaires » mais auront fait entendre leur réprobation aux politiques suivies.
Article connexe
Cinq catégories rouges
Quatre Vieilleries
Août rouge
Références
Politique en Chine
Révolution culturelle
Campagne du parti communiste chinois
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 6,055
|
Ники Каро (, род. 1967) — новозеландский кинорежиссёр, сценаристка и продюсер, обладательница многочисленных кинематографических премий.
Биография
Ники Каро родилась в 1967 году в Веллингтоне, Новая Зеландия. Окончила Школу Искусств при Университете Окленда со степенью бакалавра, а в Технологическом университете Суинберна в Мельбурне получила степень магистра.
Впервые Каро проявила себя как режиссёр, снимая небольшие рекламные проекты. В 1994 году Ники выпустила свой первый фильм — короткометражную ленту «Конечно, поднимайтесь» (Sure to Rise). В нём она выступила не только как постановщик, но и как сценарист. Эта работа была номинирована на «Золотую пальмовую ветвь» Каннского кинофестиваля.
Первым полнометражным фильмом Ники Каро стала мелодрама «Память и желание» () вышедший в 1997 году. Этот фильм был номинирован на приз Стокгольмского кинофестиваля, а в Новой Зеландии, Ники Каро стала лауреатом «Film and TV Awards». В последующие пять лет Каро стала автором ещё двух проектов — фильма ужасов «Темные истории: Сказки из могилы» («Dark Stories: Tales from Beyond the Grave»), а также телесериала «Mercy Peak», шедшего на новозеландском телевидении три сезона.
Мировую известность Ники Каро в 2002 году принесла драма «Оседлавший кита». Оригинальный и трогательный фильм о народе маори, теряющим свою самобытную культуру в современном мире, оказался чрезвычайно зрелищным. Ники Каро получила призы нескольких кинофестивалей, включая «Сандэнс» и фестиваль в Торонто.
Следующий фильм, драму «Северная страна» Каро сняла в 2005 году. Успеха предыдущего фильма картина не повторила. В 2009 году вышла драма «Удача винодела».
Фильмография
Режиссёр
1994 — Уверенное восхождение / Sure to Rise
1997 — Память и желание / Memory & Desire
2002 — Оседлавший кита / Whale Rider
2005 — Северная страна / North Country
2009 — Удача винодела / The Vintner's Luck
2015 — Тренер / McFarland
2017 — Жена смотрителя зоопарка / The Zookeeper's Wife
2020 — Мулан / Mulan
Сценарист
1994 Sure to Rise
1997 Memory & Desire
2001 Dark Stories: Tales from Beyond the Grave (видео)
2001—2003 Mercy Peak (сериал)
2002 Оседлавший кита / Whale Rider
2009 Удача винодела / The Vintner's Luck
Продюсер
2009 Удача винодела / The Vintner's Luck
Награды и номинации
1994 год — Каннский кинофестиваль. Номинация на «Золотую пальмовую ветвь» за лучший короткометражный фильм («Sure to Rise»)
2003 год — Санденс. Приз зрительских симпатий — Программа «Мировое кино» («Оседлавший кита»)
Примечания
Ссылки
Лауреаты премии Гильдии режиссёров США
Выпускники Оклендского университета
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 6,559
|
namespace util_intops {
template <typename StrongIntName, typename _ValueType>
class StrongInt;
// Defines the StrongInt using value_type and typedefs it to int_type_name.
// The struct int_type_name ## _tag_ trickery is needed to ensure that a new
// type is created per int_type_name.
#define DEFINE_STRONG_INT_TYPE(int_type_name, value_type) \
struct int_type_name##_tag_ { \
static constexpr absl::string_view TypeName() { return #int_type_name; } \
}; \
typedef ::util_intops::StrongInt<int_type_name##_tag_, value_type> \
int_type_name;
// Holds a integral value (of type ValueType) and behaves as a
// ValueType by exposing assignment, unary, comparison, and arithmetic
// operators.
//
// The template parameter StrongIntName defines the name for the int type and
// must be unique within a binary (the convenient DEFINE_STRONG_INT macro at the
// end of the file generates a unique StrongIntName). The parameter ValueType
// defines the integer type value (see supported list above).
//
// This class is NOT thread-safe.
template <typename StrongIntName, typename _ValueType>
class StrongInt {
public:
typedef _ValueType ValueType; // for non-member operators
typedef StrongInt<StrongIntName, ValueType> ThisType; // Syntactic sugar.
static constexpr absl::string_view TypeName() {
return StrongIntName::TypeName();
}
// Note that this may change from time to time without notice.
struct Hasher {
size_t operator()(const StrongInt& arg) const {
return static_cast<size_t>(arg.value());
}
};
public:
// Default c'tor initializing value_ to 0.
constexpr StrongInt() : value_(0) {}
// C'tor explicitly initializing from a ValueType.
constexpr explicit StrongInt(ValueType value) : value_(value) {}
// StrongInt uses the default copy constructor, destructor and assign
// operator. The defaults are sufficient and omitting them allows the compiler
// to add the move constructor/assignment.
// -- ACCESSORS --------------------------------------------------------------
// The class provides a value() accessor returning the stored ValueType value_
// as well as a templatized accessor that is just a syntactic sugar for
// static_cast<T>(var.value());
constexpr ValueType value() const { return value_; }
template <typename ValType>
constexpr ValType value() const {
return static_cast<ValType>(value_);
}
// -- UNARY OPERATORS --------------------------------------------------------
ThisType& operator++() { // prefix ++
++value_;
return *this;
}
const ThisType operator++(int v) { // postfix ++
ThisType temp(*this);
++value_;
return temp;
}
ThisType& operator--() { // prefix --
--value_;
return *this;
}
const ThisType operator--(int v) { // postfix --
ThisType temp(*this);
--value_;
return temp;
}
constexpr bool operator!() const { return value_ == 0; }
constexpr const ThisType operator+() const { return ThisType(value_); }
constexpr const ThisType operator-() const { return ThisType(-value_); }
constexpr const ThisType operator~() const { return ThisType(~value_); }
// -- ASSIGNMENT OPERATORS ---------------------------------------------------
// We support the following assignment operators: =, +=, -=, *=, /=, <<=, >>=
// and %= for both ThisType and ValueType.
#define STRONG_INT_TYPE_ASSIGNMENT_OP(op) \
ThisType& operator op(const ThisType& arg_value) { \
value_ op arg_value.value(); \
return *this; \
} \
ThisType& operator op(ValueType arg_value) { \
value_ op arg_value; \
return *this; \
}
STRONG_INT_TYPE_ASSIGNMENT_OP(+=);
STRONG_INT_TYPE_ASSIGNMENT_OP(-=);
STRONG_INT_TYPE_ASSIGNMENT_OP(*=);
STRONG_INT_TYPE_ASSIGNMENT_OP(/=);
STRONG_INT_TYPE_ASSIGNMENT_OP(<<=); // NOLINT
STRONG_INT_TYPE_ASSIGNMENT_OP(>>=); // NOLINT
STRONG_INT_TYPE_ASSIGNMENT_OP(%=);
#undef STRONG_INT_TYPE_ASSIGNMENT_OP
ThisType& operator=(ValueType arg_value) {
value_ = arg_value;
return *this;
}
private:
// The integer value of type ValueType.
ValueType value_;
COMPILE_ASSERT(std::is_integral<ValueType>::value,
invalid_integer_type_for_id_type_);
} ABSL_ATTRIBUTE_PACKED;
// -- NON-MEMBER STREAM OPERATORS ----------------------------------------------
// We provide the << operator, primarily for logging purposes. Currently, there
// seems to be no need for an >> operator.
template <typename StrongIntName, typename ValueType>
std::ostream& operator<<(std::ostream& os, // NOLINT
StrongInt<StrongIntName, ValueType> arg) {
return os << arg.value();
}
// -- NON-MEMBER ARITHMETIC OPERATORS ------------------------------------------
// We support only the +, -, *, and / operators with the same StrongInt and
// ValueType types. The reason is to allow simple manipulation on these IDs
// when used as indices in vectors and arrays.
//
// NB: Although it is possible to do StrongInt * StrongInt and StrongInt /
// StrongInt, it is probably non-sensical from a dimensionality analysis
// perspective.
#define STRONG_INT_TYPE_ARITHMETIC_OP(op) \
template <typename StrongIntName, typename ValueType> \
constexpr StrongInt<StrongIntName, ValueType> operator op( \
StrongInt<StrongIntName, ValueType> id_1, \
StrongInt<StrongIntName, ValueType> id_2) { \
return StrongInt<StrongIntName, ValueType>(id_1.value() op id_2.value()); \
} \
template <typename StrongIntName, typename ValueType> \
constexpr StrongInt<StrongIntName, ValueType> operator op( \
StrongInt<StrongIntName, ValueType> id, \
typename StrongInt<StrongIntName, ValueType>::ValueType arg_val) { \
return StrongInt<StrongIntName, ValueType>(id.value() op arg_val); \
} \
template <typename StrongIntName, typename ValueType> \
constexpr StrongInt<StrongIntName, ValueType> operator op( \
typename StrongInt<StrongIntName, ValueType>::ValueType arg_val, \
StrongInt<StrongIntName, ValueType> id) { \
return StrongInt<StrongIntName, ValueType>(arg_val op id.value()); \
}
STRONG_INT_TYPE_ARITHMETIC_OP(+);
STRONG_INT_TYPE_ARITHMETIC_OP(-);
STRONG_INT_TYPE_ARITHMETIC_OP(*);
STRONG_INT_TYPE_ARITHMETIC_OP(/);
STRONG_INT_TYPE_ARITHMETIC_OP(<<); // NOLINT
STRONG_INT_TYPE_ARITHMETIC_OP(>>); // NOLINT
STRONG_INT_TYPE_ARITHMETIC_OP(%);
#undef STRONG_INT_TYPE_ARITHMETIC_OP
// -- NON-MEMBER COMPARISON OPERATORS ------------------------------------------
// Static inline comparison operators. We allow all comparison operators among
// the following types (OP \in [==, !=, <, <=, >, >=]:
// StrongInt<StrongIntName, ValueType> OP StrongInt<StrongIntName, ValueType>
// StrongInt<StrongIntName, ValueType> OP ValueType
// ValueType OP StrongInt<StrongIntName, ValueType>
#define STRONG_INT_TYPE_COMPARISON_OP(op) \
template <typename StrongIntName, typename ValueType> \
static inline constexpr bool operator op( \
StrongInt<StrongIntName, ValueType> id_1, \
StrongInt<StrongIntName, ValueType> id_2) { \
return id_1.value() op id_2.value(); \
} \
template <typename StrongIntName, typename ValueType> \
static inline constexpr bool operator op( \
StrongInt<StrongIntName, ValueType> id, \
typename StrongInt<StrongIntName, ValueType>::ValueType val) { \
return id.value() op val; \
} \
template <typename StrongIntName, typename ValueType> \
static inline constexpr bool operator op( \
typename StrongInt<StrongIntName, ValueType>::ValueType val, \
StrongInt<StrongIntName, ValueType> id) { \
return val op id.value(); \
}
STRONG_INT_TYPE_COMPARISON_OP(==); // NOLINT
STRONG_INT_TYPE_COMPARISON_OP(!=); // NOLINT
STRONG_INT_TYPE_COMPARISON_OP(<); // NOLINT
STRONG_INT_TYPE_COMPARISON_OP(<=); // NOLINT
STRONG_INT_TYPE_COMPARISON_OP(>); // NOLINT
STRONG_INT_TYPE_COMPARISON_OP(>=); // NOLINT
#undef STRONG_INT_TYPE_COMPARISON_OP
// Support for-range loops. Enables easier looping over ranges of StrongInts,
// especially looping over sub-ranges of StrongVectors.
template <typename IntType>
class StrongIntRange {
public:
// Iterator over the indices.
class StrongIntRangeIterator {
public:
using value_type = IntType;
using difference_type = IntType;
using reference = const IntType&;
using pointer = const IntType*;
using iterator_category = std::input_iterator_tag;
explicit StrongIntRangeIterator(IntType initial) : current_(initial) {}
bool operator!=(const StrongIntRangeIterator& other) const {
return current_ != other.current_;
}
bool operator==(const StrongIntRangeIterator& other) const {
return current_ == other.current_;
}
value_type operator*() const { return current_; }
pointer operator->() const { return ¤t_; }
StrongIntRangeIterator& operator++() {
++current_;
return *this;
}
StrongIntRangeIterator operator++(int) {
StrongIntRangeIterator old_iter = *this;
++current_;
return old_iter;
}
private:
IntType current_;
};
// Loops from IntType(0) up to (but not including) end.
explicit StrongIntRange(IntType end) : begin_(IntType(0)), end_(end) {}
// Loops from begin up to (but not including) end.
StrongIntRange(IntType begin, IntType end) : begin_(begin), end_(end) {}
StrongIntRangeIterator begin() const { return begin_; }
StrongIntRangeIterator end() const { return end_; }
private:
const StrongIntRangeIterator begin_;
const StrongIntRangeIterator end_;
};
template <typename IntType>
StrongIntRange<IntType> MakeStrongIntRange(IntType end) {
return StrongIntRange<IntType>(end);
}
template <typename IntType>
StrongIntRange<IntType> MakeStrongIntRange(IntType begin, IntType end) {
return StrongIntRange<IntType>(begin, end);
}
} // namespace util_intops
// Allows it to be used as a key to hashable containers.
namespace std {
template <typename StrongIntName, typename ValueType>
struct hash<util_intops::StrongInt<StrongIntName, ValueType> >
: util_intops::StrongInt<StrongIntName, ValueType>::Hasher {};
} // namespace std
#endif // OR_TOOLS_BASE_STRONG_INT_H_
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 2,954
|
{"url":"https:\/\/www.shaalaa.com\/question-bank-solutions\/a-man-walks-straight-road-his-home-market-25-km-away-speed-5-km-h-1-what-magnitude-average-velocity-average-speed-man-over-interval-time-average-velocity-average-speed_10019","text":"A Man Walks on a Straight Road from His Home to a Market 2.5 Km Away with a Speed of 5 Km H \u20131 What is the Magnitude of Average Velocity and Average Speed of the Man Over the Interval of Time - Physics\n\nA man walks on a straight road from his home to a market 2.5 km away with a speed of 5 km h\u00a0\u20131. Finding the market closed, he instantly turns and walks back home with a speed of 7.5 km h\u20131. What is the\n\n(a) magnitude of average velocity, and\n\n(b) average speed of the man over the interval of time (i) 0 to 30 min, (ii) 0 to 50 min, (iii) 0 to 40 min? [Note: You will appreciate from this exercise why it is better to define average speed as total path length divided by time, and not as magnitude of average velocity. You would not like to tell the tired man on his return home that his average speed was zero!]\n\nSolution 1\n\nTime taken by the man to reach the market from home, t_1 = 2.5\/5 = 1\/2 h = 30 min\n\nTime taken by the man to reach home from the market, t_2 = 2.5\/7.5 = 1\/3 h = 20 min\n\nTotal time taken in the whole journey = 30 + 20 = 50 min\n\nAverage velocity = Displacement\/Time = 2.5\/(1\/2) = 5 \"km\/h\"\u00a0 ....(a(i))\n\nAverage speed = Distance\/Time = 2.5\/(1\/2) = 5 \"km\/h\"\u00a0 \u00a0 .....(b(i))\n\nTime = 50 min = 5\/6 h\n\nNet displacement = 0\n\nTotal distance = 2.5 + 2.5 = 5 km\n\nAverage velocity = Displacement\/Time = 0\u00a0 ....(a(ii))\n\nAverage speed = Distance\/Time = 5\/(5\/6) = 6 \"km\/h\"\u00a0 ........(b(ii))\n\nSpeed of the man = 7.5 km\n\nDistance travelled in first 30 min = 2.5 km\n\nDistance travelled by the man (from market to home) in the next 10 min\n\n= 7.5xx 10\/60 = 1.25\n\nNet displacement = 2.5 \u2013 1.25 = 1.25 km\n\nTotal distance travelled = 2.5 + 1.25 = 3.75 km\n\nAverage velocity = 1.25\/(40\/60)= (1.25xx3)\/2 = 1.875 \"km\/h\"\u00a0 ....(a(iii))\n\nAverage speed =3.75\/(40\/60) = 5.625 \"mn\/h\"\u00a0 ...(b(iii))\n\nSolution 2\n\nSince v = S\/t => t=S\/v\n\nTime taken by the man to reach market,\n\nt =S\/v = 2.5\/ = 0.5 h\n\nTime taken by the man to come back\n\nt_1 = S\/v_1 = 2.5\/7.5 = 0.333 h\n\n1) Average velocity (0-30 min) = (trianglex)\/(trianglet) = 2.5\/0.5 = 5 kmh^(-1)\n\n[\u2235 In 0.5 h , distance covered by man = 2.5 km]\n\n2)Average velocity (0 - 50 min) = ((2.5+2.5)km)\/(0.5+0.333)h = 5\/0.833 kmh^(-1) = 8 kmh^(-1)\n\n3) Average velocity (0-4 min) = (trianglex)\/(trianglet) = ((2.5 - 2.5\/2)km)\/(40\/60h) = 1.875 \"kmh\"^(-1)\n\n[\u2235During 1st 30 min, distance covered = 2.5 kmin next 10 m distnce covered\u00a0 = 25\/2 km inretun journey]\n\n4)Average speed (0-40min) - \"Time distance\"\/\"Total distance\"\n\n=(2.5+2.5\/2)\/(40\/60)` = 5.625 km h-1\n\nIs there an error in this question or solution?\n\nAPPEARS IN\n\nNCERT Class 11 Physics Textbook\nChapter 3 Motion in a Straight Line\nQ 14 | Page 57","date":"2021-03-08 00:47:34","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.5130684971809387, \"perplexity\": 2760.913000176957}, \"config\": {\"markdown_headings\": false, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-10\/segments\/1614178381230.99\/warc\/CC-MAIN-20210307231028-20210308021028-00522.warc.gz\"}"}
| null | null |
{"url":"https:\/\/help.dragandbot.com\/development\/qap\/definition.html","text":"# Definition\n\nQuick Access Poses helps to develop Programs faster. Define custom poses to make them easily accessible through the Control Panel.\n\n## Create Quick Access Poses\u00b6\n\nQuick Access Poses are defined in ~\/.dnb\/data\/quick_access_poses. Each needs a separate directory (e.g. ~\/.dnb\/data\/quick_access_poses\/example) containing a YAML file with the pose definition.\n\n## Structure\u00b6\n\nThe following code shows the structure of a Quick Access Pose YAML file.\n\ntrajectory: # list of poses\n- position?: # list entry has to contain either 1. position and\/or orientation\nx: float # 2. joints\ny: float\nz: float\norientation?:\nrz: float\nry: float\nrx: float\n- joints?: float[]\nprecondition?: # has to contain either 1. a position and\/or orientation\npositon?: # 2. joints\nx: float\ny: float\nz: float\nposition_tolerance?: float\norientation?:\nrz: float\nry: float\nrx: float\norientation_tolerance?: float\njoints?: float[]\njoints_tolerance?: float\ntcp?:\ntranslation:\nx: float\ny: float\nz: float\nrotation:\nrz: float\nry: float\nrx: float\ntooltip?: string # tooltip shown if precondition is not fullfilled\nimage?: string # name of the image file contained in the same directory as the yaml file\n\nFields marked with a ? are optional. The mark ? is just informative, please don't write it in the YAML file.\n\n### Trajectory\u00b6\n\ntrajectory: # list of poses\n- position?: # list entry has to contain either 1. position and\/or orientation\nx: float # 2. joints\ny: float\nz: float\norientation?:\nrz: float\nry: float\nrx: float\n- joints?: float[]\n\nIn some cases moving directly to the target pose is not possible and therefore Quick Access Poses allows trajectories with several waypoints. Each waypoint can consist of\n\n1. position and\/or orientation\n2. joints\n\nIf only a position is provided the orientation will stay as it is and vice versa. When using joints, the joints array should have as many entries as the robot has joints. Orientation and joints need to be set in radians.\n\n### Preconditions\u00b6\n\nprecondition?: # has to contain either a position or an orientation\npositon?:\nx: float\ny: float\nz: float\nposition_tolerance?: float\norientation?:\nrz: float\nry: float\nrx: float\norientation_tolerance?: float\njoints?: float[]\njoints_tolerance?: float\n\nTo ensure the robot is in a certain position before starting to move a precondition can be set. Preconditions need to have either\n\n1. position, orientation or both or\n2. joints\n\nBy default the robot needs to be inside a distance of 0.005 m for position and 0.005 rad for orientation\/joints from the precondition pose. These values can be changed by setting the position_tolerance, the orientation_tolerance and the joints_tolerance fields. Orientation and joints need to be set in radians.\n\n### TCP\u00b6\n\ntcp?:\ntranslation:\nx: float\ny: float\nz: float\nrotation:\nrz: float\nry: float\nrx: float\n\nTo ensure the robot is using a certain tcp the transformation of the tcp can be set. TCP needs to have a translation and a rotation. Setting a TCP is optional. When TCP is omitted, flange will be used as default value. Rotation needs to be set in radians.\n\n### Tool tip\u00b6\n\ntooltip?: string # tool tip shown if precondition is not fulfilled\n\nIf preconditions are not fulfilled, a default tool tip is shown. To display a customized message the tool tip field can be set.\n\n### Image\u00b6\n\nimage?: string # name of the image file contained in the same directory as the YAML file\n\nEach Quick Access Pose can have an image, which will be shown in the Control Panel. This can be achieved by adding an image to the directory of the Quick Access Pose and adding the filename to the image field of the YAML definition.","date":"2021-09-22 06:02:40","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.17411448061466217, \"perplexity\": 8771.791422716537}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.3, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-39\/segments\/1631780057329.74\/warc\/CC-MAIN-20210922041825-20210922071825-00424.warc.gz\"}"}
| null | null |
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 17175 -->
<!-- Reviewed: no -->
<sect1 id="zend.controller.front">
<title>Le contrôleur frontal (Front Controller)</title>
<sect2 id="zend.controller.front.overview">
<title>Présentation générale</title>
<para>
<classname>Zend_Controller_Front</classname> implémente un
<ulink url="http://www.martinfowler.com/eaaCatalog/frontController.html">motif de
contrôleur frontal</ulink>utilisé dans les applications
<ulink url="http://fr.wikipedia.org/wiki/Mod%C3%A8le-Vue-Contr%C3%B4leur">
Modèle-Vue-Contrôleur (MVC)</ulink>. Son but est d'initialiser l'environnement de
requête, d'acheminer la requête entrante et de distribuer ensuite n'importe quelles
actions découvertes ; il agrège n'importe quelles réponses et les retourne quand le
processus est complet.
</para>
<para>
<classname>Zend_Controller_Front</classname> implémente aussi le
<ulink url="http://fr.wikipedia.org/wiki/Singleton_%28motif_de_conception%29">motif
Singleton</ulink>, signifiant que seule une instance du contrôleur frontal peut être
disponible à n'importe quel moment. Cela lui permet aussi d'agir comme un
enregistrement dans lequel les autres objets du processus de distribution peuvent
écrire.
</para>
<para>
<classname>Zend_Controller_Front</classname> enregistre un
<link linkend="zend.controller.plugins">plugin broker</link>avec lui, permettant à des
événements divers qu'il déclenche d'être observés par plugins. Dans la plupart des cas,
cela donne au développeur l'occasion de construire le processus de distribution du site
sans avoir besoin d'étendre le contrôleur frontal pour ajouter une
fonctionnalité.
</para>
<para>
Le contrôleur frontal a besoin au minimum d'un ou plusieurs répertoires
contenants les
<link linkend="zend.controller.action">contrôleurs d'action</link>pour faire son
travail. Une variété de méthodes peut aussi être invoquée pour plus tard construire
l'environnement de contrôleur frontal et celui de ses classes d'aide.
</para>
<note>
<title>Comportement par défaut</title>
<para>
Par défaut, le contrôleur frontal charge le plugin
<link linkend="zend.controller.plugins.standard.errorhandler">ErrorHandler</link>,
ainsi que le plugin d'aide d'action
<link linkend="zend.controller.actionhelpers.viewrenderer">ViewRenderer</link>.
Ceci est fait respectivement pour simplifier la gestion d'erreur et le rendu des
vues dans vos contrôleurs.
</para>
<para>
Pour désactiver <code>ErrorHandler</code>, exécutez l'action suivante à
n'importe quel point précédant l'appel à <methodname>dispatch()</methodname> :
</para>
<programlisting language="php"><![CDATA[
// Désactivez le plugin ErrorHandler :
$front->setParam('noErrorHandler', true);
]]></programlisting>
<para>
Pour désactiver <code>ViewRenderer</code>, exécutez l'action suivante à
n'importe quel point précédant l'appel à <methodname>dispatch()</methodname> :
</para>
<programlisting language="php"><![CDATA[
// Désactivez l'aide ViewRenderer :
$front->setParam('noViewRenderer', true);
]]></programlisting>
</note>
</sect2>
<sect2 id="zend.controller.front.methods.primary">
<title>Méthodes principales</title>
<para>
Le contrôleur frontal a plusieurs accesseurs pour construire son environnement.
Cependant, il y a trois méthodes principales clés dans la fonctionnalité de contrôleur
frontal :
</para>
<sect3 id="zend.controller.front.methods.primary.getinstance">
<title>getInstance()</title>
<para>
<methodname>getInstance()</methodname> est utilisé pour récupérer une instance du
contrôleur frontal. Comme le contrôleur frontal implémente un motif de Singleton,
c'est aussi le seul moyen possible pour instancier un objet unique de contrôleur
frontal.
</para>
<programlisting language="php"><![CDATA[
$front = Zend_Controller_Front::getInstance();
]]></programlisting>
</sect3>
<sect3 id="zend.controller.front.methods.primary.setcontrollerdirectory">
<title>setControllerDirectory() et addControllerDirectory</title>
<para>
<methodname>setControllerDirectory()</methodname> est utilisé pour informer
<link linkend="zend.controller.dispatcher">le distributeur</link>où chercher les
fichiers de classes de
<link linkend="zend.controller.action">contrôleurs d'action</link>. Ces méthodes
acceptent un chemin unique ou un tableau associatif de paires
modules/chemins.
</para>
<para>Quelques exemples :</para>
<programlisting language="php"><![CDATA[
// Régler le dossier des contrôleurs par défaut :
$front->setControllerDirectory('../application/controllers');
// Régler plusieurs répertoires de modules d'un seul coup :
$front->setControllerDirectory(array(
'default' => '../application/controllers',
'blog' => '../modules/blog/controllers',
'news' => '../modules/news/controllers',
));
// Ajouter le répertoire de module 'foo' :
$front->addControllerDirectory('../modules/foo/controllers', 'foo');
]]></programlisting>
<note>
<para>
Si vous utilisez <methodname>addControllerDirectory()</methodname> sans nom de
module, cela réglera le répertoire pour le module <code>default</code> - en
surchargeant une valeur déjà existante.
</para>
</note>
<para>
Vous pouvez récupérer les réglages courants des répertoires du contrôleur en
utilisant <methodname>getControllerDirectory()</methodname> ; ceci retournera un tableau
des paires modules/chemins.
</para>
</sect3>
<sect3 id="zend.controller.front.methods.primary.addmoduledirectory">
<title>addModuleDirectory() et getModuleDirectory()</title>
<para>
Un des aspects du contrôleur frontal est que vous puissiez
<link linkend="zend.controller.modular">définir une structure de dossiers
modulaire</link>pour créer des composants autonomes ; ceux-ci sont nommés
"modules".
</para>
<para>
Chaque module doit être dans son propre dossier, ce dossier étant un miroir
du dossier du module "default" en terme de structure - c'est-à-dire, qu'il doit
contenir un sous-dossier "controllers" au minimum, et typiquement un sous-dossier
"views" puis d'autres sous-dossiers.
</para>
<para>
<methodname>addModuleDirectory()</methodname> vous permet de fournir le nom du dossier
contenant un ou plusieurs dossier de modules. Il scanne alors le dossier et les
ajoute au contrôleur frontal.
</para>
<para>
Ensuite, si vous souhaitez déterminer le chemin vers un module en particulier
ou vers le module courant, vous pouvez appeler <methodname>getModuleDirectory()</methodname>,
en fournissant optionnellement le nom du module spécifique que vous
recherchez.
</para>
</sect3>
<sect3 id="zend.controller.front.methods.primary.dispatch">
<title>dispatch()</title>
<para>
<code>dispatch(Zend_Controller_Request_Abstract $request = null,
Zend_Controller_Response_Abstract $response = null)</code> fait le gros travail du
contrôleur frontal. Il peut facultativement prendre un
<link linkend="zend.controller.request">objet de requête</link>et/ou un
<link linkend="zend.controller.response">objet de réponse</link>, permettant ainsi
au développeur de fournir des objets personnalisés.
</para>
<para>
Si aucun objet de requête ou de réponse ne lui sont fournis,
<methodname>dispatch()</methodname> vérifiera s'il existe des objets précédemment enregistrés
et utilisera ceux-là ou des objets par défaut pour les utiliser dans son processus
(dans les deux cas, le mode <acronym>HTTP</acronym> sera utilisé par défaut).
</para>
<para>
De la même manière, <methodname>dispatch()</methodname> vérifie s'il existe des objets
<link linkend="zend.controller.router">routeur</link>et
<link linkend="zend.controller.dispatcher">distributeur</link>inscrits, et
instancie des versions par défaut si aucun n'est trouvé.
</para>
<para>Le processus de distribution possède trois évènements</para>
<itemizedlist>
<listitem>
<para>le routage</para>
</listitem>
<listitem>
<para>la distribution</para>
</listitem>
<listitem>
<para>la réponse</para>
</listitem>
</itemizedlist>
<para>
Le routage a lieu exactement une fois, utilisant les valeurs de l'objet de
requête quand <methodname>dispatch()</methodname> est appelé. La distribution a lieu dans une
boucle ; une demande peut soit indiquer des actions multiples à distribuer,
soit le contrôleur ou un plugin peuvent remettre à zéro l'objet de requête et ainsi
forcer la distribution d'actions supplémentaires. Quand tout est réalisé, le
contrôleur frontal retourne la réponse.
</para>
</sect3>
<sect3 id="zend.controller.front.methods.primary.run">
<title>run()</title>
<para>
<methodname>Zend_Controller_Front::run($path)</methodname> est une méthode
"raccourci", statique, prenant simplement un chemin vers un répertoire contenant
des contrôleurs. Elle récupère l'instance de contrôleur frontal (via
<link linkend="zend.controller.front.methods.primary.getinstance">
getInstance()</link>), enregistre le chemin fourni par l'intermédiaire de
<link linkend="zend.controller.front.methods.primary.setcontrollerdirectory">
setControllerDirectory()</link>, et finalement réalise la
<link linkend="zend.controller.front.methods.primary.dispatch">
distribution</link>.
</para>
<para>
Fondamentalement, <methodname>run()</methodname> est une méthode de convenance qui peut
être employée pour les installations de sites qui n'exigent pas la personnalisation
de l'environnement du contrôleur frontal.
</para>
<programlisting language="php"><![CDATA[
// Instancie le contrôleur frontal, règle les dossiers de contrôleurs,
// et distribue en une seule étape :
Zend_Controller_Front::run('../application/controllers');
]]></programlisting>
</sect3>
</sect2>
<sect2 id="zend.controller.front.methods.environment">
<title>Méthodes d'accès à l'environnement</title>
<para>
En plus des méthodes énumérées ci-dessus, il y a un certain nombre de méthodes
d'accès qui peuvent être employées pour affecter l'environnement de contrôleur frontal
- et ainsi l'environnement des classes auxquelles le contrôleur frontal délégue.
</para>
<itemizedlist>
<listitem>
<para>
<methodname>resetInstance()</methodname> peut être utilisé pour effacer tous les
réglages courants. Son but principal est pour les tests, mais elle peut
également être employée pour des instances où vous souhaitez enchaîner ensemble
les contrôleurs frontaux multiples.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)DefaultControllerName()</code> vous permet d'indiquer un
nom différent pour l'utilisation du contrôleur par défaut ("index" est employé
sinon) et de rechercher la valeur courante. Ils mandatent
<link linkend="zend.controller.dispatcher">le distributeur</link>.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)DefaultAction()</code> vous permet d'indiquer un nom
différent pour l'utilisation de l'action par défaut ("index" est employé sinon)
et de rechercher la valeur courante. Ils mandatent
<link linkend="zend.controller.dispatcher">le distributeur</link>.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)Request()</code> vous permet d'indiquer la classe ou
l'objet de <link linkend="zend.controller.request">requête</link> à utiliser
durant le processus de distribution et de rechercher la valeur courante. En
réglant l'objet de requête, vous pouvez fournir le nom d'une classe de requête,
dans ce cas la méthode chargera le fichier de classe et l'instanciera.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)Router()</code> vous permet d'indiquer la classe ou
l'objet de <link linkend="zend.controller.router">routage</link> à utiliser
durant le processus de distribution et de rechercher la valeur courante. En
réglant l'objet de routage, vous pouvez fournir le nom d'une classe de routage,
dans ce cas la méthode chargera le fichier de classe et l'instanciera.
</para>
<para>
Lors de la recherche d'un objet routeur, cela vérifie d'abord si un objet
est présent, et sinon, instancie le routeur par défaut ("rewrite
router").
</para>
</listitem>
<listitem>
<para>
<code>(set|get)BaseUrl()</code> vous permet d'indiquer
<link linkend="zend.controller.request.http.baseurl">l'URL de base</link> à
écarter lors du routage des requêtes et de rechercher la valeur courante. La
valeur est fournie à l'objet de requête juste avant le routage.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)Dispatcher()</code> vous permet d'indiquer la classe ou
l'objet <link linkend="zend.controller.dispatcher">distributeur</link> à
utiliser durant le processus de distribution et de rechercher la valeur
courante. En réglant l'objet de distribution, vous pouvez fournir le nom
d'une classe de distribution, dans ce cas la méthode chargera le fichier de
classe et l'instanciera.
</para>
<para>
Lors de la recherche d'un objet distributeur, cela vérifie d'abord si un
objet est présent, et sinon, instancie le distributeur par défaut.
</para>
</listitem>
<listitem>
<para>
<code>(set|get)Response()</code> vous permet d'indiquer la classe ou
l'objet de
<link linkend="zend.controller.response">réponse</link> à utiliser durant le
processus de distribution et de rechercher la valeur courante. En réglant
l'objet de réponse, vous pouvez fournir le nom d'une classe de réponse, dans ce
cas la méthode chargera le fichier de classe et l'instanciera.
</para>
</listitem>
<listitem>
<para>
<code>registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex
= null)</code> vous permet d'inscrire un
<link linkend="zend.controller.plugins">objet plugin</link>. En réglant le
paramètre facultatif <varname>$stackIndex</varname>, vous pouvez contrôler l'ordre
dans lequel les plugins seront exécutés.
</para>
</listitem>
<listitem>
<para>
<methodname>unregisterPlugin($plugin)</methodname> vous permet de désinscrire un
<link linkend="zend.controller.plugins">objet plugin</link>.
<varname>$plugin</varname> peut être soit un objet plugin ou une chaîne représentant
la classe du plugin à désinscrire.
</para>
</listitem>
<listitem>
<para>
<methodname>throwExceptions($flag)</methodname> est utilisée pour activer/désactiver
la possibilité de lever des exceptions durant le processus de distribution. Par
défaut, les exceptions sont récupérées et placées dans l'objet
<link linkend="zend.controller.response">réponse</link> ; activer
<methodname>throwExceptions()</methodname> surchargera ce comportement et indiquera au
contrôleur frontal de ne pas enregistrer le plugin de gestion des
erreurs : <code>ErrorHandler</code>.
</para>
<para>
Pour plus d'informations, voir <xref linkend="zend.controller.exceptions" />.
</para>
</listitem>
<listitem>
<para>
<methodname>returnResponse($flag)</methodname> est utilisée pour informer le
contrôleur frontal soit de récupérer la réponse (<constant>TRUE</constant>) issue de
<methodname>dispatch()</methodname>, ou si la réponse peut être automatiquement émise
(<constant>FALSE</constant>). Par défaut la réponse est automatiquement émise (en
appelant
<methodname>Zend_Controller_Response_Abstract::sendResponse()</methodname>) ;
activer <methodname>returnResponse()</methodname> surchargera ce comportement.
</para>
<para>
Les raisons de la récupération de la réponse incluent le désir de
vérifier l'existence d'exceptions avant d'émettre la réponse, la nécessité
d'enregistrer certains aspects de la réponse (comme les en-têtes), etc.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="zend.controller.front.methods.params">
<title>Paramètres du contrôleur frontal</title>
<para>
Dans l'introduction, nous avons indiqué que le contrôleur frontal agit également
en tant qu'enregistreur pour les divers composants du contrôleur. Il réalise ceci grâce
à une famille de méthodes "param". Ces méthodes vous permettent d'enregistrer des
données arbitraires - objets et variables - que le contrôleur frontal peut rechercher à
tout moment dans la chaîne de distribution. Ces valeurs sont transmises au routeur, au
distributeur, et aux contrôleurs d'action. Les méthodes incluent :
</para>
<itemizedlist>
<listitem>
<para>
<methodname>setParam($name, $value)</methodname> vous permet de régler un paramètre
unique nommé <varname>$name</varname> avec la valeur <varname>$value</varname>.
</para>
</listitem>
<listitem>
<para>
<methodname>setParams(array $params)</methodname> vous permet de régler des
paramètres multiples en une seule fois en utilisant un tableau
associatif.
</para>
</listitem>
<listitem>
<para>
<methodname>getParam($name)</methodname> vous permet de récupérer un unique
paramètre, en utilisant <varname>$name</varname> comme identificateur.
</para>
</listitem>
<listitem>
<para>
<methodname>getParams()</methodname> vous permet de récupérer la liste entière des
paramètres.
</para>
</listitem>
<listitem>
<para>
<methodname>clearParams()</methodname> vous permet d'effacer un paramètre unique (en
fournissant l'identificateur sous forme de chaîne), des paramètres multiples
(en fournissant un tableau d'identificateurs sous forme de chaîne), ou tous les
paramètres (en ne fournissant rien).
</para>
</listitem>
</itemizedlist>
<para>
Il y a plusieurs paramètres prédéfinis qui peuvent être réglés et qui ont des
utilisations spécifiques dans la chaîne d'expédition :
</para>
<itemizedlist>
<listitem>
<para>
<methodname>useDefaultControllerAlways()</methodname> est utilisée pour informer
<link linkend="zend.controller.dispatcher">le distributeur</link> d'utiliser le
contrôleur par défaut dans le module par défaut pour toute requête qui ne
serait pas distribuable (par exemple si le module/contrôleur/action n'existe
pas). Par défaut, cette fonctionnalité est désactivée.
</para>
<para>
Voir <xref linkend="zend.controller.exceptions.internal" /> pour plus
d'informations concernant l'utilisation de ce réglage.
</para>
</listitem>
<listitem>
<para>
<methodname>disableOutputBuffering()</methodname> est utilisée pour informer
<link linkend="zend.controller.dispatcher">le distributeur</link> qu'il ne doit
pas utiliser l'"output buffering" pour capturer le rendu généré par les
contrôleurs d'action. Par défaut, le distributeur capture tout rendu et
l'ajoute au contenu de l'objet réponse.
</para>
</listitem>
<listitem>
<para>
<code>noViewRenderer</code> est utilisée pour désactiver le
<link linkend="zend.controller.actionhelpers.viewrenderer">ViewRenderer</link>.
Réglez ce paramètre à <constant>TRUE</constant> pour le désactiver.
</para>
</listitem>
<listitem>
<para>
<code>noErrorHandler</code> est utilisée pour désactiver le plugin
<link
linkend="zend.controller.plugins.standard.errorhandler">ErrorHandler</link>.
Réglez ce paramètre à <constant>TRUE</constant> pour le désactiver.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="zend.controller.front.subclassing">
<title>Étendre le contrôleur frontal</title>
<para>
Pour étendre le contrôleur frontal, vous devez au minimum surcharger la méthode
<methodname>getInstance()</methodname> :
</para>
<programlisting language="php"><![CDATA[
class Mon_Controleur_Frontal extends Zend_Controller_Front
{
public static function getInstance()
{
if (null === self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}
}
]]></programlisting>
<para>
Surcharger la méthode <methodname>getInstance()</methodname> assure que des appels suivants à
<methodname>Zend_Controller_Front::getInstance()</methodname> retourneront une instance
de votre nouvelle sous-classe au lieu d'une instance de
<classname>Zend_Controller_Front</classname> - c'est particulièrement utile pour
certains des routeurs alternatifs et certaines aides de vue.
</para>
<para>
Typiquement, vous n'aurez pas besoin de sous-classer le contrôleur frontal à
moins que vous ne deviez ajouter une nouvelle fonctionnalité (par exemple, un plugin
d'autoloader, ou une manière d'indiquer des chemins d'aide d'action). Quelques exemples
où vous pouvez vouloir changer le comportement peuvent inclure modifier comment des
répertoires de contrôleur sont stockés, ou quel routeur ou distributeur par défaut sont
employés.
</para>
</sect2>
</sect1>
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 4,518
|
{"url":"https:\/\/www.wyzant.com\/resources\/answers\/topics\/trignometry","text":"84 Answered Questions for the topic Trignometry\n\nTrignometry Math\n\n06\/19\/20\n\n#### find the exact value\n\nUse a sum or difference formula to find the exact value of the following. sin (7pi )\/(30) cos (7pi )\/(60)+ cos(7pi )\/(30) sin (pi )\/(60)\nTrignometry\n\n06\/06\/20\n\n#### sin^2(45+theta) + sin^2(45-theta) = 1\n\nTrignometry Precalculus\n\n03\/05\/20\n\n#### Solve the equation on the interval [0,2 pie)\n\n4 cos^2 x=1x= ? Type an exact answer use integers of fractions for any number in the expression\nTrignometry\n\n02\/01\/19\n\n#### verifying trignometric identities\n\n(sec^4x-1)\/(tan^2x)=tan^2x+2\nTrignometry\n\n01\/12\/19\n\n#### Angle AOB has a measure of 2\u03c0 3 radians. The shaded region (a sector of the circle) has an area of 12\u03c0 2 cm . Find the exact area of triangle AOB.\n\nAngle AOB has a measure of 2\u03c0 3 radians. The shaded region (a sector of the circle) has an area of 12\u03c0 2 cm . Find the exact area of triangle AOB.using trignometry\nTrignometry\n\n09\/08\/18\n\n#### Trig Question\n\nA 100-foot wire is attached to the top of an antenna. The wire\u00a0touches the ground and an angle of 28\u00ba. How tall is the antenna to the nearest foot?\nTrignometry\n\n09\/03\/18\n\n#### Prove that tanx+cotx=2cosec2x and deduce tan75\u00b0+cot75\u00b0=4\n\nHow to solve this\nTrignometry\n\n08\/20\/18\n\n#### A small radio transmitter broadcasts in a 47 mile radius. If you drive along a straight line from a city 65 miles north of the transmitter to a second city 59 m\n\nA small radio transmitter broadcasts in a 47 mile radius. If you drive along a straight line from a city 65 miles north of the transmitter to a second city 59 miles east of the transmitter, during... more\nTrignometry\n\n08\/19\/18\n\n#### Proove SinA + CosA > 1\n\nSteps to proove the above equation\nTrignometry\n\n08\/16\/18\n\n#### Trigonometry\n\nMr Rynne, who is 188cm, is flying a drone in the park. He looks up at a 30 degree angle towards a tree that is 20m from him and sees a bird chirping in it. The bird is chirping at the drone that is... more\nTrignometry\n\n07\/23\/18\n\nWant asap\nTrignometry\n\n07\/16\/18\n\nTrignometry\n\n07\/16\/18\n\nTrignometry\n\n07\/16\/18\n\nTrignometry\n\n06\/06\/18\n\n#### If tan theta + 1\/tan theta = root 2 then find tan square theta + 1\/tan square theta\n\nThis question is asked by the CBSE BOARD and I could not find the answer of this question. So can anyone send me the answer.\nTrignometry Math Math Help\n\n05\/11\/18\n\nJohn is trying to bring his new painting into the house but there is a problem: the door of the house is 5'7 tall and 2' wide; the painting is 5' 9' tall and 7'10 wide and if it is tilted more than... more\nTrignometry\n\n03\/26\/18\n\n#### Given that tanA is 1\/\u221a5 ..find the value of cosec a -sec\u00b2A\u00f7cosec\u00b2A+sec\u00b2A\n\nRelated to trignometry\nTrignometry\n\n03\/20\/18\n\n#### A circle has a radius of the square root of 45 and is centered at -2.4,-4.8. Write the equation of this circle\n\nI need a lot of help with this specific question.\n\n02\/24\/18\n\n#### The magnitude of the sum of two vectors A and B, |A+B| is equal to |A| + |B|\n\nChoices: A. Vectors A and B are perpendicular. B. Vectors A and B are in opposite directions. C. Vectors A and B are in the same direction. \u00a0 What's the correct answer between them, and why... more\nTrignometry\n\n02\/10\/18\n\n#### Solve the equation in the interval [0,360) for 11sin^2x-7sinx=2\n\nit needs to be done without a calculator..\nTrignometry\n\n01\/31\/18\n\n#### If sin theta -cos theta=1\/2 then find the value of 1\/sin theta +cos theta\n\nPlase help in my maths b3cause mey maths is weak and tell answe4 as soon as possibli because it is my mother mobile\nTrignometry\n\n12\/18\/17\n\n#### trignometry\n\nthe angle of elevation of the top of the incomplete vertical pillar at a horizontal distance of 100m from its base is 45.if the angle of elevation of the top of the complete pillar at the same... more\n\n## Still looking for help? Get the right answer, fast.\n\nGet a free answer to a quick problem.\nMost questions answered within 4 hours.\n\n#### OR\n\nChoose an expert and meet online. No packages or subscriptions, pay only for the time you need.","date":"2021-12-01 20:54:35","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.5116589665412903, \"perplexity\": 1654.4822997447998}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-49\/segments\/1637964360951.9\/warc\/CC-MAIN-20211201203843-20211201233843-00421.warc.gz\"}"}
| null | null |
\section{Introduction}
In liquid markets the autocorrelation of price changes decays to negligible
values in a few minutes, consistent with the absence of long term
statistical arbitrage. Because innovations of a martingale are uncorrelated,
there is a strong suggestion that it is a process of this type that should
be used to model the stochastic part of the returns process. Classical
Mathematical Finance has, for a long time, been based on the assumption that
the price process of market securities may be approximated by geometric
Brownian motion
\begin{equation}
\begin{array}{lll}
dS_{t} & = & \mu S_{t}dt+\sigma S_{t}dB\left( t\right
\end{array}
\label{1.1}
\end{equation
Geometric Brownian motion (GBM) models the absence of linear correlations,
but otherwise has some serious shortcomings. It does not reproduce the
empirical leptokurtosis nor does it explain why nonlinear functions of the
returns exhibit significant positive autocorrelation. For example, there is
volatility clustering, with large returns expected to be followed by large
returns and small returns by small returns (of either sign). This, together
with the fact that autocorrelations of volatility measures decline very
slowly \cite{Ding2}, \cite{Harvey}, \cite{Crato} has the clear implication
that long memory effects should somehow be represented in the process and
this is not included in the geometric Brownian motion hypothesis. The
existence of an essential memory component is also clear from the failure of
reconstruction of a Gibbs measure and the need to use chains with complete
connections in the phenomenological reconstruction of the market process
\cite{Vilela1}.
As pointed out by Engle \cite{Engle}, when the future is uncertain investors
are less likely to invest. Therefore uncertainty (volatility) would have to
be changing over time. The conclusion is that a dynamical model for
volatility is needed and $\sigma $ in Eq.(\ref{1.1}), rather than being a
constant, becomes itself a process. This idea led to many deterministic and
stochastic models for the volatility (\cite{Taylor}, \cite{Engle2} and
references therein).
The stochastic volatility models that were proposed described some partial
features of the market data. For example leptokurtosis is easy to fit but
the long memory effects are much harder. On the other hand, and in contrast
with GBM, some of the phenomenological fittings of historical volatility
lack the kind of nice mathematical properties needed to develop the tools of
mathematical finance. In an attempt to obtain a model that is both
consistent with the data and mathematically sound, a new approach was
developed in \cite{Oliveira}. Starting only with some criteria of
mathematical simplicity, the basic idea was to let the data itself tell us
what the processes should be.
The basic hypothesis for the model construction were:
(H1) The log-price process $\log S_{t}$ belongs to a probability product
space $(\Omega _{1}\times \Omega _{2},P_{1}\times P_{2})$ of which the
(\Omega _{1},P_{1})$ is the Wiener space and the second one, $(\Omega
_{2},P_{2})$, is a probability space to be reconstructed from the data.
Denote by $\omega _{1}\in \Omega _{1}$ and $\omega _{2}\in \Omega _{2}$ the
elements (sample paths) in $\Omega _{1}$ and $\Omega _{2}$ and by $\mathcal{
}_{1,t}$ and $\mathcal{F}_{2,t}$ the $\sigma $-algebras in $\Omega _{1}$ and
$\Omega _{2}$ generated by the processes up to $t$. Then, a particular
realization of the log-price process is denoted
\begin{equation*}
\log S_{t}\left( \omega _{1},\omega _{2}\right)
\end{equation*
This first hypothesis is really not limitative. Even if none of the
non-trivial stochastic features of the log-price were to be captured by
Brownian motion, that would simply mean that $S_{t}$ was a trivial function
in $\Omega _{1}$.
(H2) The second hypothesis is stronger, although natural. It is assumed that
for each fixed $\omega_2$, $\log S_{t}\left( \cdot ,\omega_2\right) $ is a
square integrable random variable in $\Omega_1$.
These principles and a careful analysis of the market data led, in an
essentially unique way\footnote
Essentially unique in the sense that the empiricaly reconstructed volatility
process is the simplest one, consistent with the scaling properties of the
data.}, to the following model:
\begin{equation}
\begin{array}{lll}
dS_{t} & = & \mu S_{t}\,dt+\sigma _{t}S_{t}\,dB\left( t\right) \\
\log \sigma _{t} & = & \beta +\frac{k}{\delta }\left\{ B_{H}\left( t\right)
-B_{H}\left( t-\delta \right) \right\
\end{array}
\label{1.2}
\end{equation
the data suggesting values of $H$ in the range $0.8-0.9$. In this coupled
stochastic system, in addition to a mean value, volatility is driven by
fractional noise. Notice that this empirically based model is different from
the usual stochastic volatility models which assume the volatility to follow
an arithmetic or geometric Brownian process. Also in Comte and Renault \cit
{Comte} and Hu \cite{Hu}, it is fractional Brownian motion that drives the
volatility, not its derivative (fractional noise). $\delta $ is the
observation scale of the process. In the $\delta \rightarrow 0$ limit the
driving process would be the distribution-valued process $W_{H}
\begin{equation}
W_{H}=\lim_{\delta \rightarrow 0}\frac{1}{\delta }\left( B_{H}\left(
t\right) -B_{H}\left( t-\delta \right) \right) \label{1.3}
\end{equation
The second equation in (\ref{1.2}) leads to
\begin{equation}
\sigma \left( t\right) =\theta e^{\frac{k}{\delta }\left\{ B_{H}\left(
t\right) -B_{H}\left( t-\delta \right) \right\} -\frac{1}{2}\left( \frac{k}
\delta }\right) ^{2}\delta ^{2H}} \label{1.4}
\end{equation
with $E\left[ \sigma \left( t\right) \right] =\theta >0$.
The model has been shown \cite{Oliveira} to describe well the statistics of
price returns for a large $\delta$-range and a new option pricing formula,
with "smile" deviations from Black-Scholes, was also obtained. Here we will
be concerned with general consistency questions for the model, namely
arbitrage and market completeness. Also, in Section 3, some new results on
risk measures will be presented.
\section{No-arbitrage and market incompleteness}
It had been clear for a long time that the slow decline of the volatility
autocorrelations implied the existence of some kind of long memory effect in
the market. Several authors tried to describe this effect by replacing in
the price process Brownian motion by fractional Brownian motion with $H>1/2
. However it was soon realized \cite{Rogers}, \cite{Shiryaev}, \cite{Salopek
, \cite{Sottinen} that this replacement implied the existence of arbitrage.
These results might be avoided either by restricting the class of trading
strategies \cite{Cheridito}, introducing transaction costs \cite{Guasoni} or
replacing pathwise integration by a different type of integration \cit
{Oksendal} \cite{Elliot}. However this is not free of problems because the
Skorohod integral approach requires the use of a Wick product either on the
portfolio or on the self-financing condition, leading to unreasonable
situations from the economic point of view (for example positive portfolio
with negative Wick value, etc.) \cite{Hult}.
The fractional volatility model in (\ref{1.2}) is not affected by these
considerations, because it is the volatility process that is driven by
fractional noise, not the price process. In fact a no-arbitrage result may
be proven. This is no surprise because our requirement (H2) that, for each
sample path $\omega _{2}\in \Omega _{2}$, $\log S_{t}\left( \cdot ,\omega
_{2}\right) $ is a square integrable random variable in $\Omega _{1}$
already implies that $\int \sigma _{t}dB_{t}$ is a martingale. The square
integrability is also essential to guarantee the possibility of
reconstruction of the $\sigma $ process from the data, because it implies
\cite{Nualart
\begin{equation}
\begin{array}{lll}
\frac{dS_{t}}{S_{t}}\left( \cdot ,\omega _{2}\right) & = & \mu _{t}\left(
\cdot ,\omega _{2}\right) dt+\sigma _{t}\left( \cdot ,\omega _{2}\right)
dB_{t
\end{array}
\label{2.2}
\end{equation
We now consider a market with an asset obeying the stochastic equations (\re
{1.2}) and a risk-free asset $A_{t}
\begin{equation}
dA_{t}=rA_{t}\,dt \label{2.3}
\end{equation
with $r>0$ constant.
\noindent \textbf{Proposition 1:} \textit{The market defined by (\ref{1.2})
and (\ref{2.3}) is free of arbitrages}
The proofs of this and the next proposition follow the same steps as in \cit
{Kallianpur}. Technically, the similarity of the proofs follows from the
properties of volatility process (\ref{1.4}).
\smallskip
\noindent \textbf{Lemma:} \textit{For }$\sigma $\textit{\ given by (\ref{1.4
) one has:\newline
i) For any integer number }$n$\textit{, }$\int_{0}^{T}\mathbb{E}\left(
\sigma _{t}^{n}\right) dt<\infty $, \textit{where the expectation is with
respect to the probability measure }$P_{2}$\textit{;\newline
ii) Assuming that }$\mu \in L^{\infty }\left( \left[ 0,T\right] ,P_{1}\times
P_{2}\right) $\textit{\footnote
Since this assumption is quite natural, one assumes it throughout this work.
In addition, we also assume that $\mu _{t}$ is adapted to the product
filtration $\mathcal{F}_{1,t}\times \mathcal{F}_{2,t}$.}, for any }$t\in
\left[ 0,T\right] $\textit{\ there is a constant }$C>0$\textit{\ such that }
P_{1}\times P_{2}$\textit{-a.e.}
\begin{equation*}
\int_{0}^{t}\frac{(r-\mu _{s})^{2}}{\sigma _{s}^{2}}\,ds\leq C
\end{equation*}
\smallskip
\noindent \textbf{Proof:} The first property follows from
\begin{equation*}
\mathbb{E}\left(e^{\lambda\left( B_{H}(t) -B_{H}( t-\delta)\right)}\right)
=e^{\frac{\lambda^2}{2}\delta^{2H}}
\end{equation*}
for any complex number $\lambda$, while the second one from the H\"older
continuity of the fractional Brownian motion $B_H$ of order less than $H$
(cf.~\cite{Decreusefond}). More precisely, for each $\alpha\in\left(0,
\right)$ there is a constant $C_\alpha>0$ such that $P_2$-a.e.
\begin{equation*}
\left|B_{H}(t) -B_{H}(s)\right|\leq C_\alpha\left| t-s\right|^\alpha
\end{equation*}
and thus $P_1\times P_2$-a.e.
\begin{eqnarray*}
\int_0^t\frac{(r-\mu_s)^2}{\sigma_s^2}\,ds&\leq& \frac{(r+\Vert
\mu\Vert_\infty)^2}{\theta^2}\,e^{\left( \frac{k}{\delta }\right) ^{2}\delta
^{2H}}\int_0^t e^{\frac{2k}{\delta }\left|B_{H}(s) -B_{H}(
s-\delta)\right|}\,ds \\
&\leq& \frac{T(r+\Vert \mu\Vert_\infty)^2}{\theta^2}\, e^{\left( \frac{k}
\delta }\right) ^{2}\delta ^{2H} +2kC_\alpha\delta^{\alpha-1}}
\end{eqnarray*}
\hfill$\blacksquare \medskip$
\noindent \textbf{Proof of Proposition 1: } Let $P:=P_{1}\times P_{2}$ be
the probability product measure and define the proces
\begin{equation}
Z_{t}=\frac{S_{t}}{A_{t}} \label{2.4}
\end{equation
in the interval $0\leq t\leq T$, which obeys the equatio
\begin{equation}
dZ_{t}=\left( \mu _{t}-r\right) Z_{t}\,dt+\sigma _{t}Z_{t}\,dB_{t}
\label{2.5}
\end{equation
Now le
\begin{equation}
\eta _{t}=\exp \left( \int_{0}^{t}\frac{r-\mu _{s}}{\sigma _{s}}\,dB_{s}
\frac{1}{2}\int_{0}^{t}\frac{\left\vert r-\mu _{s}\right\vert ^{2}}{\sigma
_{s}^{2}}\,ds\right) \label{2.6}
\end{equation
which by the Lemma fulfills the Novikov condition and thus it is a $P
-martingale. Moreover, it yields a probability measure $P^{\prime }$
equivalent to $P$ by
\begin{equation}
\frac{dP^{^{\prime }}}{dP}=\eta _{T} \label{2.7}
\end{equation
By the Girsanov theorem
\begin{equation}
B_{t}^{\ast }=B_{t}-\int_{0}^{t}\frac{r-\mu _{s}}{\sigma _{s}}\,ds
\label{2.8}
\end{equation
is a $P^{\prime }-$Brownian motion an
\begin{equation}
Z_{t}=Z_{0}+\int_{0}^{t}\sigma _{s}Z_{s}\,dB_{s}^{\ast } \label{2.9a}
\end{equation
is a $P^{\prime }$-martingale. By the fundamental theorem of asset pricing,
the existence of an equivalent martingale measure for $Z_{t}$ implies that
there are no arbitrages, that is, $\mathbb{E}_{P^{\prime }}\left[ Z_{t}
\mathcal{F}_{1,s}\times \mathcal{F}_{2,s}\right] =Z_{s}$ for $0\leq s<t\leq
T $.\hfill $\blacksquare \medskip $
\noindent \textbf{Proposition 2:} \textit{The market defined by (\ref{1.2})
and (\ref{2.3}) is incomplete}
\smallskip
\noindent \textbf{Proof: }Here we use an integral representation for the
fractional Brownian motion \cite{Decreusefond}, \cite{Embrechts}
\begin{equation}
B_{H}\left( t\right) =C\int_{0}^{t}K\left( t,s\right) dW_{s} \label{2.10a}
\end{equation
$W_{t}$ being a Brownian motion independent from $B_{t}$ and $K$ the square
integrable kernel
\begin{equation*}
K\left( t,s\right) =C_{H}s^{\frac{1}{2}-H}\int_{s}^{t}(u-s)^{H-\frac{3}{2
}u^{H-\frac{1}{2}}\,du,\quad s<t
\end{equation*
($H>1/2)$. Let $(B_{t},W_{t})$ be a bi-dimensional Brownian motion on $P$.
Given the $P_{2}$-martingale
\begin{equation}
\eta _{t}^{\prime }=\exp \left( W_{t}-\frac{1}{2}t\right) \label{2.11a}
\end{equation
we now use the product $\eta _{t}\eta _{t}^{\prime }$. Due to the Lemma, the
Novikov condition is fulfilled insuring that $\eta _{t}\eta _{t}^{\prime }$
is a $P$-martingale and
\begin{equation}
\frac{dP^{\prime \prime }}{dP}=\eta _{T}\eta _{T}^{\prime } \label{2.12a}
\end{equation
a probability measure. As before, the Girsanov theorem implies that the
Z_{t}$ process is still a $P^{\prime \prime }$-martingale. The equivalent
martingale measure not being unique the market is, by definition,
incomplete.\hfill $\blacksquare \medskip $
Incompleteness of the market is a reflection of the fact that in stochastic
volatility models there are two different sources of risk and only one of
the risky assets is traded. In this case a choice of measure is how one
fixes the volatility risk premium.
\section{Leverage and the identification of the stochastic generators}
The following nonlinear correlation of the returns
\begin{equation}
L\left( \tau \right) =\left\langle \left\vert r\left( t+\tau \right)
\right\vert ^{2}r\left( t\right) \right\rangle -\left\langle \left\vert
r\left( t+\tau \right) \right\vert ^{2}\right\rangle \left\langle r\left(
t\right) \right\rangle \label{C1}
\end{equation
is called \textit{leverage} and the \textit{leverage effect} is the fact
that, for $\tau >0$, $L\left( \tau \right) $ starts from a negative value
whose modulus decays to zero whereas for $\tau <0$ it has almost negligible
values. In the form of Eqs.~(\ref{1.2}) the volatility process $\sigma _{t}$
affects the log-price, but is not affected by it. Therefore, in its simplest
form the fractional volatility model contains no leverage effect.
Leverage may, however, be implemented in the model in a simple way \cit
{Vilela3} if one identifies the Brownian processes $B_{t}$ and $W_{t}$ in
\ref{1.2}) and (\ref{2.10a}). Identifying the random generator of the
log-price process with the stochastic integrator of the volatility, at least
a part of the leverage effect is taken into account.
The identification of the two Brownian processes means that now, instead of
two, there is only one source of risk. Hence it is probable that in this
case completeness of the market might be achieved. However questions like
mathematical consistency and arbitrage properties of the new model are to be
checked.
Let us now consider the market (\ref{1.2}) and (\ref{2.3}) with $B_{t}$
appearing in (\ref{1.2}) replaced by the standard Brownian motion $W_{t}$
which appears in the integral representation (\ref{2.10a}).
\noindent \textbf{Proposition 3:} \textit{This new market is free of
arbitrages}
\smallskip
\noindent \textbf{Proof:} In this case $P_{1}=P_{2}$. Since the item ii) in
the Lemma still holds for the product measure $P_{1}\times P_{2}$ replaced
by the probability measure $P_{2}$, with this change of probability measure
the proof of this result follows as in the proof of Proposition 1.\hfill
\blacksquare \medskip $
\section{Some risk measures}
Let $\delta S=S_{t+\Delta }-S_{t}$ an
\begin{equation}
r\left( \Delta \right) =\log S_{t+\Delta }-\log S_{t} \label{3.0}
\end{equation
be the return corresponding to a time lag $\Delta $.
The value at risk (VaR) $\Lambda ^{\ast }$ and the expected shortfall
E^{\ast }$ ar
\begin{equation}
\int_{-S}^{-\Lambda ^{\ast }}P_{\Delta }\left( \delta S\right) d\left(
\delta S\right) =P^{\ast } \label{3.4}
\end{equation
\begin{equation}
E^{\ast }=\frac{1}{P^{\ast }}\int_{-S}^{-\Lambda ^{\ast }}\left( -\delta
S\right) P_{\Delta }\left( \delta S\right) d\left( \delta S\right)
\label{3.5}
\end{equation
$S$ being the capital at time zero, $P^{\ast }$ the probability of a loss
\Lambda ^{\ast }$ and $P_{\Delta }\left( \delta S\right) $ the probability
of a price variation $\delta S$ in the time interval $\Delta $. In terms of
the returns these quantities ar
\begin{equation}
\int_{-\infty }^{\log \left( 1-\frac{\Lambda ^{\ast }}{S}\right) }P\left(
r\left( \Delta \right) \right) d\left( r\left( \Delta \right) \right)
=P^{\ast } \label{3.6}
\end{equation
\begin{equation}
E^{\ast }=\frac{S}{P^{\ast }}\int_{-\infty }^{\log \left( 1-\frac{\Lambda
^{\ast }}{S}\right) }\left( 1-e^{r\left( \Delta \right) }\right) P\left(
r\left( \Delta \right) \right) d\left( r\left( \Delta \right) \right)
\label{3.7}
\end{equation
For the fractional volatility model the probability distribution of the
returns in a time interval $\Delta $, is obtained \cite{Oliveira} fro
\begin{equation}
P\left( r\left( \Delta \right) \right) =\int_{0}^{\infty }p_{\delta }\left(
\sigma \right) p_{\sigma }\left( r\left( \Delta \right) \right) d\sigma
\label{3.3}
\end{equation
with
\begin{equation}
p_{\delta }\left( \sigma \right) =\frac{1}{\sqrt{2\pi }\sigma k\delta ^{H-1}
\exp \left\{ -\frac{\left( \log \sigma -\beta \right) ^{2}}{2k^{2}\delta
^{2H-2}}\right\} \label{3.1}
\end{equation
\begin{equation}
p_{\sigma }\left( r\left( \Delta \right) \right) =\frac{1}{\sqrt{2\pi \sigma
^{2}\Delta }}\exp \left\{ -\frac{\left( r\left( \Delta \right) -\left( \mu
\frac{\sigma ^{2}}{2}\right) \Delta \right) ^{2}}{2\sigma ^{2}\Delta
\right\} \label{3.2}
\end{equation}
Using (\ref{3.3})--(\ref{3.2}) $\Lambda ^{\ast }$ and $E^{\ast }$ are
computed from (\ref{3.6}) and (\ref{3.7}). As an illustration in the figures
1 and 2 one shows the results for $P^{\ast }=0.01$ ($99\%$VaR) and time lags
from 1 to 30 days, using the following parameter
\begin{equation*}
H=0.83;k=0.59,\beta =-5,\delta =1
\end{equation*
These values are obtained from typical market daily data ($\delta =1$ day).
The results are also compared with those obtained from a simple lognormal
price distribution with the same averaged volatility.
\begin{figure}[tbh]
\begin{center}
\psfig{figure=VaR3.eps,width=5truecm}
\end{center}
\caption{VaR in the fractional volatility model compared with the lognormal
with the same average volatility}
\end{figure}
\begin{figure}[tbh]
\begin{center}
\psfig{figure=Shortfall3.eps,width=5truecm}
\end{center}
\caption{Expected shortfall in the fractional volatility model compared
with the lognormal with the same average volatility}
\end{figure}
One sees that both for VaR and the expected shortfall, the fractional
volatility model predicts much larger values than the lognormal. This
results mostly from the fatter tails in the model (as well as in the market
data).
\section{Remarks and conclusions}
1) Being partially reconstructed from empirical data, it is no surprise that
the fractional volatility model describes well the statistics of returns.
The fact that, once the parameters are adjusted by the data for a particular
observation time scale $\delta $, it describes well very different time lags
seems to be related to the fact that the volatility is driven not by
fractional Brownian motion but its increments.
2) What at first seemed surprising was the fact that the same set of
parameters would describe very different markets \cite{Oliveira}. This
motivated a search for the kind of behavior of the market agents which would
be consistent with the statistical properties observed in the model (and
also on the empirical data). Two stylized models were considered. In the
first the traders strategies play a determinant role. In the second the
determinant effect is the limit-order book dynamics, the agents having a
random nature. The conclusion was that the market statistical behavior (in
normal days) seems to be more influenced by the nature of the financial
institutions (the double auction process) than by the traders strategies
\cite{Vilela2}. Specific trader strategies and psychology should however
play a role on market crisis and bubbles. Therefore some kind of
universality of the statistical behavior of the bulk data throughout
different markets would not be surprising.
3) As pointed out in Section 3, the identification of the Brownian process
of the log-price with the one that generates the fractional noise driving
the volatility, introduces an asymmetric coupling between $\sigma _{t}$ and
S_{t}$ that is also exhibited by the market data. It is natural to expect
that in this case, because there is only one generator of stochastic risk,
the market will be complete. A rigorous mathematical proof of this result,
which would be akin to the proof of uniqueness of a constrained Girsanov
construction, is still lacking.
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 2,510
|
US Has Decided to Retaliate Against China for Hacking … Somehow
By Scott August 4, 2015 3 Mins Read
The Obama Administration has finally come to the realization it can no longer hide its head in the sand since every media outlet has reported on China being the culprit behind the massive OPM breach. It is at this crossroads the US has decided to retaliate against China for hacking but the officials remain uncertain on the exact method to be used:
But in a series of classified meetings, officials have struggled to choose among options that range from largely symbolic responses — for example, diplomatic protests or the ouster of known Chinese agents in the United States — to more significant actions that some officials fear could lead to an escalation of the hacking conflict between the two countries.
That does not mean a response will happen anytime soon — or be obvious when it does. The White House could determine that the downsides of any meaningful, yet proportionate, retaliation outweigh the benefits, or will lead to retaliation on American firms or individuals doing work in China. President Obama, clearly seeking leverage, has asked his staff to come up with a more creative set of responses.
"One of the conclusions we've reached is that we need to be a bit more public about our responses, and one reason is deterrence," said one senior administration official involved in the debate, who spoke on the condition of anonymity to discuss internal White House plans. "We need to disrupt and deter what our adversaries are doing in cyberspace, and that means you need a full range of tools to tailor a response."
In public, Mr. Obama has said almost nothing, and officials are under strict instructions to avoid naming China as the source of the attack. While James R. Clapper Jr., the director of national intelligence, said last month that "you have to kind of salute the Chinese for what they did," he avoided repeating that accusation when pressed again in public last week.
But over recent days, both Mr. Clapper and Adm. Michael S. Rogers, director of the National Security Agency and commander of the military's Cyber Command, have hinted at the internal debate by noting that unless the United States finds a way to respond to the attacks, they are bound to escalate.
Mr. Clapper predicted that the number and sophistication of hacking aimed at the United States would worsen "until such time as we create both the substance and psychology of deterrence."
breachchinacybercybersecuritygovernmentmilitaryopmpoliticssecurity
Wikileaks Recent Release of Documents Stipulating the US Is Spying on Japan Is "Deeply Regrettable"
August 4, 2015 2 Mins Read
DHS Thinks the Senate's Cyber Security Information Sharing Bill Is Terrible, So Why Is It Moving
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 7,812
|
"Fighting Where We Stand" – Transcript of the Submedia Video Program
Blogger's note: This video is one of the best I've seen in a long while at putting together several strands of recent strong movement activity – all of it centered on land occupation and resistance. Thanks to the Submedia collective which produced it, "Occupations & Properties" here reproduces the English subtitle script of the 30 minute episode.
The stories in this episode start with the famous ZAD in France, the years-long airport resistance. There was a grand compromise on the airport construction, and an agreement to vacate with one faction of the encampment. Another wanted to preserve the utopia. This part speaks about internal conflicts in occupation, a topic that goes beyond propaganda.
Much of this episode focuses on Native American resistance to oil companies and pipeline construction. There is much along this line, from the newly vindicated, utterly unquaint Native American reasoning on stewardship, wisdom about healing within nature, and their methods of confronting and questioning agents of the state and corporations who enter their lands.
From Slovenia, urban squatters speak about "the twin minefields of eviction and legalization" – (exactly the dynamic described in Amy Starecheski's book "Ours to Lose") on NYC squatters' legalization).
Here follows the subtitle script:
(Sorry, I haven't put in the names of the speakers yet...)
Greetings Troublemakers! ... welcome to Trouble. My name is not important. From the endless turf battles found within the animal kingdom, to the mechanized carnage of modern warfare, the drive to control territory is a potent and recurring source of conflict.
Yet within the artificial borders that fortify the so-called "developed world", this type of conflict, like all others, is carefully managed. Which is not to say it doesn't exist. People quarrel with their neighbours all the time, even in suburbia and in places like Chicago's South Side,young men routinely get shot fighting over street corners.
As groups and individuals, we face differing types and levels of conflict in our everyday lives... but at the end of the day, the ultimate manager and mediator of these conflicts is the state. Through their police, courts and prison systems, states enforce laws that reproduce power dynamics, restrict our choices, and regulate our behaviour.
The allocation of resources is determined by the logic of the so-called "free market", whereby ownership over land is given official sanction by the state-backed illusion of private property. The key to the state control over our lives lies in its ability to regulate all conflict within a given physical area. It follows, then, that those of us seeking to steal back the power to resolve conflicts on our own terms must first draw a firm line in the sand, and deny access to the state and its sophisticated apparatus of social control.
In order to meaningfully assert collective autonomy, we must be capable of defending territory. Over the next thirty minutes, we will explore three autonomous zones serving as living embodiments of defiance to state rule: the ZAD, or Zone to Defend, in Notre-Dame-des-Landes, France; Unist'ot'en Camp located on the Wet'suet'en territories of so-called BC; and the autonomous spaces movement in Ljubljana, Slovenia. Along the way, we will speak with a number of individuals who are flaunting state authority, asserting control over the spaces they inhabit... and making a whole lot of trouble.
The ZAD has many realities. But mostly it's kind of a community where people try to experiment other ways to live their social and political life. In the end of the 1960s, somebody came up with an airport project for this area, Notre-Dame-des-Landes. And during all those years, the bocage [a terrain of mixed woodland and pasture] itself is put under the status of ZAD which basically means Postponed Planning Zone, which was transformed one day [renamed] into Zone to be Defended.
So there was a big resistance with lots of different forms of action, including sabotage, black bloc demonstrations, quite offensive defense. Occupying land is quite similar to a political squat, but with a strong dimension regarding the environment and the territory we live in.
During all those years, we did not simply organize politically against the airport, but we also made connections locally. We took care of the land. Some of us settled for good. And we thought out the future of the ZAD together. So it's been ten years now that structures have been created on the ZAD to figure out how to live as autonomously as possible. It necessarily means that we have to be able to answer our basic needs. Like be fed, sleep under a roof, have access to medicine. It's a place that has become a place where you can live for free. You can build your house, your cabin...
The occupation movement was created at a time when some of the peasants had called for illegal occupation themselves. When squatters came in 2007 they were close to anarchist and/or antiauthoritarian ideas. Trying to work together and allowing for a diversity of tactics, and knowing that that is our strength.
We're fighting against this state and this project. Also we come here.... we fight against things, but we also try to create things together. And making things available and trying to share. That everybody has possibilities and access to a place to live... to water and food.
[Blogger's note: The discussant directly engages problems in the self-organization of the ZAD, and launches a critique of one clique there. This is unsurprising on the left, and less so in an anarchist video since the critique is directed at an authoritarian tendency. Still, it's a bit of a surprise to this blogger that this video includes this kind of reflection. Contemporary radical left discourse, especially in squatting, has moved far beyond propaganda.]
So there's a kind of hegemonic ideology. Diversity of tactics has been much more of a theory for the past few months. Certain ideas that become ways of judging people, of excluding people from discussions.
So yeah there's some kind of really well-organized, sort of communist ideas that have taken a lot of place in the past few years that will have a kind of discourse about "you have to go to our meetings, and if you don't agree you might have to leave, or shut up... or maybe later on we'll come beat you up with baseball bats."
Some people who used sabotage as a tactic have been pressured and even attacked for having dug holes in the concrete of one of the roads which crosses the ZAD. And someone especially was put in the trunk and taken out of there, molested and left almost naked in front of a psychiatric hospital. And it's been some years that contesting this hegemonic power of the dominant group has been much more difficult. They tend to concentrate wealth. To concentrate strategic discussions regarding the movement. Bonds with local farmers and people governing other institutions of the movement. And they of course, deny it when it comes to critique. We provoked a number of discussions on the place that their reading group, called the CMDO, has been held among us. But they never recognized, publicly, their group as a group of power. And thus, never wanted to share that power with other groups or individuals.
It was mainly this group of persons which pushed towards the negotiations during the evictions.
Well as you can see all around us it's pitch black. People were not expecting the expulsions to happen until 6am this morning, local time here in France. Tiny groups of people chose their means of actions.
When the police attack, making barricades, going to harass the police in any form, or any way... to throwing back their own grenades or other forms of explosives, or molotov cocktails. From sabotage attempts ... especially on the tanks.
We really wanted to see one burn.
bear-warrior-with-head, from unsettlingamerica.wordpress.com blog
Digging holes to prevent the tanks from going further. And of course, erecting barricades and defending them.
Wet'suwet'en Nation Defense
Deep in the central interior forests of so-called British Columbia lies the unceded territory of the Wet'suwet'en nation. Never surrendered to the settler-colonial Canadian state, the gateway to these remote territories is the headwaters of the Wedzinkwah River, which lies under the stewardship and protection of the Unist'ot'en clan, one of the five house groups that make up the Wet'suwet'en nation.
For the past decade, the Unist'ot'en have been physically blocking the construction of three major oil and fracked gas pipelines slated to pass through their territories en route to refineries and tankers on the Pacific coast.
Ground zero in this stand has been the Unis'to'ten Camp, constructed in 2010 as a permanent resistance community, located smack dab in the path of the originally proposed route of the Northern Gateway, Pacific Trails, and Coastal Gaslink pipelines.
The Unist'ot'en have also established a checkpoint system, with access to the territories conditional on completing a Free Prior and Informed Consent Protocol. This system grants the Unis'tot'en authority over who gains access to their territory, which has allowed them to keep representatives of the extractive industry and Canadian state at bay. This territory is unceded Unist'ot'en territory, which is part of the Wet'suwet'en territory. Knedebease is the hereditary chief that manages this territory, and I am a member of that house group, so we manage these territories. And in my view, it is not Canada. It's not BC. This has always been Wet'suwet'en territory because we've never ceded or surrendered it to anybody.
Doesn't belong to the crown. Doesn't belong to the federal government. Doesn't belong to the provincial government. It belongs to Unist'ot'en. To my people.
We started travelling through the territories back here a lot more frequently. And the reason why we started spending a lot of time back here is because there were some proposed pipelines that were being proposed by industry and by government, to begin doing some preliminary work back here to stop them. You guys can't be doing any work in here, because we've already told them no. That they can't access our territory. Once we found out that industry was trying to force their way in, we put our cabin directly in the path of the initial proposal for Enbridge, for the bitumen pipeline that was proposed to come through here.
So the log cabin sits right en route of their GPS points of where Enbridge initially had planned to put their pipelines through here. At the same time, there was Coastal Gaslink and Pacific Trails Pipeline that wanted also to put pipelines through our territory. To me that's not self-sustaining. When it's really quick, it's boom and bust.
And they'll come, and then they'll be gone and they'll leave their mess behind. As you see on the sign behind it says checkpoint. So whenever industry, or just anybody comes through here you go through protocol, which you ask a series of six questions:
Who are you? Where are you from? How long do you plan to stay if we let you in? And do you work for industry or government that's destroying our lands? And how will your visit benefit Unist'ot'en?
And one of the key questions that they could not answer, truthfully and honestly, was the question where we ask "how will your visit benefit the people of this land?" Uhh.. I really don't think there is any benefit. And the reason why we turn them back is because they could not pass simple protocol questions.
The RCMP was created by the government to keep our people off our land. So, they are part of the government, so they too don't pass protocol. We don't trust police, because we're suspicious that your forces would in to scope out our layout so that if there is an injunction, you guys would be better prepared about how you're gonna deal with us.
The camp serves as a beacon for other people who are struggling with these ideas. That they might not be able to stop a project from coming through their territories. And you know, for anybody to stand up to something like that is quite a daunting task. But a lot of people who have studied us over the years, and learned from the resistance that we've taken... they've taken those lessons and have started their own actions. And there's an incredible amount of economic and logistical disruption that arise from that type of activity.
We are here today in solidarity with the Unist'ot'en camp. We wish to share the Unist'ot'en hereditary chief's clear statement that they do not consent to having pipelines built on their unceded traditional territory. This colonization has always been about the taking of Indigenous lands. We always said if we heal our people, then we'll heal our land.
The healing center idea came when we realized that "why aren't our own people coming out here to visit us?" And even though some do come, there's not a high number of our own people. And we realized that a lot of our people are still struggling because of colonization. From the Residential School era. From the public school system ... lotta racism. We realized that a lot of our people are struggling because of trauma. And we realized that we needed a healing facility that incorporated all the whole wellness thing that we were talking about.
Bear and Wolf defenders from warriorpublications.wordpress.com
And we wanna put our culture back into our people. So that they will be strong and they will stand up. When people come out to a space like this, what they experience is land that's actually beginning to go through the healing process. This land back here that we're walking through and passing through, is land that was devastated from logging already.
And it's in a process of healing. It actually has berry bushes, so we're surrounded by berry bushes here. There are grizzly bear tracks a half a kilometer from here. So when people come up to spend time here, they begin to learn about the importance of connecting themselves to the planet that is in need of healing.
Struggle and Cession in Cities
While defending territory from state incursions is hard enough in rural, or remote natural terrains, those seeking to establish autonomous spaces in urban environments face an additional set of challenges. Cities are sites of concentrated state power. Not only are they strongholds of surveillance and repression, but they are also areas where the logic of state control is thoroughly integrated into everyday social relations.
This opens the door to recuperation, a process whereby state power constantly shifts and adapts itself in order to preemptively cut off and assimilate potential threats to its authority and legitimacy. This is the balancing act faced by urban squatter movements in cities around the world, whose participants must constantly navigate the twin minefields of eviction and legalization. This means simultaneously avoiding the social isolation that would make full-scale repression possible, while also combating state and real estate developers' attempts to transform these spaces into nothing more than edgy tourist destinations. One of the really important functions of the urban occupation is that it becomes a source of inspiration.
Despite being surrounded by hostile forces – in the form of state, police, capital – that it is possible to have a space in which you can experiment with different forms of existing. With different forms of living. With different forms of relating to one another. We could speak about three distinct phases of squatting experiments in Ljubljana.
First one is early '90s. This is the time of the destruction of Yugoslavia. It's a time of massive changes in Slovenian society. This movement had a clear continuity with alternative cultural movements of the 80s that was heavily influenced by progressive currents such as feminism, LGBT movement, anti-militarist tendencies, ecological movements. This movement found its highest expression in the squatting of Metelkova military barracks in 1993.
The second wave of squatting can be traced to the late 90s. In around 98 and 99, several different initiatives and individuals were squatting different spaces in the city of Ljubljana and were all evicted from those squats. And in the middle of this wave of repression over the movement, the community of Metelkova decided to give one empty space in the Autonomous Cultural Center to the anarchist infoshop.
The third wave of squatting in Ljubljana is symbolized by the squatting of ROG Factory, which is maybe the biggest squat in Ljubljana. It was squatted in 2006 by a new precarious generation of younger people that later came to be identified as the generation without future. It has always been understood by us that the front between the two different squats is the same front.
Because if one of us is attacked, or evicted for instance, that will mean a huge attack on the ability of the other to actually be part of any kind of political process in the city. The relationship of the state has been slightly different in its expression. So for instance, when it comes to ROG they have had constant attempts of the city to either evict them or attack them in different ways.
And just two years ago there was the most serious attempt to tear down several buildings in that area. That attempt was stopped by a broader political mobilization.The nature of an urban occupation is that it is faced with different kinds of factors that perhaps escape rural occupations. Our squats are part of the neoliberal capitalist society that is progressing further and further towards social devastation. Every time we are faced with the processes that are destroying our cities, we always have to question our position and our changing position within those processes.
Metelkova and ROG both generate quite wide public support. So this forced the public authorities to be cautious. And even though there are several softer attempts to push Metelkova into the state of legalization, we haven't in the last decade really been faced with an attempt of eviction. That of course brings a different set of questions for all of us who are part of Metelkova squat. And that is, in such moments, where the city is actually trying to sell you as one of its premium tourist destinations... how do you maintain yourself as a space that can still produce radical social movements and interventions in the city?
Architectural rendering of ROG, formerly a bicycle factory... a naked x-ray, with all culture removed
That of course comes with every question of recuperation. How do we still manage to keep our practices DIY? How do we still manage to stay ungovernable, which is basically the only way not to become a squatting museum, or a sort of caricature of what a squat should be? Many people and many activities that are cleaned from the city center because of the demands of the tourist industry... we all end up in squats with different trajectories and different positions that we occupy in the current social-economic order.
This naturally leads to tensions. Some more serious than others. And the consequence also can be seen in what recently happened to club Jalla Jalla – it was destroyed in a fire. As a community this was immediately recognized as an effect of the general state in which the whole city is being pushed. And our focus is not only to rebuild Jalla Jalla the club, but also to rebuild and reclaim our collective capacity to resist the processes of devastation that are everywhere destroying the conditions of living for so many people in this town. Establishing and effectively securing an autonomous space isn't something that happens overnight. States cannot afford to let challenges to their legitimacy go unanswered, lest they serve as examples for others to follow.
For this reason, any political attempt to reject state authority over a territory is likely to provoke a serious reaction. It is therefore crucially important that those involved anticipate the state's response, and are in a strong enough position to weather the inevitable storm. Autonomous territories allow for the building of dual power. They are alternative focal points of legitimacy that can effectively challenge the state's monopoly on authority. Indigenous Nations draw this legitimacy from spiritual and cultural practices rooted in generations of deep connection to the lands claimed by their colonizers. For those of us more alienated from the lands and spaces we occupy, the process of asserting autonomy must begin with navigating the tensions and contradictions that exist in dominant society, cultivating strong bonds of solidarity, and fuelling antagonism towards the state. We'd rather not pass lessons to anyone. If people get inspired from what they've done here, it will always be a pleasure to share experiences and knowledge of those years spent here.
I think it has been proven several times that building the infrastructure for the movement and of the movement really becomes crucial in moments of high and demanding political mobilization in the society. To have the kind of spaces that enable you to maintain the historical memory of movements, that enable us to find different kinds of accomplices in our struggles for a different kind of world. With the help of allies all around the world ... we've garnered lots of support through Indigenous, non-Indigenous, professionals,... everyday citizens.
A lot of people do support what we're doing and have vocalized it to us. We have come here to be with you, to make sure you understand you're doing the right thing. There's always people who come here also who have connections, or who have been to other places where people are struggling and bring us information. And so that creates solidarity between different struggles. You need to ensure that the Indigenous people who have always lived on those lands, since millennia, are involved in that struggle. They have long stories. Ancient, ancient stories that talk about how and why they have responsibilities. The mere fact that a squat exists as a potential of development of autonomous ideas, of politically radical ideas, is of course already a threat to the state, a threat to capital's interests.
And therefore we will never be safe, no matter how many selfies tourists make here. If it is possible that in a city that is so increasingly gentrified, so penetrated with different capitalist forces if it is able to have a space where experimentation with our freedom is possible, then it kind of gives us hope that other kinds of political projects are also possible. And what we would really love to see is more of these kinds of inspirations around the world, around different cities, around different communities.
As for our inspiration, we take as much inspiration as possible from as many struggles as possible. The Zapatistas movement, even though we're far far from what they achieved. The Landless Peasant Movement, especially in South America, or Reclaim the Field network all over Europe. Or occupied neighbourhoods, like in Exarchia in Greece. Or people protecting seeds like in India. Rojava is, of course, an insight especially regarding feminist self-defence.
Some of us are also really close to the Italian struggle against the train line crossing the Val di Susa.
[Blogger's note: SqEK research group Gianni Piazza, convener of the most recent conference in Catania, Sicily, wrote a book about this peasant & activist resistance to a high-speed rail line construction; we drank "No TAV" wine at a social center in Rome in '14.]
Val di Susa police line. Image from italycalling.wordpress.com blog.
The most important thing is that we have to ask ourselves "what are our needs?" And then find ways through which we can express them. We're absolutely going to win this fight. Y'know, this is a fight that belongs to not only us, but all of our unborn. This is a fight that belongs to all of our ancestors who died fighting for these spaces, and protecting them.
So this is a fight that doesn't belong to us. We're not selfish people. This fight belongs to all of our Wet'suwet'en people past, present and future. Some of us went to fight the world of the airport. And the airport was a pretext to fight the system behind it. I'd say for me, the ZAD, it helps me burn the social and structural boundaries in my head ... and then almost everything became possible.
We live in a historical moment in which the global neoliberal order, wracked by overlapping social, economic and ecological crises, is rapidly unraveling before our very eyes. Yet far from being a cause for celebration, the dark new reality rising to take its place promises to be even worse. New and resurgent forms of state power are being constructed on foundations of hyper-nationalist reaction, armed with sophisticated new tools of surveillance and repression.
A proliferation of civil wars, surging levels of inequality and climate change-fuelled catastrophes are provoking historical levels of forced human migration. But while things look undoubtedly bleak, the rapid transformations currently underway have the potential to uncover new cracks in the facade of state power. Revolutionaries must be ready to take advantage of any and all opportunities that these shifting new dynamics may produce, establishing a decentralized network of autonomous zones that can sustain projects of mutual aid, respond to emergent threats, and coordinate solidarity across borders.
So at this point, we'd like to remind you that Trouble is intended to be watched in groups, and to be used as a resource to promote discussion and collective organizing. Are you interested in offering sustained material support for existing autonomous spaces, or figuring out what steps would be involved in launching your own? Consider getting together with some comrades, organizing a screening of this film, and discussing where to get started. Interested in running regular screenings of Trouble at your campus, infoshop, community center, or even just at home with friends?
Become a Trouble-Maker! For 10 bucks a month, we'll hook you up with an advanced copy of the show, and a screening kit featuring additional resources and some questions you can use to get a discussion going. If you can't afford to support us financially, no worries! You can stream and/or download all our content for free off our website. If you've got any suggestions for show topics, or just want to get in touch, drop us a line. This episode would not have been possible without the generous support of Komunal, Group Groix and Michael. Now get out there and make some trouble!
Many thanks to the Submedia collective for sharing the subtitled script with "Occupations & Properties."
Submedia collective: "Fighting Where We Stand", 30 minutes, November 2018
https://sub.media/video/trouble-14-fighting-where-we-stand-struggles-for-autonomous-spaces/
"My name is not important."
Marco Deseriis, "Improper Names: Collective Pseudonyms from the Luddites to Anonymous"
https://www.upress.umn.edu/book-division/books/improper-names
Donatella Della Porta, Gianni Piazza, "Voices of the Valley, Voices of the Straits: How Protest Creates Communities" (2008)
https://www.berghahnbooks.com/title/PortaVoices
While this academic book is expensive, Gianni has also written articles on the Val di Susa resistance
Spain Is Africa (Part Two) – The Seminar of Prof. Taylor
Colectivo Ayllu
Some Recent Institutional Motion
This is the second post about recent meetings and events of migrants and Afro-descendants in Madrid. After the earlier- and below-blogged conference at the Reina Sofia museum in July of this year, city cultural institutions are moving on the issue. Although the city proper still hasn't done much for the mainly African street-sellers without working papers who are represented by the Sindicato de manteros y lateros de Madrid (@manteroslateros, #LaLeydeExtranjeriaMata) – much less anything for the many African beggars (or sellers of the weird La Farola newspaper) who aren't part of the union, there are now a slew of cultural programs appearing.
The Afroconciencia group, resident at the giant Matadero cultural center ("Black in Spain"), produced a festival recently. It included a big market. Another African market event is slated for CSA La Tabacalera (although that is regular; Tabacalera self-organized has had a Templo Afro collective since its beginnings). Another resident group of Americans (no, not USAians), Colectivo Ayllu, has an exhibition up at Matadero as well: "Devuélvannos el oro" -- "Give us back the gold." And the weirdly conceived Grigri Pixel residency project at Medialab Prado has begun (#grigripixel18), dynamized by a meeting with anti-racist groups and social center activists. I hope to report on some of this action in later posts.
Professor's Taylor's Listening Session
Professor Keeanga-Yamahtta Taylor was in Madrid in the summer touring her recent books on Black Lives Matter and the Combahee River Collective. Her lecture is discussed in the previous blog post. The later seminar was peopled by members of many of the same groups as the MAC4 session (also blogged earlier), along with many new ones. Both events were part of the Reina Sofia Museum's fascinating series "Six Contradictions and the End of the Present". My notes are from the simultaneous translation into English.
Beatriz García Dorado of Traficantes de Sueños introduced. She referenced a 2005 project of migrant solidarity which that editorial collective had done, the "Ferrocarril Clandestino" (underground railroad). This early initiative was prefigurative, as today today rescue ships, like Open Arms, ply the Mediterranean despite the fulminations of the Italian interior minister.
There is now an alliance, Beatriz García said, between the precarious worker and the migrants. It is anti-capitalist, and works against the way people are divided.
Keeanga-Yamahtta Taylor said her interest in black feminism was spurred by the U.S. Black Lives Matter (BLM) movement and the women she met in it; especially the #SayHerName campaign to remember black female victims murdered by police, like Sandra Bland.
The Story of the Combahee River Collective
In the view of whites, Taylor said, black women are angry, aggressive, "impervious to pain." "Slavery was far more terrible for women." "Overlapping simultaneous oppressions explain the essence" of black feminist politics. In the 19th century there was both a "woman question and a "race problem." Gender, race and class meet in the Combahee River Collective Statement.
The name of the group came from an 1863 U.S. army raid directed by Harriet Tubman which freed 750 slaves. While the Combahee River Collective paralleled the mostly white New Left of the 1960s, the slogan/idea "the personal is political" was not a retreat, but a description of their lives of oppression. Their "daily indignities" were not abstract.
Like the Black Panther Party, the CBC's program was misconstrued as a demand for separation. The idea was that if black women were to be free, everyone would be free. "Black women will never be free within capitalism." Oppression is in the "marrow of the nation."
Between today and 40 years ago, the class divide between black people has grown. As an example, in Ferguson – [the 2014 protests in Ferguson, Missouri, after the police killing of Michael Brown] – black political figures urged young people "to get off the streets and vote for them." BLM rejects that kind of politics, and the "pathetic tradition of currying favor." The CBC, in contrast, were internationalists aligned with third world movements.
Muchas Quejas Importantes
The seminar was peopled by reps from many of the same groups as the MAC4 session, with many new ones.
NOTICE: I am sorry that I didn't get the names of people speaking, and sometimes not even their organizations. Please, if you know and can comment, I'll happily improve this and any other post. This is a rough report.
Discussant (Francesca?) – The NGOs [Non-governmental organizations] have been instrumentalized by the political parties. The Roma community [aka gypsies] has been criminalized. We seek cultural strategies both inside and outside the system.
[I thought about museums of the excluded, like the installation called the Culture and Art Museum of Migrant Workers in China I saw at the Principio Potosi show in 2010.]
Beatriz Garcia: Territorio Domestico is organizing care and domestic workers. Care work has been politicized. (Silvia Federici, author of Caliban and the Witch: Women, the Body and Primitive Accumulation, and an important theorist of 'women's work', has been to Madrid often to speak about this issue.) We are thinking of spaces we can build together.
Keeanga-Yamahtta Taylor – I am here to listen.
Josh (?) of the collective of transgender migrants (also present and speaking in the earlier meeting at MAC4) – Sexual dissidence is also an issue among migrants seeking refuge in Spain. We are talking about the politics of social death inflicted on non-heterosexual bodies.
Ángela Muñoz of Las Kellys, a group that organizes hotel cleaners – Tourism is the engine of the Spanish economy. The last labor reform laws made our hard jobs miserable. Cleaners are paid two euros (about $2.35) for each room cleaned. There is overt discrimination against black workers. We also regularly confront sexual violence.
"We migrant women have an extra load on us."
K-YT – That it is seen as women's work allows it to be devalued. It's an excuse to keep wages low.
? – Europe was built on slavery and genocide, but hides behind a universalist humanist discourse. It is a sinister legacy. In Spain it is fascism and racism. Gender colonialism. An inferiorization of peoples. The nationalist idea is of a hetersexual nation. Other bodies don't matter.
Institutional Aporias
K-YT – This is similar to the U.S. There is no national monument to slavery. A complete denial of racism in the USA.
[There is the Wright Museum of African American History in Detroit (est. 1965) with grand displays on slavery. There is the Black Holocaust Museum, founded by a lynching survivor in 1984, which lost its building in Milwaukee in '08, and is gimping along. In the '90s Colonial Williamsburg added a slave market to their recreation. Children cried. The very popular National Museum of African American History and Culture in D.C. is recent. Brand new is the National Memorial for Peace and Justice, aka the Lynching Memorial in Alabama.]
To admit this history would legitimize black demands for reparations. By denying it the disparities [in income and wealth, education, etc.] can be seen as inherent to black people, as coming from them.
A Caribbean journalist Taylor talked to in London said, "We were there, so we are here." People are here now to demand what is theirs. The expatriation continues. The past is not past.
[This was said in the shadow of the scandal of the Windrush generation in the UK, Caribbean immigrants to the island during the 1940s and '50s who had their UK citizenship revoked. This resurgent white nationalist policy abrogates the responsibility to negotiate the human legacy of imperialism in British society.]
? – A women's refugee network is forming. We need to make alliances to combat this socio-economic system.
K-YT – In the U.S. the police and ICE [Immigration and Customs Enforcement agency] have been unleashed.
[In June when she said this, I wrote in my notes, "I think she exaggerates, but not by much." Now, in October, after a brutal summer which saw the incarceration of migrant families, which continues with 13,000 children in concentration camps (the figure is only estimated) and the threat to jail more, I can see that she was not exaggerating in the slightest. One thing this nakedly brutal Republican administration is eradicating is any residual belief among its citizens that the US government represents good or moral political behavior in any way, on any level.]
This is a normalization of the security state, which began with the "9/11 process". It has affected everyone.
Start with the Most Oppressed
How to organize is to start with the most oppressed, and keep that struggle front and center. There is a lack of space in U.S. social movements to have these difficult conversations.
Man from SOS Racismo – As people who live in the margins, we are inside structures. There is a difference in the struggle around La Manada [a crew of rapists who were treated with leniency by a Spanish court, leading to mass protests by women against Spain's deep culture of male sexual aggression] and the struggles of the strawberry workers in the south of Spain who are mostly black. We are lonely in this struggle. The struggles of racialized people are always pushed to the margins.
The reception of the Aquarius [a boatload of rescued migrants which was rejected by the Italian government and welcomed in Spain] was very good, but it was atypical of what has been happening to other migrants arriving. Moroccan workers have been raped in factories.
Woman from the Vallekas PAH – I am Ecuadorian. To get documents we are often ignored by functionaries because they are racist. A Spanish person does not suffer this. The police stereotype us. In the PAH, we welcome everyone.
Another woman of the same group – I am from the Dominican Republic. I am here 21 years. But I am still being told, "Go back to your country."
Malik of the Sindicato of Manteros [the union of blanket sellers, mostly Senegalese migrants] – We experience police abuse every day. This is institutional racism. There is a rising current of xenophobia. The white left has closed their eyes, because the anti-racist struggle does not give them votes. The racism of the Popular Party and the Ciudadanos [right-wing Spanish parties, old and new] does give them votes. We are subject to invisibilization as sin papeles [without papers, sans papiers in France]. We need papers.
Francisco of the Colectivo Ayllu now resident at the Matadero cultural complex criticized the institution of power. "Racism has a cultural dimension" in the "Indian" identity. The Museum of the Americas has to recognize this pain. In our daily life and our private life we must reckon with this memory of colonization and white violence. We have to find ways of healing this long memory of pain. "We don't need a white voice" to tell us who we are.
Borders Are Violent Spaces
A woman from Peru added, mistrust and rage have very deep historical roots. We are speaking about power, and how we participate in it. There is a lot of desire to take on these problems. Borders are violent spaces, more violent for some than for others.
"Eric" – Race, class and gender, yes. But where is coloniality? We are not here to perform a victimist narration. We want to conquer a political situation. The tension with the white left is causing us great problems.
Woman from Territorio Domestico – I was protesting alone in front of a hotel because they were disrespecting and smashing me. If you are a black woman they don't respect you.
Lynching memorial in Mongtomery, Alabama, USA
Professor Taylor's Concluding Statement
K-Y Taylor concluded with a brief on the U.S. political situation:
The death toll from the hurricane in Puerto Rico, she said, shows what U.S. power looks like in a cultural context: 4,300 deaths. Black activists see cities as "internal colonies." A small space opened up for the black elite – after all, the U.S. had a black president! So black people think they are American.
The presence of white people is an issue in the Black Lives Matter movement. BLM groups are not integrated, but the protests see many white people involved. [And, I'll add, victim support as well.] There is a long history of independent black organizing, with left white people, not liberals, involved. Black people are 12% of the U.S. population. Changing society in an anti-capitalist way won't be possible with segregated movements. To confront the Trump administration "we have to figure out how to do things together." BLM is a young movement. It's not even four years since Michael Brown's murder. Now the U.S. government no longer counts people killed by police. Estimates are 1,000 a year. The biggest challenge now is "how does the movement get bigger?" There is no coalition organization for BLM. BLM doesn't have to manage diversity within their movement. Joining struggles seem like the obvious next step. For example, to connect to the immigration crisis, and attacks on Arabs and Muslims. But people are worried about their issue being subsumed. The funding streams of foundations tend to narrow the political perspectives of those involved. This makes people more conservative.
The rich are hoarding their wealth and we all have to scramble for what is left. Racism is the explanation for this, in "the way that it is explained away." Blame the poor, "paint them as crminals." The most vulnerable are blamed for their social problems. The center left political parties have failed to produce a change. Racism is a strategy the right has evolved to cover over their own failures to take care of society. "There is no post-Occupy autonomous organization in the U.S." Occupy was effectively smashed by the U.S. state. This, and the legacy of horizontalism, of "leaderlessness" has amplified the lack of input people have in the decision-making processes.
Okay, it was a pretty bleak afternoon. And, as we head into the US midterm elections, it could get bleaker. Hope not! I voted! But the renewed desire to fucking do something to stem the white nationalist counter-revolution, both electorally and in schools, streets and workplaces, has to be the best thing in the USA today.
Grigri Pixel -- "Magical objects in urban spaces"
https://www.medialab-prado.es/en/node/38323
MNCARS, Reina Sofia Museum – "Six Contradictions and the End of the Present"
http://www.museoreinasofia.es/en/activities/six-contradictions-and-end-present
Ferrocarril clandestino
http://www.exodo.org/la-red-de-apoyo-ferrocarril-2/
PDF The Combahee River Collective Statement - American Studies
http://circuitous.org/scraps/combahee.html
Principio Potosi show in 2010.)
https://potosiprincipleprocess.wordpress.com/
Black Holocaust Museum, Milwaukee (presently virtual)
https://abhmuseum.org/
Slavery and Remembrance -- Colonial Williamsburg, Virginia
http://slaveryandremembrance.org/partners/partner/?id=P0000
Lynching Memorial -- account of an Englishman's tour
Thomas Laqueur, "Lynched for Drinking from a White Man's Well"
https://www.lrb.co.uk/v40/n19/thomas-laqueur/lynched-for-drinking-from-a-white-mans-well?fbclid=IwAR0VzZM6g-LIVn09KQp5ywH1KwF714Zjxc4fsEdAfz7MCIOAFuz_zc_RHy0
Windrush scandal
https://en.wikipedia.org/wiki/Windrush_scandal
Windrush Generation
https://www.bbc.com/news/uk-43782241
from doomsteaddiner blog
Spain Is Africa (Part One): The Spanish Visit of Prof. Keeanga-Yamahtta Taylor
Keeanga-Yamahtta Taylor
A constant cause of activism in the squatting and social center occupation movement is open borders, and solidarity with migrants. The European squatting movement is peopled with activists from many European countries, most of them with colonial pasts of which activists are well aware. Threaded through this blog, and the book Occupation Culture that came out of it, are stories of experimental solidarities like the Metropoliz in Rome where punks and gypsies live together, and Jeudi Noir, the French collective that squats big buildings for migrants to live in. And recently in Madrid, the Sindicato de Manteros y Lateros – the union of blanket-sellers and can-sellers, who work selling on the streets without legal papers, was organized inside squatted social centers.
With the unceasing flows of migrants and refugees from south to north, the issue has been on the front burner of global politics, leading to the rise of "populist" neo-fascists who have mobilized white fear to win elections. At the same time, the USA has seen a spike in activism by people of color – by Afro-descendants in Spanish parlance, against police violence, and by immigrants against the mass detentions, deportations and jailing of children by the Trump government.
Beyond what can be called reactive activism, powerful as it may be, the inspiring initiatives of Cooperation Jackson in that Mississippi city are part of the global municipalist movement. (I've also blogged on them here.)
As municipalists have taken power in some Spanish cities, a line of work specifically focussed on migrants and Afro-descendants has been taken up by the cultural institutions. This string of posts will be devoted to a review of some of those initiatives.
A Union of the Excluded and Illegal
Earlier this year I was commissioned to write on a social art project with the Sindicato de Manteros y Lateros de Madrid (@manteroslateros), a kind of union for the mostly Senegalese and Bangladeshi migrants who sell stuff on the streets. They do the work they can do without papers, and endure much police harrassment and punishing fines. (The text was written, but not published – that's another story.)
But I saw the stirrings of a larger movement against institutional racism in Spain, which connects to wider struggles of migrants and marginalized peoples globally. In the summer at the MAC 4 conference, a group met to talk about it. (I blogged this in a July post "MAC 4: Anti-Racism and Subaltern Europe".)
That summer I could not follow most of the talk in ESP – but, with the visit of Princeton professor Keeanga-Yamahtta Taylor to Madrid shortly after I had another chance to catch up (@KeeangaYamahtta). Prof. Taylor is Anglophone, so the Reina Sofia museum which invited her set up a seminar with simultaneous translation into English.
She'd given a formal talk – on the translation ftom Traficantes de Sueños of her 2016 book. From #BlackLivesMatter to Black Liberation. And in the seminar she frequently referenced her work in the 2017 book How We Get Free: Black Feminism and the Combahee River Collective.
Black Feminism and the Combahee River Collective
Beatriz García Dorado of Traficantes de Sueños introduced. She referenced a 2005 project of migrant solidarity, the "Ferrocarril Clandestino" – underground railroad. (This early initiative has been eclipsed today by the rescue ships, like Open Arms, which ply the Mediterranean despite the fulminations of the Italian interior minister.)
There is now an alliance, Beatriz García said between the precarious worker and the migrants. It is anti-capitalist, and works against the way people are divided.
1987 pamphlet of the Combahee River Collective
Keeanga-Yamahtta Taylor said her interest in black feminism was spurred by the Black Lives Matter (BLM) movement and the women she met in it; especially the #SayHerName campaign to remember black female victims, like Sandra Bland, murdered by police.
In the view of whites, Taylor said, black women are seen as angry, aggressive, "impervious to pain." "Slavery was far more terrible for women." "Overlapping simultaneous oppressions explain the essence" of black feminist politics.In the 19th century there was both a "woman question and a "race problem." Gender, race and class meet in the Combahee River Collective Statement.
The name of the group came from an 1863 U.S. army raid directed by Harriet Tubman which freed 750 slaves. Identity politics for the Combahee River Collective was about how black women were being politicized. While they paralleled the mostly white New Left of the 1960s, the slogan/idea "the personal is political" was not a retreat, but a description of their lives of oppression. The "daily indignities" were not abstract.
Between today and 40 years ago, the class divide between black people has grown. As an example, in Ferguson – [the 2014 protests in Ferguson, Missouri, after the police killing of Michael Brown] – black political figures urged young people "to get off the streets and vote for them." BLM rejected that kind of politics, and the "pathetic tradition of currying favor." The CBC, in contrast, were internationalists aligned with third world movements.
NEXT: Spain Is Africa (Part Two) – The Seminar of Prof. Taylor: Important Complaints
16th c. engraving of Columbus landing in the Caribbean by Theodore de Bry. Via Florida Museum/University of Florida Library
Occupation Culture: Art & Squatting in the City from Below, by Alan W. Moore (Minor Compositions, 2015)
http://occupationculture.net/
Il Metropoliz – Space Metropoliz
https://www.spacemetropoliz.com/film/metropoliz/
Collectif Jeudi noir
https://fr.wikipedia.org/wiki/Collectif_Jeudi_noir
Cooperation Jackson
https://cooperationjackson.org/
Sindicato de manteros y lateros de Madrid - Inicio | Facebook / (@manteroslateros)
https://es-es.facebook.com/sindicatomanteroslaterosmadrid/
July post "MAC 4: Anti-Racism and Subaltern Europe" reporting on the anti-racism discussion
http://occuprop.blogspot.com/2018/07/mac-4-anti-racism-and-subaltern-europe.html
Keeanga-Yamahtta Taylor - Wikipedia
https://en.wikipedia.org/wiki/Keeanga-Yamahtta_Taylor
"She'd given a formal talk..."
Her talk in ENG with x-lation into ESP after each statement was posted by Katakrak as Keeanga-Yamahtta Taylor «Un destello de libertad» (a flash of freedom)
https://soundcloud.com/katakrak54/keeanga
Her visit was part of the museum's fascinating series "Six Contradictions and the End of the Present"
Combahee River Collective
https://en.wikipedia.org/wiki/Combahee_River_Collective
https://americanstudies.yale.edu/.../Keyword%20Coalition_Readin...
Of Platforms and Contradictions #2
This is my second post on the "Overexploited and Underpaid" talks, part of the series "Six Contradictions and the End of the Present" at the Reina Sofia museum in Madrid. In this I reflect on the seminar held with the main guests, professors Trebor Scholz and Tiziana Terranova.
It's great that the museum hosts events like this. Institutions here do continuous adult education about new ideas, new media, and the new ways of thinking, being, and working which these momentous changes entail. The processes of information capitalism are working so far in advance of most people's understanding it is imperative for state institutions to step up to educate the public. Continuous education will be needed for people to cope with the impending changes in every aspect of life.
The framing of this appearance was announced on the museum's website:
"Though the Internet was initially considered a public space based on the free interaction among equals, it is now conceived as a huge factory without walls where any aspect of the day-to-day life can be valorised, produced and commoditised. Is there any alternative to this scenario?"
A study document was prepared by the GEC, which is quite extensive, concluding with the group's "Requirements for a transformative cooperativism". I did not see this. I just kind of came along, and had no hesitation about barging into the conversation.
The seminar with the two guests began with a presentation on the short-term housing platform Airbnb by Javier Gil, a sociologist and activist with a Madrid tenants union (@Gil_JavierGil; I think this is the PAH, but not sure).
The Straight Dope on Airbnb
Two things are happening with Airbnb in Madrid, Gil said: property owners are taking housing out of the market because of the rent gap, and renters are doing it with their own flats, to help deal with a 38% increase of housing prices in last four years.
Of these in Madrid, only 6% are people doing it out of their own home; the other 94% are owners taking units out of the housing market. For them, said Terranova, management agencies in Naples contact owners and offer to manage their Airbnb. A big hotel chain in Madrid is doing that now, said Gil.
Around the corner from the museum in the diverse Lavapiés barrio, there is a strike now against a 300% rent increase. The tenants union is a collective solution to a collective problem, a message to owners that increasing rents so high will meet resistance. The "nos quedamos" (we stay) campaign refuses rent increases.
Gil spoke of "urban nomads," those who rent on weekends and sleep elsewhere. This is a stressful life for the individual, Scholz said. In your fieldwork how did you find the "urban nomads"? One by one, right? You could have found them more easily if you had access to the Airbnb data. The platform capitalists create market instabilities, and they don't allow for solutions to emerge using their data.
This market couldn't operate without a frame of government which allows this. Meanwhile, the human and social costs mount, and are not adequately addressed.
The Urban Money Mindset
Airbnb accelerates the housing market, Gil said, Precarious people can participate, but only in moments of crisis. For some it allows them not to work in traditional economy. They prefer that kind of life to a bad job. It's the new subjectivity. People start looking for more money opportunities in how you organize your life, your house. "Hey, I can rent my sofa too." The market is expanding itself into aspcts of life which have not been mercantilized.
The model of the market is continually enforced, said Terranova. How do we contest the political hegemony that enforces this modality over others? Maybe that is the form of the class struggle today, against the market.
In their publicity, Scholz said, Airbnb talks about this old lady who can now stay in her apartment thanks to them. The guy doing global outreach for Airbnb did his PhD on religious cults. He is aware of how to manipulate subjectivity around the company's product. Scholz said he was recently in a solidarity economy meeting and Airbnb was on the panel, presenting all these lies, a charming young lady. It's like the pharmaceutical industry selling drugs.
It is hard to communcate this to North American colleagues, he said. Because only health, education and services are growing sectors, these should be the basis of the economy, not the cost. The economy needs to be re-centered.
This is exactly the argument of feminist economist Kate Raworth with her conception of what she calls the "donut economy."
Addressing economic organization is a post-national way of thinking. Yet even as market capitalism and global finance have lost legitimacy, this precarity and financialization of everything embeds the neoliberal mentality very deeply.
An Excursus on Art
Terranova, referencing Stewart Hall, said that we need to "make stories" – the popular cannot be only the field of capital. We need novels, volumes of similar stories, TV shows in the reward and punishment format.
I disagreed on this. It's the argument of Stephen Duncombe for an "ethical spectacle" in his 2007 book Dream. I'm a diehard avant gardist, I suppose, and prefer to step outside the Spectacle for cultural strategies. Example, "Dada Ruso," the magnificent exhibition presently in the MNCARS museum.
At this point, a guy with TV experience spoke up, a producer of web series. Long form story telling in that medium, he said, is a corporation thing. It's very difficult to do something different. Bernardo Gutiérrez, who introduced the seminar, told of a friend who made a proposal for a TV show about student journalists around the time of the 15M movement. It sounded like a great pitch to me. It was rejected – "Who would be interested in that?", they said.
A garbage picker from Sao Paolo told Scholz, "I read your book, and it's inspiring, but I really need money." The question is, what do we have that people can engage with now, next week? It can be completely flawed, only temporary, but immediate in its effects. There is a story of Emma Goldman. She is giving a fiery speech, and afterwards an old worker says, That's great, but what about me? I'm old. I won't see the revolution. What about worker rights? She took the point.
Economy Is Political – Why No Co-op Lobby?
During the break I said that my biggest question concerned the apparent disconnect between political activism and cooperative initiatives. The Cooperation Jackson group in Mississippi has elected a mayor. They intend as well to build "a solidarity economy, anchored by a network of cooperatives and worker-owned, democratically self-managed enterprises" (quote from a succinct UK documentary on the group [ca. 30 min.]). The group is regularly invited to Barcelona en Comú's municipalist meetings (the "Fearless Cities" series), but has never come to Madrid.
Why don't the cooperatives demand political support and funding from their governments? A key part of the Cooperative Jackson plan is precisely to swing city contracts to workers cooperatives.
A convener of the GEC told me Madrid had tried that, through a program called Mares Madrid. But the right wing attacked it as "jobs for friends", and the timorous city council cut the funding way back.
When we reconvened, Scholz said he was seeing among academics a fatigue with analysis. They are reporting, analyzing, and then throwing their hands up, as if to say, What can we do about it?
"Free Jeremy Hammond," I cracked. (He is the notorious hacker of the Stratfor defense intelligence website who is doing 10 years in US federal prison; @FreeJeremyNet)
For me, Scholz said, it's not about bringing the giants down. Corporations and coops exist side by side – one can't destroy the other.
Side by side they may be, but one is beating and squashing the other, like Laurel and Hardy.
"An investor-based startup gets tax advantages. If you do the same thing as a co-op you don't. This has to change."
Scholz talks to policymakers, and has had success in Brussels, some in Germany and France. Jeremy Corbyn in the UK has made platform co-ops part of his program for the Labor party. Scholz's group has tried to get the US DSA (Democratic Socialists of America) to do the same. This is a long road, up a steep hill.
The infamous ALEC, which writes boilerplate regressive anti-union legislation for state governments around the USA, is joined at the hip with chambers of commerce. These bodies don't have co-ops on their agendas.
Scholz lamented that the biggest co-ops, like Spain's Mondragon and USA's TrueValue hardware chain don't flex their muscles politically. "Peoples banks in Germany are huge, but they are just like any other bank.... In Spain and Brazil the co-ops are rich... How do we motivate them to invest in their future?" These giant co-ops have lost sense of their mission and social responsibility. "They don't project their values outward. I think that's because of McCarthyism," Scholz said.
That's a historical question. Co-ops emerged strongly in the US during the Depression of the 1930s, but they were not included in Roosevelt's New Deal. Instead corporations and extractive industries were favored. The big co-ops have gone a long way to disassociate themselves with left politics.
But how can the chicken run away from the egg?
Today in the US, co-ops are part of Cooperation Jackson's plan. These organizers come out of the Malcolm X Grassroots Movement. Malcolm was on top of J. Edgar Hoover's enemies list. The Communist Caucus of the DSA in Oakland advocates cooperatives. They are a group despised by the Democrats.
Can a Union be a Co-op?
This blog began as an investigation into the squatting movement. And I keep a weather eye on that movement and its possibilities as they have changed over the years. Municipalism is part of that change, and I have blogged a lot about that. But now, to many in the left movements in Spain, municipalism has turned into something of a false promise – as a Chavista in Madrid anguished during the formal talk of Scholz and Terranova, "The left has come into power here but refuses to take power." Another part of that change is the emergence of what Beatriz Garcia has called social unionism in the world of the social centers, sindicalismo social.
The platform cooperativism program is quite hopeful. But the question remains, how can people move into positions of participation? It seems obvious that left electoral platforms should boost co-ops. Their constituents stand to benefit most. Unions as well, clobbered by foreign competition, regressive legislation (in the USA), and the looming clouds of AI and robots, should be out front of co-op formation. But they aren't doing it.
Which leaves... what, hackers, academics and anarchists?
How About a Squat?
Italian social centers come out of a strong autonomist marxist tradition. They have always been "workerist." So it was an unsurprising surprise that Terranova concluded her remarks at the seminar by recalling that many conversations in occupied social centers in Naples had contributed to her understandings of these issues. Now, she said, there is a fear that these centers, only recently given a path of legalization, may be shut down by a change of city administration.
(This was a key topic at MAC 4 which I blogged – but not that session. It is yet to come... [cue flush of shame].)
Luca Recano, who traveled from Naples with Terranova, explained that Macao in Milan, the cultural center that emerged out of an important squatting action there in 2012 – (I blogged it at the time; Emanuele Braga wrote of it in Scapegoat) – has turned the money they have raised from cultural activity into a blockchain crypto-currency called Common Coin, which also includes labor. (This is from the Bank of the Commons, now in beta.)
Political action is paid in the Macao system, because it is considered important work in the general interest.
Even so, Luca said, "strong contradictions which limit the reproduction of this experience.... There's a lack of trust among some in the use of the technology... a fear of scaling up this practice." Many of these economic relations remain on the level of gift economy.
Macao in Milan. "Nowhere", i.e. "utopia".
"I don't think that when people get paid that it's all about being paid," said Scholz. Speaking of a project he had done in India with dalit women, "becoming owner of a business changed their lives."
In a sense, OSCs are already quite internet platform-dependent. And they are intrinsically cooperatives. mount websites and use existing platforms like Twitter and Facebook to distribute their activities. They have a virtual presence that often lasts long past their actual physical existence.What they have not done – and it's a big stretch – is make substantive changes in people's daily economies.
I am doubtful that the OSCs can become incubators of cooperativism, either platform or brick-and-mortar, on anything like the scale of even a small restaurant chain. OSCs are too minoritarian, and their constituency is split, like classic anarchists, between sindicalists and insurrectionaries. But, as seminar introducer Bernardo Gutiérrez shows in his book Pasado mañana. Viaje a la España del cambio, sprouts of cooperativism are appearing all over Spain, not just in OSCs.
Municipalists have been concentrating on pulling what levers of the state they can, re-municipalizing privatized city services, building new social housing, and taming repressive police forces. It is up to entrepreneurs of the social to promote, institute and maintain the economies – many of them, and all diverse – that we so desperately need to survive the Anthropocene.
#platformcoop
#municipalismo
#mac4
NEXT: Back to Old Business – MAC 4 Concluding Session; Spanish Social Centers Ponder Legalization Strategies; The Madrid Seminar of Keeanga-Yamahtta Taylor
study document prepared by the GEC for this meeting
http://www.gec-madrid.org/wp-content/uploads/2018/09/Notes-on-Terranova-Scholz-seminar.pdf
Rent-gap theory
https://en.wikipedia.org/wiki/Rent-gap_theory
The concept of ethical spectacle offers a way of thinking about the tactical and strategic use of signs, symbols, myths, and fantasies to advance progressive, democratic goals.
http://beautifultrouble.org/theory/ethical-spectacle/
Russian Dada 1914–1924
http://www.museoreinasofia.es/en/exhibitions/russian-dada
UK documentary on the group Film length: 32:06 In Jackson, Mississippi, Cooperation Jackson are building a solidarity economy...
https://reelnews.co.uk/2018/09/10/all-reelnews-campaigns/environment/cooperation-jackson-building-a-social-and-solidarity-economy/
Mares de Madrid - Barrios. Economía. Futuro
Mares de Madrid es un proyecto de transformación urbana que, a través de la economía social y solidaria, busca fomentar iniciativas productivas innovadoras. https://maresmadrid.es/
Naples OSCs given a path of legalization...
Marta Cillero, "What Makes an Empty Building in Naples a 'Common Good'?", Political Critique, April 25, 2017
http://politicalcritique.org/world/2017/naples-common-good-empty-buildings/
Co-ops were not included in Roosevelt's New Deal....
Jonathan Rowe, "What History Books Left Out About Depression Era Co-ops", Yes! magazine, Sep 14, 2018
https://www.yesmagazine.org/issues/5000-years-of-empire/what-history-books-left-out-about-depression-era-co-ops-20180914
Beatriz García, "Centros sociales y sindicalismo: la potencia colectiva," June 2, 2015, Diagonal Periodico
https://www.diagonalperiodico.net/blogs/funda/centros-sociales-y-sindicalismo-la-potencia-colectiva.html
I blogged it in 2012....
http://occuprop.blogspot.com/2012/05/earthquake-in-milan.html
Bank of the Commons
https://bankofthecommons.coop/
M^C^O – Macao – their manifesto about Common Coin
www.macaomilano.org/spip.php?rubrique114
using the Bank of the Commons (now in beta)
"Messages of Rupture": An Interview with Emanuele Braga on the MACAO Occupation in Milan By by Cultural Workers Organize, translated by Roberta Buiani
http://www.scapegoatjournal.org/docs/04/04_Cultural%20Workers%20Organize_MessagesOfRupture.pdf
M^C^O - Macao
http://macaomilano.org
Posted by Alan W. Moore at 3:53 AM 2 comments:
On the Tech Beat – Of Platforms and Contradictions
Graphic from IGD podcast of Nov. '17 "Error451: #04 Net Neutrality"
So summer is done and it's back to school before you know it. There's still a bunch to say about what happened in Madrid in July – and I promise to get back to it. But first, to the current course work.
I attended a talk last week at the Reina Sofia museum entitled "Overexploited and Underpaid," part of a series called "Six Contradictions and the End of the Present" produced by the Grupo de Estudios Críticos.
The speakers were professors Trebor Scholz and Tiziana Terranova.
A study document was prepared by the GEC, which is quite extensive, concluding with the group's "Requirements for a transformative cooperativism". I did not see this. I just kind of came along to the seminar after the talk I blog below, and had no hesitation about barging into the conversation.
I had met Trebor 15 years ago at a conference in Buffalo, New York, called "Free Cooperation." I was working then on artists' groups and collectives (I finally published Art Gangs in 2012), so all this stuff and these people interested me. Key conveners of that long-ago conference were Trebor Scholz, Brian Holmes, Geert Lovink, and Howard Rheingold, a Whole Earth catalog veteran and professional tech optimist.
"Free cooperation" named a conditon of labor promoted by Christoph Spehr. A book came out of that conference published by Autonomedia which emphasized the creative side of online action: "New media artists create social online tools and urge others to participate," the promotion reads. "Knowledge collectives gather information in large, open repositories. Free culture – with all its file-sharing applications – is blossoming."
At that point internet penetration was about 13% of everybody. Last year it passed 50% of everyone in the world. What has powered that is not free cooperation, nor indeed any kind of blossoming. It has been the raw power of capital. And, despite Google's pledge to "not be evil," capital is not benign.
In 2016 I saw a barnstormer tour appearance by the authors of People Get Ready concerning the "jobless future" of AI (artificial intelligence) and super supple robots which turbo-capitalism can soon deliver. The implications for liberal democracy are bleak. The Atlantic magazine has been dinning this line for some time, most recently in a text by an Israeli author, who ought to know.
Or not. There's clear advantages everywhere for everybody in the platforms which capitalist internet firms have provided. This modern sword of Damocles hanging over our virtual banquet table is one of the "Six Contradictions" the seminar series at MNCARS set out to explore.
Scholz and Terranova both spoke in a formal lecture talk at the museum. I was immediately presented with a classic meat-world problem when a sniffling sneezing young woman sat down next to me, blocking me from the aisle. Foolish me, to take an inside seat. I really didn't want to get sick.
Terranova had the dystopian side of the argument, as she pointed out that the internet was developed with state funding. In the middle '90s it was opened to business and the market, and the slide towards monopoly concentration began. Investment poured in for all kinds of schemes. It stuttered with the "bubble" of '00, when many of the more hippie-minded projects popped, then came in again for real with the aim of disrupting all former businesses as usual. Ergo, shopping malls dying all over the USA today.
She began with an enormous obscure graphic – "Anatomy of an AI System [artificial intelligence] -- The Amazon Echo as an anatomical map of human labor, data and planetary resources." More than a map, this enormous graphic is accompanied online by an extensive illustrated essay. Terranova pointed out that the terms with which we think of capital and labor today must undergo deep change in the face of the rise of AI.
A 17th c. graphic from the "anatomy of AI" article; this illustration of "citafonia" from the Baroque era makes as much or more sense than the micro-rendering of the AI diagram itself....
All of this development is going to remain invisible to us, the users, "confined to the front end," i.e., the user interface. These ways of interacting with "computational platform capital," like Alexa and Siri [Alexa is Amazon's virtual assistant, like Siri from Apple's iPhone], raise the specter of a foreclosed dystopian future, like the TV series "Black Mirror." (Which, BTW, I will not watch as I consider it the epistemological equivalent of the "strong guys with guns" genre of TV programs.)
Alexa starts laughing in the middle of the night, scaring its owners. Is a resistance embedded in the program?
All of this is profoundly disruptive to life as we have known and lived it, driven by the idea that information-based economic models can replace market systems. What maintains this hegemony in the sphere of public life is neoliberalism, an ideology, a Foucauldian "abstract machine" that subjectively holds the explicit structures together.
Trebor Scholz had the optimistic role, but he began it with a sober reminder. "People gave their lives" for the rights of workers over the past 200 years, and now capitalist "sharing" platforms are wiping those away. Discrimination among platform workers and vendors is resurgent as well.
As the evangelist of platform cooperativism, he drove straight to a few of the 45 cases from his book with Nathan Schneider, "Ours to Hack and to Own." Among them is Up & Go Cleaners in NYC, one of a number of in-home services groups comprised of women of color and migrant laborers. There is here an alignment, a commonality with union organizing, as in the case of Las Kellys, and Territorio Domestico, workers' rights groups active in Spain among hotel cleaners and care workers.
Another is a Swiss co-op, MIDATA.coop which helps "citizens to securely store, manage and control access to their personal" health data. Very useful when talking to different doctors, and also to access clinical trials.
There is also FairBnB, a short-term rental platform which started in Italy and also works in Spain on a principle of "community-powered tourism," returning a portion of profit to local projects.
These examples directly address current hot button issues – low-wage labor, exploitation and exclusion of migrants from labor markets, data privacy, and impact of Airbnb tourism on housing availability.
The idea is not new, Scholz said. Older co-ops, some quite powerful – e.g., Mondragon, True Value hardware – are "hiding in plain sight" as they have adapted to the corporate landscape, and do not look down at the seedlings around them.
The platform cooperative idea has a good deal of powerhouse academic support behind it. Multiple sessions of training are being held, and publications produced.
A questioner wondered if this was not cultural imperialism? The precondition of co-design, that the workers themselves be intimately involved in developing the platform, works against that.
Politically, said Terranova, the main task is to show that platform capitalism is doing a lot of collateral damage. Scholz said that in the USA they are looking to municipalities to support these initiatives. As per André Gorz it's a "reformist reform."
People are struggling to survive, said Terranova. That's a strategy of power. They don't have time to organize. And (unsurprisingly) most of these platform capitalists are US companies.
NEXT: The seminar report
Six Contradictions and the End of the Present
Grupo de Estudios Críticos
@GECmadrid
http://www.gec-madrid.org/
one brief bio of Trebor Scholz
https://2017.open.coop/contributors/trebor-scholz/
Tiziana Terranova
https://transmediale.de/content/tiziana-terranova
an idea promoted by Christoph Spehr
http://wiki.p2pfoundation.net/Free_Cooperation
the book, "Free Cooperation"
http://networkcultures.org/blog/publication/the-art-of-free-cooperation/
internet penetration last year
https://www.internetworldstats.com/emarketing.htm
Summary highlights from People Get Ready, by Robert W McChesney and John Nichols
https://catholicclimatemovement.global/summary-highlights-from-people-get-ready-by-robert-w-mcchesney-and-john-nichols/
a text by an Israeli author – "Why Technology Favors Tyranny," by Yuval Noah Harari; extract from his book
https://www.theatlantic.com/magazine/archive/2018/10/yuval-noah-harari-technology-tyranny/568330/
shopping malls dying all over the USA
"Big, bold … and broken: is the US shopping mall in a fatal decline?", by Dominic Rushe. 23 Jul 2017
https://www.theguardian.com/us-news/2017/jul/22/mall-of-america-minnesota-retail-anniversary
"Anatomy of an AI System -- The Amazon Echo as an anatomical map of human labor, data and planetary resources."
More than a map, this
https://anatomyof.ai/
evangelist of platform cooperativism – Trebor Scholz has published a number of books.
This pamphlet by Trebor Scholz is online, "Platform Cooperativism: Challenging the Corporate Sharing Economy," January 2016
http://www.rosalux-nyc.org/platform-cooperativism-2/
Nathan Schneider – "Everything for everyone": Michel Bauwens interviews Nathan Schneider, Sept. 10, 2018
http://commonstransition.org/everything-for-everyone-michel-bauwens-interviews-nathan-schneider/
Find a Better Home Cleaning Service - Up & Go Cleaners
https://www.upandgo.coop/
Up & Go can help you quickly and easily access ethical, affordable home cleaning services in your area. Check providers, get estimates, and make bookings ...
MIDATA.coop | my data - our health
https://www.midata.coop/
MIDATA's initial focus will be on health related data since these are most sensitive and valuable ... informed about future research and citizen science projects.
FairBnB - Una solución justa e inteligente para un turismo gestionado ...
https://fairbnb.coop/es/
Lee nuestro Manifesto. Una plataforma de alquiler vacacional con tres ventajas: transparencia, copropiedad y valor añadido para los barrios.
MAC 4: "Subaltern Europe" Continued
A 2015 performance action against "wolfish" financial speculators in housing, performed by Warsaw group Miasto Jest Nasze
Voices from the East
In Raúl Sánchez Cedillo's trans-European segment of the MAC 4 conference Justyuna Koscinska of Miasto Jest Nasze spoke. That is the City is Ours group of Warsaw, Poland. (She distributed her card upon leaving the conference, which is quite untypical in these gatherings; it was easy then to find her group online.) They are fighting "wild reprivatizations" and evictions from social housing, and always the cutting down of trees to prepare parks for development.
(I recalled the hard story of the Warsaw woman housing activist murdered in the 1990s for her activism that we heard from activist architects at our SqEK conference in Rome in '14. Never solved. Even so, as I write this, NY Times reports: "In Poland, nearly half of the judges on the Constitutional Tribunal, one of the nation's top courts, rebelled and declared its workings politicized and dysfunctional", illustrated with a photo of people protesting in front of the Supreme Court in Warsaw. So not only the young left, but also the shreds of civil society are pushing back against the authoritarian government. SqEK's 2017 conference was in the east of Europe, in Prague, for the first time.)
Radomir from the Belgrade, Serbia, group Roof Overhead, a consortium of anti-eviction groups, spoke also of their struggle against the privatization of flats acquired during the socialist period. "When we made an electoral run," he said, "we were shocked by how the media banalized and stereotyped our positions. It's a thing to be aware of, how your positions will be distorted."
Justyuna concurred. "We are stereotyped as communists who want to terrorize society. Ownership of apartments has been valorized. We think it's better to rent. Tenants' rights is hard to discuss, because renting is associated with communism. The air pollution problem is also involved with ownership, and the property rights of the car."
She referenced the sanctuary cities movement, and the offering of municipal ID cards to migrants. Urban citizenship is happening more in the German-speaking world right now, she said. This amounts to rethinking global justice from the municipal level.
I was reminded of the prescient artists' project, recently shown in Madrid, the "NSK State." It was created in 1992 by people from Slovenian arts group Neue Slowenische Kunst (NSK). They issued passports for their "state", which for a period were actually used successfully by some African migrants.
One-time logo of Warsaw municipalist group
Corporate Power in Cities
A madrileño, Tom of Ecologists in Action, asked: "What are the limits of municipalism in relation to corporate powers? With Ahora Madrid we can see there are big limits. How to spend public monies is the question. Here in Madrid, a huge amount goes to transnational corporations. How can we get rid of that? We don't have small and medium companies to take over from the transnationals. From the first moment, corporate power was organized to stop any systemic change."
Now, he noted, AirBnB is lobbying in Brussels as the "European Holiday Association." They are asking the EU to intervene in cities' lawsuits against AirBnB, relying on the capitalist market policies of the EU.
A woman from Greece observed that now, ten big cities in Greece have left governments. Women have campaigned to pass resolutions against TTIP, the trade pact that would affect cities' ability to do local democracy, and other things.
Renau from Lisbon: The political questions are obvious, even if they are not discussed under the rubric of municipalism. The anti-austerity movements of 2011-12 were the biggest movements in Portugal since the Carnation Revolution. They started to shift the political composition of the ossified left in Lisbon. Questions around gentrification and tourism weren't as present. But recently there has also been a shift in global investment. A huge influx of foreign capital has come to Lisbon. Rented social centers have emerged. Squatting is hard because of the weakness of the social movements. There is now an Assembleia de Ocupação de Lisboa – AOLX to claim housing in Lisbon. We try to squat city-owned property. The group is not openly antagonistic, she said (although their blog posts are pretty rad). "They've sort of formed an NGO."
Passport of the NSK State
This compares directly to the NYC of the 1980s and '90s, when the movement squatted abandoned city-owned properties which the city was trying to sell to private developers. (The story is told in Christopher Mele's book, "The Selling of the Lower East Side.") Then artists weren't so hip to being used. Now artists are coming to the aid of the movements early on – e.g., the activist art group Left Hand Rotation has produced a documentary comparing the new pressures on housing to the 18th c. earthquake that levelled Lisbon.
Raul Recapped –
Isabel spoke (and I missed her) on how the work of care is being reorganized. On the long trend of racism. Ecologies of care. Techno-ecologies. On the new social commons, and on new ways of defining social struggles. Transformation of classes.
Poster from Euromayday
He summarized me (on the question I've written already) – speaking of constructing migrants as subjects in themselves, not only as subjects of care, and how cultural institutions could relate in that work.
Other points of his summary in telegraphic fashion –
Elections are useful mainly as ways of deblocking at the level of the state. I think this meant "deblocking" the path of the social movements, how they are constrained in terms of the invisibility of their issues, distortion, etc., and their inability to propose policy and legal solutions to their questions.
Gerald Raunig: We need our own media.
Lunch. (I failed to buy a ticket, and there was no more room.)
The second session of the Subaltern meeting was assemblyistic. Groups were defined in a kind of rolling chaos, but ended up being something like 1) on treaties, municipalists against them, and how to network for practical purposes; and 2) housing – the struggle against global funds like Blackstone, and e-platforms like Uber, Cabify, Air BnB.
I joined a 3rd group on networking. The discussion was broad:
In the electoral pursuits, you get into an NGO world. Which network can municipalists use to help them? Radomir of Belgrade – Foreign legitimation of our struggle against waterfront development was helpful.
Italian man – We need to share legal best practices. Other municipalities offer examples of what is possible to do. A knowledge exchange in the field of law. I mention the crowd source law project in Madrid, which is in its infancy.
A "how to" program of questions like social media, how to do campaigns, etc. Question of the local vs. the national: "Neighborhood politics is already transnational" because everyone comes from someplace.
Me – (broken record) Cultural institutions in relation to social movements.
Raul – There is no global-local opposition anymore. Any locality is already a small world, an isomorphism that is already academic. Democracy is not overdetermined by national interests and governments. The manteros are harrassed by local police. This is not only here in Madrid, but everywhere.
He proposes an action day on issues, like No Se Vende (Not For Sale) EU-wide.
The main idea is to reinforce each movement in its own place.
Tom of Ecologists in Action – Who represents municipalities on the EU level? EU regulations impact cities, but the cities can't influence them back? This is a question, to work to influence power on an EU level, or mainly to build local power? We can use a concrete exchange with political platforms like Corbyn's Momentum and Bernie Sanders campaign on media and social media.
Gerald – We need these classical campaign logics, but on social media we need not to be so classical. We should think of funding our own media. Using Facebook and so, we will not produce a disobedient character. For example, the Euromayday program, a networked event which started in Milan in 2001. It spread all over the EU. The question of precaricization of labor became foregrounded. They named the issue. Municipalism was long a'building. EU wide action days can help.
In Hamburg in 2009, I saw street poster traces of Euromayday all around the city, as groups there had participated and pushed the program. An amazing Lego animation announced it online. I met graduate students who planned to write theses on Euromayday. Now online there is merely a fading luminescence of this event. I put some in the links below.
Many, including Gerald Raunig and most recently Geert Lovink in an anthology by my publisher, have written on the question of dissident media, and the dystopian aspects of corporate social media platforms. These writings definitely inform my consumption and use of the corporate platforms. But "our own"? So much more easily said than done. I recall the failed efforts of Michael Alpert's zcomm.org to launch one a few years ago. I'd love to see Gerald get a big grant and launch a platform with built-in auto-translation (like Facebook and Twitter have), that would greatly extend the fine work EIPCP has done with its occasional multi-lingual e-zine.
MAC 4 Concluding Session; Spanish Social Centers Ponder Legalization Strategies; The Madrid Seminar of Keeanga-Yamahtta Taylor
Miasto jest Nasze | Warszawa: miasto mieszkańców!
http://miastojestnasze.org/
Roof Overhead, Belgrade, Serbia (in Cyrillic)
https://nedavimobeograd.rs/zdruzena-akcija-krov-nad-glavom-podrzala-ne-davimo-beograd/
Squatting in the East - Baltic Worlds
http://balticworlds.com/wp-content/uploads/2010/02/BW-1-2-2016-open-access.pdf
NSK State | The NSK TIMES
times.nskstate.com/about-nsk/
The city belongs to those who occupy it: Okupying Lisbon
blog post of Sept. '17 describes the movement
http://autonomies.org/2017/09/the-city-belongs-to-those-who-occupy-it-okupying-lisbon/
Assembleia de Ocupação de Lisboa - AOLX
https://www.facebook.com/assembleiadeocupacaodelisboa/
"Terramotourism" documentary by the activist art group Left Hand Rotation
http://autonomies.org/2016/11/the-plunder-of-tourism-lisbon/
I saw the Madrid city website last year, but now cannot find it. There is this article, which looks to be an exhaustive rundown, as of 3 years ago. (This stuff changes fast.)
Robert Ambrogi, "The Failure of Crowdsourcing in Law (So Far, At Least)", August 10, 2015, at lawsitesblog.com
Tomas Herreros and Raúl Sánchez Cedillo, "Euro Mayday: El otro 1 de mayo," 01/05/2008
http://blogs.publico.es/dominiopublico/488/euro-mayday-el-otro-1-de-mayo/
Publication in PDF (SP): "Milano-Barcelona. Euro MayDay 004. 1º www.euromayday.org. Primer de maig de 2004. MayDay! MayDay! Contra la precarització de la vida..."
https://marceloexposito.net/pdf/mayday_periodico.pdf
EuroMayDay - Tactical Media Files (ENG)
http://www.tacticalmediafiles.net/campaigns/6410/EuroMayDay;jsessionid=1C8A4F64F806E9DED6EF792AD9C52ED5
Geert Lovink and Ned Rossiter, eds., Organization after Social Media (Minor Compositions, UK/USA, 2018); online via Scribd at:
http://www.minorcompositions.info/?p=857#more-857
Publication in PDF (SP): "Milano-Barcelona. Euro MayDay 004. 1º www.euromayday.org. Primer de maig de 2004. MayDay! MayDay! Contra la precarització de la vida..." https://marceloexposito.net/pdf/mayday_periodico.pdf EuroMayDay - Tactical Media Files (ENG) http://www.tacticalmediafiles.net/campaigns/6410/EuroMayDay;jsessionid=1C8A4F64F806E9DED6EF792AD9C52ED5
"Fighting Where We Stand" – Transcript of the Subm...
Spain Is Africa (Part Two) – The Seminar of Prof. ...
Spain Is Africa (Part One): The Spanish Visit of P...
On the Tech Beat – Of Platforms and Contradictions...
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 1,655
|
The countdown has begun. As part of our collaboration with the BBC we're running a Human Jukebox radio series focused on Christmas songs and stories. You can hear them on BBC Newcastle this week 95.4 FM or on the soundcloud link below.
Bethany from Cleadon shares her story of a brush with the mellifluous tones of Aled Jones and a repeat of a Xmas dinner.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 8,260
|
{"url":"https:\/\/pypi.org\/project\/sfc-models\/0.2\/","text":"Stock-Flow Consistent (SFC) model generation\n\n## Introduction\n\nCreation and solution of stock-flow consistent (SFC) models. Currently under construction.\n\nAt present, the module sfc_models.iterative_machie_generator.py imports a text block of equations, and then writes a python module that implements that system of equations.\n\nAlthough such functionality is nice, the objective is to build modules that generate the systems of equations. That is, the user will specify the high-level sector description of the economy (which may include multiple countries), and the high-level description will be parsed to generate the low-level equations.\n\nFor another take on SFC models in Python see: https:\/\/github.com\/kennt\/monetary-economics\n\nDeveloped under Python 3.4, and is compatible with Python 2.7.\n\n## Sub-package: gl_book\n\nThe subpackage sfc_models.gl_book contains code to generate models from the text \u201cMonetary Economics\u201d by Wynne Godley and Marc Lavoie. Since the ultimate objective is to generate the equations algorithmically, these models are only used for comparative purposes.\n\nThe previously mentioned GitHub package by \u201ckennt\u201d consists of well-documented solutions of those models.\n\n## Solution Method\n\nThe single-period solution of a SFC model relies on market-clearing (not necessarily relying on price adjustments, unlike mainstream models). Market clearing relies on solving many simultaneous equations.\n\nAt present, the machine-generated code uses an iterative approach to solve x = f(x) (where x is a vector). We just passing an initial guess vector trhough f(x) and hope it converges.\n\nThis works for the simple models tested so far. The objective is to augment this by a brute-force search technique that relies upon economic intuition to reduce the dimension of the search space. The margins in this file are too small to write a proof of this technique.\n\n## Dependencies\n\n\u2022 matplotlib: for plots in examples. (May be required later.)\n\nDocumentation will be placed in the \u201cdocs\u201d directory.\n\nExamples are in the \u201cexamples\u201d directory.\n\n(Please note that setup.py - which is invoked by pip install - currently does not install those directories. The user will need to go to GitHub to get them, as well as the unit tests (and doctests) found in the tests\/ directory.)\n\nThe test coverage on the \u201cmaster\u201d branch is 100%, and the objective is to hold that standard. (There are some sections that are effectively untestable, and there appears to be issues with some lines that are undoubtedly hit as being marked as unreached; they have been eliminated with:: # pragma: no cover\n\nCopyright 2016 Brian Romanchuk\n\nLicensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \u201cAS IS\u201d BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\n## Release history Release notifications | RSS feed\n\nUploaded source\nUploaded 3 4","date":"2022-09-30 14:11:37","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.3838132917881012, \"perplexity\": 2943.4664862160616}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.3, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2022-40\/segments\/1664030335469.40\/warc\/CC-MAIN-20220930113830-20220930143830-00486.warc.gz\"}"}
| null | null |
How NOAA's first undersea lab helped scientists study corals
Focus areas:
Corals Week
In the early days of undersea research at NOAA, scientists needed to surface regularly when SCUBA diving to study coral reefs and other habitats. This slowed down their progress, making it difficult to conduct longer studies. All that changed with the introduction of the HYDROLAB.
A drawing of the HYDROLAB, showing a cross section of the inside.
See More of NOAA's Undersea Labs
Oral History with Dick Rutkowski, founder and former director of the NOAA Diving/Hyperbaric Training and Diver Treatment Facility
Coral Reef Conservation Program
Featured Heritage Stories
Evelyn Fields: A trailblazer
NOAA Heritage Homepage
What was the HYDROLAB?
The HYDROLAB was NOAA's first undersea research habitat where aquanauts could live on the ocean floor for days or weeks at a time. It was used by NOAA and its partners from approximately 1970 to 1985, in which time it housed over 700 scientists on more than 85 missions. The HYDROLAB operated on the ocean floor in the Bahamas, then in St. Croix, in the U.S. Virgin Islands.
NOAA's HYDROLAB, based in the Caribbean beginning in the mid-70s, was an underwater lab for researchers.
What does this have to do with corals?
The HYDROLAB made it easier to study coral reefs. The projects performed in the 1980s included studies of the life history and behavior of coral reef organisms, research on the chemical ecology and compatibility between the tissues of different sponges, and the development and testing of underwater fish marking and release techniques.
Two scientists in SCUBA gear float above a coral reef as they study it. The HYDROLAB sits in the background.
max occupancy of the HYDROLAB
number of bunks in the HYDROLAB
What was it like living in the HYDROLAB?
The HYDROLAB was very small, only 16 feet long and 8 feet in diameter - a little bigger than a mid-size car. In that space, it housed a lab, three bunks, and a moon pool, which allowed scientists to get in and out of the habitat while it was on the ocean floor. It had six viewports, electricity, running water, and heat. The HYDROLAB held four people, but since it only had three bunks, inhabitants had to rotate sleeping schedules.
When it was time to leave the HYDROLAB, the inhabitants had to spend at least 16 hours in a hyperbaric chamber, so they wouldn't get decompression sickness (known as "the bends"). This serious condition can lead to effects ranging from joint pain and rashes to paralysis and even death.
Four scientists inside the NOAA Hydrolab as it sits on the ocean floor, with two more scientists in SCUBA gear looking in through a window on the end of the structure.
Dive back in time to HYDROLAB: NOAA's first undersea research habitat
Where is the HYDROLAB now?
NOAA still has the HYDROLAB, but its undersea days are over. It was decommissioned in 1985 and replaced by the Aquarius for underwater research. The Aquarius is a more modern undersea dwelling and is currently the only one in the world being used for marine science. It resides in NOAA's Florida Keys National Marine Sanctuary and is operated by the Florida International University.
The HYDROLAB is currently on display in the NOAA Science Center in Silver Spring, Maryland.
Former NOAA Research administrator Craig McLean points to the HYDROLAB, where three mannequins are staged as though they are working in the small lab it houses.
Related Features //
Coral reef ecosystems
Coral reefs: Essential and threatened
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 7,630
|
Copperbelt Province is a province in Zambia which covers the mineral-rich Copperbelt, and farming and bush areas to the south. It was the backbone of the Northern Rhodesian economy during British colonial rule and fuelled the hopes of the immediate post-independence period, but its economic importance was severely damaged by a crash in global copper prices in 1973. The province adjoins the Haut-Katanga province of the Democratic Republic of the Congo, which is similarly mineral-rich.
The main cities of the Copperbelt are Kitwe, Ndola, Mufulira, Luanshya, Chingola, Kalulushi and Chililabombwe. Roads and rail links extend north into the Congo to Lubumbashi, but the Second Congo War brought economic contact between the two countries to a standstill, now recovering.
It is informally referred to at times as 'Copala' or 'Kopala', invoking the vernacular-like term of the mineral copper that is mined in the province.
Demographics
As per the 2010 Zambian census, Copperbelt Province had a population of 1,972,317 accounting to 15.21% of the total Zambian population of 13,092,666. There were 981,887 males and 990,430 females, making the sex ratio to 1,009 for every 1,000 males, compared to the national average of 1,028. The literacy rate stood at 83.10% against a national average of 70.2%. The rural population constituted 19.11%, while the urban population was 80.89%. The total area of the province was 31,328 km2 and the population density was 63.00 per km2. The population density during 2000 Zambian census stood at 63.00. The decadal population growth of the province was 2.20%. The median age in the province at the time of marriage was 21.7. The average household size was 5.3, with the families headed by females being 4.8 and 5.5 for families headed by men. The total eligible voters in the province was 66.10%. The unemployment rate of the province was 22.10%. The total fertility rate was 5.0, complete birth rate was 5.8, crude birth rate was 29.0, child women population at birth was 587, general fertility rate was 112, gross reproduction rate was 1.8 and net reproduction rate was 1.7. The total labour force constituted 50.40% of the total population. Out of the labour force, 63.2% were men and 37.7% women. The annual growth rate of labour force was 2.7%. Bemba was the most spoken language with 83.90% speaking it but bemba is not the indigenous language in fact the language spoken their is a lingua franca like the Nyanja of Lusaka, the indigenous language is Lamba. The total population in the province with albinism stood at 2,912. The life expectancy at birth stood at 54 compared to the national average of 51.
Administration
Provincial administration is set up purely for administrative purposes. The province is headed by a minister appointed by the President and there are ministries of central government for each province. The administrative head of the province is the Permanent Secretary, appointed by the President. There is a Deputy Permanent Secretary, heads of government departments and civil servants at the provincial level. Copperbelt Province is divided into ten districts, namely, Chililabombwe District, Chingola District, Kalulushi District, Kitwe District, Luanshya District, Lufwanyama District, Masaiti District, Mpongwe District, Mufulira District and Ndola District. All the district headquarters are the same as the district names. There are ten councils in the province, each of which is headed by an elected representative, called councilor. Each councilor holds office for three years. The administrative staff of the council is selected based on Local Government Service Commission from within or outside the district. The office of the provincial government is located in each of the district headquarters and has provincial local government officers and auditors. Each council is responsible for raising and collecting local taxes and the budgets of the council are audited and submitted every year after the annual budget. The elected members of the council do not draw salaries, but are paid allowances from the council. The Copperbelt province is a predominantly urban district and has three city councils. The government stipulates 63 different functions for the councils with the majority of them being infrastructure management and local administration. Councils are mandated to maintain each of their community centres, zoos, local parks, drainage system, playgrounds, cemeteries, caravan sites, libraries, museums and art galleries. They also work along with specific government departments for helping in agriculture, conservation of natural resources, postal service, establishing and maintaining hospitals, schools and colleges. The councils prepare schemes that encourage community participation.
Wildlife areas
There are no national parks in this most urban and industrial of Zambia's provinces. Other parks with wildlife aspects:
Chembe Bird Sanctuary west of Kitwe includes crocodiles and Sitatunga as well as plentiful bird life.
Chimfunshi Wildlife Orphanage (established mainly to rescue captive non-indigenous chimpanzees).
Geography
The Copperbelt region of Zambia and Congo D.R. is a 500 million year old mountain chain, the Lufilian Arc, which formed when two large pieces of continental crust, the Kalahari craton and the Congo craton, collided. This collision was one of the many that happened between 700 and 500 million years ago to form the Gondwana supercontinent.
This collision is thought to have remobilised base metals, largely already present in the sediments that had accumulated in the basin between the two cratons. These brines then concentrated the base metals either along stratigraphic boundaries, or along fractures, faults or within structurally controlled 'traps' (such as the nose of a fold). The collision also produced crustal shortening, during which the stratigraphic sequence was tectonically pushed northwards on top of the Congo Craton.
The Lufilian Arc contains two diamictites, megaconglomerates of glacial origin. One of those is correlated with the Sturtian glaciation, while another correlates with the Marinoan Glaciation, both global glaciation events that had profound influence on the history of the planet.
The Lufilian Arc is correlated along trend to the west with the Damara Orogen in Namibia, which also hosts large mineral deposits.
Copperbelt Province is rich with mineral finds and mines. The name of the province is given by the rich finds of copper ore (e.g. Chingola, Konkola, Nchanga Mines), but notable are also emerald mines along Kafubu River, which in the first 6 months of 2011 yielded 3.74 tons of high quality emeralds.
Economy and education
As 2004, the province had 856 basic schools, 71 high schools and the number of school children out of school in ages between 7 and 15 stood at 856. The unemployment rate was 32 per cent and the general unemployment rate for youth stood at 55 per cent as of 2008. The province had 213 doctors as of 2005. There were 377 Malaria incidence for every 1,000 people in the province as of 2005 and there were 26,799 AIDS death as of 2010.
The total area of crops planted during the year 2014 in the province was 122,525.52 hectares which constituted 6.46% of the total area cultivated in Zambia. The net production stood at 315,153 metric tonnes, which formed 7.74% of the total agricultural production in the country. Maize was the major crop in the province with 37,610 metric tonnes, constituting 17.56% of the national output.
See also
Ndola City Council
Notes
References
External links
Provinces of Zambia
Copper mining
Geology of Zambia
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 2,638
|
That 1 Painter Launches New Locations In North and Central Texas
The 1 Painter has announced the opening of five new locations in Texas's North and Central regions. Their plans are ambitious and they are motivated to grow. In order to provide jobs and resources to communities, they are eager to see That 1 Painter's proven systems in action in their own neighborhoods.
Rick Lucas, Southlake's franchisee, has been an estimator at That 1 Painter's Austin location, so he has gained valuable experience from working in that position. A sense of sincerity was a key factor in his decision to become a franchise owner. "I actually came on with them as a contractor, so I kinda got to learn the behind-the-scenes first. After that, they brought me into estimating, learning the company, and being part of it – following the deep roots, the sincerity in everything they do made me fall in love with the company, not just because they were my nephews."
That 1 Painter Southlake will surely prosper from his commitment to the business and the company's support of their employees! "They are focused on improving people's lives, and sometimes that's just a different position…that's what made me want to become a franchisee." – Rick Lucas | That 1 Painter Southlake
T1P's new Fort Worth location will be managed by Benbrook native Mansur Ismail-zade. According to Manny, it only takes a little bit of local help to make anything happen. He has a deep love for his community and strives to help others! "Right now I live in Benbrook, and what I wanna do with the community in Benbrook and in general is to just better the life of people and make sure their homes are looking beautiful, make sure they are comfortable in their place, and just provide a great service." – Mansur Ismail-zade | That 1 Painter Fort Worth
The Georgetown location of That 1 Painter welcomes a friendly face and former estimator from their Austin location, Ricardo Fontanez. "The Good Teacher says It's better to give than to receive." I am committed to giving my passion, time, and experience to help my community in any way possible." By providing excellent service and assistance to potential customers and employees, Ricardo will help others to achieve their dreams.
Additionally, That 1 Painter is launching locations in North Texas, Southlake, Fort Worth, and Georgetown.
Dedication to fantastic service is a huge part of what draws people to sign on for a franchise. Evidenced by a multitude of stellar reviews and their doubling revenue during the pandemic, this company has proven their systems work and that they know how to teach them.
That 1 Painter North Texas owner, Rocky Nudurupati, is looking forward to the training and marketing systems that will enable him and the other 4 franchisees to stand out in a growing market. "In the next 3-5 years I would like to be at a place where if anyone would think about a painting job in my territory, the first thing they would think is – hey, let's go with Rocky to get the painting job done!" – Rocky Nudurupati | T1P North Texas
With an extensive training program that involves personal coaching, a remarkable Brand Team, and seamless scheduling systems, franchisees have enough support to hit the ground running before their business even launches.
Visit that1painterfranchise.com to learn more
About That 1 Painter
Born out of a passion and purpose to help people, That 1 Painter has grown since its founding in 2011 to offer over 18 painting services to the communities of Austin, San Marcos, Tyler, Longview, Frisco, and Plano with other locations already in the works. T1P uses its resources and talents to offer free painting to those in need, through their Paint It Forward program and extends it's missional outreach to refugees in Africa. The very core of this business is to spread love and generosity throughout the world and to bless their customers with outstanding service while achieving their mission
Learn More About Our Franchise
What Zip Code Are You In?*
What are your questions for us?
Available Liquid Capital
Available Liquid Capital $0 - $49,000 $50,000 - $99,000 $100,000 - $149,000 $150,000 - $199,000 $200,000 or more
PrevPreviousIntroducing a Friendly Face | Ricardo Fontanez leads That 1 Painter Georgetown
San Antonio Local Launches That 1 Painter West San Antonio
San Antonio Local Launches That 1 Painter West San Antonio Ken LaFon | Owner of That 1 Painter West San Antonio Ken LaFon is a
From T1P Project Manger to Owner of That 1 Painter Cypress – Katy
From T1P Project Manger to Owner of That 1 Painter Cypress – Katy Damen Carlson | Owner of That 1 Painter Cypress – Katy
T1P Dream Team Trio Launch That 1 Painter Galveston County
T1P Dream Team Trio Launch That 1 Painter Galveston County Chad Fancher, Hunter Estes, & Dylan Walker | Owners of That 1 Painter Galveston County
© 2021 That 1 Painter. All Rights Reserved.
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 1,880
|
{"url":"http:\/\/www.r-bloggers.com\/quick-guide-to-parallel-r-with-snow\/","text":"# Quick guide to parallel R with snow\n\nJanuary 10, 2014\nBy\n\n(This article was first published on My Data Atelier \u00bb R, and kindly contributed to R-bloggers)\n\nProbably, the most common complains against R are related to its speed issues, especially when handling a high volume of information. This is, in principle, true, and relies partly on the fact that R does not run parallely\u2026. unless you tell it to do so!\n\nR offers a wide variety of packages dedicated to parallelisation. After doing several tries with some of them, I found snow the best one (for me) to perform classical parallellizable operations. Among the functions that this package provides, I found the parApply family the most useful ones and the easiest to work with to take profit of parallelisation.\n\nIn order to use these functions, it is necessary to have firstly a solid knoweldge of the apply-like functions in traditional R, i.e., lapply, sapply, vapply and apply. What are they exactly? In essence, they apply a function over an array of objects.\n\nThe example below would return a numeric vector consistent of 3,4,5\u202610 for variable \u201cresult\u201d\n\n my.vec <- 1:10 result <- vapply(my.vec,function(x) x+2,FUN.VALUE=0) \n\nThis code returns exactly the same output as the one below\n\n my.vec <- 1:10 result <- numeric(length(my.vec)) for(i in 1:length(my.vec)){ result[i] <- my.vec[i]+2} \n\nOf course, in this example no significant speed differences can be found between the 2 pieces of code shown. However, even in one-node executions, the first alternative is considerably faster, which can be appreciated when working with larger amount of data. For a vector of length 1000000, the difference is 0.94 vs 3.04 secs\n\nIn the internet, plenty of posts and tutorials about the use of lapply,sapply,vapply and apply can be found, for example here. However, it is not redundant to explain again what each function does:\n\na)Lapply\n\nApplies a function over a vector and returns a vector of lists. If lapply were used in the previous example and would want to obtain the first element, a \u201clist-like\u201d indexing should be used\n\n my.vec <- 1:10 result <- lapply(my.vec,function(x) x+2) #get the third element of result result[3][[1]] \n\nb)Sapply\/Vapply\n\nIt is very similar to lapply, but, instead of a vector of lists, it returns a vector of some type (numeric, character, Date, etc). Sapply will \u201cdeduce\u201d the class of the output elements. In vapply, the output type has to be specified. Although it is simpler to use sapply, as there is no need to specify output type, vapply is faster (0.94 secs vs 4.04) and enables the user to control output type.\n\n my.vec <- 1:1000000 system.time(result <- vapply(my.vec,function(x) x+2,FUN.VALUE=0)) system.time(result <- sapply(my.vec,function(x) x+2)) \n\nThe FUN.VALUE argument is where the output type of vapply is specified, which is done by passing a \u201cgeneral form\u201d to which the output should fit. If the output returned by the function does not match with the specified return type, R will throw an error\n\n #These 2 alternatives are equivalent vapply(letters[1:20], function(x) paste0(x,\"_concat\"),FUN.VALUE=\"\") vapply(letters[1:20], function(x) paste0(x,\"_concat\"),FUN.VALUE=\"aaa\") #This throws an error vapply(letters[1:20], function(x) paste0(x,\"_concat\"),FUN.VALUE=0) \n\nc)Apply\n\napply() is used to apply a function over a matrix row or columnwise, which is specified in its MARGIN argument with 1 for row and 2 for columns.\n\n #Some random dataframe ex.df <- data.frame(a=seq(1,100,1),b=seq(10,1000,10),c=runif(100)) #Apply rowwise: The first element of each row plus the second, multiplied by the third aa <- apply(ex.df,1, function(x) (x[1]+x[2])*x[3]) #Apply columnwise. Extract the mean of each column bb <- apply(ex.df,2, mean) \n\nTip: You may have noticed that you can write apply-like functions with a function(\u2026) argument or without it. Usually you use \u201cfunction(\u2026) + a function\u201d when the attributes of the object you are passing to the function have to do different things (like in the rowwise apply example). However, if it is not the case, you can just pass the name of the function, like in the apply columnwise example. Other functions you could use similarly are median, max, min, quantile, among others.\n\nParallelisation\n\nIf the use of apply functions is clear, then parallelisation is just one small step beyond with snow. The functions equivalents are\n\nBase R snow\nlapply parLapply\nsapply parSapply\nvapply -\napply(rowwise) parRapply, parApply(,1)\napply(columnwise) parCapply, parApply(,2)\n\nThe only thing you really have to keep in mind is that when parallelising you have to explicitly export\/declare everything you need to perform the parallel operation to each thread. This is done mainly with the clusterExport() and clusterEvalQ() functions. This is very important to keep in mind because you might be able to run something on a one-node traditional R code and then get errors with the same execution in parallel due to the fact that these things are missing.\n\nFrom apply() rowwise to parRapply()\n\nBelow you will find a small example, very similar to the one done above with apply rowwise, illustrating the above mentioned small changes\/additions needed in order to run your code parallely\n\n #Return if the result of (x[1]+x[2])*x[3] is greater than 20 or not # The same df as before ex.df <- data.frame(a=seq(1,100,1),b=seq(10,1000,10),c=runif(100)) # Define the threshold ths <- 20 # These 2 statements in Base R are equivalent aa <- apply(ex.df,1, function(x) (x[1]+x[2])*x[3] > 20) aa <- apply(ex.df,1, function(x) (x[1]+x[2])*x[3] > ths) ### Equivalent parallel execution ### # Declare the cluster object. Here we use the default settings (SOCK) # and the number of nodes is specified by the number given clus <- makeCluster(3) # The equivalent for the first alternative would be very easy aa <- parRapply(clus,ex.df, function(x) (x[1]+x[2])*x[3] > 20) #However, if the variable \"ths\" needs to be used, a line has to be added clusterExport(clus,\"ths\") aa <- parRapply(clus,ex.df, function(x) (x[1]+x[2])*x[3] > ths) \n\nThe clusterExport() function exports an object to each node, enabling them to work parallely. The use of it, as it can be appreciated, is extremely simple: you need to pass the variable name\/s in a character vector (or a single string, as in this case)\n\nTo conclude, imagine you would need to apply a custom function to each row of your data frame. Following the same example, in Base R it would be\n\n #Declare the function custom.function <- function(a,b,c){ result <- (a+b)*c return(result)} ex.df <- data.frame(a=seq(1,100,1),b=seq(10,1000,10),c=runif(100)) #Apply the declared function aa <- apply(ex.df,1, function(x) custom.function(x[1],x[2],x[3])) \n\nTo perform the same action parallely with snow, you can declare the function inside a clusetEvalQ() statement or declare it in the base-workspace and then export it. If you use clusterEvalQ() you will not see the function in your workspace\n\n #Create cluster clus <- makeCluster(3) #Option 1. Declare the function for each node clusterEvalQ(clus, custom.function <- function(a,b,c){ result <- (a+b)*c return(result)}) #Option 2. Export it form base workspace custom.function <- function(a,b,c){ result <- (a+b)*c return(result)} clusterExport(clus,\"custom.function\") ex.df <- data.frame(a=seq(1,100,1),b=seq(10,1000,10),c=runif(100)) #Apply the declared function aa <- parRapply(clus,ex.df, function(x) custom.function(x[1],x[2],x[3])) \n\nPerformance differences\n\nOf course, the main goal of parallelisation is to reduce execution times. However, it does not make much sense to work over a small set (a small list, data frame, etc) as parallelisation requires time for distributing the task among the nodes and collecting the results from them. This opertaion consumes some time of course, which is not significant when working with large volume of data but in cases of small datasets, the overall execution time required to fulfill a task parallely might be greater than doing it in just one core.\n\nAlthough the execution time reduces considerably, it should not be assumed that it will decrease proportionally to the nodes introduced.,i.e., if the execution time in one node is 30 seconds it will not decrease to 10 seconds with 3 nodes. Probably, it will be higher.\n\nThese are the execution times for 1 and 3 nodes for the example above with a data frame of 1M and 3M rows.\n\n# of Rows 1 Node 3 Nodes\n1M 18.81 secs 10.90 secs\n3M 65.67 secs 40.26 secs\n\nFeel free to write any questions,suggestions, comments, etc.! I hope you liked it and find it useful","date":"2014-08-23 13:23:35","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.4450221359729767, \"perplexity\": 2216.6942527946817}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2014-35\/segments\/1408500826025.8\/warc\/CC-MAIN-20140820021346-00039-ip-10-180-136-8.ec2.internal.warc.gz\"}"}
| null | null |
{"url":"https:\/\/www.gamedev.net\/forums\/topic\/66042-2d-tile-based-game-under-dx8-running-just-want-advice\/","text":"#### Archived\n\nThis topic is now archived and is closed to further replies.\n\n# 2d tile-based game under DX8: running, just want advice\n\n## Recommended Posts\n\nI''ve recently begun learning C++ and DX with the aim of creating 2d games. Having never worked with a previous version of DirectX, the merger between DDraw and D3D doesn''t really bother me, except that it has resulted in a lot of overly complex tutorials on creating simple 2d graphics. I have NO budget and no prior experience, so I''ve decided upon DirectX for graphics, FMOD for sound (not tried this out yet but implementation looks simple enough), Dev-C++ 4 with the mingw compiler, and scrapping ''2d-via-3d'' tutorials and just using ID3DXSprite objects. Seeing as everything I know about the ID3DXSprite interface was picked up from the MSDN library and trial-and-error (and all over the last two days), I''d like to share a few things I''ve discovered in the hope they may be useful to other beginners, and for people to correct\/add to my knowledge. All sprites can be drawn using a single ID3DXSprite object: specify rectangle, scaling, rotation, texture etc. when calling Draw(). Uses less memory than separate object for each sprite? Call sprite object''s Begin() and End() methods OUTSIDE the main drawing loop - Draw() can be called any number of times between the two. Being able to call Begin() and End() once a frame is much faster than a Begin(), Draw(), End() sequence for every sprite to be plotted, and a serious advantage of plotting all sprites via a single sprite object. If drawing a background texture, or in similar suitable situations, don''t clear the backbuffer every frame. This can also be done deliberately for creation of certain effects. No noticeable speed increase on my machine, however I use a GeForce3; older hardware may benefit. Another thing I''m doing, not related directly to the sprite interface, is compiling all my bitmaps as resources in my main executable - this makes it possible to load textures without having an absolute file path, but how will it affect memory usage? Final question: d3dx8d.dll - is this or is this not a debugging version of one of the DX DLLs, and if so, how can I link with a non-debug version under Dev-C++?\n\n##### Share on other sites\nMy D3DXWrapper article explains the usage of the D3DXSprite interface, D3DXSprite is only a small interface that prepares the device for rendering in 2D, the only memory hog is the textures.\n\nquote:\n\nFinal question: d3dx8d.dll - is this or is this not a debugging version of one of the DX DLLs, and if so, how can I link with a non-debug version under Dev-C++?\n\nSimply specify d3dx8.lib instead of d3dx8d and select the ''Release'' profile (in DevStudio) or put the flag \/NDEBUG in your makefile.\n\nThe article can be found at:\n\nDownloads, D3DXSprite tutorial, New platform game: .-= The ZeroOne Realm =-.\n\n##### Share on other sites\nhmmm. I imagine the equivalent file for mingw would be named something like libd3dx8.a ...but I already tried searching for such a file; if it exists, it wasn''t included in the package I downloaded from the Bloodshed site. no offence, but I ONLY have free compilers available to me, instructions specific to other compilers don''t help much\nalso I see a strange lack of d3dx8.dll anywhere on my machine; perhaps there isn''t one, I just assumed that would be the name of the equivalent non-debugging DLL.\n\n##### Share on other sites\nAnarchy,\n\ni''ve tried to download the wrapper but the links don''t work !\n\n##### Share on other sites\nYes you need to link to d3dx8.lib which live in $your sdk path$\\lib\\\n\nTry to shearch in your workspace or makfile for the link with d3dx8d.lib and just remplace to d3dx8.lib\n\nWhy English rules?? C pas tr\u00e8s malin tout \u00e7a!\n\n##### Share on other sites\nHey, skweek, I would like to contact you. Do you think you could leave your e-mail address? Or if not, maybe you could ask me for one of mine that works(hehe).\n\n\u2022 ### Forum Statistics\n\n\u2022 Total Topics\n628394\n\u2022 Total Posts\n2982427\n\n\u2022 10\n\u2022 9\n\u2022 19\n\u2022 24\n\u2022 9","date":"2017-11-24 18:48:13","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.18808545172214508, \"perplexity\": 4714.267560412406}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.3, \"absolute_threshold\": 20, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2017-47\/segments\/1510934808742.58\/warc\/CC-MAIN-20171124180349-20171124200349-00746.warc.gz\"}"}
| null | null |
Crown land in New South Wales
Home - Crown land
Land Negotiation Program Review
Types of Crown land
Land management & compliance
Crown land searches
Showground stimulus funding program
Contact Crown land
Access & ownership
Land purchases
Water boundary determination
Public works access
Travelling stock
Leases, licences, easements and permits
Enclosure permits
Conveyancing search
Regional ports
Notifications & decisions
What's happening in your area
Leases and sales
Community Engagement Strategy
Plans of management
COVID-19 Rental Assistance
Financial concessions
Sapphire Coast Marine Discovery Centre
Crown road closures and disposals
Albury Environmental Lands Vesting
Border Fence Maintenance Regulation 2018
King Edward Headland Reserve & Burwood Colliery Bowling Club land claims
Sydney Football Stadium Vesting
Former Jennings Arsenic Processing Plant Remediation Project
IPART review of communication tower rents
Proposed seawall Narrabeen-Collaroy beach
Ettalong Channel dredging program
Sapphire Coast Marine Discovery Centre building, Eden
The NSW Department of Planning, Industry and Environment recently commissioned a condition assessment report of the Sapphire Coast Marine Discovery Centre, or 'wharf building', as it is locally known in Eden.
The Marine Centre were advised that the report identified a number of issues that posed an immediate risk to the health and safety of tenants and visitors to the site and were asked to undertake repairs. The Marine Centre subsequently appointed a voluntary administrator and commenced actions to vacate the property.
To secure the safety of the public and the tenants, the department has taken immediate steps to terminate the head lease (which as a consequence terminated both the commercial subleases and residential tenancies). The department is working with the tenants to vacate the building.
What has happened? Why has the building been closed?
As part of the NSW Government's investigation of possible future uses for the Crown land site, we commissioned a condition assessment of the wharf building. This condition report was provided to the Eden Marine Centre Limited, who held the head lease.
This report identified:
serious issues including structural faults, electrical faults and fire safety compliance issues that the government deems are posing an immediate risk to tenants' and public' safety
the building has reached the end of its useful life in the absence of undertaking significant repairs and capital works
the cost of repairing and upgrading the existing structure to extend its useful life was estimated to be greater than the cost of demolishing it and rebuilding it.
The voluntary administrator advised that Eden Marine Centre Limited were not in a position to undertake the required repairs and would be vacating the property. As Eden Marine Centre were not meeting the requirements of the head lease, the government has stepped in to protect the public, tenants and the site.
Given the safety concerns and the termination of the sub-leases and residential tenancies, we issued notices for the residential and commercial tenants to vacate the building.
Can I get a copy of the report?
The condition assessment report was provided in confidence to the Eden Marine Centre Limited, who were the head lessee of the building. We will not be publishing this report.
We are aware that the report has been circulated by social media and other channels.
Why didn't the government maintain the building?
The department leased the building to Eden Marine Centre Limited who were the head lessee. Under the lease, Eden Marine Centre Limited was required to maintain the Building, including meeting the cost of all repairs and maintenance.
What does this mean for tenants who had subleases with SCMDC?
On termination of the head lease, all sub-leases were also terminated. It doesn't matter when the sub-lease was due to expire.
When do the commercial tenants have to leave?
As soon as reasonably practicable.
All commercial tenants were issued notices to cease trading effective from Sunday, 11 October 2020. These tenants have been asked to remove their business and personal items and to vacate the premises on or before 30 October 2020.
Assistance is being offered to commercial tenants to support them vacating the premises.
What is happening to the residents who live in the building?
Due to the safety issues with the Building, the government is offering assistance to allow both residential tenants to immediately relocate to short-stay accommodation.
We are working with each tenant to see what other assistance may be provided.
What is the government doing to help everyone who is impacted?
The government acknowledges how significant this announcement is for tenants in the Building and for the Eden community.
We have reached out to all tenants and have held an initial briefing with them. We will continue to work with the tenants over the coming weeks.
Whilst we can't force tenants to engage with us, our focus is on:
ensuring their health and safety by ensuring they safely vacate the Building (including the removal of their business and personal items)
providing assistance to help them move on as best as possible in these circumstances.
Why is this happening now? Can't it wait until after summer or until the subleases expire?
Issues identified in the condition assessment report are deemed by the government to pose an immediate risk to tenant and public safety. Tenants have been instructed to vacate to ensure their safety and the safety of the public.
Can the building be repaired?
Significant time and additional funding would need to be invested to address the issues in the condition assessment report over and above what is needed to address the immediate health and safety issues.
While no decision has been made, it is likely that the building will be demolished to make the site safe.
What is happening to the NSW Water Police and Australian Border Force?
The Australian Border Force and NSW Water Police occupy a section of the building that was assessed to be in better condition than the rest of the building and did not pose a risk to the health and safety of the tenants or visitors.
These tenants are still expected to move out of the building in late 2020, early 2021. They have been provided a short-term license agreement to allow them to continue to occupy their premises.
Is the site contaminated?
There are underground fuel tanks that need to be safely removed if a decision was made to demolish the building. Any residual contamination will need to be assessed and remediated in line with current requirements.
How will the site be used in the future?
No decision has been made on the future use of the site.
Updates will continue to be provided to the Eden community through the NSW Port Authority's Snug Cove updates. Those interested can register to receive updates to Port Matters Newsletter.
If the building is closed, can the land around it be used?
We have already had suggestions for use of the area around the building, including requests if it can be used for food trucks and as event space through the summer holidays.
These are great suggestions, keeping the space activated and servicing visitors to the town. We are committed to working with key stakeholders, including Bega Valley Shire Council and the Eden Chamber of Commerce to explore options and find workable solutions.
No decision has been made about the future of the buildings, however the likely outcome is that it will be demolished to make the site safe.
Page link: https://www.industry.nsw.gov.au/lands/public/notifications/sapphire-coast-marine-discovery-centre
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 9,226
|
\section{Introduction}
The Goos-H\"anchen (GH) lateral shift is an optical phenomenon in which a spatially limited beam reflected at an interface near conditions of total internal reflection is displaced from the incident beam position. Although conjectured by Isaac Newton in the 18th century \cite{Newton1}, experimental evidence was only provided in 1943 by Hilda H\"anchen (a doctoral student at the time) and her thesis advisor Fritz Goos \cite{Hanchentesis,Goos-Hanchen1}.
The effect was theoretically explained by Artmann \cite{Artmann}, who noted that each plane wave component in the expansion of the incident beam undergoes a slightly different phase change after total internal reflection, so the sum of all the reflected components produces a lateral displacement of the reflected beam from the geometrical optics prediction. When the stationary phase approximation is used to calculate the sum of all the reflected components, the lateral beam shift is given by
\begin{equation}
\Delta = - \frac{d\varphi}{d\alpha},
\label{stationary}
\end{equation}
where $\alpha$ is the tangential component of the wave vector in the medium of incidence and $\varphi$ is the phase difference between the reflected and incident waves.
Incidentally, we note that Artmann's argument shows that a prerequisite for the existence of a Goos-H\"anchen shift is not the excitation of surface or evanescent waves but rather the phases of the different plane wave components in the expansion of the incident beam being shifted differently upon reflection.
The GH lateral shift and other nonspecular phenomena \cite{Nasalski2}, such as beam profile deformation, focal displacement, spatial waist modification and angular deviation, have been theoretically investigated in diverse configurations which include multilayers \cite{Tamir1} and periodic structures \cite{Zhang}.
For beams reflected from a single flat interface, the GH effect is much smaller than for beams reflected from periodically corrugated or multilayered structures, in which the shift could be of the same order of magnitude as the beam width \cite{tamirbertoni}.
Apart from the case of linear isotropic dielectric media, nonspecular phenomena have been estimated and measured for other kind of homogeneous materials, such as chiral \cite{Bonomo82}, anisotropic uniaxial \cite{Bonomo57,Bonomo73,Bonomo75} or dielectric--magnetic media with negative refraction index \cite{berman,NPVLakhtakiaSLABS,NPVLakhtakia}.
A unified linear algebra approach to study the generalized shifts for the polarization components of reflected light beams is presented in \cite{NJP-gottedennis}.
For a self-consistent description of the GH shift and related beam-shift phenomena together with an overview of their most important extensions and generalizations, the reader is referred to \cite{BliokhAiello}.
For total internal reflection from a boundary between two positive index media, the GH shift is typically the same order of magnitude as the wavelength and positive (i.e., the reflected beam is shifted to the other side of the normal from the incident beam).
On the contrary, for reflection from a metallic boundary and provided that the beam is p polarized, the GH shift may be negative (i.e., the reflected beam can be shifted towards the same side of the normal as the incident beam).
As shown in Ref. \cite{Lai}, this negative shift is due to the fact that the p polarized evanescent wave in the metal is {\em backward}, i.e., it has an energy flow opposite to the direction of the phase velocity along the interface.
For total internal reflection at the boundary between a positive index medium and a negative index medium
\cite{berman,NPVLakhtakiaSLABS,NPVLakhtakia}, the lateral shift is also negative because the evanescent wave is again backward \cite{ishimaru1}.
Although the beam shift at a single flat interface can be either positive or negative depending on the type of the surface waves (forward or backward) excited by the incoming beam, the same is not true for beam reflection from other structures. For example, it is well known (see \cite{physicalorigin} and references therein) that the excitation of a forward surface wave in a prism-waveguide coupling system can result in either a positive or a negative GH
shift. However, the erroneous belief that the excitation of a backward surface wave always results in a negative GH shift sometimes appears in the literature, particularly when multilayers with negative index materials are involved \cite{Shadrivov1,Chen,mentira}.
The purpose of this paper is twofold:
(a) to study the lateral displacement of spatially limited beams reflected from Attenuated Total Reflection (ATR) structures under conditions of resonant excitation of
backward surface plasmon polaritons (SPPs) and
(b)
to apply the phenomenological model presented in \cite{zeller_incidente}
to clearly evidence that the excitation of backward surface waves in multilayers with negative index metamaterials can lead to both negative and positive (and not exclusively negative) GH shifts,
depending on whether the thickness of the coupling layer is higher or lower than a critical value representing a real zero of the reflection coefficient.
The plan of this paper is as follows. In Section \ref{teoria} we present some technical background and two alternative methods that will be used to numerically calculate the GH lateral shift, namely the stationary phase approximation and the rigorous calculation of the field distribution of the reflected beam.
In Section \ref{zero-pole} we discuss the GH shift near conditions of resonant coupling between the incident field and backward surface waves in terms of the behavior of the complex poles and zeroes of the reflection coefficient \cite{zeller_incidente}.
We give examples that show the existence of a critical thickness of the coupling layer: above this critical value the lateral shift is positive, whereas below this critical value the lateral shift is negative.
In Section \ref{resultados} we present rigorous calculations of the transverse distribution of the reflected electric field near the resonant excitation of the backward surface plasmon polariton. We investigate the influence of the angle of incidence and the thickness of the ATR device for the optimal condition of coupling between the incident radiation and backward SPPs. Large (negative or positive) GH shifts are obtained, accompanied by a splitting of the reflected beam.
In Section \ref{conclusiones} we summarize and discuss the obtained results.
\section{GH shift calculation} \label{teoria}
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure1.eps}}
\caption{Schematic diagram of the system. It shows the lateral shift $\Delta$ of a bounded beam at an interface. The dashed lines show the boundaries of the reflected beam as predicted by geometrical optics theory.}
\label{sistema}
\end{figure}
Since the spatial periodicity associated with surface plasmon polaritons is less than the spatial periodicity which could be induced by an incident photon on the surface, surface plasmon polaritons cannot be resonantly excited by plane waves. This difficulty can be overcome by using ATR techniques, which require the introduction of a second surface, usually the base of an isosceles prism. In the Kretschmann configuration, the prism is positioned against the plasmonic medium (metal o metamaterial), while in the Otto configuration \cite{ottoNC} the prism is positioned very close to the surface of the plasmonic medium.
Figure \ref{sistema} shows an Otto--ATR structure illuminated by a spatially limited gaussian beam (width $2a$).
The beam is incident upon the base of the prism at $y=0$, the center of the beam waist is located at $x=0$ and the angle of incidence of the beam axis is $\theta_{0}$.
Medium 3 is a magnetic metamaterial with complex values of electric permittivity $\varepsilon_{3}$ and magnetic permeability $\mu_{3}$. These constitutive parameters satisfy the condition for power flow and phase velocity in opposite directions \cite{MOTL41_315AnewConditionNPV}.
Medium 1 (the prism) and medium 2 (the coupling layer, thickness $d$) are nonmagnetic ($\mu_{1}=\mu_{2}=1$) and have real and positive electric permittivities ($\varepsilon_{1}$ and $\varepsilon_{2}$ respectively).
When the values of the relative constitutive parameters $\varepsilon_{3}/\varepsilon_{2}$ and $\mu_{3}/\mu_{2}$ are properly chosen \cite{darmanyanOC}, the interface 2--3 between the coupling layer and the metamaterial can support SPPs with time-averaged Poynting vector directed opposite to the phase velocity (backward SPPs). The examples of this paper are for the case $\Re \;(\varepsilon_{3}/\varepsilon_{2}) < -1$, that corresponds to $s$-polarized backward SPPs.
When s-polarized incident radiation reaches the base of the prism with an angle $\theta_{0}$ greater than the critical angle of total reflection, the evanescent field can resonantly couple with the $s$-polarized backward SPP of the interface 2--3.
We assume that the electric field of the incident beam is given by
\begin{equation}
\textbf E_{i}= E_{i}(x,y=0)\,\hat z =\exp{[-(\frac{x}{a_{x}})^2+i\,\alpha_{0}\,x]}\,\hat z \,, \label{campoincidente1}
\end{equation}
with $\alpha_{0}=\frac{\omega}{c}\sqrt{\varepsilon_{1}\mu_{1}}\sin \theta_{0}$,
$c$ the speed of light in vacuum,
and $a_{x}=a\,\sec\,(\theta_{0})$.
An $\exp{(-i\omega t)}$ time dependence is implicit, with $\omega$ the angular frequency, $t$ the time and $i =\sqrt{-1}$.
Using a Fourier integral representation, the incident field can be written as
\begin{equation}
E_{i}(x,y=0)=\int_{-\infty}^{\infty} A(\alpha)\exp{(i\,\alpha x)}\,d\alpha,
\label{campoincidente}
\end{equation}
where
\begin{equation}
A(\alpha)=\frac{a_{x}}{2\sqrt{\pi}}\exp{[-(\alpha-\alpha_{0})^{2}\,(\frac{a_{x}}{2})^{2}]}\,,
\label{espectro}
\end{equation}
is the angular spectral distribution of the incident beam.
The electric field of the reflected beam
at the interface $y=0$ is given by
\begin{equation}
E_{r}(x,y=0)
=\int_{-\infty}^{\infty}R(\alpha)\,A(\alpha)\,\exp{(i\,\alpha\,x)}\,d\alpha \,
\label{ref}
\end{equation}
where $R(\alpha)=|R(\alpha)| \exp{i\varphi(\alpha)}$ is the complex reflection coefficient of the multilayer as a function of the spectral variable $\alpha=\frac{\omega}{c}\sqrt{\varepsilon_{1}\mu_{1}}\sin \theta$.
The beam shift can be obtained by finding the location where $|E_{r}(x,y=0)|$ is maximal.
Using the stationary-phase approximation and assuming a linear variation for $\varphi(\alpha)$ and that the beam experiences total
internal reflection, this location is given by equation (\ref{stationary}). However, if $\varphi$ is not a linear function of $\alpha$ or if $|R(\alpha)| \neq 1$ along the spectral width of the incident beam, the reflected beam may suffer severe distortions and the stationary-phase result given by equation (\ref{stationary}) is usually unsuitable to describe the lateral shift correctly \cite{Tamir1973}.
In such cases, it is preferable to define the GH shift using the normalized first moment of the electric field of the reflected beam \cite{Hugonin}
\begin{equation}
\Delta^{(1)}=\frac{\int_{-\infty}^{\infty}x|E_{r}(x,y=0)|^{2}dx}{\int_{-\infty}^{\infty}|E_{r}(x,y=0)|^{2}dx}\,.
\label{corrimiento}
\end{equation}
In this definition, the shift is expressed as an average of the $x$-position of the reflected beam on the surface of interest and no approximation is done over the amplitude and phase of the reflected plane wave components of the beam.
When the spectral width of the incident beam is small, it is possible to derive equation (\ref{stationary}) as a first order approximation of equation (\ref{corrimiento}) \cite{artmanDEmomento}.
\section{Zero-pole model for the GH shift} \label{zero-pole}
To numerically illustrate
the lateral displacement of spatially limited beams under conditions of resonant excitation of backward SPPs, we choose an Otto-ATR structure with $\varepsilon_{1}=2.25$, $\mu_{1}=1$, $\varepsilon_{2}=1$, $\mu_{2}=1$, $\varepsilon_{3}=-1.6+0.001\,i$ and $\mu_{3}=-0.7+0.001\,i$. For these constitutive parameters, the interface 2--3 between the coupling layer and the metamaterial supports $s$-polarized SPPs with time-averaged Poynting vector directed opposite to the phase velocity \cite{darmanyanOC}.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure2.eps}}
\caption{(Color online) Trajectories of the zero ($z_{0}$) and the pole ($z_{p}$) in the complex plane as functions of $d/\lambda$ for an Otto - ATR structure with $\varepsilon_{1}=2.25$, $\mu_{1}=1$, $\varepsilon_{2}=1$, $\mu_{2}=1$, $\varepsilon_{3}=-1.6+0.001\,i$ and $\mu_{3}=-0.7+0.001\,i$. For these constitutive parameters, the interface 2--3 supports $s$-polarized, backward SPPs.}
\label{ceroypolo}
\end{figure}
As shown by equation (\ref{ref}) the distortions of the reflected beam are ruled by the behavior of $R(\alpha)=|R(\alpha)| \exp{i\varphi(\alpha)}$. The exact form of this reflection coefficient is given for instance by equation (1) in \cite{zeller_incidente}.
However, to clearly evidence the facts that i) the excitation of backward surface waves can lead to both negative and positive (and not exclusively negative) GH shifts and that ii) the sign of the GH shift depends on wheater the value of the coupling layer thickness is higher or lower than the critical value characteristic of the ATR structure, first we choose to represent this quantity within the frame of a phenomenological model based on the properties of the complex poles and zeroes of the reflection coefficient.
According to this model, used previously for the case of Kretschmann-ATR structures with metamaterials \cite{zeller_incidente}, the reflection coefficient $R$ can be written as
\begin{equation}
R (z,d/\lambda)= \zeta(z,d/\lambda)\,\frac{z-z_{0}(d/\lambda)}{z-z_{p}(d/\lambda)},
\label{rmodelo}
\end{equation}
where $z$ is the analytic continuation of $\sin \theta$ to the complex plane, $z_{0}$ and $z_{p}$ denote respectively the complex zero and the complex pole of $R$, $\lambda$ is the wavelength in vacuum and $\zeta(z,d/\lambda)$ is a complex regular function near $z_{0}$ and $z_{p}$ that does not change significantly near $z_{p}$.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure3.eps}}
\caption{Phase $\varphi$ of the reflection coefficient for an Otto-ATR structure with $\varepsilon_{1}=2.25$, $\mu_{1}=1$, $\varepsilon_{2}=1$, $\mu_{2}=1$, $\varepsilon_{3}=-1.6+0.001\,i$, $\mu_{3}=-0.7+0.001\,i$ and $d/\lambda=0.7$.}
\label{d07}
\end{figure}
As explained in \cite{zeller_incidente} (see figures 2 and 3 therein), one of the main characteristics of using the zero-pole model to represent the optical response near the excitation of SPPs is that it provides a direct visualization of the behavior of the phase curves $\varphi(\alpha)$ in terms of the spectral variable $\alpha$.
This characteristic makes the zero-pole model particularly suited for the study of the lateral GH shift, since the quantity that fixes the sign of the GH shift in the stationary phase approximation equation (\ref{stationary}) is precisely the derivative of the phase.
The interested reader is referred to \cite{zeller_incidente} for further details, here we limit ourselves to mentioning the key result regarding the sign of the GH shift, namely that phase curves $\varphi(\alpha)$ have a very different behavior depending on the location in the complex plane of both the zero and the pole: when $\Im(z_{0})\,\Im(z_{p})<0$, the phase curve $\varphi(\alpha)$ is a monotonically increasing function, whereas when $\Im(z_{0})\,\Im(z_{p})>0$, the phase curve is a monotonically decreasing function, exhibiting first a maximum and then a minimum. In terms of the sign of the GH shift, negative GH shifts should be expected in the first case, whereas positive GH shifts should be expected in the second case.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure4.eps}}
\caption{
Phase $\varphi$ of the reflection coefficient for an Otto-ATR structure with $\varepsilon_{1}=2.25$, $\mu_{1}=1$, $\varepsilon_{2}=1$, $\mu_{2}=1$, $\varepsilon_{3}=-1.6+0.001\,i$, $\mu_{3}=-0.7+0.001\,i$ and $d/\lambda=0.9$.}
\label{d09}
\end{figure}
Figure \ref{ceroypolo}, where we plot the parametric trajectories of $z_{0}(d/\lambda)$ and $z_{p}(d/\lambda)$ calculated for the values of the constitutive parameters used in this example, clearly shows that both cases ($\Im(z_{0})\,\Im(z_{p})<0$, negative GH shift, or $\Im(z_{0})\,\Im(z_{p})>0$, positive GH shift) can occur near the excitation of a backward SPP.
The pole trajectory cannot cross the real axis, (if it did, infinite reflectance would result for a real angle of incidence), but the trajectory of the zero of the reflection coefficient is not limited and in this example it crosses the real axis for a critical value of $d/\lambda \approx 0.8$.
The value of $z_{0}$ ($\approx 0.74$) at this critical thickness of the coupling layer corresponds to an angle of incidence $\theta_{0}=47.8^{\circ}$ for which a plane wave is totally absorbed by the ATR structure.
We conclude that, for values of $d/\lambda$ lower than this critical value, the zero-pole model predicts that the function $\varphi(\alpha)$ is monotonically increasing (as the curve shown in figure \ref{d07} calculated for $d/\lambda=0.7$), and according to the stationary phase approximation, negative GH shifts are to be expected. On the other hand, for values of $d/\lambda$ above this critical value, the zero-pole model predicts that the function $\varphi(\alpha)$ is monotonically decreasing (as the curve shown in figure \ref{d09}, calculated for $d/\lambda=0.9$), and according to the stationary phase approximation the GH shift will be positive.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure5.eps}}
\caption{
(Color online)
Lateral shift as a function of the angle of incidence for $d/\lambda=0.7$ and different widths of the gaussian incident wave.}
\label{fig1}
\end{figure}
\section{Transverse structure of the reflected beam} \label{resultados}
To verify the prediction from the zero-pole model and the stationary phase approximation that the sign of the GH shift near the excitation of a backward surface wave depends critically on the thickness of the coupling layer, we compare the results of the previous section with those obtained from the rigorous calculation of the spatial structure of the reflected beam (equation (\ref{ref})). The integrals in equation (\ref{ref}) and (\ref{corrimiento}) have been numerically calculated.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure6.eps}}
\caption{(Color online)
Lateral shift as a function of the angle of incidence for $d/\lambda=0.9$ and different widths of the gaussian incident wave.}
\label{fig2}
\end{figure}
Figure \ref{fig1} (for $d/\lambda=0.7$, a value lower than the critical value) and \ref{fig2} (for $d/\lambda=0.9$, a value higher than the critical value) show curves of $\Delta^{(1)}$, the normalized first moment of the reflected electric field given by equation (\ref{corrimiento}), as functions of the angle of incidence $\theta$ and for different values of the beam width $a$.
In all the cases, the sign of $\Delta^{(1)}$ is in complete agreement with the
zero-pole model and the stationary phase approximation.
For both values of $d/\lambda$, the larger the width of the incident beam, the greater the peak value of $|\Delta^{(1)}|$.
Due to the shift of the SPP resonance with the coupling layer thickness, peak values occur for different angles of incidence
($\theta\approx48^{\circ}$ for $d/\lambda=0.7$ and $\theta\approx47.9^{\circ}$ for $d/\lambda=0.9$).
Note that large peak values for $|\Delta^{(1)}|$ are obtained in both cases. When $d/\lambda=0.7$, the peak values of $\Delta^{(1)}/\lambda$ are $-61.18$, $-89.19$ and $-97.02$ for $a/\lambda=50, 100$ and $200$ respectively, whereas when $d/\lambda=0.9$, the peak values of $\Delta^{(1)}/\lambda$ are $8.67$, $41.18$ and $80.53$ for $a/\lambda=50$, $100$ and $200$ respectively.
Under conditions as those considered in these examples, such as total absorptions and resonant excitation of SPPs, the transverse structure of the reflected beam can have a complicated form. Particularly, the spatial distribution in the beam can be asymmetric, so that the value of the shift defined by equation (\ref{stationary}) may not coincide with the value obtained from the first moment of the spatial structure of the reflected beam.
In these cases, and following a procedure similar to that presented in a paper by Tamir and Bertoni \cite{tamirbertoni}, it is possible to obtain a description which i) accounts for the deformation of the beam, ii) agrees quantitatively with the numerical calculations, and iii) takes advantage of the phenomenological model described by equation (\ref{rmodelo}).
The advantage of using the zero-pole model to represent the reflection coefficient is that the integrals in
equation (\ref{ref}) can be evaluated explicitly in terms of the complementary error function of complex argument \cite{tamirbertoni}. In this description, the electric field of the reflected beam at the interface $y = 0$ results
\begin{equation}
E_r (x,0)=\zeta\;E_{i}(x,0)\left[1- i\;\pi^{3/2} n_1 (z_p-z_0) \frac{a_x}{\lambda}\;\exp(\gamma^2)\;\mathrm{erfc}(-\gamma)\right]\,,
\label{E-r6}
\end{equation}
where $n_1=\sqrt{\varepsilon_{1}\mu_{1}}$ and $\mathrm{erfc}$ is the complementary error function evaluated at the complex argument $\gamma$
\begin{equation}
\gamma=-\frac{x}{a_x}+i\frac{a_x}{\lambda}\pi n_1(z-z_p) \,.
\label{gama}
\end{equation}
Thus, the reflected beam is obtained as a product of two terms: one with a Gaussian form, which is multiplied by another function so that the reflected field is no longer Gaussian.
To gain a deeper understanding of the distortions of the reflected beam, we have calculated the transverse distribution of the reflected electric field as a function of the $x$-coordinate. As shown in Figures \ref{perfiles07} and \ref{perfiles09}, the results obtained using equation (\ref{ref}) (solid lines) are in very good agreement with those obtained using equation (\ref{E-r6}) (circles).
Figure \ref{perfiles07} shows $|E_{r}(x,0)|$ (equation (\ref{ref})) for $d/\lambda=0.7$, $\theta=48.01^{\circ}$ (the angle of incidence for which the peaks in $\Delta^{(1)}$ occur, see figure \ref{fig1}) and for different values of the beam width $a$. The spatial distribution of the incident electric field (dashed line) is given as a reference.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure7a.eps}}
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure7b.eps}}
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure7c.eps}}
\caption{(Color online)
Profiles of $|E_{r}(x,0)|$ calculated with equation (\ref{ref})(solid line), $|E_{r}(x,0)|$ calculated with equation
(\ref{E-r6}) (circles) and the Gaussian incident field (dashed line) for $d/\lambda=0.7$, $\theta=48.01^{\circ}$ and values of $a/\lambda$ considered in figure \ref{fig1}.}
\label{perfiles07}
\end{figure}
In these examples we observe that the spatial distributions
are always shifted toward negative values of $x$, in total agreement with the
values of $\Delta$ and $\Delta^{(1)}$ obtained for a structure with the coupling layer thickness lower than the critical value. However, the profiles of the reflected fields are distorted with respect to the Gaussian profile of the incident beam, and the more severe distortion is obtained for the smallest beam width. The profiles exhibit a splitting of the reflected beam. As explained in \cite{Tamir}, the major peak is produced by the spectral components of the incident beam which are coupled to the excited SPP, while the minor peak is produced by the spectral components of the incident beam which are not coupled with SPPs.
\begin{figure}[htbp!]
\centering
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure8a.eps}}
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure8b.eps}}
\resizebox{0.50\textwidth}{!}
{\includegraphics{figure8c.eps}}
\caption{(Color online)
Profiles of $|E_{r}(x,0)|$ calculated with equation (\ref{ref})(solid line), $|E_{r}(x,0)|$ calculated with equation
(\ref{E-r6}) (circles) and the Gaussian incident field (dashed line) for $d/\lambda=0.9$, $\theta=47.86^{0}$ and values of $a/\lambda$ considered in figure \ref{fig2}.}
\label{perfiles09}
\end{figure}
For a structure with the coupling layer thickness higher than the critical value, the spatial distribution of reflected electric field is expected to be shifted toward positive values of $x$. The rigorous calculation of $|E_{r}(x,y=0)|$ confirms this expectation, as shown in figure \ref{perfiles09}, analogous to figure \ref{perfiles07}, but for $d/\lambda=0.9$ and
$\theta=47.86^{\circ}$ (the angle of incidence for which the larger values for $\Delta^{(1)}$ occur, see figure \ref{fig2}).
Except for the sign of the lateral shift, the features exhibited by the profiles in figure \ref{perfiles09} are completely analogous to those in figure \ref{perfiles07}. As in the previous example, a double peak structure in the reflected field profile is present and the more severe distortions occur for the smallest beam width.
\section{Conclusions} \label{conclusiones}
We have presented an exhaustive study of the GH lateral shift in Otto-ATR systems with negative index metamaterials near conditions of resonant coupling between the incident field and backward surface waves.
Although the GH beam shift at a {\em single flat interface} can be either positive or negative depending on the type of surface waves (forward or backward) excited by the incoming beam, the erroneous belief that the excitation of a backward surface wave always results in a negative GH shift frequently appears in the literature, particularly when multilayers with negative index materials are involved. To clearly evidence that the excitation of backward surface waves in multilayers with negative index metamaterials can lead to both negative and positive (and not exclusively negative) GH shifts, we have adapted to the Otto configuration the zero-pole model presented in \cite{zeller_incidente} for the Kretschmann configuration. This model predicts the existence of a critical thickness of the coupling layer: above this critical value the lateral shift is positive whereas below this critical value the lateral shift is negative. We have presented rigorous calculations of the transverse distribution of the reflected electric field near the resonant excitation of the backward surface plasmon polariton. These calculations show the existence of large (negative or positive) Goos-H\"anchen shifts accompanied by a splitting of the reflected beam and confirm the predictions of the zero-pole model.
\section*{Acknowledgment}
The authors acknowledge the financial support of Consejo Nacional de Investigaciones Cient\'{\i}ficas y T\'ecnicas, (CONICET, PIP 451)
and Universidad de Buenos Aires (project UBA 20020130100718BA).
\section*{References}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 4,418
|
A tone stack is a specialized type of audio filter incorporated into the circuit of an audio amplifier for altering the frequency response of the amplifier. The term is primarily used in reference to instrument amplifiers such as guitar amplifiers. The simplest tone stacks are derived from a bridged T network implemented with resistors in place of inductors, creating a notch filter. These will utilize 3 capacitors and 3 resistors in the form of potentiometers.
The Fender Bassman was the first amplifier to standardize the tone stack design. Dubbed the 5F6-A, this tone stack offered the performer the ability to control the amplifier's low, mid, and high frequency response independently.
References
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 2,189
|
Moanda è una città del Gabon, capoluogo del dipartimento di Lemboumbi-Leyou nella provincia di Haut-Ogooué.
È un'importante città mineraria di manganese (dove opera la "Compagnie Minière de l'Ogooué" o "COMILOG" sin dal 1957), ed è la quinta città come popolazione dell'intero Gabon.
Moanda è circondata da altopiani diversi, tra cui il Bangombe, che viene sfruttato dal "COMILOG", il Monte Boudinga e il Monte Moanda.
Il clima è equatoriale.
La città è suddivisa in 3 zone. La prima area comprende il centro commerciale, e alcuni quartieri come Ankoula, Montagne Sainte e Fumier. Le aree seconda e la terza comprendono quartieri più popolari come Lekolo, Leyima, L'Oasis, Alliance, e di altri distretti come Mukaba.
Il COMILOG esporta in media 3,5 milioni di tonnellate di manganese all'anno, rendendo il Gabon uno dei tre principali esportatori di manganese nel mondo.
Altri progetti
Collegamenti esterni
Centri abitati del Gabon
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 6,593
|
\section{Introduction}
The aim of the birational anabelian program initiated by Bogomolov~\cite{bogomolov} at the beginning of the 1990's is to recover function fields $K|k$ of dimension $>1$ over algebraically closed fields from their absolute Galois group $G_K$. This cannot be possible in the one-dimensional case since then $G_K$ is profinite free of rank $|k|$ by results of Harbater~\cite{harbater} and Pop~\cite{pop-galois-covers}, containing therefore almost no information about $K$. We show however that $K|k$ can be recovered if in addition to $G_K$ also the larger automorphism group $\Aut(\overline{K}|k) \supseteq G_K$ fixing only the base field is provided. On the way, we prove a Galois-type correspondence for transcendental field extensions and give a group-theoretic characterisation of stabiliser subgroups for $\PGL(2,k)$ acting on ${\mathbb P}^1$.
We use the following notation: Let $k$ be an algebraically closed base field. A function field $K|k$ is a finitely generated field extension. Its dimension is defined as the transcendence degree $\trdeg(K|k)$. If $F := \overline{K}$ is an algebraic closure, we write $G_{F|k} := \Aut(F|k)$ and denote the absolute Galois group of $K$ by $U_K := \Aut(F|K) \cong \Gal(K^{{\rm sep}}|K)$. The group $G_{F|k} \subseteq {\rm Map}(F,F)$ is endowed with the compact-open topology for discrete $F$, making $U_K$ an open subgroup whose induced topology agrees with the usual profinite Krull topology.
\begin{thmalpha}
\label{thm-function-field-main-theorem}
Let $k$ be an algebraically closed field and $K|k$ a 1-dimensional function field with algebraic closure $F = \overline{K}$. If $(k',K',F')$ is another such triple, then the natural map
$$\Phi: \Isom(F'|K'|k', F|K|k) \longrightarrow \Isom((G_{F|k},U_K), (G_{F'|k'},U_{K'}))$$
is a bijection.
\end{thmalpha}
The right hand side consists of isomorphisms of topological groups $G_{F|k} \isomto G_{F'|k'}$ which restrict to an isomorphism between the open subgroups $U_{K} \cong U_{K'}$. An isomorphism between field towers $F'|K'|k'$ and $F|K|k$ is by definition an isomorphism $\sigma: F' \isomto F$ restricting to isomorphisms $K' \cong K$ and $k' \cong k$. The natural map in the theorem assigns to such $\sigma$ the isomorphism $\Phi(\sigma): (G_{F|k},U_K) \isomto (G_{F'|k'},U_{K'})$ given by
$$\Phi(\sigma)(\tau) = \sigma^{-1} \circ \tau \circ \sigma.$$
It is useful to not single out one function field in $F|k$ but rather work with the totality of them and study their interplay that comes from inclusions between them, or equivalently from morphisms between their complete nonsingular models. We therefore prove the following variant which, as proved at the end of Section~\ref{sec-galois-type-correspondence}, implies Theorem~\ref{thm-function-field-main-theorem}.
\begin{thmalpha}
\label{thm-main-theorem}
Let $F|k$ be an extension of algebraically closed fields of transcendence degree 1. If $F'|k'$ is another extension of algebraically closed fields, the natural map
\begin{align*}
\Phi: \Isom^i(F'|k', F|k) &\longrightarrow \Isom(G_{F|k},G_{F'|k'})
\end{align*}
is a bijection.
\end{thmalpha}
Here, $\Isom^i$ denotes the set of isomorphisms up to Frobenius twists, i.e.\ identifying $\sigma \sim \Frob^n \circ \sigma$ for $n \in {\mathbb Z}$ if $\Char(k) = \Char(k') = p > 0$, where $\Frob \in \Isom(F|k,F|k)$ is $\Frob(x) = x^p$.
The present article is heavily based on~\cite{rovinsky}. It contains however several new aspects, most notably extending the results to function fields of positive characteristic. This required a Galois-type correspondence theorem for certain transcendental field extensions (Theorem~\ref{thm-galois}). Moreover, we include the details of how the stabiliser subgroups of $\PGL(2,k)$ acting on ${\mathbb P}^1$ are group-theoretically distinguished (Lemma~\ref{lem-stab-subgroups-in-pgl}) and present a simplified way of detecting decomposition groups (Lemma~\ref{lem-detect-dec-groups}). We also take an alternative route to reconstruct the function fields from there, namely via the reconstruction of ramification indices and principal divisors, whereas the approach of \cite{rovinsky} is based on linear systems.
\subsection*{Acknowledgements}
The author would like to thank Jakob Stix for careful proofreading and many helpful comments, Armin Holschbach for numerous discussions and Alexander Schmidt for supervising the master's thesis from which this article originated.
\section{Injectivity}
\label{sec-injectivity}
We start by quickly treating the easier part of Theorem~\ref{thm-function-field-main-theorem}, namely the question of injectivity. In fact, we show the following stronger statement.
\begin{thm}
\label{thm-injectivity}
Let $K$ be a function field of dimension $\geq 1$ over an algebraically closed field $k$, let $F$ be its algebraic closure and $U_K = \Aut(F|K)$ its absolute Galois group. If $(k',K',F')$ is another such triple, then the natural map
$$\Isom(F'|K', F|K) \longrightarrow \Isom(U_K, U_{K'})$$
is injective.
\end{thm}
Note that the function fields $K$ and $K'$ are allowed to have any dimension $\geq 1$, and on the right hand side we have isomorphisms between $U_K$ and $U_{K'}$ rather than isomorphisms of pairs $(G_{F|k},U_K)$, $(G_{F'|k'},U_{K'})$. Thus the statement applies also to situations that Bogomolov's conjecture is concerned with. Our proof uses a valuation theoretic result of F.~K.~Schmidt and is similar to that of the last lemma in \cite{pop-galois-theory-of-function-fields}.
Recall that a \defstyle{rank 1 valuation} on a field $K$ is a map $v: K \to {\mathbb R} \cup \{\infty\}$ satisfying
\begin{enumerate}[leftmargin=1.5cm,label=(\alph*),itemsep=0ex]
\item{$v(x) = \infty \; \Leftrightarrow \; x = 0;$}
\item{$v(xy) = v(x) + v(y);$}
\item{$v(x+y) \geq \min\{v(x), v(y)\};$}
\end{enumerate}
and moreover $v \not\equiv 0$ on $K^\times$. It is a \defstyle{discrete valuation} if its value group $v(K^\times)$ is a discrete subgroup of ${\mathbb R}$. Two rank 1 valuations $v$, $w$ on $K$ are \defstyle{equivalent}, written $v \sim w$, if $w = \lambda v$ for some $\lambda > 0$. The automorphism group $\Aut(K)$ acts on the set of rank 1 valuations on $K$ by the rule $\tau v = v \circ \tau^{-1}$. The \defstyle{decomposition group} of $v$ over a subfield $k \subseteq K$ is defined as
$$Z_v(K|k) = \left\{ \tau \in \Aut(K|k) \suchthat \tau v \sim v \right\}.$$
The field $K$ is \defstyle{henselian} with respect to the valuation $v$ if $v$ extends uniquely to every algebraic extension of $K$.
\begin{lem}
\label{lem-dec-groups-trivial intersection}
Let $K$ be a field, $F = \overline{K}$ its algebraic closure and $v$, $w$ two rank 1 valuations on $F$ with decomposition groups $Z_v$, $Z_w$ over $K$. If $v$ and $w$ are inequivalent, then
$$Z_v \cap Z_w = 1.$$
\end{lem}
\begin{proof}
The fixed field $F^{Z_v \cap Z_w}$ is henselian with respect to the restrictions of $v$ and $w$, hence is separably closed by a theorem of F.~K.~Schmidt (cf.~\cite{engler-prestel}, Thm.~4{.}4{.}1). Thus, $F^{Z_v \cap Z_w} = F$ and $Z_v \cap Z_w = 1$.
\end{proof}
\begin{lem}
\label{lem-autom-id-citerion}
Let $K$ be a field and $\sigma \in \Aut(K)$. If there exists a proper subfield $k \subset K$ such that $\sigma x / x \in k^\times$ for all $x \in K^\times$, then $\sigma = \id$.
\end{lem}
\begin{proof}
Put $a(x) = \sigma x / x \in k^\times$. By additivity of $\sigma$, we have
$$a(x) x + a(y) y = a(x+y) x + a(x+y) y$$
for all $x,y \in K^\times$ with $x+y \neq 0$. For $k$-linearly independent $x$ and $y$, we obtain $a(x) = a(x+y) = a(y)$. For linearly dependent $x$ and $y$ we find $a(x) = a(y)$ as well, by comparing with an element of $K^\times$ which is linearly independent from $x$ and $y$. So we have $\sigma x = ax$ for some $a \in k^\times$ which does not depend on $x$. Since $\sigma(1) = 1$, we have $a = 1$.
\end{proof}
\begin{proof}[Proof of Theorem~\ref{thm-injectivity}]
It suffices to show that if $\sigma \in \Aut(F)$ is an automorphism with $\sigma K = K$ for which $\sigma^{-1} (-)\sigma = \id$ in $\Aut(U_K)$, then $\sigma = \id$. Consider a rank 1 valuation $v$ of $F$ which is discrete on $K$. Its decomposition group $Z_v$ over $K$ is nontrivial since $v$ ramifies in $K^{\rm sep}|K$, e.g.\ by adjoining $\ell$-th roots of a uniformiser for $\ell \neq \Char(k)$. The decomposition group of $\sigma^{-1}v$ is $Z_{\sigma^{-1}v} = \sigma^{-1}Z_v \sigma = Z_v$, hence $\sigma^{-1}v = \lambda v$ for some $\lambda > 0$ by Lemma~\ref{lem-dec-groups-trivial intersection}. Since $\sigma K = K$, the valuations $v$ and $\lambda v$ have the same value group on $K$. As this value group is discrete, we must have $\lambda = 1$, thus $\sigma^{-1}v = v$. So we have $v(\sigma x / x) = 0$ for all $x \in F^\times$ and all rank 1 valuations $v$ on $F$ which are discrete on $K$. We claim that this implies $\sigma x / x \in k^\times$, so that we are done by Lemma~\ref{lem-autom-id-citerion}.
Indeed, otherwise we find a transcendence basis $T = (t_1,\ldots,t_n)$ of $F|k$ with $t_1 = \sigma x/x$ and a rank 1 valuation $v$ on $F$ extending the $t_1$-adic valuation on $k(T)$. Then $v$ is discrete on $k(T)$ and since the composite field $K(T)$ is a common finite extension of $K$ and $k(T)$, it is also discrete on $K$. But by construction $v(\sigma x/x) \neq 0$, contradiction!
\end{proof}
\section{A Galois-Type Correspondence for Transcendental Field Extensions}
\label{sec-galois-type-correspondence}
Let $k$ be a field and $F|k$ a field extension with $F$ algebraically closed. We prove a generalised Galois correspondence for such extensions and apply it in the case where $k$, too, is algebraically closed and $\trdeg(F|k) = 1$. Let $G_{F|k} = \Aut(F|k)$ be endowed with the compact-open topology for discrete $F$, so that a basis of open neighbourhoods of the identity is given by the subgroups $\Aut(F|K)$ with $K|k$ a finitely generated subextension of $F|k$. For such $K$, we denote the open subgroup $\Aut(F|K) \leq G_{F|k}$ by $U_K$. The group $G_{F|k}$ is a Hausdorff and totally disconnected topological group, since $\sigma \in U_{k(x)}$ for all $x \in F$ implies $\sigma = \id$.
In positive characteristic, one has to deal with the phenomenon that purely inseparable extensions are not visible in field automorphism groups. We therefore consider an equivalence relation on the set of subfields of $F$, which we call perfect equivalence.
\begin{defi}
\label{def-purely-inseparable-equivalence}
For a subfield $L$ in $F$, its \defstyle{perfect closure} $L^i$ in $F$ consists of all elements in $F$ that are purely inseparable over $L$. If $\Char k = p > 0$, it is given by
$$L^i = L^{p^{-\infty}} = \left\{ x \in F : x^{p^n} \in L \text{ for some } n\in {\mathbb N} \right\}.$$
We call two subfields $L_1,L_2$ of $F$ \defstyle{perfectly equivalent} if $L_1^i = L_2^i$.
\end{defi}
In characteristic $p > 0$, since $p$th roots are unique, the image of $x \in F$ under an automorphism is uniquely determined by the image of $x^{p^n}$, hence $\Aut(F|L) = \Aut(F|L^i)$ for all subfields $L$ of $F$. Automorphism groups of field extensions are therefore "blind" towards purely inseparable extensions in the sense that perfectly equivalent subfields $L_1$ and $L_2$ satisfy $\Aut(F|L_1) = \Aut(F|L_2)$. However, a subfield $L$ of $F$ can be recovered from $\Aut(F|L)$ up to perfect equivalence.
\begin{lem}
\label{lem-fixed-field}
Let $F$ be an algebraically closed field. Then for all subfields $L \subseteq F$, we have $F^{\Aut(F|L)} = L^i$.
\end{lem}
\begin{proof}
The inclusion $(\supseteq)$ is trivial. If $x \in F$, but $x \not\in L^i$, there exists some $x' \in F \setminus \{x\}$ and an isomorphism $L(x) \cong L(x')$ over $L$, sending $x$ to $x'$; take $x' = x+1$ if $x$ is transcendental over $L$, and any root $x' \neq x$ of the (not purely inseparable) minimal polynomial of $x$ over $L$ if $x$ is algebraic. Since $F|L(x)$ and $F|L(x')$ have equal transcendence degree (possibly infinite), the isomorphism $L(x) \cong L(x')$ extends to an automorphism $\sigma$ of $F$. We have $\sigma \in \Aut(F|L)$, but $\sigma(x) \neq x$, therefore $x \not\in F^{\Aut(F|L)}$.
\end{proof}
\begin{thm}[Galois-Type Correspondence]
\label{thm-galois}
Let $F|k$ be a field extension with $F$ algebraically closed and let $G_{F|k} = \Aut(F|k)$. Then the map $L \mapsto \Aut(F|L)$ is injective up to perfect equivalence and restricts to bijections as follows:
\begin{center}
\begin{tikzpicture}[commutative diagrams/every diagram]
\node (A1)
{ $\left\{ \parbox{4.5cm}{\centering subfields $L$ in $F|k$, up to perfect equivalence } \right\}$ };
\node (A2) [right = of A1]
{ $\left\{ \parbox{4.3cm}{\centering closed subgroups of $G_{F|k}$ } \right\}$ };
\node (AB1) [below = 0.15cm of A1, rotate = 90, xscale=1.8] {$\subseteq$};
\node (AB2) [below = 0.5cm of A2, rotate = 90, xscale=2] {$\subseteq$};
\node (B1) [below = 0.4cm of A1]
{ $\left\{ \parbox{4.5cm}{\centering subfields $L$ in $F|k$ with $\overline{L} = F$, up to perfect equivalence } \right\}$ };
\node (B2) [right = of B1]
{ $\left\{ \parbox{4.3cm}{\centering compact subgroups of $G_{F|k}$ } \right\}$ };
\node (BC1) [below = 0.25cm of B1, rotate = 90, xscale=1.8] {$\subseteq$};
\node (BC2) [below = 0.7cm of B2, rotate = 90, xscale=2] {$\subseteq$};
\node (C1) [below = 0.6cm of B1]
{ $\left\{ \parbox{4.5cm}{\centering finitely generated subfields $L$ in $F|k$ with $\overline{L} = F$, up to perfect equivalence } \right\}$ };
\node (C2) [right = of C1]
{ $\left\{ \parbox{4.3cm}{\centering compact open subgroups of $G_{F|k}$ } \right\}$ };
\path[commutative diagrams/.cd, every arrow, every label]
(A1) edge[commutative diagrams/hook] (A2)
(B1) edge node {$\sim$} (B2)
(C1) edge node {$\sim$} (C2);
\end{tikzpicture}
\end{center}
\end{thm}
\begin{proof}
Write $G := G_{F|k}$. For every subfield $L$ in $F|k$, the group
$$\Aut(F|L) = \bigcap_{x \in L} U_{k(x)}$$
is closed in $G$. If $F|L$ is algebraic, then the $\Aut(F|L)$-orbit of every $x \in F$ is finite and the product $\prod (X-x_i)$ with $x_i$ running through this orbit is a separable polynomial annihilating $x$ with coefficients in $F^{\Aut(F|L)} = L^i$, so that $F$ is separable and hence Galois over $L^i$. Thus $\Aut(F|L) = \Gal(F|L^i)$ is compact if $\overline{L} = F$, and compact open if in addition $L$ is finitely generated over $k$.
Suppose $H$ is a compact subgroup of $G$. Then for every $x \in F$, the orbit $Hx$ is compact and discrete, hence finite, so $x$ is a root of a separable polynomial with coefficients in $F^H$. Thus $F|F^H$ is Galois and we have $H = \Aut(F|H)$ by Galois theory. This establishes the middle bijection.
It remains to show that if $H \leq G$ is a compact open subgroup, then there exists a finitely generated subfield $K$ in $F|k$ with $H = \Aut(F|K)$. Since the sets $U_K$ with $K|k$ finitely generated form a neighbourhood basis of the identity, there exists such $K$ with $U_K \subseteq H$. Taking fixed fields, we get $F^H \subseteq K^i$. As $F^H|F^H \cap K$ is purely inseparable and $H$ is compact, we have
$$\Aut(F|F^H \cap K) = \Aut(F|F^H) = H,$$
and $F^H \cap K$ is finitely generated over $k$, being contained in the finitely generated extension $K|k$.
\end{proof}
\begin{rmks*}
\begin{enumeral} [itemsep=1ex]
\item{The association $L \mapsto \Aut(F|L)$ is compatible with the $G_{F|k}$-actions in the sense that
\begin{equation}
\label{eq-conj-corresp}
\Aut(F|\sigma L) = \sigma \Aut(F|L) \sigma^{-1}
\end{equation}
for all subextensions $L$ of $F|k$ and all $\sigma \in G_{F|k}$. Moreover, the $G_{F|k}$-action on the set of subextensions of $F|k$ is compatible with perfect equivalence since $\sigma(L)^i = \sigma(L^i)$.}
\item{
\label{rem-normaliser-quotient}
Let $L$ be a subextension of $F|k$ and $H = \Aut(F|L)$. Then the normaliser of $H$ in $G_{F|k}$ is given by
$
N_{G_{F|k}}(H) = \left\{ \sigma \in G_{F|k} \suchthat \sigma L^i = L^i \right\}
$
and the restriction homomorphism $N_{G_{F|k}}(H) \to \Aut(L^i|k)$ induces an isomorphism of topological groups
$$ N_{G_{F|k}}(H)/H \cong \Aut(L^i|k).$$}
\item{The Galois correspondence is inclusion-reversing in the sense that
$$L_1^i \subseteq L_2^i \; \Leftrightarrow \; \Aut(F|L_2) \subseteq \Aut(F|L_1)$$
for all subfields $L_1$ and $L_2$ of $F|k$.}
\item{If $L_1 \subseteq L_2$ is an algebraic extension of subfields of $F|k$, the index $(\Aut(F|L_1) : \Aut(F|L_2))$ equals the separable degree $[L_2 : L_1]_s$ since the left cosets are in canonical bijection with the $L_1$-embeddings $L_2 \hookrightarrow \overline{L_1}$.}
\item{If the transcendence degree of $F|k$ is finite, then every finitely generated subextension $K$ is contained in a finitely generated extension $L$ with $\overline{L} = F$. Otherwise, there are no subextensions $L$ that are both finitely generated over $k$ and have $\overline{L} = F$. Consequently, $G_{F|k}$ is locally compact if and only if $F|k$ has finite transcendence degree. If moreover $k$ algebraically closed, the transcendence degree of $F|k$ can be recovered: let $U_K \leq G_{F|k}$ be any compact open subgroup, corresponding to a finitely generated subfield $K|k$ with $\overline{K} = F$. Then $\trdeg(F|k) = {\rm cd}_\ell(U_K)$ for all primes $\ell \neq \Char(k)$ (\cite{serre-galois-coh}, Ch.~II, Proposition~11). \label{recover_transcendence_degree}}
\item{In general, there exist closed subgroups of $G \coloneqq G_{F|k}$ that do not arise as $\Aut(F|K)$ for some subfield $K$ of $F|k$. A subgroup $H \leq G$ arises in this way if and only if the inclusion $H \subseteq \Aut(F|F^H)$ is an equality. For a counterexample, consider the closed subgroup $G^\circ \subseteq G$ topologically generated by all compact subgroups. If $T$ is a transcendence basis of $F|k$, so is $T^n := \{t^n\}_{t \in T}$ for $n \geq 1$. Thus, the groups $\Aut(F|k(T^n))$ are all compact, hence $F^{G^\circ} = \bigcap_n k(T^n)^i = k^i$. However, if $F|k$ has finite transcendence degree $\geq 1$ with $x \in F$ transcendental over $k$, then $G^\circ$ is a proper subgroup of $G$ as $G^\circ$ is unimodular but any automorphism $\sigma \in G$ extending $k(x) \cong k(x^2)$ has Haar modulus $\Delta(\sigma) = 2$.
One can show that the subgroups of the form $\Aut(F|K) \subseteq G$ are stable under passage to closed supergroups with compact quotient. For subgroups this is false: assuming $1 \leq \trdeg(F|k) < \infty$, the Haar modulus induces a surjective homomorphism $\Delta: G/G^\circ \twoheadrightarrow {\mathbb Q}_{>0}$, yielding many finite index subgroups $H \subsetneq G$ containing $G^\circ$. They all satisfy $F^H = k^i$ and hence $\Aut(F|F^H) = G$, so they are not of the form $\Aut(F|K)$.}
\end{enumeral}
\end{rmks*}
Parts of the Galois-type correspondence appear in the literature as~\cite{jacobson}, p.\ 151, Exercise~5; \cite{shimura}, Propositions~6{.}11 and 6{.}12; \cite{shapiro-shafarevic}, §3, Lemma~1. A statement very close to ours in that it encompasses the case of positive characteristic is contained in \cite{rovinsky-motives}, Appendix~B, under the slightly stronger assumptions that $k$ be algebraically closed and that $\trdeg(F|k)$ be countable and $\geq 1$.
We now apply the Galois-type correspondence to the situation at hand where $k$ is algebraically closed and $\trdeg(F|k) = 1$. When we use the term \defstyle{function field in $F$}, we shall always mean one of dimension $1$, in other words we exclude the trivial function field $k$. The Galois-type correspondence shows that the function fields $K|k$ in $F$ are encoded in $G_{F|k}$ as the compact open subgroups $U_K$, up to perfect equivalence. By Remark~\ref{recover_transcendence_degree} above, the transcendence degree of $F|k$ is encoded as the $\ell$-cohomological dimension for $\ell \neq \Char(k)$ of any such $U_K$.
\begin{prop}
\label{prop-function-field-bijection}
In the situation of Theorem~\ref{thm-main-theorem}, let $\lambda: G_{F|k} \isomto G_{F'|k'}$ be an isomorphism. Then also $\trdeg(F'|k') = 1$ and $\lambda$ induces a bijection
\begin{center}
\begin{tikzpicture}
\node (A) {$\left\{ \parbox{4.5cm}{\centering function fields $K'|k'$ in $F'$, up to perfect equivalence } \right\}$};
\node (B) [right = of A] {$\left\{ \parbox{4.5cm}{\centering function fields $K|k$ in $F$, up to perfect equivalence } \right\}$};
\path[commutative diagrams/.cd, every arrow, every label] (A) edge node {$\sim$} (B);
\end{tikzpicture}
\end{center}
given by $K' \mapsto K$ whenever $\lambda^{-1}(U_{K'}) = U_K$. \qed
\end{prop}
We have the an explicit description of perfect equivalence for 1-dimensional function fields.
\begin{prop}[\cite{hartshorne} IV, Proposition~2.5]
Let $F|k$ be an extension of algebraically closed fields of characteristic $p > 0$ and let $K|k$ be a 1-dimensional function field in $F$. Then for each $n \in {\mathbb N}_0$, the extension $K^{p^{-n}}|K$ is the unique purely inseparable extension of $K$ in $F$ of degree $p^n$. Moreover, every function field in $F$ perfectly equivalent to $K$ is of the form $K^{p^{n}}$ for some $n \in {\mathbb Z}$. In particular, they form an infinite field tower
\label{prop-purely-inseparable-equivalence}
\[
\pushQED{\qed}
\ldots \subset K^{p^2} \subset K^p \subset K \subset K^{p^{-1}} \subset K^{p^{-2}} \subset \ldots. \qedhere
\popQED
\]
\end{prop}
Recall that for an algebraic field extension $L|K$ with relative separable closure $K \subseteq K_s \subseteq L$, the \defstyle{inseparable degree} of $L|K$ is defined as $[L : K]_i \coloneqq [L : K_s]$.
\begin{defi}
\label{def-gen-insep-degree}
Let $F|k$ be an extension of algebraically closed fields and $K_1,K_2$ one-dimensional function fields in $F$ with $K_1^i \subseteq K_2^i$ (but not necessarily $K_1 \subseteq K_2$). If $\Char(k) = p > 0$, we define the \defstyle{generalised inseparable degree} $[K_2 : K_1]_i \in p^{{\mathbb Z}}$ to be $p^{-n}[K_2 : K_1^{p^n}]_i$ where $n$ is sufficiently large such that $K_1^{p^n} \subseteq K_2$. If $\Char(k) = 0$, we set $[K_2 : K_1]_i = 1$.
\end{defi}
We note the following properties of the generalised inseparable degree:
\begin{enumeral}
\item{For $K_1^i \subseteq K_2^i \subseteq K_3^i$ one has $[K_3 : K_1]_i = [K_3 : K_2]_i [K_2:K_1]_i$.}
\item{$K_1 \subseteq K_2$ iff $[K_2: K_1]_i \geq 1$.}
\item{$K_2|K_1$ is separable iff $[K_2:K_1]_i = 1$.}
\end{enumeral}
For a function field $K|k$ in $F$, we can recover the automorphism group $\Aut(K^i|k)$ from $(G_{F|k},U_K)$ as the quotient $N_{G_{F|k}}(U_K)/U_K$ by Remark~\ref{rem-normaliser-quotient}. It is related to $\Aut(K|k)$ as follows.
\begin{lem}
\label{lem-aut-Ki}
Let $K$ be a one-dimensional function field over an algebraically closed field $k$. Then there is a canonical exact sequence
$$1 \longrightarrow \Aut(K|k) \longrightarrow \Aut(K^i|k) \longrightarrow {\mathbb Z}.$$
\end{lem}
\begin{proof}
The statement is trivial in characteristic zero, so assume $\Char(k) = p > 0$. Every automorphism of $K|k$ extends uniquely to $K^i$, whence the injective homomorphism $\Aut(K|k) \hookrightarrow \Aut(K^i|k)$. The second map is defined as $\sigma \mapsto \log_p\, [\sigma(K) : K]_i$ and the exactness is readily checked.
\end{proof}
\begin{proof}[Proof of Theorem~\ref{thm-main-theorem} $\Rightarrow$ Theorem~\ref{thm-function-field-main-theorem}]
Consider the diagram
\begin{diagram}
\Isom(F'|K'|k, F|K|k) \dar[hook] \rar{\Phi}[swap]{(A)} & \Isom((G_{F|k}, U_K), (G_{F'|k'}, U_{K'})) \dar[hook] \\
\Isom^i(F'|k', F|k) \rar{\Phi}[swap]{(B)} & \Isom(G_{F|k}, G_{F'|k'}).
\end{diagram}
The left vertical map is injective because the condition $\sigma(K') = K$ determines $\sigma$ uniquely among its Frobenius twists. Theorems~\ref{thm-function-field-main-theorem} and \ref{thm-main-theorem} assert the bijectivity of the top and bottom horizonal map, respectively. The square is cartesian: For $\sigma \in \Isom(F'|k', F|k)$ we have $\Phi(\sigma)(U_K) = U_{K'}$ if and only if $\sigma(K')^i = K^i$ (Galois correspondence), or equivalently if $\tilde{\sigma}(K') = K$ for some Frobenius twist $\tilde{\sigma} \sim \sigma$.
\end{proof}
\begin{prop}
\label{prop-injectivity}
The map $\Phi$ of Theorem~\ref{thm-main-theorem} is injective.
\end{prop}
\begin{proof}
If $\Phi(\sigma_1) = \Phi(\sigma_2)$, choose an arbitrary function field $K|k$ in $F$ and find $K'$ such that $\Phi(\sigma_i)(U_K) = U_{K'}$ (Galois correspondence). Then in the diagram above, $\sigma_1$ and $\sigma_2$ come from upstairs where $\Phi$ is injective by Theorem~\ref{thm-injectivity}.
\end{proof}
\section{Detecting the Rationality of Function Fields}
\label{sec-detect-rationality}
The aim of this section is to prove the following Proposition~\ref{prop-rational-group-autom-invariant} and to show that the characteristic $\Char(k)$ is encoded in $G_{F|k}$ (Proposition~\ref{prop-char}).
\begin{prop}
\label{prop-rational-group-autom-invariant}
Given $\lambda: G_{F|k} \isomto G_{F'|k'}$, the bijection of Proposition~\ref{prop-function-field-bijection} maps rational function fields to rational function fields.
\end{prop}
Note that the rationality of a function field depends only on its perfect equivalence class, for the function fields perfectly equivalent to $k(x)$ are given by $k(x)^{p^n} = k(x^{p^n})$ for $n \in {\mathbb Z}$, where $\Char(k) = p > 0$. Our proof of Proposition~\ref{prop-rational-group-autom-invariant} is an adaption of \cite{rovinsky}, Lemma~3.1\,(1) that takes into account the possibility of positive characteristic.
\begin{defi}
Let $G$ be a group and $n \in {\mathbb N}$. An element $x \in G$ is called \defstyle{$n$-divisible} if $y^n = x$ for some $y \in G$. It is called \defstyle{infinitely $n$-divisible} if there exists a sequence $(x_1,x_2,\ldots)$ with $x_1 = x$ and $x_i = x_{i+1}^n$ for all $i \in {\mathbb N}$. We say the group $G$ is \defstyle{$n$-divisible} if every element is so.
\end{defi}
Recall that a group is \defstyle{virtually abelian} if it contains an abelian subgroup of finite index.
\begin{lem}
\label{lem-pgl-divisible}
Let $k$ be an algebraically closed field. Then $\Aut({\mathbb P}_k^1)$ is not virtually abelian, it is $\ell$-divisible for every prime number $\ell \neq \Char(k)$ but not $p$-divisible if $\Char(k) = p > 0$.
\end{lem}
\begin{proof}
Suppose $H \leq \Aut({\mathbb P}_k^1)$ has finite index. Then $H$ contains a nontrivial translation $\phi(z) = z+b$, $b \neq 0$, and a nontrivial homothety $\psi(z) = az$, $a \neq 1$. They do not commute since
\begin{align*}
\psi \circ \phi(z) &= az + ab,\\
\phi \circ \psi(z) &= az + b,
\end{align*}
but $ab \neq b$. It is enough to show the $\ell$-divisibility of $\GL(2,k)$ as this property descends to the quotient $\Aut({\mathbb P}_k^1) = \PGL(2,k)$. Given $A \in \GL(2,k)$, we may assume it is in Jordan normal form
$$A = \left(\begin{matrix}\lambda & 0 \\ 0 & \mu \end{matrix}\right) \quad \text{or} \quad A = \left(\begin{matrix}\lambda & 1 \\ 0 & \lambda \end{matrix}\right).$$
Then a matrix $B \in \GL(2,k)$ with $B^\ell = A$ is given by
\[B = \left(\begin{matrix}\lambda^{1/\ell} & 0 \\ 0 & \mu^{1/\ell} \end{matrix}\right) \quad \text{or} \quad B = \lambda^{1/\ell}\left(\begin{matrix}1 & \lambda^{-1}/\ell \\ 0 & 1 \end{matrix}\right), \]
respectively. Suppose $\Char(k) = p > 0$ and assume for contradiction that there exists $\psi \in \Aut({\mathbb P}_k^1)$ such that $\psi^p(z) = z + 1$. If $P \in {\mathbb P}_k^1$ is a fixed point of $\psi$, it is also a fixed point of $\psi^p$, hence $P = \infty$. As a Möbius transformation with $\infty$ as its only fixed point, $\psi$ is a translation, $\psi(z) = z + a$ for some $a \in k$. But then $\psi^p(z) = z + p a = z \neq z+1$, contradiction!
\end{proof}
\begin{lem}
\label{lem-detect-rational-group}
Let $K|k$ be a 1-dimensional function field with perfect closure $K^i$ and let $\ell \neq \Char(k)$ be a prime number. Then $K$ is rational if and only if the subgroup of $\Aut(K^i|k)$ generated by the infinitely $\ell$-divisible elements is not virtually abelian.
\end{lem}
\begin{proof}
By Lemma~\ref{lem-aut-Ki}, the infinitely $\ell$-divisible elements of $\Aut(K^i|k)$ are in fact infinitely $\ell$-divisible elements in the subgroup $\Aut(K|k)$. Moreover, if $C$ is a complete nonsingular model of $K|k$, we have isomorphisms
$$\Aut(K|k) \cong \Aut(C)^{\rm op} \cong \Aut(C).$$
Thus, we define $H$ as the subgroup of $\Aut(C)$ generated by the infinitely $\ell$-divisible elements and show that $C$ is rational if and only if $H$ is not virtually abelian.
If $C \cong {\mathbb P}^1$ is rational, we have $H = \Aut(C) \cong \Aut({\mathbb P}_k^1)$ and this is not virtually abelian by Lemma~\ref{lem-pgl-divisible}. If $C$ has genus 1, it is a principal homogeneous space under the elliptic curve $E = \Jac C$ and we have $\Aut(C) \cong E(k) \rtimes \Aut(E)$. The abelian subgroup $E(k)$ is divisible, hence contained in $H$, so that $H$ is virtually abelian, $\Aut(E)$ being finite. For $C$ of higher genus, $\Aut(C)$ is finite and $H$ is virtually abelian via the trivial subgroup.
\end{proof}
\begin{proof}[Proof of Proposition~\ref{prop-rational-group-autom-invariant}]
Let $K|k$ and $K'|k'$ be function fields with $\lambda^{-1}(U_{K'}) = U_K$. Then $\lambda$ induces an isomorphism
$$N_{G_{F|k}}(U_K)/U_K \isomto N_{G_{F'|k'}}(U_{K'})/U_{K'},$$
hence $\Aut(K^i|k) \cong \Aut(K'^i|k')$. Now use Lemma~\ref{lem-detect-rational-group} with $\ell$ a prime number $\neq \Char(k), \Char(k')$ to test the rationality of $K$ (resp.~$K')$ by means of these automorphism groups.
\end{proof}
\begin{prop}
\label{prop-char}
For $F|k$ and $F'|k'$ as in Theorem~\ref{thm-main-theorem}, if $G_{F|k} \cong G_{F'|k'}$, then $\Char(k) = \Char(k')$.
\end{prop}
\begin{proof}
Choose an arbitrary rational function field $K|k$ in $F$ and $K'$ with $\lambda^{-1}(U_{K'}) = U_K$. Then $\Aut(K^i|k) \cong \Aut(K'^i|k')$ as above and passing to the subgroups generated by the infinitely $\ell$-divisible elements, $\Aut({\mathbb P}_{k}^1) \cong \Aut({\mathbb P}_{k'}^1).$
By Lemma~\ref{lem-pgl-divisible}, $\Char(k)$ is the unique prime $p$ for which $\Aut({\mathbb P}_k^1)$ is not $p$-divisible, or zero if no such prime exists, so it is the same for $k$ and $k'$.
\end{proof}
\section{Detecting Decomposition Groups}
\label{sec-dec-subgroups}
\label{sec-detect-dec-subgroups}
Our next aim is to give a group-theoretic characterisation in terms of $(G_{F|k}, U_K)$ of the decomposition groups in the pro-$\ell$ abelian Galois group $U_K^{\ab,\ell}$ (Proposition~\ref{prop-autom-preserve-dec-subgroups}). We start by recollecting some generalities. Let $k$ be an algebraically closed field, $\ell \neq \Char(k)$ a fixed prime number and $K|k$ the function field of a complete nonsingular curve $C$ over $k$. The normalised discrete valuations on $K|k$ correspond bijectively to closed points of $C$ and we write $\ord_P$ for the valuation associated with $P \in C(k)$. Denote by $K^{\ab,\ell}$ the maximal pro-$\ell$ abelian extension of $K$, obtained by adjoining the $\ell^n$th roots of all elements of $K$ for all $n \in {\mathbb N}$. The Galois group $\Gal(K^{\ab,\ell}|K)$ acts transitively on the set of valuations of $K^{\ab,\ell}$ extending $\ord_P$ and their common stabiliser is the (pro-$\ell$) \defstyle{decomposition group} of $P$, which we denote by $Z_P$. Let $Z_{\tot}(C) \subseteq \Gal(K^{\ab,\ell}|K)$ be the closed subgroup topologically generated by all $Z_P$, called the (pro-$\ell$) \defstyle{total decomposition group} of $K|k$. Its fixed field is the maximal completely split pro-$\ell$ abelian extension of $K$, or equivalently the maximal unramified pro-$\ell$ abelian extension since all residue field extensions are trivial. Thus, we have an exact sequence
\begin{equation}
\label{eq-total-dec-sequence}
1 \longrightarrow Z_{\tot}(C) \longrightarrow \Gal(K^{\ab,\ell}|K) \longrightarrow \pi_1^{\ab,\ell}(C) \longrightarrow 1
\end{equation}
where $\pi_1^{\ab,\ell}(C)$ is the pro-$\ell$ abelianisation of the algebraic fundamental group of $C$.
Denote by $\mu_{\ell^n}(k)$ the group of $\ell^n$th roots of unity in $k$ and by ${\mathbb Z}_\ell(1) = \varprojlim_n \mu_{\ell^n}(k)$ the $\ell$-adic Tate module of $k^\times$. By Kummer theory, there is a natural isomorphism of topological groups
$$\Gal(K^{\ab,\ell}|K) \cong \Hom(K^\times, {\mathbb Z}_\ell(1)).$$
\begin{defi}
Write ${\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1)$ for the group of set-theoretic functions $C(k) \to {\mathbb Z}_\ell(1)$ modulo the subgroup of constant functions. A function $f: C(k) \to {\mathbb Z}_\ell(1)$ is a \defstyle{1-point function} at $P \in C(k)$ if it is constant on $C(k)\setminus\{P\}$.
\end{defi}
Our 1-point functions are called "$\delta$-functions" in \cite{rovinsky}. Note that the 1-point functions at $P$ are closed under addition of constants, so the notion makes sense even for elements of ${\rm Map}(C, {\mathbb Z}_{\ell}(1))/{\mathbb Z}_{\ell}(1)$. A typical 1-point function at $P$ has the form $\delta_P\, \omega$ with $\omega \in {\mathbb Z}_\ell(1)$, where $\delta_P: C(k) \to \{0,1\}$ is the Kronecker delta function. We recall the following well-known description of decomposition groups.
\begin{prop}
\label{prop-dec-subgroups}
There are canonical isomorphisms
\begin{enumerate}[label=(\alph*)]
\item{$Z_P \cong {\mathbb Z}_\ell(1)$, for all closed points $P \in C$,}
\item{$Z_{\tot}(C) \cong {\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1) \cong \Hom(\Div^0(C), {\mathbb Z}_\ell(1))$,}
\end{enumerate}
under which the inclusion $Z_P \subseteq Z_{\tot}(C)$ is isomorphic to ${\mathbb Z}_\ell(1) \overset{\delta_P \cdot{\;\;}}{\longrightarrow} {\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1)$ with image the 1-point functions at $P$.
\end{prop}
\begin{proof}
Let $K_P$ be the henselisation of $K$ with respect to $\ord_P$, let $\dO_{C,P}^h$ be its valuation ring and $K_P^{\ab,\ell}$ its maximal pro-$\ell$ abelian extension, which is also the henselisation of $K^{\ab,\ell}$ with respect to a valuation extending $\ord_P$.
The inclusion $Z_P \subseteq \Gal(K^{\ab,\ell}|K)$ is isomorphic to $\Hom(K_P^\times, {\mathbb Z}_\ell(1))\hookrightarrow \Hom(K^\times, {\mathbb Z}_\ell(1))$ by functoriality of Kummer theory. We have a split exact sequence
\begin{diagram}
1 \rar & {\dO_{C,P}^{h,\times}} \rar & K_P^\times \rar[swap]{\ord_P} & {\mathbb Z} \rar \lar[bend right] & 1
\end{diagram}
and obtain another short exact sequence upon taking $\Hom(-,{\mathbb Z}_\ell(1))$. The group $\dO_{C,P}^{h,\times}$ is $\ell$-divisible by Hensel's lemma, hence $\Hom(\dO_{C,P}^{h,\times}, {\mathbb Z}_\ell(1)) = 0$ and we get the canonical isomorphism
$${\mathbb Z}_\ell(1) \cong \Hom(K_P^\times,{\mathbb Z}_\ell(1)),$$
given by $\omega \mapsto [x \mapsto \ord_P(x) \omega]$.
Consider the exact sequence
$$K^\times \overset{\divisor}{\longrightarrow} \Div^0(C) \longrightarrow \Pic^0(C) \longrightarrow 1.$$
We have $\Hom(\Pic^0(C),{\mathbb Z}_\ell(1)) = 0$ as $\Pic^0(C)$ is $\ell$-divisible, hence
$$\divisor^*: \Hom(\Div^0(C), {\mathbb Z}_\ell(1)) \ensuremath{\lhook\joinrel\relbar\joinrel\rightarrow} \Hom(K^\times, {\mathbb Z}_\ell(1)).$$
is injective. The groups are endowed with the compact-open topology and $\divisor^*$ is a topological embedding as it is continuous and the groups are compact Hausdorff. We have an isomorphism
$$\Hom(\Div^0(C),{\mathbb Z}_\ell(1)) \cong {\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1)$$
induced by $\Hom(\Div(C),{\mathbb Z}_\ell(1)) \cong {\rm Map}(C,{\mathbb Z}_\ell(1))$. The maps
$${\mathbb Z}_\ell(1) \cong \Hom(K_P^\times, {\mathbb Z}_\ell(1)) \hookrightarrow \Hom(K^\times, {\mathbb Z}_\ell(1))$$
all factor through ${\mathbb Z}_\ell(1) \overset{\delta_P \cdot{\;\;}}{\longrightarrow} {\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1)$ and (b) follows since the images generate ${\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1)$ topologically.
\end{proof}
We are interested in the functorial behaviour of decomposition groups. Let $\phi: C_2 \to C_1$ be a dominant morphism between complete nonsingular curves over $k$ and $\phi^*: K_1 \hookrightarrow K_2$ the corresponding function field extension. Embed $K_1$ and $K_2$ in a common algebraic closure $F$ and let $U_{K_i} = \Aut(F|K_i)$. The inclusion $U_{K_2} \subseteq U_{K_1}$ induces two homomorphisms in opposite directions between the pro-$\ell$ abelianisations:
\begin{itemize}
\item{the \defstyle{corestriction} $\cores: U_{K_2}^{\ab,\ell} \to U_{K_1}^{\ab,\ell}$; and}
\item{the \defstyle{restriction} $\res: U_{K_1}^{\ab,\ell} \to U_{K_2}^{\ab,\ell}$, also called the \defstyle{transfer} $\tr$.}
\end{itemize}
They come from profinite group homology via the isomorphisms $U_{K_i}^{\ab,\ell} \cong H_1(U_{K_i}, {\mathbb Z}_\ell)$. The corestriction is also the natural map from the functoriality of $(-)^{\ab,\ell}$. Their effect on decomposition groups can be expressed via the pullback and pushward map of divisors.
\begin{prop}
\label{prop-two-squares}
The following squares commute:
\begin{center}
\begin{minipage}[t]{0.44\textwidth}
\begin{tikzcd}
\Hom(\Div^0(C_2),{\mathbb Z}_\ell(1)) \rar \dar{- \circ \phi^*} & U_{K_2}^{\ab,\ell} \dar{\cores} \\
\Hom(\Div^0(C_1),{\mathbb Z}_\ell(1)) \rar & U_{K_1}^{\ab,\ell}
\end{tikzcd}
\end{minipage}
\begin{minipage}[t]{0.44\textwidth}
\begin{tikzcd}
\Hom(\Div^0(C_2),{\mathbb Z}_\ell(1)) \rar & U_{K_2}^{\ab,\ell} \\
\Hom(\Div^0(C_1),{\mathbb Z}_\ell(1)) \rar \uar{\deg_i(\phi)^{-1}\cdot(- \circ \phi_*)} \rar & U_{K_1}^{\ab,\ell} \uar{\tr}
\end{tikzcd}
\end{minipage}
\end{center}
\end{prop}
Here $\deg_i(\phi) = [K_2 : K_1]_i$ denotes the inseparable degree, which is either $1$ or a power of the characteristic of $k$ so that multiplication by $\deg_i(\phi)^{-1}$ on ${\mathbb Z}_\ell(1)$ is well-defined.
\begin{proof}
From Kummer theory and the fact that corestriction is Pontryagin dual to restriction we have two commutative squares.
\begin{center}
\begin{minipage}[t]{0.40\textwidth}
\begin{tikzcd
\Hom((K_2^i)^\times, {\mathbb Z}_\ell(1)) \rar{\sim} \dar[swap]{- \circ \res} & U_{K_2}^{\ab,\ell} \dar[swap]{\cores} \\
\Hom((K_1^i)^\times, {\mathbb Z}_\ell(1)) \rar{\sim} & U_{K_1}^{\ab,\ell}
\end{tikzcd}
\end{minipage}
\begin{minipage}[t]{0.48\textwidth}
\begin{tikzcd
\Hom((K_2^i)^\times, {\mathbb Z}_\ell(1)) \rar{\sim} & U_{K_2}^{\ab,\ell} \\
\Hom((K_1^i)^\times, {\mathbb Z}_\ell(1)) \rar{\sim} \uar{- \circ \cores} & U_{K_1}^{\ab,\ell}. \uar{\res}
\end{tikzcd}
\end{minipage}
\end{center}
The restriction $\res: (K_1^i)^\times \to (K_2^i)^\times$ is the extension of the inclusion $\phi^*: K_1^\times \hookrightarrow K_2^\times$ and the corestriction $\cores: (K_2^i)^{\times} \to (K_1^i)^{\times}$ is the group-theoretic norm
$$\cores(x_2) = \prod_{\sigma \in U_{K_1}/U_{K_2}} \sigma x_2,$$
which on $K_2^\times$ is related to the field-theoretic norm ${\rm Nm}: K_2^\times \to K_1^\times$ by $\cores(x_2) = {\rm Nm}(x_2)^{\deg_i(\phi)}$. The claim follows now from the formulae for the divisor map
\begin{align*}
\divisor(\phi^*x_1) &= \phi^*(\divisor(x_1)),\\
\divisor({\rm Nm} \,x_2) &= \phi_*(\divisor(x_2)). \qedhere
\end{align*}
\end{proof}
Given $\phi: C_2 \to C_1$ as above, we use the terms corestriction and transfer not just for the homomorphisms between the pro-$\ell$ abelianised absolute Galois groups but also for the corresponding maps between the groups $\Hom(\Div^0(C_i), {\mathbb Z}_\ell(1))$. On 1-point functions and hence on decomposition groups they act as follows. Given $P \in C_2(k)$, $Q \in C_1(k)$ and $\omega \in {\mathbb Z}_\ell(1)$, we have
\begin{align}
\cores(\delta_P \,\omega) &= e_\phi(P)\, \delta_{\phi(P)} \, \omega, \label{eq-cor-delta}\\
\tr(\delta_Q\, \omega) &= \deg_i(\phi)^{-1}\, \mathbbm{1}_{\phi^{-1}(Q)} \, \omega, \label{eq-tr-delta}
\end{align}
where $e_\phi(P)$ denotes the ramification index of $\phi$ at $P$ and $\mathbbm{1}_{\phi^{-1}(Q)}$ denotes the characteristic function of $\phi^{-1}(Q)$ on $C_2(k)$.
With these generalities at hand, we turn to the proof of the following.
\begin{prop}
\label{prop-autom-preserve-dec-subgroups}
In the situation of Theorem~\ref{thm-main-theorem}, given $\lambda: G_{F|k} \cong G_{F'|k'}$, let $K|k$ and $K'|k'$ be corresponding function fields with complete nonsingular models $C,C'$. Then the isomorphism $\lambda^{\ab,\ell}: U_K^{\ab,\ell} \isomto U_{K'}^{\ab,\ell}$ maps decomposition groups to decomposition groups, inducing a bijection
$$\lambda^*: C'(k') \isomto C(k).$$
\end{prop}
We first treat the case of rational function fields and then extend to the general case. Let $K|k$ be a rational function field in $F$ with complete nonsingular model $C$. Let $H \subseteq N_{G_{F|k}}(U_K)/U_K$ be the subgroup generated by the infinitely $\ell$-divisible elements. Recall from the proof of Lemma~\ref{lem-detect-rational-group} the isomorphism $H \cong \Aut(K|k) \cong \Aut(C)^{{\rm op}}$. For $\sigma \in H$, denote by $\sigma^*$ the corresponding automorphism of $C$ and by $\ad(\sigma)$ the automorphism of $U_K^{\ab,\ell}$ induced by conjugation. For $P \in C(k)$, denote by $\Stab_H(P)$ the stabiliser
$$\Stab_H(P) = \{ \sigma \in H : \sigma^*(P) = P \}.$$
\begin{lem}
\label{lem-dec-group-fixed-group}
An element of $U_K^{\ab,\ell}$ belongs to the decomposition subgroup $Z_P$ if and only if it is fixed by $\ad(\sigma)$ for all $\sigma \in \Stab_H(P)$.
\end{lem}
\begin{proof}
Since the homomorphism ${\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1) \to U_K^{\ab,\ell}$ from Proposition~\ref{prop-dec-subgroups} depends functorially on $F|K|k$ with respect to isomorphisms, any $\sigma \in H$ induces a commutative square
\begin{center}
\begin{tikzcd}
{\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1) \dar{- \circ \sigma^*} \rar & U_K^{\ab,\ell} \dar{\ad(\sigma)} \\
{\rm Map}(C,{\mathbb Z}_\ell(1))/{\mathbb Z}_\ell(1) \rar & U_K^{\ab,\ell}.
\end{tikzcd}
\end{center}
By the exact sequence~\ref{eq-total-dec-sequence}, the horizontal maps are injective with cokernel $\pi_1^{\ab,\ell}(C) = 1$, so they are in fact isomorphisms. We have to show that $f: C(k) \to {\mathbb Z}_\ell(1)$ is a 1-point function at $P$ if and only if $f \circ \sigma^* \equiv f$ mod constants for all $\sigma \in \Stab_H(P)$. As these $\sigma^*$ fix $P$, the congruence mod constants amounts to equality. Now $\Stab_H(P)$ acts transitively on $C(k)\setminus\{P\}$, therefore if $f \circ \sigma^* = f$ for all $\sigma \in \Stab_H(P)$, then $f$ is constant on $C(k) \setminus \{P\}$.
\end{proof}
We are led to the question of a group-theoretic characterisation of the stabiliser subgroups in $\Aut({\mathbb P}^1)$. Recall that an automorphism of ${\mathbb P}^1$ is \defstyle{parabolic} if it has a single fixed point. E.\,g., the parabolic elements with fixed point $\infty$ are the non-trivial translations $z \mapsto z+b$ with $b \in k$.
\begin{lem}
\label{lem-stab-subgroups-in-pgl}
\begin{enumerate}[leftmargin=1.5cm,label=(\alph*),itemsep=0ex]
\item{An element of $\Aut({\mathbb P}^1)$ is parabolic if and only if it is uniquely $\ell$-divisible.}
\item{A subgroup of $\Aut({\mathbb P}^1)$ is the stabiliser subgroup of a point $P \in {\mathbb P}^1(k)$ if and only if it is the normaliser of the centraliser of a parabolic element.}
\end{enumerate}
\end{lem}
\begin{proof}
The parabolic elements constitute the conjugacy class of the translation $z+1$. This is uniquely $\ell$-divisible with $z+1/\ell$ as the unique dividing element. Indeed, if $\varphi^\ell = z+1$, then $\varphi$ commutes with $z+1$, which implies that $\varphi$ is also parabolic with fixed point $\infty$, i.e.\ a translation, necessarily equal to $\varphi(z) = z +1/\ell$. The non-parabolic elements are conjugate to a homothety $az$ and are non-uniquely $\ell$-divisible as there are $\ell$ distinct roots $\sqrt[\ell]{a}$.
For (b) it suffices to show that the stabiliser of $\infty$, which consists of the affine transformations $az+b$ with $a \in k^\times$ and $b \in k$, is the normaliser of the centraliser of $z+1$. The centraliser of $z+1$ is the group of translations $z+b$. These are indeed normalised by the affine transformations and conversely, if $\psi \circ (z+1) \circ \psi^{-1}$ is a translation, we have $\psi(\infty) = \infty$ since $\psi$ maps the fixed point of $z+1$ to that of $\psi \circ (z+1) \circ \psi^{-1}$.
\end{proof}
The two preceding lemmas prove Proposition~\ref{prop-autom-preserve-dec-subgroups} in the rational case. For the general case, call a compact open subgroup $V \subseteq G_{F|k}$ \defstyle{rational} if $V = U_{k(x)}$ for some rational function field $k(x)$ in $F$. Recall that the rational compact open subgroups are group-theoretically distinguished by Proposition~\ref{prop-rational-group-autom-invariant}.
\begin{lem}
\label{lem-detect-dec-groups}
Let $K|k$ be a function field in $F$ with complete nonsingular model $C$. A subgroup $Z \subseteq U_K^{\ab,\ell}$ is the decomposition group of a point $P \in C(k)$ if and only if the following hold:
\begin{enumerate}[leftmargin=1.5cm,label=(\alph*),itemsep=0ex]
\item{There exists a rational $V \supseteq U_K$ such that $Z$ is the image of a decomposition group under the transfer map $\tr: V^{\ab,\ell} \to U_K^{\ab,\ell}$.}
\item{For every rational $V \supseteq U_K$, the image of $Z$ under the corestriction map $\cores: U_K^{\ab,\ell} \to V^{\ab,\ell}$ is contained in a decomposition group.}
\end{enumerate}
\end{lem}
\begin{proof}
Assume that $Z = Z_P$ is a decomposition group. By Riemann-Roch, there exists a morphism $\phi: C \to {\mathbb P}^1$ having a pole at $P$ and no other poles. Let $k(x) \subseteq K$ be the corresponding inclusion of function fields in $F$ and $V = U_{k(x)} \supseteq U_K$. For a 1-point function $\delta_{\infty} \,\omega$ at $\infty \in {\mathbb P}^1$, we have
$$\tr(\delta_\infty\,\omega) = \deg_i(\phi)^{-1} \mathbbm{1}_{\phi^{-1}(\infty)} \, \omega = \deg_i(\phi)^{-1} \delta_P \, \omega,$$
which shows $\tr(Z_\infty) = Z_P$. For (b), let $V \subseteq U_K$ be any rational group and $\phi: C \to {\mathbb P}^1$ a corresponding morphism. Then for $P \in C(k)$, we have
$$\cores(\delta_P\,\omega) = e_\phi(P) \delta_{\phi(P)} \,\omega,$$
hence $\cores(Z_P) = e_\phi(P) Z_{\phi(P)}$ is contained in the decomposition group $Z_{\phi(P)}$.
Suppose conversely that $Z \subseteq U_K^{\ab,\ell}$ satisfies the two conditions. The transfer calculation above shows that (a) is equivalent to the existence of a non-empty finite subset $S \subseteq C(k)$ (namely a fibre of a morphism $C \to {\mathbb P}^1$) such that the elements of $Z$ correspond to the functions $f: C(k) \to {\mathbb Z}_\ell(1)$ that are constant on $S$ and vanish on $C(k) \setminus S$. Let $\phi: C \to {\mathbb P}^1$ be a morphism separating the points in $S$ and let $V \supseteq U_K$ be the corresponding rational group. For $f = \mathbbm{1}_S\, \omega$ we have
$$
\cores(f)(Q) = (f \circ \phi^*)(Q) =
\begin{cases}
e_\phi(P)\,\omega & \text{if } \phi^{-1}(Q) \cap S = \{P\},\\
0 & \text{if } \phi^{-1}(Q) \cap S = \emptyset.
\end{cases}
$$
By (b), this should be a 1-point function at a point, hence $S$ consists just of a single point, $S = \{P\}$, and $Z = Z_P$ is the decomposition group of $P$.
\end{proof}
\iffalse
From the group-theoretic characterisation of decomposition groups and from corollary~\ref{cor-map-seen-in-dec-subgroups} we obtain the following.
\begin{corollary}
\label{cor-dec-groups}
In the situation of Theorem~\ref{thm-main-theorem}, for every function field $K$ in $F$ and every corresponding function field $K'$ in $F'$ (determined up to perfect equivalence), we have a bijection
$$\lambda^*: C' \isomto C$$
between their complete nonsingular models, given by $\lambda^*(P') = P$ whenever $(\lambda^{\ab,\ell})^{-1}(Z_{P'}) = Z_P$. Moreover, for $K_1 \subseteq K_2$ and $K_1' \subseteq K_2'$, corresponding to morphisms $\phi: C_2 \to C_1$ and $\phi': C_2' \to C_1'$, the following square commutes:
\begin{diagram}
C_2' \dar{\phi'} \rar{\lambda^*}[below]{\sim} & C_2 \dar{\phi} \\
C_1' \rar{\lambda^*}[below]{\sim} & C_1.
\end{diagram}
\end{corollary}
\fi
\section{Proof of Main Theorem}
\label{sec-main-result}
\begin{lem}
\label{lem-pullback}
In the situation of Theorem~\ref{thm-main-theorem}, given $\lambda: G_{F|k} \isomto G_{F'|k'}$, let $K_1 \subseteq K_2$ and $K_1' \subseteq K_2'$ be extensions of function fields with $\lambda^{-1}(U_{K_i'}) = U_{K_i}$, corresponding to morphisms $\phi: C_2 \to C_1$ and $\phi': C_2' \to C_1'$. Let $\lambda^*: \Div(C_i') \to \Div(C_i)$ be the linear extension of the bijection from Proposition~\ref{prop-autom-preserve-dec-subgroups}. Of the two squares
\begin{center}
\begin{minipage}[t]{0.40\textwidth}
\begin{diagram}
\Div(C_2') \rar{\lambda^*}[below]{\sim} \dar{\phi'_*} & \Div(C_2) \dar{\phi_*} \\
\Div(C_1') \rar{\lambda^*}[below]{\sim} & \Div(C_1),
\end{diagram}
\end{minipage}
\begin{minipage}[t]{0.40\textwidth}
\begin{diagram}
\Div(C_2') \rar{\lambda^*}[below]{\sim} & \Div(C_2) \\
\Div(C_1') \rar{\lambda^*}[below]{\sim} \uar{\phi'^*} & \Div(C_1) \uar{\phi^*},
\end{diagram}
\end{minipage}
\end{center}
the first always commutes and the second commutes if $\deg_i(\phi) = \deg_i(\phi')$.
\end{lem}
\begin{proof}
By equations~\eqref{eq-cor-delta} and \eqref{eq-tr-delta}, the corestriction and transfer maps restrict for $Q \in C_1$ as follows
\begin{diagram}
\displaystyle\bigoplus_{P \in \phi^{-1}(Q)} Z_P \rar[hook] \dar[xshift=-.3em,swap]{\cores} & U_{K_2}^{\ab,\ell} \dar[xshift=-.3em, swap]{\cores} \\
Z_Q \rar[hook] \uar[xshift=.3em,swap]{\tr} & U_{K_1}^{\ab,\ell}. \uar[xshift=.3em,swap]{\tr}
\end{diagram}
For $P \in \phi^{-1}(Q)$, we have $\cores(Z_P) = e_\phi(P)Z_Q \subseteq Z_Q$ of finite index. This determines $Q = \phi(P)$ uniquely since decomposition groups of different points have trivial intersection, hence the commutativity of the first square. We have
$$(\tr\circ\cores)(\delta_P\,\omega) = \frac{e_\phi(P)}{\deg_i(\phi)} \mathbbm{1}_{\phi^{-1}(Q)}\,\omega = \frac{e_\phi(P)}{\deg_i(\phi)} \sum_{P' \in \phi^{-1}(Q)}\delta_{P'}\,\omega,$$
thus the endomorphism of $Z_P$ induced by $\tr \circ \cores$ is multiplication by $e_\phi(P)/\deg_i(\phi)$. Therefore, assuming equal inseparable degrees of $\phi$ and $\phi'$, the ramification indices match and the second square commutes.
\end{proof}
\begin{rmk}
The $\ell$-part of the ramification index $e_\phi(P)$ can also be reconstructed as the index $(Z_Q : \cores(Z_P))$. If one restricts oneself to fields of characteristic zero, $\ell$ can be an arbitrary prime and this would give an alternative reconstruction of ramification indices.
\end{rmk}
The \defstyle{projectivisation} of a $k$-vector space $V$ is the set ${\mathbb P}_k V = (V \setminus \{0\})/k^\times,$
together with the projective lines as distinguished subsets. A map ${\mathbb P}_{k'} V' \hookrightarrow {\mathbb P}_k V$ is a \defstyle{projective embedding} if it is injective and maps lines onto lines. It is a \defstyle{collineation} if it admits an inverse projective embedding. Given a function field $K|k$ with complete nonsingular model $C$, we view $K^\times/k^\times = {\mathbb P}_k K$ as a projective space over $k$, and with it the group $\PDiv(C) \cong K^\times/k^\times$ of principal divisors. The strategy is then to recover the projective structure on $\PDiv(C)$ and reconstruct the function field $K|k$ by an application of the fundamental theorem of projective geometry. This idea appears already in~\cite{bogomolov} and later in~\cite{bogomolov-tschinkel-reconstruction} (Theorem~3.6) and~\cite{pop-recovering-function-fields}. We shall use the following slightly more general form for projective embeddings rather than collineations.
\begin{thm}[Fundamental Theorem of Projective Geometry, \cite{artin-ga}, Thm~II.2.26]
Let $k$ and $k'$ be arbitrary fields, let $V$ and $V'$ be vector spaces of dimension $\geq 3$ over $k$ and $k'$, respectively, and let $\varphi: {\mathbb P}_{k'}V' \ensuremath{\lhook\joinrel\relbar\joinrel\rightarrow} {\mathbb P}_k V$ be a projective embedding.
Then there exist a field isomorphism $\tau: k' \isomto k$ and a $\tau$-semilinear injection $\Phi: V' \hookrightarrow V$ lifting $\varphi$, i.e.\
$$\varphi(v' \bmod k'^\times) = \Phi(v') \bmod k^\times \quad \text{for } v' \in V'\setminus\{0\}.$$
If $(\tilde \tau, \tilde \Phi)$ is another such pair, then $\tilde \tau = \tau$ and $\tilde \Phi = m_\alpha \circ \Phi$ for a unique $\alpha \in k^\times$, where $m_\alpha \in \Aut_{k}(V)$ is multiplication by $\alpha$. \qed
\end{thm}
\begin{lem}
\label{lem-collineation-from-field-isom}
Let $k$ and $k'$ be arbitrary fields, $K|k$ and $K'|k'$ two field extensions of degree $\geq 3$ and suppose that
$$\varphi: K'^\times/k'^\times \ensuremath{\lhook\joinrel\relbar\joinrel\rightarrow} K^\times/k^\times$$
is simultaneously a projective embedding and a homomorphism of abelian groups. Then there exists a unique homomorphism of field extensions
$$\Phi: K'|k' \ensuremath{\lhook\joinrel\relbar\joinrel\rightarrow} K|k$$
lifting $\varphi$ and restricting to an isomorphism $k' \cong k$.
\end{lem}
\begin{proof}
Let $(\tau,\Phi)$ be the pair from the fundamental theorem of projective geometry, which is uniquely determined by requiring $\Phi(1) = 1$. We have to show that $\Phi$ respects multiplication. Fix $x' \in K'^\times$ and let $m_{x'}: K' \to K'$ and $m_{\Phi(x')}: K \to K$ be multiplication by $x'$ and $\Phi(x')$, respectively. We need to show that the two maps
$$\Phi \circ m_{x'} \;\text{ and }\: m_{\Phi(x')} \circ \Phi: K' \to K$$
are equal. They are both $\tau$-semilinear and by multiplicativity of $\varphi$ induce the same projective embedding $K'^\times/k'^\times \to K^\times/k^\times$. By the uniqueness statement in the fundamental theorem of projective geometry, there exists a unique $\alpha \in k^\times$ such that $\Phi \circ m_{x'} = m_\alpha \circ m_{\Phi(x')} \circ \Phi$. The normalisation $\Phi(1) = 1$ forces $\alpha = 1$, so the two maps are equal.
\end{proof}
\begin{prop}
\label{prop-isom-and-collineation}
In the situation of Theorem~\ref{thm-main-theorem}, given $\lambda: G_{F|k} \isomto G_{F'|k'}$, let $K|k$ and $K'|k'$ be corresponding function fields. Then $\lambda$ induces an isomorphism
$$\lambda^*: K'^\times/k'^\times \isomto K^\times/k^\times$$
of abelian groups which is simultaneously a collineation of projective spaces. If $K_1 \subseteq K_2$ and $K_1' \subseteq K_2'$ have the same inseparable degree, the following square commutes:
\begin{diagram}
K_1'^\times/k'^\times \dar[hook] \rar{\lambda^*}[swap]{\sim} & K_1^\times/k^\times \dar[hook] \\
K_2'^\times/k'^\times \rar{\lambda^*}[swap]{\sim} & K_2^\times/k^\times.
\end{diagram}
\end{prop}
\begin{proof}
A divisor $D \in \Div(C)$ is principal if and only if there exist a morphism $\phi: C \to {\mathbb P}^1$ and two points $Q_0,Q_1 \in {\mathbb P}^1(k)$ such that $D = \phi^*(Q_0) - \phi^*(Q_1)$, thus by Lemma~\ref{lem-pullback} the isomorphism $\lambda^*: \Div(C') \cong \Div(C)$ restricts to the subgroups of principal divisors and induces $\lambda^*$ as claimed. The lines in $\PDiv(C)$ are given by
$$D + \left\{ \phi^*(Q) - \phi^*(Q_0) \suchthat Q \in {\mathbb P}^1(k) \right\}$$
for a principal divisor $D \in \PDiv(C)$ , a morphism $\phi: C \to {\mathbb P}^1$ and a point $Q_0 \in {\mathbb P}^1(k)$. Indeed, a line in $\PDiv(C)$ corresponds to a 2-dimensional $k$-subspace $\langle f, g\rangle \subseteq K$, and if $\phi: C \to {\mathbb P}^1$ is the morphism given by $f/g$, the line is
\begin{align*}
\left\{ \divisor(af+bg) \suchthat (a:b) \in {\mathbb P}^1 \right\} &= \divisor(g) + \left\{ \divisor(af/g+b) \suchthat (a:b) \in {\mathbb P}^1 \right\} \\
&= \divisor(g) + \left\{ \phi^*(-b:a) - \phi^*(\infty) \suchthat (a : b) \in {\mathbb P}^1 \right\}.
\end{align*}
Thus, again by Lemma~\ref{lem-pullback}, $\lambda^*$ is a collineation. The commutativity of the square follows from the same lemma.
\end{proof}
Hence in the situation of Theorem~\ref{thm-main-theorem}, given $\lambda: G_{F|k} \isomto G_{F'|k'}$, we have for every pair of corresponding function fields $K|k$ and $K'|k'$ an isomorphism
\begin{align}
\sigma_{K,K'}: K'|k' \isomto K|k. \label{eq-sigma-isom}
\end{align}
\begin{lem}
\label{lem-choose-K'}
Given $\lambda: G_{F|k} \isomto G_{F'|k'}$, there exists a map $K \mapsto K'$ from the set of function fields in $F$ to the set of function fields in $F'$ such that $\lambda^{-1}(U_{K'}) = U_K$ for all $K$, and whenever $K_1 \subseteq K_2$, then $K_1' \subseteq K_2'$ of the same inseparable degree.
\end{lem}
\begin{proof}
Assume $\Char(k) = p > 0$. Fix a function field $K_0$ in $F$ and choose any corresponding $K_0'$. For every $K \supseteq K_0$, choose $K'$ in its perfect equivalence class such that $[K' : K_0']_i = [K : K_0]_i$. Then for an arbitrary function field $K$ in $F$, choose $K'$ in its perfect equivalence class such that $[(K K_0)' : K']_i = [K K_0 : K]_i$. One verifies the assertions by looking at the field diagram
\begin{center}
\begin{tikzcd}[row sep = tiny]
& & (K_0 K_2)' \arrow[dash]{dd} \\
& (K_0 K_1)' \urar[dashed,-] \arrow[dash]{dd} & \\
K_0' \urar[dash] \arrow[uurr, bend left, -] & & K_2'. \\
& K_1' \urar[dashed,-] &
\end{tikzcd}
\end{center}
The fields are chosen for the solid lines to have inseparable degrees matching those of the corresponding extensions in $F$. It follows that the same holds for the dashed lines.
\end{proof}
Choosing a map $K \mapsto K'$ according to the lemma, the isomorphisms $\sigma_{K,K'}$ from~(\ref{eq-sigma-isom}) are compatible with each other, hence define $\sigma: F'|k' \isomto F|k$ that satisfies $\sigma(K') = K$ for all function fields $K$ in $F$. It remains to show that the induced isomorphism $\Phi(\sigma): G_{F|k} \isomto G_{F'|k'}$ coincides with the given $\lambda$.
\begin{lem}
\label{lem-autom-preserv-function-fields}
Let $F|k$ be an extension of algebraically closed fields with $\trdeg(F|k) = 1$.
\begin{enumerate}[label=(\alph*)]
\item{Suppose $\sigma \in \Aut(F)$ satisfies $\sigma k = k$ and $\sigma K = K$ for all function fields $K$ in $F$. Then $\sigma = \id$.}
\item{Assume $\Char(k) = p > 0$ and suppose $\sigma \in \Aut(F)$ satisfies $\sigma k = k$ and $\sigma K^i = K^i$ for all function fields $K|k$ in $F$. Then $\sigma$ is an integral power of the Frobenius automorphism.}
\item{Let $\lambda \in \Aut(G_{F|k})$ be a topological automorphism such that $\lambda(U) = U$ for all compact open subgroups $U$ in $G_{F|k}$. Then $\lambda = \id$.}
\end{enumerate}
\end{lem}
\begin{proof}
\begin{enumerate}[label=(\alph*)]
\item{
Let $x \in F\setminus k$, use it as a coordinate on ${\mathbb P}^1$. For every function field extension $k(x) \subseteq K$, corresponding to a morphism $\phi: C \to {\mathbb P}^1$, the automorphism $\sigma$ permutes the normalised discrete valuations of $k(x)|k$ that ramify in $K$, i.e.\ the branch points of $\phi$. But every two-element subset of ${\mathbb P}^1(k)$ is the branch locus of some $\phi$, so $\sigma$ must act trivially on the set of normalised discrete valuations of $k(x)|k$. Therefore we have $\sigma y / y \in k^\times$ for all $y \in k(x)^\times$ and we conclude $\sigma = \id$ on $k(x)$ by Lemma~\ref{lem-autom-id-citerion}. Since $x$ was arbitrary, $\sigma = \id$ on $F$.
}
\item{
For each function field $K$, there exists a unique $n \in {\mathbb Z}$ such that $\sigma K = K^{p^{n}}$. We claim that $n$ is independent of $K$. Indeed, if one function field is contained in another, $K_1 \subseteq K_2$, we find $n_1 = n_2$ by looking at generalised inseparable degrees of $K_1 \subseteq K_2$ and $\sigma K_1 \subseteq \sigma K_2$. The general case follows since any two function fields are contained in a common finite extension. Now $(\sigma \circ \Frob^{-n})(K) = K$ for all function fields $K$, thus $\sigma = \Frob^{n}$ by (a).
}
\item{
Let $\sigma \in G_{F|k}$. For all compact open subgroups $U$ of $G_{F|k}$ we have
$$\sigma U \sigma^{-1} = \lambda(\sigma U \sigma^{-1}) = \lambda(\sigma) U \lambda(\sigma)^{-1},$$
thus $\sigma^{-1}\lambda(\sigma)$ is contained in the normaliser of $U$. This implies $\sigma^{-1}\lambda(\sigma)(K^i) = K^i$ for all function fields $K|k$ in $F$, so $\sigma^{-1}\lambda(\sigma)$ is the identity in characteristic $0$ and a power of the Frobenius in positive characteristic by (a) and (b), respectively. But it fixes $k$ elementwise, hence $\sigma^{-1}\lambda(\sigma) = 1$.
\qedhere
}
\end{enumerate}
\end{proof}
For the isomorphism $\sigma: F'|k' \isomto F|k$ constructed from $\lambda: G_{F|k} \isomto G_{F'|k'}$, we have
$$\Phi(\sigma)(U_K) = \sigma^{-1} U_K \sigma = U_{\sigma^{-1}K} = U_{K'} = \lambda(U_K)$$
for all function fields $K$ in $F$. Thus $\Phi(\sigma)^{-1} \circ \lambda$ satisfies the hypotheses of Lemma~\ref{lem-autom-preserv-function-fields}~(c) and we conclude $\lambda = \Phi(\sigma)$, finishing the proof of Theorem~\ref{thm-main-theorem}.
\bibliographystyle{amsalpha}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 169
|
\section{Introduction}
\label{sec:intro}
The collapsing inner core of a massive star in a core collapse supernova (CCSN) releases $>{\rm few} \times 10^{53} {~\rm erg}$ in gravitational energy. The rest of the star explodes and carries a fraction of $\simeq 0.0001-0.1$ of this energy (e.g., \citealt{Hegeretal2003, Janka2012}). Neutrinos carry the rest of the energy, while typically only a small fraction of the released gravitational energy ends in radiation. The very inner part of the core forms a nuclear-density compact object at the center, the proto-neutron star (NS). The formation of the pro-NS stops the collapse of the very inner part of the core and sends a shock wave outward. Because of the ram pressure of the collapsing core material the shock stalls at a radius of about $R_{\rm s} \simeq 100 {~\rm km}$. This is the stalled shock. The mass that the proto-NS accretes flows through this stalled shock.
Recent theoretical studies consider two mechanisms to channel a small fraction of the gravitational energy to the exploding outer core and envelope, in case an envelope exists. According to the delayed neutrino mechanism \citep{BetheWilson1985} neutrinos heat the material in the post-shock zone behind the stalled shock, the gain region, and after some delay the heating revives the stalled shock in a non-spherical manner (e.g., \citealt{Nordhausetal2012, CouchOtt2013, Bruennetal2016, Jankaetal2016R, OConnorCouch2018, Mulleretal2019Jittering, BurrowsVartanyan2021, Fujibayashietal2021, Bocciolietal2022, Nakamuraetal2022}).
According to the jittering jets explosion mechanism \citep{Soker2010} the proto-NS, or later the newly born NS or a black hole (BH) if it is formed, launches jets that deposit sufficient energy to the collapsing-core material outside the stalled shock and explode the star (e.g., \citealt{PapishSoker2011, PapishSoker2014Planar, GilkisSoker2015, Quataertetal2019, Soker2020RAA, AntoniQuataert2022, ShishkinSoker2022, Soker2022a}).
During the explosion there might be several to few tens of jet-launching episodes. Some typical physical values are as follows \citep{PapishSoker2014a}. The jets carry a total energy of $\simeq 10^{51} {~\rm erg}$ with a typical velocity of $\simeq 10^5 {~\rm km} {~\rm s}^{-1}$ and total explosion time of $\simeq 1 \sec$. Each jet-launching episode lasts for $\simeq 0.01-0.1 \sec$ and carries a mass of $\approx 10^{-3} M_\odot$. The accretion disk that launches the jets is ten times as massive, so each accretion disk mass at a jet-launching episode is $\approx 10^{-2} M_\odot$. In total, during the entire explosion process a mass of $\approx 0.1 M_\odot$ is accreted through an intermittent accretion disk.
The source of the stochastic angular momentum of the mass that is accreted through the intermittent accretion disk is the stochastic convection motion in the pre-collapse core. The convective cells in the silicon or oxygen burning zones serve as perturbation seeds that instabilities above the newly born NS further amplify to supply stochastic angular momentum with large enough amplitudes to form intermittent accretion disks (e.g., \citealt{ShishkinSoker2022}). An important property of the jittering jets explosion mechanism is that the jets of early episodes do not disturb these perturbations for later jet-launching episodes. The jets do influence somewhat the directions of the later jittering jets \citep{PapishSoker2014Planar}. The source of magnetic fields that are required to launch jets is also in the pre-collapse core, from the convective zones as well as the radiative zone above the iron core \citep{Perersetal2019}. The amplification of the seed angular momentum perturbations, the role of the magnetic field in influencing the stochastic angular momentum (by angular momentum transfer), and the interaction of neutrino-driven convection plumes with the accretion disks are open questions to be determined by future studies of the jittering jets explosion mechanism.
The jittering jets explosion mechanism differs from many studies of jet-driven explosions that assume rapidly rotating pre-collapse cores (e.g., \citealt{Khokhlovetal1999, Aloyetal2000, MacFadyenetal2001, Maedaetal2012, LopezCamaraetal2013, BrombergTchekhovskoy2016, Nishimuraetal2017, WangWangDai2019RAA, Grimmettetal2021, Perleyetal2021}) in the following properties. (1) The jittering jets operate in a negative feedback mechanism (see review by \citealt{Soker2016Rev}). This explains why typical explosion energies are several times the binding energy of the ejected mass. (2) According to the jittering jets explosion mechanism most (or even all) CCSNe are driven by jets, even CCSNe of non-rotating cores. In cases of slowly rotating (or non-rotating) pre-collapse cores, the convective motion in the pre-collapse core (e.g., \citealt{GilkisSoker2014, GilkisSoker2016, ShishkinSoker2021}) or envelope (e.g., \citealt{Quataertetal2019}) allows the formation of intermittent/stochastic accretion disks or belts that launch jittering jets. Namely, the accretion process through intermittent accretion disks/belts leads to jet-launching episodes where the direction of the symmetry axis of the two opposite jets changes from one episode to the next.
One result of these differences is that there are no failed CCSNe in the jittering jets explosion mechanism framework (e.g., \citealt{Gilkisetal2016Super, Soker2017RAA, AntoniQuataert2022}). This claim has received strong support with the new observational finding by \cite{ByrneFraser2022}. According to the jittering jets explosion mechanism all massive stars explode, even when the explosion forms a BH.
In the jittering jets explosion mechanism the explosion leads to BH formation in the case of a rapidly rotating pre-collapse core. The jets that the newly born NS launches maintain a fixed axis along the large angular momentum axis, and therefore the jets eject only a small fraction of the stellar mass along the polar directions. The rest of the stellar mass collapses to form a BH. The jets lead to a very energetic CCSN, i.e., some of the most energetic CCSN explosions are those that form BHs (e.g., \citealt{Gilkisetal2016Super, Soker2017RAA}). On the other hand, according to the delayed neutrino mechanism it is possible that a massive star does not explode, but rather most of the mass collapses to form a BH accompanied by a faint transient event (e.g., \citealt{Nadezhin1980, LovegroveWoosley2013}).
There is no need to form a thin accretion disk that is supported against gravity solely by the centrifugal force to launch jets, although this is the case in many astrophysical objects. Consider a case where the specific angular momentum is smaller than the critical value to support a Keplerian motion around the newly born NS (proto-NS), but the accretion flow does form low-density funnels along the two opposite polar directions (along the angular momentum axis). \cite{SchreierSoker2016} argued that this accretion belt geometry allows the launching of jets along the polar funnels. Critical to the launching of jets from accretion belts in CCSNe is the presence of very strong magnetic fields (e.g., \citealt{SchreierSoker2016, Soker2018arXiv, Soker2019RAA, Soker2020RAA}).
This claim, that the compact object at the center of a CCSN can launch jets even when the core does not rotate, but only if there are strong magnetic fields and funnels along the polar directions, has received indirect support from recent three-dimensional magneto-hydrodynamical simulations of a BH moving through a uniform magnetized medium and accreting mass. In these simulations, \cite{Kaazetal2022} find that a BH can launch strong jets despite that the initial angular momentum of the accreted gas is zero, as long as the magnetic fields are sufficiently strong. The ordered magnetic fields that they use form the funnels along the symmetry axis.
In some earlier papers (e.g., \citealt{Soker2019arXiv}) I mentioned the possibility that there is a mutual influence between stochastic angular momentum accretion and neutrino heating, and that the combined operation of jets and neutrino heating power CCSNe. In the present paper I study in more detail the way by which neutrino heating in the gain region can boost the outflow that the jets induce. I recall that each jet launching episode is expected to last for $<0.1 {~\rm s}$. Therefore, although the jets of the first pair of jets break out from the stalled shock, there is no time to set an explosion via neutrino heating alone because the delayed neutrino mechanism requires a much longer time to set an explosion (e.g., \citealt{Bolligetal2021}). For that, I expect that there will be at least several jet-launching episodes before the end of the explosion process.
I present the relevant parameters of the gain region and of the jets in section \ref{sec:RelevantParameters}, and the processes by which the neutrino heating boost the outflow in section \ref{sec:Boosting}. In section \ref{sec:Assumptions} I discuss some of the assumptions that I make in this study.
I summarize in section \ref{sec:Summary}.
\section{Relevant parameters}
\label{sec:RelevantParameters}
\subsection{The ambient medium}
\label{subsec:Ambient}
In scaling the quantities for the ambient medium, namely, the medium into which the jets expand, I make use of the detailed study by \cite{Janka2001}. I chose specific profiles to demonstrate the boosting processes, but the results are not sensitive to these specific profiles.
I consider the time in the collapse when the stalled shock is more or less static at $R_{\rm s}=100 {~\rm km}$ and the gain radius is at $R_{\rm g}=50 {~\rm km}$. The gain radius is defined to be such that in the zone $R_{\rm g} < r < R_{\rm s}$ neutrino heating overcomes neutrino cooling. This zone is made of free nucleons and alpha particles.
For the density profile I take (equation 63 scaled with figure 3 from \citealt{Janka2001})
\begin{equation}
\rho_{\rm g} \simeq 2 \times 10^9
\left( \frac{r}{R_{\rm s}} \right)^{-3}
{~\rm g} {~\rm cm}^{-3} ; \quad 50 {~\rm km} < r< 100 {~\rm km}.
\label{eq:RhoG}
\end{equation}
Note that I consider a spherical and static stalled shock front and ignore here the standing accretion shock instability (SASI), which I return to in section \ref{subsec:SASI}.
For an adiabatic index of $\gamma=4/3$ the pre-shock gas density is $\rho_{\rm p}=\rho_{\rm g} (R_{\rm s})/7$. As photodissociation of nuclei increases this density ratio (e.g., \citealt{Thompson2000}), I take this ratio to be 8. For a mass of $M_{\rm s} = 1.4 M_\odot$ inside the stalled shock and a free fall velocity of the pre-shock gas, $v_{\rm ff,s}=6.1\times 10^4 {~\rm km} {~\rm s}^{-1}$, the accretion rate of the collapsing core at the shock is $\dot M_{\rm c} \simeq 1 M_\odot {~\rm s}^{-1}$. I do note that the collapsing velocity is somewhat smaller than the free fall velocity (e.g., \citealt{Janka2001}), but like \cite{Thompson2000} I take it to be the free fall velocity. The post-shock pressure is about equal to the pre-shock ram pressure, and for the pressure profile in the gain region I take (equation 63 from \citealt{Janka2001})
\begin{equation}
P_{\rm g} \simeq 10^{28}
\left( \frac{r}{R_{\rm s}} \right)^{-4}
{~\rm erg} {~\rm cm}^{-3} ; \quad 50 {~\rm km} < r< 100 {~\rm km}.
\label{eq:PressG}
\end{equation}
Photons and electron-positron pairs dominate the pressure, and so the temperature is
\begin{equation}
k T_{\rm g} \simeq 3
\left( \frac{r}{R_{\rm s}} \right)^{-1}
{~\rm MeV} ; \quad 50 {~\rm km} < r< 100 {~\rm km}.
\label{eq:TG}
\end{equation}
The internal energy in the gain region is $E_{\rm th,g} \simeq \int 3 P_{\rm g} dV \simeq 4 \times 10^{50} {~\rm erg}$. In the present study I examine the possibility that a fraction of this energy boosts the jets. This energy is not the total energy in the gain region during the entire explosion time, but rather the energy at a given time. The gain region loses energy but neutrino heating and the in-flowing core material replenish the energy. Therefore, the total energy that the gain region can add to the outflow during the entire explosion process is $>E_{\rm th,g}$.
\subsection{The jets}
\label{subsec:Jets}
I do not study the formation of jets (see section \ref{sec:intro} and section \ref{subsec:Launching}). I assume that the proto-NS (or newly born NS) launches the jets inside the gain region, i.e., at $r < R_{\rm g} \simeq 50 {~\rm km}$. The inner boundary of the launching zone is the proto-NS. The neutrinosphere is outside the proto-NS at very early times, moving into the proto-NS at late times (e.g., \citealt{Jankaetal2007}). As the jets are launched by the operation of magnetic fields, the location of the neutrinosphere is not of large significance. The jets might start with a mass outflow rate that is $\simeq 0.1-0.2$ times the mass accretion rate, and have a terminal velocity larger than the escape velocity from the proto-NS, which is somewhat larger than $10^5 {~\rm km} {~\rm s}^{-1}$. Like \cite{PapishSoker2011} I take the velocity of the gas in the jets before it is shocked to be constant at $v_{\rm j} =10^5 {~\rm km} {~\rm s}^{-1}$, and its mass outflow rate to be $\dot M_{\rm 2j} \simeq 0.1 \dot M_{\rm c}$. The deceleration by the gravity of the central mass is significant at short distances of $r \la 100 {~\rm km}$. I am here interested in the interaction mainly near and outside the stalled shock, i.e., at $r \ga R_{\rm s}$, and so I take the above value of jets velocity at $R_{\rm s}$, and for the accuracy of the present study I can neglect gravitational deceleration at $r>R_{\rm s}$. The solid angle that the two opposite jets cover is
\begin{equation}
\Omega_{\rm 2j} = 4 \pi \delta,
\label{eq:OmegaJets}
\end{equation}
where $\delta$ can vary as the jets expand, i.e., $\delta(r,t)$. Like \cite{PapishSoker2011} I scale with $\delta=0.01$ that corresponds to a half-opening angle of $\alpha_{\rm j}=8^\circ$.
The density in the jets is
\begin{equation}
\begin{split}
\rho_{\rm j}= 1.6 \times 10^9
\left( \frac{\dot M_{\rm 2j}}{0.1 M_\odot {~\rm s}^{-1}} \right)
\left( \frac{v_{\rm j}}{10^5 {~\rm km} {~\rm s}^{-1}}\right)^{-1}
\\ \times \left( \frac{\delta}{0.01} \right)^{-1}
\left( \frac{r}{100 {~\rm km}} \right)^{-2}
{~\rm g} {~\rm cm}^{-3} ; \qquad r > 50 {~\rm km} .
\label{eq:RhoJets}
\end{split}
\end{equation}
Each jet-launching episodes lasts for $\tau_{\rm j} \simeq 0.01-0.1 {~\rm s}$ and carry and energy of $E_{\rm 2j} \approx {\rm few} \times 10^{49} - {\rm few} \times 10^{50} {~\rm erg}$. Note that the jets get their initial energy directly from the accretion energy of the accretion disk, and not from the gain region. The energy from the gain region boosts the outflow that the jets induce.
A possible case for the present setting is one where there are $N_{\rm launch} = 4$, or few more, jet-launching episodes as I claimed for the supernova remnant SNR~0540-69.3 \citep{Soker2022a}, each lasting $\tau_{\rm j} \simeq 0.03 {~\rm s}$ or somewhat less. The total energy of the four jet-launching episodes is $1.2 \times 10^{51} {~\rm erg}$, which after adding the contribution from neutrino heating that I study here and removing the binding energy of the ejecta gives a typical CCSN explosion energy, i.e., $\simeq 10^{51} {~\rm erg}$. By explosion energy I refer to the kinetic energy of the ejecta, which dominates the explosion energy, plus the radiated energy.
The outcome for the parameters that I use here is that the density in the jets is similar to the density in the gain region. Since the jets' receive the same amount of neutrino flux from the center, the temperature and pressure inside the pre-shock jets is similar to that in the gain region.
Actually, if the thermal pressure in the ambient gas is larger than that inside the jet the ambient medium compresses the jet, while if the ambient thermal pressure is smaller then the cross section of the jet increases. Therefore, the thermal pressures inside the jets and in the ambient gas are about equal. As the pressure close to the proto-NS is much larger than that in the outer gain region (e.g., \citealt{Janka2001}), the jets are expected to be collimated. I present the schematic flow structure in Fig. \ref{Fig:Schematic}.
\begin{figure*}
\begin{center}
\includegraphics[trim=28.5cm 8.2cm 29.0cm 2.0cm,scale=0.86]{RAA20220178Fig1.pdf}
\caption{A schematic drawing (not to scale) of the flow structure of one of the two opposite jets just after it breaks out from the gain region. The effects inside boxes that point with double-line arrows are those involved in boosting the outflow that the jets induce. The yellow-hatched region is the cocoon, which includes the post-shock material of the jets and of the collapsing core. In the figure the neutrinosphere is outside the proto-NS, which is true only at the very beginning of the process, as in a short time it moves into the proto-NS (e.g., \citealt{Jankaetal2007}). }
\label{Fig:Schematic}
\end{center}
\end{figure*}
Momentum balance at the head of a jet implies that within the gain region the jet's head velocity is (e.g., \citealt{PapishSoker2011})
\begin{equation}
v_{\rm h,g} \simeq 0.5 v_{\rm j}
\left( \frac{2}{1+\sqrt{\rho_{\rm g}/{\rho_{\rm j}}}} \right).
\label{eq:Vhg}
\end{equation}
The jet's head crosses the gain region within $\Delta t_{\rm h,g} \simeq 0.001 {~\rm s} \la 0.1 \tau_{\rm j}$.
As the jets propagate out from the stalled shock they encounter the collapsing core material.
The ram pressure of the collapsing gas in the frame of the stationary stalled shock $P_{\rm ram,p}$ just before it hits the stalled shock is about the post-shock pressure as given by equation (\ref{eq:PressG}), and varies as $P_{\rm ram,p} \simeq P(R_{\rm s}) (r/R_{\rm s})^{-5/2}$ (e.g. \citealt{BlondinMezzacappa2006}).
The ratio of the jets' ram pressure to that of the collapsing gas in the frame of the stationary stalled shock is
\begin{equation}
\begin{split}
\frac{\rho_{\rm j} v^2_{\rm j}}{P_{\rm ram,p}} \simeq 16
\left( \frac{\dot M_{\rm 2j}}{0.1 \dot M_{\rm c}} \right)
\left( \frac{v_{\rm j}}{10^5 {~\rm km} {~\rm s}^{-1}}\right) \\ \times
\left( \frac{\delta}{0.01} \right)^{-1}
\left( \frac{r}{100 {~\rm km}} \right)^{1/2}
; \quad r > R_{\rm s} = 100 {~\rm km}
\label{eq:eq:RamPs}
\end{split}
\end{equation}
and I take $R_{\rm s}=100 {~\rm km}$.
Note that in this approximation I neglect the time variation of the accretion rate (the jets were launched by earlier accreted gas).
To find the velocity of the head of a jet $v_{\rm h}$ as the jet propagates through the collapsing core material we need to equate the ram pressures in the frame of the jet's head
\begin{equation}
\rho_{\rm c} (v_{\rm h} + v_{\rm ff})^2 \simeq
\rho_{\rm j} (v_{\rm j} - v_{\rm h})^2,
\label{eq:RamPressurs1}
\end{equation}
where I will take for the collapsing core velocity the free fall velocity that I define positively, $v_{\rm ff} > 0$, and the density of the collapsing material is $\rho_{\rm c} = \dot M_{\rm c}/ (4 \pi r^2 v_{\rm ff})$.
The density of the pre-shock material inside the jet is given equation (\ref{eq:RhoJets}), and I define
\begin{equation}
\beta \equiv \frac {\dot M_{\rm 2j}}{\delta \dot M_{\rm c}} = 10
\left( \frac{\dot M_{\rm 2j}}{0.1 \dot M_{\rm c}} \right)
\left( \frac{\delta}{0.01} \right)^{-1}.
\label{eq:beta}
\end{equation}
Equation (\ref{eq:RamPressurs1}) is a quadratic equation for $v_{\rm h}$ that reads
\begin{equation}
\begin{split}
\left( \beta v_{\rm ff} - v_{\rm j}\right) v^2_{\rm h}
- 2 v_{\rm j} v_{\rm ff} \left(1+ \beta\right)v_{\rm h}
+ v_{\rm j} v_{\rm ff} \left( \beta v_{\rm j} - v_{\rm ff} \right)=0.
\end{split}
\label{eq:RamPressurs2}
\end{equation}
Just outside the stalled shock at $R_{\rm s} =100 {~\rm km}$ the velocity of the jet's head is $v_{\rm h}=0.54 v_{\rm j}$, where I substituted the parameters I use here $v_{\rm j}=10^5 {~\rm km} {~\rm s}^{-1}$, $\beta=10$, and $v_{\rm ff}(R_{\rm s})=6.1 \times 10^4 {~\rm km} {~\rm s}^{-1}$. \cite{PapishSoker2011} use a different approach to calculate the jet's head velocity, i.e., they take the ambient density from numerical simulations. Using the same parameters as I do here, their equation (6) gives a similar value of $v_{\rm h} \simeq 0.54 v_{\rm j}$.
At $r=1600 {~\rm km}$ where $v_{\rm ff}= 1.5 \times 10^4{~\rm km} {~\rm s}^{-1}$ the solution of equation (\ref{eq:RamPressurs2}) gives a similar value of $v_{\rm h}=0.48 v_{\rm j}$. Namely, the velocity of the jet's head does not change much near and outside the radius of the stalled shock, and for the parameters that I use here it is
\begin{equation}
v_{\rm h} \simeq 0.5 v_{\rm j}.
\label{eq:VhOut}
\end{equation}
For a jet-launching episode that lasts $\tau_{\rm j} \simeq 0.03 {~\rm s}$ the jet reaches
a distance $\simeq 1500 {~\rm km}$ by the end of the episode. However, the head of the jet will `know' about this at a much later time.
For example, if the jet's head proceeds at half the velocity of the material in the jets it will reach a distance of $\simeq 3000 {~\rm km}$ before the supply of fresh jet's material ceases. This distance is similar to simulations of the jittering jets \citep{PapishSoker2014a, PapishSoker2014Planar}. For a constant jet's head velocity the interaction will continue until time
\begin{equation}
\tau_{\rm h} \simeq 2 \tau_{\rm j} \frac{v_{\rm j}}{2 \left( v_{\rm j}- v_{\rm h} \right) },
\label{eq:Tauhead}
\end{equation}
from the beginning of the jet-launching episode, when the jet's head reaches a distance of
\begin{equation}
R_{\rm h}(\tau_{\rm h}) \simeq 3000
\left( \frac{\tau_{\rm j}}{0.03 {~\rm s}} \right)
\left( \frac{v{\rm j}}{10^5 {~\rm km} {~\rm s}^{-1}} \right)
\frac{v_{\rm h}}{v_{\rm j}- v_{\rm h}} {~\rm km}.
\label{eq:Rhead}
\end{equation}
In Fig. \ref{Fig:Schematic2} I schematically (not to scale) draw the flow at the time $\tau_{\rm h}$ when the jet ceases to feed the head.
\begin{figure}
\begin{center}
\includegraphics[trim=28.5cm 3.2cm 30.0cm 2.0cm,scale=0.58]{RAA20220178Fig2.pdf}
\caption{A schematic drawing (not to scale) of the flow structure of one of the two opposite jets just as the jet ceases to feed the head, at $\tau_{\rm h}$ as given by equation (\ref{eq:Tauhead}). Note that at late times, unless accretion rate increases a lot, the neutrinosphere is inside the proto-NS. }
\label{Fig:Schematic2}
\end{center}
\end{figure}
The interaction of the jets with the collapsing core is more complicated because neutrino heating and cooling take place in the pre-shock and post-shock media, that of the jets and that of the collapsing core. The post-shock regions of the two media is the `cocoon'. The shock wave that runs into the collapsing core (forward shock) has a size larger than the jet's radius $r \sin \alpha_{\rm j}$.
In the rest frame of the jet's head the collapsing core is shocked at a velocity that is close to about twice as large as its free fall velocity at the stalled shock. This implies that the pressure of the post-shock material of the collapsing core, the `cocoon', is about three times as large as that just behind the stalled shock. Therefore, the cocoon maintains the collimation of the jet, or might even compress it somewhat.
\section{The boosting process}
\label{sec:Boosting}
In the jittering jets explosion mechanism there are in total several to few tens of jets-launching episodes, each lasting $\tau_{\rm j} \simeq 0.01-0.1 {~\rm s}$, or even up to few$\times 0.1 {~\rm s}$. In each episode the accretion belt/disk launches two opposite jets. The jets' axis directions change by a large angle from one episode to the next.
Although in Fig. \ref{Fig:Schematic}, that represents one jet in one episode, I draw a straight jet, the jets direction might continuously change (precesses) by a small angle even within a jet-launching episode.
The interaction of each of the two opposite jets with the collapsing core material shocks both the jet's material, in the reverse shock, and the collapsing core material, in the forward shock. These two post-shock zones, separated by a contact
discontinuity, are referred to as the 'cocoon' (yellow-hatched region in Fig. \ref{Fig:Schematic}).
There are two processes by which neutrino heating boosts the outflow of the `cocoon' along the sides of the jets.
\subsection{Heating the cocoon}
\label{subsec:HeatingCocoon}
In the direct heating process that I consider first neutrinos directly heat the cocoon. To estimate the importance of this process I estimate the properties of the cocoon.
Equation (\ref{eq:VhOut}) implies that as the jets expand into the collapsing core, at least for $r \la 2000 {~\rm km}$, both the jets' material and the collapsing core that the jets interact with pass through strong shocks, e.g., shock velocities of $\simeq 5 \times 10^4 - 10^5 {~\rm km} {~\rm s}^{-1}$. This is similar to the velocity by which the collapsing core hits the stalled shock away from the jets.
Therefore, the post-shock jets and collapsing core zones, the `cocoon' (see Fig. \ref{Fig:Schematic}), are nearly fully composed of free nucleons. This in turns implies an efficient neutrino heating, similar to that in the gain region.
Neutrino heating depends on the neutrino flux $L_{\nu} / 4 \pi r^2$ and neutrino energy, where the relevant neutrinos are the electron-neutrino and the anti-electron-neutrino.
As typical neutrino luminosity and average energy in the first second of collapse for a model with an initial mass of $M_{\rm ZAMS} = 15 M_\odot$ I take $L_\nu = 2 \times 10^{52} {~\rm erg} {~\rm s}^{-1}$ and $\bar{e}_\nu =12 {~\rm MeV}$, respectively, and note that different models might have different values (e.g, \citealt{Mulleretal2012, Glasetal2019, Matsumotoetal2022, Nakamuraetal2022}). The neutrino heating rate per nucleon at a distance $r$ from the center is (e.g., \citealt{Janka2001})
\begin{equation}
\begin{split}
q_{\nu} \approx 3000
\left( \frac{r}{100 {~\rm km}} \right)^{-2}
\left( \frac{L_{\rm \nu}}{2 \times 10^{52} {~\rm erg} {~\rm s}^{-1}} \right)
\\ \times
\left( \frac{\bar{e}_\nu }{12 {~\rm MeV}} \right)^{2}
{~\rm MeV} {~\rm s}^{-1}.
\label{eq:Qheat}
\end{split}
\end{equation}
I present here a very crude estimate, since only hydrodynamical simulations of the interaction of the jets with the collapsing core can find the total heating of the cocoon. Consider that the jets shock and drag out collapsing core material of equal mass. This means that each nucleon in the jets drag another nucleon from the collapsing core. Although the interaction region moves out, there must be material between the jet's head and the stalled shock. I consider that this material flows outward at a speed of $v_{\rm cocoon} \approx 0.5 v_{\rm j} \simeq 5 \times 10^4 {~\rm km} {~\rm s}^{-1}$.
To find the total heating of the cocoon per nucleon in the jet I
integrate over time $dt = dr /v_{\rm cocoon}$ from $r=100 {~\rm km}$ out and multiply by two, as for each nucleon in the jet there are two in the cocoon. I find that for each original nucleon in the jet direct neutrino heating of the cocoon adds energy of
\begin{equation}
\begin{split}
\Delta E_{\rm n_j, \nu} < 10
\left( \frac{L_{\rm \nu}}{2 \times 10^{52} {~\rm erg} {~\rm s}^{-1}} \right)
\left( \frac{\bar{e}_\nu }{12 {~\rm MeV}} \right)^{2}
\\ \times
\left( \frac{v_{\rm cocoon}}{5 \times 10^4 {~\rm km} {~\rm s}^{-1}} \right)^{-1}
{~\rm MeV}.
\label{eq:DeltaEn}
\end{split}
\end{equation}
I use the inequality sign above because this calculation overestimates the time the cocoon stays close to the stalled shock and does not include neutrino cooling. Including the appropriate time and neutrino cooling reduce the energy that equation (\ref{eq:DeltaEn}) would give to less than half the value, i.e., $\Delta E_{\rm n_j, \nu} < 5 {~\rm MeV}$ (see also \citealt{Janka2001}). The kinetic energy that each nucleon in the jet carries, which is
$E_{\rm n_j,k} = 57 {~\rm MeV}$ for $v_{\rm j} = 10^5 {~\rm km} {~\rm s}^{-1}$, is about an order of magnitude larger. Therefore, direct neutrino heating of the cocoon plays a very small role in boosting the explosion by jets.
The significant conclusion of this subsection is that future numerical simulations of the neutrino boosting of jittering jets, that will be highly resources-demanding, can ignore the direct heating of the cocoon.
\subsection{Accelerating the cocoon out}
\label{subsec:AcceleratingCocoon}
With the parameters of equations (\ref{eq:RhoG})-(\ref{eq:TG}) the sound speed of the gain region at $r\la R_{\rm s}$ is
\begin{equation}
C_{\rm s} (R_{\rm s}) \simeq 2.5 \times 10^4 {~\rm km} {~\rm s}^{-1} \simeq 0.5 v_{\rm h},
\label{eq:Cs}
\end{equation}
where in the second equality I used equation (\ref{eq:VhOut}).
The collapsing core material along the jet's axis and around is shocked by the jet, and therefore reaches the stalled shock at a slower velocity than that of the undisturbed collapsing core material. As a result of that the ram pressure on the stalled shock around the jet, namely, where the cocoon touches the stalled shock (see Fig. \ref{Fig:Schematic}), is much lower than that of the undisturbed collapsing core material. This leads the high-pressure gas just behind the stalled shock to stream into the cocoon (the arrows with a double-triangle head). This adds energy to the cocoon.
In other words, the material in the gain region locally revives the stalled shock (Fig. \ref{Fig:Schematic}) and does work on the cocoon.
Only full 2D or 3D hydrodynamical simulations can determine the extra work that the gas from the gain region does on the cocoon.
I here only crudely estimate a plausible value.
Consider that the cocoon cross section on the stalled shock is $b \simeq {\rm few}$ times the cross section of the jet. The combined cross sections of the two opposite cocoons (only one shown in Fig. \ref{Fig:Schematic}) is
\begin{equation}
A_{\rm cocoon}=b 4 \pi \delta R^2_s.
\label{eq:Acocoon}
\end{equation}
The rate of work done on the cocoon by the material of the gain region that expands behind the cocoon is
\begin{equation}
\begin{split}
W_{\rm g} & \approx A_{\rm cocoon} P(R_s) C_{\rm s}
\simeq 9.4 \times 10^{50}
\left( \frac{b}{3} \right)
\left( \frac{\delta}{0.01} \right)
\\ \times &
\left( \frac{R_{\rm s}}{100 {~\rm km}} \right)^2
\left( \frac{P(R_s)}{10^{28} {~\rm erg} {~\rm cm}^{-3}} \right)
\\ \times &
\left( \frac{C_{\rm s}}{2.5 \times 10^4 {~\rm km} {~\rm s}^{-1}} \right)
{~\rm erg} {~\rm s}^{-1} .
\label{eq:Wgcoccon}
\end{split}
\end{equation}
Because the ram pressure at the stalled shock goes as $R^{-5/2}_{\rm R_s}$, and the sound speed also decreases somewhat, the rate of work varies with the shock radius as $W_{\rm g} \propto R^{-1}_{\rm s}$. For a shock radius of $R_{\rm s} = 200 {~\rm km}$ the rate of work as given by equation (\ref{eq:Wgcoccon}) would be about half the value as given now in that equation. On the other hand, the value of $b$ might be somewhat larger. Still, the largest uncertainty is in the value of $\delta$.
I comment on the two main assumptions that I used in deriving equation (\ref{eq:Wgcoccon}). (1) The gain region expands at the sound speed into the cocoon. The reason is that, as I discussed above, the pressure in the gain region is much larger than the pressure of the cocoon. The typical velocity by which a high pressure zone expands into a much lower pressure zone is the sound speed. In other words, I assume that the initial thermal and kinetic energy of the cocoon near the stalled shock is negligible. (2) The pressure inside the stalled shock does not drop despite the expansion along the cocoon. This assumption is based on the inequality $b \delta \ll 1$. Namely, the area through which the gas in the gain region expands out is small. Collapsing core material continues to fall on most of the other area of the stalled-shock sphere and therefore maintains the pressure there. Moreover, if the pressure in the gain region drops the stalled shock moves inward and this, as I indicated above, increases the work done according to equation (\ref{eq:Wgcoccon}) as $R^{-1}_{\rm s}$.
The nucleon outflow rate in the two jets is $\dot M_{\rm 2j}/m_{\rm n}$, where $m_{\rm n}$ is the neutron mass.
However, the outward flow of the material from the gain region will continue until the collapsing core material resumes its inflow onto the stalled shock in that region.
By equation (\ref{eq:Tauhead}) the jet interaction with the collapsing core might last for about twice the duration of the jet-launching episode. Then, the ram pressure will return to its undisturbed value by about the time the collapsing core freely falls from that distance. This time might be a fraction of a second. From $r_{\rm h} = 3000 {~\rm km}$ the free fall time is $\simeq 0.4 {~\rm s}$.
Namely, more than 10 times the duration of the jet-launching episode. However, material from the sides of the jet's axis will partially fill the empty zone because the collapsing core at large distances still maintains a high thermal pressure.
Overall, I take the outflow time of the gain region material to be several times the jet's activity phase $\tau_{\rm g,out} = {\rm several} \times \tau_{\rm j}$.
In section \ref{subsec:timescale} I return to discuss this timescale.
The energy that the work of the gain region adds to the cocoon per nucleon in the two jets is then
\begin{equation}
\begin{split}
& \Delta E_{\rm n_j,g} \approx
\frac{\tau_{\rm g,out}}{\tau_{\rm j}}
\frac{W_{\rm g}}{\dot M_{\rm 2j}/m_{\rm n}}
\approx 50
\left( \frac{\tau_{\rm g,out}}{10 \tau_{\rm j}} \right)
\\ \times
& \left( \frac{W_{\rm g}}{10^{51} {~\rm erg} {~\rm s}^{-1}} \right)
\left( \frac{\dot M_{\rm 2j}}{0.1 M_\odot {~\rm s}^{-1}} \right)^{-1}
{~\rm MeV}.
\label{eq:WgNucleon}
\end{split}
\end{equation}
The value of the energy per nucleon in the jets that the expanding gain region adds to the energy of the cocoon, i.e., the outflow that the jets induce, according to equation (\ref{eq:WgNucleon}) is highly uncertain and very crude. Nonetheless, equation (\ref{eq:WgNucleon}) does suggest that the outflow that the jets induce allows the high-pressure material in the gain region to expand and add a significant amount of energy relative to that of the jets, $E_{\rm n_j,k} = 57 {~\rm MeV}$ in the present setting.
\subsection{Relation to the standing accretion shock instability (SASI)}
\label{subsec:SASI}
In the SASI the stalled shock surface oscillates with a large departure from spherical symmetry (e.g., \citealt{Blondinetal2003, Ohnishietal2006}). Because the ram pressure of the collapsing core varies as $\propto R^{-5/2}$ (e.g., \citealt{BlondinMezzacappa2006}), the ram pressure on a small protrusion of the stalled shock surface into the collapsing core (towards larger radius) is lower than on the rest of the stalled shock. This protrusion then grows. Simulations find that the $l=1$ and $l=2$ modes dominate the SASI (e.g., \citealt{Ohnishietal2006, BlondinMezzacappa2006, Hankeetal2013}).
\cite{ Blondinetal2003} worked out the physics of SASI and write that if neutrino heating supports the stalled shock for a sufficiently long period of time the SASI might initiate the explosion. \cite{ Blondinetal2003} further discussed the possible coupling between rotation, magnetic fields, and SASI, as later numerical simulations show (e.g., \citealt{Summaetal2018}).
The effect by which the gain region does work on the cocoon, i.e., the shocked material of the jets and of the collapsing core around the jets (section \ref{subsec:AcceleratingCocoon}) is similar to the way the SASI facilitates explosion in the frame of the delayed neutrino explosion mechanism.
The differences are that in the jittering jets explosion mechanism the perturbations that the jets cause are non-linear to start with (see Fig. \ref{Fig:Schematic} and \ref{Fig:Schematic2}), and that they are on smaller scales.
Consider that the diameter of the cross section of the cocoon on stalled shock surface (Fig. \ref{Fig:Schematic2}) is $D \simeq (8 b \delta)^{1/2} R_{\rm s}$, where $b$ and $\delta$ are given by equations (\ref{eq:Acocoon}) and (\ref{eq:OmegaJets}), respectively. This corresponds to a mode of order
\begin{equation}
l_{\rm j} \simeq \frac{\pi R_{\rm s}}{D} \simeq 6
\left( \frac{b}{3} \right)^{-1/2}
\left( \frac{\delta}{0.01} \right)^{-1/2} .
\label{eq:Ljets}
\end{equation}
It is quite likely that the next jet-launching episode starts while the outflow from the gain region along the jets of the previous jet-launching episode has not ended yet. Namely, for a short time the perturbations by the jets occur at four places simultaneously.
The conclusion is that the jets might excite SASI-like oscillations with $l_{\rm j} \simeq 6$ in addition to the $l=1$ and $l=2$ of the SASI itself.
In a recent study \cite{Vartanyanetal2022} examine the turbulence that develops below the stalled shock as a result of pre-collapse perturbations in the core. They find that the power spectra of tangential velocities in the turbulence zone is relatively flat up to spherical harmonic index $l \la 4$, and from there on a Kolgomorov-like spectrum forms.
In the range $4 \la l \la 10$ the modes have energies $\simeq 0.2-1$ (depending on the 3D progenitor model) times the energy of the $ l \la 4$ modes. However, the seed perturbations in those simulations are small (in the linear regime). Here I suggest that the non-linear perturbations that the jets introduce might excite the $l \simeq 6$ SASI modes. My suggestion requires of course to be confirmed by 3D simulations.
\section{On the assumptions}
\label{sec:Assumptions}
I here discuss the challenges and difficulties that the proposed boosting process should overcome before it stands on solid ground.
\subsection{Motivation}
\label{subsec:Motivation}
Before discussing the challenges of the jittering jets explosion mechanism I comment that there is a place to discuss the jittering jets explosion mechanism because of the imprints of jets in many supernova remnants (e.g., \citealt{Bearetal2017, GrichenerSoker2017, YuFang2018, Luetal2021, Soker2022a}), and because of the difficulties of the delayed neutrino mechanism. Among several difficulties (e.g., \citealt{Kushnir2015, Papishetal2015}), the two main disadvantages of the delayed neutrino mechanism are that the maximum explosion energy that can be explained is $\simeq 2 \times 10^{51} {~\rm erg}$ (e.g. \citealt{Fryeretal2012, Sukhboldetal2016}), and that in some cases explosion does not occur at all (e.g., \citealt{Burrowsetal2020}), although in many other cases explosion does take place in simulations (e.g. \citealt{Bolligetal2021, BurrowsVartanyan2021}).
\subsection{The available explosion energy}
\label{subsec:Energy}
According to the jittering jets explosion mechanism the pre-collapse inner one or two convective zones launch the jets as they are accreted onto the proto-NS (newly born NS) through an intermittent accretion disk/belt at a radius of $\simeq 20-40 {~\rm km}$. At the very beginning the proto-NS radius is $\simeq 50 {~\rm km}$, but it shrinks to these smaller values by the time the jittering jets are launched. In some cases the mass in these convective zones is only $\Delta m_{\rm conv}=0.03 M_\odot$ \citep{ShishkinSoker2022}, and therefore do not supply by themselves enough mass to the jets to explain typical CCSN energies. However, in many other cases the mass in the pre-collapse convective zones is larger, and so the sample of stellar models cover the typical range of CCSN explosion energies \citep{ShishkinSoker2022}.
For a proto-NS mass of $1.4 M_\odot$ and a radius of $R_{\rm PNS}=30 {~\rm km}$ the escape velocity is $v_{\rm es}=1.1 \times 10^5 {~\rm km} {~\rm s}^{-1}$. If the jets carry a fraction of $f_{\rm 2j}=0.1$ of the accreted mass, then for the above values the energy that they carry will only be $\simeq 0.1 \Delta m_{\rm conv} v^2_{\rm es}/2 \simeq 3.6 \times 10^{50}$. This can explain by itself low-energy CCSNe.
However, the available energy is larger. The reason is that the convective stochastic motion in the accreted layers serves as the seeds of the perturbations. Instabilities inside the stalled shock, like the spiral-SASI, amplify these seed perturbations and increase the amplitude of the specific angular momentum fluctuations, and, live longer to increase the amount of mass accreted through the intermittent disk/belt (see discussion in \citealt{ShishkinSoker2022}).
Moreover, according to equation (\ref{eq:WgNucleon}) neutrino heating can double the original jets energy. Substituting typical values and a proto-NS mass of $1.4 M_\odot$ gives the total available energy according to the present study
\begin{equation}
\begin{split}
E_{\rm jets-total} & > 2 f_{\rm 2j} \Delta m_{\rm conv} v^2_{\rm es} /2
=7 \times 10^{50}
\\ & \times
\left( \frac{\Delta m_{\rm conv}}{0.03 M_\odot} \right)
\left( \frac{R_{\rm PNS}}{30 {~\rm km} }\right)^{-1}
\left( \frac{f_{\rm 2j}}{0.1} \right) {~\rm erg}
\label{eq:Ejetstotal}
\end{split}
\end{equation}
This is compatible with observed energies of CCSNe as in most cases $\Delta m_{\rm conv} > 0.03 M_\odot$ \citep{ShishkinSoker2022}.
\subsection{The timescale of the boosting process}
\label{subsec:timescale}
\subsubsection{Comments on equation (\ref{eq:WgNucleon})}
\label{subsubsec:Equation19}
In section \ref{subsec:AcceleratingCocoon} I estimated the outflow timescale
of the gain region material to be several times the jet's
activity phase, $\tau_{\rm g,out} = {\rm several} \times \tau_{\rm j}$.
As stated, this estimate should be confirmed with 2D or 3D numerical simulations.
Here I further describe the process and the uncertainty in this time scale.
After the jet activity ceases, the material in the gain region closes the funnel that each jet opened in the post-stalled shock zone in about a sound crossing time,
$\Delta t_{\rm funnel,g} \simeq D/C_{\rm s} (R_{\rm s}) \simeq 5 \times 10^{-4} {~\rm s}$ for a jet with a half opening angle of $8^\circ$ and sound speed as in equation (\ref{eq:Cs}). This very short time scale works for the proposed mechanism because it implies that practically the gain region starts to impart force on the cocoon (Fig. \ref{Fig:Schematic2}) immediately.
The cocoon itself closes the funnel that the jet has opened outside the gain region (above the stalled shock). Because the cocoon is the post-shock media after it expanded, its temperature is lower than the immediately post-shock temperatures of the shocked collapsing core and of the jet near its head. Nonetheless, its sound speed is expected to be very large, definitely much larger than $1 \%$ of the jet velocity, i.e., $C_{\rm s} (\rm cocoon) > 1000 {~\rm km} {~\rm s}^{-1}$. It will close the funnel at $r_{\rm h} = 3000 {~\rm km}$ in a time scale of $\Delta t_{\rm funnel,3000} < 0.4 {~\rm s}$ for the same parameters that I use throughout the paper (see equation \ref{eq:Rhead}). As this is about the time I estimated, $\tau_{\rm g,out} = 10 \tau_{\rm j} \simeq 0.3 {~\rm s}$ (see equation \ref{eq:WgNucleon}), I conclude that the cocoon also closes the funnel at any radius $r$ before the outflow that the gain region accelerates reaches that radius.
I emphasize that although the cocoon closes the funnel, unlike the collapsing core, the cocoon does not fall towards the center at a high speed. As well, due to its high thermal pressure as a post-shock gas, its density is lower than that of the collapsing core. In other words, the jets pushed the gas to the sides as they expand outward. This will allow the high-pressure gas in the gain region to expand and further accelerate the cocoon to high velocities.
To summarize this section I emphasize again the implication of equation (\ref{eq:WgNucleon}) and the discussion above. What I have shown is that the mechanism by which the delayed neutrino explodes stars, when it manages to work, is more efficient when we consider jets that locally revive the stalled shock. If this mechanism does not work here, the delayed neutrino mechanism will not work either.
What I further argue is that in many cases where the delayed neutrino mechanism does not work, the jittering jets explosion mechanism can work, and further be boosted by neutrino heating. As well, the jittering jets mechanism can account for explosion energies much above $2 \times 10^{51} {~\rm erg}$.
\subsubsection{On the possibility of prolonged jet activity}
\label{subsubsec:prolonged}
The jittering jets mechanism was developed to explode starts within about a second from core bounce, similar to the expectations from the delayed neutrino mechanism in the past. Some recent studies suggest that the explosion activity can last for over five seconds (e.g., \citealt{Bolligetal2021}), while other studies, however, argue that the explosion should take place within less than a second (e.g., \citealt{Saitoetal2022}). The accretion rate in a fraction of the first second is indeed close to $1 M_\odot {~\rm s}^{-1}$, as I scale quantities in this study. The accretion rate in the simulation of \citealt{Bolligetal2021} from $t=1 {~\rm s}$ to $t=6 \sec$ is about $0.01 M_\odot {~\rm s}^{-1}$. The total accreted mass might be $\simeq 0.05 M_\odot$ in this time period. The proto-NS radius is smaller at these late times $R_{\rm PNs} \simeq 15-20 {~\rm km}$. Substituting this accreted mass and the smaller proto-NS radius in equation (\ref{eq:Ejetstotal}), I derive an energy that might be comparable to or larger than the energy that the jets carry in the first second. Namely, the jets can supply more energy if the process of accretion continues.
The prolonged jet activity has the advantage that at later times core material from further out is accreted, and those zones further out might in some cases posses strong pre-collapse convection that seeds the instabilities that feed the stochastic angular momentum of the accreted gas (e.g., \citealt{ShishkinSoker2022}).
\subsection{The launching of jets}
\label{subsec:Launching}
The processes that most severely needs confirmation by 3D simulations is the launching of the jittering jets by the intermittent accretion disk/belt that the accreted mass with stochastic angular momentum forms.
These simulations must include magnetic fields (e.g., \citealt{Soker2018arXiv, Soker2019RAA, Soker2020RAA}), and be of very high resolution. For that, I do not expect simulations at present to be able to launch jets.
Critical to the launching process is the formation of two opposite funnels near the proton-NS. The accretion disk/belt launches the two opposite jets through these funnels (e.g., \citealt{SchreierSoker2016}). Like the disk, the funnels are intermittent and change their direction in a stochastic manner, giving rise to jittering jets. Magnetic fields can form such funnels, as well as the stochastic angular momentum of the accreted gas. But even when the angular momentum of the accreted gas opens funnels along the angular momentum axis, magnetic fields are crucial to channel accretion energy to the collimated outflow.
As I mentioned in section \ref{sec:intro}, the simulations by \cite{Kaazetal2022} suggest that such a process is possible.
\cite{Kaazetal2022} simulate cases of a BH that accretes mass as it moves through a magnetized homogeneous medium, i.e., the Bondi-Hoyle-Lyttleton accretion flow. The initial direction of the magnetic field lines is perpendicular to the direction of BH motion through the medium.
They obtain jets more or less along the initial direction of the magnetic field lines, despite that there is no initial angular momentum in the flow. However, for jets to be launched the magnetic fields have to be sufficiently strong.
I therefore conclude that the fact that present simulations do not obtain jittering jets cannot be used to rule out such jets, simply because these simulations do not have yet all ingredients that might lead to such jets.
\section{Summary}
\label{sec:Summary}
I conducted a study to crudely estimate the boosting of jittering jets by neutrino heating. In the jittering jets explosion mechanism where there are several or more jet-launching episodes, the jets of one jet-launching episode are active for a relatively shot time and do not carry enough energy to explode the core. It is the additive effect of several and more jet-launching episodes that eventually explodes the star.
I chose a set of parameters for the ambient gas and jets (section \ref{sec:RelevantParameters}) to perform the calculations.
I then studied two processes by which neutrino heating can increase the energy that the jets deposit to the collapsing core material.
In the direct heating process (section \ref{subsec:HeatingCocoon}) the neutrinos that the cooling proto-NS emits directly heat the cocoon (yellow-hatched region in Fig. \ref{Fig:Schematic}). I find that this direct heating process adds less than about ten percent of the kinetic energy that the jets carry, $\Delta E_{\rm n_j, \nu} < 0.1 E_{\rm n_j,k}$, where these energies are defined per nucleon in the jets (equation \ref{eq:DeltaEn}).
In the second process (section \ref{subsec:AcceleratingCocoon}) the material from the gain region flows out into the cocoon and does work on it. The material in the gain region maintains its high pressure by neutrino heating. I estimate the work that the gain region does on the cocoon to be crudely equal to the initial energy that the jets carry, $\Delta E_{\rm n_j,g} \approx E_{\rm n_j,k} $ (equation \ref{eq:WgNucleon}).
In section \ref{subsec:SASI} I raised the possibility that the jets excite SASI-like oscillations but with higher orders of $l \simeq 6$ (equation \ref{eq:Ljets}) with respect to the regular SASI models that have mainly $l=1$ or $l=2$. These modes exist alongside the regular SASI modes.
\cite{ Blondinetal2003} mentioned the possible coupling between neutrino heating, the SASI, rotation, and magnetic fields, in exploding CCSNe. The spiral modes of SASI amplify initial perturbations to supply the stochastic angular momentum to the accreted gas that launches the jittering jets (e.g., \citealt{ShishkinSoker2021}), and strong magnetic fields are involved in launching the jets (sections \ref{sec:intro} and \ref{subsec:Launching}).
In the present study I strengthen the claim for a mutual influence between jittering jets and neutrino heating. I therefore extend the statement of \cite{Blondinetal2003} to include also jets, and argue that the coupling between spiral-SASI, stochastic rotation, possible ordered rotation, magnetic fields, and \textit{(jittering) jets}, lead to the explosion of CCSNe.
In section \ref{sec:Assumptions} I discussed some of the assumptions of the present study. Although the launching of jittering jets is impossible to include in present numerical studies (section \ref{subsec:Launching}), I encourage simulations to insert jittering jets near the stalled shock and study the effects of neutrino heating on these jets and the outflow they induce.
\section*{Acknowledgments}
I thank Dima Shishkin for helpful comments, and an anonymous referee for detailed and very useful comments. This research was supported by a grant from the Israel Science Foundation (769/20).
\textbf{Data availability}
The data underlying this article will be shared on reasonable request to the corresponding author.
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 103
|
\section{Introduction}
\label{sec:intro}
A recent trend in image processing has been to move from simple non adaptive filters to image dependent filters such as the bilateral filter \cite{TomasiBF1998}, non local means \cite{BuadesNLM2005}, block matching \cite{BM3D_2007}, kernel regression methods \cite{KernelRegressionImageProcessing}, expected patch likelihood maximization (EPLL) \cite{ZoranEPLL_2011} or window nuclear norm minimization (WNNM) \cite{GuWNNM_2014}.
One shortcoming of these adaptive filters is that they cannot be efficiently described using traditional image domain Fourier techniques, since these models are highly non linear. To solve this issue of interpretability, graph based perspectives have been introduced to analyze data dependent image processing models \cite{milanfar2013tour, PeyreSpectralUnderstanding}.
In the graph formulation, pixels corresponds to the nodes of a graph and are connected with edges having edge weights capturing pixel similarity.
\cite{milanfar2013tour, AkshayBF2013} shows the correspondence between window based filters and graph based filtering where the graph is formed by connecting each pixel (node) to only those within a window centered at the pixel.
This method of graph construction for $w \times w$ filtering resembles a $K$-Nearest Neighbor (KNN) graph with $K = w^2$ where neighbors are selected based on their spatial location relative to the pixel at the window center.
Thus, the choice of $w$, similar to $K$ in KNN graphs, can be considered a hyperparameter offering coarse control of sparsity and complexity of the graph representation.
In this work, we focus on graph construction for image representation, a specific application which is often overlooked in data driven graph learning methods \cite{Qiao2018}.
Our proposed method extends to images recently introduced non negative kernel regression (NNK) method \cite{shekkizhar2019graph, shekkizhar2020graph} for graph construction.
Unlike earlier methods, our framework leads to a principled way to construct sparse graphs that can be combined with spectral graph wavelets and other graph signal processing tools \cite{ortega2018, GeneGraphImage2018}. Relative to previous work \cite{shekkizhar2019graph, shekkizhar2020graph}, the key novelty in this paper is to exploit pixel position regularity, and specific characteristics of kernels used for image filtering, to learn image graphs in a fast and efficient manner, which allows us to scale the proposed methods to graphs with millions nodes as required by image processing applications. Experimentally, our image specific simplifications lead to average speed ups in graph construction of at least a factor $10$ for $w=11$, relative to the original NNK algorithm.
We focus our graph construction and filtering by taking the bilateral filter graph as starting point, but the same can be adapted to other image processing models that have a graph interpretation (e.g., those described in \cite{milanfar2013tour}).
Of particular relevance to our work is \cite{AkshaySparseBF2017}, where the authors construct sparse graph alternatives by approximating the inverse of the bilateral filter matrix. The authors motivate the idea by drawing parallels to the graph construction methods that estimate sparse inverse covariance or precision matrix of a Gaussian Markov Random Field model \cite{HilmiGraphLaplacian}. The authors note that this method is expensive and resort to a heuristic algorithm which still can only be used for small images \cite{AkshaySparseBF2017}. In contrast, in this paper we are able to apply our method to images with typical sizes.
We combine our method with Spectral Graph Wavelets \cite{HammondSGW2011} to illustrate its benefits for image representation, showing that our graphs have $90\%$ fewer edges than bilateral filter graphs constructed with $11\times11$ window while offering better low frequency representation and improved performance in the context of a simple denoising task. The runtime of graph wavelets and other graph filter operations for images are notably reduced due to the sparse nature of our graphs (e.g., $15\times$ faster than the same algorithm using BF graph).
\section{Preliminaries}
\label{sec:preliminaries}
\subsection{Bilateral Filter}
The bilateral filter (BF) can be interpreted as a \textit{graph filter} on a dense, image-dependent graph,
with edge weights between nodes (pixels) $i$ and $j$ given by the kernel
\begin{align}
{\bm{K}}_{i,j} &= \exp\left(-\frac{\|{\bm{x}}_i - {\bm{x}}_j\|^2}{2\sigma_d^2 }\right)\exp\left(-\frac{\|{\bm{f}}_i - {\bm{f}}_j\|^2}{2\sigma_f^2 }\right) \label{eq:bf_kernel}
\end{align}
where ${\bm{x}}_i$ and ${\bm{f}}_i$ denote the position and the intensity of pixel $i$, respectively. The bilateral filter operation on graph signal ${\bm{f}}$ can be interpreted as ${\bm{D}}^{-1}{\bm{K}}{\bm{f}}$, where ${\bm{D}}$ is the degree matrix of the graph and its inverse is used as a normalization. With this interpretation it is also possible to develop alternative graphs, via symmetrization of ${\bm{D}}^{-1}{\bm{K}}$ \cite{MilanfarSymmetrizingFilter2013} or sparsification of the original BF graph \cite{AkshaySparseBF2017}.
Note that the pixel positions ${\bm{x}}$ and the distances $\|{\bm{x}}_i - {\bm{x}}_j\|^2$ in the BF kernel \plainref{eq:bf_kernel} are image independent and are known in advance.
\subsection{Non Negative Kernel regression graphs}
Note that ${\bm{K}}_{i,j}$ can be viewed as the inner product of two kernel functions ${\bm{\phi}}_i$ and ${\bm{\phi}}_j$ \cite{Hofmann2008}.
Then, a non negative kernel regression (NNK) graph can be computed by formulating graph construction as a signal representation problem, where each node is to be approximated by a weighted sum of functions from a dictionary formed by its neighboring nodes \cite{shekkizhar2019graph,shekkizhar2020graph}.
At each node, we need to solve:
\begin{align}
& \min_{{\bm{\theta}} \colon {\bm{\theta}} \geq 0} \;
||{\bm{\phi}}_i - {\bm{\Phi}}_S{\bm{\theta}}||^2_{_{l_2}}, \label{eq:nnk_lle_objective}
\end{align}
where ${\bm{\phi}}_i$ (corresponding to node $i$) is to be represented by a linear combination of atoms~(with weights given by ${\bm{\theta}}$) from a dictionary obtained from a set $S$ of neighbors~(${\bm{\Phi}}_S$).
As shown in \cite{shekkizhar2019graph,shekkizhar2020graph}, it is possible to associate a geometric interpretation to conditions that determine whether two nodes are connected (kernel ratio interval or KRI conditions). Thus, in contrast to KNN graphs, even when window size $w$ increases the number of connected nodes does not necessarily grow, so that NNK graphs tend to be better at reflecting the actual data topology.
A key contribution of this paper is to adapt NNK to image data, and in particular taking into account the special characteristics of image to apply the KRI conditions more effectively. Unlike in the general case, where all data dimensions are irregular and unknown, in image graphs pixel locations are regularly spaced and are known before hand. This observation allows us to reduce the KRI condition to simple intensity thresholding rules for removing neighbors in images (see \secref{sec:nnk_image}).
Formally, the KRI theorem states that for any positive definite kernel with range in $[0, 1]$ (e.g. bilateral kernel \plainref{eq:bf_kernel}), the necessary and sufficient condition for two nodes $j$ and $k$ to be {\em both} connected to node $i$ in a NNK graph is
\begin{align}
{\bm{K}}_{j,k} < \frac{{\bm{K}}_{i,j}}{{\bm{K}}_{i,k}} < \frac{1}{{\bm{K}}_{j,k}}.
\label{eq:kernel_ratio_interval}
\end{align}
The geometric interpretation of (\ref{eq:kernel_ratio_interval}) is illustrated by \Figref{fig:plane}.
\begin{figure}[htbp]
\centering
\includegraphics[width=0.3\textwidth]{plane.png}
\caption{Plane (yellow dashed line) associated to a connected node $j$ in NNK. Nodes in the blue region to the right of the plane will be not be connected to node $i$. This provides an intuitive explanation of KRI: given that there is edge between node $i$ and $j$, a farther away node $k$ in the same direction can be connected to $i$ only if it is \emph{more similar} to $i$ than $j$.}
\label{fig:plane}
\end{figure}
\subsection{Spectral Graph Wavelet Transform}
Given the adjacency matrix ${\bm{K}}$ of a graph ${\mathcal{G}}= ({\mathbb{V}}, {\mathbb{\xi}})$, the associated combinatorial graph Laplacian ${\bm{L}}$ is defined as ${\bm{L}} = {\bm{D}} - {\bm{K}}$, where ${\bm{D}}$ is the diagonal degree matrix given by ${\bm{D}}_{i,i} = \sum_j {\bm{K}}_{i,j}$. A graph signal is a function $f \colon {\mathbb{V}} \to \mathbb{R}$ defined on the vertices of the graph. In the case of images, this corresponds to the intensity or values defined at each pixel.
The Graph Fourier Transform (GFT) \cite{ortega2018} is defined as the expansion of the graph signal in terms of the eigenvectors of chosen graph operator, e.g., the graph Laplacian.
Spectral Graph Wavelets (SGW) \cite{HammondSGW2011} are based on defining a scaling operator in the GFT domain, based on the eigenvectors of the graph, analogous to the Fourier transform but for signals defined on a weighted graph.
The wavelet coefficients for a given signal at scale $s$ at a vertex $i$ are calculated as a function of a graph operator ${\bm{T}}_g = g({\bm{L}})$ and the eigenpair ($\lambda_l, {\bm{e}}_l$) defining the GFT, namely
\begin{align}
{\mathcal{W}}_f(s, i) = {\bm{T}}^s_gf(i) = \sum^{|{\mathbb{V}}|}_{l=1}g(s\lambda_l)\hat{f}(\lambda_l){\bm{e}}_l(i) \label{eq:wavelet_coefficents}
\end{align}
These coefficients can be computed with a fast algorithm based on Chebychev polynomials for approximating the scaled operator function. We refer the reader to \cite{HammondSGW2011} for further details on approximations for practical realization of SGW.
\section{NNK IMAGE FILTERING}
\label{sec:nnk_image}
Given the neighbor set at each node, NNK graph can be obtained with ${\mathcal{O}}(K^3)$ complexity at each node, where $K$ is the number of neighbors.
In this section, we present image specific simplifications to compute NNK graphs efficiently.
\subsection{Kernel Ratio Interval for images}
The KRI condition of \plainref{eq:kernel_ratio_interval} allows us to identify neighboring nodes (pixels in $w \times w$ window for images) that will have zero edge weights, given knowledge of a connected node (\Figref{fig:plane}).
From an image point of view, this corresponds to removing graph edges
to pixels which are farther away when there exists pixels with similar intensity that are closer.
\begin{proposition}
\label{prop:kri_images}
The necessary and sufficient condition for a pixel $k$ to not have an edge to pixel $i$ given that pixel $j$ is connected to pixel $i$ i.e ${\bm{\theta}}_{i,k} = 0 | ({\bm{\theta}}_{i,j} > 0)$ is given by
\begin{equation}
({\bm{f}}_j - {\bm{f}}_k)^\top({\bm{f}}_j - {\bm{f}}_i) < \left(\frac{\sigma_f}{\sigma_d}\right)^2({\bm{x}}_k - {\bm{x}}_j)^\top({\bm{x}}_j - {\bm{x}}_i)
\label{eq:proposition-1}
\end{equation}
\begin{proof}
Denote $d_{i,j} = \|{\bm{x}}_i - {\bm{x}}_j\|^2$ and similarly $f_{i,j} = \|{\bm{f}}_i - {\bm{f}}_j\|^2$. Thus the bilateral filter weights can be rewritten as:
\begin{align}
{\bm{K}}_{i,j}
&= \exp\left( - \frac{d^2_{i,j}}{2\sigma_d^2 } - \frac{f^2_{i,j}}{2\sigma_f^2 }\right) \label{eq:simplified_bf_kernel}
\end{align}
Now, the contraposition of KRI theorem \plainref{eq:kernel_ratio_interval} gives a necessary and sufficient condition for an edge (${\bm{\theta}}_{i,k}$) to be disconnected as
\begin{align}
\frac{{\bm{K}}_{i,j}}{{\bm{K}}_{i,k}} & \geq \frac{1}{{\bm{K}}_{j,k}}. \label{eq:kri_contrapositive}
\end{align}
Substituting for the bilateral weight kernel
\begin{align}
\frac{{\bm{K}}_{i,j}}{{\bm{K}}_{i,k}}
& = \exp\left( -\frac{(d^2_{i,j} - d^2_{i,k})}{2\sigma^2_d} -\frac{(f^2_{i,j} - f^2_{i,k})}{2\sigma^2_f} )\right) \label{eq:kri_image_left}
\end{align}
Thus, condition \plainref{eq:kri_contrapositive} is simplified as
\begin{align*}
\exp\left( -\frac{(d^2_{i,j} - d^2_{i,k})}{2\sigma^2_d} -\frac{(f^2_{i,j} - f^2_{i,k})}{2\sigma^2_f})\right) \geq \exp\left(\frac{d^2_{j,k}}{2\sigma_d^2 } + \frac{f^2_{j,k}}{2\sigma_f^2 }\right)
\end{align*}
Taking logarithm on both sides and rearranging terms corresponding to intensity and location we obtain after some manipulations
\begin{align}
f^2_{i,j} + f^2_{j,k} - f^2_{i,k} & \leq - \left(\frac{2\sigma^2_f}{2\sigma^2_d}\right) d^2_{i,j} + d^2_{j,k} - d^2_{i,k} \label{eq:kri_simplified_1}
\end{align}
Using the simplification from Lemma \ref{lemma:norm_simplification}, to replace $d^2_{i,j} + d^2_{j,k} - d^2_{i,k}$ and $f^2_{i,j} + f^2_{j,k} - f^2_{i,k}$ leads to (\ref{eq:proposition-1}) and concludes the proof.
\end{proof}
\end{proposition}
\begin{lemma}
\label{lemma:norm_simplification}
\begin{align*}
d^2_{i,j} + d^2_{j,k} - d^2_{i,k} &= 2\;({\bm{x}}_j - {\bm{x}}_k)^\top({\bm{x}}_j - {\bm{x}}_i) \\
f^2_{i,j} + f^2_{j,k} - f^2_{i,k} &= 2\;({\bm{f}}_j - {\bm{f}}_k)^\top({\bm{f}}_j - {\bm{f}}_i)
\end{align*}
\begin{proof}
Omitted for space.
\end{proof}
\end{lemma}
\subsection{Sparse graph representation of images}
The right term in (\ref{eq:proposition-1}) depends only on pixel locations and kernel parameters and can be determined for a given window size $w$ and saved before hand. As a further simplification we consider only threshold factors ($\Delta = ({\bm{x}}_k - {\bm{x}}_j)^\top({\bm{x}}_j - {\bm{x}}_i)$) that are positive, corresponding to regions along the same direction as the connected pixel $j$ (see \Figref{fig:kri_for_images}). This stands to intuition as the KRI plane (\Figref{fig:plane}) would hardly influence the selection of pixels on the other side of the window. The order of the pixels in the window can be precomputed by closest to farthest for a given window.
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.21\textwidth}
\centering
\includegraphics[width=\textwidth]{figs/nnk_image.png}
\caption{}
\label{fig:kri_for_images}
\end{subfigure}
\begin{subfigure}{0.23\textwidth}
\centering
\includegraphics[trim={0cm 6cm 2cm 6cm},clip,width=\textwidth]{figs/runtime_difference.pdf}
\caption{}
\label{fig:runtime_difference}
\end{subfigure}
\caption{\textbf{(a)}. (Best viewed in color) Simple scenario of 4 connected neighbor and remaining pixels in a $7\times7$ window with their associated \emph{threshold factor} ($\Delta$). For e.g, given pixel $j$ is connected to $i$, the proposed graph construction eliminates all pixel intensities in green region (right of $i$) which satisfy the condition in Proposition \ref{prop:kri_images}.
The algorithm continues pruning by moving radially outwards connecting pixels that are not pruned and removing ones that are to be pruned based on proposition until no pixel is left unprocessed.\\
\textbf{(b)}. Average processing time per pixel for our proposed simplified NNK and the original NNK construction. We observe a similar trend on all our test images with the difference widening further for increasing window sizes.}
\end{figure}
Further, given the set of neighbors for each pixel after pruning, we approximate the weights with the original bilateral kernel weights, instead of computing them to satisfy the condition of (\ref{eq:nnk_lle_objective}). This can be justified by the fact that both NNK and original BF kernel weights maintain the same relative order of importance and would serve as good approximations.
Let us consider the simple case where only two nodes remain after pruning, then NNK weights are given as
\begin{align*}
\begin{bmatrix}
{\bm{\theta}}_{i,j} \\ {\bm{\theta}}_{i,k}
\end{bmatrix} = \frac{1}{1-{\bm{K}}^2_{j,k}}
\begin{bmatrix}
{\bm{K}}_{i,j} - {\bm{K}}_{j,k}{\bm{K}}_{i,k} \\ {\bm{K}}_{i,k} - {\bm{K}}_{j,k}{\bm{K}}_{i,j}
\end{bmatrix}
\end{align*}
Thus,
\begin{align}
{\bm{\theta}}_{i,j} - {\bm{\theta}}_{i,k} = ({\bm{K}}_{i,j} - {\bm{K}}_{i,k})\left[ \frac{1+{\bm{K}}_{j,k}}{1-{\bm{K}}^2_{j,k}}\right]
\end{align}
The factor on the right with ${\bm{K}}_{j,k}$ term is strictly positive and thus the relative impact of the edges is preserved when NNK graph is approximated with the original kernel weights.
\begin{algorithm}
\DontPrintSemicolon
\SetKwInOut{Input}{Input}
\SetKwFunction{Precompute}{Precompute}
\SetKwFunction{FMain}{NNK\_Image\_Graph}
\SetKwProg{Fn}{Function}{:}{}
\Fn{\Precompute{$w$}}{
${\bm{x}} = \text{pixel positions in } w\times w,\;\; {\mathbb{S}} = \{ \text{pixels in } w\times w \}$\\
window center $= i,\;\; {\mathbb{S}} = {\mathbb{S}} - \{i\}$\\
${\mathbb{S}} = $ sort ${\mathbb{S}}$ by $ \|{\bm{x}}_j - {\bm{x}}_i\|^2 \;\; \forall j \in {\mathbb{S}}$ \\
\For{$j,k$ in ${\mathbb{S}}$}{
$\Delta_{j,k} = ({\bm{x}}_k - {\bm{x}}_j)^\top({\bm{x}}_j - {\bm{x}}_i)$
}
}
\textbf{return} Ordered window pixels ${\mathbb{S}}$, Threshold factor $\Delta$ \\[0.5em]
\Input{Image ${\bm{f}} \in \mathbb{R}^{m\times n}$, window size $w, \sigma_f, \sigma_r$}
\Fn{\FMain{}}{
$\mu = \left(\frac{\sigma_f}{\sigma_d}\right)^2$, \hspace{0.5em}
$[{\mathbb{S}}^*,\; \Delta ]= \;$\Precompute($w$)\\
\For{ each pixel $i$}{
${\mathbb{S}} = {\mathbb{S}}^*,\;\; {\mathbb{P}} = \{\}$ \\
\For{$j$ in ${\mathbb{S}}$}{
\tcc{pick neighbors in spatial distance sorted order}
\uIf{$j$ in ${\mathbb{P}}$}{continue \tcp*[r]{skip if pruned}}
${\mathbb{P}} = {\mathbb{P}} + \{j\}$ \\
\For{pixel $k$ in ${\mathbb{S}}$ with $\Delta_{j,k} \geq 0$}{
\tcc{consider pixels in same direction as $j$}
\uIf{$({\bm{f}}_j - {\bm{f}}_k)^\top({\bm{f}}_j - {\bm{f}}_i) \leq \mu\Delta_{j,k} \;$}{${\mathbb{P}} = {\mathbb{P}} + \{k\}, \;\; {\mathbb{S}} = {\mathbb{S}} - \{k\}$}
}
}
${\bm{W}}_{i, {\mathbb{S}}} = {\bm{K}}_{i, {\mathbb{S}}}\;, \;\;{\bm{W}}_{i, {\mathbb{S}}^c} = 0 $
}
}
\textbf{return} Graph Adjacency ${\bm{W}}$
\caption{Proposed NNK for Images}
\label{algorithm:nnk_algorithm}
\end{algorithm}
\section{IMAGE REPRESENTATION AND DENOISING WITH NNK IMAGE GRAPHS}
\label{sec:experiments}
We validate experimentally the effectiveness of our proposed method over the naive BF graph version in terms of energy compaction and denoising performance.
\subsection{Energy compaction}
In this section, we evaluate our graph construction for image representation. Variance of the wavelet signals is an indicator of information content corresponding to the frequency band of the wavelet. As can be observed in \Figref{fig:butterfly_wavelets}, wavelets corresponding to our method have very less information in the higher frequency bands which is very natural for images as they are inherently smooth. Another feature to identify a good representation of images is the fraction of image energy captured by each wavelet, i.e $(\|{\bm{f}}_w\|^2/\|{\bm{f}}\|^2)$. \Figref{fig:wavelet_vs_degree} shows that NNK graphs capture much of the image energy earlier than BF graph which corresponds to compact support in the wavelet domain.
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{figs/bf_wavelets.png}
\end{subfigure}
~~
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{figs/nnk_wavelets.png}
\end{subfigure}
\caption{(Top: $11\times11$ Bilateral Filter Graph vs Bottom: Proposed NNK Graph Construction) Energy compaction using spectral graph wavelets. NNK graphs captures most of image in the lower bands.}
\label{fig:butterfly_wavelets}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics[trim={2.5cm 7cm 2cm 6cm},clip,width=0.45\textwidth]{figs/wavelet_vs_degree.pdf}
\caption{The energy captured by BF Graph (blue) and NNK graph (red) for different polynomial degree approximations of SGW. The wavelets were designed with frame bounds $A=1.71, B=2.35$ as designed in \cite{HammondSGW2011}. NNK consistently captures the image content better than BF graph irrespective of the Chebychev polynomial degree.}
\label{fig:wavelet_vs_degree}
\end{figure}
\subsection{Image Denoising}
\begin{figure}[ht]
\centering
\begin{subfigure}{0.4\textwidth}
\includegraphics[trim={1cm 6cm 2cm 6cm},clip,width=\textwidth]{figs/psnr_noise_complete_boxplot.pdf}
\end{subfigure}
\begin{subfigure}{0.4\textwidth}
\includegraphics[trim={1cm 6cm 2cm 6cm},clip,width=\textwidth]{figs/ssim_noise_complete_boxplot.pdf}
\end{subfigure}
\caption{Denoising performance using SGW on BF graph and proposed method with comparisons to original BF and BM3D algorithms. NNK graphs achieves a significant improvement over the BF Graph version in SSIM and PSNR. Our method improves SSIM of the output while matching PSNR performance with original BF. The BM3D method included for completeness shows that the proposed graph method with BF kernel achieves comparable SSIM measures.}
\label{fig:denoising_results}
\end{figure}
We consider the problem of image denoising to evaluate filtering performance of our proposed graph. We consider 12 standard images ($256\times 256$) used in image processing
with Gaussian corruption at 5 different noise variances ($\sigma = 10,15,20,25,30$). We use a $11\times11$ window for constructing the graphs with hyperparameters chosen as in \cite{ZhangMultiBF}. Denoising is done on image signal corresponding to each frequency band separately. The average performance and quantiles for original BF \cite{TomasiBF1998}, BM3D \cite{BM3D_2007} and SGW based on BF graph and proposed method are shown in \Figref{fig:denoising_results}. A key thing to notice is that performance worsens with SGW denoising using BF graph. We attribute this to a shortcoming of the BF graph construction. Since the resulting graph is dense, higher degree polynomials of the BF adjacency used in SGW lead to averaging over larger window and consequently to increased blurring.
\section{CONCLUSION}
We present an attractive framework for image representation using graphs. The proposed graph is sparse and scalable with better energy compaction in its spectral bases than previously used window based graph methods. Our graph construction is robust to a wide range of window sizes and can be run in a parallel for even lower computational complexity.
Further, we explore the use of Spectral Graph Wavelets which operates simultaneously in vertex and spectral domain for image denoising. This approach allows us to leverage ideas from previously studied wavelet methods for images and presents a potential research direction moving forward. In the future, we would like to study the performance of our graph construction with more complex filtering kernels such as those used in non local means, BM3D, kernel regression to mention a few.
\bibliographystyle{IEEEbib}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 8,791
|
using System;
namespace SharpDX.WIC
{
public partial class ColorTransform
{
/// <summary>
/// Initializes a new instance of the <see cref="ColorTransform"/> class.
/// </summary>
/// <param name="factory">The factory.</param>
/// <unmanaged>HRESULT IWICImagingFactory::CreateColorTransformer([Out, Fast] IWICColorTransform** ppIWICColorTransform)</unmanaged>
public ColorTransform(ImagingFactory factory)
: base(IntPtr.Zero)
{
factory.CreateColorTransformer(this);
}
}
}
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 4,077
|
When most people think about their air conditioner, they think about the cool air that comes out of the vents. However, one of the biggest factors in HVAC efficiency is where that air ultimately goes. In order to cool a home effectively, air must be kept inside the home. In buildings with poor windows, air escapes quickly, causing cooling expenses to literally go out the window. This is why new windows are a critical part of air conditioner efficiency.
While any new window is an upgrade, the most dramatic results come with low-emissivity windows. Commonly called low-e storm windows, these unique options are specially designed for energy efficiency.
Reflective coating: Although the specific coating varies, all low-e storm windows have a thin but powerful metal coating. This coating is virtually invisible, but it provides an important reflective barrier that directs energy into the home.
Versatile installation: Because these are storm windows, they can be installed inside or outside an existing window. They can also be used to replace an entire window unit. These variations allow customers to pick an option that suits their home and their budget.
Ultimate efficiency: Despite the range of options, the outcome is always the same. With the reflective coating, these windows consistently lead to reduced cooling expenses, which are often seen immediately on monthly utility bills. The savings only grows with time.
Upgrading windows has other effects on air conditioner efficiency. Not only does a new window keep air inside effectively, but this improvement can positively impact the long term health of any HVAC system. With better windows, an air conditioner will not have to work as hard, which will minimize the amount of repair needed. This can continually decrease the long range costs of any HVAC system.
To learn more about how to improve your air conditioner efficiency or any other HVAC needs, be sure to contact Comfort24-7 for more information.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 4,516
|
RP13 - Restricted to persons over 13 years of age unless accomanied by a parent of guardian.
RP16 - Restricted to persons over 16 years of age unless accomanied by a parent of guardian.
RP18 – Restricted to persons over 18 years of age unless accomanied by a parent of guardian.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 7,008
|
Rebordainhos e Pombares (oficialmente: União das Freguesias de Rebordainhos e Pombares) é uma freguesia portuguesa do município de Bragança com 24,08 km² de área e 148 habitantes (2021). A sua densidade populacional é de 6,1 hab/km².
História
Foi constituída em 2013, no âmbito de uma reforma administrativa nacional, pela agregação das antigas freguesias de Rebordainhos e Pombares e tem a sede em Rebordainhos.
Demografia
Geografia
Localidades
A freguesia de Rebordainhos e Pombares compreende um total de sete lugares, que são os seguintes:
{|
| valign="top" |
Arufe
Pereiros
Pombares
Quinta de Vila Boa de Arufe
Rebordainhos (Sede da Freguesia)
Teixedo (Povoação Morta)
Vales
Eleições
Freguesias de Bragança
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 303
|
high quality Replica Hermes To answer a recurrent question: "If kids aren crossing the road, why do the cars have to stop?" I think the idea here is to make it safer not only for the kids but for the bus as a whole. If you don require people to stop or make only a few lanes stop, you increase the risk of someone hitting the stopped bus or going around the lanes which would have to stop. By making everyone stop, it makes it safer as a whole high quality Replica Hermes.
Acest articol a fost publicat in revista Telegraful Român la data de 22/11/2014 .
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 970
|
Q: Monodevelop compile issue with ReadAsync Monodevelop V5.1 & V5.9.8
Mono JIT compiler version 4.2.1
Monodevelop is complaing over this:
while ((numBytesRead = await stream.ReadAsync(data, 0, 1024)) >0)
Yet intellisense offers it up as an option
Error CS1061: Type System.IO.Stream' does not contain a definition
forReadAsync' and no extension method ReadAsync' of type
System.IO.Stream' could be found. Are you missing an assembly
reference? (CS1061)
A: Manually adding the framework fixed it
<PropertyGroup>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 563
|
(function() {
// TODO: put "use strict"; here (but right now webstorms inspector starts
// complaining on this issue: http://youtrack.jetbrains.com/issue/WEB-7485)
/**
* Define namespace
*/
var math = {
type: {},
expr: {
node: {
handlers: {}
}
},
docs: {},
options: {
precision: 5 // number of digits in formatted output
}
};
// utility methods for strings, objects, and arrays
var util = (function () {
var util = {};
/**
* Convert a number to a formatted string representation.
* @param {Number} value The value to be formatted
* @param {Number} [precision] number of digits in formatted output
* @return {String} formattedValue The formatted value
*/
util.formatNumber = function formatNumber(value, precision) {
if (value === Infinity) {
return 'Infinity';
}
else if (value === -Infinity) {
return '-Infinity';
}
else if (isNaN(value)) {
return 'NaN';
}
// TODO: what is a nice limit for non-scientific values?
var abs = Math.abs(value);
if ( (abs > 0.001 && abs < 100000) || abs == 0.0 ) {
// round the value to a limited number of precision
return util.toPrecision(value, precision);
}
else {
// scientific notation
var exp = Math.round(Math.log(abs) / Math.LN10);
var v = value / (Math.pow(10.0, exp));
return util.toPrecision(v, precision) + 'e' + exp;
}
};
/**
* Round a value to a maximum number of precision. Trailing zeros will be
* removed.
* @param {Number} value
* @param {Number} [precision] Number of digits in formatted output
* @returns {string} str
*/
util.toPrecision = function toPrecision (value, precision) {
return value.toPrecision(precision).replace(_trailingZeros, function (a, b, c) {
return a.substring(0, a.length - (b.length ? 0 : 1) - c.length);
});
};
/** @private */
var _trailingZeros = /\.(\d*?)(0+)$/g;
/**
* Recursively format an n-dimensional matrix
* Example output: "[[1, 2], [3, 4]]"
* @param {Array} array
* @returns {String} str
*/
util.formatArray = function formatArray (array) {
if (array instanceof Array) {
var str = '[';
var len = array.length;
for (var i = 0; i < len; i++) {
if (i != 0) {
str += ', ';
}
str += util.formatArray(array[i]);
}
str += ']';
return str;
}
else {
return math.format(array);
}
};
/**
* Recursively format an n-dimensional array, output looks like
* "[1, 2, 3]"
* @param {Array} array
* @returns {string} str
*/
util.formatArray2d = function formatArray2d (array) {
var str = '[';
var s = util.size(array);
if (s.length != 2) {
throw new RangeError('Array must be two dimensional (size: ' +
util.formatArray(s) + ')');
}
var rows = s[0];
var cols = s[1];
for (var r = 0; r < rows; r++) {
if (r != 0) {
str += '; ';
}
var row = array[r];
for (var c = 0; c < cols; c++) {
if (c != 0) {
str += ', ';
}
var cell = row[c];
if (cell != undefined) {
str += math.format(cell);
}
}
}
str += ']';
return str;
};
/**
* Convert function arguments to an array. Arguments can have the following
* signature:
* fn()
* fn(n)
* fn(m, n, p, ...)
* fn([m, n, p, ...])
* @param {...Number | Array | Matrix} args
* @returns {Array} array
*/
util.argsToArray = function argsToArray(args) {
var array;
if (args.length == 0) {
// fn()
array = [];
}
else if (args.length == 1) {
// fn(n)
// fn([m, n, p, ...])
array = args[0];
if (array instanceof Matrix) {
array = array.toVector();
}
if (array instanceof Range) {
array = array.valueOf();
}
if (!(array instanceof Array)) {
array = [array];
}
}
else {
// fn(m, n, p, ...)
array = [];
for (var i = 0; i < args.length; i++) {
array[i] = args[i];
}
}
return array;
};
/**
* Check if a text ends with a certain string.
* @param {String} text
* @param {String} search
*/
util.endsWith = function endsWith(text, search) {
var start = text.length - search.length;
var end = text.length;
return (text.substring(start, end) === search);
};
/**
* Extend object a with the properties of object b
* @param {Object} a
* @param {Object} b
* @return {Object} a
*/
util.extend = function extend (a, b) {
for (var prop in b) {
if (b.hasOwnProperty(prop)) {
a[prop] = b[prop];
}
}
return a;
};
/**
* Deep extend an object a with the properties of object b
* @param {Object} a
* @param {Object} b
* @returns {Object}
*/
util.deepExtend = function deepExtend (a, b) {
for (var prop in b) {
if (b.hasOwnProperty(prop)) {
if (b[prop] && b[prop].constructor === Object) {
if (a[prop] === undefined) {
a[prop] = {};
}
if (a[prop].constructor === Object) {
deepExtend(a[prop], b[prop]);
}
else {
a[prop] = b[prop];
}
} else {
a[prop] = b[prop];
}
}
}
return a;
};
/**
* Create a semi UUID
* b: http://stackoverflow.com/a/105074/1262753
* @return {String} uuid
*/
util.randomUUID = function randomUUID() {
var S4 = function () {
return Math.floor(
Math.random() * 0x10000 /* 65536 */
).toString(16);
};
return (
S4() + S4() + '-' +
S4() + '-' +
S4() + '-' +
S4() + '-' +
S4() + S4() + S4()
);
};
// TODO: write the map, deepMap, map2, and deepMap2 functions in a more concise way
/**
* Execute function fn element wise for each element in array.
* Returns an array with the results
* @param {Array | Matrix | Range} array
* @param {function} fn
* @return {Array | Matrix} res
*/
util.map = function map(array, fn) {
if (array instanceof Array || array instanceof Matrix || array instanceof Range) {
return array.map(function (x) {
return fn(x);
});
}
else {
throw new TypeError('Array expected');
}
};
/**
* Execute function fn element wise for each element in array and any nested
* array
* Returns an array with the results
* @param {Array | Matrix | Range} array
* @param {function} fn
* @return {Array | Matrix} res
*/
util.deepMap = function map(array, fn) {
if (array instanceof Array || array instanceof Matrix || array instanceof Range) {
return array.map(function (x) {
return map(x, fn);
});
}
else {
return fn(array);
}
};
/**
* Execute function fn element wise for each entry in two given arrays, or
* for a (scalar) object and array pair. Returns an array with the results
* @param {Array | Matrix | Range | Object} array1
* @param {Array | Matrix | Range | Object} array2
* @param {function} fn
* @return {Array | Matrix} res
*/
util.map2 = function map2(array1, array2, fn) {
var res, len, i;
// handle Matrix
if (array1 instanceof Matrix || array2 instanceof Matrix) {
return new Matrix(util.map2(array1.valueOf(), array2.valueOf(), fn));
}
// handle Range
if (array1 instanceof Range || array2 instanceof Range) {
// TODO: util.map2 does not utilize Range.map
return util.map2(array1.valueOf(), array2.valueOf(), fn);
}
if (array1 instanceof Array) {
if (array2 instanceof Array) {
// fn(array, array)
if (array1.length != array2.length) {
throw new RangeError('Dimension mismatch ' +
'(' + array1.length + ' != ' + array2.length + ')');
}
res = [];
len = array1.length;
for (i = 0; i < len; i++) {
res[i] = fn(array1[i], array2[i]);
}
}
else {
// fn(array, object)
res = [];
len = array1.length;
for (i = 0; i < len; i++) {
res[i] = fn(array1[i], array2);
}
}
}
else {
if (array2 instanceof Array) {
// fn(object, array)
res = [];
len = array2.length;
for (i = 0; i < len; i++) {
res[i] = fn(array1, array2[i]);
}
}
else {
// fn(object, object)
res = fn(array1, array2);
}
}
return res;
};
/**
* Execute function fn element wise for each entry in two given arrays,
* and for any nested array. Objects can also be scalar objects.
* Returns an array with the results.
* @param {Array | Matrix | Range | Object} array1
* @param {Array | Matrix | Range | Object} array2
* @param {function} fn
* @return {Array | Matrix} res
*/
util.deepMap2 = function map2(array1, array2, fn) {
var res, len, i;
// handle Matrix
if (array1 instanceof Matrix || array2 instanceof Matrix) {
return new Matrix(map2(array1.valueOf(), array2.valueOf(), fn));
}
// handle Range
if (array1 instanceof Range || array2 instanceof Range) {
// TODO: util.deepMap2 does not utilize Range.map
return map2(array1.valueOf(), array2.valueOf(), fn);
}
if (array1 instanceof Array) {
if (array2 instanceof Array) {
// fn(array, array)
if (array1.length != array2.length) {
throw new RangeError('Dimension mismatch ' +
'(' + array1.length + ' != ' + array2.length + ')');
}
res = [];
len = array1.length;
for (i = 0; i < len; i++) {
res[i] = map2(array1[i], array2[i], fn);
}
}
else {
// fn(array, object)
res = [];
len = array1.length;
for (i = 0; i < len; i++) {
res[i] = map2(array1[i], array2, fn);
}
}
}
else {
if (array2 instanceof Array) {
// fn(object, array)
res = [];
len = array2.length;
for (i = 0; i < len; i++) {
res[i] = map2(array1, array2[i], fn);
}
}
else {
// fn(object, object)
res = fn(array1, array2);
}
}
return res;
};
/**
* For each method for objects and arrays.
* In case of an object, the method loops over all properties of the object.
* In case of an array, the method loops over all indexes of the array.
* @param {Object | Array} object The object
* @param {function} callback Callback method, called for each item in
* the object or array with three parameters:
* callback(value, index, object)
*/
util.forEach = function forEach (object, callback) {
if (object instanceof Array) {
object.forEach(callback);
}
else {
for (var key in object) {
if (object.hasOwnProperty(key)) {
callback(object[key], key, object);
}
}
}
};
/**
* Creates a new object with the results of calling a provided function on
* every prop in the object.
* @param {Object} object The object.
* @param {function} callback Mapping function
* @return {Object | Array} mappedObject
*/
util.mapObject = function mapObject (object, callback) {
var m = {};
for (var key in object) {
if (object.hasOwnProperty(key)) {
m[key] = callback(object[key]);
}
}
return m;
};
/**
* Deep test equality of all fields in two pairs of arrays or objects.
* @param {Array | Object} a
* @param {Array | Object} b
* @returns {boolean}
*/
util.deepEqual = function deepEqual (a, b) {
var prop, i, len;
if (a instanceof Array) {
if (!(b instanceof Array)) {
return false;
}
for (i = 0, len = a.length; i < len; i++) {
if (!util.deepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
else if (a instanceof Object) {
if (b instanceof Array || !(b instanceof Object)) {
return false;
}
for (prop in a) {
if (a.hasOwnProperty(prop)) {
if (!util.deepEqual(a[prop], b[prop])) {
return false;
}
}
}
for (prop in b) {
if (b.hasOwnProperty(prop)) {
if (!util.deepEqual(a[prop], b[prop])) {
return false;
}
}
}
return true;
}
else {
return (a.valueOf() == b.valueOf());
}
};
/**
* Recursively calculate the size of a multi dimensional array.
* @param {Array} x
* @Return {Number[]} size
* @throws RangeError
*/
function _size(x) {
if (x instanceof Array) {
var sizeX = x.length;
if (sizeX) {
var size0 = _size(x[0]);
if (size0[0] == 0) {
return [0].concat(size0);
}
else {
return [sizeX].concat(size0);
}
}
else {
return [sizeX];
}
}
else {
return [];
}
}
/**
* Calculate the size of a multi dimensional array.
* All elements in the array are checked for matching dimensions using the
* method validate
* @param {Array} x
* @Return {Number[]} size
* @throws RangeError
*/
util.size = function size (x) {
// calculate the size
var s = _size(x);
// verify the size
util.validate(x, s);
return s;
};
/**
* Recursively validate whether each element in a multi dimensional array
* has a size corresponding to the provided size array.
* @param {Array} array Array to be validated
* @param {Number[]} size Array with the size of each dimension
* @param {Number} dim Current dimension
* @throws RangeError
*/
function _validate(array, size, dim) {
var i;
var len = array.length;
if (len != size[dim]) {
throw new RangeError('Dimension mismatch (' + len + ' != ' + size[dim] + ')');
}
if (dim < size.length - 1) {
// recursively validate each child array
var dimNext = dim + 1;
for (i = 0; i < len; i++) {
var child = array[i];
if (!(child instanceof Array)) {
throw new RangeError('Dimension mismatch ' +
'(' + (size.length - 1) + ' < ' + size.length + ')');
}
_validate(array[i], size, dimNext);
}
}
else {
// last dimension. none of the childs may be an array
for (i = 0; i < len; i++) {
if (array[i] instanceof Array) {
throw new RangeError('Dimension mismatch ' +
'(' + (size.length + 1) + ' > ' + size.length + ')');
}
}
}
}
/**
* Recursively validate whether each array in a multi dimensional array
* is empty (zero size) and has the correct number dimensions.
* @param {Array} array Array to be validated
* @param {Number[]} size Array with the size of each dimension
* @param {Number} dim Current dimension
* @throws RangeError
*/
function _validateEmpty(array, size, dim) {
if (dim < size.length - 1) {
var child = array[0];
if (array.length != 1 || !(child instanceof Array)) {
throw new RangeError('Dimension mismatch ' + '(' + array.length + ' > 0)');
}
_validateEmpty(child, size, dim + 1);
}
else {
// last dimension. test if empty
if (array.length) {
throw new RangeError('Dimension mismatch ' + '(' + array.length + ' > 0)');
}
}
}
/**
* Validate whether each element in a multi dimensional array has
* a size corresponding to the provided size array.
* @param {Array} array Array to be validated
* @param {Number[]} size Array with the size of each dimension
* @throws RangeError
*/
util.validate = function validate(array, size) {
var isScalar = (size.length == 0);
if (isScalar) {
// scalar
if (array instanceof Array) {
throw new RangeError('Dimension mismatch (' + array.length + ' != 0)');
}
return;
}
var hasZeros = (size.indexOf(0) != -1);
if (hasZeros) {
// array where all dimensions are zero
size.forEach(function (value) {
if (value != 0) {
throw new RangeError('Invalid size, all dimensions must be ' +
'either zero or non-zero (size: ' + util.formatArray(size) + ')');
}
});
_validateEmpty(array, size, 0);
}
else {
_validate(array, size, 0);
}
};
/**
* Test whether index is an integer number with index >= 1 and index <= max
* @param {*} index One-based index
* @param {Number} [max] One-based maximum value
*/
util.validateIndex = function validateIndex (index, max) {
if (!isNumber(index) || !isInteger(index)) {
throw new TypeError('Index must be an integer (value: ' + index + ')');
}
if (index < 1) {
throw new RangeError('Index out of range (' + index + ' < 1)');
}
if (max && index > max) {
throw new RangeError('Index out of range (' + index + ' > ' + max + ')');
}
};
/**
* Recursively resize a multi dimensional array
* @param {Array} array Array to be resized
* @param {Number[]} size Array with the size of each dimension
* @param {Number} dim Current dimension
* @param {*} [defaultValue] Value to be filled in in new entries,
* 0 by default.
* @private
*/
function _resize (array, size, dim, defaultValue) {
if (!(array instanceof Array)) {
throw new TypeError('Array expected');
}
var len = array.length,
newLen = size[dim];
if (len != newLen) {
if(newLen > array.length) {
// enlarge
for (var i = array.length; i < newLen; i++) {
array[i] = defaultValue ? math.clone(defaultValue) : 0;
}
}
else {
// shrink
array.length = size[dim];
}
len = array.length;
}
if (dim < size.length - 1) {
// recursively validate each child array
var dimNext = dim + 1;
for (i = 0; i < len; i++) {
child = array[i];
if (!(child instanceof Array)) {
child = [child];
array[i] = child;
}
_resize(child, size, dimNext, defaultValue);
}
}
else {
// last dimension
for (i = 0; i < len; i++) {
var child = array[i];
while (child instanceof Array) {
child = child[0];
}
array[i] = child;
}
}
}
/**
* Resize a multi dimensional array
* @param {Array} array Array to be resized
* @param {Number[]} size Array with the size of each dimension
* @param {*} [defaultValue] Value to be filled in in new entries,
* 0 by default
*/
util.resize = function resize(array, size, defaultValue) {
// TODO: what to do with scalars, when size=[] ?
// check the type of size
if (!(size instanceof Array)) {
throw new TypeError('Size must be an array (size is ' + math['typeof'](size) + ')');
}
// check whether size contains positive integers
size.forEach(function (value) {
if (!isNumber(value) || !isInteger(value) || value < 0) {
throw new TypeError('Invalid size, must contain positive integers ' +
'(size: ' + util.formatArray(size) + ')');
}
});
var hasZeros = (size.indexOf(0) != -1);
if (hasZeros) {
// array where all dimensions are zero
size.forEach(function (value) {
if (value != 0) {
throw new RangeError('Invalid size, all dimensions must be ' +
'either zero or non-zero (size: ' + util.formatArray(size) + ')');
}
});
}
// recursively resize
_resize(array, size, 0, defaultValue);
};
return util;
})();
/**
* Utility functions for Booleans
*/
/**
* Test whether value is a Boolean
* @param {*} value
* @return {Boolean} isBoolean
*/
function isBoolean(value) {
return (value instanceof Boolean) || (typeof value == 'boolean');
}
/**
* @constructor Complex
*
* A complex value can be constructed in the following ways:
* var a = new Complex();
* var b = new Complex(re, im);
* var c = Complex.parse(str);
*
* Example usage:
* var a = new Complex(3, -4); // 3 - 4i
* a.re = 5; // a = 5 - 4i
* var i = a.im; // -4;
* var b = Complex.parse('2 + 6i'); // 2 + 6i
* var c = new Complex(); // 0 + 0i
* var d = math.add(a, b); // 5 + 2i
*
* @param {Number} re The real part of the complex value
* @param {Number} [im] The imaginary part of the complex value
*/
function Complex(re, im) {
if (!(this instanceof Complex)) {
throw new SyntaxError(
'Complex constructor must be called with the new operator');
}
switch (arguments.length) {
case 0:
this.re = 0;
this.im = 0;
break;
case 2:
if (!isNumber(re) || !isNumber(im)) {
throw new TypeError(
'Two numbers expected in Complex constructor');
}
this.re = re;
this.im = im;
break;
default:
if (arguments.length != 0 && arguments.length != 2) {
throw new SyntaxError(
'Two or zero arguments expected in Complex constructor');
}
break;
}
}
math.type.Complex = Complex;
// Complex parser methods in a closure
(function () {
var text, index, c;
function skipWhitespace() {
while (c == ' ' || c == '\t') {
next();
}
}
function isDigitDot (c) {
return ((c >= '0' && c <= '9') || c == '.');
}
function isDigit (c) {
return ((c >= '0' && c <= '9'));
}
function next() {
index++;
c = text.charAt(index);
}
function revert(oldIndex) {
index = oldIndex;
c = text.charAt(index);
}
function parseNumber () {
var number = '';
var oldIndex;
oldIndex = index;
if (c == '+') {
next();
}
else if (c == '-') {
number += c;
next();
}
if (!isDigitDot(c)) {
// a + or - must be followed by a digit
revert(oldIndex);
return null;
}
// get number, can have a single dot
if (c == '.') {
number += c;
next();
if (!isDigit(c)) {
// this is no legal number, it is just a dot
revert(oldIndex);
return null;
}
}
else {
while (isDigit(c)) {
number += c;
next();
}
if (c == '.') {
number += c;
next();
}
}
while (isDigit(c)) {
number += c;
next();
}
// check for scientific notation like "2.3e-4" or "1.23e50"
if (c == 'E' || c == 'e') {
number += c;
next();
if (c == '+' || c == '-') {
number += c;
next();
}
// Scientific notation MUST be followed by an exponent
if (!isDigit(c)) {
// this is no legal number, exponent is missing.
revert(oldIndex);
return null;
}
while (isDigit(c)) {
number += c;
next();
}
}
return number;
}
function parseComplex () {
// check for 'i', '-i', '+i'
var cnext = text.charAt(index + 1);
if (c == 'I' || c == 'i') {
next();
return '1';
}
else if ((c == '+' || c == '-') && (cnext == 'I' || cnext == 'i')) {
var number = (c == '+') ? '1' : '-1';
next();
next();
return number;
}
return null;
}
/**
* Create a complex number from a provided real and imaginary number.
* When the imaginary part is zero, a real number is returned instead of
* a complex number. For example:
* Complex.create(2, 3); // returns a Complex(2, 3)
* Complex.create(2, 0); // returns a Number 2
*
* @param {Number} re
* @param {Number} im
* @return {Complex | Number} value
*/
Complex.create = function (re, im) {
if (im == 0) {
return re;
}
else {
return new Complex(re, im);
}
};
/**
* Parse a complex number from a string. For example Complex.parse("2 + 3i")
* will return a Complex value where re = 2, im = 3.
* Returns null if provided string does not contain a valid complex number.
* @param {String} str
* @returns {Complex | null} complex
*/
Complex.parse = function parse(str) {
text = str;
index = -1;
c = '';
if (!isString(text)) {
return null;
}
next();
skipWhitespace();
var first = parseNumber();
if (first) {
if (c == 'I' || c == 'i') {
// pure imaginary number
next();
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
return new Complex(0, Number(first));
}
else {
// complex and real part
skipWhitespace();
var separator = c;
if (separator != '+' && separator != '-') {
// pure real number
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
return new Complex(Number(first), 0);
}
else {
// complex and real part
next();
skipWhitespace();
var second = parseNumber();
if (second) {
if (c != 'I' && c != 'i') {
// 'i' missing at the end of the complex number
return null;
}
next();
}
else {
second = parseComplex();
if (!second) {
// imaginary number missing after separator
return null;
}
}
if (separator == '-') {
if (second[0] == '-') {
second = '+' + second.substring(1);
}
else {
second = '-' + second;
}
}
next();
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
return new Complex(Number(first), Number(second));
}
}
}
else {
// check for 'i', '-i', '+i'
first = parseComplex();
if (first) {
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
return new Complex(0, Number(first));
}
}
return null;
};
})();
/**
* Test whether value is a Complex value
* @param {*} value
* @return {Boolean} isComplex
*/
function isComplex(value) {
return (value instanceof Complex);
}
/**
* Create a copy of the complex value
* @return {Complex} clone
*/
Complex.prototype.clone = function () {
return new Complex(this.re, this.im);
};
/**
* Get string representation of the Complex value
* @return {String} str
*/
Complex.prototype.toString = function () {
var str = '';
var strRe = util.formatNumber(this.re, math.options.precision);
var strIm = util.formatNumber(this.im, math.options.precision);
if (this.im == 0) {
// real value
str = strRe;
}
else if (this.re == 0) {
// purely complex value
if (this.im == 1) {
str = 'i';
}
else if (this.im == -1) {
str = '-i';
}
else {
str = strIm + 'i';
}
}
else {
// complex value
if (this.im > 0) {
if (this.im == 1) {
str = strRe + ' + i';
}
else {
str = strRe + ' + ' + strIm + 'i';
}
}
else {
if (this.im == -1) {
str = strRe + ' - i';
}
else {
str = strRe + ' - ' +
util.formatNumber(Math.abs(this.im), math.options.precision) + 'i';
}
}
}
return str;
};
/**
* Documentation object
* @param {Object} doc Object containing properties:
* {String} name
* {String} category
* {String[]} syntax
* {String[]} examples
* {String[]} seealso
* @constructor
*/
function Help (doc) {
if (doc) {
util.extend(this, doc);
}
}
math.type.Help = Help;
/**
* Generate readable description from a Help object
* @return {String} readableDoc
* @private
*/
Help.prototype.toString = function () {
var desc = '';
if (this.name) {
desc += 'NAME\n' + this.name + '\n\n';
}
if (this.category) {
desc += 'CATEGORY\n' + this.category + '\n\n';
}
if (this.syntax) {
desc += 'SYNTAX\n' + this.syntax.join('\n') + '\n\n';
}
if (this.examples) {
var parser = math.parser();
desc += 'EXAMPLES\n';
for (var i = 0; i < this.examples.length; i++) {
var expr = this.examples[i];
var res;
try {
res = parser.eval(expr);
}
catch (e) {
res = e;
}
desc += expr + '\n';
desc += ' ' + math.format(res) + '\n';
}
desc += '\n';
}
if (this.seealso) {
desc += 'SEE ALSO\n' + this.seealso.join(', ') + '\n';
}
return desc;
};
// TODO: implement a toHTML function in Help
/**
* Export the help object to JSON
*/
Help.prototype.toJSON = function () {
return util.extend({}, this);
};
/**
* @constructor Matrix
*
* A Matrix is a wrapper around an Array. A matrix can hold a multi dimensional
* array. A matrix can be constructed as:
* var matrix = new Matrix(data)
*
* Matrix contains the functions to resize, get and set values, get the size,
* clone the matrix and to convert the matrix to a vector, array, or scalar.
* Furthermore, one can iterate over the matrix using map and forEach.
* The internal Array of the Matrix can be accessed using the method valueOf.
*
* Example usage:
* var matrix = new Matrix([[1, 2], [3, 4]);
* matix.size(); // [2, 2]
* matrix.resize([3, 2], 5);
* matrix.valueOf(); // [[1, 2], [3, 4], [5, 5]]
* matrix.get([2,1]) // 3
*
* @param {Array | Matrix} [data] A multi dimensional array
*/
function Matrix(data) {
if (!(this instanceof Matrix)) {
throw new SyntaxError(
'Matrix constructor must be called with the new operator');
}
if (data instanceof Matrix || data instanceof Range) {
// clone data from a Matrix or Range
this._data = data.toArray();
}
else if (data instanceof Array) {
// use array as is
this._data = data;
}
else if (data != null) {
// unsupported type
throw new TypeError('Unsupported type of data (' + math['typeof'](data) + ')');
}
else {
// nothing provided
this._data = [];
}
// verify the size of the array
this._size = util.size(this._data);
}
math.type.Matrix = Matrix;
/**
* Get a value or a submatrix of the matrix.
* @param {Array | Matrix} index One-based index
*/
Matrix.prototype.get = function (index) {
var isScalar;
if (index instanceof Matrix) {
// index is scalar when size==[n] or size==[1,1,...]
isScalar = (index.size().length == 1) || !index.size().some(function (i) {
return (i != 1);
});
index = index.valueOf();
}
else if (index instanceof Array) {
isScalar = !index.some(function (elem) {
var size = math.size(elem);
return (size.length != 0) && (size != [1]);
});
}
else {
throw new TypeError('Invalid index');
}
if (index.length != this._size.length) {
throw new RangeError('Dimension mismatch ' +
'(' + index.length + ' != ' + this._size.length + ')');
}
if (isScalar) {
// return a single value
switch (index.length) {
case 1: return _get(this._data, index[0]);
case 2: return _get(_get(this._data, index[0]), index[1]);
default: return _getScalar(this._data, index);
}
}
else {
// return a submatrix
switch (index.length) {
case 1: return new Matrix(_getSubmatrix1D(this._data, index));
case 2: return new Matrix(_getSubmatrix2D(this._data, index));
default: return new Matrix(_getSubmatrix(this._data, index, 0));
}
// TODO: more efficient when creating an empty matrix and setting _data and _size manually
}
};
/**
* Get a single value from an array. The method tests whether:
* - index is a non-negative integer
* - index does not exceed the dimensions of array
* @param {Array} array
* @param {Number} index One-based index
* @return {*} value
* @private
*/
function _get (array, index) {
util.validateIndex(index, array.length);
return array[index - 1]; // one-based index
}
/**
* Get a single value from the matrix. The value will be a copy of the original
* value in the matrix.
* Index is not checked for correct number of dimensions.
* @param {Array} data
* @param {Number[]} index One-based index
* @return {*} scalar
* @private
*/
function _getScalar (data, index) {
index.forEach(function (i) {
data = _get(data, i);
});
return math.clone(data);
}
/**
* Get a submatrix of a one dimensional matrix.
* Index is not checked for correct number of dimensions.
* @param {Array} data
* @param {Array} index One-based index
* @return {Array} submatrix
* @private
*/
function _getSubmatrix1D (data, index) {
var current = index[0];
if (current.map) {
// array or Range
return current.map(function (i) {
return _get(data, i);
});
}
else {
// scalar
return [
_get(data, current)
];
}
}
/**
* Get a submatrix of a 2 dimensional matrix.
* Index is not checked for correct number of dimensions.
* @param {Array} data
* @param {Array} index One-based index
* @return {Array} submatrix
* @private
*/
function _getSubmatrix2D (data, index) {
var rows = index[0];
var cols = index[1];
if (rows.map) {
if (cols.map) {
return rows.map(function (row) {
var child = _get(data, row);
return cols.map(function (col) {
return _get(child, col);
});
});
}
else {
return rows.map(function (row) {
return [
_get(_get(data, row), cols)
];
});
}
}
else {
if (cols.map) {
var child = _get(data, rows);
return [
cols.map(function (col) {
return _get(child, col);
})
]
}
else {
return [
[
_get(_get(data, rows), cols)
]
];
}
}
}
/**
* Get a submatrix of a multi dimensional matrix.
* Index is not checked for correct number of dimensions.
* @param {Array} data
* @param {Array} index One-based index
* @param {number} dim
* @return {Array} submatrix
* @private
*/
function _getSubmatrix (data, index, dim) {
var last = (dim == index.length - 1);
var current = index[dim];
var recurse = function (i) {
var child = _get(data, i);
return last ? child : _getSubmatrix(child, index, dim + 1);
};
if (current.map) {
// array or Range
return current.map(recurse);
}
else {
// scalar
return [
recurse(current)
];
}
}
/**
* Replace a value or a submatrix in the matrix.
* Indexes are one-based.
* @param {Array | Matrix} index One-based index
* @param {*} submatrix
* @return {Matrix} itself
*/
Matrix.prototype.set = function (index, submatrix) {
var isScalar;
if (index instanceof Matrix) {
// index is scalar when size==[n] or size==[1,1,...]
isScalar = (index.size().length == 1) || !index.size().some(function (i) {
return (i != 1);
});
index = index.valueOf();
}
else if (index instanceof Array) {
isScalar = !index.some(function (elem) {
var size = math.size(elem);
return (size.length != 0) && (size != [1]);
});
}
else {
throw new TypeError('Invalid index');
}
if (submatrix instanceof Matrix || submatrix instanceof Range) {
submatrix = submatrix.valueOf();
}
if (index.length < this._size.length) {
throw new RangeError('Dimension mismatch ' +
'(' + index.length + ' != ' + this._size.length + ')');
}
if (isScalar) {
// set a scalar
// check whether submatrix is no matrix/array
if (math.size(submatrix).valueOf().length != 0) {
throw new TypeError('Scalar value expected');
}
switch (index.length) {
case 1: _setScalar1D(this._data, this._size, index, submatrix); break;
case 2: _setScalar2D(this._data, this._size, index, submatrix); break;
default: _setScalar(this._data, this._size, index, submatrix); break;
}
}
else {
// set a submatrix
var size = this._size.concat();
_setSubmatrix (this._data, size, index, 0, submatrix);
if (!util.deepEqual(this._size, size)) {
_init(this._data);
this.resize(size);
}
}
return this;
};
/**
* Replace a single value in an array. The method tests whether index is a
* non-negative integer
* @param {Array} array
* @param {Number} index One-based index
* @param {*} value
* @private
*/
function _set (array, index, value) {
util.validateIndex(index);
if (value instanceof Array) {
throw new TypeError('Dimension mismatch, value expected instead of array');
}
array[index - 1] = value; // one-based index
}
/**
* Replace a single value in a multi dimensional matrix
* @param {Array} data
* @param {Number[]} size
* @param {Number[]} index One-based index
* @param {*} value
* @private
*/
function _setScalar (data, size, index, value) {
var resized = false;
if (index.length > size.length) {
// dimension added
resized = true;
}
for (var i = 0; i < index.length; i++) {
var index_i = index[i];
util.validateIndex(index_i);
if ((size[i] == null) || (index_i > size[i])) {
size[i] = index_i;
resized = true;
}
}
if (resized) {
util.resize(data, size, 0);
}
var len = size.length;
index.forEach(function (v, i) {
if (i < len - 1) {
data = data[v - 1]; // one-based index
}
else {
data[v - 1] = value; // one-based index
}
});
}
/**
* Replace a single value in a one dimensional matrix
* @param {Array} data
* @param {Number[]} size
* @param {Number[]} index One-based index
* @param {*} value
* @private
*/
function _setScalar1D (data, size, index, value) {
var row = index[0];
util.validateIndex(row);
if (row > size[0]) {
util.resize(data, [row], 0);
size[0] = row;
}
data[row - 1] = value; // one-based index
}
/**
* Replace a single value in a two dimensional matrix
* @param {Array} data
* @param {Number[]} size
* @param {Number[]} index One-based index
* @param {*} value
* @private
*/
function _setScalar2D (data, size, index, value) {
var row = index[0];
var col = index[1];
util.validateIndex(row);
util.validateIndex(col);
var resized = false;
if (row > (size[0] || 0)) {
size[0] = row;
resized = true;
}
if (col > (size[1] || 0)) {
size[1] = col;
resized = true;
}
if (resized) {
util.resize(data, size, 0);
}
data[row - 1][col - 1] = value; // one-based index
}
/**
* Replace a submatrix of a multi dimensional matrix.
* @param {Array} data
* @param {Array} size
* @param {Array} index One-based index
* @param {number} dim
* @param {Array} submatrix
* @private
*/
function _setSubmatrix (data, size, index, dim, submatrix) {
var last = (dim == index.length - 1);
var current = index[dim];
var recurse = function (dataIndex, subIndex) {
if (last) {
_set(data, dataIndex, submatrix[subIndex]);
if (dataIndex > (size[dim] || 0)) {
size[dim] = dataIndex;
}
}
else {
var child = data[dataIndex - 1]; // one-based index
if (!(child instanceof Array)) {
data[dataIndex - 1] = child = [child]; // one-based index
}
if (dataIndex > (size[dim] || 0)) {
size[dim] = dataIndex;
}
_setSubmatrix(child, size, index, dim + 1, submatrix[subIndex]);
}
};
if (current.map) {
// array or Range
var len = (current.size && current.size() || current.length);
if (len != submatrix.length) {
throw new RangeError('Dimensions mismatch ' +
'(' + len + ' != '+ submatrix.length + ')');
}
current.map(recurse);
}
else {
// scalar
recurse(current, 0)
}
}
/**
* Recursively initialize all undefined values in the array with zeros
* @param array
* @private
*/
function _init(array) {
for (var i = 0, len = array.length; i < len; i++) {
var value = array[i];
if (value instanceof Array) {
_init(value);
}
else if (value == undefined) {
array[i] = 0;
}
}
}
/**
* Resize the matrix
* @param {Number[]} size
* @param {*} [defaultValue] Default value, filled in on new entries.
* If not provided, the vector will be filled
* with zeros.
*/
Matrix.prototype.resize = function (size, defaultValue) {
util.resize(this._data, size, defaultValue);
this._size = math.clone(size);
};
/**
* Create a clone of the matrix
* @return {Matrix} clone
*/
Matrix.prototype.clone = function () {
var matrix = new Matrix();
matrix._data = math.clone(this._data);
matrix._size = math.clone(this._size);
return matrix;
};
/**
* Retrieve the size of the matrix.
* The size of the matrix will be validated too
* @returns {Number[]} size
*/
Matrix.prototype.size = function () {
return this._size;
};
/**
* Create a new matrix with the results of the callback function executed on
* each entry of the matrix.
* @param {function} callback The callback method is invoked with three
* parameters: the value of the element, the index
* of the element, and the Matrix being traversed.
* @return {Matrix} matrix
*/
Matrix.prototype.map = function (callback) {
var me = this;
var matrix = new Matrix();
var index = [];
var recurse = function (value, dim) {
if (value instanceof Array) {
return value.map(function (child, i) {
index[dim] = i + 1; // one-based index
return recurse(child, dim + 1);
});
}
else {
return callback(value, index, me);
}
};
matrix._data = recurse(this._data, 0);
matrix._size = math.clone(this._size);
return matrix;
};
/**
* Execute a callback method on each entry of the matrix.
* @param {function} callback The callback method is invoked with three
* parameters: the value of the element, the index
* of the element, and the Matrix being traversed.
*/
Matrix.prototype.forEach = function (callback) {
var me = this;
var index = [];
var recurse = function (value, dim) {
if (value instanceof Array) {
value.forEach(function (child, i) {
index[dim] = i + 1; // one-based index
recurse(child, dim + 1);
});
}
else {
callback(value, index, me);
}
};
recurse(this._data, 0);
};
/**
* Create a scalar with a copy of the data of the Matrix
* Will return null if the matrix does not consist of a scalar value
* @return {* | null} scalar
*/
Matrix.prototype.toScalar = function () {
var scalar = this._data;
while (scalar instanceof Array && scalar.length == 1) {
scalar = scalar[0];
}
if (scalar instanceof Array) {
return null;
}
else {
return math.clone(scalar);
}
};
/**
* Test whether the matrix is a scalar.
* @return {boolean} isScalar
*/
Matrix.prototype.isScalar = function () {
return this._size.every(function (s) {
return (s <= 1);
});
};
/**
* Create a vector with a copy of the data of the Matrix
* Returns null if the Matrix does not contain a vector
*
* A matrix is a vector when it has 0 or 1 dimensions, or has multiple
* dimensions where maximum one of the dimensions has a size larger than 1.
* return {Array | null} vector
*/
Matrix.prototype.toVector = function () {
var count = 0;
var dim = undefined;
var index = [];
this._size.forEach(function (length, i) {
if (length > 1) {
count++;
dim = i;
}
index[i] = 0;
});
if (count == 0) {
// scalar or empty
var scalar = this.toScalar();
if (scalar) {
return [scalar];
}
else {
return [];
}
}
else if (count == 1) {
// valid vector
var vector = [];
var recurse = function (data) {
if (data instanceof Array) {
data.forEach(recurse);
}
else {
vector.push(data);
}
};
recurse(this._data);
return vector;
}
else {
// count > 1, this is no vector
return null;
}
};
/**
* Test if the matrix contains a vector.
* A matrix is a vector when it has 0 or 1 dimensions, or has multiple
* dimensions where maximum one of the dimensions has a size larger than 1.
* return {boolean} isVector
*/
Matrix.prototype.isVector = function () {
var count = 0;
this._size.forEach(function (length) {
if (length > 1) {
count++;
}
});
return (count <= 1);
};
/**
* Create an Array with a copy of the data of the Matrix
* @returns {Array} array
*/
Matrix.prototype.toArray = function () {
return math.clone(this._data);
};
/**
* Get the primitive value of the Matrix: a multidimensional array
* @returns {Array} array
*/
Matrix.prototype.valueOf = function () {
return this._data;
};
/**
* Get a string representation of the matrix
* @returns {String} str
*/
Matrix.prototype.toString = function () {
return math.format(this._data);
};
/**
* Utility functions for Numbers
*/
/**
* Test whether value is a Number
* @param {*} value
* @return {Boolean} isNumber
*/
function isNumber(value) {
return (value instanceof Number) || (typeof value == 'number');
}
/**
* Check if a number is integer
* @param {Number} value
* @return {Boolean} isInteger
*/
function isInteger(value) {
return (value == Math.round(value));
}
/**
* @constructor Range
* Create a range. A range works similar to an Array, with functions like
* forEach and map. However, a Range object is very cheap to create compared to
* a large Array with indexes, as it stores only a start, step and end value of
* the range.
*
* A range can be constructed as:
* var a = new Range(start, step, end);
*
* To get the result of the range:
* range.forEach(function (x) {
* console.log(x);
* });
* range.map(function (x) {
* return math.sin(x);
* });
* range.toArray();
*
* Example usage:
* var c = new Range(2, 1, 5); // 2:1:5
* c.toArray(); // [2, 3, 4, 5]
* var d = new Range(2, -1, -2); // 2:-1:-2
* d.toArray(); // [2, 1, 0, -1, -2]
*
* @param {Number} start
* @param {Number} step
* @param {Number} end
*/
function Range(start, step, end) {
if (!(this instanceof Range)) {
throw new SyntaxError(
'Range constructor must be called with the new operator');
}
if (start != null && !isNumber(start)) {
throw new TypeError('Parameter start must be a number');
}
if (end != null && !isNumber(end)) {
throw new TypeError('Parameter end must be a number');
}
if (step != null && !isNumber(step)) {
throw new TypeError('Parameter step must be a number');
}
this.start = (start != null) ? start : 0;
this.end = (end != null) ? end : 0;
this.step = (step != null) ? step : 1;
}
math.type.Range = Range;
/**
* Parse a string into a range,
* The string contains the start, optional step, and end, separated by a colon.
* If the string does not contain a valid range, null is returned.
* For example str='0:2:10'.
* @param {String} str
* @return {Range | null} range
*/
Range.parse = function (str) {
if (!isString(str)) {
return null;
}
var args = str.split(':');
var nums = args.map(function (arg) {
return Number(arg);
});
var invalid = nums.some(function (num) {
return isNaN(num);
});
if(invalid) {
return null;
}
switch (nums.length) {
case 2: return new Range(nums[0], 1, nums[1]);
case 3: return new Range(nums[0], nums[1], nums[2]);
default: return null;
}
};
/**
* Create a clone of the range
* @return {Range} clone
*/
Range.prototype.clone = function () {
return new Range(this.start, this.step, this.end);
};
/**
* Retrieve the size of the range.
* @returns {Number[]} size
*/
Range.prototype.size = function () {
var len = 0,
start = Number(this.start),
step = Number(this.step),
end = Number(this.end),
diff = end - start;
if (math.sign(step) == math.sign(diff)) {
len = Math.floor((diff) / step) + 1;
}
else if (diff == 0) {
len = 1;
}
if (isNaN(len)) {
len = 0;
}
return [len];
};
/**
* Execute a callback function for each value in the range.
* @param {function} callback The callback method is invoked with three
* parameters: the value of the element, the index
* of the element, and the Matrix being traversed.
*/
Range.prototype.forEach = function (callback) {
var x = Number(this.start);
var step = Number(this.step);
var end = Number(this.end);
var i = 0;
if (step > 0) {
while (x <= end) {
callback(x, i, this);
x += step;
i++;
}
}
else if (step < 0) {
while (x >= end) {
callback(x, i, this);
x += step;
i++;
}
}
};
/**
* Execute a callback function for each value in the Range, and return the
* results as an array
* @param {function} callback The callback method is invoked with three
* parameters: the value of the element, the index
* of the element, and the Matrix being traversed.
* @returns {Array} array
*/
Range.prototype.map = function (callback) {
var array = [];
this.forEach(function (value, index, obj) {
array[index] = callback(value, index, obj);
});
return array;
};
/**
* Create a Matrix with a copy of the Ranges data
* @return {Matrix} matrix
*/
Range.prototype.toMatrix = function () {
return new Matrix(this.toArray());
};
/**
* Create an Array with a copy of the Ranges data
* @returns {Array} array
*/
Range.prototype.toArray = function () {
var array = [];
this.forEach(function (value, index) {
array[index] = value;
});
return array;
};
/**
* Create an array with a copy of the Ranges data.
* This method is equal to Range.toArray, and is available for compatibility
* with Matrix.
* @return {Array} vector
*/
Range.prototype.toVector = Range.prototype.toArray;
/**
* Test if the range contains a vector. For a range, this is always the case
* return {boolean} isVector
*/
Range.prototype.isVector = function () {
return true;
};
/**
* Create a scalar with a copy of the data of the Range
* Will return null if the range does not consist of a scalar value
* @return {* | null} scalar
*/
Range.prototype.toScalar = function () {
var array = this.toArray();
if (array.length == 1) {
return array[0];
}
else {
return null;
}
};
/**
* Test whether the matrix is a scalar.
* @return {boolean} isScalar
*/
Range.prototype.isScalar = function () {
return (this.size()[0] == 1);
};
/**
* Get the primitive value of the Range, a one dimensional array
* @returns {Array} array
*/
Range.prototype.valueOf = function () {
// TODO: implement a caching mechanism for range.valueOf()
return this.toArray();
};
/**
* Get the string representation of the range, for example '2:5' or '0:0.2:10'
* @returns {String} str
*/
Range.prototype.toString = function () {
var str = math.format(Number(this.start));
if (this.step != 1) {
str += ':' + math.format(Number(this.step));
}
str += ':' + math.format(Number(this.end));
return str;
};
/**
* @constructor math.type.Selector
* Wrap any value in a Selector, allowing to perform chained operations on
* the value.
*
* All methods available in the math.js library can be called upon the selector,
* and then will be evaluated with the value itself as first argument.
* The selector can be closed by executing selector.done(), which will return
* the final value.
*
* The Selector has a number of special functions:
* - done() Finalize the chained operation and return the selectors value.
* - valueOf() The same as done()
* - toString() Executes math.format() onto the selectors value, returning
* a string representation of the value.
* - get(...) Get a subset of the selectors value. Useful for example for
* matrices and arrays.
* - set(...) Replace a subset of the selectors value. Useful for example for
* matrices and arrays.
*
* @param {*} [value]
*/
math.type.Selector = function Selector (value) {
if (!(this instanceof math.type.Selector)) {
throw new SyntaxError(
'Selector constructor must be called with the new operator');
}
if (value instanceof math.type.Selector) {
this.value = value.value;
}
else {
this.value = value || undefined;
}
};
math.type.Selector.prototype = {
/**
* Close the selector. Returns the final value.
* Does the same as method valueOf()
* @returns {*} value
*/
done: function () {
return this.value;
},
/**
* Get a submatrix or subselection from current value.
* Only applicable when the current value has a method get.
*/
get: function (index) {
var value = this.value;
if (!value) {
throw Error('Selector value is undefined');
}
return new math.type.Selector(math.subset(value, index));
},
/**
* Set a submatrix or subselection on current value.
* Only applicable when the current value has a method set.
*/
set: function (index, replacement) {
var value = this.value;
if (!value) {
throw Error('Selector value is undefined');
}
return new math.type.Selector(math.subset(value, index, replacement));
},
/**
* Close the selector. Returns the final value.
* Does the same as method done()
* @returns {*} value
*/
valueOf: function () {
return this.value;
},
/**
* Get the string representation of the value in the selector
* @returns {String}
*/
toString: function () {
return math.format(this.value);
}
};
/**
* Create a proxy method for the selector
* @param {String} name
* @param {*} value The value or function to be proxied
*/
function createSelectorProxy(name, value) {
var Selector = math.type.Selector;
var slice = Array.prototype.slice;
if (typeof value === 'function') {
// a function
Selector.prototype[name] = function () {
var args = [this.value].concat(slice.call(arguments, 0));
return new Selector(value.apply(this, args));
}
}
else {
// a constant
Selector.prototype[name] = new Selector(value);
}
}
/**
* Utility functions for Strings
*/
/**
* Test whether value is a String
* @param {*} value
* @return {Boolean} isString
*/
function isString(value) {
return (value instanceof String) || (typeof value == 'string');
}
/**
* @constructor Unit
*
* A unit can be constructed in the following ways:
* var a = new Unit(value, unit);
* var b = new Unit(null, unit);
* var c = Unit.parse(str);
*
* Example usage:
* var a = new Unit(5, 'cm'); // 50 mm
* var b = Unit.parse('23 kg'); // 23 kg
* var c = math.in(a, new Unit(null, 'm'); // 0.05 m
*
* @param {Number} [value] A value like 5.2
* @param {String} [unit] A unit like "cm" or "inch"
*/
function Unit(value, unit) {
if (!(this instanceof Unit)) {
throw new Error('Unit constructor must be called with the new operator');
}
if (value != null && !isNumber(value)) {
throw new TypeError('First parameter in Unit constructor must be a number');
}
if (unit != null && !isString(unit)) {
throw new TypeError('Second parameter in Unit constructor must be a string');
}
if (unit != null) {
// find the unit and prefix from the string
var res = _findUnit(unit);
if (!res) {
throw new SyntaxError('String "' + unit + '" is no unit');
}
this.unit = res.unit;
this.prefix = res.prefix;
}
else {
this.unit = Unit.UNIT_NONE;
this.prefix = Unit.PREFIX_NONE; // link to a list with supported prefixes
}
if (value != null) {
this.value = this._normalize(value);
this.fixPrefix = false; // is set true by the methods Unit.in and math.in
}
else {
this.value = null;
this.fixPrefix = true;
}
}
math.type.Unit = Unit;
(function() {
var text, index, c;
function skipWhitespace() {
while (c == ' ' || c == '\t') {
next();
}
}
function isDigitDot (c) {
return ((c >= '0' && c <= '9') || c == '.');
}
function isDigit (c) {
return ((c >= '0' && c <= '9'));
}
function next() {
index++;
c = text.charAt(index);
}
function revert(oldIndex) {
index = oldIndex;
c = text.charAt(index);
}
function parseNumber () {
var number = '';
var oldIndex;
oldIndex = index;
if (c == '+') {
next();
}
else if (c == '-') {
number += c;
next();
}
if (!isDigitDot(c)) {
// a + or - must be followed by a digit
revert(oldIndex);
return null;
}
// get number, can have a single dot
if (c == '.') {
number += c;
next();
if (!isDigit(c)) {
// this is no legal number, it is just a dot
revert(oldIndex);
return null;
}
}
else {
while (isDigit(c)) {
number += c;
next();
}
if (c == '.') {
number += c;
next();
}
}
while (isDigit(c)) {
number += c;
next();
}
// check for scientific notation like "2.3e-4" or "1.23e50"
if (c == 'E' || c == 'e') {
number += c;
next();
if (c == '+' || c == '-') {
number += c;
next();
}
// Scientific notation MUST be followed by an exponent
if (!isDigit(c)) {
// this is no legal number, exponent is missing.
revert(oldIndex);
return null;
}
while (isDigit(c)) {
number += c;
next();
}
}
return number;
}
function parseUnit() {
var unit = '';
skipWhitespace();
while (c && c != ' ' && c != '\t') {
unit += c;
next();
}
return unit || null;
}
/**
* Parse a string into a unit. Returns null if the provided string does not
* contain a valid unit.
* @param {String} str A string like "5.2 inch", "4e2 kg"
* @return {Unit | null} unit
*/
Unit.parse = function parse(str) {
text = str;
index = -1;
c = '';
if (!isString(text)) {
return null;
}
next();
skipWhitespace();
var value = parseNumber();
var unit;
if (value) {
unit = parseUnit();
next();
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
if (value && unit) {
return new Unit(Number(value), unit);
}
}
else {
unit = parseUnit();
next();
skipWhitespace();
if (c) {
// garbage at the end. not good.
return null;
}
return new Unit(null, unit)
}
return null;
};
})();
/**
* Test whether value is of type Unit
* @param {*} value
* @return {Boolean} isUnit
*/
function isUnit(value) {
return (value instanceof Unit);
}
/**
* create a copy of this unit
* @return {Unit} clone
*/
Unit.prototype.clone = function () {
var clone = new Unit();
for (var p in this) {
if (this.hasOwnProperty(p)) {
clone[p] = this[p];
}
}
return clone;
};
/**
* Normalize a value, based on its currently set unit
* @param {Number} value
* @return {Number} normalized value
* @private
*/
Unit.prototype._normalize = function(value) {
return (value + this.unit.offset) *
this.unit.value * this.prefix.value;
};
/**
* Unnormalize a value, based on its currently set unit
* @param {Number} value
* @param {Number} [prefixValue] Optional prefix value to be used
* @return {Number} unnormalized value
* @private
*/
Unit.prototype._unnormalize = function (value, prefixValue) {
if (prefixValue == undefined) {
return value / this.unit.value / this.prefix.value -
this.unit.offset;
}
else {
return value / this.unit.value / prefixValue -
this.unit.offset;
}
};
/**
* Find a unit from a string
* @param {String} str A string like 'cm' or 'inch'
* @returns {Object | null} result When found, an object with fields unit and
* prefix is returned. Else, null is returned.
* @private
*/
function _findUnit(str) {
var UNITS = Unit.UNITS;
for (var i = 0, iMax = UNITS.length; i < iMax; i++) {
var UNIT = UNITS[i];
if (util.endsWith(str, UNIT.name) ) {
var prefixLen = (str.length - UNIT.name.length);
var prefixName = str.substring(0, prefixLen);
var prefix = UNIT.prefixes[prefixName];
if (prefix !== undefined) {
// store unit, prefix, and value
return {
unit: UNIT,
prefix: prefix
};
}
}
}
return null;
}
/**
* Test if the given expression is a unit.
* The unit can have a prefix but cannot have a value.
* @param {String} unit A plain unit without value. Can have prefix, like "cm"
* @return {Boolean} true if the given string is a unit
*/
Unit.isPlainUnit = function (unit) {
return (_findUnit(unit) != null);
};
/**
* check if this unit has given base unit
* @param {Unit.BASE_UNITS} base
*/
Unit.prototype.hasBase = function(base) {
if (this.unit.base === undefined) {
return (base === undefined);
}
return (this.unit.base === base);
};
/**
* Check if this unit has a base equal to another base
* @param {Unit} other
* @return {Boolean} true if equal base
*/
Unit.prototype.equalBase = function(other) {
return (this.unit.base === other.unit.base);
};
/**
* Check if this unit equals another unit
* @param {Unit} other
* @return {Boolean} true if both units are equal
*/
Unit.prototype.equals = function(other) {
return (this.equalBase(other) && this.value == other.value);
};
/**
* Create a clone of this unit with a representation
* @param {String | Unit} plainUnit A plain unit, without value. Can have prefix, like "cm"
* @returns {Unit} unit having fixed, specified unit
*/
Unit.prototype['in'] = function (plainUnit) {
var other;
if (isString(plainUnit)) {
other = new Unit(null, plainUnit);
if (!this.equalBase(other)) {
throw new Error('Units do not match');
}
other.value = this.value;
return other;
}
else if (plainUnit instanceof Unit) {
if (!this.equalBase(plainUnit)) {
throw new Error('Units do not match');
}
if (plainUnit.value != null) {
throw new Error('Cannot convert to a unit with a value');
}
if (plainUnit.unit == null) {
throw new Error('Unit expected on the right hand side of function in');
}
other = plainUnit.clone();
other.value = this.value;
other.fixPrefix = true;
return other;
}
else {
throw new Error('String or Unit expected as parameter');
}
};
/**
* Return the value of the unit when represented with given plain unit
* @param {String | Unit} plainUnit For example 'cm' or 'inch'
* @return {Number} value
*/
Unit.prototype.toNumber = function (plainUnit) {
var other = this['in'](plainUnit);
var prefix = this.fixPrefix ? other._bestPrefix() : other.prefix;
return other._unnormalize(other.value, prefix.value);
};
/**
* Get string representation
* @return {String}
*/
Unit.prototype.toString = function() {
var value, str;
if (!this.fixPrefix) {
var bestPrefix = this._bestPrefix();
value = this._unnormalize(this.value, bestPrefix.value);
str = (this.value != null) ? util.formatNumber(value, math.options.precision) + ' ' : '';
str += bestPrefix.name + this.unit.name;
}
else {
value = this._unnormalize(this.value);
str = (this.value != null) ? util.formatNumber(value, math.options.precision) + ' ' : '';
str += this.prefix.name + this.unit.name;
}
return str;
};
/**
* Calculate the best prefix using current value.
* @returns {Object} prefix
* @private
*/
Unit.prototype._bestPrefix = function () {
// find the best prefix value (resulting in the value of which
// the absolute value of the log10 is closest to zero,
// though with a little offset of 1.2 for nicer values: you get a
// sequence 1mm 100mm 500mm 0.6m 1m 10m 100m 500m 0.6km 1km ...
var absValue = Math.abs(this.value / this.unit.value);
var bestPrefix = Unit.PREFIX_NONE;
var bestDiff = Math.abs(
Math.log(absValue / bestPrefix.value) / Math.LN10 - 1.2);
var prefixes = this.unit.prefixes;
for (var p in prefixes) {
if (prefixes.hasOwnProperty(p)) {
var prefix = prefixes[p];
if (prefix.scientific) {
var diff = Math.abs(
Math.log(absValue / prefix.value) / Math.LN10 - 1.2);
if (diff < bestDiff) {
bestPrefix = prefix;
bestDiff = diff;
}
}
}
}
return bestPrefix;
};
Unit.PREFIXES = {
'NONE': {
'': {'name': '', 'value': 1, 'scientific': true}
},
'SHORT': {
'': {'name': '', 'value': 1, 'scientific': true},
'da': {'name': 'da', 'value': 1e1, 'scientific': false},
'h': {'name': 'h', 'value': 1e2, 'scientific': false},
'k': {'name': 'k', 'value': 1e3, 'scientific': true},
'M': {'name': 'M', 'value': 1e6, 'scientific': true},
'G': {'name': 'G', 'value': 1e9, 'scientific': true},
'T': {'name': 'T', 'value': 1e12, 'scientific': true},
'P': {'name': 'P', 'value': 1e15, 'scientific': true},
'E': {'name': 'E', 'value': 1e18, 'scientific': true},
'Z': {'name': 'Z', 'value': 1e21, 'scientific': true},
'Y': {'name': 'Y', 'value': 1e24, 'scientific': true},
'd': {'name': 'd', 'value': 1e-1, 'scientific': false},
'c': {'name': 'c', 'value': 1e-2, 'scientific': false},
'm': {'name': 'm', 'value': 1e-3, 'scientific': true},
// 'µ': {'name': 'µ', 'value': 1e-6, 'scientific': true},
'u': {'name': 'u', 'value': 1e-6, 'scientific': true},
'n': {'name': 'n', 'value': 1e-9, 'scientific': true},
'p': {'name': 'p', 'value': 1e-12, 'scientific': true},
'f': {'name': 'f', 'value': 1e-15, 'scientific': true},
'a': {'name': 'a', 'value': 1e-18, 'scientific': true},
'z': {'name': 'z', 'value': 1e-21, 'scientific': true},
'y': {'name': 'y', 'value': 1e-24, 'scientific': true}
},
'LONG': {
'': {'name': '', 'value': 1, 'scientific': true},
'deca': {'name': 'deca', 'value': 1e1, 'scientific': false},
'hecto': {'name': 'hecto', 'value': 1e2, 'scientific': false},
'kilo': {'name': 'kilo', 'value': 1e3, 'scientific': true},
'mega': {'name': 'mega', 'value': 1e6, 'scientific': true},
'giga': {'name': 'giga', 'value': 1e9, 'scientific': true},
'tera': {'name': 'tera', 'value': 1e12, 'scientific': true},
'peta': {'name': 'peta', 'value': 1e15, 'scientific': true},
'exa': {'name': 'exa', 'value': 1e18, 'scientific': true},
'zetta': {'name': 'zetta', 'value': 1e21, 'scientific': true},
'yotta': {'name': 'yotta', 'value': 1e24, 'scientific': true},
'deci': {'name': 'deci', 'value': 1e-1, 'scientific': false},
'centi': {'name': 'centi', 'value': 1e-2, 'scientific': false},
'milli': {'name': 'milli', 'value': 1e-3, 'scientific': true},
'micro': {'name': 'micro', 'value': 1e-6, 'scientific': true},
'nano': {'name': 'nano', 'value': 1e-9, 'scientific': true},
'pico': {'name': 'pico', 'value': 1e-12, 'scientific': true},
'femto': {'name': 'femto', 'value': 1e-15, 'scientific': true},
'atto': {'name': 'atto', 'value': 1e-18, 'scientific': true},
'zepto': {'name': 'zepto', 'value': 1e-21, 'scientific': true},
'yocto': {'name': 'yocto', 'value': 1e-24, 'scientific': true}
},
'BINARY_SHORT': {
'': {'name': '', 'value': 1, 'scientific': true},
'k': {'name': 'k', 'value': 1024, 'scientific': true},
'M': {'name': 'M', 'value': Math.pow(1024, 2), 'scientific': true},
'G': {'name': 'G', 'value': Math.pow(1024, 3), 'scientific': true},
'T': {'name': 'T', 'value': Math.pow(1024, 4), 'scientific': true},
'P': {'name': 'P', 'value': Math.pow(1024, 5), 'scientific': true},
'E': {'name': 'E', 'value': Math.pow(1024, 6), 'scientific': true},
'Z': {'name': 'Z', 'value': Math.pow(1024, 7), 'scientific': true},
'Y': {'name': 'Y', 'value': Math.pow(1024, 8), 'scientific': true},
'Ki': {'name': 'Ki', 'value': 1024, 'scientific': true},
'Mi': {'name': 'Mi', 'value': Math.pow(1024, 2), 'scientific': true},
'Gi': {'name': 'Gi', 'value': Math.pow(1024, 3), 'scientific': true},
'Ti': {'name': 'Ti', 'value': Math.pow(1024, 4), 'scientific': true},
'Pi': {'name': 'Pi', 'value': Math.pow(1024, 5), 'scientific': true},
'Ei': {'name': 'Ei', 'value': Math.pow(1024, 6), 'scientific': true},
'Zi': {'name': 'Zi', 'value': Math.pow(1024, 7), 'scientific': true},
'Yi': {'name': 'Yi', 'value': Math.pow(1024, 8), 'scientific': true}
},
'BINARY_LONG': {
'': {'name': '', 'value': 1, 'scientific': true},
'kilo': {'name': 'kilo', 'value': 1024, 'scientific': true},
'mega': {'name': 'mega', 'value': Math.pow(1024, 2), 'scientific': true},
'giga': {'name': 'giga', 'value': Math.pow(1024, 3), 'scientific': true},
'tera': {'name': 'tera', 'value': Math.pow(1024, 4), 'scientific': true},
'peta': {'name': 'peta', 'value': Math.pow(1024, 5), 'scientific': true},
'exa': {'name': 'exa', 'value': Math.pow(1024, 6), 'scientific': true},
'zetta': {'name': 'zetta', 'value': Math.pow(1024, 7), 'scientific': true},
'yotta': {'name': 'yotta', 'value': Math.pow(1024, 8), 'scientific': true},
'kibi': {'name': 'kibi', 'value': 1024, 'scientific': true},
'mebi': {'name': 'mebi', 'value': Math.pow(1024, 2), 'scientific': true},
'gibi': {'name': 'gibi', 'value': Math.pow(1024, 3), 'scientific': true},
'tebi': {'name': 'tebi', 'value': Math.pow(1024, 4), 'scientific': true},
'pebi': {'name': 'pebi', 'value': Math.pow(1024, 5), 'scientific': true},
'exi': {'name': 'exi', 'value': Math.pow(1024, 6), 'scientific': true},
'zebi': {'name': 'zebi', 'value': Math.pow(1024, 7), 'scientific': true},
'yobi': {'name': 'yobi', 'value': Math.pow(1024, 8), 'scientific': true}
}
};
Unit.PREFIX_NONE = {'name': '', 'value': 1, 'scientific': true};
Unit.BASE_UNITS = {
'NONE': {},
'LENGTH': {}, // meter
'MASS': {}, // kilogram
'TIME': {}, // second
'CURRENT': {}, // ampere
'TEMPERATURE': {}, // kelvin
'LUMINOUS_INTENSITY': {}, // candela
'AMOUNT_OF_SUBSTANCE': {}, // mole
'FORCE': {}, // Newton
'SURFACE': {}, // m2
'VOLUME': {}, // m3
'ANGLE': {}, // rad
'BIT': {} // bit (digital)
};
var BASE_UNITS = Unit.BASE_UNITS;
var PREFIXES = Unit.PREFIXES;
Unit.BASE_UNIT_NONE = {};
Unit.UNIT_NONE = {'name': '', 'base': Unit.BASE_UNIT_NONE, 'value': 1, 'offset': 0};
Unit.UNITS = [
// length
{'name': 'meter', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
{'name': 'inch', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.0254, 'offset': 0},
{'name': 'foot', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.3048, 'offset': 0},
{'name': 'yard', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.9144, 'offset': 0},
{'name': 'mile', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 1609.344, 'offset': 0},
{'name': 'link', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.201168, 'offset': 0},
{'name': 'rod', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 5.029210, 'offset': 0},
{'name': 'chain', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 20.1168, 'offset': 0},
{'name': 'angstrom', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 1e-10, 'offset': 0},
{'name': 'm', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
//{'name': 'in', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.0254, 'offset': 0}, not supported, In is an operator
{'name': 'ft', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.3048, 'offset': 0},
{'name': 'yd', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.9144, 'offset': 0},
{'name': 'mi', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 1609.344, 'offset': 0},
{'name': 'li', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.201168, 'offset': 0},
{'name': 'rd', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 5.029210, 'offset': 0},
{'name': 'ch', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 20.1168, 'offset': 0},
{'name': 'mil', 'base': BASE_UNITS.LENGTH, 'prefixes': PREFIXES.NONE, 'value': 0.0000254, 'offset': 0}, // 1/1000 inch
// Surface
{'name': 'm2', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
{'name': 'sqin', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 0.00064516, 'offset': 0}, // 645.16 mm2
{'name': 'sqft', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 0.09290304, 'offset': 0}, // 0.09290304 m2
{'name': 'sqyd', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 0.83612736, 'offset': 0}, // 0.83612736 m2
{'name': 'sqmi', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 2589988.110336, 'offset': 0}, // 2.589988110336 km2
{'name': 'sqrd', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 25.29295, 'offset': 0}, // 25.29295 m2
{'name': 'sqch', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 404.6873, 'offset': 0}, // 404.6873 m2
{'name': 'sqmil', 'base': BASE_UNITS.SURFACE, 'prefixes': PREFIXES.NONE, 'value': 6.4516e-10, 'offset': 0}, // 6.4516 * 10^-10 m2
// Volume
{'name': 'm3', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
{'name': 'L', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.SHORT, 'value': 0.001, 'offset': 0}, // litre
{'name': 'litre', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.LONG, 'value': 0.001, 'offset': 0},
{'name': 'cuin', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 1.6387064e-5, 'offset': 0}, // 1.6387064e-5 m3
{'name': 'cuft', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.028316846592, 'offset': 0}, // 28.316 846 592 L
{'name': 'cuyd', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.764554857984, 'offset': 0}, // 764.554 857 984 L
{'name': 'teaspoon', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.000005, 'offset': 0}, // 5 mL
{'name': 'tablespoon', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.000015, 'offset': 0}, // 15 mL
//{'name': 'cup', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.000240, 'offset': 0}, // 240 mL // not possible, we have already another cup
// Liquid volume
{'name': 'minim', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.00000006161152, 'offset': 0}, // 0.06161152 mL
{'name': 'fluiddram', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0000036966911, 'offset': 0}, // 3.696691 mL
{'name': 'fluidounce', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.00002957353, 'offset': 0}, // 29.57353 mL
{'name': 'gill', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0001182941, 'offset': 0}, // 118.2941 mL
{'name': 'cup', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0002365882, 'offset': 0}, // 236.5882 mL
{'name': 'pint', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0004731765, 'offset': 0}, // 473.1765 mL
{'name': 'quart', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0009463529, 'offset': 0}, // 946.3529 mL
{'name': 'gallon', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.003785412, 'offset': 0}, // 3.785412 L
{'name': 'beerbarrel', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.1173478, 'offset': 0}, // 117.3478 L
{'name': 'oilbarrel', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.1589873, 'offset': 0}, // 158.9873 L
{'name': 'hogshead', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.2384810, 'offset': 0}, // 238.4810 L
//{'name': 'min', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.00000006161152, 'offset': 0}, // 0.06161152 mL // min is already in use as minute
{'name': 'fldr', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0000036966911, 'offset': 0}, // 3.696691 mL
{'name': 'floz', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.00002957353, 'offset': 0}, // 29.57353 mL
{'name': 'gi', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0001182941, 'offset': 0}, // 118.2941 mL
{'name': 'cp', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0002365882, 'offset': 0}, // 236.5882 mL
{'name': 'pt', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0004731765, 'offset': 0}, // 473.1765 mL
{'name': 'qt', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.0009463529, 'offset': 0}, // 946.3529 mL
{'name': 'gal', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.003785412, 'offset': 0}, // 3.785412 L
{'name': 'bbl', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.1173478, 'offset': 0}, // 117.3478 L
{'name': 'obl', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.1589873, 'offset': 0}, // 158.9873 L
//{'name': 'hogshead', 'base': BASE_UNITS.VOLUME, 'prefixes': PREFIXES.NONE, 'value': 0.2384810, 'offset': 0}, // 238.4810 L // TODO: hh?
// Mass
{'name': 'g', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.SHORT, 'value': 0.001, 'offset': 0},
{'name': 'gram', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.LONG, 'value': 0.001, 'offset': 0},
{'name': 'ton', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.SHORT, 'value': 907.18474, 'offset': 0},
{'name': 'tonne', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.SHORT, 'value': 1000, 'offset': 0},
{'name': 'grain', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 64.79891e-6, 'offset': 0},
{'name': 'dram', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 1.7718451953125e-3, 'offset': 0},
{'name': 'ounce', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 28.349523125e-3, 'offset': 0},
{'name': 'poundmass', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 453.59237e-3, 'offset': 0},
{'name': 'hundredweight', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 45.359237, 'offset': 0},
{'name': 'stick', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 115e-3, 'offset': 0},
{'name': 'gr', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 64.79891e-6, 'offset': 0},
{'name': 'dr', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 1.7718451953125e-3, 'offset': 0},
{'name': 'oz', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 28.349523125e-3, 'offset': 0},
{'name': 'lbm', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 453.59237e-3, 'offset': 0},
{'name': 'cwt', 'base': BASE_UNITS.MASS, 'prefixes': PREFIXES.NONE, 'value': 45.359237, 'offset': 0},
// Time
{'name': 's', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
{'name': 'min', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 60, 'offset': 0},
{'name': 'h', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 3600, 'offset': 0},
{'name': 'seconds', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
{'name': 'second', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
{'name': 'sec', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
{'name': 'minutes', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 60, 'offset': 0},
{'name': 'minute', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 60, 'offset': 0},
{'name': 'hours', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 3600, 'offset': 0},
{'name': 'hour', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 3600, 'offset': 0},
{'name': 'day', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 86400, 'offset': 0},
{'name': 'days', 'base': BASE_UNITS.TIME, 'prefixes': PREFIXES.NONE, 'value': 86400, 'offset': 0},
// Angles
{'name': 'rad', 'base': BASE_UNITS.ANGLE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
{'name': 'deg', 'base': BASE_UNITS.ANGLE, 'prefixes': PREFIXES.NONE, 'value': 0.017453292519943295769236907684888, 'offset': 0}, // deg = rad / (2*pi) * 360 = rad / 0.017453292519943295769236907684888
{'name': 'grad', 'base': BASE_UNITS.ANGLE, 'prefixes': PREFIXES.NONE, 'value': 0.015707963267948966192313216916399, 'offset': 0}, // grad = rad / (2*pi) * 400 = rad / 0.015707963267948966192313216916399
{'name': 'cycle', 'base': BASE_UNITS.ANGLE, 'prefixes': PREFIXES.NONE, 'value': 6.2831853071795864769252867665793, 'offset': 0}, // cycle = rad / (2*pi) = rad / 6.2831853071795864769252867665793
// Electric current
{'name': 'A', 'base': BASE_UNITS.CURRENT, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
{'name': 'ampere', 'base': BASE_UNITS.CURRENT, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
// Temperature
// K(C) = °C + 273.15
// K(F) = (°F + 459.67) / 1.8
// K(R) = °R / 1.8
{'name': 'K', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
{'name': 'degC', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 273.15},
{'name': 'degF', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1/1.8, 'offset': 459.67},
{'name': 'degR', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1/1.8, 'offset': 0},
{'name': 'kelvin', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
{'name': 'celsius', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 273.15},
{'name': 'fahrenheit', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1/1.8, 'offset': 459.67},
{'name': 'rankine', 'base': BASE_UNITS.TEMPERATURE, 'prefixes': PREFIXES.NONE, 'value': 1/1.8, 'offset': 0},
// amount of substance
{'name': 'mol', 'base': BASE_UNITS.AMOUNT_OF_SUBSTANCE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
{'name': 'mole', 'base': BASE_UNITS.AMOUNT_OF_SUBSTANCE, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
// luminous intensity
{'name': 'cd', 'base': BASE_UNITS.LUMINOUS_INTENSITY, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
{'name': 'candela', 'base': BASE_UNITS.LUMINOUS_INTENSITY, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
// TODO: units STERADIAN
//{'name': 'sr', 'base': BASE_UNITS.STERADIAN, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
//{'name': 'steradian', 'base': BASE_UNITS.STERADIAN, 'prefixes': PREFIXES.NONE, 'value': 1, 'offset': 0},
// Force
{'name': 'N', 'base': BASE_UNITS.FORCE, 'prefixes': PREFIXES.SHORT, 'value': 1, 'offset': 0},
{'name': 'newton', 'base': BASE_UNITS.FORCE, 'prefixes': PREFIXES.LONG, 'value': 1, 'offset': 0},
{'name': 'lbf', 'base': BASE_UNITS.FORCE, 'prefixes': PREFIXES.NONE, 'value': 4.4482216152605, 'offset': 0},
{'name': 'poundforce', 'base': BASE_UNITS.FORCE, 'prefixes': PREFIXES.NONE, 'value': 4.4482216152605, 'offset': 0},
// Binary
{'name': 'b', 'base': BASE_UNITS.BIT, 'prefixes': PREFIXES.BINARY_SHORT, 'value': 1, 'offset': 0},
{'name': 'bits', 'base': BASE_UNITS.BIT, 'prefixes': PREFIXES.BINARY_LONG, 'value': 1, 'offset': 0},
{'name': 'B', 'base': BASE_UNITS.BIT, 'prefixes': PREFIXES.BINARY_SHORT, 'value': 8, 'offset': 0},
{'name': 'bytes', 'base': BASE_UNITS.BIT, 'prefixes': PREFIXES.BINARY_LONG, 'value': 8, 'offset': 0}
];
/**
* mathjs constants
*/
math.pi = Math.PI;
math.e = Math.E;
math.tau = Math.PI * 2;
math.i = new Complex(0, 1);
math.Infinity = Infinity;
math.NaN = NaN;
// uppercase constants (for compatibility with built-in Math)
math.E = Math.E;
math.LN2 = Math.LN2;
math.LN10 = Math.LN10;
math.LOG2E = Math.LOG2E;
math.LOG10E = Math.LOG10E;
math.PI = Math.PI;
math.SQRT1_2 = Math.SQRT1_2;
math.SQRT2 = Math.SQRT2;
/**
* Helper methods for functions
*/
/**
* Create a TypeError with message:
* 'Function <fn> does not support a parameter of type <type>';
* @param {String} name Function name
* @param {*} value1
* @param {*} [value2]
* @return {TypeError | Error} error
*/
function newUnsupportedTypeError(name, value1, value2) {
var msg = undefined;
if (arguments.length == 2) {
var t = math['typeof'](value1);
msg = 'Function ' + name + '(' + t + ') not supported';
}
else if (arguments.length > 2) {
var types = [];
for (var i = 1; i < arguments.length; i++) {
types.push(math['typeof'](arguments[i]));
}
msg = 'Function ' + name + '(' + types.join(', ') + ') not supported';
}
else {
msg = 'Unsupported parameter in function ' + name;
}
return new TypeError(msg);
}
/**
* Create a syntax error with the message:
* 'Wrong number of arguments in function <fn> (<count> provided, <min>-<max> expected)'
* @param {String} name Function name
* @param {Number} count Actual argument count
* @param {Number} min Minimum required argument count
* @param {Number} [max] Maximum required argument count
*/
function newArgumentsError(name, count, min, max) {
var msg = 'Wrong number of arguments in function ' + name +
' (' + count + ' provided, ' +
min + ((max != undefined) ? ('-' + max) : '') + ' expected)';
return new SyntaxError(msg);
}
/**
* Node
*/
function Node() {}
math.expr.node.Node = Node;
/**
* Evaluate the node
* @return {*} result
*/
Node.prototype.eval = function () {
throw new Error('Cannot evaluate a Node interface');
};
/**
* Find any node in the node tree matching given filter. For example, to
* find all nodes of type SymbolNode having name 'x':
*
* var results = Node.find({
* type: SymbolNode,
* properties: {
* name: 'x'
* }
* });
*
* @param {Object} filter Available parameters:
* {Function} type
* {Object<String, String>} properties
* @return {Node[]} nodes An array with nodes matching given filter criteria
*/
Node.prototype.find = function (filter) {
return this.match(filter) ? [this] : [];
};
/**
* Test if this object matches given filter
* @param {Object} filter Available parameters:
* {Function} type
* {Object<String, String>} properties
* @return {Boolean} matches True if there is a match
*/
Node.prototype.match = function (filter) {
var match = true;
if (filter) {
if (filter.type && !(this instanceof filter.type)) {
match = false;
}
if (match && filter.properties) {
for (var prop in filter.properties) {
if (filter.properties.hasOwnProperty(prop)) {
if (this[prop] != filter.properties[prop]) {
match = false;
break;
}
}
}
}
}
return match;
};
/**
* Get string representation
* @return {String}
*/
Node.prototype.toString = function() {
return '';
};
/**
* @constructor ConstantNode
* @param {*} value
* @extends {Node}
*/
function ConstantNode(value) {
this.value = value;
}
ConstantNode.prototype = new Node();
math.expr.node.ConstantNode = ConstantNode;
/**
* Evaluate the constant (just return it)
* @return {*} value
*/
ConstantNode.prototype.eval = function () {
return this.value;
};
/**
* Get string representation
* @return {String} str
*/
ConstantNode.prototype.toString = function() {
return math.format(this.value || null);
};
/**
* @constructor OperatorNode
* An operator with two arguments, like 2+3
* @param {String} name Function name, for example '+'
* @param {function} fn Function, for example math.add
* @param {Node[]} params Parameters
*/
function OperatorNode (name, fn, params) {
this.name = name;
this.fn = fn;
this.params = params;
}
OperatorNode.prototype = new Node();
math.expr.node.OperatorNode = OperatorNode;
/**
* Evaluate the parameters
* @return {*} result
*/
OperatorNode.prototype.eval = function() {
return this.fn.apply(this, this.params.map(function (param) {
return param.eval();
}));
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
OperatorNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search in parameters
var params = this.params;
if (params) {
for (var i = 0, len = params.length; i < len; i++) {
nodes = nodes.concat(params[i].find(filter));
}
}
return nodes;
};
/**
* Get string representation
* @return {String} str
*/
OperatorNode.prototype.toString = function() {
var params = this.params;
// special case: unary minus
if (this.fn === math.unary) {
return '-' + params[0].toString();
}
switch (params.length) {
case 1: // for example '5!'
return params[0].toString() + this.name;
case 2: // for example '2+3'
var lhs = params[0].toString();
if (params[0] instanceof OperatorNode) {
lhs = '(' + lhs + ')';
}
var rhs = params[1].toString();
if (params[1] instanceof OperatorNode) {
rhs = '(' + rhs + ')';
}
return lhs + ' ' + this.name + ' ' + rhs;
default: // this should occur. format as a function call
return this.name + '(' + this.params.join(', ') + ')';
}
};
/**
* @constructor SymbolNode
* A symbol node can hold and resolve a symbol
* @param {String} name
* @param {math.expr.Scope} scope
* @extends {Node}
*/
function SymbolNode(name, scope) {
this.name = name;
this.scope = scope;
}
SymbolNode.prototype = new Node();
math.expr.node.SymbolNode = SymbolNode;
/**
* Evaluate the symbol. Throws an error when the symbol is undefined.
* @return {*} result
* @override
*/
SymbolNode.prototype.eval = function() {
// return the value of the symbol
var value = this.scope.get(this.name);
if (value === undefined) {
throw new Error('Undefined symbol ' + this.name);
}
return value;
};
/**
* Get string representation
* @return {String} str
* @override
*/
SymbolNode.prototype.toString = function() {
return this.name;
};
/**
* @constructor ParamsNode
* invoke a list with parameters on the results of a node
* @param {Node} object
* @param {Node[]} params
* @param {Scope[]} paramScopes A scope for every parameter, where the
* index variable 'end' can be defined.
*/
function ParamsNode (object, params, paramScopes) {
this.object = object;
this.params = params;
this.paramScopes = paramScopes;
// check whether any of the params expressions uses the context symbol 'end'
this.hasContextParams = false;
if (params) {
var filter = {
type: math.type.SymbolNode,
properties: {
name: 'end'
}
};
for (var i = 0, len = params.length; i < len; i++) {
if (params[i].find(filter).length > 0) {
this.hasContextParams = true;
break;
}
}
}
}
ParamsNode.prototype = new Node();
math.expr.node.ParamsNode = ParamsNode;
/**
* Evaluate the parameters
* @return {*} result
*/
ParamsNode.prototype.eval = function() {
var i, len;
// evaluate the object
var object = this.object;
if (object == undefined) {
throw new Error ('Node undefined');
}
var obj = object.eval();
// evaluate the values of context parameter 'end' when needed
if (this.hasContextParams) {
var paramScopes = this.paramScopes,
size;
if (obj.size) {
size = obj.size(); // matrix
}
else if (obj.length !== undefined) {
size = [obj.length]; // string
}
else {
size = []; // scalar
}
if (paramScopes && size) {
for (i = 0, len = this.params.length; i < len; i++) {
var paramScope = paramScopes[i];
if (paramScope) {
paramScope.set('end', size[i]);
}
}
}
}
// evaluate the parameters
var params = this.params,
results = [];
for (i = 0, len = this.params.length; i < len; i++) {
results[i] = params[i].eval();
}
if (typeof obj === 'function') {
// invoke a function with the parameters
return obj.apply(this, results);
}
else {
// get a subset of the object
return math.subset(obj, results);
}
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
ParamsNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search object
if (this.object) {
nodes = nodes.concat(this.object.find(filter));
}
// search in parameters
var params = this.params;
if (params) {
for (var i = 0, len = params.length; i < len; i++) {
nodes = nodes.concat(params[i].find(filter));
}
}
return nodes;
};
/**
* Get string representation
* @return {String} str
*/
ParamsNode.prototype.toString = function() {
// format the parameters like "(2, 4.2)"
var str = this.object ? this.object.toString() : '';
if (this.params) {
str += '(' + this.params.join(', ') + ')';
}
return str;
};
/**
* @constructor MatrixNode
* Holds an 2-dimensional array with nodes
* @param {Array[]} nodes 2 dimensional array with nodes
* @extends {Node}
*/
function MatrixNode(nodes) {
this.nodes = nodes || [];
}
MatrixNode.prototype = new Node();
math.expr.node.MatrixNode = MatrixNode;
(function () {
/**
* Evaluate the array
* @return {Matrix} results
* @override
*/
MatrixNode.prototype.eval = function() {
// evaluate all nodes in the 2d array, and merge the results into a matrix
var nodes = this.nodes,
results = [],
mergeNeeded = false;
for (var r = 0, rows = nodes.length; r < rows; r++) {
var nodes_r = nodes[r];
var results_r = [];
for (var c = 0, cols = nodes_r.length; c < cols; c++) {
var results_rc = nodes_r[c].eval();
if (results_rc instanceof Matrix ||
results_rc instanceof Range ||
results_rc instanceof Array) {
mergeNeeded = true;
}
results_r[c] = results_rc;
}
results[r] = results_r;
}
if (mergeNeeded) {
results = merge(results);
}
return new Matrix(results);
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
MatrixNode.prototype.find = function (filter) {
var results = [];
// check itself
if (this.match(filter)) {
results.push(this);
}
// search in all nodes
var nodes = this.nodes;
for (var r = 0, rows = nodes.length; r < rows; r++) {
var nodes_r = nodes[r];
for (var c = 0, cols = nodes_r.length; c < cols; c++) {
results = results.concat(nodes_r[c].find(filter));
}
}
return results;
};
/**
* Merge nested Matrices in a two dimensional Array.
* @param {Array} array Two-dimensional array containing Matrices
* @return {Array} merged The merged array (two-dimensional)
*/
function merge (array) {
var merged = [];
var rows = array.length;
for (var r = 0; r < rows; r++) {
var array_r = array[r];
var cols = array_r.length;
var submatrix = null;
var submatrixRows = null;
for (var c = 0; c < cols; c++) {
var entry = math.clone(array_r[c]);
var size;
if (entry instanceof Matrix) {
// get the data from the matrix
size = entry.size();
entry = entry.valueOf();
if (size.length == 1) {
entry = [entry];
size = [1, size[0]];
}
else if (size.length > 2) {
throw new Error('Cannot merge a multi dimensional matrix');
}
}
else if (entry instanceof Range) {
// change range into an 1xn matrix
entry = [entry.valueOf()];
size = [1, entry[0].length];
}
else if (entry instanceof Array) {
// change array into a 1xn matrix
size = [1, entry.length];
entry = [entry];
}
else {
// change scalar into a 1x1 matrix
size = [1, 1];
entry = [[entry]];
}
// check the height of this row
if (submatrix == null) {
// first entry
submatrix = entry;
submatrixRows = size[0];
}
else if (size[0] == submatrixRows) {
// merge
for (var s = 0; s < submatrixRows; s++) {
submatrix[s] = submatrix[s].concat(entry[s]);
}
}
else {
// no good...
throw new Error('Dimension mismatch ' +
'(' + size[0] + ' != ' + submatrixRows + ')');
}
}
// merge the submatrix
merged = merged.concat(submatrix);
}
return merged;
}
/**
* Get string representation
* @return {String} str
* @override
*/
MatrixNode.prototype.toString = function() {
return util.formatArray(this.nodes);
};
})();
/**
* @constructor BlockNode
* Holds a set with nodes
* @extends {Node}
*/
function BlockNode() {
this.params = [];
this.visible = [];
}
BlockNode.prototype = new Node();
math.expr.node.BlockNode = BlockNode;
/**
* Add a parameter
* @param {Node} param
* @param {Boolean} [visible] true by default
*/
BlockNode.prototype.add = function (param, visible) {
var index = this.params.length;
this.params[index] = param;
this.visible[index] = (visible != undefined) ? visible : true;
};
/**
* Evaluate the set
* @return {*[]} results
* @override
*/
BlockNode.prototype.eval = function() {
// evaluate the parameters
var results = [];
for (var i = 0, iMax = this.params.length; i < iMax; i++) {
var result = this.params[i].eval();
if (this.visible[i]) {
results.push(result);
}
}
return results;
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
BlockNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search in parameters
var params = this.params;
if (params) {
for (var i = 0, len = params.length; i < len; i++) {
nodes = nodes.concat(params[i].find(filter));
}
}
return nodes;
};
/**
* Get string representation
* @return {String} str
* @override
*/
BlockNode.prototype.toString = function() {
var strings = [];
for (var i = 0, iMax = this.params.length; i < iMax; i++) {
if (this.visible[i]) {
strings.push('\n ' + this.params[i].toString());
}
}
return '[' + strings.join(',') + '\n]';
};
/**
* @constructor AssignmentNode
* Define a symbol, like "a = 3.2"
*
* @param {String} name Symbol name
* @param {Node} expr The expression defining the symbol
* @param {math.expr.Scope} scope Scope to store the result
*/
function AssignmentNode(name, expr, scope) {
this.name = name;
this.expr = expr;
this.scope = scope;
}
AssignmentNode.prototype = new Node();
math.expr.node.AssignmentNode = AssignmentNode;
/**
* Evaluate the assignment
* @return {*} result
*/
AssignmentNode.prototype.eval = function() {
if (this.expr === undefined) {
throw new Error('Undefined symbol ' + this.name);
}
var result = this.expr.eval();
this.scope.set(this.name, result);
return result;
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
AssignmentNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search in expression
if (this.expr) {
nodes = nodes.concat(this.expr.find(filter));
}
return nodes;
};
/**
* Get string representation
* @return {String}
*/
AssignmentNode.prototype.toString = function() {
return this.name + ' = ' + this.expr.toString();
};
/**
* @constructor UpdateNode
* Update a symbol value, like a(2,3) = 4.5
*
* @param {String} name Symbol name
* @param {Node[] | undefined} params One or more parameters
* @param {Scope[]} paramScopes A scope for every parameter, where the
* index variable 'end' can be defined.
* @param {Node} expr The expression defining the symbol
* @param {math.expr.Scope} scope Scope to store the result
*/
function UpdateNode(name, params, paramScopes, expr, scope) {
this.name = name;
this.params = params;
this.paramScopes = paramScopes;
this.expr = expr;
this.scope = scope;
// check whether any of the params expressions uses the context symbol 'end'
this.hasContextParams = false;
var filter = {
type: math.type.SymbolNode,
properties: {
name: 'end'
}
};
for (var i = 0, len = params.length; i < len; i++) {
if (params[i].find(filter).length > 0) {
this.hasContextParams = true;
break;
}
}
}
UpdateNode.prototype = new Node();
math.expr.node.UpdateNode = UpdateNode;
/**
* Evaluate the assignment
* @return {*} result
*/
UpdateNode.prototype.eval = function() {
if (this.expr === undefined) {
throw new Error('Undefined symbol ' + this.name);
}
var result;
var params = this.params;
// test if definition is currently undefined
var prevResult = this.scope.get(this.name);
if (prevResult == undefined) {
throw new Error('Undefined symbol ' + this.name);
}
// evaluate the values of context parameter 'end' when needed
if (this.hasContextParams) {
var paramScopes = this.paramScopes,
size;
if (prevResult.size) {
size = prevResult.size(); // matrix
}
else if (prevResult.length !== undefined) {
size = [prevResult.length]; // string
}
else {
size = []; // scalar
}
if (paramScopes && size) {
for (var i = 0, len = this.params.length; i < len; i++) {
var paramScope = paramScopes[i];
if (paramScope) {
paramScope.set('end', size[i]);
}
}
}
}
// change part of a matrix, for example "a=[]", "a(2,3)=4.5"
var paramResults = [];
this.params.forEach(function (param) {
paramResults.push(param.eval());
});
var exprResult = this.expr.eval();
// replace subset
result = math.subset(prevResult, paramResults, exprResult);
this.scope.set(this.name, result);
return result;
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
UpdateNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search in parameters
var params = this.params;
if (params) {
for (var i = 0, len = params.length; i < len; i++) {
nodes = nodes.concat(params[i].find(filter));
}
}
// search in expression
if (this.expr) {
nodes = nodes.concat(this.expr.find(filter));
}
return nodes;
};
/**
* Get string representation
* @return {String}
*/
UpdateNode.prototype.toString = function() {
var str = '';
str += this.name;
if (this.params && this.params.length) {
str += '(' + this.params.join(', ') + ')';
}
str += ' = ';
str += this.expr.toString();
return str;
};
/**
* @constructor FunctionNode
* Function assignment
*
* @param {String} name Function name
* @param {String[]} variables Variable names
* @param {Node} expr The function expression
* @param {math.expr.Scope} functionScope Scope in which to write variable
* values
* @param {math.expr.Scope} scope Scope to store the resulting
* function assignment
*/
function FunctionNode(name, variables, expr, functionScope, scope) {
this.name = name;
this.variables = variables;
this.expr = expr;
this.scope = scope;
// create function
this.fn = function () {
var num = variables ? variables.length : 0;
// validate correct number of arguments
if (arguments.length != num) {
throw newArgumentsError(name, arguments.length, num);
}
// fill in the provided arguments in the functionScope variables
for (var i = 0; i < num; i++) {
functionScope.set(variables[i], arguments[i]);
}
// evaluate the expression
return expr.eval();
};
this.fn.toString = function() {
// TODO: what to return as toString?
return name + '(' + variables.join(', ') + ')';
//return name + '(' + variableNames.join(', ') + ') = ' + expr.toString();
};
}
FunctionNode.prototype = new Node();
math.expr.node.FunctionNode = FunctionNode;
/**
* Evaluate the function assignment
* @return {function} fn
*/
FunctionNode.prototype.eval = function() {
// put the definition in the scope
this.scope.set(this.name, this.fn);
return this.fn;
};
/**
* Find all nodes matching given filter
* @param {Object} filter See Node.find for a description of the filter options
* @returns {Node[]} nodes
*/
FunctionNode.prototype.find = function (filter) {
var nodes = [];
// check itself
if (this.match(filter)) {
nodes.push(this);
}
// search in expression
if (this.expr) {
nodes = nodes.concat(this.expr.find(filter));
}
return nodes;
};
/**
* get string representation
* @return {String} str
*/
FunctionNode.prototype.toString = function() {
return this.fn.toString();
};
/**
* Scope
* A scope stores values of symbols: variables and functions.
*
* Syntax:
* var scope = new math.expr.Scope();
* var scope = new math.expr.Scope(parentScope);
* var scope = new math.expr.Scope(symbols);
* var scope = new math.expr.Scope(parentScope, symbols);
*
* Where:
* {math.expr.Scope} parentScope Scope will be linked to a parent scope,
* which is traversed when resolving
* symbols.
* {Object} symbols A custom object that will be used to
* resolve and store variables.
*
* @constructor math.expr.Scope
* @param {...} [args]
*/
math.expr.Scope = function Scope(args) {
/** @type {math.expr.Scope} */
this.parentScope = null;
/** @type {math.expr.Scope[]} */
this.subScopes = null;
/** @type {Object.<String, *>} */
this.symbols = {}; // variables and functions
/** @type {Object.<String, Object>} */
this.cache = {}; // cache, referring to the scope.symbols object where
// a variable was last found
// read first argument (can be parentScope or symbols map)
if (arguments.length > 0) {
var arg0 = arguments[0];
if (arg0 instanceof math.expr.Scope) {
this.parentScope = arg0;
}
else if (arg0 instanceof Object) {
this.symbols = arg0;
}
}
// read second argument (can be symbols map)
if (arguments.length > 1) {
var arg1 = arguments[1];
if (arg1 instanceof Object) {
this.symbols = arg1;
}
}
};
math.expr.Scope.prototype = {
/**
* Create a sub scope
* The variables in a sub scope are not accessible from the parent scope
* @return {math.expr.Scope} subScope
*/
createSubScope: function () {
var subScope = new math.expr.Scope(this);
if (!this.subScopes) {
this.subScopes = [];
}
this.subScopes.push(subScope);
return subScope;
},
/**
* Get a symbol value by name.
* Returns undefined if the symbol is not found in this scope or any of
* its parent scopes.
* @param {String} name
* @returns {* | undefined} value
*/
get: function (name) {
var value;
// check itself
value = this.symbols[name];
if (value !== undefined) {
return value;
}
// read from cache
var symbols = this.cache[name];
if (symbols) {
return symbols[name];
}
// check parent scope
var parent = this.parentScope;
while (parent) {
value = parent.symbols[name];
if (value !== undefined) {
this.cache[name] = parent.symbols;
return value;
}
parent = parent.parentScope;
}
// check math namespace
value = math[name];
if (value !== undefined) {
this.cache[name] = math;
return value;
}
// check if name is a unit
if (Unit.isPlainUnit(name)) {
value = new Unit(null, name);
this.cache[name] = {};
this.cache[name][name] = value;
return value;
}
return undefined;
},
/**
* Test whether this scope contains a symbol (will not check parent scopes)
* @param {String} name
* @return {Boolean} hasSymbol
*/
has: function (name) {
return (this.symbols[name] !== undefined);
},
/**
* Set a symbol value
* @param {String} name
* @param {*} value
* @return {*} value
*/
set: function (name, value) {
return this.symbols[name] = value;
},
/**
* Remove a symbol by name
* @param {String} name
*/
remove: function(name) {
delete this.symbols[name];
},
/**
* Clear all symbols in this scope, its sub scopes, and clear the cache.
* Parent scopes will not be cleared.
*/
clear: function () {
var symbols = this.symbols;
for (var name in symbols) {
if (symbols.hasOwnProperty(name)) {
delete symbols[name];
}
}
if (this.subScopes) {
var subScopes = this.subScopes;
for (var i = 0, iMax = subScopes.length; i < iMax; i++) {
subScopes[i].clear();
}
}
this.clearCache();
},
/**
* Clear cached links to symbols in other scopes
*/
clearCache: function () {
this.cache = {};
}
};
/**
* @constructor math.expr.Parser
* Parser contains methods to evaluate or parse expressions, and has a number
* of convenience methods to get, set, and remove variables from memory. Parser
* keeps a scope containing variables in memory, which is used for all
* evaluations.
*
* Methods:
* var result = parser.eval(expr); // evaluate an expression
* var value = parser.get(name); // retrieve a variable from the parser
* parser.set(name, value); // set a variable in the parser
* parser.remove(name); // clear a variable from the
* // parsers scope
* parser.clear(); // clear the parsers scope
*
* // it is possible to parse an expression into a node tree:
* var node = parser.parse(expr); // parse an expression into a node tree
* var result = node.eval(); // evaluate a parsed node
*
* Example usage:
* var parser = new math.expr.Parser();
* // Note: there is a convenience method which can be used instead:
* // var parser = new math.parser();
*
* // evaluate expressions
* parser.eval('sqrt(3^2 + 4^2)'); // 5
* parser.eval('sqrt(-4)'); // 2i
* parser.eval('2 inch in cm'); // 5.08 cm
* parser.eval('cos(45 deg)'); // 0.7071067811865476
*
* // define variables and functions
* parser.eval('x = 7 / 2'); // 3.5
* parser.eval('x + 3'); // 6.5
* parser.eval('function f(x, y) = x^y'); // f(x, y)
* parser.eval('f(2, 3)'); // 8
*
* // get and set variables and functions
* var x = parser.get('x'); // 7
* var f = parser.get('f'); // function
* var g = f(3, 2); // 9
* parser.set('h', 500);
* var i = parser.eval('h / 2'); // 250
* parser.set('hello', function (name) {
* return 'hello, ' + name + '!';
* });
* parser.eval('hello("user")'); // "hello, user!"
*
* // clear defined functions and variables
* parser.clear();
*/
math.expr.Parser = function Parser() {
if (!(this instanceof math.expr.Parser)) {
throw new SyntaxError(
'Parser constructor must be called with the new operator');
}
this.scope = new math.expr.Scope();
};
/**
* Parse an expression end return the parsed function node.
* The node can be evaluated via node.eval()
* @param {String} expr
* @return {Node} node
* @throws {Error}
*/
math.expr.Parser.prototype.parse = function (expr) {
return math.parse(expr, this.scope);
};
/**
* Parse and evaluate the given expression
* @param {String} expr A string containing an expression, for example "2+3"
* @return {*} result The result, or undefined when the expression was empty
* @throws {Error}
*/
math.expr.Parser.prototype.eval = function (expr) {
var node = math.parse(expr, this.scope);
return node.eval();
};
/**
* Get a variable (a function or variable) by name from the parsers scope.
* Returns undefined when not found
* @param {String} name
* @return {* | undefined} value
*/
math.expr.Parser.prototype.get = function (name) {
return this.scope.get(name);
};
/**
* Set a symbol (a function or variable) by name from the parsers scope.
* @param {String} name
* @param {* | undefined} value
*/
math.expr.Parser.prototype.set = function (name, value) {
this.scope.set(name, value);
};
/**
* Remove a variable from the parsers scope
* @param {String} name
*/
math.expr.Parser.prototype.remove = function (name) {
this.scope.remove(name);
};
/**
* Clear the scope with variables and functions
*/
math.expr.Parser.prototype.clear = function () {
this.scope.clear();
};
/**
* Calculate the absolute value of a value.
*
* abs(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.abs = function abs(x) {
if (arguments.length != 1) {
throw newArgumentsError('abs', arguments.length, 1);
}
if (isNumber(x)) {
return Math.abs(x);
}
if (x instanceof Complex) {
return Math.sqrt(x.re * x.re + x.im * x.im);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.abs);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.abs(x.valueOf());
}
throw newUnsupportedTypeError('abs', x);
};
/**
* Add two values
*
* x + y
* add(x, y)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Number | Complex | Unit | String | Array | Matrix} res
*/
math.add = function add(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('add', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
// number + number
return x + y;
}
else if (y instanceof Complex) {
// number + complex
return Complex.create(
x + y.re,
y.im
)
}
}
else if (x instanceof Complex) {
if (isNumber(y)) {
// complex + number
return Complex.create(
x.re + y,
x.im
)
}
else if (y instanceof Complex) {
// complex + complex
return Complex.create(
x.re + y.re,
x.im + y.im
);
}
}
else if (x instanceof Unit) {
if (y instanceof Unit) {
if (!x.equalBase(y)) {
throw new Error('Units do not match');
}
if (x.value == null) {
throw new Error('Unit on left hand side of operator + has an undefined value');
}
if (y.value == null) {
throw new Error('Unit on right hand side of operator + has an undefined value');
}
var res = x.clone();
res.value += y.value;
res.fixPrefix = false;
return res;
}
}
if (isString(x) || isString(y)) {
return x + y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.add);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive value
return math.add(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('add', x, y);
};
/**
* Round a value towards plus infinity
*
* ceil(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.ceil = function ceil(x) {
if (arguments.length != 1) {
throw newArgumentsError('ceil', arguments.length, 1);
}
if (isNumber(x)) {
return Math.ceil(x);
}
if (x instanceof Complex) {
return Complex.create (
Math.ceil(x.re),
Math.ceil(x.im)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.ceil);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.ceil(x.valueOf());
}
throw newUnsupportedTypeError('ceil', x);
};
/**
* Compute the cube of a value
*
* x .* x .* x
* cube(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.cube = function cube(x) {
if (arguments.length != 1) {
throw newArgumentsError('cube', arguments.length, 1);
}
if (isNumber(x)) {
return x * x * x;
}
if (x instanceof Complex) {
return math.multiply(math.multiply(x, x), x);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.cube);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.cube(x.valueOf());
}
throw newUnsupportedTypeError('cube', x);
};
/**
* Divide two values.
*
* x / y
* divide(x, y)
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.divide = function divide(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('divide', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
// number / number
return x / y;
}
else if (y instanceof Complex) {
// number / complex
return _divideComplex(new Complex(x, 0), y);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
// complex / number
return _divideComplex(x, new Complex(y, 0));
}
else if (y instanceof Complex) {
// complex / complex
return _divideComplex(x, y);
}
}
if (x instanceof Unit) {
if (isNumber(y)) {
var res = x.clone();
res.value /= y;
return res;
}
}
if (x instanceof Array || x instanceof Matrix) {
if (y instanceof Array || y instanceof Matrix) {
// TODO: implement matrix right division using pseudo inverse
// http://www.mathworks.nl/help/matlab/ref/mrdivide.html
// http://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html
// http://stackoverflow.com/questions/12263932/how-does-gnu-octave-matrix-division-work-getting-unexpected-behaviour
return math.multiply(x, math.inv(y));
}
else {
// matrix / scalar
return util.map2(x, y, math.divide);
}
}
if (y instanceof Array || y instanceof Matrix) {
// TODO: implement matrix right division using pseudo inverse
return math.multiply(x, math.inv(y));
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive value
return math.divide(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('divide', x, y);
};
/**
* Divide two complex numbers. x / y or divide(x, y)
* @param {Complex} x
* @param {Complex} y
* @return {Complex} res
* @private
*/
function _divideComplex (x, y) {
var den = y.re * y.re + y.im * y.im;
if (den != 0) {
return Complex.create(
(x.re * y.re + x.im * y.im) / den,
(x.im * y.re - x.re * y.im) / den
);
}
else {
// both y.re and y.im are zero
return Complex.create(
(x.re != 0) ? (x.re / 0) : 0,
(x.im != 0) ? (x.im / 0) : 0
);
}
}
/**
* Divide two values element wise.
*
* x ./ y
* edivide(x, y)
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex | Unit | Array | Matrix} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.edivide = function edivide(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('edivide', arguments.length, 2);
}
return util.deepMap2(x, y, math.divide);
};
/**
* Multiply two values element wise.
*
* x .* y
* emultiply(x, y)
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex | Unit | Array | Matrix} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.emultiply = function emultiply(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('emultiply', arguments.length, 2);
}
return util.deepMap2(x, y, math.multiply);
};
/**
* Calculates the power of x to y element wise
*
* x .^ y
* epow(x, y)
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex | Unit | Array | Matrix} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.epow = function epow(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('epow', arguments.length, 2);
}
return util.deepMap2(x, y, math.pow);
};
/**
* Check if value x equals y,
*
* x == y
* equal(x, y)
*
* For matrices, the function is evaluated element wise.
* In case of complex numbers, x.re must equal y.re, and x.im must equal y.im.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Boolean | Array | Matrix} res
*/
math.equal = function equal(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('equal', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x == y;
}
else if (y instanceof Complex) {
return (x == y.re) && (y.im == 0);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return (x.re == y) && (x.im == 0);
}
else if (y instanceof Complex) {
return (x.re == y.re) && (x.im == y.im);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value == y.value;
}
if (isString(x) || isString(y)) {
return x == y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.equal);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return equal(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('equal', x, y);
};
/**
* Calculate the exponent of a value
*
* exp(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.exp = function exp (x) {
if (arguments.length != 1) {
throw newArgumentsError('exp', arguments.length, 1);
}
if (isNumber(x)) {
return Math.exp(x);
}
if (x instanceof Complex) {
var r = Math.exp(x.re);
return Complex.create(
r * Math.cos(x.im),
r * Math.sin(x.im)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.exp);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.exp(x.valueOf());
}
throw newUnsupportedTypeError('exp', x);
};
/**
* Round a value towards zero
*
* fix(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.fix = function fix(x) {
if (arguments.length != 1) {
throw newArgumentsError('fix', arguments.length, 1);
}
if (isNumber(x)) {
return (x > 0) ? Math.floor(x) : Math.ceil(x);
}
if (x instanceof Complex) {
return Complex.create(
(x.re > 0) ? Math.floor(x.re) : Math.ceil(x.re),
(x.im > 0) ? Math.floor(x.im) : Math.ceil(x.im)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.fix);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.fix(x.valueOf());
}
throw newUnsupportedTypeError('fix', x);
};
/**
* Round a value towards minus infinity
*
* floor(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.floor = function floor(x) {
if (arguments.length != 1) {
throw newArgumentsError('floor', arguments.length, 1);
}
if (isNumber(x)) {
return Math.floor(x);
}
if (x instanceof Complex) {
return Complex.create (
Math.floor(x.re),
Math.floor(x.im)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.floor);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.floor(x.valueOf());
}
throw newUnsupportedTypeError('floor', x);
};
/**
* Calculate the greatest common divisor for two or more values or arrays.
*
* gcd(a, b)
* gcd(a, b, c, ...)
*
* For matrices, the function is evaluated element wise.
*
* @param {... Number | Array | Matrix} args two or more integer numbers
* @return {Number | Array | Matrix} greatest common divisor
*/
math.gcd = function gcd(args) {
var a = arguments[0],
b = arguments[1],
t;
if (arguments.length == 2) {
// two arguments
if (isNumber(a) && isNumber(b)) {
if (!isInteger(a) || !isInteger(b)) {
throw new Error('Parameters in function gcd must be integer numbers');
}
// http://en.wikipedia.org/wiki/Euclidean_algorithm
while (b != 0) {
t = b;
b = a % t;
a = t;
}
return Math.abs(a);
}
// evaluate gcd element wise
if (a instanceof Array || a instanceof Matrix ||
b instanceof Array || b instanceof Matrix) {
return util.map2(a, b, math.gcd);
}
if (a.valueOf() !== a || b.valueOf() !== b) {
// fallback on the objects primitive value
return math.gcd(a.valueOf(), b.valueOf());
}
throw newUnsupportedTypeError('gcd', a, b);
}
if (arguments.length > 2) {
// multiple arguments. Evaluate them iteratively
for (var i = 1; i < arguments.length; i++) {
a = math.gcd(a, arguments[i]);
}
return a;
}
// zero or one argument
throw new SyntaxError('Function gcd expects two or more arguments');
};
/**
* Check if value x is larger y
*
* x > y
* larger(x, y)
*
* For matrices, the function is evaluated element wise.
* In case of complex numbers, the absolute values of a and b are compared.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Boolean | Array | Matrix} res
*/
math.larger = function larger(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('larger', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x > y;
}
else if (y instanceof Complex) {
return x > math.abs(y);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return math.abs(x) > y;
}
else if (y instanceof Complex) {
return math.abs(x) > math.abs(y);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value > y.value;
}
if (isString(x) || isString(y)) {
return x > y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.larger);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.larger(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('larger', x, y);
};
/**
* Check if value x is larger or equal to y
*
* x >= y
* largereq(x, y)
*
* For matrices, the function is evaluated element wise.
* In case of complex numbers, the absolute values of a and b are compared.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Boolean | Array | Matrix} res
*/
math.largereq = function largereq(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('largereq', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x >= y;
}
else if (y instanceof Complex) {
return x >= math.abs(y);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return math.abs(x) >= y;
}
else if (y instanceof Complex) {
return math.abs(x) >= math.abs(y);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value >= y.value;
}
if (isString(x) || isString(y)) {
return x >= y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.largereq);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.largereq(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('largereq', x, y);
};
/**
* Calculate the least common multiple for two or more values or arrays.
*
* lcm(a, b)
* lcm(a, b, c, ...)
*
* lcm is defined as:
* lcm(a, b) = abs(a * b) / gcd(a, b)
*
* For matrices, the function is evaluated element wise.
*
* @param {... Number | Array | Matrix} args two or more integer numbers
* @return {Number | Array | Matrix} least common multiple
*/
math.lcm = function lcm(args) {
var a = arguments[0],
b = arguments[1],
t;
if (arguments.length == 2) {
// two arguments
if (isNumber(a) && isNumber(b)) {
if (!isInteger(a) || !isInteger(b)) {
throw new Error('Parameters in function lcm must be integer numbers');
}
// http://en.wikipedia.org/wiki/Euclidean_algorithm
// evaluate gcd here inline to reduce overhead
var prod = a * b;
while (b != 0) {
t = b;
b = a % t;
a = t;
}
return Math.abs(prod / a);
}
// evaluate lcm element wise
if (a instanceof Array || a instanceof Matrix ||
b instanceof Array || b instanceof Matrix) {
return util.map2(a, b, math.lcm);
}
if (a.valueOf() !== a || b.valueOf() !== b) {
// fallback on the objects primitive value
return math.lcm(a.valueOf(), b.valueOf());
}
throw newUnsupportedTypeError('lcm', a, b);
}
if (arguments.length > 2) {
// multiple arguments. Evaluate them iteratively
for (var i = 1; i < arguments.length; i++) {
a = math.lcm(a, arguments[i]);
}
return a;
}
// zero or one argument
throw new SyntaxError('Function lcm expects two or more arguments');
};
/**
* Calculate the logarithm of a value
*
* log(x)
* log(x, base)
*
* base is optional. If not provided, the natural logarithm of x is calculated.
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @param {Number | Complex} [base]
* @return {Number | Complex | Array | Matrix} res
*/
math.log = function log(x, base) {
if (arguments.length == 1) {
// calculate natural logarithm, log(x)
if (isNumber(x)) {
if (x >= 0) {
return Math.log(x);
}
else {
// negative value -> complex value computation
return math.log(new Complex(x, 0));
}
}
if (x instanceof Complex) {
return Complex.create (
Math.log(Math.sqrt(x.re * x.re + x.im * x.im)),
Math.atan2(x.im, x.re)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.log);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive values
return math.log(x.valueOf());
}
throw newUnsupportedTypeError('log', x);
}
else if (arguments.length == 2) {
// calculate logarithm for a specified base, log(x, base)
return math.divide(math.log(x), math.log(base));
}
else {
throw newArgumentsError('log', arguments.length, 1, 2);
}
};
/**
* Calculate the 10-base logarithm of a value
*
* log10(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.log10 = function log10(x) {
if (arguments.length != 1) {
throw newArgumentsError('log10', arguments.length, 1);
}
if (isNumber(x)) {
if (x >= 0) {
return Math.log(x) / Math.LN10;
}
else {
// negative value -> complex value computation
return math.log10(new Complex(x, 0));
}
}
if (x instanceof Complex) {
return Complex.create (
Math.log(Math.sqrt(x.re * x.re + x.im * x.im)) / Math.LN10,
Math.atan2(x.im, x.re) / Math.LN10
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.log10);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.log10(x.valueOf());
}
throw newUnsupportedTypeError('log10', x);
};
/**
* Calculates the modulus, the remainder of an integer division.
*
* x % y
* mod(x, y)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @param {Number | Complex | Array | Matrix} y
* @return {Number | Array | Matrix} res
*/
math.mod = function mod(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('mod', arguments.length, 2);
}
// see http://functions.wolfram.com/IntegerFunctions/Mod/
if (isNumber(x) && isNumber(y)) {
// number % number
return _mod(x, y);
}
// TODO: implement mod for complex values
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.mod);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.mod(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('mod', x, y);
};
/**
* Calculate the modulus of two numbers
* @param {Number} x
* @param {Number} y
* @returns {number} res
* @private
*/
function _mod(x, y) {
if (y > 0) {
if (x > 0) {
return x % y;
}
else if (x == 0) {
return 0;
}
else { // x < 0
return x - y * Math.floor(x / y);
}
}
else if (y == 0) {
return x;
}
else { // y < 0
// TODO: implement mod for a negative divisor
throw new Error('Cannot calculate mod for a negative divisor');
}
}
/**
* Multiply two values.
*
* x * y
* multiply(x, y)
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex | Unit | Array | Matrix} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.multiply = function multiply(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('multiply', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
// number * number
return x * y;
}
else if (y instanceof Complex) {
// number * complex
return _multiplyComplex (new Complex(x, 0), y);
}
else if (y instanceof Unit) {
res = y.clone();
res.value *= x;
return res;
}
}
else if (x instanceof Complex) {
if (isNumber(y)) {
// complex * number
return _multiplyComplex (x, new Complex(y, 0));
}
else if (y instanceof Complex) {
// complex * complex
return _multiplyComplex (x, y);
}
}
else if (x instanceof Unit) {
if (isNumber(y)) {
res = x.clone();
res.value *= y;
return res;
}
}
else if (x instanceof Array) {
if (y instanceof Array) {
// matrix * matrix
var sizeX = util.size(x);
var sizeY = util.size(y);
if (sizeX.length != 2) {
throw new Error('Can only multiply a 2 dimensional matrix ' +
'(A has ' + sizeX.length + ' dimensions)');
}
if (sizeY.length != 2) {
throw new Error('Can only multiply a 2 dimensional matrix ' +
'(B has ' + sizeY.length + ' dimensions)');
}
if (sizeX[1] != sizeY[0]) {
throw new RangeError('Dimensions mismatch in multiplication. ' +
'Columns of A must match rows of B ' +
'(A is ' + sizeX[0] + 'x' + sizeX[1] +
', B is ' + sizeY[0] + 'x' + sizeY[1] + ', ' +
sizeY[1] + ' != ' + sizeY[0] + ')');
}
// TODO: performance of matrix multiplication can be improved
var res = [],
rows = sizeX[0],
cols = sizeY[1],
num = sizeX[1],
multiply = math.multiply,
add = math.add;
for (var r = 0; r < rows; r++) {
res[r] = [];
for (var c = 0; c < cols; c++) {
var result = null;
for (var n = 0; n < num; n++) {
var p = multiply(x[r][n], y[n][c]);
result = (result == null) ? p : add(result, p);
}
res[r][c] = result;
}
}
return res;
}
else if (y instanceof Matrix) {
return new Matrix(math.multiply(x.valueOf(), y.valueOf()));
}
else {
// matrix * scalar
return util.map2(x, y, math.multiply);
}
}
else if (x instanceof Matrix) {
return new Matrix(math.multiply(x.valueOf(), y.valueOf()));
}
if (y instanceof Array) {
// scalar * matrix
return util.map2(x, y, math.multiply);
}
else if (y instanceof Matrix) {
return new Matrix(math.multiply(x.valueOf(), y.valueOf()));
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.multiply(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('multiply', x, y);
};
/**
* Multiply two complex numbers. x * y or multiply(x, y)
* @param {Complex} x
* @param {Complex} y
* @return {Complex | Number} res
* @private
*/
function _multiplyComplex (x, y) {
// Note: we test whether x or y are pure real or pure complex,
// to prevent unnecessary NaN values. For example, Infinity*i should
// result in Infinity*i, and not in NaN+Infinity*i
if (x.im == 0) {
// x is pure real
if (y.im == 0) {
// y is pure real
return x.re * y.re;
}
else if (y.re == 0) {
// y is pure complex
return new Complex(
0,
x.re * y.im
);
}
else {
// y has a real and complex part
return new Complex(
x.re * y.re,
x.re * y.im
);
}
}
else if (x.re == 0) {
// x is pure complex
if (y.im == 0) {
// y is pure real
return new Complex(
0,
x.im * y.re
);
}
else if (y.re == 0) {
// y is pure complex
return -x.im * y.im;
}
else {
// y has a real and complex part
return new Complex(
-x.im * y.im,
x.im * y.re
);
}
}
else {
// x has a real and complex part
if (y.im == 0) {
// y is pure real
return new Complex(
x.re * y.re,
x.im * y.re
);
}
else if (y.re == 0) {
// y is pure complex
return new Complex(
-x.im * y.im,
x.re * y.im
);
}
else {
// y has a real and complex part
return new Complex(
x.re * y.re - x.im * y.im,
x.re * y.im + x.im * y.re
);
}
}
}
/**
* Calculates the power of x to y
*
* x ^ y
* pow(x, y)
*
* @param {Number | Complex | Array | Matrix} x
* @param {Number | Complex} y
* @return {Number | Complex | Array | Matrix} res
*/
math.pow = function pow(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('pow', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
if (isInteger(y) || x >= 0) {
// real value computation
return Math.pow(x, y);
}
else {
return powComplex(new Complex(x, 0), new Complex(y, 0));
}
}
else if (y instanceof Complex) {
return powComplex(new Complex(x, 0), y);
}
}
else if (x instanceof Complex) {
if (isNumber(y)) {
return powComplex(x, new Complex(y, 0));
}
else if (y instanceof Complex) {
return powComplex(x, y);
}
}
else if (x instanceof Array) {
if (!isNumber(y) || !isInteger(y) || y < 0) {
throw new TypeError('For A^b, b must be a positive integer ' +
'(value is ' + y + ')');
}
// verify that A is a 2 dimensional square matrix
var s = util.size(x);
if (s.length != 2) {
throw new Error('For A^b, A must be 2 dimensional ' +
'(A has ' + s.length + ' dimensions)');
}
if (s[0] != s[1]) {
throw new Error('For A^b, A must be square ' +
'(size is ' + s[0] + 'x' + s[1] + ')');
}
if (y == 0) {
// return the identity matrix
return math.eye(s[0]);
}
else {
// value > 0
var res = x;
for (var i = 1; i < y; i++) {
res = math.multiply(x, res);
}
return res;
}
}
else if (x instanceof Matrix) {
return new Matrix(math.pow(x.valueOf(), y));
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.pow(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('pow', x, y);
};
/**
* Calculates the power of x to y, x^y, for two complex numbers.
* @param {Complex} x
* @param {Complex} y
* @return {Complex} res
* @private
*/
function powComplex (x, y) {
// complex computation
// x^y = exp(log(x)*y) = exp((abs(x)+i*arg(x))*y)
var temp1 = math.log(x);
var temp2 = math.multiply(temp1, y);
return math.exp(temp2);
}
/**
* Round a value towards the nearest integer
*
* round(x)
* round(x, n)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @param {Number | Array} [n] number of decimals (by default n=0)
* @return {Number | Complex | Array | Matrix} res
*/
math.round = function round(x, n) {
if (arguments.length != 1 && arguments.length != 2) {
throw newArgumentsError('round', arguments.length, 1, 2);
}
if (n == undefined) {
// round (x)
if (isNumber(x)) {
return Math.round(x);
}
if (x instanceof Complex) {
return Complex.create (
Math.round(x.re),
Math.round(x.im)
);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.round);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.round(x.valueOf());
}
throw newUnsupportedTypeError('round', x);
}
else {
// round (x, n)
if (!isNumber(n)) {
throw new TypeError('Number of decimals in function round must be an integer');
}
if (n !== Math.round(n)) {
throw new TypeError('Number of decimals in function round must be integer');
}
if (n < 0 || n > 9) {
throw new Error ('Number of decimals in function round must be in te range of 0-9');
}
if (isNumber(x)) {
return roundNumber(x, n);
}
if (x instanceof Complex) {
return Complex.create (
roundNumber(x.re, n),
roundNumber(x.im, n)
);
}
if (x instanceof Array || x instanceof Matrix ||
n instanceof Array || n instanceof Matrix) {
return util.map2(x, n, math.round);
}
if (x.valueOf() !== x || n.valueOf() !== n) {
// fallback on the objects primitive values
return math.round(x.valueOf(), n.valueOf());
}
throw newUnsupportedTypeError('round', x, n);
}
};
/**
* round a number to the given number of decimals, or to zero if decimals is
* not provided
* @param {Number} value
* @param {Number} [decimals] number of decimals, between 0 and 15 (0 by default)
* @return {Number} roundedValue
*/
function roundNumber (value, decimals) {
if (decimals) {
var p = Math.pow(10, decimals);
return Math.round(value * p) / p;
}
else {
return Math.round(value);
}
}
/**
* Compute the sign of a value.
*
* sign(x)
*
* The sign of a value x is 1 when x > 1, -1 when x < 0, and 0 when x == 0
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.sign = function sign(x) {
if (arguments.length != 1) {
throw newArgumentsError('sign', arguments.length, 1);
}
if (isNumber(x)) {
var sign;
if (x > 0) {
sign = 1;
}
else if (x < 0) {
sign = -1;
}
else {
sign = 0;
}
return sign;
}
if (x instanceof Complex) {
var abs = Math.sqrt(x.re * x.re + x.im * x.im);
return Complex.create(x.re / abs, x.im / abs);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.sign);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.sign(x.valueOf());
}
throw newUnsupportedTypeError('sign', x);
};
/**
* Check if value x is smaller y
*
* x < y
* smaller(x, y)
*
* For matrices, the function is evaluated element wise.
* In case of complex numbers, the absolute values of a and b are compared.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Boolean | Array | Matrix} res
*/
math.smaller = function smaller(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('smaller', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x < y;
}
else if (y instanceof Complex) {
return x < math.abs(y);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return math.abs(x) < y;
}
else if (y instanceof Complex) {
return math.abs(x) < math.abs(y);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value < y.value;
}
if (isString(x) || isString(y)) {
return x < y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.smaller);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.smaller(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('smaller', x, y);
};
/**
* Check if value a is smaller or equal to b
*
* a <= b
* smallereq(a, b)
*
* For matrices, the function is evaluated element wise.
* In case of complex numbers, the absolute values of a and b are compared.
*
* @param {Number | Complex | Unit | String | Array | Matrix} x
* @param {Number | Complex | Unit | String | Array | Matrix} y
* @return {Boolean | Array | Matrix} res
*/
math.smallereq = function smallereq(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('smallereq', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x <= y;
}
else if (y instanceof Complex) {
return x <= math.abs(y);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return math.abs(x) <= y;
}
else if (y instanceof Complex) {
return math.abs(x) <= math.abs(y);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value <= y.value;
}
if (isString(x) || isString(y)) {
return x <= y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.smallereq);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.smallereq(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('smallereq', x, y);
};
/**
* Calculate the square root of a value
*
* sqrt(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.sqrt = function sqrt (x) {
if (arguments.length != 1) {
throw newArgumentsError('sqrt', arguments.length, 1);
}
if (isNumber(x)) {
if (x >= 0) {
return Math.sqrt(x);
}
else {
return math.sqrt(new Complex(x, 0));
}
}
if (x instanceof Complex) {
var r = Math.sqrt(x.re * x.re + x.im * x.im);
if (x.im >= 0) {
return Complex.create(
0.5 * Math.sqrt(2.0 * (r + x.re)),
0.5 * Math.sqrt(2.0 * (r - x.re))
);
}
else {
return Complex.create(
0.5 * Math.sqrt(2.0 * (r + x.re)),
-0.5 * Math.sqrt(2.0 * (r - x.re))
);
}
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.sqrt);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.sqrt(x.valueOf());
}
throw newUnsupportedTypeError('sqrt', x);
};
/**
* Compute the square of a value
*
* x .* x
* square(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.square = function square(x) {
if (arguments.length != 1) {
throw newArgumentsError('square', arguments.length, 1);
}
if (isNumber(x)) {
return x * x;
}
if (x instanceof Complex) {
return math.multiply(x, x);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.square);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.square(x.valueOf());
}
throw newUnsupportedTypeError('square', x);
};
/**
* Subtract two values
*
* x - y
* subtract(x, y)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @param {Number | Complex | Unit | Array | Matrix} y
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.subtract = function subtract(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('subtract', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
// number - number
return x - y;
}
else if (y instanceof Complex) {
// number - complex
return Complex.create (
x - y.re,
- y.im
);
}
}
else if (x instanceof Complex) {
if (isNumber(y)) {
// complex - number
return Complex.create (
x.re - y,
x.im
)
}
else if (y instanceof Complex) {
// complex - complex
return Complex.create (
x.re - y.re,
x.im - y.im
)
}
}
else if (x instanceof Unit) {
if (y instanceof Unit) {
if (!x.equalBase(y)) {
throw new Error('Units do not match');
}
if (x.value == null) {
throw new Error('Unit on left hand side of operator - has an undefined value');
}
if (y.value == null) {
throw new Error('Unit on right hand side of operator - has an undefined value');
}
var res = x.clone();
res.value -= y.value;
res.fixPrefix = false;
return res;
}
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.subtract);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.subtract(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('subtract', x, y);
};
/**
* Inverse the sign of a value.
*
* -x
* unary(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Unit | Array | Matrix} res
*/
math.unary = function unary(x) {
if (arguments.length != 1) {
throw newArgumentsError('unary', arguments.length, 1);
}
if (isNumber(x)) {
return -x;
}
else if (x instanceof Complex) {
return Complex.create(
-x.re,
-x.im
);
}
else if (x instanceof Unit) {
var res = x.clone();
res.value = -x.value;
return res;
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.unary);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.unary(x.valueOf());
}
throw newUnsupportedTypeError('unary', x);
};
// TODO: deprecated since version 0.10.0, cleanup some day
math.unaryminus = function unaryminus(x) {
throw new Error('Function unaryminus is deprecated, use unary instead');
};
/**
* Check if value x unequals y, x != y
* In case of complex numbers, x.re must unequal y.re, or x.im must unequal y.im
* @param {Number | Complex | Unit | String | Array | Matrix | Range} x
* @param {Number | Complex | Unit | String | Array | Matrix | Range} y
* @return {Boolean | Array | Matrix} res
*/
math.unequal = function unequal(x, y) {
if (arguments.length != 2) {
throw newArgumentsError('unequal', arguments.length, 2);
}
if (isNumber(x)) {
if (isNumber(y)) {
return x != y;
}
else if (y instanceof Complex) {
return (x != y.re) || (y.im != 0);
}
}
if (x instanceof Complex) {
if (isNumber(y)) {
return (x.re != y) || (x.im != 0);
}
else if (y instanceof Complex) {
return (x.re != y.re) || (x.im != y.im);
}
}
if ((x instanceof Unit) && (y instanceof Unit)) {
if (!x.equalBase(y)) {
throw new Error('Cannot compare units with different base');
}
return x.value != y.value;
}
if (isString(x) || isString(y)) {
return x != y;
}
if (x instanceof Array || x instanceof Matrix ||
y instanceof Array || y instanceof Matrix) {
return util.map2(x, y, math.unequal);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.unequal(x.valueOf(), y.valueOf());
}
throw newUnsupportedTypeError('unequal', x, y);
};
/**
* Calculate the extended greatest common divisor for two values.
*
* xgcd(a, b)
*
* @param {Number} a An integer number
* @param {Number} b An integer number
* @return {Array} An array containing 3 integers [div, m, n]
* where div = gcd(a, b) and a*m + b*n = div
*
* @see http://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
*/
math.xgcd = function xgcd(a, b) {
if (arguments.length == 2) {
// two arguments
if (isNumber(a) && isNumber(b)) {
if (!isInteger(a) || !isInteger(b)) {
throw new Error('Parameters in function xgcd must be integer numbers');
}
if(b == 0) {
return [a, 1, 0];
}
var tmp = xgcd(b, a % b),
div = tmp[0],
x = tmp[1],
y = tmp[2];
return [div, y, x - y * Math.floor(a / b)];
}
throw newUnsupportedTypeError('xgcd', a, b);
}
// zero or one argument
throw new SyntaxError('Function xgcd expects two arguments');
};
/**
* Compute the argument of a complex value.
* If x = a + bi, the argument is computed as atan2(b, a).
*
* arg(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Array | Matrix} res
*/
math.arg = function arg(x) {
if (arguments.length != 1) {
throw newArgumentsError('arg', arguments.length, 1);
}
if (isNumber(x)) {
return Math.atan2(0, x);
}
if (x instanceof Complex) {
return Math.atan2(x.im, x.re);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.arg);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.arg(x.valueOf());
}
// handle other types just as non-complex values
return math.atan2(0, x);
};
/**
* Compute the complex conjugate of a complex value.
* If x = a+bi, the complex conjugate is a-bi.
*
* conj(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.conj = function conj(x) {
if (arguments.length != 1) {
throw newArgumentsError('conj', arguments.length, 1);
}
if (isNumber(x)) {
return x;
}
if (x instanceof Complex) {
return Complex.create(x.re, -x.im);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.conj);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.conj(x.valueOf());
}
// return a clone of the value for non-complex values
return clone(x);
};
/**
* Get the imaginary part of a complex number.
*
* im(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Array | Matrix} im
*/
math.im = function im(x) {
if (arguments.length != 1) {
throw newArgumentsError('im', arguments.length, 1);
}
if (isNumber(x)) {
return 0;
}
if (x instanceof Complex) {
return x.im;
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.im);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.im(x.valueOf());
}
// return 0 for all non-complex values
return 0;
};
/**
* Get the real part of a complex number.
*
* re(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Array | Matrix} re
*/
math.re = function re(x) {
if (arguments.length != 1) {
throw newArgumentsError('re', arguments.length, 1);
}
if (isNumber(x)) {
return x;
}
if (x instanceof Complex) {
return x.re;
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.re);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.re(x.valueOf());
}
// return a clone of the value itself for all non-complex values
return math.clone(x);
};
/**
* Create a complex value. Depending on the passed arguments, the function
* will create and return a new math.type.Complex object.
*
* The method accepts the following arguments:
* complex() creates a complex value with zero
* as real and imaginary part.
* complex(re : number, im : string) creates a complex value with provided
* values for real and imaginary part.
* complex(arg : string) parses a string into a complex value.
*
* Example usage:
* var a = math.complex(3, -4); // 3 - 4i
* a.re = 5; // a = 5 - 4i
* var i = a.im; // -4;
* var b = math.complex('2 + 6i'); // 2 + 6i
* var c = math.complex(); // 0 + 0i
* var d = math.add(a, b); // 5 + 2i
*
* @param {*} [args]
* @return {Complex} value
*/
math.complex = function complex(args) {
switch (arguments.length) {
case 0:
// no parameters. Set re and im zero
return new Complex(0, 0);
break;
case 1:
// parse string into a complex number
var arg = arguments[0];
if (arg instanceof Complex) {
// create a clone
return arg.clone();
}
else if (isString(arg)) {
var c = Complex.parse(arg);
if (c) {
return c;
}
else {
throw new SyntaxError('String "' + arg + '" is no valid complex number');
}
}
else {
throw new TypeError(
'Two numbers or a single string expected in function complex');
}
break;
case 2:
// re and im provided
return new Complex(arguments[0], arguments[1]);
break;
default:
throw newArgumentsError('complex', arguments.length, 0, 2);
}
};
/**
* Create a matrix. The function creates a new math.type.Matrix object.
*
* The method accepts the following arguments:
* matrix() creates an empty matrix
* matrix(data) creates a matrix with initial data.
*
* Example usage:
* var m = matrix([[1, 2], [3, 4]);
* m.size(); // [2, 2]
* m.resize([3, 2], 5);
* m.valueOf(); // [[1, 2], [3, 4], [5, 5]]
* m.get([1, 0]) // 3
*
* @param {Array | Matrix} [data] A multi dimensional array
* @return {Matrix} matrix
*/
math.matrix = function matrix(data) {
if (arguments.length > 1) {
throw newArgumentsError('matrix', arguments.length, 0, 1);
}
return new Matrix(data);
};
/**
* Create a number or convert a string to a number
* @param {String | Number | Boolean} [value]
* @return {Number} num
*/
math.number = function (value) {
switch (arguments.length) {
case 0:
return 0;
case 1:
var num = Number(value);
if (isNaN(num)) {
num = Number(value.valueOf());
}
if (isNaN(num)) {
throw new SyntaxError(value.toString() + ' is no valid number');
}
return num;
default:
throw newArgumentsError('number', arguments.length, 0, 1);
}
};
/**
* Create a parser. The function creates a new math.expr.Parser object.
*
* parser()
*
* Example usage:
* var parser = new math.parser();
*
* // evaluate expressions
* var a = parser.eval('sqrt(3^2 + 4^2)'); // 5
* var b = parser.eval('sqrt(-4)'); // 2i
* var c = parser.eval('2 inch in cm'); // 5.08 cm
* var d = parser.eval('cos(45 deg)'); // 0.7071067811865476
*
* // define variables and functions
* parser.eval('x = 7 / 2'); // 3.5
* parser.eval('x + 3'); // 6.5
* parser.eval('function f(x, y) = x^y'); // f(x, y)
* parser.eval('f(2, 3)'); // 8
*
* // get and set variables and functions
* var x = parser.get('x'); // 7
* var f = parser.get('f'); // function
* var g = f(3, 2); // 9
* parser.set('h', 500);
* var i = parser.eval('h / 2'); // 250
* parser.set('hello', function (name) {
* return 'hello, ' + name + '!';
* });
* parser.eval('hello("user")'); // "hello, user!"
*
* // clear defined functions and variables
* parser.clear();
*
* @return {math.expr.Parser} Parser
*/
math.parser = function parser() {
return new math.expr.Parser();
};
/**
* Create a range. The function creates a new math.type.Range object.
*
* A range works similar to an Array, with functions like
* forEach and map. However, a Range object is very cheap to create compared to
* a large Array with indexes, as it stores only a start, step and end value of
* the range.
*
* The method accepts the following arguments
* range(str) Create a range from a string, where the
* string contains the start, optional step,
* and end, separated by a colon.
* range(start, end) Create a range with start and end and a
* default step size of 1
* range(start, step, end) Create a range with start, step, and end.
*
* Example usage:
* var c = math.range(2, 1, 5); // 2:1:5
* c.toArray(); // [2, 3, 4, 5]
* var d = math.range(2, -1, -2); // 2:-1:-2
* d.forEach(function (value, index) {
* console.log(index, value);
* });
* var e = math.range('2:1:5'); // 2:1:5
*
* @param {...*} args
* @return {Range} range
*/
math.range = function range(args) {
switch (arguments.length) {
case 1:
// parse string into a range
if (args instanceof Range) {
// create a clone
return args.clone();
}
else if (isString(args)) {
var r = Range.parse(args);
if (r) {
return r;
}
else {
throw new SyntaxError('String "' + r + '" is no valid range');
}
}
else {
throw new TypeError(
'Two or three numbers or a single string expected in function range');
}
break;
case 2:
// range(start, end)
return new Range(arguments[0], null, arguments[1]);
break;
case 3:
// range(start, step, end)
return new Range(arguments[0], arguments[1], arguments[2]);
break;
default:
throw newArgumentsError('range', arguments.length, 2, 3);
}
};
/**
* Create a string or convert any object into a string
* @param {*} [value]
* @return {String} str
*/
math.string = function (value) {
switch (arguments.length) {
case 0:
return '';
case 1:
return _toString(value);
default:
throw newArgumentsError('string', arguments.length, 0, 1);
}
};
/**
* Recursive toString function
* @param {*} value Value can be anything: number, string, array, Matrix, ...
* @returns {String} str
* @private
*/
function _toString(value) {
if (value instanceof Array || value instanceof Matrix || value instanceof Range) {
var array = value.valueOf();
var str = '[';
var len = array.length;
for (var i = 0; i < len; i++) {
if (i != 0) {
str += ', ';
}
str += _toString(array[i]);
}
str += ']';
return str;
}
else if (isNumber(value)) {
return util.formatNumber(value); // no digits specified
}
else {
return value.toString();
}
}
/**
* Create a unit. Depending on the passed arguments, the function
* will create and return a new math.type.Unit object.
*
* The method accepts the following arguments:
* unit(unit : string)
* unit(value : number, unit : string
*
* Example usage:
* var a = math.unit(5, 'cm'); // 50 mm
* var b = math.unit('23 kg'); // 23 kg
* var c = math.in(a, math.unit('m'); // 0.05 m
*
* @param {*} args
* @return {Unit} value
*/
math.unit = function unit(args) {
switch(arguments.length) {
case 1:
// parse a string
var arg = arguments[0];
if (arg instanceof Unit) {
// create a clone of the unit
return arg.clone();
}
else if (isString(arg)) {
if (Unit.isPlainUnit(arg)) {
return new Unit(null, arg); // a pure unit
}
var u = Unit.parse(arg); // a unit with value, like '5cm'
if (u) {
return u;
}
throw new SyntaxError('String "' + arg + '" is no valid unit');
}
else {
throw new TypeError('A string or a number and string expected in function unit');
}
break;
case 2:
// a number and a unit
return new Unit(arguments[0], arguments[1]);
break;
default:
throw newArgumentsError('unit', arguments.length, 1, 2);
}
};
math.workspace = function () {
throw new Error('Workspace is no longer supported, sorry...');
};
/**
* Concatenate two or more matrices
* Usage:
* math.concat(A, B, C, ...)
* math.concat(A, B, C, ..., dim)
*
* Where the optional dim is the one-based number of the dimension to be
* concatenated.
*
* @param {... Array | Matrix} args
* @return {Array | Matrix} res
*/
math.concat = function concat (args) {
var i,
len = arguments.length,
dim = -1, // one-based dimension
prevDim,
asMatrix = false,
matrices = []; // contains multi dimensional arrays
for (i = 0; i < len; i++) {
var arg = arguments[i];
// test whether we need to return a Matrix (if not we return an Array)
if (arg instanceof Matrix) {
asMatrix = true;
}
if ((i == len - 1) && isNumber(arg)) {
// last argument contains the dimension on which to concatenate
prevDim = dim;
dim = arg;
if (!isInteger(dim) || dim < 1) {
throw new TypeError('Dimension number must be a positive integer ' +
'(dim = ' + dim + ')');
}
if (i > 0 && dim > prevDim) {
throw new RangeError('Dimension out of range ' +
'(' + dim + ' > ' + prevDim + ')');
}
}
else if (arg instanceof Array || arg instanceof Matrix) {
// this is a matrix or array
var matrix = math.clone(arg).valueOf();
var size = math.size(arg).valueOf();
matrices[i] = matrix;
prevDim = dim;
dim = size.length;
// verify whether each of the matrices has the same number of dimensions
if (i > 0 && dim != prevDim) {
throw new RangeError('Dimension mismatch ' +
'(' + prevDim + ' != ' + dim + ')');
}
}
else {
throw newUnsupportedTypeError('concat', arg);
}
}
if (matrices.length == 0) {
throw new SyntaxError('At least one matrix expected');
}
var res = matrices.shift();
while (matrices.length) {
res = _concat(res, matrices.shift(), dim - 1, 0);
}
return asMatrix ? new Matrix(res) : res;
};
/**
* Recursively concatenate two matrices.
* The contents of the matrices is not cloned.
* @param {Array} a Multi dimensional array
* @param {Array} b Multi dimensional array
* @param {Number} concatDim The dimension on which to concatenate (zero-based)
* @param {Number} dim The current dim (zero-based)
* @return {Array} c The concatenated matrix
* @private
*/
function _concat(a, b, concatDim, dim) {
if (dim < concatDim) {
// recurse into next dimension
if (a.length != b.length) {
throw new Error('Dimensions mismatch (' + a.length + ' != ' + b.length + ')');
}
var c = [];
for (var i = 0; i < a.length; i++) {
c[i] = _concat(a[i], b[i], concatDim, dim + 1);
}
return c;
}
else {
// concatenate this dimension
return a.concat(b);
}
}
/**
* @constructor det
* Calculate the determinant of a matrix
*
* det(x)
*
* @param {Array | Matrix} x
* @return {Number} determinant
*/
math.det = function det (x) {
if (arguments.length != 1) {
throw newArgumentsError('det', arguments.length, 1);
}
var size = math.size(x).valueOf();
switch (size.length) {
case 0:
// scalar
return math.clone(x);
break;
case 1:
// vector
if (size[0] == 1) {
return math.clone(x.valueOf()[0]);
}
else {
throw new RangeError('Matrix must be square ' +
'(size: ' + math.format(size) + ')');
}
break;
case 2:
// two dimensional array
var rows = size[0];
var cols = size[1];
if (rows == cols) {
return _det(x.valueOf(), rows, cols);
}
else {
throw new RangeError('Matrix must be square ' +
'(size: ' + math.format(size) + ')');
}
break;
default:
// multi dimensional array
throw new RangeError('Matrix must be two dimensional ' +
'(size: ' + math.format(size) + ')');
}
};
/**
* Calculate the determinant of a matrix
* @param {Array[]} matrix A square, two dimensional matrix
* @param {Number} rows Number of rows of the matrix (zero-based)
* @param {Number} cols Number of columns of the matrix (zero-based)
* @returns {Number} det
* @private
*/
function _det (matrix, rows, cols) {
var multiply = math.multiply,
subtract = math.subtract;
if (rows == 1) {
// this is a 1 x 1 matrix
return matrix[0][0];
}
else if (rows == 2) {
// this is a 2 x 2 matrix
// the determinant of [a11,a12;a21,a22] is det = a11*a22-a21*a12
return subtract(
multiply(matrix[0][0], matrix[1][1]),
multiply(matrix[1][0], matrix[0][1])
);
}
else {
// this is an n x n matrix
var det = 1;
var lead = 0;
for (var r = 0; r < rows; r++) {
if (lead >= cols) {
break;
}
var i = r;
// Find the pivot element.
while (matrix[i][lead] == 0) {
i++;
if (i == rows) {
i = r;
lead++;
if (lead == cols) {
// We found the last pivot.
if (util.deepEqual(matrix, math.eye(rows).valueOf())) {
return math.round(det, 6);
} else {
return 0;
}
}
}
}
if (i != r) {
// Swap rows i and r, which negates the determinant.
for (var a = 0; a < cols; a++) {
var temp = matrix[i][a];
matrix[i][a] = matrix[r][a];
matrix[r][a] = temp;
}
det *= -1;
}
// Scale row r and the determinant simultaneously.
var div = matrix[r][lead];
for (var a = 0; a < cols; a++) {
matrix[r][a] = matrix[r][a] / div;
}
det *= div;
// Back-substitute upwards.
for (var j = 0; j < rows; j++) {
if (j != r) {
// Taking linear combinations does not change the det.
var c = matrix[j][lead];
for (var a = 0; a < cols; a++) {
matrix[j][a] = matrix[j][a] - matrix[r][a] * c;
}
}
}
lead++; // Now looking for a pivot further right.
}
// If reduction did not result in the identity, the matrix is singular.
if (util.deepEqual(matrix, math.eye(rows).valueOf())) {
return math.round(det, 6);
} else {
return 0;
}
}
}
/**
* Create a diagonal matrix or retrieve the diagonal of a matrix
*
* diag(v)
* diag(v, k)
* diag(X)
* diag(X, k)
*
* TODO: more documentation on diag
*
* @param {Number | Matrix | Array} x
* @param {Number} [k]
* @return {Matrix} matrix
*/
math.diag = function diag (x, k) {
var data, vector, i, iMax;
if (arguments.length != 1 && arguments.length != 2) {
throw newArgumentsError('diag', arguments.length, 1, 2);
}
if (k) {
if (!isNumber(k) || !isInteger(k)) {
throw new TypeError ('Second parameter in function diag must be an integer');
}
}
else {
k = 0;
}
var kSuper = k > 0 ? k : 0;
var kSub = k < 0 ? -k : 0;
// convert to matrix
if (!(x instanceof Matrix) && !(x instanceof Range)) {
x = new Matrix(x);
}
// get as array when the matrix is a vector
var s;
if (x.isVector()) {
x = x.toVector();
s = [x.length];
}
else {
s = x.size();
}
switch (s.length) {
case 1:
// x is a vector. create diagonal matrix
vector = x.valueOf();
var matrix = new Matrix();
matrix.resize([vector.length + kSub, vector.length + kSuper]);
data = matrix.valueOf();
iMax = vector.length;
for (i = 0; i < iMax; i++) {
data[i + kSub][i + kSuper] = math.clone(vector[i]);
}
return matrix;
break;
case 2:
// x is a matrix get diagonal from matrix
vector = [];
data = x.valueOf();
iMax = Math.min(s[0] - kSub, s[1] - kSuper);
for (i = 0; i < iMax; i++) {
vector[i] = math.clone(data[i + kSub][i + kSuper]);
}
return new Matrix(vector);
break;
default:
throw new RangeError('Matrix for function diag must be 2 dimensional');
}
};
/**
* Create an identity matrix with size m x n
*
* eye(m)
* eye(m, n)
*
* TODO: more documentation on eye
*
* @param {...Number | Matrix | Array} size
* @return {Matrix} matrix
*/
math.eye = function eye (size) {
var args = util.argsToArray(arguments);
if (args.length == 0) {
args = [1, 1];
}
else if (args.length == 1) {
args[1] = args[0];
}
else if (args.length > 2) {
throw newArgumentsError('eye', args.length, 0, 2);
}
var rows = args[0],
cols = args[1];
if (!isNumber(rows) || !isInteger(rows) || rows < 1) {
throw new Error('Parameters in function eye must be positive integers');
}
if (cols) {
if (!isNumber(cols) || !isInteger(cols) || cols < 1) {
throw new Error('Parameters in function eye must be positive integers');
}
}
// create and args the matrix
var matrix = new Matrix();
matrix.resize(args);
// fill in ones on the diagonal
var min = math.min(args);
var data = matrix.valueOf();
for (var d = 0; d < min; d++) {
data[d][d] = 1;
}
return matrix;
};
/**
* Calculate the inverse of a matrix
*
* inv(x)
*
* TODO: more documentation on inv
*
* @param {Array | Matrix} x
* @return {Array | Matrix} inv
*/
math.inv = function inv (x) {
if (arguments.length != 1) {
throw newArgumentsError('inv', arguments.length, 1);
}
var size = math.size(x).valueOf();
switch (size.length) {
case 0:
// scalar
return math.divide(1, x);
break;
case 1:
// vector
if (size[0] == 1) {
if (x instanceof Matrix) {
return new Matrix([
math.divide(1, x.valueOf()[0])
]);
}
else {
return [
math.divide(1, x[0])
];
}
}
else {
throw new RangeError('Matrix must be square ' +
'(size: ' + math.format(size) + ')');
}
break;
case 2:
// two dimensional array
var rows = size[0];
var cols = size[1];
if (rows == cols) {
if (x instanceof Matrix) {
return new Matrix(
_inv(x.valueOf(), rows, cols)
);
}
else {
// return an Array
return _inv(x, rows, cols);
}
}
else {
throw new RangeError('Matrix must be square ' +
'(size: ' + math.format(size) + ')');
}
break;
default:
// multi dimensional array
throw new RangeError('Matrix must be two dimensional ' +
'(size: ' + math.format(size) + ')');
}
};
/**
* Calculate the inverse of a square matrix
* @param {Array[]} matrix A square matrix
* @param {Number} rows Number of rows
* @param {Number} cols Number of columns, must equal rows
* @return {Array[]} inv Inverse matrix
* @private
*/
function _inv (matrix, rows, cols){
var r, s, f, value, temp,
add = math.add,
unary = math.unary,
multiply = math.multiply,
divide = math.divide;
if (rows == 1) {
// this is a 1 x 1 matrix
value = matrix[0][0];
if (value == 0) {
throw Error('Cannot calculate inverse, determinant is zero');
}
return [[
divide(1, value)
]];
}
else if (rows == 2) {
// this is a 2 x 2 matrix
var det = math.det(matrix);
if (det == 0) {
throw Error('Cannot calculate inverse, determinant is zero');
}
return [
[
divide(matrix[1][1], det),
divide(unary(matrix[0][1]), det)
],
[
divide(unary(matrix[1][0]), det),
divide(matrix[0][0], det)
]
];
}
else {
// this is a matrix of 3 x 3 or larger
// calculate inverse using gauss-jordan elimination
// http://en.wikipedia.org/wiki/Gaussian_elimination
// http://mathworld.wolfram.com/MatrixInverse.html
// http://math.uww.edu/~mcfarlat/inverse.htm
// make a copy of the matrix (only the arrays, not of the elements)
var A = matrix.concat();
for (r = 0; r < rows; r++) {
A[r] = A[r].concat();
}
// create an identity matrix which in the end will contain the
// matrix inverse
var B = math.eye(rows).valueOf();
// loop over all columns, and perform row reductions
for (var c = 0; c < cols; c++) {
// element Acc should be non zero. if not, swap content
// with one of the lower rows
r = c;
while (r < rows && A[r][c] == 0) {
r++;
}
if (r == rows || A[r][c] == 0) {
throw Error('Cannot calculate inverse, determinant is zero');
}
if (r != c) {
temp = A[c]; A[c] = A[r]; A[r] = temp;
temp = B[c]; B[c] = B[r]; B[r] = temp;
}
// eliminate non-zero values on the other rows at column c
var Ac = A[c],
Bc = B[c];
for (r = 0; r < rows; r++) {
var Ar = A[r],
Br = B[r];
if(r != c) {
// eliminate value at column c and row r
if (Ar[c] != 0) {
f = divide(unary(Ar[c]), Ac[c]);
// add (f * row c) to row r to eliminate the value
// at column c
for (s = c; s < cols; s++) {
Ar[s] = add(Ar[s], multiply(f, Ac[s]));
}
for (s = 0; s < cols; s++) {
Br[s] = add(Br[s], multiply(f, Bc[s]));
}
}
}
else {
// normalize value at Acc to 1,
// divide each value on row r with the value at Acc
f = Ac[c];
for (s = c; s < cols; s++) {
Ar[s] = divide(Ar[s], f);
}
for (s = 0; s < cols; s++) {
Br[s] = divide(Br[s], f);
}
}
}
}
return B;
}
}
/**
* Create a matrix filled with ones
*
* ones(n)
* ones(m, n)
* ones([m, n])
* ones([m, n, p, ...])
*
* @param {...Number | Array} size
* @return {Matrix} matrix
*/
math.ones = function ones (size) {
var args = util.argsToArray(arguments);
if (args.length == 0) {
args = [1, 1];
}
else if (args.length == 1) {
args[1] = args[0];
}
// create and size the matrix
var matrix = new Matrix();
var defaultValue = 1;
matrix.resize(args, defaultValue);
return matrix;
};
/**
* Calculate the size of a matrix or scalar
*
* size(x)
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.size = function size (x) {
if (arguments.length != 1) {
throw newArgumentsError('size', arguments.length, 1);
}
if (isNumber(x) || x instanceof Complex || x instanceof Unit || x == null) {
return [];
}
if (isString(x)) {
return [x.length];
}
if (x instanceof Array) {
return util.size(x);
}
if (x instanceof Matrix) {
return new Matrix(x.size());
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.size(x.valueOf());
}
throw newUnsupportedTypeError('size', x);
};
/**
* Remove singleton dimensions from a matrix
*
* squeeze(x)
*
* @param {Matrix | Array} x
* @return {Matrix | Array} res
*/
math.squeeze = function squeeze (x) {
if (arguments.length != 1) {
throw newArgumentsError('squeeze', arguments.length, 1);
}
if (x instanceof Array) {
return _squeezeArray(math.clone(x));
}
else if (x instanceof Matrix) {
return math.matrix(_squeezeArray(x.toArray()));
}
else if (x.valueOf() instanceof Array) {
return _squeezeArray(math.clone(x.valueOf()));
}
else {
// scalar
return math.clone(x);
}
};
/**
* Recursively squeeze a multi dimensional array
* @param {Array} array
* @return {Array} array
* @private
*/
function _squeezeArray(array) {
if (array.length == 1) {
// squeeze this array
return _squeezeArray(array[0]);
}
else {
// process all childs
for (var i = 0, len = array.length; i < len; i++) {
var child = array[i];
if (child instanceof Array) {
array[i] = _squeezeArray(child);
}
}
return array;
}
}
/**
* Get or set a subset of a matrix or string
*
* Usage:
* var subset = math.subset(value, index) // retrieve subset
* var value = math.subset(value, index, replacement) // replace subset
*
* Where:
* {*} value An array, matrix, or scalar value
* {Array} index An array containing index values
* {*} replacement An array, matrix, or scalar
*
* @param args
* @return res
*/
math.subset = function subset (args) {
switch (arguments.length) {
case 2: // get subset
return _getSubset(arguments[0], arguments[1]);
case 3: // set subset
return _setSubset(arguments[0], arguments[1], arguments[2]);
default: // wrong number of arguments
throw newArgumentsError('subset', arguments.length, 2, 3);
}
};
/**
* Retrieve a subset of an value such as an Array, Matrix, or String
* @param {*} value Object from which to get a subset
* @param {Array[] | Range[] | Number[] | Matrix} index
* Two dimensional array (size 1 x n) containing
* the indexes to be retrieved. Can also be a two
* dimensional Matrix (size 1 x n), or an Array
* (size 1) containing a Range or a Number.
* @returns {*} subset
* @private
*/
function _getSubset(value, index) {
var matrix, subset;
if (value instanceof Array || value instanceof Range) {
matrix = math.matrix(value);
subset = matrix.get(index);
return subset.valueOf();
}
else if (value instanceof Matrix) {
return value.get(index);
}
else if (isString(value)) {
return _getSubstring(value, index);
}
else {
// scalar
matrix = math.matrix([value]);
subset = matrix.get(index);
return subset.valueOf();
}
}
/**
* Retrieve a subset of a string
* @param {String} str String from which to get a substring
* @param {Array[] | Range[] | Number[] | Matrix} index
* Two dimensional array (size 1 x n) containing
* the indexes to be retrieved. Can also be a two
* dimensional Matrix (size 1 x n), or an Array
* (size 1) containing a Range or a Number.
* @returns {string} substring
* @private
*/
function _getSubstring(str, index) {
var i, len;
index = index.valueOf(); // cast from matrix or range to array
if (index.length != 1) {
throw new RangeError('Dimension mismatch (' + index.length + ' != 1)');
}
if (index instanceof Array) {
index = index[0]; // read first dimension
}
index = index.valueOf(); // cast from matrix or range to array
if (!(index instanceof Array)) {
index = [index];
}
var substr = '';
var strLen = str.length;
for (i = 0, len = index.length; i < len; i++) {
var index_i = index[i];
util.validateIndex(index_i, strLen);
substr += str.charAt(index_i - 1); // index_i is one based
}
return substr;
}
/**
* Replace a subset in an value such as an Array, Matrix, or String
* @param {*} value Object to be replaced
* @param {Array[] | Range[] | Number[] | Matrix} index
* Two dimensional array (size 1 x n) containing
* the indexes to be replaced. Can also be a two
* dimensional Matrix (size 1 x n), or an Array
* (size 1) containing a Range.
* @param {String} replacement
* @returns {*} result
* @private
*/
function _setSubset(value, index, replacement) {
if (value instanceof Array || value instanceof Range) {
var matrix = math.matrix(math.clone(value));
matrix.set(index, replacement);
return matrix.valueOf();
}
else if (value instanceof Matrix) {
return value.clone().set(index, replacement);
}
else if (isString(value)) {
return _setSubstring(value, index, replacement);
}
else {
// scalar
matrix = math.matrix([value]);
matrix.set(index, replacement);
if (matrix.isScalar()) {
// still a scalar
return matrix.toScalar();
}
else {
// changed into a matrix. return array
return matrix.valueOf();
}
}
}
/**
* Replace a substring in a string
* @param {String} str String to be replaced
* @param {Array[] | Range[] | Number[] | Matrix} index
* Two dimensional array (size 1 x n) containing
* the indexes to be replaced. Can also be a two
* dimensional Matrix (size 1 x n), or an Array
* (size 1) containing a Range.
* @param {String} replacement Replacement string
* @returns {string} result
* @private
*/
function _setSubstring(str, index, replacement) {
var i, len;
index = index.valueOf(); // cast from matrix or range to array
if (index.length != 1) {
throw new RangeError('Dimension mismatch (' + index.length + ' != 1)');
}
if (index instanceof Array) {
index = index[0]; // read first dimension
}
index = index.valueOf(); // cast from matrix or range to array
if (!(index instanceof Array)) {
index = [index];
}
if (index.length != replacement.length) {
throw new RangeError('Dimension mismatch ' +
'(' + index.length + ' != ' + replacement.length + ')');
}
// copy the string into an array with characters
var strLen = str.length;
var chars = [];
for (i = 0; i < strLen; i++) {
chars[i] = str.charAt(i);
}
for (i = 0, len = index.length; i < len; i++) {
var index_i = index[i];
util.validateIndex(index_i);
chars[index_i - 1] = replacement.charAt(i); // index_i is one based
}
// initialize undefined characters with a space
if (chars.length > strLen) {
for (i = strLen - 1, len = chars.length; i < len; i++) {
if (!chars[i]) {
chars[i] = ' ';
}
}
}
return chars.join('');
}
/**
* Create the transpose of a matrix
*
* transpose(x)
*
* @param {Array | Matrix} x
* @return {Array | Matrix} transpose
*/
math.transpose = function transpose (x) {
if (arguments.length != 1) {
throw newArgumentsError('transpose', arguments.length, 1);
}
var size = math.size(x).valueOf();
switch (size.length) {
case 0:
// scalar
return math.clone(x);
break;
case 1:
// vector
// TODO: is it logic to return a 1 dimensional vector itself as transpose?
return math.clone(x);
break;
case 2:
// two dimensional array
var rows = size[1], // index 1 is no error
cols = size[0], // index 0 is no error
asMatrix = x instanceof Matrix,
array = x.valueOf(),
transposed = [],
transposedRow,
clone = math.clone;
for (var r = 0; r < rows; r++) {
transposedRow = transposed[r] = [];
for (var c = 0; c < cols; c++) {
transposedRow[c] = clone(array[c][r]);
}
}
if (cols == 0) {
transposed[0] = [];
}
return asMatrix ? new Matrix(transposed) : transposed;
break;
default:
// multi dimensional array
throw new RangeError('Matrix must be two dimensional ' +
'(size: ' + math.format(size) + ')');
}
};
/**
* create a matrix filled with zeros
*
* zeros(n)
* zeros(m, n)
* zeros([m, n])
* zeros([m, n, p, ...])
*
* @param {...Number | Array} size
* @return {Matrix} matrix
*/
math.zeros = function zeros (size) {
var args = util.argsToArray(arguments);
if (args.length == 0) {
args = [1, 1];
}
else if (args.length == 1) {
args[1] = args[0];
}
// create and size the matrix
var matrix = new Matrix();
matrix.resize(args);
return matrix;
};
/**
* Compute the factorial of a value
*
* x!
* factorial(x)
*
* Factorial only supports an integer value as argument.
* For matrices, the function is evaluated element wise.
*
* @Param {Number | Array | Matrix} x
* @return {Number | Array | Matrix} res
*/
math.factorial = function factorial (x) {
if (arguments.length != 1) {
throw newArgumentsError('factorial', arguments.length, 1);
}
if (isNumber(x)) {
if (!isInteger(x) || x < 0) {
throw new TypeError('Positive integer value expected in function factorial');
}
var value = x,
res = value;
value--;
while (value > 1) {
res *= value;
value--;
}
if (res == 0) {
res = 1; // 0! is per definition 1
}
return res;
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.factorial);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.factorial(x.valueOf());
}
throw newUnsupportedTypeError('factorial', x);
};
/**
* Return a random number between 0 and 1
*
* random()
*
* @return {Number} res
*/
math.random = function random () {
if (arguments.length != 0) {
throw newArgumentsError('random', arguments.length, 0);
}
// TODO: implement parameter min and max
return Math.random();
};
/**
* Compute the maximum value of a list of values
*
* max(a, b, c, ...)
* max([a, b, c, ...])
*
* @param {... *} args A single matrix or or multiple scalar values
* @return {*} res
*/
math.max = function max(args) {
if (arguments.length == 0) {
throw new Error('Function max requires one or more parameters (0 provided)');
}
if (args instanceof Array || args instanceof Matrix || args instanceof Range) {
// max([a, b, c, d, ...]])
if (arguments.length > 1) {
throw Error('Wrong number of parameters (1 matrix or multiple scalars expected)');
}
var size = math.size(args).valueOf();
if (size.length == 1) {
// vector
if (args.length == 0) {
throw new Error('Cannot calculate max of an empty vector');
}
return _max(args.valueOf());
}
else if (size.length == 2) {
// 2 dimensional matrix
if (size[0] == 0 || size[1] == 0) {
throw new Error('Cannot calculate max of an empty matrix');
}
if (args instanceof Array) {
return _max2(args, size[0], size[1]);
}
else if (args instanceof Matrix || args instanceof Range) {
return new Matrix(_max2(args.valueOf(), size[0], size[1]));
}
else {
throw newUnsupportedTypeError('max', args);
}
}
else {
// TODO: implement max for n-dimensional matrices
throw new RangeError('Cannot calculate max for multi dimensional matrix');
}
}
else {
// max(a, b, c, d, ...)
return _max(arguments);
}
};
/**
* Calculate the max of a one dimensional array
* @param {Array} array
* @return {Number} max
* @private
*/
function _max(array) {
var larger = math.larger;
var res = array[0];
for (var i = 1, iMax = array.length; i < iMax; i++) {
var value = array[i];
if (larger(value, res)) {
res = value;
}
}
return res;
}
/**
* Calculate the max of a two dimensional array
* @param {Array} array
* @param {Number} rows
* @param {Number} cols
* @return {Number[]} max
* @private
*/
function _max2(array, rows, cols) {
var larger = math.larger;
var res = [];
for (var c = 0; c < cols; c++) {
var max = array[0][c];
for (var r = 1; r < rows; r++) {
var value = array[r][c];
if (larger(value, max)) {
max = value;
}
}
res[c] = max;
}
return res;
}
/**
* Compute the minimum value of a list of values
*
* min(a, b, c, ...)
* min([a, b, c, ...])
*
* @param {... *} args A single matrix or multiple scalars
* @return {*} res
*/
math.min = function min(args) {
if (arguments.length == 0) {
throw new Error('Function min requires one or more parameters (0 provided)');
}
if (args instanceof Array || args instanceof Matrix || args instanceof Range) {
// min([a, b, c, d, ...]])
if (arguments.length > 1) {
throw Error('Wrong number of parameters (1 matrix or multiple scalars expected)');
}
var size = math.size(args).valueOf();
if (size.length == 1) {
// vector
if (args.length == 0) {
throw new Error('Cannot calculate min of an empty vector');
}
return _min(args.valueOf());
}
else if (size.length == 2) {
// 2 dimensional matrix
if (size[0] == 0 || size[1] == 0) {
throw new Error('Cannot calculate min of an empty matrix');
}
if (args instanceof Array) {
return _min2(args, size[0], size[1]);
}
else if (args instanceof Matrix || args instanceof Range) {
return new Matrix(_min2(args.valueOf(), size[0], size[1]));
}
else {
throw newUnsupportedTypeError('min', args);
}
}
else {
// TODO: implement min for n-dimensional matrices
throw new RangeError('Cannot calculate min for multi dimensional matrix');
}
}
else {
// min(a, b, c, d, ...)
return _min(arguments);
}
};
/**
* Calculate the min of a one dimensional array
* @param {Array} array
* @return {Number} min
* @private
*/
function _min(array) {
var smaller = math.smaller;
var res = array[0];
for (var i = 1, iMax = array.length; i < iMax; i++) {
var value = array[i];
if (smaller(value, res)) {
res = value;
}
}
return res;
}
/**
* Calculate the min of a two dimensional array
* @param {Array} array
* @param {Number} rows
* @param {Number} cols
* @return {Number[]} min
* @private
*/
function _min2(array, rows, cols) {
var smaller = math.smaller;
var res = [];
for (var c = 0; c < cols; c++) {
var min = array[0][c];
for (var r = 1; r < rows; r++) {
var value = array[r][c];
if (smaller(value, min)) {
min = value;
}
}
res[c] = min;
}
return res;
}
/**
* Calculate the inverse cosine of a value
*
* acos(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/InverseCosine.html
*/
math.acos = function acos(x) {
if (arguments.length != 1) {
throw newArgumentsError('acos', arguments.length, 1);
}
if (isNumber(x)) {
if (x >= -1 && x <= 1) {
return Math.acos(x);
}
else {
return math.acos(new Complex(x, 0));
}
}
if (x instanceof Complex) {
// acos(z) = 0.5*pi + i*log(iz + sqrt(1-z^2))
var temp1 = Complex.create(
x.im * x.im - x.re * x.re + 1.0,
-2.0 * x.re * x.im
);
var temp2 = math.sqrt(temp1);
var temp3;
if (temp2 instanceof Complex) {
temp3 = Complex.create(
temp2.re - x.im,
temp2.im + x.re
)
}
else {
temp3 = Complex.create(
temp2 - x.im,
x.re
)
}
var temp4 = math.log(temp3);
// 0.5*pi = 1.5707963267948966192313216916398
if (temp4 instanceof Complex) {
return Complex.create(
1.57079632679489661923 - temp4.im,
temp4.re
);
}
else {
return new Complex(
1.57079632679489661923,
temp4
);
}
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.acos);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.acos(x.valueOf());
}
throw newUnsupportedTypeError('acos', x);
};
/**
* Calculate the inverse sine of a value
*
* asin(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/InverseSine.html
*/
math.asin = function asin(x) {
if (arguments.length != 1) {
throw newArgumentsError('asin', arguments.length, 1);
}
if (isNumber(x)) {
if (x >= -1 && x <= 1) {
return Math.asin(x);
}
else {
return math.asin(new Complex(x, 0));
}
}
if (x instanceof Complex) {
// asin(z) = -i*log(iz + sqrt(1-z^2))
var re = x.re;
var im = x.im;
var temp1 = Complex.create(
im * im - re * re + 1.0,
-2.0 * re * im
);
var temp2 = math.sqrt(temp1);
var temp3;
if (temp2 instanceof Complex) {
temp3 = Complex.create(
temp2.re - im,
temp2.im + re
);
}
else {
temp3 = Complex.create(
temp2 - im,
re
);
}
var temp4 = math.log(temp3);
if (temp4 instanceof Complex) {
return Complex.create(temp4.im, -temp4.re);
}
else {
return Complex.create(0, -temp4);
}
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.asin);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.asin(x.valueOf());
}
throw newUnsupportedTypeError('asin', x);
};
/**
* Calculate the inverse tangent of a value
*
* atan(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/InverseTangent.html
*/
math.atan = function atan(x) {
if (arguments.length != 1) {
throw newArgumentsError('atan', arguments.length, 1);
}
if (isNumber(x)) {
return Math.atan(x);
}
if (x instanceof Complex) {
// atan(z) = 1/2 * i * (ln(1-iz) - ln(1+iz))
var re = x.re;
var im = x.im;
var den = re * re + (1.0 - im) * (1.0 - im);
var temp1 = Complex.create(
(1.0 - im * im - re * re) / den,
(-2.0 * re) / den
);
var temp2 = math.log(temp1);
if (temp2 instanceof Complex) {
return Complex.create(
-0.5 * temp2.im,
0.5 * temp2.re
);
}
else {
return Complex.create(
0,
0.5 * temp2
);
}
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.atan);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.atan(x.valueOf());
}
throw newUnsupportedTypeError('atan', x);
};
/**
* Computes the principal value of the arc tangent of y/x in radians
*
* atan2(y, x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Array | Matrix} y
* @param {Number | Complex | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/InverseTangent.html
*/
math.atan2 = function atan2(y, x) {
if (arguments.length != 2) {
throw newArgumentsError('atan2', arguments.length, 2);
}
if (isNumber(y)) {
if (isNumber(x)) {
return Math.atan2(y, x);
}
/* TODO: support for complex computation of atan2
else if (x instanceof Complex) {
return Math.atan2(y.re, x.re);
}
*/
}
else if (y instanceof Complex) {
if (isNumber(x)) {
return Math.atan2(y.re, x);
}
/* TODO: support for complex computation of atan2
else if (x instanceof Complex) {
return Math.atan2(y.re, x.re);
}
*/
}
if (y instanceof Array || y instanceof Matrix ||
x instanceof Array || x instanceof Matrix) {
return util.map2(y, x, math.atan2);
}
if (x.valueOf() !== x || y.valueOf() !== y) {
// fallback on the objects primitive values
return math.atan2(y.valueOf(), x.valueOf());
}
throw newUnsupportedTypeError('atan2', y, x);
};
/**
* Calculate the cosine of a value
*
* cos(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/Cosine.html
*/
math.cos = function cos(x) {
if (arguments.length != 1) {
throw newArgumentsError('cos', arguments.length, 1);
}
if (isNumber(x)) {
return Math.cos(x);
}
if (x instanceof Complex) {
// cos(z) = (exp(iz) + exp(-iz)) / 2
return Complex.create(
0.5 * Math.cos(x.re) * (Math.exp(-x.im) + Math.exp(x.im)),
0.5 * Math.sin(x.re) * (Math.exp(-x.im) - Math.exp(x.im))
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function cos is no angle');
}
return Math.cos(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.cos);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.cos(x.valueOf());
}
throw newUnsupportedTypeError('cos', x);
};
/**
* Calculate the cotangent of a value. cot(x) is defined as 1 / tan(x)
*
* cot(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.cot = function cot(x) {
if (arguments.length != 1) {
throw newArgumentsError('cot', arguments.length, 1);
}
if (isNumber(x)) {
return 1 / Math.tan(x);
}
if (x instanceof Complex) {
var den = Math.exp(-4.0 * x.im) -
2.0 * Math.exp(-2.0 * x.im) * Math.cos(2.0 * x.re) + 1.0;
return Complex.create(
2.0 * Math.exp(-2.0 * x.im) * Math.sin(2.0 * x.re) / den,
(Math.exp(-4.0 * x.im) - 1.0) / den
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function cot is no angle');
}
return 1 / Math.tan(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.cot);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.cot(x.valueOf());
}
throw newUnsupportedTypeError('cot', x);
};
/**
* Calculate the cosecant of a value, csc(x) = 1/sin(x)
*
* csc(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.csc = function csc(x) {
if (arguments.length != 1) {
throw newArgumentsError('csc', arguments.length, 1);
}
if (isNumber(x)) {
return 1 / Math.sin(x);
}
if (x instanceof Complex) {
// csc(z) = 1/sin(z) = (2i) / (exp(iz) - exp(-iz))
var den = 0.25 * (Math.exp(-2.0 * x.im) + Math.exp(2.0 * x.im)) -
0.5 * Math.cos(2.0 * x.re);
return Complex.create (
0.5 * Math.sin(x.re) * (Math.exp(-x.im) + Math.exp(x.im)) / den,
0.5 * Math.cos(x.re) * (Math.exp(-x.im) - Math.exp(x.im)) / den
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function csc is no angle');
}
return 1 / Math.sin(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.csc);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.csc(x.valueOf());
}
throw newUnsupportedTypeError('csc', x);
};
/**
* Calculate the secant of a value, sec(x) = 1/cos(x)
*
* sec(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*/
math.sec = function sec(x) {
if (arguments.length != 1) {
throw newArgumentsError('sec', arguments.length, 1);
}
if (isNumber(x)) {
return 1 / Math.cos(x);
}
if (x instanceof Complex) {
// sec(z) = 1/cos(z) = 2 / (exp(iz) + exp(-iz))
var den = 0.25 * (Math.exp(-2.0 * x.im) + Math.exp(2.0 * x.im)) +
0.5 * Math.cos(2.0 * x.re);
return Complex.create(
0.5 * Math.cos(x.re) * (Math.exp(-x.im) + Math.exp( x.im)) / den,
0.5 * Math.sin(x.re) * (Math.exp( x.im) - Math.exp(-x.im)) / den
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function sec is no angle');
}
return 1 / Math.cos(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.sec);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.sec(x.valueOf());
}
throw newUnsupportedTypeError('sec', x);
};
/**
* Calculate the sine of a value
*
* sin(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/Sine.html
*/
math.sin = function sin(x) {
if (arguments.length != 1) {
throw newArgumentsError('sin', arguments.length, 1);
}
if (isNumber(x)) {
return Math.sin(x);
}
if (x instanceof Complex) {
return Complex.create(
0.5 * Math.sin(x.re) * (Math.exp(-x.im) + Math.exp( x.im)),
0.5 * Math.cos(x.re) * (Math.exp( x.im) - Math.exp(-x.im))
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function cos is no angle');
}
return Math.sin(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.sin);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.sin(x.valueOf());
}
throw newUnsupportedTypeError('sin', x);
};
/**
* Calculate the tangent of a value
*
* tan(x)
*
* For matrices, the function is evaluated element wise.
*
* @param {Number | Complex | Unit | Array | Matrix} x
* @return {Number | Complex | Array | Matrix} res
*
* @see http://mathworld.wolfram.com/Tangent.html
*/
math.tan = function tan(x) {
if (arguments.length != 1) {
throw newArgumentsError('tan', arguments.length, 1);
}
if (isNumber(x)) {
return Math.tan(x);
}
if (x instanceof Complex) {
var den = Math.exp(-4.0 * x.im) +
2.0 * Math.exp(-2.0 * x.im) * Math.cos(2.0 * x.re) +
1.0;
return Complex.create(
2.0 * Math.exp(-2.0 * x.im) * Math.sin(2.0 * x.re) / den,
(1.0 - Math.exp(-4.0 * x.im)) / den
);
}
if (x instanceof Unit) {
if (!x.hasBase(Unit.BASE_UNITS.ANGLE)) {
throw new TypeError ('Unit in function tan is no angle');
}
return Math.tan(x.value);
}
if (x instanceof Array || x instanceof Matrix) {
return util.map(x, math.tan);
}
if (x.valueOf() !== x) {
// fallback on the objects primitive value
return math.tan(x.valueOf());
}
throw newUnsupportedTypeError('tan', x);
};
/**
* Change the unit of a value.
*
* x in unit
* in(x, unit)
*
* For matrices, the function is evaluated element wise.
*
* @param {Unit | Array | Matrix} x
* @param {Unit | Array | Matrix} unit
* @return {Unit | Array | Matrix} res
*/
math['in'] = function unit_in(x, unit) {
if (arguments.length != 2) {
throw newArgumentsError('in', arguments.length, 2);
}
if (x instanceof Unit) {
if (unit instanceof Unit || isString(unit)) {
return x['in'](unit);
}
}
// TODO: add support for string, in that case, convert to unit
if (x instanceof Array || x instanceof Matrix ||
unit instanceof Array || unit instanceof Matrix) {
return util.map2(x, unit, math['in']);
}
if (x.valueOf() !== x || unit.valueOf() !== unit) {
// fallback on the objects primitive value
return math['in'](x.valueOf(), unit.valueOf());
}
throw newUnsupportedTypeError('in', x, unit);
};
/**
* Clone an object
*
* clone(x)
*
* @param {*} x
* @return {*} clone
*/
math.clone = function clone(x) {
if (arguments.length != 1) {
throw newArgumentsError('clone', arguments.length, 1);
}
if (x == null) {
// null or undefined
return x;
}
if (typeof(x.clone) === 'function') {
return x.clone();
}
if (isNumber(x) || isString(x) || isBoolean(x)) {
return x;
}
if (x instanceof Array) {
var c = math.clone;
return x.map(function (value) {
return c(value);
});
}
if (x instanceof Object) {
return util.mapObject(x, math.clone);
}
throw newUnsupportedTypeError('clone', x);
};
/**
* Evaluate an expression.
*
* Syntax:
*
* math.eval(expr)
* math.eval(expr, scope)
* math.eval([expr1, expr2, expr3, ...])
* math.eval([expr1, expr2, expr3, ...], scope)
*
* Example:
*
* math.eval('(2+3)/4'); // 1.25
* math.eval('sqrt(3^2 + 4^2)'); // 5
* math.eval('sqrt(-4)'); // 2i
* math.eval(['a=3', 'b=4', 'a*b']);, // [3, 4, 12]
*
* var scope = {a:3, b:4};
* math.eval('a * b', scope); // 12
*
* @param {String | String[] | Matrix} expr
* @param {math.expr.Scope | Object} [scope]
* @return {*} res
* @throws {Error}
*/
math.eval = function (expr, scope) {
if (arguments.length != 1 && arguments.length != 2) {
throw newArgumentsError('eval', arguments.length, 1, 2);
}
// instantiate a scope
var evalScope;
if (scope) {
if (scope instanceof math.expr.Scope) {
evalScope = scope;
}
else {
evalScope = new math.expr.Scope(scope);
}
}
else {
evalScope = new math.expr.Scope();
}
if (isString(expr)) {
// evaluate a single expression
var node = math.parse(expr, evalScope);
return node.eval();
}
else if (expr instanceof Array || expr instanceof Matrix) {
// evaluate an array or matrix with expressions
return util.map(expr, function (elem) {
var node = math.parse(elem, evalScope);
return node.eval();
});
}
else {
// oops
throw new TypeError('String or matrix expected');
}
};
/**
* Format a value of any type into a string. Interpolate values into the string.
* Numbers are rounded off to a maximum number of 5 digits by default.
* Usage:
* math.format(value)
* math.format(template, object)
*
* Example usage:
* math.format(2/7); // '0.28571'
* math.format(new Complex(2, 3)); // '2 + 3i'
* math.format('Hello $name! The date is $date', {
* name: 'user',
* date: new Date().toISOString().substring(0, 10)
* }); // 'hello user! The date is 2013-03-23'
*
* @param {String} template
* @param {Object} values
* @return {String} str
*/
math.format = function format(template, values) {
var num = arguments.length;
if (num != 1 && num != 2) {
throw newArgumentsError('format', num, 1, 2);
}
if (num == 1) {
// just format a value as string
var value = arguments[0];
if (isNumber(value)) {
return util.formatNumber(value, math.options.precision);
}
if (value instanceof Array) {
return util.formatArray(value);
}
if (isString(value)) {
return '"' + value + '"';
}
if (value instanceof Object) {
return value.toString();
}
return String(value);
}
else {
if (!isString(template)) {
throw new TypeError('String expected as first parameter in function format');
}
if (!(values instanceof Object)) {
throw new TypeError('Object expected as first parameter in function format');
}
// format values into a string
return template.replace(/\$([\w\.]+)/g, function (original, key) {
var keys = key.split('.');
var value = values[keys.shift()];
while (keys.length && value != undefined) {
var k = keys.shift();
value = k ? value[k] : value + '.';
}
return value != undefined ? value : original;
}
);
}
};
/**
* Retrieve help on a function or data type.
* Help files are retrieved from the documentation in math.docs.
* @param {function | string | Object} search
* @return {Help} help
*/
math.help = function help(search) {
if (arguments.length != 1) {
throw new SyntaxError('Wrong number of arguments in function help ' +
'(' + arguments.length + ' provided, 1 expected)');
}
var text = null;
if ((search instanceof String) || (typeof(search) === 'string')) {
text = search;
}
else {
var prop;
for (prop in math) {
// search in functions and constants
if (math.hasOwnProperty(prop)) {
if (search === math[prop]) {
text = prop;
break;
}
}
}
if (!text) {
// search data type
for (prop in math.type) {
if (math.type.hasOwnProperty(prop)) {
if (search === math.type[prop]) {
text = prop;
break;
}
}
}
}
}
if (!text) {
throw new Error('Could not find search term "' + search + '"');
}
else {
var doc = math.docs[text];
if (!doc) {
throw new Error('No documentation found on "' + text + '"');
}
return new Help(doc);
}
};
/**
* Import functions from an object or a file
* @param {function | String | Object} object
* @param {Object} [options] Available options:
* {Boolean} override
* If true, existing functions will be
* overwritten. False by default.
* {Boolean} wrap
* If true (default), the functions will
* be wrapped in a wrapper function which
* converts data types like Matrix to
* primitive data types like Array.
* The wrapper is needed when extending
* math.js with libraries which do not
* support the math.js data types.
*/
// TODO: return status information
math['import'] = function math_import(object, options) {
var name;
var opts = {
override: false,
wrap: true
};
if (options && options instanceof Object) {
util.extend(opts, options);
}
if (isString(object)) {
// a string with a filename
if (typeof (require) !== 'undefined') {
// load the file using require
var _module = require(object);
math['import'](_module);
}
else {
throw new Error('Cannot load file: require not available.');
}
}
else if (isSupportedType(object)) {
// a single function
name = object.name;
if (name) {
if (opts.override || math[name] === undefined) {
_import(name, object, opts);
}
}
else {
throw new Error('Cannot import an unnamed function or object');
}
}
else if (object instanceof Object) {
// a map with functions
for (name in object) {
if (object.hasOwnProperty(name)) {
var value = object[name];
if (isSupportedType(value)) {
_import(name, value, opts);
}
else {
math['import'](value);
}
}
}
}
};
/**
* Add a property to the math namespace and create a chain proxy for it.
* @param {String} name
* @param {*} value
* @param {Object} options See import for a description of the options
* @private
*/
function _import(name, value, options) {
if (options.override || math[name] === undefined) {
// add to math namespace
if (options.wrap && typeof value === 'function') {
// create a wrapper around the function
math[name] = function () {
var args = [];
for (var i = 0, len = arguments.length; i < len; i++) {
args[i] = arguments[i].valueOf();
}
return value.apply(math, args);
};
}
else {
// just create a link to the function or value
math[name] = value;
}
// create a proxy for the Selector
createSelectorProxy(name, value);
}
}
/**
* Check whether given object is a supported type
* @param object
* @return {Boolean}
* @private
*/
function isSupportedType(object) {
return (typeof object == 'function') ||
isNumber(object) || isString(object) ||
(object instanceof Complex) || (object instanceof Unit);
// TODO: add boolean?
}
(function () {
/**
* Parse an expression. Returns a node tree, which can be evaluated by
* invoking node.eval();
*
* Syntax:
*
* math.parse(expr)
* math.parse(expr, scope)
* math.parse([expr1, expr2, expr3, ...])
* math.parse([expr1, expr2, expr3, ...], scope)
*
* Example:
*
* var node = math.parse('sqrt(3^2 + 4^2)');
* node.eval(); // 5
*
* var scope = {a:3, b:4}
* var node = math.parse('a * b', scope); // 12
* node.eval(); // 12
* scope.a = 5;
* node.eval(); // 20
*
* var nodes = math.parse(['a = 3', 'b = 4', 'a * b']);
* nodes[2].eval(); // 12
*
* @param {String | String[] | Matrix} expr
* @param {math.expr.Scope | Object} [scope]
* @return {Node | Node[]} node
* @throws {Error}
*/
math.parse = function (expr, scope) {
if (arguments.length != 1 && arguments.length != 2) {
throw newArgumentsError('parse', arguments.length, 1, 2);
}
// instantiate a scope
var parseScope;
if (scope) {
if (scope instanceof math.expr.Scope) {
parseScope = scope;
}
else {
parseScope = new math.expr.Scope(scope);
}
}
else {
parseScope = new math.expr.Scope();
}
if (isString(expr)) {
// parse a single expression
expression = expr || '';
return parse_start(parseScope);
}
else if (expr instanceof Array || expr instanceof Matrix) {
// parse an array or matrix with expressions
return util.map(expr, function (elem) {
expression = elem || '';
return parse_start(parseScope);
});
}
else {
// oops
throw new TypeError('String or matrix expected');
}
};
// token types enumeration
var TOKENTYPE = {
NULL : 0,
DELIMITER : 1,
NUMBER : 2,
SYMBOL : 3,
UNKNOWN : 4
};
// map with all delimiters
var DELIMITERS = {
',': true,
'(': true,
')': true,
'[': true,
']': true,
'\"': true,
'\n': true,
';': true,
'+': true,
'-': true,
'*': true,
'.*': true,
'/': true,
'./': true,
'%': true,
'^': true,
'.^': true,
'!': true,
'\'': true,
'=': true,
':': true,
'==': true,
'!=': true,
'<': true,
'>': true,
'<=': true,
'>=': true
};
var handlers = math.expr.node.handlers;
var expression = ''; // current expression
var index = 0; // current index in expr
var c = ''; // current token character in expr
var token = ''; // current token
var token_type = TOKENTYPE.NULL; // type of the token
/**
* Get the first character from the expression.
* The character is stored into the char c. If the end of the expression is
* reached, the function puts an empty string in c.
* @private
*/
function first() {
index = 0;
c = expression.charAt(0);
}
/**
* Get the next character from the expression.
* The character is stored into the char c. If the end of the expression is
* reached, the function puts an empty string in c.
* @private
*/
function next() {
index++;
c = expression.charAt(index);
}
/**
* Preview the next character from the expression.
* @return {String} cNext
* @private
*/
function nextPreview() {
return expression.charAt(index + 1);
}
/**
* Get next token in the current string expr.
* The token and token type are available as token and token_type
* @private
*/
function getToken() {
token_type = TOKENTYPE.NULL;
token = '';
// skip over whitespaces
while (c == ' ' || c == '\t') { // space or tab
next();
}
// skip comment
if (c == '#') {
while (c != '\n' && c != '') {
next();
}
}
// check for end of expression
if (c == '') {
// token is still empty
token_type = TOKENTYPE.DELIMITER;
return;
}
// check for delimiters consisting of 2 characters
var c2 = c + nextPreview();
if (DELIMITERS[c2]) {
token_type = TOKENTYPE.DELIMITER;
token = c2;
next();
next();
return;
}
// check for delimiters consisting of 1 character
if (DELIMITERS[c]) {
token_type = TOKENTYPE.DELIMITER;
token = c;
next();
return;
}
// check for a number
if (isDigitDot(c)) {
token_type = TOKENTYPE.NUMBER;
// get number, can have a single dot
if (c == '.') {
token += c;
next();
if (!isDigit(c)) {
// this is no legal number, it is just a dot
token_type = TOKENTYPE.UNKNOWN;
}
}
else {
while (isDigit(c)) {
token += c;
next();
}
if (c == '.') {
token += c;
next();
}
}
while (isDigit(c)) {
token += c;
next();
}
// check for scientific notation like "2.3e-4" or "1.23e50"
if (c == 'E' || c == 'e') {
token += c;
next();
if (c == '+' || c == '-') {
token += c;
next();
}
// Scientific notation MUST be followed by an exponent
if (!isDigit(c)) {
// this is no legal number, exponent is missing.
token_type = TOKENTYPE.UNKNOWN;
}
while (isDigit(c)) {
token += c;
next();
}
}
return;
}
// check for variables or functions
if (isAlpha(c)) {
token_type = TOKENTYPE.SYMBOL;
while (isAlpha(c) || isDigit(c)) {
token += c;
next();
}
return;
}
// something unknown is found, wrong characters -> a syntax error
token_type = TOKENTYPE.UNKNOWN;
while (c != '') {
token += c;
next();
}
throw createSyntaxError('Syntax error in part "' + token + '"');
}
/**
* Check if a given name is valid
* if not, an error is thrown
* @param {String} name
* @return {boolean} valid
* @private
*/
// TODO: check for valid symbol name
function isValidSymbolName (name) {
for (var i = 0, iMax = name.length; i < iMax; i++) {
var c = name.charAt(i);
//var valid = (isAlpha(c) || (i > 0 && isDigit(c))); // TODO: allow digits in symbol name
var valid = (isAlpha(c));
if (!valid) {
return false;
}
}
return true;
}
/**
* checks if the given char c is a letter (upper or lower case)
* or underscore
* @param {String} c a string with one character
* @return {Boolean}
* @private
*/
function isAlpha (c) {
return ((c >= 'a' && c <= 'z') ||
(c >= 'A' && c <= 'Z') ||
c == '_');
}
/**
* checks if the given char c is a digit or dot
* @param {String} c a string with one character
* @return {Boolean}
* @private
*/
function isDigitDot (c) {
return ((c >= '0' && c <= '9') ||
c == '.');
}
/**
* checks if the given char c is a digit
* @param {String} c a string with one character
* @return {Boolean}
* @private
*/
function isDigit (c) {
return ((c >= '0' && c <= '9'));
}
/**
* Start of the parse levels below, in order of precedence
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_start (scope) {
// get the first character in expression
first();
getToken();
var node;
if (token == '') {
// empty expression
node = new ConstantNode(undefined);
}
else {
node = parse_block(scope);
}
// check for garbage at the end of the expression
// an expression ends with a empty character '' and token_type DELIMITER
if (token != '') {
if (token_type == TOKENTYPE.DELIMITER) {
// user entered a not existing operator like "//"
// TODO: give hints for aliases, for example with "<>" give as hint " did you mean != ?"
throw createError('Unknown operator ' + token);
}
else {
throw createSyntaxError('Unexpected part "' + token + '"');
}
}
return node;
}
/**
* Parse a block with expressions. Expressions can be separated by a newline
* character '\n', or by a semicolon ';'. In case of a semicolon, no output
* of the preceding line is returned.
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_block (scope) {
var node, block, visible;
if (token != '\n' && token != ';' && token != '') {
node = parse_ans(scope);
}
while (token == '\n' || token == ';') {
if (!block) {
// initialize the block
block = new BlockNode();
if (node) {
visible = (token != ';');
block.add(node, visible);
}
}
getToken();
if (token != '\n' && token != ';' && token != '') {
node = parse_ans(scope);
visible = (token != ';');
block.add(node, visible);
}
}
if (block) {
return block;
}
if (!node) {
node = parse_ans(scope);
}
return node;
}
/**
* Parse assignment of ans.
* Ans is assigned when the expression itself is no variable or function
* assignment
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_ans (scope) {
var expression = parse_function_assignment(scope);
// create a variable definition for ans
var name = 'ans';
return new AssignmentNode(name, expression, scope);
}
/**
* Parse a function assignment like "function f(a,b) = a*b"
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_function_assignment (scope) {
// TODO: keyword 'function' must become a reserved keyword
if (token_type == TOKENTYPE.SYMBOL && token == 'function') {
// get function name
getToken();
if (token_type != TOKENTYPE.SYMBOL) {
throw createSyntaxError('Function name expected');
}
var name = token;
// get parenthesis open
getToken();
if (token != '(') {
throw createSyntaxError('Opening parenthesis ( expected');
}
// get function variables
var functionScope = scope.createSubScope();
var variables = [];
while (true) {
getToken();
if (token_type == TOKENTYPE.SYMBOL) {
// store variable name
variables.push(token);
}
else {
throw createSyntaxError('Variable name expected');
}
getToken();
if (token == ',') {
// ok, nothing to do, read next variable
}
else if (token == ')') {
// end of variable list encountered. break loop
break;
}
else {
throw createSyntaxError('Comma , or closing parenthesis ) expected"');
}
}
getToken();
if (token != '=') {
throw createSyntaxError('Equal sign = expected');
}
// parse the expression, with the correct function scope
getToken();
var expression = parse_assignment(functionScope);
return new FunctionNode(name, variables, expression, functionScope, scope);
}
return parse_assignment(scope);
}
/**
* Assignment of a variable, can be a variable like "a=2.3" or a updating an
* existing variable like "matrix(2,3:5)=[6,7,8]"
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_assignment (scope) {
var name, params, paramScopes, expr;
var node = parse_range(scope);
if (token == '=') {
if (node instanceof SymbolNode) {
// parse the expression, with the correct function scope
getToken();
name = node.name;
params = null;
expr = parse_assignment(scope);
return new AssignmentNode(name, expr, scope);
}
else if (node instanceof ParamsNode && node.object instanceof SymbolNode) {
// parse the expression, with the correct function scope
getToken();
name = node.object.name;
params = node.params;
paramScopes = node.paramScopes;
expr = parse_assignment(scope);
return new UpdateNode(name, params, paramScopes, expr, scope);
}
else {
throw createSyntaxError('Symbol expected at the left hand side ' +
'of assignment operator =');
}
}
return node;
}
/**
* parse range, "start:end", "start:step:end", ":", "start:", ":end", etc
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_range (scope) {
var node, name, fn, params = [];
if (token == ':') {
// implicit start=1
node = new ConstantNode(1);
}
else {
// explicit start
node = parse_conditions(scope);
}
if (token == ':') {
params.push(node);
// parse step and end
while (token == ':') {
getToken();
if (token == ')' || token == ',' || token == '') {
// implicit end
params.push(new SymbolNode('end', scope));
}
else {
// explicit end
params.push(parse_conditions(scope));
}
}
if (params.length) {
// create a range constructor
name = 'range';
fn = math.range;
node = new OperatorNode(name, fn, params);
}
}
return node;
}
/**
* conditions like and, or, in
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_conditions (scope) {
var node, operators, name, fn, params;
node = parse_bitwise_conditions(scope);
// TODO: precedence of And above Or?
// TODO: implement a method for unit to number conversion
operators = {
'in' : 'in'
/* TODO: implement conditions
'and' : 'and',
'&&' : 'and',
'or': 'or',
'||': 'or',
'xor': 'xor'
*/
};
while (operators[token] !== undefined) {
name = token;
fn = math[operators[name]];
getToken();
params = [node, parse_bitwise_conditions(scope)];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* conditional operators and bitshift
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_bitwise_conditions (scope) {
var node = parse_comparison(scope);
/* TODO: implement bitwise conditions
var operators = {
'&' : 'bitwiseand',
'|' : 'bitwiseor',
// todo: bitwise xor?
'<<': 'bitshiftleft',
'>>': 'bitshiftright'
};
while (operators[token] !== undefined) {
var name = token;
var fn = math[operators[name]];
getToken();
var params = [node, parse_comparison()];
node = new OperatorNode(name, fn, params);
}
*/
return node;
}
/**
* comparison operators
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_comparison (scope) {
var node, operators, name, fn, params;
node = parse_addsubtract(scope);
operators = {
'==': 'equal',
'!=': 'unequal',
'<': 'smaller',
'>': 'larger',
'<=': 'smallereq',
'>=': 'largereq'
};
while (operators[token] !== undefined) {
name = token;
fn = math[operators[name]];
getToken();
params = [node, parse_addsubtract(scope)];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* add or subtract
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_addsubtract (scope) {
var node, operators, name, fn, params;
node = parse_multiplydivide(scope);
operators = {
'+': 'add',
'-': 'subtract'
};
while (operators[token] !== undefined) {
name = token;
fn = math[operators[name]];
getToken();
params = [node, parse_multiplydivide(scope)];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* multiply, divide, modulus
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_multiplydivide (scope) {
var node, operators, name, fn, params;
node = parse_unary(scope);
operators = {
'*': 'multiply',
'.*': 'emultiply',
'/': 'divide',
'./': 'edivide',
'%': 'mod',
'mod': 'mod'
};
while (operators[token] !== undefined) {
name = token;
fn = math[operators[name]];
getToken();
params = [node, parse_unary(scope)];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* Unary minus
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_unary (scope) {
var name, fn, params;
if (token == '-') {
name = token;
fn = math.unary;
getToken();
params = [parse_pow(scope)];
return new OperatorNode(name, fn, params);
}
return parse_pow(scope);
}
/**
* power
* Node: power operator is right associative
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_pow (scope) {
var node, leftNode, nodes, ops, name, fn, params;
nodes = [
parse_factorial(scope)
];
ops = [];
// stack all operands of a chained power operator (like '2^3^3')
while (token == '^' || token == '.^') {
ops.push(token);
getToken();
nodes.push(parse_factorial(scope));
}
// evaluate the operands from right to left (right associative)
node = nodes.pop();
while (nodes.length) {
leftNode = nodes.pop();
name = ops.pop();
fn = (name == '^') ? math.pow : math.epow;
params = [leftNode, node];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* Factorial
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_factorial (scope) {
var node, name, fn, params;
node = parse_transpose(scope);
while (token == '!') {
name = token;
fn = math.factorial;
getToken();
params = [node];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* Transpose
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_transpose (scope) {
var node, name, fn, params;
node = parse_node_handler(scope);
while (token == '\'') {
name = token;
fn = math.transpose;
getToken();
params = [node];
node = new OperatorNode(name, fn, params);
}
return node;
}
/**
* Parse a custom node handler. A node handler can be used to process
* nodes in a custom way, for example for handling a plot.
*
* A handler must be defined in the namespace math.expr.node.handlers,
* and must extend math.expr.node.Node, and the handler must contain
* functions eval(), find(filter), and toString().
*
* For example:
*
* math.expr.node.handlers['plot'] = PlotHandler;
*
* The constructor of the handler is called as:
*
* node = new PlotHandler(params, paramScopes);
*
* The handler will be invoked when evaluating an expression like:
*
* node = math.parse('plot(sin(x), x)');
*
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_node_handler (scope) {
var params,
paramScopes,
paramScope,
handler;
if (token_type == TOKENTYPE.SYMBOL && handlers[token]) {
handler = handlers[token];
getToken();
// parse parameters
if (token == '(') {
params = [];
paramScopes = [];
getToken();
if (token != ')') {
paramScope = scope.createSubScope();
paramScopes.push(paramScope);
params.push(parse_range(paramScope));
// parse a list with parameters
while (token == ',') {
getToken();
paramScope = scope.createSubScope();
paramScopes.push(paramScope);
params.push(parse_range(paramScope));
}
}
if (token != ')') {
throw createSyntaxError('Parenthesis ) expected');
}
getToken();
}
// create a new node handler
//noinspection JSValidateTypes
return new handler(params, paramScopes);
}
return parse_symbol(scope);
}
/**
* parse symbols: functions, variables, constants, units
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_symbol (scope) {
var node, name;
if (token_type == TOKENTYPE.SYMBOL) {
name = token;
getToken();
// create a symbol
node = new SymbolNode(name, scope);
// parse parameters
return parse_params(scope, node);
}
return parse_string(scope);
}
/**
* parse parameters, enclosed in parenthesis
* @param {math.expr.Scope} scope
* @param {Node} node Node on which to apply the parameters. If there
* are no parameters in the expression, the node
* itself is returned
* @return {Node} node
* @private
*/
function parse_params (scope, node) {
var params,
paramScopes,
paramScope;
while (token == '(') {
params = [];
paramScopes = [];
getToken();
if (token != ')') {
paramScope = scope.createSubScope();
paramScopes.push(paramScope);
params.push(parse_range(paramScope));
// parse a list with parameters
while (token == ',') {
getToken();
paramScope = scope.createSubScope();
paramScopes.push(paramScope);
params.push(parse_range(paramScope));
}
}
if (token != ')') {
throw createSyntaxError('Parenthesis ) expected');
}
getToken();
node = new ParamsNode(node, params, paramScopes);
}
return node;
}
/**
* parse a string.
* A string is enclosed by double quotes
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_string (scope) {
var node, str, tPrev;
if (token == '"') {
// string "..."
str = '';
tPrev = '';
while (c != '' && (c != '\"' || tPrev == '\\')) { // also handle escape character
str += c;
tPrev = c;
next();
}
getToken();
if (token != '"') {
throw createSyntaxError('End of string " expected');
}
getToken();
// create constant
node = new ConstantNode(str);
// parse parameters
node = parse_params(scope, node);
return node;
}
return parse_matrix(scope);
}
/**
* parse the matrix
* @param {math.expr.Scope} scope
* @return {Node} A MatrixNode
* @private
*/
function parse_matrix (scope) {
var array, params, r, c, rows, cols;
if (token == '[') {
// matrix [...]
// skip newlines
getToken();
while (token == '\n') {
getToken();
}
// check if this is an empty matrix "[ ]"
if (token != ']') {
// this is a non-empty matrix
params = [];
r = 0;
c = 0;
params[0] = [parse_assignment(scope)];
// the columns in the matrix are separated by commas, and the rows by dot-comma's
while (token == ',' || token == ';') {
if (token == ',') {
c++;
}
else {
r++;
c = 0;
params[r] = [];
}
// skip newlines
getToken();
while (token == '\n') {
getToken();
}
params[r][c] = parse_assignment(scope);
// skip newlines
while (token == '\n') {
getToken();
}
}
// TODO: spaces as separator for matrix columns
/*
// the columns in the matrix are separated by commas or spaces,
// and the rows by dot-comma's
while (token && token != ']') {
if (token == ';') {
r++;
c = 0;
params[r] = [];
getToken();
}
else if (token == ',') {
c++;
getToken();
}
else {
c++;
}
// skip newlines
while (token == '\n') {
getToken();
}
//TODO: math.eval('[1 -2 3]') is evaluated as '[(1-2) 3]' instead of '[(1) (-2) (3)]'
//TODO: '[(1) (-2) (3)]' doesn't work
params[r][c] = parse_assignment(scope);
// skip newlines
while (token == '\n') {
getToken();
}
}
*/
rows = params.length;
cols = (params.length > 0) ? params[0].length : 0;
// check if the number of columns matches in all rows
for (r = 1; r < rows; r++) {
if (params[r].length != cols) {
throw createError('Number of columns must match ' +
'(' + params[r].length + ' != ' + cols + ')');
}
}
if (token != ']') {
throw createSyntaxError('End of matrix ] expected');
}
getToken();
array = new MatrixNode(params);
}
else {
// this is an empty matrix "[ ]"
getToken();
array = new MatrixNode([[]]);
}
// parse parameters
array = parse_params(scope, array);
return array;
}
return parse_number(scope);
}
/**
* parse a number
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_number (scope) {
var node, value, number;
if (token_type == TOKENTYPE.NUMBER) {
// this is a number
if (token == '.') {
number = 0;
} else {
number = Number(token);
}
getToken();
/* TODO: implicit multiplication?
// TODO: how to calculate a=3; 2/2a ? is this (2/2)*a or 2/(2*a) ?
// check for implicit multiplication
if (token_type == TOKENTYPE.VARIABLE) {
node = multiply(node, parse_pow());
}
//*/
if (token_type == TOKENTYPE.SYMBOL) {
if (token == 'i' || token == 'I') {
value = new Complex(0, number);
getToken();
return new ConstantNode(value);
}
if (Unit.isPlainUnit(token)) {
value = new Unit(number, token);
getToken();
return new ConstantNode(value);
}
throw createTypeError('Unknown unit "' + token + '"');
}
// just a regular number
node = new ConstantNode(number);
// parse parameters
node = parse_params(scope, node);
return node;
}
return parse_parentheses(scope);
}
/**
* parentheses
* @param {math.expr.Scope} scope
* @return {Node} node
* @private
*/
function parse_parentheses (scope) {
var node;
// check if it is a parenthesized expression
if (token == '(') {
// parentheses (...)
getToken();
node = parse_assignment(scope); // start again
if (token != ')') {
throw createSyntaxError('Parenthesis ) expected');
}
getToken();
/* TODO: implicit multiplication?
// TODO: how to calculate a=3; 2/2a ? is this (2/2)*a or 2/(2*a) ?
// check for implicit multiplication
if (token_type == TOKENTYPE.VARIABLE) {
node = multiply(node, parse_pow());
}
//*/
// parse parameters
node = parse_params(scope, node);
return node;
}
return parse_end(scope);
}
/**
* Evaluated when the expression is not yet ended but expected to end
* @param {math.expr.Scope} scope
* @return {Node} res
* @private
*/
function parse_end (scope) {
if (token == '') {
// syntax error or unexpected end of expression
throw createSyntaxError('Unexpected end of expression');
} else {
throw createSyntaxError('Value expected');
}
}
/**
* Shortcut for getting the current row value (one based)
* Returns the line of the currently handled expression
* @private
*/
function row () {
// TODO: also register row number during parsing
return undefined;
}
/**
* Shortcut for getting the current col value (one based)
* Returns the column (position) where the last token starts
* @private
*/
function col () {
return index - token.length + 1;
}
/**
* Build up an error message
* @param {String} message
* @return {String} message with row and column information
* @private
*/
function createErrorMessage (message) {
var r = row();
var c = col();
if (r === undefined) {
if (c === undefined) {
return message;
} else {
return message + ' (char ' + c + ')';
}
} else {
return message + ' (line ' + r + ', char ' + c + ')';
}
}
/**
* Create an error
* @param {String} message
* @return {SyntaxError} instantiated error
* @private
*/
function createSyntaxError (message) {
return new SyntaxError(createErrorMessage(message));
}
/**
* Create an error
* @param {String} message
* @return {TypeError} instantiated error
* @private
*/
function createTypeError(message) {
return new TypeError(createErrorMessage(message));
}
/**
* Create an error
* @param {String} message
* @return {Error} instantiated error
* @private
*/
function createError (message) {
return new Error(createErrorMessage(message));
}
})();
/**
* Wrap any value in a Selector, allowing to perform chained operations on
* the value.
*
* All methods available in the math.js library can be called upon the selector,
* and then will be evaluated with the value itself as first argument.
* The selector can be closed by executing selector.done(), which will return
* the final value.
*
* Example usage:
* math.select(3)
* .add(4)
* .subtract(2)
* .done(); // 5
* math.select( [[1, 2], [3, 4]] )
* .set([1, 1], 8)
* .multiply(3)
* .done(); // [[24, 6], [9, 12]]
*
* The Selector has a number of special functions:
* - done() Finalize the chained operation and return the selectors value.
* - valueOf() The same as done()
* - toString() Executes math.format() onto the selectors value, returning
* a string representation of the value.
* - get(...) Get a subselection of the selectors value. Only applicable when
* the value has a method get, for example when value is a Matrix
* or Array.
* - set(...) Replace a subselection of the selectors value. Only applicable
* when the value has a method get, for example when value is a
* Matrix or Array.
*
* @param {*} value
* @return {math.type.Selector} selector
*/
math.select = function select(value) {
return new math.type.Selector(value);
};
/**
* Determine the type of a variable
*
* typeof(x)
*
* @param {*} x
* @return {String} type Lower case type, for example "number", "string",
* "array".
*/
math['typeof'] = function math_typeof(x) {
if (arguments.length != 1) {
throw newArgumentsError('typeof', arguments.length, 1);
}
var type = typeof x,
name;
if (type == 'object') {
if (x == null) {
return 'null';
}
if (x instanceof Boolean) {
return 'boolean';
}
if (x instanceof Number) {
return 'number';
}
if (x instanceof String) {
return 'string';
}
if (x instanceof Array) {
return 'array';
}
if (x instanceof Date) {
return 'date';
}
if (x.constructor) {
// search functions / constants
for (name in math) {
if (math.hasOwnProperty(name)) {
if (x.constructor == math[name]) {
return name.toLowerCase();
}
}
}
// search data types
for (name in math.type) {
if (math.type.hasOwnProperty(name)) {
if (x.constructor == math.type[name]) {
return name.toLowerCase();
}
}
}
// try the constructors name as last resort
if (x.constructor.name) {
return x.constructor.name.toLowerCase();
}
}
}
return type;
};
math.docs['Infinity'] = {
'name': 'Infinity',
'category': 'Constants',
'syntax': [
'Infinity'
],
'description': 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',
'examples': [
'Infinity',
'1 / 0'
],
'seealso': []
};
math.docs.LN10 = {
'name': 'LN10',
'category': 'Constants',
'syntax': [
'LN10'
],
'description': 'Returns the natural logarithm of 10, approximately equal to 2.302',
'examples': [
'LN10',
'log(10)'
],
'seealso': []
};
math.docs.LN2 = {
'name': 'LN2',
'category': 'Constants',
'syntax': [
'LN2'
],
'description': 'Returns the natural logarithm of 2, approximately equal to 0.693',
'examples': [
'LN2',
'log(2)'
],
'seealso': []
};
math.docs.LOG10E = {
'name': 'LOG10E',
'category': 'Constants',
'syntax': [
'LOG10E'
],
'description': 'Returns the base-10 logarithm of E, approximately equal to 0.434',
'examples': [
'LOG10E',
'log(e, 10)'
],
'seealso': []
};
math.docs.LOG2E = {
'name': 'LOG2E',
'category': 'Constants',
'syntax': [
'LOG2E'
],
'description': 'Returns the base-2 logarithm of E, approximately equal to 1.442',
'examples': [
'LOG2E',
'log(e, 2)'
],
'seealso': []
};
math.docs['NaN'] = {
'name': 'NaN',
'category': 'Constants',
'syntax': [
'NaN'
],
'description': 'Not a number',
'examples': [
'NaN',
'0 / 0'
],
'seealso': []
};
math.docs.SQRT1_2 = {
'name': 'SQRT1_2',
'category': 'Constants',
'syntax': [
'SQRT1_2'
],
'description': 'Returns the square root of 1/2, approximately equal to 0.707',
'examples': [
'SQRT1_2',
'sqrt(1/2)'
],
'seealso': []
};
math.docs.SQRT2 = {
'name': 'SQRT2',
'category': 'Constants',
'syntax': [
'SQRT2'
],
'description': 'Returns the square root of 2, approximately equal to 1.414',
'examples': [
'SQRT2',
'sqrt(2)'
],
'seealso': []
};
math.docs.e = math.docs.E = {
'name': 'e',
'category': 'Constants',
'syntax': [
'e'
],
'description': 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828',
'examples': [
'e',
'e ^ 2',
'exp(2)',
'log(e)'
],
'seealso': ['exp']
};
math.docs.i = {
'name': 'i',
'category': 'Constants',
'syntax': [
'i'
],
'description': 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',
'examples': [
'i',
'i * i',
'sqrt(-1)'
],
'seealso': []
};
math.docs.pi = math.docs.PI = {
'name': 'pi',
'category': 'Constants',
'syntax': [
'pi'
],
'description': 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159',
'examples': [
'pi',
'sin(pi/2)'
],
'seealso': ['tau']
};
math.docs.tau = {
'name': 'tau',
'category': 'Constants',
'syntax': [
'pi'
],
'description': 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',
'examples': [
'tau',
'2 * pi'
],
'seealso': ['pi']
};
math.docs.abs = {
'name': 'abs',
'category': 'Arithmetic',
'syntax': [
'abs(x)'
],
'description': 'Compute the absolute value.',
'examples': [
'abs(3.5)',
'abs(-4.2)'
],
'seealso': ['sign']
};
math.docs.add = {
'name': 'add',
'category': 'Operators',
'syntax': [
'x + y',
'add(x, y)'
],
'description': 'Add two values.',
'examples': [
'2.1 + 3.6',
'ans - 3.6',
'3 + 2i',
'"hello" + " world"',
'3 cm + 2 inch'
],
'seealso': [
'subtract'
]
};
math.docs.ceil = {
'name': 'ceil',
'category': 'Arithmetic',
'syntax': [
'ceil(x)'
],
'description':
'Round a value towards plus infinity.If x is complex, both real and imaginary part are rounded towards plus infinity.',
'examples': [
'ceil(3.2)',
'ceil(3.8)',
'ceil(-4.2)'
],
'seealso': ['floor', 'fix', 'round']
};
math.docs.cube = {
'name': 'cube',
'category': 'Arithmetic',
'syntax': [
'cube(x)'
],
'description': 'Compute the cube of a value. The cube of x is x * x * x.',
'examples': [
'cube(2)',
'2^3',
'2 * 2 * 2'
],
'seealso': [
'multiply',
'square',
'pow'
]
};
math.docs.divide = {
'name': 'divide',
'category': 'Operators',
'syntax': [
'x / y',
'divide(x, y)'
],
'description': 'Divide two values.',
'examples': [
'2 / 3',
'ans * 3',
'4.5 / 2',
'3 + 4 / 2',
'(3 + 4) / 2',
'18 km / 4.5'
],
'seealso': [
'multiply'
]
};
math.docs.edivide = {
'name': 'edivide',
'category': 'Operator',
'syntax': [
'x ./ y',
'edivide(x, y)'
],
'description': 'divide two values element wise.',
'examples': [
'a = [1, 2, 3; 4, 5, 6]',
'b = [2, 1, 1; 3, 2, 5]',
'a ./ b'
],
'seealso': [
'multiply',
'emultiply',
'divide'
]
};
math.docs.emultiply = {
'name': 'emultiply',
'category': 'Operator',
'syntax': [
'x .* y',
'emultiply(x, y)'
],
'description': 'multiply two values element wise.',
'examples': [
'a = [1, 2, 3; 4, 5, 6]',
'b = [2, 1, 1; 3, 2, 5]',
'a .* b'
],
'seealso': [
'multiply',
'divide',
'edivide'
]
};
math.docs.epow = {
'name': 'epow',
'category': 'Operators',
'syntax': [
'x .^ y',
'epow(x, y)'
],
'description':
'Calculates the power of x to y element wise.',
'examples': [
'a = [1, 2, 3; 4, 5, 6]',
'a .^ 2'
],
'seealso': [
'pow'
]
};
math.docs.equal = {
'name': 'equal',
'category': 'Operators',
'syntax': [
'x == y',
'equal(x, y)'
],
'description':
'Check equality of two values. Returns 1 if the values are equal, and 0 if not.',
'examples': [
'2+2 == 3',
'2+2 == 4',
'a = 3.2',
'b = 6-2.8',
'a == b',
'50cm == 0.5m'
],
'seealso': [
'unequal', 'smaller', 'larger', 'smallereq', 'largereq'
]
};
math.docs.exp = {
'name': 'exp',
'category': 'Arithmetic',
'syntax': [
'exp(x)'
],
'description': 'Calculate the exponent of a value.',
'examples': [
'exp(1.3)',
'e ^ 1.3',
'log(exp(1.3))',
'x = 2.4',
'(exp(i*x) == cos(x) + i*sin(x)) # Euler\'s formula'
],
'seealso': [
'square',
'multiply',
'log'
]
};
math.docs.fix = {
'name': 'fix',
'category': 'Arithmetic',
'syntax': [
'fix(x)'
],
'description':
'Round a value towards zero.If x is complex, both real and imaginary part are rounded towards zero.',
'examples': [
'fix(3.2)',
'fix(3.8)',
'fix(-4.2)',
'fix(-4.8)'
],
'seealso': ['ceil', 'floor', 'round']
};
math.docs.floor = {
'name': 'floor',
'category': 'Arithmetic',
'syntax': [
'floor(x)'
],
'description':
'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',
'examples': [
'floor(3.2)',
'floor(3.8)',
'floor(-4.2)'
],
'seealso': ['ceil', 'fix', 'round']
};
math.docs.gcd = {
'name': 'gcd',
'category': 'Arithmetic',
'syntax': [
'gcd(a, b)',
'gcd(a, b, c, ...)'
],
'description': 'Compute the greatest common divisor.',
'examples': [
'gcd(8, 12)',
'gcd(-4, 6)',
'gcd(25, 15, -10)'
],
'seealso': [ 'lcm', 'xgcd' ]
};
math.docs.larger = {
'name': 'larger',
'category': 'Operators',
'syntax': [
'x > y',
'larger(x, y)'
],
'description':
'Check if value x is larger than y. Returns 1 if x is larger than y, and 0 if not.',
'examples': [
'2 > 3',
'5 > 2*2',
'a = 3.3',
'b = 6-2.8',
'(a > b)',
'(b < a)',
'5 cm > 2 inch'
],
'seealso': [
'equal', 'unequal', 'smaller', 'smallereq', 'largereq'
]
};
math.docs.largereq = {
'name': 'largereq',
'category': 'Operators',
'syntax': [
'x >= y',
'largereq(x, y)'
],
'description':
'Check if value x is larger or equal to y. Returns 1 if x is larger or equal to y, and 0 if not.',
'examples': [
'2 > 1+1',
'2 >= 1+1',
'a = 3.2',
'b = 6-2.8',
'(a > b)'
],
'seealso': [
'equal', 'unequal', 'smallereq', 'smaller', 'largereq'
]
};
math.docs.lcm = {
'name': 'lcm',
'category': 'Arithmetic',
'syntax': [
'lcm(x, y)'
],
'description': 'Compute the least common multiple.',
'examples': [
'lcm(4, 6)',
'lcm(6, 21)',
'lcm(6, 21, 5)'
],
'seealso': [ 'gcd' ]
};
math.docs.log = {
'name': 'log',
'category': 'Arithmetic',
'syntax': [
'log(x)',
'log(x, base)'
],
'description': 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',
'examples': [
'log(3.5)',
'a = log(2.4)',
'exp(a)',
'10 ^ 3',
'log(1000, 10)',
'log(1000) / log(10)',
'b = logb(1024, 2)',
'2 ^ b'
],
'seealso': [
'exp',
'log10'
]
};
math.docs.log10 = {
'name': 'log10',
'category': 'Arithmetic',
'syntax': [
'log10(x)'
],
'description': 'Compute the 10-base logarithm of a value.',
'examples': [
'log10(1000)',
'10 ^ 3',
'log10(0.01)',
'log(1000) / log(10)',
'log(1000, 10)'
],
'seealso': [
'exp',
'log'
]
};
math.docs.mod = {
'name': 'mod',
'category': 'Operators',
'syntax': [
'x % y',
'x mod y',
'mod(x, y)'
],
'description':
'Calculates the modulus, the remainder of an integer division.',
'examples': [
'7 % 3',
'11 % 2',
'10 mod 4',
'function isOdd(x) = x % 2',
'isOdd(2)',
'isOdd(3)'
],
'seealso': []
};
math.docs.multiply = {
'name': 'multiply',
'category': 'Operators',
'syntax': [
'x * y',
'multiply(x, y)'
],
'description': 'multiply two values.',
'examples': [
'2.1 * 3.6',
'ans / 3.6',
'2 * 3 + 4',
'2 * (3 + 4)',
'3 * 2.1 km'
],
'seealso': [
'divide'
]
};
math.docs.pow = {
'name': 'pow',
'category': 'Operators',
'syntax': [
'x ^ y',
'pow(x, y)'
],
'description':
'Calculates the power of x to y, x^y.',
'examples': [
'2^3 = 8',
'2*2*2',
'1 + e ^ (pi * i)'
],
'seealso': [
'unequal', 'smaller', 'larger', 'smallereq', 'largereq'
]
};
math.docs.round = {
'name': 'round',
'category': 'Arithmetic',
'syntax': [
'round(x)',
'round(x, n)'
],
'description':
'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',
'examples': [
'round(3.2)',
'round(3.8)',
'round(-4.2)',
'round(-4.8)',
'round(pi, 3)',
'round(123.45678, 2)'
],
'seealso': ['ceil', 'floor', 'fix']
};
math.docs.sign = {
'name': 'sign',
'category': 'Arithmetic',
'syntax': [
'sign(x)'
],
'description':
'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',
'examples': [
'sign(3.5)',
'sign(-4.2)',
'sign(0)'
],
'seealso': [
'abs'
]
};
math.docs.smaller = {
'name': 'smaller',
'category': 'Operators',
'syntax': [
'x < y',
'smaller(x, y)'
],
'description':
'Check if value x is smaller than value y. Returns 1 if x is smaller than y, and 0 if not.',
'examples': [
'2 < 3',
'5 < 2*2',
'a = 3.3',
'b = 6-2.8',
'(a < b)',
'5 cm < 2 inch'
],
'seealso': [
'equal', 'unequal', 'larger', 'smallereq', 'largereq'
]
};
math.docs.smallereq = {
'name': 'smallereq',
'category': 'Operators',
'syntax': [
'x <= y',
'smallereq(x, y)'
],
'description':
'Check if value x is smaller or equal to value y. Returns 1 if x is smaller than y, and 0 if not.',
'examples': [
'2 < 1+1',
'2 <= 1+1',
'a = 3.2',
'b = 6-2.8',
'(a < b)'
],
'seealso': [
'equal', 'unequal', 'larger', 'smaller', 'largereq'
]
};
math.docs.sqrt = {
'name': 'sqrt',
'category': 'Arithmetic',
'syntax': [
'sqrt(x)'
],
'description':
'Compute the square root value. If x = y * y, then y is the square root of x.',
'examples': [
'sqrt(25)',
'5 * 5',
'sqrt(-1)'
],
'seealso': [
'square',
'multiply'
]
};
math.docs.square = {
'name': 'square',
'category': 'Arithmetic',
'syntax': [
'square(x)'
],
'description':
'Compute the square of a value. The square of x is x * x.',
'examples': [
'square(3)',
'sqrt(9)',
'3^2',
'3 * 3'
],
'seealso': [
'multiply',
'pow',
'sqrt',
'cube'
]
};
math.docs.subtract = {
'name': 'subtract',
'category': 'Operators',
'syntax': [
'x - y',
'subtract(x, y)'
],
'description': 'subtract two values.',
'examples': [
'5.3 - 2',
'ans + 2',
'2/3 - 1/6',
'2 * 3 - 3',
'2.1 km - 500m'
],
'seealso': [
'add'
]
};
math.docs.unary = {
'name': 'unary',
'category': 'Operators',
'syntax': [
'-x',
'unary(x)'
],
'description':
'Inverse the sign of a value.',
'examples': [
'-4.5',
'-(-5.6)'
],
'seealso': [
'add', 'subtract'
]
};
math.docs.unequal = {
'name': 'unequal',
'category': 'Operators',
'syntax': [
'x != y',
'unequal(x, y)'
],
'description':
'Check unequality of two values. Returns 1 if the values are unequal, and 0 if they are equal.',
'examples': [
'2+2 != 3',
'2+2 != 4',
'a = 3.2',
'b = 6-2.8',
'a != b',
'50cm != 0.5m',
'5 cm != 2 inch'
],
'seealso': [
'equal', 'smaller', 'larger', 'smallereq', 'largereq'
]
};
math.docs.xgcd = {
'name': 'xgcd',
'category': 'Arithmetic',
'syntax': [
'xgcd(a, b)'
],
'description': 'Calculate the extended greatest common divisor for two values',
'examples': [
'xgcd(8, 12)',
'gcd(8, 12)',
'xgcd(36163, 21199)'
],
'seealso': [ 'gcd', 'lcm' ]
};
math.docs.arg = {
'name': 'arg',
'category': 'Complex',
'syntax': [
'arg(x)'
],
'description':
'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',
'examples': [
'arg(2 + 2i)',
'atan2(3, 2)',
'arg(2 - 3i)'
],
'seealso': [
're',
'im',
'conj',
'abs'
]
};
math.docs.conj = {
'name': 'conj',
'category': 'Complex',
'syntax': [
'conj(x)'
],
'description':
'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',
'examples': [
'conj(2 + 3i)',
'conj(2 - 3i)',
'conj(-5.2i)'
],
'seealso': [
're',
'im',
'abs',
'arg'
]
};
math.docs.im = {
'name': 'im',
'category': 'Complex',
'syntax': [
'im(x)'
],
'description': 'Get the imaginary part of a complex number.',
'examples': [
'im(2 + 3i)',
're(2 + 3i)',
'im(-5.2i)',
'im(2.4)'
],
'seealso': [
're',
'conj',
'abs',
'arg'
]
};
math.docs.re = {
'name': 're',
'category': 'Complex',
'syntax': [
're(x)'
],
'description': 'Get the real part of a complex number.',
'examples': [
're(2 + 3i)',
'im(2 + 3i)',
're(-5.2i)',
're(2.4)'
],
'seealso': [
'im',
'conj',
'abs',
'arg'
]
};
math.docs.complex = {
'name': 'complex',
'category': 'Type',
'syntax': [
'complex()',
'complex(re, im)',
'complex(string)'
],
'description':
'Create a complex number.',
'examples': [
'complex()',
'complex(2, 3)',
'complex("7 - 2i")'
],
'seealso': [
'matrix', 'number', 'range', 'string', 'unit'
]
};
math.docs.matrix = {
'name': 'matrix',
'category': 'Type',
'syntax': [
'[]',
'[a1, b1, ...; a2, b2, ...]',
'matrix()',
'matrix([...])'
],
'description':
'Create a matrix.',
'examples': [
'[]',
'[1, 2, 3]',
'[1, 2, 3; 4, 5, 6]',
'matrix()',
'matrix([3, 4])'
],
'seealso': [
'complex', 'number', 'range', 'string', 'unit'
]
};
math.docs.number = {
'name': 'number',
'category': 'Type',
'syntax': [
'x',
'number(x)'
],
'description':
'Create a number or convert a string or boolean into a number.',
'examples': [
'2',
'2e3',
'4.05',
'number(2)',
'number("7.2")',
'number(true)'
],
'seealso': [
'complex', 'matrix', 'range', 'string', 'unit'
]
};
math.docs.range = {
'name': 'range',
'category': 'Type',
'syntax': [
'start:end',
'start:step:end',
'range(start, end)',
'range(start, step, end)',
'range(string)'
],
'description':
'Create a range.',
'examples': [
'1:5',
'3:-1:-3',
'range(3, 6)',
'range(0, 2, 10)',
'range("4:10")',
'a = [1, 2, 3; 4, 5, 6]',
'a(:, 2:3)'
],
'seealso': [
'complex', 'matrix', 'number', 'string', 'unit'
]
};
math.docs.string = {
'name': 'string',
'category': 'Type',
'syntax': [
'"text"',
'string(x)'
],
'description':
'Create a string or convert a value to a string',
'examples': [
'"Hello World!"',
'string(4.2)',
'string(3 + 2i)'
],
'seealso': [
'complex', 'matrix', 'number', 'range', 'unit'
]
};
math.docs.unit = {
'name': 'unit',
'category': 'Type',
'syntax': [
'value unit',
'unit(value, unit)',
'unit(string)'
],
'description':
'Create a unit.',
'examples': [
'5.5 mm',
'3 inch',
'unit(7.1, "kilogram")',
'unit("23 deg")'
],
'seealso': [
'complex', 'matrix', 'number', 'range', 'string'
]
};
math.docs.concat = {
'name': 'concat',
'category': 'Matrix',
'syntax': [
'concat(a, b, c, ...)',
'concat(a, b, c, ..., dim)'
],
'description': 'Concatenate matrices. By default, the matrices are concatenated by the first dimension. The dimension on which to concatenate can be provided as last argument.',
'examples': [
'a = [1, 2; 5, 6]',
'b = [3, 4; 7, 8]',
'concat(a, b)',
'[a, b]',
'concat(a, b, 2)',
'[a; b]'
],
'seealso': [
'det', 'diag', 'eye', 'inv', 'ones', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.det = {
'name': 'det',
'category': 'Matrix',
'syntax': [
'det(x)'
],
'description': 'Calculate the determinant of a matrix',
'examples': [
'det([1, 2; 3, 4])',
'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'
],
'seealso': [
'concat', 'diag', 'eye', 'inv', 'ones', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.diag = {
'name': 'diag',
'category': 'Matrix',
'syntax': [
'diag(x)',
'diag(x, k)'
],
'description': 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned.When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',
'examples': [
'diag(1:4)',
'diag(1:4, 1)',
'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]',
'diag(a)'
],
'seealso': [
'concat', 'det', 'eye', 'inv', 'ones', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.eye = {
'name': 'eye',
'category': 'Matrix',
'syntax': [
'eye(n)',
'eye(m, n)',
'eye([m, n])',
'eye'
],
'description': 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',
'examples': [
'eye(3)',
'eye(3, 5)',
'a = [1, 2, 3; 4, 5, 6]',
'eye(size(a))'
],
'seealso': [
'concat', 'det', 'diag', 'inv', 'ones', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.inv = {
'name': 'inv',
'category': 'Matrix',
'syntax': [
'inv(x)'
],
'description': 'Calculate the inverse of a matrix',
'examples': [
'inv([1, 2; 3, 4])',
'inv(4)',
'1 / 4'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'ones', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.ones = {
'name': 'ones',
'category': 'Matrix',
'syntax': [
'ones(n)',
'ones(m, n)',
'ones(m, n, p, ...)',
'ones([m, n])',
'ones([m, n, p, ...])',
'ones'
],
'description': 'Create a matrix containing ones.',
'examples': [
'ones(3)',
'ones(3, 5)',
'ones([2,3]) * 4.5',
'a = [1, 2, 3; 4, 5, 6]',
'ones(size(a))'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'size', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.size = {
'name': 'size',
'category': 'Matrix',
'syntax': [
'size(x)'
],
'description': 'Calculate the size of a matrix.',
'examples': [
'size(2.3)',
'size("hello world")',
'a = [1, 2; 3, 4; 5, 6]',
'size(a)',
'size(1:6)'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'squeeze', 'subset', 'transpose', 'zeros'
]
};
math.docs.squeeze = {
'name': 'squeeze',
'category': 'Matrix',
'syntax': [
'squeeze(x)'
],
'description': 'Remove singleton dimensions from a matrix.',
'examples': [
'a = zeros(1,3,2)',
'size(squeeze(a))',
'b = zeros(3,1,1)',
'size(squeeze(b))'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'size', 'subset', 'transpose', 'zeros'
]
};
math.docs.subset = {
'name': 'subset',
'category': 'Matrix',
'syntax': [
'value(index)',
'value(index) = replacement',
'subset(value, [index])',
'subset(value, [index], replacement)'
],
'description': 'Get or set a subset of a matrix or string.',
'examples': [
'd = [1, 2; 3, 4]',
'e = []',
'e(1, 1:2) = [5, 6]',
'e(2, :) = [7, 8]',
'f = d * e',
'f(2, 1)',
'f(:, 1)'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'range', 'size', 'squeeze', 'transpose', 'zeros'
]
};
math.docs.transpose = {
'name': 'transpose',
'category': 'Matrix',
'syntax': [
'x\'',
'transpose(x)'
],
'description': 'Transpose a matrix',
'examples': [
'a = [1, 2, 3; 4, 5, 6]',
'a\'',
'transpose(a)'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'size', 'squeeze', 'subset', 'zeros'
]
};
math.docs.zeros = {
'name': 'zeros',
'category': 'Matrix',
'syntax': [
'zeros(n)',
'zeros(m, n)',
'zeros(m, n, p, ...)',
'zeros([m, n])',
'zeros([m, n, p, ...])',
'zeros'
],
'description': 'Create a matrix containing zeros.',
'examples': [
'zeros(3)',
'zeros(3, 5)',
'a = [1, 2, 3; 4, 5, 6]',
'zeros(size(a))'
],
'seealso': [
'concat', 'det', 'diag', 'eye', 'inv', 'ones', 'size', 'squeeze', 'subset', 'transpose'
]
};
math.docs.factorial = {
'name': 'factorial',
'category': 'Probability',
'syntax': [
'x!',
'factorial(x)'
],
'description': 'Compute the factorial of a value',
'examples': [
'5!',
'5*4*3*2*1',
'3!'
],
'seealso': []
};
math.docs.random = {
'name': 'random',
'category': 'Probability',
'syntax': [
'random()'
],
'description':
'Return a random number between 0 and 1.',
'examples': [
'random()',
'100 * random()'
],
'seealso': []
};
math.docs.max = {
'name': 'max',
'category': 'Statistics',
'syntax': [
'max(a, b, c, ...)'
],
'description': 'Compute the maximum value of a list of values.',
'examples': [
'max(2, 3, 4, 1)',
'max(2.7, 7.1, -4.5, 2.0, 4.1)',
'min(2.7, 7.1, -4.5, 2.0, 4.1)'
],
'seealso': [
//'sum',
//'prod',
//'avg',
//'var',
//'std',
'min'
//'median'
]
};
math.docs.min = {
'name': 'min',
'category': 'Statistics',
'syntax': [
'min(a, b, c, ...)'
],
'description': 'Compute the minimum value of a list of values.',
'examples': [
'min(2, 3, 4, 1)',
'min(2.7, 7.1, -4.5, 2.0, 4.1)',
'max(2.7, 7.1, -4.5, 2.0, 4.1)'
],
'seealso': [
//'sum',
//'prod',
//'avg',
//'var',
//'std',
'max'
//'median'
]
};
math.docs.acos = {
'name': 'acos',
'category': 'Trigonometry',
'syntax': [
'acos(x)'
],
'description': 'Compute the inverse cosine of a value in radians.',
'examples': [
'acos(0.5)',
'acos(cos(2.3))'
],
'seealso': [
'cos',
'acos',
'asin'
]
};
math.docs.asin = {
'name': 'asin',
'category': 'Trigonometry',
'syntax': [
'asin(x)'
],
'description': 'Compute the inverse sine of a value in radians.',
'examples': [
'asin(0.5)',
'asin(sin(2.3))'
],
'seealso': [
'sin',
'acos',
'asin'
]
};
math.docs.atan = {
'name': 'atan',
'category': 'Trigonometry',
'syntax': [
'atan(x)'
],
'description': 'Compute the inverse tangent of a value in radians.',
'examples': [
'atan(0.5)',
'atan(tan(2.3))'
],
'seealso': [
'tan',
'acos',
'asin'
]
};
math.docs.atan2 = {
'name': 'atan2',
'category': 'Trigonometry',
'syntax': [
'atan2(y, x)'
],
'description':
'Computes the principal value of the arc tangent of y/x in radians.',
'examples': [
'atan2(2, 2) / pi',
'angle = 60 deg in rad',
'x = cos(angle)',
'y = sin(angle)',
'atan2(y, x)'
],
'seealso': [
'sin',
'cos',
'tan'
]
};
math.docs.cos = {
'name': 'cos',
'category': 'Trigonometry',
'syntax': [
'cos(x)'
],
'description': 'Compute the cosine of x in radians.',
'examples': [
'cos(2)',
'cos(pi / 4) ^ 2',
'cos(180 deg)',
'cos(60 deg)',
'sin(0.2)^2 + cos(0.2)^2'
],
'seealso': [
'acos',
'sin',
'tan'
]
};
math.docs.cot = {
'name': 'cot',
'category': 'Trigonometry',
'syntax': [
'cot(x)'
],
'description': 'Compute the cotangent of x in radians. Defined as 1/tan(x)',
'examples': [
'cot(2)',
'1 / tan(2)'
],
'seealso': [
'sec',
'csc',
'tan'
]
};
math.docs.csc = {
'name': 'csc',
'category': 'Trigonometry',
'syntax': [
'csc(x)'
],
'description': 'Compute the cosecant of x in radians. Defined as 1/sin(x)',
'examples': [
'csc(2)',
'1 / sin(2)'
],
'seealso': [
'sec',
'cot',
'sin'
]
};
math.docs.sec = {
'name': 'sec',
'category': 'Trigonometry',
'syntax': [
'sec(x)'
],
'description': 'Compute the secant of x in radians. Defined as 1/cos(x)',
'examples': [
'sec(2)',
'1 / cos(2)'
],
'seealso': [
'cot',
'csc',
'cos'
]
};
math.docs.sin = {
'name': 'sin',
'category': 'Trigonometry',
'syntax': [
'sin(x)'
],
'description': 'Compute the sine of x in radians.',
'examples': [
'sin(2)',
'sin(pi / 4) ^ 2',
'sin(90 deg)',
'sin(30 deg)',
'sin(0.2)^2 + cos(0.2)^2'
],
'seealso': [
'asin',
'cos',
'tan'
]
};
math.docs.tan = {
'name': 'tan',
'category': 'Trigonometry',
'syntax': [
'tan(x)'
],
'description': 'Compute the tangent of x in radians.',
'examples': [
'tan(0.5)',
'sin(0.5) / cos(0.5)',
'tan(pi / 4)',
'tan(45 deg)'
],
'seealso': [
'atan',
'sin',
'cos'
]
};
math.docs['in'] = {
'name': 'in',
'category': 'Units',
'syntax': [
'x in unit',
'in(x, unit)'
],
'description': 'Change the unit of a value.',
'examples': [
'5 inch in cm',
'3.2kg in g',
'16 bytes in bits'
],
'seealso': []
};
math.docs.clone = {
'name': 'clone',
'category': 'Utils',
'syntax': [
'clone(x)'
],
'description': 'Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices',
'examples': [
'clone(3.5)',
'clone(2 - 4i)',
'clone(45 deg)',
'clone([1, 2; 3, 4])',
'clone("hello world")'
],
'seealso': []
};
math.docs['eval'] = {
'name': 'eval',
'category': 'Utils',
'syntax': [
'eval(expression)',
'eval([expr1, expr2, expr3, ...])'
],
'description': 'Evaluate an expression or an array with expressions.',
'examples': [
'eval("2 + 3")',
'eval("sqrt(" + 4 + ")")'
],
'seealso': []
};
math.docs.format = {
'name': 'format',
'category': 'Utils',
'syntax': [
'format(value)'
],
'description': 'Format a value of any type as string.',
'examples': [
'format(2.3)',
'format(3 - 4i)',
'format([])'
],
'seealso': []
};
math.docs.help = {
'name': 'help',
'category': 'Utils',
'syntax': [
'help(object)'
],
'description': 'Display documentation on a function or data type.',
'examples': [
'help("sqrt");',
'help("complex");'
],
'seealso': []
};
math.docs['import'] = {
'name': 'import',
'category': 'Utils',
'syntax': [
'import(string)'
],
'description': 'Import functions from a file.',
'examples': [
'import("numbers")',
'import("./mylib.js")'
],
'seealso': []
};
math.docs['typeof'] = {
'name': 'typeof',
'category': 'Utils',
'syntax': [
'typeof(x)'
],
'description': 'Get the type of a variable.',
'examples': [
'typeof(3.5)',
'typeof(2 - 4i)',
'typeof(45 deg)',
'typeof("hello world")'
],
'seealso': []
};
/**
* Compatibility shims for legacy JavaScript engines
*/
// Internet Explorer 8 and older does not support Array.indexOf,
// so we define it here in that case.
// http://soledadpenades.com/2007/05/17/arrayindexof-in-internet-explorer/
if(!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj){
for(var i = 0; i < this.length; i++){
if(this[i] == obj){
return i;
}
}
return -1;
};
}
// Internet Explorer 8 and older does not support Array.forEach,
// so we define it here in that case.
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(fn, scope) {
for(var i = 0, len = this.length; i < len; ++i) {
fn.call(scope || this, this[i], i, this);
}
}
}
// Internet Explorer 8 and older does not support Array.map,
// so we define it here in that case.
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map
// Production steps of ECMA-262, Edition 5, 15.4.4.19
// Reference: http://es5.github.com/#x15.4.4.19
if (!Array.prototype.map) {
Array.prototype.map = function(callback, thisArg) {
var T, A, k;
if (this == null) {
throw new TypeError(" this is null or not defined");
}
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
var O = Object(this);
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = O.length >>> 0;
// 4. If IsCallable(callback) is false, throw a TypeError exception.
// See: http://es5.github.com/#x9.11
if (typeof callback !== "function") {
throw new TypeError(callback + " is not a function");
}
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
if (thisArg) {
T = thisArg;
}
// 6. Let A be a new array created as if by the expression new Array(len) where Array is
// the standard built-in constructor with that name and len is the value of len.
A = new Array(len);
// 7. Let k be 0
k = 0;
// 8. Repeat, while k < len
while(k < len) {
var kValue, mappedValue;
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
if (k in O) {
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
kValue = O[ k ];
// ii. Let mappedValue be the result of calling the Call internal method of callback
// with T as the this value and argument list containing kValue, k, and O.
mappedValue = callback.call(T, kValue, k, O);
// iii. Call the DefineOwnProperty internal method of A with arguments
// Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true},
// and false.
// In browsers that support Object.defineProperty, use the following:
// Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });
// For best browser support, use the following:
A[ k ] = mappedValue;
}
// d. Increase k by 1.
k++;
}
// 9. return A
return A;
};
}
// Internet Explorer 8 and older does not support Array.every,
// so we define it here in that case.
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/every
if (!Array.prototype.every) {
Array.prototype.every = function(fun /*, thisp */) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun != "function") {
throw new TypeError();
}
var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in t && !fun.call(thisp, t[i], i, t)) {
return false;
}
}
return true;
};
}
// Internet Explorer 8 and older does not support Array.some,
// so we define it here in that case.
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/some
if (!Array.prototype.some) {
Array.prototype.some = function(fun /*, thisp */) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun != "function") {
throw new TypeError();
}
var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in t && fun.call(thisp, t[i], i, t)) {
return true;
}
}
return false;
};
}
// Define Function.bind if not available
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
/**
* math.js library initialization
*/
// initialise the Chain prototype with all functions and constants in math
for (var prop in math) {
if (math.hasOwnProperty(prop) && prop) {
createSelectorProxy(prop, math[prop]);
}
}
/**
* CommonJS module exports
*/
if ((typeof module !== 'undefined') && (typeof module.exports !== 'undefined')) {
module.exports = math;
}
if (typeof exports !== 'undefined') {
exports = math;
}
/**
* AMD module exports
*/
if (typeof(require) != 'undefined' && typeof(define) != 'undefined') {
define(function () {
return math;
});
}
/**
* Browser exports
*/
if (typeof(window) != 'undefined') {
if (window['math']) {
util.deepExtend(window['math'], math);
}
else {
window['math'] = math;
}
}
})();
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 2,213
|
A silver and a 7th!
Alex's last day of competition included the 4x100 relay and the 100M. These are her best events and we were excited for the competitions. My sisters Sue and Katie as well as John, Courtney Tom and I got to the stadium early to watch the races. It was the usual Nebraska weather; hot and humid and tough for the athletes.
Alex's relay team consists of the four team mates; Aimee, Ben, Charlie and Alex. Alex is the lead runner, followed by Ben, Aimee and Charlie as the anchor. Charlie is one of those long and lanky runners and is VERY fast. Going into the last leg the team was in 5th place, but Charlie was able to overcome three of the competitors and Team Colorado came in 2nd place, this made my daughter much happier than the previous days' results. A silver medal!!
On this fourth day of competitions the awards ceremonies got a bit delayed. After each race the athletes went in the air-conditioned building next door, host of the bocce tournament. However with all the events ending so close together the medals and times could not get assembled and presented very quickly. This meant the athletes had to sit inside for a long periods of time, and get pulled at for their next competitions. So far, this in the only glitch in the Games and very minor. However, Ben had to miss the ceremony as he went out to the shot put; this was unfortunate.
Alex's next and final event was the 100M. I had been able to look up her division the evening before on the web site and saw she had eight in her division and she had the slowest qualifying time. Granted these competitors are only a second or so apart, but this put Alex in an outside lane which I knew was not her favorite.
Alex ran a great race and came in 7th, but the look of disappointment when she crossed the finish line broke my heart. I wished I could make her understand that she ran really fast and was competing against top runners. Why can't she feel proud of her accomplishments and not be so focused on the gold? I know the reason is part of her intellectual capabilities; she sees the now and feels it very strongly. She will understand later about the times when I show her on the computer, but it will take awhile. Alex is competitive and hard on herself; as my sister said to me all week – apple: tree.
Alex held herself together for the award ceremony but wanted lots of hugs afterwards. Her coach left her with us for awhile as she could not stop crying. She told me "I could not take any pictures or tell anyone she got 7th". This is not acceptable to me; Alex should be extremely proud of herself and her accomplishments. I will not honor her request.
I know after the evening's dances, and team camaraderie Alex will feel better. After all, she got silver and a 5th, 6th and 7th in the National Special Olympic Games, not many of us can say that. It is a proud week for our family and we will relish these memories for a long time.
Melissa July 23, 2010 at 11:29 PM
Congrats Alex!!
UP to Me July 27, 2010 at 12:10 PM
Wow! congrats, I hope my little girl can do that- it's so awesome just to go and I love that she's a runner!
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 6,073
|
{"url":"https:\/\/improve-future.com\/en\/arguments-and-parameters-for-functions.html","text":"# Arguments and Parameters for Functions\n\nHere I wrote about arguments and parameters.\n\nArguments and parameters are different for functions.\n\n## Argument\n\nAn argument is the expression between parenthesis in function call. An argument is defined outside the function.\n\nAn argument is an expression, so the argument of print(1 + 1) is 1 + 1, and the argument of print(2) is 2, in Python 3.6.\n\n## Parameter\n\nThe variable to receive the evaluated value of the argument is parameter. The parameter is valid inside the function.\n\nIn both expressions print(1 + 1) and print(2), the parameter will holds the same value, 2.\n\nWhen the function def function(value): is defined in Python 3.6, the parameter is value.\n\nIn addition, a function in Python 3.6 can have parameters up to 255. (I wrote the maximum numbers in some languages in the article, The maximum number of parameters in several programming language.)","date":"2019-04-22 09:08:37","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.7215632796287537, \"perplexity\": 1154.532736532738}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2019-18\/segments\/1555578548241.22\/warc\/CC-MAIN-20190422075601-20190422101255-00006.warc.gz\"}"}
| null | null |
\section{ Introduction}
Instabilities in plastic flow has been an object of attention
for a long time in metallurgical literature. Conceptually
simplest form of this [Lubahn \& Felgar, 1961; Hall, 1970]
manifests when the material is subjected to a creep test wherein
a force is applied and the response in the form of elongation of
the material is measured, which under normal conditions, is a
smooth strain-time curve. However, under certain metallurgical
conditions, one sees steps on creep curve suggesting a form of
instability [Lubahn \& Felgar, 1961; Hall, 1970; Da Silveira \&
Monteiro, 1979]. A better known form of the instability having
the same physical origin, but conceptually more difficult,
appears when the material is deformed under tensile deformation
[Bodner \& Rosen, 1967; Brindley \& Worthington, 1970; Penning,
1972]. Here, the material is subjected to a predetermined
response namely a constant rate of deformation, and the force or
the stress developed in the sample is sought to be measured.
Even in this case, one finds a smooth stress-strain curve under
normal conditions. However, when the system is in the regime of
instability, for some values of material parameters the
stress-strain curve exhibits multiple load drops. Each of the
load drops is related to the formation and propagation of
dislocation bands [Chihab {\it et al}, 1987]. It is in the latter
type of testing where plastic instability manifests much more
easily than in the former. The phenomenon is referred to as the
Portevin-Le Chatelier (PLC) effect or the jerky flow and is seen
in several metals such as commercial aluminium, brass, alloys of
aluminium and magnesium [Brindley \& Worthington, 1970]. It is
observed only in a window of strain rates and temperature. In
contrast, the phenomenon of steps on creep curve, which is the
subject of the present discussion, is seen in few
instances [Da Silveira \& Monteiro, 1979; Zagarukuyko {\it et
al}, 1977; Stejskalova {\it et al }, 1981 ]. The reason
attributed to this is that it is difficult to obtain proper control
on metallurgical parameters wherein this form of instability can be
observed. There is one more form of
instability which manifests under constant stress test where
similar strain jumps are seen as a function of time.
The origin of instability in all these three modes of
testing is known to be the same.( For a current status of
both experiments and theory see Kubin {\it et al}, 1993). Eventhough steps
on creep curve are seen in a limited number of experiments, it
is often straight forward to translate many of the experimental
results of constant strain rate test into that of creep test.
It is generally agreed that the microscopic origin
of the instabilities arises due to the interaction of
dislocations with mobile point defects and is referred to as
dynamic strain ageing. This leads to negative strain rate
characteristic. The basic idea was formulated by Cottrell [1953]
few decades ago.
The early phenomenological models are all static since they do
not deal with time development. In contrast, methodology of
dynamical systems addresses precisely this aspect. Until about
a decade and a half ago, there were no models which looked at
the problem from the point of view of bifurcation theory.
An attempt to understand the problem in the above
perspective was first made by our group several years ago
[Ananthakrishna \& Sahoo, 1981b; Ananthakrishna \& Valsakumar,
1982, 1983; Valsakumar \& Ananthakrishna, 1983]. In a series of
papers starting from an extended Fokker-Planck equation for the
distribution function of the velocity of dislocation segments,
and then splitting this into a mobile and an immobile component,
we arrived at a model which
consisted of three types of dislocations and some
transformations between them [Ananthakrishna \& Sahoo, 1981a,
1981b; Sahoo \& Ananthakrishna, 1982;
Valsakumar \& Ananthakrishna, 1983]. The basic idea
could be summarized by stating that the phenomena is due to
a Hopf bifurcation resulting from nonlinear interactions between
three different types of
dislocations, suggesting a new mathematical mechanism for the
instability. Eventhough the spatial inhomogeneous structure
was ignored and only the temporal oscillatory state was sought
to be described, the model and its extensions to the case of
constant strain rate test, proved to be very successful in that
it could explain most of the experimentally observed features
(for critical reviews see Kubin \& Lepinoux, 1988 and
Kubin {\it et al}, 1993).
{\it For instance, the existence of negative strain rate sensitivity
in a regime of strain rates, comes out naturally as a consequence of
the Hopf bifurcation} [Ananthakrishna \&
Valsakumar, 1982]. It
must be emphasized, that this feature has been measured in most
experiments on the PLC effect, and is {\it assumed} in all other
theoretical models
[ Cottrell, 1953; Bodner \& Rosen, 1967; Penning, 1972;
Kubin and Estrin 1990; see also Kubin \& Martin, 1988;
Martin \& Kubin, 1992; Kubin {\it et al} 1993].
Other experimentally observed features such as the
existence of bounds on strain rate for the PLC
effect to occur, the existence of critical strain and its dependence
on applied strain rate, the dependence of the amplitude on
the strain etc., also follow. {\it One other
important prediction which is direct consequence of the dynamical basis
of the model is the existence of chaotic
stress drops in a window of strain rates} [Ananthakrishna \&
Valsakumar, 1983; Ananthakrishna \& John, 1990].
{\it Recently this prediction has been verified which in turn
implies that only a few degrees of freedom are required
for a dynamical description of
the phenomenon. This offers
justification for the use of only a few degrees of freedom for
the description of the temporal aspect, eventhough the system is
spatially extended.}
[Ananthakrishna {\it et al}., 1995;
Ananthakrishna \& Noronha, 1995; Quaouire \& Fressengeas, 1995;
Venkadesan {\it et al} 1995; Noronha {\it et al} 1996 \& 1997].
(Note that a
spatially extended system implies infinite degrees of freedom.)
Description of the phenomenon which includes the initiation and
propagation of the bands during the PLC effect has also been
recently attempted [Ananthakrishna, 1993].
Since the introduction of bifurcation theory into this field
several years ago by our group, there has been a resurgence
of interest in plastic instabilities in the light of
introduction of new methodology borrowed from the theory of
dynamical systems. This has further helped to obtain new
insights hitherto not possible [Kubin \& Martin, 1988; Estrin \&
Kubin, 1989; Kubin \& Estrin, 1990; see also Kubin \& Martin, 1988;
Martin \& Kubin, 1992; Kubin, 1993; Ananthakrishna {\it et al}.,
1995a \&b and references therein].
One of the aims of such theories is to be able to relate the
microscopic dislocation mechanisms to the measurable macroscopic
quantities. However, in the process, we feel that finer aspects
of dynamical systems have been glossed over in this field. For
instance, one often finds that casual remarks are made about
fast and slow modes without actually going through the procedure
of demonstrating the existence of such modes and eliminating the
fast modes in favour of the slow ones [Aifantis, 1988; Hahner \&
Kubin, 1992; Hahner, 1993]. In addition, under the adiabatic
elimination, the slow modes are complicated functions of the original modes.
Yet, hand waiving arguments have been used in building models
which we believe are technically suspect.
The purpose of this article is at least three fold. First, we wish
to illustrate the power and utility of dynamical methods
to the study of dynamical aspects of the model. We demonstrate the
technical aspects of adiabatic elimination
(largely addressed to metallurgists working in the area of plastic
instabilities) and then derive the equation for the slow modes having
the form of time-dependent Ginzburg-Landau (TDGL) equation.
Second, we wish to compare the results of the dependence of the
amplitude and the period of the strain jumps on stress and temperature
with experiments on creep curve as also with the results translated from the
constant strain rate case
to the creep case. This will allow us to relate the theoretically
introduced parameters to the macroscopically measured quantities.
Third, we wish to compare these results and the detailed numerical results
via power series expansion with the approximate solutions
for the limit cycles obtained earlier [Ananthakrishna
\& Sahoo, 1981b; Valsakumar \& Ananthakrishna, 1983].
The principal results of this work are as follows. We show that
the derived quintic TDGL equation for the slow modes is valid
in the mid-range of the instability domain.
Within this range, there is a narrow sub-range of the parameter
where the system exhibits a supercritical bifurcation, beyond
which subcritical bifurcation is exhibited. The results of this
calculations on the amplitude and period of the strain jumps are
compared with experiments. In addition, analytical work
based on the TDGL equation and a detailed comparative numerical
study via the power series solution shows that the model
exhibits unusual properties in a certain domain of the
parameter. The study further shows that very high order
nonlinearities actually govern the nature of the subcritical
bifurcation beyond the domain handled by the quintic TDGL
equation.
The plan of the paper is as follows. In what follows (section
2) we present a brief summary of the model. In section 3, the
technique of extracting the TDGL equation using reductive
perturbative approach is applied to the model. In section 4,
approximate limit cycle solution obtained through the TDGL
equation is compared with experiments and
with the numerical solution of the model as
well as earlier studies on the model. Section 5 contains
summary and discussion.
\section{ A Model for Steps on Creep Curve}
We start with a brief summary of the model. The basic idea of
the model is that instabilities in plastic flow are a
consequence of nonlinear interactions between different types of
dislocation populations. Spatial dependence is ignored and
only temporal aspects are described, the idea being that the few
degrees of freedom used for describing the phenomenon
(dislocation populations) correspond to the
collective modes of dislocations in the spatially extended
system. As mentioned in the introduction, this finds support from
the recent experimental verification of chaos in the PLC effect.
The details of the model
can be found in the original references [Ananthakrishna \&
Sahoo, 1981b; Valsakumar \& Ananthakrishna, 1983]. The model
consists of mobile dislocations $m$ and immobile
dislocations $im$ and another type which mimics the Cottrell's
type $i$, which are dislocations with clouds of solute atoms.
Let the corresponding densities be $N_m$, $N_{im}$ and $N_i$,
respectively. The basic dislocation mechanisms included are the
following: (a) production of dislocations by cross glide
(\( m \stackrel{\theta V_m}{\rightarrow} m + m \) ,
$\theta$ is the cross glide coefficient, $V_m$ is the velocity of
mobile dislocations; $V_m = V_0
(\sigma_a/\sigma_0)^m$ [Alexander, 1986] where $\sigma_a$ is
the applied stress), (b) immobilization of two mobile dislocations
(\( m + m \stackrel{\beta}{\rightarrow} im + im \), $\beta$ is the rate at
which two mobile dislocations get immobilized) and annihilation of two
mobile dislocations
(\( m + m \stackrel{\beta^{\prime}}{\rightarrow} 0 \)), and annihilation of a
mobile with an immobile dislocation
(\( m + im \stackrel{\bar{\beta}}{\rightarrow} 0 \)), (c) once a mobile
dislocation is immobilized, it can be reactivated by
athermal or thermal means
(\( i \stackrel{\gamma}{\rightarrow} m \)), (d) lastly,
a mobile dislocation can
acquire a cloud of solute atoms and move with them. We consider
such dislocations as distinct from both the mobile as well as
the immobile and denote them $i$. This process is represented by
\( m \stackrel{\alpha_m}{\rightarrow} i \), $\alpha_m$ being a
function of the concentration of solute atoms. However, as the
solute atoms gather progressively around dislocations, these
dislocations eventually will be immobilized
(\( i\stackrel{\alpha_i}{\rightarrow} im \)). ( Note that in principle,
$\beta$, $\beta^{\prime}$ and $\bar{\beta}$ are different.)
These mechanisms lead to the rate equations for the densities of dislocations:
\begin{eqnarray}
\dot{N}_m & = & \theta V_m N_m - (\beta + \beta^{\prime}) N_m^2 - \bar{\beta} N_m N_{im}
+\gamma N_{im} -\alpha_m N_m\,,
\\
\dot{N}_{im} & = &\beta N^2_m - \bar{\beta} N_{im} N_m - \gamma N_{im} + \alpha_i N_i,
\\
\dot{N}_i & = & \alpha_m N_m - \alpha_i N_i.
\end{eqnarray}
\noindent
(For the sake of simplicity, we take $\beta^{\prime} = 0$
and $\bar{\beta} = \beta$.)
One can give a more transparent interpretation for Eq. (3) which
represents whole process of acquiring
a cloud of solute atoms by a mobile dislocation and eventual
immobilization. This
can be seen by defining $N_i = \int_{-\infty}^t K(t - t^{\prime}) N_m
(t^{\prime}) dt^{\prime}$, where the kernel $K(t)$ which represents
the fact that solute atoms are arriving at a certain rate has
been chosen to be $\alpha_m e^{-\alpha_i t}$. It can be easily
checked that Eq. (3) is the differential form of the definition of
$N_i$. One last remark about some of the terms appearing in these equations.
The first two
terms plus the last term in Eq.(1), and equivalent terms in
Eqs.(2), were derived starting from a velocity distribution
function of the dislocation segments [ Ananthakrishna \& Sahoo
1981a; Sahoo \& Ananthakrishna, 1982]. Thus, this model is
an improved model to explain the
instability in plastic flow. Equations (1-3) can be cast into
a dimensionless form by using scaled variables:
\begin{equation}
x = N_m (\frac{\beta}{\gamma}), y = N_{im}(\frac{\beta}{\theta
V_m}), z = N_i (\frac{\beta\alpha_i}{\gamma\alpha_m})
,\tau=\theta V_m t,
\end{equation}
to get
\begin{eqnarray}
\dot{x} & = & (1-a)x -b_0x^2 -xy +y,
\\
\dot{y} & = & b_0\left(b_0x^2 -xy-y+az\right),
\\
\dot{z} & = & c(x-z),
\end{eqnarray}
where $a = \frac{\alpha_m}{\theta V_m}, b_0=\frac{\gamma}{\theta
V_m}, {\rm and }\, c=\frac{\alpha_i}{\theta V_m}$. The dot
represents differentiation with respect to $\tau$. Equations (5-7)
are coupled set of nonlinear equations which support limit cycle
solutions for a range of parameters $a,b_0$ and $ c$, that are
physically relevant. $a$ refers to the concentration of the
solute atoms, $b_0$ refers to the reactivation of immobile
dislocations and $c$ to the time scales over which the slowing
down occurs. We have demonstrated the existence of limit
cycle solutions and also obtained approximate closed form
solutions for the limit cycles [Ananthakrishna \& Sahoo, 1981b;
Valsakumar \& Ananthakrishna, 1983]. In addition, the model has
been studied numerically. Using the Orowan equation which
relates the rate of change of strain($\dot{S}$) to mobile dislocation
density and the mean velocity: $\dot{S}=bN_mV_m$, with $b$ as
the Burger's vector, steps on the creep curve follow
automatically since the densities of dislocations are
oscillatory. Several experimental results are reproduced
[Ananthakrishna \& Sahoo, 1981b; Valsakumar \& Ananthakrishna,
1983].
\section{ Reductive Perturbative Approach}
For the sake of completeness, we outline the reductive
perturbative approach.
Near the point of Hopf bifurcation of the system (Eqs.5-7),
corresponding to a critical value of the drive parameter, a pair
of complex conjugate eigenvalues and another real negative
eigenvalue exist for the linearized system of equations around
the steady state. As we approach the critical value from the
stable side, the real parts of the pair of complex conjugate
eigenvalues approach zero and hence the corresponding
eigenvectors get slower and slower. In contrast, the effect of
the change in the drive parameter on the real negative
eigenvalue is negligible. Thus, {\it the eigenvector
corresponding to the real negative eigenvalue is the fast mode}.
For this reason, the slow modes are the ones which determine the
formation of new states of order. {\it The reductive
perturbative method is a method where the asymptotic equation is
extracted in a systematic way} [Taniuti \& Wei, 1968; Newell \&
Whitehead, 1969; Kuramoto \& Tsuzuki, 1974; Mashiyama {\it et
al}., 1975; Richter {\it et al}., 1981]. The method involves in
first finding the eigenvectors corresponding to the slow modes
and looking for a solution in the subspace spanned by these
vectors. The effect of the nonlinearity is handled progressively
as a perturbation of the linear solution in power series of the
deviation from the critical value of the drive parameter. It
may be worth emphasizing that this method is essentially the same
as reduction to center manifold. Indeed, the equivalence of the
center manifold theory [Carr, 1981; Guckenheimer \& Holmes, 1983;
Troger \& Steindl, 1991] with the reductive perturbation has been
established [Chen {\it et al}, 1996]. Other techniques of
extracting amplitude equations have been devised whose end
results are basically the same. For instance, perturbative
renormalization group method [Goldenfeld {\it et al} 1989; Chen
{\it et al}, 1996] and its recent extension on the basis of
envelope theory [Kunihiro, 1995 \& 1996] has also been developed
as a tool for global asymptotic analysis which can be used to
extract the amplitude equations.
In the present model, there is one simplification arising from
the fact that $x$ can be identified as the fast (stable) mode,
and hence this will be eliminated adiabatically. Then we derive
the equation
for the slow dynamics through a power series expansion. Although
this adiabatic elimination is approximate, the result is found
to be in a reasonably good agreement with the accurate method
(which will be reported elsewhere) except for finer details.
Consider the Eqs.(5-7). It can be shown that there is a domain
of instability for the parameters $a$, $b_0$ and $c$. The range of
values of $b_0$ is $\sim 0 - 10^{-2}$, that of $c$ is $\sim 0 - 10^{-1}$
while $a\sim 1$. Thus, $b_0 $ and $c $ $\ll 1$. Thus, there are
three time scales that are in principle different from each other.
Physically, they correspond to the mobile (fastest $a$),
the Cottrell type ($c$) and the immobile (slowest $b_0$).
Under these conditions we can eliminate one full equation
adiabatically. This aspect becomes transparent if the above
equations are written in terms of variables which are deviations
from the steady state. There is only one steady state defined
by:
\begin{equation}
x_{a} = z_{a} = {{1-2a+[(1-2a)^2+8b_0]^{1/2}}\over{4b_0}}, {\rm
and},y_{a}=1/2.
\end{equation}
\noindent
Defining new variables which are deviations from the steady
state
\begin{equation}
X=x-x_a,Y=y-y_a, {\rm and}{} \, Z=z-z_a,
\end{equation}
\noindent
Eqns. (5-7) take the form \begin{eqnarray}
\dot{X} & = &-(\alpha X +\chi Y +b_0X^2 +XY ), \\
\dot{Y} & = & - b_0\left(\Gamma X+\delta Y-a Z -b_0 X^2 + XY \right),
\\
\dot{Z} & = & c(X-Z).
\end{eqnarray}
where
\begin{eqnarray}
\alpha = a +2b_{0}x_{a} +y_{a} -1, \chi = x_{a} -1,
\nonumber
\\
& &
\\
\Gamma = y_{a} -2b_{0}x_{a}, \delta = x_{a} +1.
\nonumber
\end{eqnarray}
\noindent
Now, we can rescale the time-like variable by
$\tau^{\prime}=b_0\tau$ and get
\begin{eqnarray}
b_0{{d{X}}\over{d\tau^{\prime}}} & = & -(\alpha X+\chi Y +b_0X^2
+XY ),
\\
{{d{Y}}\over{d\tau^{\prime}}} & = & - \left(\Gamma X +\delta Y
-a Z -b_0 X^2 + XY \right) ,
\\
{{d{Z}}\over{d\tau^{\prime}}} & = & {{c}\over{b_0}}(X-Z).
\end{eqnarray}
\noindent
It is clear that in the limit of small $b_0$, $\vert{X}\vert
\rightarrow \infty$,
unless the left hand side vanishes identically. Thus, we can
eliminate $X$ in favour of the other two variables and obtain:
\begin{eqnarray}
{{d{Y}}\over{d\tau}} & = & -b_{0}\left[a X+2(x_a + X)Y
-aZ\right], \\
\mbox{and}\hspace{.5cm} {{d{Z}}\over{d\tau}} &= & c\left[X -Z\right],
\end{eqnarray}
\noindent
where
\begin{equation}
X = \frac{1}{2b_0}
\left(-(\alpha+Y)+[Y^2+2(\alpha-2b_{0}\chi)Y+\alpha^2]^{\frac{1}{2}} \right).
\end{equation}
\noindent
(The other root for $X$ is unphysical since it corresponds to
negative dislocation density.) It must be emphasized that this
adiabatic elimination becomes more exact as the value of the
parameter $b_0$ gets smaller. Equations (17-18) will be solved
reductive perturbatively. Writing these equations as a matrix
equation where the nonlinear part appears separately from the
linear part, we get
\begin{equation}
{{d\vec{R}}\over{d\tau}}= {\bf L}\vec{R} + \vec{N}
\label{mtrxeqn}
\end{equation}
\noindent
where
\begin{equation}
\vec{R} = \left( \begin{array}{c} Y\\ Z \end{array} \right),
\end{equation}
\begin{equation}
{\bf L} = \left( \begin{array}{cc} c_{0} & ab_{0} \\
-\frac{c\chi}{\alpha} & -c \end{array} \right), \end{equation}
\noindent
with $c_{0} = b_0(\frac{a\chi}{\alpha} -2x_a)$ and the
nonlinear part, $\vec{N}$, is given by
\begin{equation}
\vec{N} = \left( \begin{array}{c}
-ab_0(X+\frac{\chi}{\alpha} Y) - 2b_{0}XY \\
c(X+\frac{\chi}{\alpha} Y) \end{array} \right)=\left(
\begin{array}{c}
\sum_{n=2}^{\infty}\xi_{n}Y^{n} \\
\sum_{n=2}^{\infty}\zeta_{n}Y^{n}
\end{array} \right).
\end{equation}
\noindent
The coefficients $\xi_{n}$ and $\zeta_{n}$ appearing in the last
expression for $\vec{N}$ are functions of $ a$, $b_{0}$ and $c$
whose expressions for the required first few are given in
Eqs.(A8-A15) of Appendix A.
Consider stability of the fixed point as a function of the
parameter $c$. The eigenvalues, $\lambda_{\pm}$, of the matrix
${\bf L}$ are
\begin{equation}
\lambda_{\pm}=\frac{1}{2}\left(c_0 -c \pm \sqrt((c_0
-c)^2-8b_{0}x_a c)\right).
\end{equation}
\noindent
The fixed point becomes unstable when $c$ is less than $c_0$
($c$ is non-negative) and the discriminant of Eq.(24) is
negative giving a pair of complex conjugate eigenvalues. This
holds when the inequality $(3a-1)(1-2a^2)\geq 2b_{0}(2+a)^2$ is
satisfied. The instability region in the $\frac{1}{c}$ versus
$a$ plane for a fixed value of $b_{0}(=10^{-4})$ is shown in
Fig. 1. It extends approximately between $a=\frac{1}{3}$ and
$a=\frac{1}{\sqrt{2}}$.
To get approximate analytical solution of Eq.(20), we follow the
reductive perturbative approach similar to that used by
Mashiyama {\it et al}. [1975] and Richter {\it et al}. [1981].
We choose $c=c_0 (1-\epsilon)$ with $0 < \epsilon \ll 1$ and
write the matrix ${\bf L}$ as a sum of two matrices, ${\bf L}=
{\bf L}_0 +\epsilon{\bf L}_1$, where ${\bf L}_0$ is the matrix
${\bf L}$ evaluated for $c=c_0$ and
\begin{equation}
{\bf L}_1 = \left( \begin{array}{cc} 0 & 0 \\ \frac{c_0
\chi}{\alpha} & c_0
\end{array} \right).
\end{equation}
\noindent
The eigenvalues of ${\bf L}_0$ are $\lambda_{0
\pm}=\pm\imath\omega$,
where $\omega = \sqrt(2b_{0}c_0x_a)$.
Considering that the solution for $\vec{R}$ grows continuously out of the
critical eigenmodes, we can express it as
\begin{equation}
\vec{R}(\tau)=\Psi (\tau)e^{\imath\omega \tau}\vec{r_+} + \Psi^{*} (\tau)e^{-\imath\omega \tau}\vec{r_-},
\label{lincomb}
\end{equation}
\noindent
where $\Psi$ and $\Psi^*$ are time-dependent complex amplitudes while
$\vec{r}_\pm$ are right eigenvectors defined by
${\bf L}_0\vec{r}_\pm = \pm\imath\omega\vec{r}_\pm$.
Similarly, we introduce left eigenvectors, $\vec{s}_\pm^T$
defined by $\vec{s}_\pm^T{\bf L}_0 = \pm\imath\omega\vec{s}_\pm^T$.
(Note that $\vec{s}_+^T\vec{r}_- =\vec{s}_-^T\vec{r}_+= 0$. T refers to
transpose operation of the matrix concerned). Substituting this
expression for $\vec{R}$ in Eq.($\ref{mtrxeqn}$) and multiplying it by
$\vec{s}_+^T$ from the left-hand side gives the equation
governing $\Psi$:
\begin{equation}
e^{i\omega \tau} \frac {d \Psi} {d \tau} \,=\, \epsilon \mu \Psi e^{i\omega \tau}
\,-\, \epsilon \mu^* \Psi^{*} e^{-i\omega \tau} \,+\, \sum^{\infty}_{n=2} P_n
(\psi e^{i\omega \tau} \,+\, c.c. )^n.
\label{amp1}
\end{equation}
\noindent
$\mu=\mu_1 + \imath\mu_2$ and $P_n$ are complex coefficients which are
functions of $a$, $b_0$ and $c$. Their expressions are,
respectively, given in Eqs. (A1) and (A4) in Appendix A.
We express $\Psi$ in power series of $\epsilon^{\frac{1}{2}}$:
\begin{equation}
\Psi \,=\, \epsilon^{\frac {1} {2}} \psi_1 \,+\, \epsilon \psi_2 \,+\, ...\\
\end{equation}
\noindent
and introduce slowly varying multiple time scales
$\tau_1(=\epsilon\tau)$, $\tau_2(=\epsilon^2\tau)$,...
replacing $\frac{d}{d\tau}$ by
$\frac{\partial}{\partial\tau}+\epsilon\frac{\partial}{\partial\tau_1}
+\epsilon^2\frac{\partial}{\partial\tau_2}+...$. With this
substitution in Eq.($\ref{amp1}$), it can be solved successively
by equating terms of equal power in $\epsilon$ on both sides of
the equation. At first, $\cal{O}$($\epsilon^{\frac{1}{2}}$) terms
give rise to the equation
\begin{equation}
\frac {\partial \psi_1} {\partial \tau} \,=\, 0\\
\end{equation}
\noindent
which means that, on the time scale of $\tau$, $\psi_1$ is constant.
The next higher order, $\cal{O}(\epsilon)$, terms give the equation
\begin{equation}
\frac {\partial \psi_2} {\partial \tau} \,=\, P_2 (\psi_1 e^{i\omega \tau} \,+\,
c.c. )^2 e^{-i\omega \tau}\\
\end{equation}
\noindent
which can be integrated to get $\psi_2$.
$\cal{O}$($\epsilon^{\frac{3}{2}}$) terms give the equation
\begin{equation}
\frac{\partial \psi_3}{\partial \tau} + \frac{\partial
\psi_1}{\partial\tau_1} = \mu \psi_1 - \mu^* \psi_1^* e^{-2i\omega \tau}
+ \left[ 2P_2[(\psi_1 \psi_2e^{2i\omega\tau}
+ \psi_1 \psi_2^*) + c.c.] + P_3 (\psi_1 e^{i\omega\tau}
+ c.c. )^3 \right] e^{-i\omega\tau},
\end{equation}
\noindent
from which we extract the slow dynamics:
\begin{equation}
\frac {\partial \psi_1} {\partial \tau_1} \,+\, \mu \psi_1 \,+\, \eta \vert
\psi_1 \vert^2 \psi_1
\label{slowdyn1}
\end{equation}
\noindent
Since to ${\cal O}(\epsilon^{\frac{1}{2}})$ $\Psi = \epsilon^{\frac{1}{2}}\psi_1$,
Eq.($\ref{slowdyn1}$) gives the dynamics for the complex amplitude $\Psi$:
\begin{equation}
\frac{d\Psi}{d\tau} = \epsilon\mu\Psi + \eta\vert\Psi\vert^{2}\Psi.
\label{cubic}
\end{equation}
\noindent
The expression for the complex coefficient $\eta=\eta_1 +\imath\eta_2$
is given in Eq. (A2) in Appendix A.
Equation ($\ref{cubic}$) is a {\it cubic} TDGL equation where $\Psi$
is the complex amplitude for the slow mode which is also
referred to as complex order parameter (of the new state of
temporal order). Its steady state
solution gives the amplitude squared as
\begin{equation}
\vert\Psi\vert^2= -\epsilon\frac{\mu_{1}}{\eta_{1}}
\label{amp}
\end{equation}
\noindent
and the associated frequency,
$\Omega$, (with $\Psi=\vert\Psi\vert e^{\imath\Omega\tau}$) as
\begin{equation}
{\Omega}={\epsilon}\left(\mu_{2} -\frac{\eta_{2}}{\eta_{1}}\mu_{1}\right).
\label{freq}
\end{equation}
\noindent
Note that $\Psi$ describes the limit cycle oscillation.
This solution exists provided $\eta_{1}$ is negative since $\mu_{1}$
is positive (see expression of $\mu$ in Eq.(A1) in Appendix A).
$\eta_1$ is found to be negative in a narrow region
($0.4713\le a \le 0.5120$) as can be seen in Fig. 2.
In this case, since the amplitude of the slow modes grows continuously
in proportion to $\epsilon^{\frac{1}{2}}$ (see Eq.($\ref{amp}$))
the transition is supercritical bifurcation
(continuous or `second order')
For other values of $a$ (within the instability range),
$\eta_{1}$
is positive implying that the transition is subcritical bifurcation
(discontinuous or `first order').
One has to then go to quintic or even higher terms in the TDGL
equation for obtaining an expression for the slow modes (order parameter).
We have carried out the reductive
perturbative method further to derive the {\it quintic} TDGL equation:
\begin{equation}
\frac{d}{d\tau}\Psi=\epsilon\mu\Psi
+\eta\vert\Psi\vert^{2}\Psi
+\nu\vert\Psi\vert^{4}\Psi.
\label{quintic}
\end{equation}
\noindent
The steady state solution of this equation gives
the amplitude squared as
\begin{equation}
\vert\Psi\vert^2=\frac{1}{2}\left(-\frac{\eta_1}{\nu_1}
+ \sqrt{(\frac{\eta_1}{\nu_1})^2
-4\epsilon\frac{\mu_1}{\nu_1}}\right),
\end{equation}
and the frequency as
\begin{equation}
\Omega = \left(\eta_2 - \eta_1\frac{\nu_2}{\nu_1}\right)\vert\Psi\vert^2 +
\epsilon\left(\mu_2 - \mu_1\frac{\nu_2}{\nu_1}\right).
\end{equation}
We found $\nu_{1}$ to be negative in the range $0.4538\le a\le0.5097$
(see Fig. 2). {\it This means a narrow region:
$0.4538\le a\le0.4713$ within the subcritical bifurcation exists over which
the quintic TDGL equation has a solution} (see Fig. 2).
\section {Comparison with Experiments and Numerical Solutions}
\subsection{Comparison with Experiments}
To start with, consider the supercritical regime where
expressions for the amplitude and period of the limit cycle are simple.
Using the steady state solution of the cubic TDGL equation,
Eqs.($\ref{amp}$) \& ($\ref{freq}$), the dependence of
$\vert\Psi\vert^2$ and period,
$P \sim \frac{1}{(\omega + \Omega)}$, of the limit cycle on $a$ are, to
the leading order, found to be $a^{-2}$ and $(const. + a^2)$,
respectively. The parameter $ a (=\alpha_m/\theta V_m)$
is a function of the applied stress ($\sigma_a$) and temperature
(T). As remarked earlier, $\alpha_m$ is proportional to the
concentration of the solute atoms, and therefore $\alpha_m \sim exp
(-E/kT)$. Using the standard expression [ Alexander 1986]
$V_m(\sigma_a, T) = V_0 (\sigma_a/\sigma_0)^m exp (- E_m/kT)$ (with $m>1$),
we get
\begin{equation}
\frac{1}{a} \sim \left(\frac{\sigma_a}{\sigma_0}\right)^m e^{\frac{E-E_m}{kT}}.
\label{rel}
\end{equation}
From this we see that the amplitude of the limit cycle has a
strong increasing dependence on stress and an increasing
dependence on temperature if we
assume that $E > E_m$. In contrast, the period of the limit
cycle has a weak decreasing dependence on stress (as the leading
contribution is constant) and a decreasing
dependence on temperature.
Since stress and temperature are measurable quantities,
our predictions can be compared with experimental results.
The amplitude and period of the limit cycle are related,
respectively, to the amount of strain jumps and the period of the jumps
on the creep curve through the Orowan equation.
There are
very few experiments in this mode of testing as mentioned
in the introduction. The only experiment where this
dependence on stress and temperature has been measured is that by
Zagoruyko {\it et al} [1977].
However, it is possible to translate the results from
experiments in constant strain rate case to the creep case
and compare them with the results of this calculation.
According to Zagoruyko {\it et al} [1977], the amplitude of
the strain jumps increases with stress while its period
has a weak but decreasing dependence on stress. Experiments from constant
strain rate case also exhibit the same trend when the results are
translated in terms of constant stress experiments. It is well
known that the amplitude of the stress drops decreases with
applied strain rate. In fact, even the
present model predicts this behaviour for the constant strain rate mode
[Ananthakrishna \& Valsakumar 1982]. This implies
that the dependence of the amplitude of strain jumps
on stress should increase [ Kubin {\it et al} 1993].
[ This relation can
be seen as follows. In constant strain rate case, the deformation rate is
fixed and the stress developed in the sample is measured.
When the contribution to the plastic strain rate increases
due to increased dislocation motion (for whatever reasons),
the stress has to fall in order to keep the applied strain rate constant.
Thus, the relation between strain rate and stress is opposite.]
Clearly, the general trend is consistent with the experimental results.
Fig. 3 shows the actual dependence of the amplitude and the period on $a$
in the domain of supercritical bifurcation (not the leading one as given
by the above expressions).
Zagarukuyko ${\it et al}$ [1977] also report that the amplitude
of the strain jumps increases while its period
decreases with temperature, which is consistent with our
result ( provided $E > E_m $ ).
In the case of subcritical bifurcation, the dependence of the
amplitude of the strain jumps and the period on $a$ have similar behaviour
as in the case of the supercritical bifurcation. Eventhough, in this
case, leading order dependence on $a$ is difficult to obtain we
have their actual dependence plotted in Fig. 4. It may be
noted that they have qualitatively the same behaviour as in
Fig. 3 with the degree of dependence more pronounced in this case.
Experiments in constant strain rate case show that the stress drops
are seen to arise both abruptly as well as continuously
[Kubin {\it et al}, 1988]. Translating this result to the constant
stress case, it implies that the strain jumps can arise both
abruptly and continuously. This feature again follows from our calculations.
\subsection{Comparison with Numerical Solutions}
Having derived the TDGL equation, we would first like to
compare its result with the numerical solutions
obtained via Eqs. (17-18) and via Eq.($\ref{mtrxeqn}$). Secondly, due to the
fact that the quintic TDGL equation (Eq. $\ref{quintic}$) is
valid in a limited domain, one suspects that higher order
nonlinearities are controlling the subcritical bifurcation,
which is quite unusual.
Therefore, we would like to investigate the numerical
solution
obtained by solving Eq.($\ref{mtrxeqn}$) keeping successive leading powers in
$Y$. This analysis confirms the above suspicion that higher order
nonlinearities are important in
this model outside the domain of validity of the quintic TDGL equation.
Using the steady state solution of the quintic TDGL equation,
Eq.($\ref{quintic}$), in
Eq.($\ref{lincomb}$), we get an approximate expression for the limit cycle which is
usually called the secular motion. The equations governing the secular
motion are given by Eqs. (B5) and (B6) (hereafter called secular
equations) in Appendix B. This can be compared with the numerical solutions
obtained using Eqs. (17-18) (hereafter called the reduced model) and with
that obtained using Eq.($\ref{mtrxeqn}$) {\it where} the expansion in $Y$ of
Eq. (23) is limited up to a certain power (hereafter called the
$Y^n$-truncated model, n signifying the highest power of $Y$ after
truncation). {\it At the outset we state that the reduced model has bounded
solution over the entire instability domain}.
In the case of the numerical solutions obtained from Eq.($\ref{mtrxeqn}$),
we have found that while truncating the $Y$-expansion in Eq. (23)
at $Y^3$ is sufficient to give a bounded solution for the range of
supercritical bifurcation ($ 0.4713 < a < 0.512 $), it fails beyond this.
On the other hand, truncating the $Y$-expansion at $Y^5$ does extend the
domain of bounded solution ($ 0.4538 < a < 0. 512$) which matches with the
domain where the quintic TDGL equation works.
Figure 5 shows the plots of the solutions to the secular equations
(Eqs. B5 and B6),
the reduced model (Eqs. 17-18) and the $Y^3$-truncated model
(Eq. $\ref{mtrxeqn}$) for $a=0.5$ and $\epsilon=10^{-4}$.
All of them are numerically almost indistinguishable.
We have verified that the solutions obtained by these three methods show
that the amplitude of the limit cycle scales with $\epsilon^{\frac{1}{2}}$.
Figure 6 shows the solutions obtained by the three ways for $a=0.468$
and $\epsilon=10^{-4}$ where, this time, the truncation is at $Y^5$.
The agreement between the three solutions is reasonably good. Part of the
discrepancy between
the secular motion and the two numerical solutions can be attributed to
the range of values of the various terms
($k$'s, $\ell$'s, $m$'s and $n$'s of Appendix C)
contributing to $\eta$ and $\nu$. (They range from $10^{-16}$ to $10^9$).
We have also verified that the amplitude of the limit cycle has a finite
jump for this case.
For $a< 0.4538$, where the quintic TDGL equation is inadequate,
$Y^5$-truncated model is
also inadequate. However, $Y^7$-truncated model has a bounded solution for
the region $ 0.4385 < a < 0.5120$. In particular,
Fig. 7 shows the plots of the solutions obtained by the $Y^7$-truncated
model and that by the reduced model for $a=0.44$ and $\epsilon=10^{-4}$.
{\it This implies that seventh order TDGL equation need to be considered
for this range of $a$}. We have verified that $Y^9$ term extends the domain
of bounded solutions upto $ a = 0.4246 $. From this trend, it appears
that very high powers in $Y$
need to be retained to cover the entire domain upto $a = 0. 333$.
The region $a > 0.5120$ is even more interesting.
While the quintic TDGL equation is inadequate to give a bounded solution,
we found that retaining even upto the ninth power in $Y$ does not give a
bounded solution for the entire range of values $0.512 < a < 0.707$ (even
for those close to $a=0.512$). This suggests that this region is one
where the nonlinearity is strong. On the other hand, as pointed out earlier
the reduced model
has limit cycle solution in this range as well. In particular, Fig. 8
shows such a plot for $a=0.63$ and $\epsilon=10^{-4}$.
Thus, the results of the TDGL equation, the $Y^n$-truncated model and
the reduced model are consistent with each other. Further, the numerical
solutions via the power series in $Y$ throws light
on the nature of nonlinearities governing the solution in
different regions of instability.
\section{ Summary and Discussion}
We have carried out the reductive perturbative approach to the problem
of steps on creep curve and shown that the dynamics of the
system is described by a TDGL equation for the amplitude of the
slow modes (complex order parameter) $\Psi$ in the neighbourhood
of the bifurcation point. Since the above
derivation is valid only in the neighbourhood of the
critical value, the expression for
$\Psi$ is valid only for small $\epsilon$. This has been exemplified by the
reasonable agreement between the secular motion and the numerical solution
of the reduced model within the domain of the validity of the quintic
TDGL equation.
We have shown that both subcritical as well as supercritical bifurcations
are seen in the instability range of the parameter $a$. {\it While the
subcritical bifurcation ( abrupt or `first order' transition)
seen over most of the
values of $a$ is consistent with our earlier calculation}
[Ananthakrishna \& Sahoo, 1981b; Valsakumar \& Ananthakrishna, 1983],
{\it we see a supercritical bifurcation ( continuous or
`second order' transition) over a
narrow mid-range of} $a$. The existence of the supercritical bifurcation
was missed by us earlier. {\it The existence of both supercritical and
subcritical bifurcations is consistent with experiments.
In addition, the dependence of the amplitude and the periodicity
of the strain jumps on stress and temperature are consistent
with experiments}. From this point of view, even though the
derived TDGL equation is valid in
a limited domain, the present calculation allows a direct mapping of
these quantities. This calculation also helps us
to demonstrate the complicated dependence of the slow modes
on the original modes. This will serve as a warning to those
using hand waiving arguments for declaring certain modes as fast modes
and others as slow modes in modelling of such of these problems.
Looked at from the point of view of the properties of the model,
there are some interesting features. For the region outside the
validity of the quintic TDGL equation, on the basis of a careful
numerical analysis, we found that high order nonlinearities govern
the nature of the subcritical bifurcation. It must be emphasized
that this feature is unusual and this insight would not have
been possible but for the numerical solutions obtained by
keeping successive higher powers in $Y$, which in itself
is the basis for the derivation of the TDGL equation.
This unusual feature of the model interpreted in the language of
phase transitions give better insight and could also find applicability.
For conventional models,
the `free energy' is described by an expansion in power series
of the order parameter. Even in the case of dynamic transition
such as the present one, it is possible to associate a
`free energy' like function such that
$\partial \Psi\over\partial\tau$ $= -\frac{\delta F}{\delta \Psi^*}$, where
$F[\Psi,\Psi^*]$ is the `free energy' like function.
While the `free energy' for
`second order' phase transitions is described by retaining up to fourth
power in the order parameter, up to sixth power is conventionally required
for `first order' phase transitions (with the appropriate signs
for the coefficients in the expansion). In the present case, however,
we need to go to as high as twelfth power (or more) of the order parameter
to cover the interval $0.3333 < a < 0.4246$ (or equivalently twelfth power or
higher in $Y$). In this case, including
successively higher powers in $Y$ increases the domain of description.
On the other hand, in the
interval of $0.512 < a < 0.707$, even retaining upto tenth power
in $Y$ (which is the highest power we have checked) does not work.
This must be contrasted with the existence of bounded solution for
the reduced model over the entire interval. {\it This feature is rather
unusual and, to the best of our knowledge, we are not aware of any
other model which exhibits this property}.
\subsection*{ Acknowledgement}
One of us (M.B.) would like to thank the International Program in Physical
Sciences, Uppsala University (Sweden) for offering a fellowship to study
at Indian Institute of Science. Part of this work has been supported
by IFCPAR Grant No. 1108-1.
\newpage
\noindent
\begin{description}
\item {\bf References}
\item Aifantis, E. C. [1988] ``On the problem of dislocation
patterning and persistent slip bands'' in
{\it Non Linear Phenomena in Materials Science I}, eds.
Kubin, L. P. \& Martin, G. (Trans Tech, Switzerland), pp. 397-406.
\item Alexander, H. [1986] ``Dislocations in covalent crystals''
in {\it Dislocations in Solids} ed. Nabarro, F. R. N. (North-Holland), 151.
\item Ananthakrishna, G. [1993] ``Formation, propagation of
bands and chaos in jerky flow'',
{\it Scripta. Metall.} {\bf 29}, 1183-1188.
\item Ananthakrishna, G. \& John, T. M. [1990] ``Instabilities and chaos in
plastic flow'', in {\it Directions in Chaos} Vol. 3, ed. Hao Bai-lin
(World Scientific, Singapore), pp. 133-148.
\item Ananthakrishna, G., Fressengeas C., Grosbras, M., Vergnol, J.,
Engelke, C., Plessing, J., Neuhaeuser, H., Bouchaud, E., Planes, J.
\& Kubin, L. P. [1995a] ``On the existence of chaos in jerky flow,''
{\it Scripta Metall.} {\bf 32}, 1731-1737.
\item Ananthakrishna, G., Kubin, L. P. \& Martin, G. (eds.) [1995b]
{\it Solid State Phenomena} Vol. 42\&43 (Scitec, Switzerland).
\item Ananthakrishna, G. \& Noronha, S. J. [1995] ``Chaos in jerky
flow: Theory and experiment'' in {\it Solid State Phenomena}
Vol. 42\&43, eds. Ananthakrishna, G.,
Kubin, L. P. \& Martin, G. (Scitec, Switzerland) , pp. 277-286.
\item Ananthakrishna G. \& Sahoo, D. [1981a] ``A statistical
dislocation dynamics with application to LiF'',
{\it J. Phys. D} {\bf 14}), 699-713.
\item Ananthakrishna, G. \& Sahoo, D. [1981b] ``A model based on
nonlinear oscillations to explain jumps on creep curves'',
{\it J. Phys. D} {\bf 14}, 2081-2090.
\item Ananthakrishna, G. \& Valsakumar, M. C. [1982] ``Repeated
yield drop phenomena: a temporal dissipative structure'',
{\it J. Phys. D} {\bf 15}, L171-L175.
\item Ananthakrishna, G. \& Valsakumar, M. C. [1983] ``Chaotic flow in a
model for repeated yielding'', {\it Phys. Lett. A} {\bf 95}, 69-71.
\item Ananthakrishna, G., Fressengeas C., Grosbras, M., Vergnol, J.,
Engelke, C., Plessing, J., Neuhaeuser, H., Bouchaud, E., Planes, J.
\& Kubin, L. P. [1995] ``On the existence of chaos in jerky flow,''
{\it Scripta Metall.} {\bf 32}, 1731-1737.
\item Bodner, S. R. \& Rosen, A. [1967] ``Discontinuous yielding of
commercially-pure aluminium'', {\it J. Mech. Phys. Solids}
{\bf 15}, 63-77.
\item Brindley, B. J. \& Worthington, P. J. [1970] ``Yield-point
phenomena in substitutional alloys'', {\it Metall. Reviews}
{\bf 145}, 101-114.
\item Carr, J. [1981] {\it Applications of Center Manifold Theory}
(Springer-Verlag, Berlin).
\item Chen, L. Y., Goldenfeld, N. \& Oono, Y., [1996] ``The
Renormalization Group and Singular Perturbations: Multiple-
Scales, Boundary Layers and Reductive Perturbation Theory'',
{\it Phys. Rev. E} {\bf 54}, 376-394.
\item Chihab, K., Estrin, Y., Kubin, L. P. \& Vergnol, J. [1987]
``The kinetics of the Portevin-Le Chatelier effect in an
Al-5 at\% Mg alloy'', {\it Scripta. Metall.} {\bf 21}, 203-208.
\item Cottrell, A. H. [1953] ``A note on the Portevin-Le Chatelier
effect'', {\it Phil. Mag.} {\bf 44}, 829-832.
\item Da Silveira, T. L. \& S. N. Monteiro, S. N. [1979] ``Jumps
in the creep curve of austentic stainless steels'',
{\it Met. Trans. A} {\bf 10}, 1795-1796.
\item Estrin, Y. \& Kubin, L. P. [1989] ``Collective dislocation
behavior in dilute alloys and the Portevin-Le Chatelier effect'',
{\it J. Mech. Behaviour of Materials} {\bf 2}, 255-292.
\item Goldenfeld, N., Martin, O. \& Oono, Y. [1989]
``Intermediate Asymptotics and Renormalization Group Theory'', {\it J. Sci.
Comp.} {\bf 4}, 355.
\item Guckenheimer, J. \& Holmes, P. [1983] {\it Nonlinear Oscillations,
Dynamical Systems, and Bifurcations of Vector Fields} vol. 42
of {\it Applied Math. Sciences} (Springer-Verlag, Berlin), 123-145.
\item Hahner, P. \& Kubin, L. P. [1992] ``Coherent Propagative Structures
in Plastic Deformation: A Theory of Ludlers Bands in Polycrystals''
in {\it Solid State Phenomena} Vol. 3\&4, eds.
Kubin, L. P. \& Martin, G. (Trans Tech, Switzerland), pp. 385-402.
\item Hahner, P. [1993] ``Modelling the spatiotemporal aspects of the
Portevin-Le Chatelier effect'', {\it Mater. Sci. and Eng.}
{\bf 164}, 23-34.
\item Hall, E. O. [1970] {\it Yield Point Phenomena in Metals and
Alloys} (Macmillan, London).
\item Kubin, L. P., Chihab, K. \& Estrin, Y. [1988] ``The rate
dependence of the Portevin-Le Chatelier effect'',
{\it Acta Metall.} {\bf 36}, 2707-2718.
\item Kubin, L. P. \& Estrin, Y. [1990] ``Evolution of dislocation
densities and the critical conditions for the Portevin-Le Chatelier
effect'', {\it Acta Metall.} {\bf 38}, 697-708.
\item Kubin, L. P. \& Estrin, Y. (organizers) [1993] ``Viewpoint
Set No. 21: Propagative instabilities'', {Scripta Metall.}
{\bf 29}, 1147-1188.
\item Kubin, L. P. \& Lepinoux, J. [1988] ``The dynamic Organization of
dislocation structures'', {\it Strength of Metals and Alloys} (ICSMA 8),
vol. 1, eds. Kettunen, P. O., Lepisto, T. K., \& Lehtonen, M. E.,
(Pergamon Press ,Oxford), pp. 35-59.
\item Kubin, L. P. \& Martin, G. (eds.) [1988] {\it Solid State Phenomena}
Vol. 3\&4 (Trans Tech, Switzerland).
\item Kunihiro, T. [1995] ``A Geometrical Formulation of the
Renormalization Group Method for Global Analysis'',
{\it Prog. Theor. Phys.} {\bf 94} 503-514.
\item Kunihiro, T. [1996] ``The Renormalization Group Method
Applied to Asymptotic Analysis of Vector Fields'', in hep-th/9609045.
\item Kuramoto, Y. \& Tsuzuki, T. [1974] ``Reductive perturbative
approach to chemical instabilities'', {\it Prog. Theor. Phys.}
{\bf 52}, 1399-1401.
\item Lubahn, J. D. \& Felgar, R. P. [1961]
{\it Plasticity and Creep of Metals} (John Wiley, New York).
\item Martin, G. \& Kubin, L. P. (eds.) [1992] {\it Solid State Phenomena}
Vol.23\&24 (Trans Tech, Switzerland).
\item Mashiyama, H., Ito, A. \& Ohta, T. ``Fluctuations and phase
transitions far from equilibrium'', {\it Prog. Theor. Phys.}
{\bf 54}, 1050-1066.
\item Newell, A. C. \& Whitehead, J. A. [1968] ``Finite
bandwidth, finite amplitude convection'',
{\it J. Fluid Mech.} {\bf 38}, 279-303.
\item Noronha, S. J., Ananthakrishna, G., Quaouire, L. \& Fressengeas, C.
[1997] ``Chaos in Jerky Flow- Experimental verification of a
theoretical prediction'', {\it Pramana}, in press.
\item Noronha, S. J., Ananthakrishna, G., Quaouire, L., Fressengeas, C.
\& Kubin, L. P. [1996] ``Chaos in the Portevin-Le Chatelier Effect'',
submitted to Int. J. Bif. \& Chaos.
\item Penning, P. [1972] ``Mathematics of the Portevin-Le Chatelier
effect'', {\it Acta Metall.} {\bf 20}, 1169-1175.
\item Quaouire, L. \& Fressengeas, C. [1995] ``Dynamical analysis of the
Portevin-Le Chatelier effect'' in {\it Solid State Phenomena}
Vol. 3\&4 (Trans Tech, Switzerland), eds. Ananthakrishna, G.,
Kubin, L. P. \& Martin, G. (Scitec, Switzerland), pp. 293-302.
\item Richter, P. H., Procaccia, I. \& Ross, J. [1981] ``Chemical
Instabilities'' in {\it Advances in Chemical Physics} Vol. 43,
eds. Prigogine, I, \& Rice, S. (Wiley-Interscience, New York),
pp. 217-268.
\item Sahoo, D. \& Ananthakrishna, G. [1982] ``A phenomenological
dislocation transformation model for the mobile fraction in simple
systems'', {\it J. Phys. D} {\bf 15}, 1439-1449.
\item Stejskalova, V., Hammersky, M., Luckac, P., Vostry, P. \&
Spursil, B. [1981] {\it Czech. J. Phys.} {\bf B31}, 195.
\item Taniuti, T. \& Wei, C. C. [1968] ``Reductive perturbative
method in nonlinear wave propagation I'',
{\it J. Phys. Soc. Japan} {\bf 24}, 941-946.
\item Troger, H. \& Steindl, A. [1991] {\it Nonlinear Stability
and Bifurcation Theory} (Springer-Verlag, Wien, New York), pp. 52-68.
\item Valsakumar, M. C. \& Ananthakrishna, G. [1983] ``A model based on
nonlinear oscillations to explain jumps on creep curves: II.
Approximate solutions'', {\it J. Phys. D} {\bf 16}, 1055-1068.
\item Venkadesan, S., Murthy, K. P. N., \& Valsakumar, M. C. [1995]
`` Chaotic Flow in Al-Mg Alloy'' in {\it Solid State Phenomena}
Vol. 42\&43, eds. Ananthakrishna, G.,
Kubin, L. P. \& Martin, G. (Scitec, Switzerland), pp. 287-292.
\item Zagoruyko, L. N., Osetskiy A. I. \& Soldatov, V. P. [1977]
``Discontinuous deformation of zinc single crystals under creep
conditions'', {\it Phys. Met. Metallogr.} {\bf 43}(5), 156-164.
\end{description}
\newpage
\section*{Appendix A}
In this appendix we give the expressions for the coefficients appearing
in the TDGL equation up to the quintic term, i.e. the expressions for
$\mu$, $\eta$ and $\nu$ in the equation
$\frac{d}{d\tau}\Psi=\epsilon\mu\Psi
+\eta\vert\Psi\vert^{2}\Psi
+\nu\vert\Psi\vert^{4}\Psi$.
\noindent
They are given by
\setcounter{equation}{0}
\renewcommand{\theequation}{A\arabic{equation}}
\begin{equation}
\mu\equiv \frac{1}{2}(c_0-\imath\omega),
\end{equation}
\begin{equation}
\eta\equiv 2P_2(k_1+k_2+k_2^*+k_3^*) + 3P_3,
\end{equation}
\noindent
and
\begin{equation}
\nu\equiv 2P_2Q_2 +3P_3Q_3 +4P_4Q_4 + 10P_5,
\end{equation}
\noindent
where
\begin{equation}
P_n\equiv\frac{(ab_0)^{n-1}}{2\omega}\left[\omega\xi_n -\imath(c_0\xi_n +ab_0\zeta_n)\right],
\end{equation}
\noindent
and
\begin{equation}
Q_2\equiv(k_1+k_3^*)\ell_3 +(k_2+k_2^*)\ell_3^*+(k_1^*+k_3)(\ell_2+\ell_4^*) + m_5+m_6+m_6^*+m_7^*,\\
\end{equation}
\begin{equation}
Q_3\equiv 2(k_1+k_3^*)(k_1^*+k_2+k_2^*+k_3)+(k_2+k_2^*)^2+\ell_2+\ell_3+2\ell_3^*+\ell_4^*,\\
\end{equation}
\begin{equation}
Q_4\equiv k_1^*+k_3+3(k_1+k_2+k_2^*+k_3^*).
\end{equation}
The expressions for $\xi_n$'s and $\zeta_n$'s used in Eq.(A5) are given by
\begin{equation}
\xi_2\equiv\frac{b_0\chi}{\alpha^3}\left[2\alpha^2 -a(\alpha-b_0\chi)\right],
\end{equation}
\begin{equation}
\xi_3\equiv\frac{b_0\chi}{\alpha^5}(\alpha - b_0\chi)(a\Delta - 2\alpha^2),
\end{equation}
\begin{equation}
\xi_4\equiv\frac{\alpha^2 - \Delta^2}{16\alpha^7}\left[a(\alpha^2 - 5\Delta^2) + 8\Delta\alpha^2\right],
\end{equation}
\begin{equation}
\xi_5\equiv -\frac{\alpha^2-\Delta^2}{16\alpha^9}\left[a\Delta(3\alpha^2 - 7\Delta^2) - 2\alpha^2(\alpha^2 - \Delta^2)\right],
\end{equation}
\noindent
and
\begin{equation}
\zeta_2\equiv\frac{c_0}{4b_0\alpha^3}(\alpha^2 - \Delta^2),
\end{equation}
\begin{equation}
\zeta_3\equiv -\frac{\Delta}{\alpha^2}\zeta_2,
\end{equation}
\begin{equation}
\zeta_4\equiv - \frac{\alpha^2 - 5\Delta^2}{4\alpha^4}\zeta_2,
\end{equation}
\begin{equation}
\zeta_5\equiv\frac{\Delta(3\alpha^2 - 7\Delta^2)}{4\alpha^6}\zeta_2,
\end{equation}
\noindent
where
\begin{equation}
\Delta\equiv \alpha- 2b_0\chi.
\end{equation}
Expressions for $k$'s, $\ell$'s, $m$'s and $n$'s are given in Appendix C.
\section*{Appendix B}
In this appendix the equations describing the secular motion are derived
for the case when the order parameter, $\Psi$, is found from the quintic
TDGL equation (Eq. 44).
From Eq. (39),
\setcounter{equation}{0}
\renewcommand{\theequation}{B\arabic{equation}}
\begin{equation}
Y(\tau)=ab_0(\Psi e^{\imath\omega\tau} + c. c.),
\end{equation}
and
\begin{equation}
Z(\tau)=(-c_0+\imath\omega)\Psi e^{\imath\omega\tau} + c. c.,
\end{equation}
where the complex amplitude is
$\Psi=\epsilon^{\frac{1}{2}}\psi_1 +\epsilon\psi_2 +...+\epsilon^{\frac{5}{2}}\psi_5$
with $\psi_2,..., \psi_5$ given in terms of functions of $\psi_1$ and phase
factors (see Appendix C). On the other hand, to
${\cal O}(\epsilon^{\frac{1}{2}})$,
\begin{equation}
\Psi=\epsilon^{\frac{1}{2}}\psi_1,
\end{equation}
which, upon inverting, gives $\psi_1$ in terms of $\Psi$:
\begin{equation}
\psi_1=\epsilon^{-\frac{1}{2}}\vert\Psi\vert e^{\imath\Omega\tau}.
\end{equation}
\noindent
Substituting the $\psi_2,...,\psi_5$-expressions from Appendix C in Eqs.
(B1) and (B2) and, then, using Eq. (B4) leads to obtaining the secular
equations given by:
\begin{equation}
Y=2ab_0 \,P_+,
\end{equation}
\noindent
and
\begin{equation}
Z=-2c_0 \,P_+ \,-2\omega \,P_-.
\end{equation}
\noindent
where
\begin{eqnarray}
P_{\pm} &\equiv &| \Psi | \, F_{\pm}(\Omega_c\,\tau) + K_{13}^{\pm}\, |\Psi|^{2}
F_{\pm}(2\Omega_{c} \, \tau + \theta_{k_{13}}^{\pm}) + |\Psi|^{2} \,
G_{\pm}(k_2) \nonumber\\
& & +\epsilon\, L_1 \, |\Psi|\, F_{\pm} \left(\Omega_c\, \tau -
\theta_{\ell_{1}}\right)
+ L_{24}^{\pm} \, |\Psi|^{3}\, F_{\pm} \left(3\Omega_c\, \tau +
\theta_{\ell_{24}}^{\pm}\right)
+ L_3 \, |\Psi|^{3}\, F_{\pm} \left(\Omega_c\, \tau -
\theta_{\ell_{3}}\right) \nonumber\\
& & + \epsilon \, M_{13}^{\pm} \, |\Psi|^{2}\, F_{\pm} \left(2\Omega_c\,
\tau + \theta_{m_{13}}^{\pm} \right)
+ \epsilon \, |\Psi|^2 \, G_{\pm} (m_{2}) +
M_{48}^{\pm} \, |\psi|^{4} \, F_{\pm} \left(4\Omega_c\, \tau
+ \theta_{m_{48}}^{\pm} \right) \nonumber\\
& & + M_{57}^{\pm} \, |\Psi|^{4} \, F_{\pm} \left(2\Omega_c\, \tau +
\theta_{m_{57}}^{\pm} \right)
+ |\psi|^{4} \, G_{\pm} (m_{6}) + \epsilon^{2}\, N_1 \, |\Psi| \, F_{\pm} \left(\Omega_c\, \tau
- \theta_{n_{1}}\right) \nonumber\\
& & +\epsilon\, N_{24}^{\pm} \, |\Psi|^{3} \, F_{\pm}
\left(3\Omega_c\, \tau + \theta_{n_{24}}^{\pm}\right)
+\epsilon\, N_3 \, |\Psi|^{3} \, F_{\pm} \left(\Omega_c\, \tau
- \theta_{n_{3}}\right) + N_{59}^{\pm} \, |\Psi|^{5} \, F_{\pm} \left(5\Omega_c\, \tau
+ \theta_{n_{59}}^{\pm}\right) \nonumber\\
& & + N_{68}^{\pm} \, |\Psi|^{5}\, F_{\pm} \left(3\Omega_c\, \tau
+ \theta_{n_{68}}^{\pm}\right)
+ N_{7}^{\pm} \, |\Psi|^{5}\, F_{\pm} \left(\Omega_c\, \tau
- \theta_{n_{7}}^{\pm}\right),
\end{eqnarray}
with
\begin{eqnarray}
F_{+} (\phi) & \equiv & cos(\phi), \\
F_{-} (\phi) & \equiv & sin(\phi), \\
G_{+}(u) & \equiv & Real (u),\\
G_{-}(u) & \equiv & Im (u) ,\\
\Omega_{c} & \equiv & \omega + \Omega,\\
V_{ij}^{\pm} & \equiv & | v_{i} \pm v^{\star}_{j}|,\\
V_{i} & \equiv & | v_{i}|,\\
\Theta^{\pm}_{v_{ij}} & \equiv & \sin^{-1} \left(\frac{Real(v_{i} \pm v_{j}^{\star})}
{|v_{i} \pm v_{j}^{\star}|}\right) ,
\end{eqnarray}
\noindent
where $V$ stands for either $K$, $L$, $M$ or $N$, while $v$ stands for either
$k$, $\ell$, $m$, or $n$ correspondingly. Expressions for $K$, $L$, $M$
and for $N$ can be obtained from $k$'s, $\ell$'s, $m$'s and $n$'s which
are given in Appendix C.
\section*{Appendix C}
Expressions for $\psi_2$, $\psi_3$, $\psi_4$, $\psi_5$ (with a factor
$e^{\imath\omega\tau}$) are
\setcounter{equation}{0}
\renewcommand{\theequation}{C\arabic{equation}}
\begin{eqnarray}
\psi_{2}\, e^{i\omega \tau} & = & k_{1}\, \psi_{1}^{2}\, e^{2i\omega
\tau} + k_{2} |
\psi_{1} |^{2} + k_{3}\, \psi_{1}^{\star^{2}}\, e^{-2i\omega \tau},\\
\psi_{3}\, e^{i\omega \tau} & = & \ell_{1}\, \psi_{1}^{\star}\,
e^{-i\omega \tau}+\ell_{2}\, \psi_{1}^{3} \, e^{3i\omega \tau}+
\ell_{3}|\psi_{1}|^{2}\,
\psi_{1}^{\star}\, e^{-i\omega \tau} + \ell_{4}\, \psi_{1}^{\star^{3}}\,
e^{-3i\omega \tau},\\
\psi_{4}\, e^{i\omega \tau} & = & m_{1}\, \psi_{1}^{2} \, e^{2i\omega \tau}
+ m_{2}\,|
\psi_{1}^{2}| + m_{3} \, \psi_{1}^{\star^{2}}\, e^{-2i\omega \tau} +
m_{4} \, \psi_{1}^{4}\, e^{4i\omega \tau}+ m_{5} \, |\psi_{1}|^{2}\,
\psi_{1}^{2}\, e^{2i\omega \tau}\nonumber \\
& &+ m_{6} \, |\psi_{1}|^{4} + m_{7} \, |\psi_{1}|^{2}\,
\psi_{1}^{\star^{2}}\, e^{-2i\omega \tau}+ m_{8} \,
\psi_{1}^{\star^{4}}\, e^{-4i\omega \tau} , \\
\psi_{5}\, e^{2i\omega \tau} & = & n_{1} \,\psi_{1}^{\star}\,
e^{-i\omega \tau} + n_{2}\,\psi_{1}^{3}\, e^{3 i \omega \tau} + n_{3}\,
|\psi_{1}|^{2}\psi_{1}^{\star} \, e^{-i\omega \tau} + n_{4}
\,\psi_{1}^{\star^{3}}\, e^{-3i \omega \tau} + n_{5} \, \psi_{1}^{5}\,
e^{5i \omega \tau}\nonumber \\
& & + n_{6}|\psi_{1}|^{2} \psi_{1}^{3}\, e^{3i \omega\tau}
+ n_{7}\, |\psi_{1}|^{4}\, \psi_{1}^{\star}\, e^{-i\omega \tau}
+ n_{8} \,|\psi_{1}|^{2}\, \psi_{1}^{\star^{3}}\, e^{-3i\omega \tau}+
n_{9}\, \psi_{1}^{\star^{5}}\, e^{-5 i \omega \tau},
\end{eqnarray}
\noindent
where
\begin{eqnarray}
k_{1} & \equiv & - \frac{i}{\omega}\, P_{2},\\
k_{2} & \equiv & \frac{2i}{\omega}\, P_{2},\\
k_{3} & \equiv & \frac{i}{3\omega}\, P_{2},\\
\ell_{1} & \equiv & - \frac{i}{2\omega}\, \mu^{\star},\\
\ell_{2} & \equiv & -
\frac{i}{2\omega}\,\left[2P_{2}(k_{1}+k_{3}^{\star})+P_{3}\right],\\
\ell_{3} & \equiv &
\frac{i}{2\omega}\,\left[2P_{2}(k_{1}^{\star}+k_{2}^{\star}+k_{2} +
k_{3})+3P_{3}\right],\\
\ell_{4} & \equiv &
\frac{i}{4\omega}\,\left[2P_{2}(k_{1}^{\star}+k_{3})+P_{3}\right],\\
m_{1} & \equiv & -\frac{i}{\omega}\left[-\mu\, k_{1} - \mu^{\star}\,
k_{3}^{\star} + 2 P_{2} \, \ell_{1}^{\star} \right],\\
m_{2} & \equiv & \frac{i}{\omega}\left[-\mu^{\star}\,(k_{2}+ k_{2}^{\star})+
2 P_{2} (\ell_{1}+\ell_{1}^{\star}) \right],\\
m_{3} & \equiv & \frac{i}{3\omega}\left[\mu\, k_{3} -
\mu^{\star}(k_{1}^\star+ 2k_{3}) +2P_2 \ell_{1}\right],\\
m_{4} & \equiv & -
\frac{i}{3\omega} \left\{P_{2}\left[(k_{1}+k_{3}^{\star})^{2}+ 2
(\ell_{2}+\ell_{4}^{\star})\right]+ 3P_{3} (k_{1}+k_{3}^{\star}) + P_{4}
\right\},\\
m_{5} & \equiv & -
\frac{i}{\omega}\left\{2P_{2}\left[(k_{1}+k_{3}^{\star})(k_{2}+k_{2}^{\star})
+\ell_{2}+\ell_{3}^{\star} +\ell_{4}^{\star}\right]+ 3P_{3}
\left[2(k_{1}+k_{3}^{\star}) +k_{2} +k_{2}^{\star}\right]\right. \nonumber \\
& & + 4P_{4}- 2k_{1}\,\eta \left. \right\},\\
m_{6} & \equiv & \frac{i}{\omega}\left\{P_{2}\left[2(k_{1}+k_{3}^{\star})
(k_{1}^\star+k_{3})+(k_{2}+k_{2}^{\star})^{2}
+2(\ell_{3} +\ell_{3}^{\star})\right] \right. \nonumber\\
& & + 3P_{3}\left[k_{1}+k_{1}^{\star} + 2(k_{2}
+k_{2}^{\star})+k_{3}+k_{3}^{\star}\right]
+ 6P_{4}-2k_{2}\eta_1 \left. \right\},\\
m_{7} & \equiv &
\frac{i}{3\omega}\left\{2P_{2}\left[(k_{1}^{\star}+k_{3})(k_{2}^{\star}+k_{2})
+\ell_{2}^{\star}+\ell_{3} +\ell_{4}\right]+ 3P_{3}
\left[2(k_{1}^{\star}+k_{3}) + k_{2}
+k_{2}^{\star}\right]\right. \nonumber \\
& & + 4P_{4}-2k_{3} \eta^{\star}\left. \right\},\\
m_{8} & \equiv &
\frac{i}{5\omega}\left\{P_{2}\left[(k_{1}^{\star}+k_{3})^{2}
+2(\ell_{2}^{\star} +\ell_{4})\right]
+ 3P_{3}(k_{1}^{\star} + k_{3})+P_{4} \right\},\\
n_{1} & \equiv & \frac{i}{2 \omega}\left(\mu - \mu^{\star}\right)
\ell_{1},\\
n_{2} & \equiv & -\frac{i}{2 \omega} \left\{ 2 P_{2}\left[\ell_{1}^{\star} (k_{1}+ k_{3}^{\star}) +
m_{1} + m_{3}^{\star}\right] +3P_{3}\, \ell_{1}^{\star} -2\mu\ell_{2} - \mu^{\star}
\ell^{\star}_{4} \right\},\\
n_{3} & \equiv & \frac{i}{2\omega} \left\{ 2 P_{2}\left[\ell_{1}(k_{2}+ k_{2}^{\star} ) +
\ell^{\star}_{1}(k_{1}^{\star} + k_{3}) + m_{1}^{\star} +m_{2}^{\star}
+m_{2}+ m_{3}\right]\right. \nonumber\\
& & + 3P_{3}(\ell_{1}^{\star}+2\ell_{1})\left.-\eta^{\star} \, \ell_{1} - 2
\mu^{\star}\,\ell_{3} \right\},\\
n_{4} & \equiv & \frac{i}{4\omega} \left\{ 2 P_{2}\left[\ell_{1}(k_{1}^{\star}+ k_{3}) +
m_{1}^{\star} + m_{3}\right] + 3P_{3}\, \ell_{1}-\mu^{\star} \ell_{2}^{\star} +
(\mu - 3\mu^{\star})\ell_{4} \right\},\\
n_{5} & \equiv & -
\frac{i}{4\omega}\left\{2P_{2}\left[m_{4}+m_{8}^{\star} +
(k_{1}+k_{3}^{\star})
(\ell_{2}+\ell_{4}^{\star})\right] + 3P_{3}
\left[(k_{1}+k_{3}^{\star})^2 +\ell_{2} + \ell_{4}^{\star}\right] \right.\nonumber \\
& & +4P_{4}(k_{1}+k_{3}^{\star}) +P_{5}\left. \right\},\\
n_{6} & \equiv & -\frac{i}{2\omega}\left\{ 2P_{2}\left[m_{4} +
m_{5} +m_{7}^{\star} +
m_{8}^{\star} + \ell_{3}^{\star}(k_{1}+k_{3}^{\star}) + (\ell_{2}
+\ell_{4}^{\star}) (k_{2} + k_{2}^{\star}) \right] \right. \nonumber \\
& & + 3P_{3}
\left[\ell_{3}^{\star} + 2(\ell_{2} + \ell_{4}^{\star}) + (k_{1} +
k_{3}^{\star})^{2} + 2(k_{1}+k_{3}^{\star})(k_{2}+k_{2}^{\star}) \right]\nonumber \\
& & + 4P_{4} \left[ k_{2} + k_{2}^{\star} + 3(k_{1}+k_{3}^{\star}) \right]
+ 5 P_{5}\left.-3\eta \ell_{2} \right\},\\
n_{7} & \equiv & \frac{i}{2\omega}\left\{ 2P_{2}\left[m_{5}^{\star} +m_{6}^{\star}+
m_{6} +m_{7} + (\ell_{2}^{\star}+\ell_{4})(k_{1}+k_{3}^{\star}) + \ell_{3}
(k_{2} + k_{2}^{\star})+\ell_{3}^{\star}(k_{1}^{\star}+k_{3}) \right] \right. \nonumber\\
& & + 3P_{3} \left[ (k_{2} + k_{2}^{\star})^{2} +
2(k_{1}^{\star}+k_{3})(k_{1}+k_{2}+k_{2}^{\star}+k_{3}^{\star})+\ell_{2}^{\star}
+ \ell_{3}^{\star} + 2\ell_{3}+\ell_{4}\right] \nonumber\\
& & + 4P_{4} \left[ k_{1} + k_{3}^{\star} + 3(k_{1}^{\star}+k_{2}^{\star}+k_{2}
+k_{3})\right] +10 P_{5}\left.-(\eta
+2\eta^{\star})\ell_{3} \right\},\\
n_{8} & \equiv & \frac{i}{4\omega}\left\{2P_{2}\left[m_{4}^{\star} + m_{5}^{\star} +m_{7} +
m_{8} + \ell_{3}(k_{1}^{\star}+k_{3}) + (\ell_{2}^{\star}
+\ell_{4}) (k_{2} + k_{2}^{\star}) \right] \right. \nonumber \\
& & + 3P_{3}\left[ (k_{1}^{\star} +
k_{3})^{2} + 2(k_{2}+k_{2}^{\star})(k_{1}^\star+k_{3})+2 (\ell_{2}^{\star} +
\ell_{4}) + \ell_{3}\right] \nonumber \\
& & + 4P_{4} \left[ k_{2} + k_{2}^{\star} + 3(k_{1}^{\star}+k_{3}) \right]
+ 5 P_{5}\left.-3\eta^{\star}\ell_{4}
\right\},\\
n_{9} & \equiv & \frac{i}{6\omega}\left\{2P_{2}\left[m_{4}^{\star} +
m_{8} + (\ell_{2}^{\star}
+\ell_{4}) (k_{1}^{\star} + k_{3}\right] + 3P_{3}
\left[ (k_{1}^{\star} +
k_{3})^{2} + \ell_{4}^{\star} +
\ell_{4}\right] \right.\nonumber \\
& & + 4P_{4} (k_{1}^{\star}+k_{3}) + P_{5}\left. \right\}.
\end{eqnarray}
Note that expressions for $P_2$,...,$P_5$ are given in Eq. (A5) in
Appendix A.
\newpage
\section*{Figure Captions}
\begin{description}
\item[Fig. 1] Plot of $\frac{1}{c_0}$ versus $a$ with $b_0=10^{-4}$. The hatched
portion shows the instability region which extends between $a=\frac{1}{3}$
and $a=\frac{1}{\sqrt{2}}$ approximately.
\item[Fig. 2] Plots of $\eta_1$ and $\nu_1$ versus $a$ ($b_0=10^{-4}$).
Note that $\eta_1$ is negative (but finite) in the interval
$0.4713\le a\le 0.5210$. Similarly, $\nu_1$ is negative (but finite)
in the interval $0.4538\le a\le0.5097$.
\item[Fig. 3] Plots of $|\Psi|^2$ and $P$ versus $a$ in the region of
supercritical bifurcation.
\item[Fig. 4] Plots of $|\Psi|^2$ and $P$ versus $a$ in a subregion of
subcritical bifurcation, i. e. the region where quintic TDGL equation
holds.
\item[Fig. 5] Plots of the (numerical) limit cycle solutions obtained from
the secular equations (dotted line), the reduced model (dashed line) and
the $Y^3$-truncated model (crossed line) for $a=0.5$ and $\epsilon=10^{-4}$.
\item[Fig. 6] Plots of the (numerical) limit cycle solutions obtained from
the secular equations (dotted line), the reduced model (dashed line) and
the $Y^5$-truncated model (crossed line) for $a=0.468$ and $\epsilon=10^{-4}$.
\item[Fig. 7] Plots of the (numerical) limit cycle solutions obtained from
the reduced model (dashed line) and the $Y^7$-truncated model (crossed line)
for $a=0.44$ and $\epsilon=10^{-4}$.
\item[Fig. 8] Plot of the (numerical) limit cycle solution obtained from the
reduced model for $a=0.63$ and $\epsilon=10^{-4}$.
\end{description}
\end{document}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 4,350
|
Stefanie Zofya Federkiewicz (Hollywood, 2 de novembro de 1942), mais conhecida como Stefanie Powers, é uma atriz estadunidense com ascendência polonesa. Ela se tornou mundialmente conhecida com o seriado Casal 20, no qual fazia par com Robert Wagner.
Filmografia
No cinema
Na televisão
Ligações externas
Atores dos Estados Unidos
Norte-americanos de ascendência polonesa
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 8,191
|
\section{Introduction}
The discovery of approximate symmetries in the hadron spectrum
played an important role in establishing the structure of hadrons
and of underlying strong interactions. The observation of many new
resonances in recent years raised a renewed interest in the
spectral degeneracies. Broadly speaking, the problem can be framed
as follows: If a set of hadrons reveals a clear-cut clustering
near certain values of mass, what symmetry is responsible for the
observed pattern of approximate mass degeneracy and what are the
physical reasons for this symmetry? Needless to say, the correct
answer to this question can help considerably in unveiling the
underlying universal physics to the first approximation, the next
step would be the understanding of the sign and magnitude of fine
splittings inside degenerate multiplets, but those phenomena are
usually more involved and strongly channel-dependent (e.g., the
masses of resonances can be moved seriously by the threshold
effects).
A remarkable recent example of such a clustering is provided by
the spectrum of unflavored mesons, see~\cite{mpla} for a review.
The effect is certainly seen for the well confirmed states from
the Particle Data Group (PDG)~\cite{pdg}. A clear-cut cluster
structure of the spectrum of light nonstrange mesons was
convincingly confirmed by the Crystal Barrel experiment on
$\bar{p}p$ annihilation in flight~\cite{bugg,epja} which ran at
the antiproton storage ring LEAR at CERN. In brief, all observed
unflavored mesons above the chiral symmetry breaking (CSB) scale
in QCD, approximately 1~GeV, cluster into fairly narrow mass
ranges with the "centers of gravity" situated near 1340, 1700,
2000, and 2260~MeV. The corresponding spectrum is populated mainly
by the radial and orbital excitations of some ground states whose
masses lie below the CSB scale. The close values of masses in
these "towers" of resonances imply that the states inside each
cluster are related by some $\mathcal{X}$-symmetry of unknown
nature~\cite{mpla}.
The purpose of this paper is to develope a possible candidate
for the $\mathcal{X}$-symmetry. We will argue that the full
symmetry governing the approximate mass degeneracies in the light
nonstrange mesons seems to be
$\mathcal{X}=SU(2)_f\times I\times O(4)$,
where $I$ means the degeneracy of isosinglets and
isotriplets emerging due to the Zweig rule and $O(4)$ is the
hydrogen like degeneracy of energy levels.
An immediate question which likely rises here is how the
suggested $O(4)$ symmetry is related to QCD, i.e. how it can be
understood from the first principles? We do not know a convincing
answer to this question. We remind, however, that numerous
phenomena and symmetries emerging in the solid state physics
originate from Quantum Electrodynamics, on the other hand they are
not seen on the level of QED Lagrangian and hardy ever can be
derived from the underlying fundamental theory. Even in such a
simple system as the classical hydrogen atom, the $SO(4)$
symmetry of energy levels appears, which hardly can be envisaged
starting from the QED Lagrangian because it is a {\it dynamical}
symmetry reflecting the internal structure of the system, it seems
to have nothing to do with the approximate symmetries of the QED
Lagrangian. Needless to say that QCD is much more complex theory
and in the hadron world we can encounter manifestations of similar
dynamical symmetries, thus it is not excluded that searching for the
complete explanation of observed spectral symmetries in hadrons
having at hand the QCD Lagrangian only,
one is staying on a false way.
To clarify the point let us consider a simple example. The spin
$J$ and mass $m$ are known to be two independent Casimir
invariants of the Poincar\'{e} group. Hence, if there is a functional
dependence between $J$ and $m$, some higher symmetry takes place.
Consider now a classical object of size $r$ rotating at constant
velocity, its angular momentum is $J\sim mr$. On the other hand,
$n$-dimensional object of constant density has mass $m\sim r^n$,
i.e. $r\sim m^{1/n}$. Thus,
\begin{equation}
\label{re}
J\sim m^{1+1/n}.
\end{equation}
Quantum theory tells us that properties of any quantum system
approach to its classical ones if the quantum numbers defining the
stationary states of this system are large enough~\cite{landau}.
For this reason the highly excited hadrons are inevitably
quasiclassical objects, i.e. the classical arguments can be
applied for them as the first approximation. The functional
dependence $m(J)$ is an inherent feature of the Regge theory,
experimentally the Regge trajectories are approximately linear on
$(J,m^2)$ plane, at least for highly excited hadrons.
Consequently, to the extent that the Regge trajectories are
linear, the excited hadrons can be viewed quasiclassically as
one-dimensional objects of constant density according to
Eq.~\eqref{re}. Thus, one arrives at a nice agreement of very
general arguments and the real-life phenomenology. What must be
emphasized here is that relation~\eqref{re} is dynamical, we need
not any particular Lagrangian to obtain it --- the role of
interactions is to create the rotating system, the ensuing
dynamical dependence~\eqref{re} is then independent of a concrete
kind of underlying interactions.
Similarly, the local strong interactions described by the QCD
Lagrangian create hadrons which are {\it extended objects}, hence,
one may expect that some dynamical symmetries come into play.
In summary, the standpoint of the present paper is that the
observed spectral degeneracies have somewhat dynamical origin,
hence, in order to advance in understanding the spectral
degeneracies one should think in terms of internal structure of
hadrons rather than analyze dynamics and general properties of
QCD. The spirit of our work has something in common with that of
Ref.~\cite{ia2} where the spectrum-generating algebra approach was
used to deduce the $SO(4)$ dynamical symmetry from the string-like
properties of mesons.
The paper is organized as follows. In Sect.~2 we provide some
general arguments justifying the approach we will use. Sect.~3 is
devoted to construction of $O(4)$ classification for mesons. In
Sect.~4 the proposed scheme is discussed and compared with some
other approaches. We conclude in Sect.~5.
\section{Preliminary remarks}
The isospin invariance $SU(2)_f$ does not need comments, it is the
generally known vector part of the spontaneously broken chiral
$SU(2)_L\times SU(2)_R$ symmetry of the QCD Lagrangian in the
limit of vanishing current quark masses. The symmetry $I$ appears
as a consequence of the suppression of transitions between quarks
of different flavors, the so-called Zweig (or OZI) rule. The Zweig
rule is well understood in the $1/N_c$ expansion since it becomes
exact at $N_c=\infty$, i.e., in the planar limit of
QCD~\cite{hoof,hoof2}. Usually, the large-$N_c$ limit works fairly well
in the phenomenology, there are sizeable violations of the
OZI-rule only for a relatively small number of states, typically
in the scalar sector, reflecting a specific nature of those states
which results in a considerable mixture of strange and nonstrange
components. It should be noted that the $I$-symmetry is of
dynamical origin as it is not present in the QCD Lagrangian. The
symmetry $O(4)$ appears to be also dynamical, this novel symmetry
will be the subject of our discussions in what follows.
At present there are different ideas (not yet proved rigorously)
on the excited light mesons which happened to by quite successful
in a global description of the spectroscopic data. In fact, the
assumption of $O(4)$-symmetry is likely the only self-consistent
way for unification of those ideas. First of all, various
arguments and observations indicate that the spin-orbital and
spin-spin correlations are strongly suppressed in the excited
unflavored hadrons~\cite{wil,wil2,wil3,wil4,wil5,sh,glozrev}.
This suggests that,
neglecting a possible fine splitting due to such correlations and
other non-leading effects, the pattern of mass degeneracies of
mesons built from the conventional spinor quarks is the same as
that of mesons made of scalar quarks. Since the light mesons are
ultrarelativistic systems the use of the potential models is
difficult to
justify, one should rather solve the Bethe-Salpeter equation for
two scalar particles interacting through massless bosons. The
corresponding solutions reveal the $SO(4)$-degeneracy, this result
goes back to Wick and Cutkosky~\cite{wick,wick2}. The group $SO(4)$ is
known to be the dynamical degeneracy group of the nonrelativistic
hydrogen (H) atom~\cite{fock,fock2}.
The H-like $SO(4)$ degeneracy implies the dependence of
discrete spectrum on a single "principal" quantum number $n$,
\begin{equation}
\label{1}
n=l+n_r+1,
\end{equation}
where $l$ is the angular momentum and $n_r$ labels the "radial"
excitations. On the other hand, it has been observed recently~\cite{mpla,sh}
that the dependence of the meson mass $M$ on $l$ and $n_r$ indeed
enters in the combination $l+n_r$, namely, to a rather high
accuracy, the whole spectrum of excited unflavored meson resonances
can be fitted by the linear relation~\cite{mpla,prc}
\begin{equation}
\label{2}
M^2=a(l+n_r)+b,
\end{equation}
with $a\approx1.1$~GeV$^2$ and $b\approx0.7$~GeV$^2$. It is
interesting to note that the linear dependence of $M^2$ on $l+n_r$
holds in certain quasiclassical strings~\cite{baker}
(see also~\cite{npb} for the discussions based on the QCD sum rules)
and, by construction, in some AdS/QCD models~\cite{katz,katz2},
while it cannot be obtained within
the existing potential models~\cite{bicudo}, namely the
semirelativistic potential models with linearly rising potential
yield typically $M^2\sim l+cn_r$ with $c\neq1$. Thus, although
we use the nonrelativistic basis, our framework will not be
completely equivalent to old potential models. Introducing the
quark spin in the additive way as in the usual quantum mechanics,
one obtains the physical mesons with the spin $J=l,\,l\pm1$, which
possess the masses dictated by Eq.~\eqref{2}. The outlined
dynamical mechanism seems to be responsible for the emergence of
an approximate degeneracy among resonances of different spin
value. The assumption of suppression of the spin-orbital and
spin-spin correlations inside excited mesons is crucial in this
kind of reasoning, otherwise the angular momentum of $\bar{q}q$
pair and the intrinsic quark spin cannot be separated in the
relativistic systems under consideration, hence, the formulas
like Eq.~\eqref{2} may not be written.
All these arguments are quite standard, nevertheless they do not
save us from a certain uneasiness caused by the fact that we are
trying to describe the ultrarelativistic systems by means of the
unobservable nonrelativistic terms. It would be desirable to
understand deeper why the nonrelativistic basis may be useful. For
instance, consider a strong decay $A\rightarrow B+C$, where $A$,
$B$, and $C$ are some mesons. Experimentally one is able to
determine the relative angular momentum $L$ of the hadron pair $B$
and $C$. Intuitively, it is easy to imagine the following picture:
Quark and antiquark inside the hadron $A$ have the relative
momentum $l$, then the strong gluon field inside $A$ creates from
the vacuum a quark-antiquark pair, the whole system rearranges
into two colorless hadrons $B$ and $C$ which, in turn, conserve
the relative angular momentum, $L=l$, if $l_B=l_C=0$, say if $B$
and $C$ are pions. In reality, however, we should confess honestly
that we do not know and cannot imagine the internal structure of
meson $A$. But it is natural to conjecture that the observable $L$
reflects somehow this structure. A relevant example is the
observation of excited light mesons with identical quantum numbers
and very close masses, which are related to two different values
of $L$. It is reasonable to assume that their internal structure
is different, an additional argument is that these two kinds of
almost degenerate mesons always have different full width
--- this is natural as long as two different quantum systems
generically have different lifetimes. Thus, introducing $l$ and
identifying $l=L$ (plus fixing the orientation of intrinsic quark
spin) we may expect that thereby we do an unambiguous mapping of
observable $L$ onto the internal structure of observed meson,
moreover, to a certain extent we may expect that this mapping is
universal for all mesons, this permits then to establish some
relations between mesons, such as relations between masses. It
should be added also that the angular momentum $l$ and the total
quark-antiquark spin $s$ can be well defined through the
observable P- and C-parities~\cite{sh} (see their
definitions~\eqref{defPC} below). Thus, classifications in terms
of unobservable $l$ can definitely make sense, in this regard it
should be reminded that the standard $SU(3)_f$ classifications of
hadrons are also based on unobservables, which are the quarks. The
existence of noticeable mass splittings inside $l$-multiplets
should not be regarded as some kind of drawback of the proposed
scheme since they could encode an important physics (say, the spin
interactions) like the mass splittings inside the
$SU(3)_f$-multiplets.
Another argument in favour of our approach is that even
essentially relativistic models for light hadron spectrum can
possess the property that the states in their spectrum are
classified as in nonrelativistic potential models. An example of
such models is given in~\cite{berd} where the mesons are described
by a hadron string with massless spinor quarks at its ends. In
addition, it is easy to see that in the case of breaking of
classical string, a part of its angular momentum is converted into
the relative angular momentum of "splinters" and if these
"splinters" are spinless (as it usually happens in real life) this
conversion is complete due to the momentum conservation, i.e. one
has $l=L$ just as expected. As long as string models for hadrons
are known to be well motivated by QCD, our discussions above are
also well motivated.
Our approach is very different from the so-called chiral symmetry
restoration (CSR) scenario, which is claimed to be completely
relativistic and QCD-based explanation of many observed spectral
degeneracies~\cite{glozrev}. First of all, the CSR explains
degeneracies among states of equal spin, e.g., the parity
doubling, while the observed degeneracy is much
broader~\cite{epja}. A detailed comparison of our scheme with the
CSR one is presented in Sect.~4, here we would give the following
general remark. The CSR scenario treats the observed degeneracies
as a completely quantum effect, i.e., it does not have a well
understood classical limit, this point has been already criticized
in~\cite{sh} from the point of view of linearity of Regge
trajectories. The hadrons are bound states of quarks, therefore
they are described by some theory of bound states and it is quite
difficult to imagine that such a theory does not have the
quasiclassical limit. The quantum effects are decisive in
phenomena like boundary effects (e.g., the Casimir effect) or
quantum tunneling, but in bound states, they commonly result in
fine splittings of energy levels which are the next-to-leading
effects. Our standpoint is that the theory of bound quarks does
have the classical limit, we try to guess the dynamical symmetry
in this limit and use it as a starting point for further analysis.
In what follows, we proceed to explanation of observed
degeneracies in light nonstrange mesons on the base of
nonrelativistic basis, finally it will turn out that the scheme
can be reformulated in terms of observable hadron spin. The
detailed phenomenological analysis based on Eq.~\eqref{2} was
carried out in~\cite{mpla,prc} and we will not repeat it here, of
our concern will be the group-theoretical aspects and their
physical sense.
\section{Construction of $O(4)$ classification}
The light nonstrange mesons are characterized by the quantum
numbers $I^G(J^{PC})$, with the P, C, G parities defined as
\begin{equation}
\label{defPC}
P=(-1)^{l+1},\quad C=(-1)^{l+s},\quad G=(-1)^{l+s+I},
\end{equation}
where $s$ is the total quark-antiquark spin. The G-parity is not
of interest for us since it is just a combination of the
C-parity and isospin. Changing the angular momentum $l$ by one
unit we change immediately the P and C parities. Define the pure
and mixed $P$ and $C$ transformations as
\begin{eqnarray}
\label{4}
P:& |\Delta l|=1,& l+s=const,\\
\label{5}
C:& |\Delta s|=1,& |\Delta l|=0,\\
\label{6}
PC:& |\Delta l|=1,& |\Delta s|=0.
\end{eqnarray}
The change of $l$ can be compensated by that of $n_r$ such that
the sum $l+n_r$ remains constant, the meson mass then is not
affected due to Eq.~\eqref{2}. The $C$-transformation preserves
the meson mass by virtue of the assumed quark spin orientation
independence of the hadron masses. Thus, there is a possibility to
relate, in some sense, the $P$ and $C$ invariances of the QCD
Lagrangian to the same invariances of the resonance spectrum.
Supplementing the $P$ and $C$ transformations defined in
Eqs.~\eqref{4}-\eqref{6} by the $I$-transformation discussed above
(the mass-conserving transitions from isosinglet channels to the isotriplet
ones and {\it vice versa}) we obtain the complete set of
transformations relating different states within a degenerate
cluster. For instance, consider the first cluster of unflavored
mesons. It is populated by the well-established states from the
PDG~\cite{pdg}, the fine splitting does not exceed 10\% of meson
mass except for the $h_1(1170)$-meson, the fine splitting is known
to reduce progressively in the higher clusters~\cite{epja}. We can
"walk" along the whole tower of states, e.g., in the following way,
\begin{multline}
a_2(1320)\xrightarrow{I}f_2(1270)\xrightarrow{CI}b_1(1235)\xrightarrow{I}h_1(1170)\xrightarrow{C}
f_1(1285)\xrightarrow{I}a_1(1260)\xrightarrow{PC}\\
\rho(1450)\xrightarrow{I}\omega(1420)\xrightarrow{CI}
\pi(1300)\xrightarrow{P}a_0(1450)\xrightarrow{I}f_0(1370)\xrightarrow{P}\eta(1295).
\label{7}
\end{multline}
Similarly, one is able to go over the resonances in the higher
towers, those clusters contain more mesons including some missing
states.
The multiplets predicted by Eq.~\eqref{2} are drawn in
Fig.~\ref{f1}. The states lying on the
diagonal line have $n_r=0$, they form the leading Regge trajectory,
with the spin being $J=l$ or $J=l+1$ in the real situations. It
should be emphasized that these resonances do not possess P-parity
doublets --- the states of equal spin and close mass but with the
opposite P-parity --- as the $P$-transformation~\eqref{4} for
such mesons cannot conserve the spin and mass simultaneously.
\begin{figure}
\vspace{-7cm}
\hspace{-4cm}
\includegraphics[scale=0.9]{scheme.ps}
\vspace{-16cm}
\caption{\label{f1} A graphical representation of Eq.~\eqref{2} with physical
values of parameters in GeV$^2$. The principal quantum number $n$ is defined in Eq.~\eqref{1}.
The dots denote the corresponding states (only several low-lying levels are shown).
The numbers in brackets display the predicted mean mass in MeV.}
\end{figure}
\begin{figure}
\vspace{-8cm}
\hspace{-5.4cm}
\includegraphics[scale=1]{hydr2.ps}
\vspace{-17cm}
\caption{\label{f2} A hydrogen like classification for the states with $J=l$
and for their P-parity doublets. The dashed line
denotes symbolically the CSB scale, the given classification is not
expected to be reliable below this scale.}
\end{figure}
\begin{figure}
\vspace{-6cm}
\hspace{-5.4cm}
\includegraphics[scale=1]{hydr1.ps}
\vspace{-18cm}
\caption{\label{f3} The same as in Fig.~\ref{f2}, but for the states having $J=l+1$
and for their PC-parity doublets.}
\end{figure}
Besides spin, a complete extension of Fig.~\ref{f1} to the real
mesons must include the isospin and doubling of both P and C
parities. The isospin can be incorporated by a reflection with
respect to the axis $M^2$, the values of mass remain intact due to
the $I$-invariance. There are two possible ways of $P$-parity
doubling, they correspond to $P$ and $PC$ transformations.
The former case is depicted in Fig.~\ref{f2}, the states on the
leading Regge trajectories have $s=0$, hence, $J=l$. The latter
possibility is displayed in Fig.~\ref{f3}, the resonances
belonging to the leading trajectories have then $s=1$, $J=l+1$. As
remarked above, the resonances on the leading trajectories are
P-parity singlets, all other states are P-parity doubled. The last
step is to superimpose Fig.~\ref{f3} on Fig.~\ref{f2} identifying
the $M^2$ axes and dashed lines and turn one of figures through
angle 90$^{\circ}$, in this way we incorporate also the C-parity.
The horizontal lines of degenerate states in Fig.~\ref{f2} and
Fig.~\ref{f3} will form then planes, the clusters of degenerate
states live on these equidistant and parallel planes. For example,
the states in cluster~\eqref{7} populate the lowest such plane. The
resulting three-dimensional picture of meson degeneracies is easy
to imagine, although the corresponding figure
appears to be beyond author's artistic abilities.
The states below 1.9~MeV in Fig.~\ref{f2} and Fig.~\ref{f3} are
taken from the PDG~\cite{pdg}, the nonstrange nature of those
resonances is usually indicated by their decay channels. Above
1.9~MeV the states are mainly from a review~\cite{bugg}, the PDG
lists them in section "Other States". A complementary test for the
non-strangeness of included states is that they belong to the
relevant families of Regge trajectories~\cite{bugg,ani,ani2,ani3}. The
numbers in brackets serve for orientation only as long as often
they refer to the traditional names of particles given by the PDG
rather than to the actual mass. For instance, the mass of
$\rho_5(2350)$ is $2330\pm35$~MeV according to the PDG~\cite{pdg}, in
the $\bar{p}p$ annihilation it is seen with the mass
$2300\pm45$~MeV~\cite{bugg}, the mass of $\omega_5(2250)$ was
estimated in the $\bar{p}p$ annihilation as
$2250\pm70$~MeV~\cite{bugg}, thus, it is not excluded that
$\rho_5(2350)$ and $\omega_5(2250)$ are exactly degenerate despite
so different numbers in brackets, which would mean the exact
$I$-symmetry for them. Another example is the $\pi_2(2100)$-meson
of the PDG, its mass looks considerably bigger than the averaged
value 2000~MeV in the corresponding cluster, however, such an
observation may turn out to be misleading since, say, in the $\bar{p}p$
annihilation this resonance was seen in the region
$2005\pm15$~MeV~\cite{bugg}. The same can be said about the
$\eta_2(1870)$-meson, which was observed in the $\bar{p}p$ annihilation
at $2030\pm16$~MeV~\cite{bugg}.
In all other cases any judgements about the fine splittings within the
clusters should be also made with caution.
Notably, within the presented classification of light nonstrange
mesons there is no place for the states $f_0(600)$, $f_0(980)$,
and $a_0(980)$, the nature of which is highly controversial.
\section{Discussions}
It is interesting to notice that although we have used
the nonrelativistic arguments in building our classification, the
final scheme turns out to be relativistic as long as formally the
spectrum depends on the spin $J$ and the number $n$ enumerating the
daughter trajectories, in principle, now one can detach from the
nonrelativistic interpretations at all, regarding Fig.~\ref{f2}
and Fig.~\ref{f3} as classifications for the states generated by
the leading Regge trajectories of unnatural, $P=(-1)^{J+1}$, and
natural, $P=(-1)^J$, P-parity, respectively.
In addition, the proposed
classification coincides with the classification of energy levels
in the relativistic H-atom, see~\cite{ijmpa} for
references. The latter scheme was used for description of the
light nonstrange baryons in 1960s (see, e.g.,~\cite{barut,barut2}; numerous
references are collected in a review~\cite{ijmpa}). In essence,
the H-like description of the light nonstrange mesons contains
only one substantial complication in comparison with the baryons
--- the resulting picture of mass degeneracies is
three-dimensional due to the existence of C-parity. The
relativistic $O(4)$ description of the H-atom emerged in
1960s from a remarkable group-theoretical discovery: The full
relativistic theory of the H-atom (without account for
electron spin) can be formulated as a dynamical group theory based on
$O(4,2)$, the conformal group. The unitary irreducible
representations of $O(4,2)$ are labelled then by $|nJm_{\pm}\rangle$,
where $m$ is the usual magnetic quantum number, $n$ is the
relativistic principal quantum number, and $\pm$ refers to the
P-parity, which is determined from the parity of the ground state.
While the
$O(4)$ symmetry relates only states within a degenerate energy
level, the $O(4,2)$ symmetry relates also different energy levels,
in our case the latter relation is given by Eq.~\eqref{2}.
One of reduction of $O(4,2)$ to $O(4)$ corresponds to the
relativistic H-atom, where all states for a given $n$ are
P-parity doublets, except the state $J=n-1$ which is a singlet.
The P-parity doubling distinguishes the relativistic $O(4)$ H-like
assignment of energy levels from the nonrelativistic $SO(4)$ one,
the group $O(4)$ is just the extension of $SO(4)$ by P-parity.
The absence of P-parity partners for the states lying on the
principal Regge trajectories is a remarkable feature of the H-based
scheme since such partners have never been observed in the mesons.
As was mentioned in Sect.~2, the most known recent explanation of
spectral degeneracies among the highly excited states is based on
the effective axial and chiral symmetry restoration at high
energies, the relevant ideas are summarized in a
review~\cite{glozrev} (see also~\cite{ijmpa,sh2}). In this regard,
it would be instructive to compare in detail our scheme with the
CSR one. Resorting to some semiclassical arguments, the latter
idea suggests that the highly excited hadrons fall into the
multiplets of approximate chiral $SU(2)_L\times SU(2)_R$ symmetry
of QCD extended by P-parity, the resulting parity-chiral group is
isomorphic to $O(4)$, we will call it $O(4)_{pc}$ in what follows.
First of all, the possible physical origins of the H-like $O(4)_H$
symmetry and that of $O(4)_{pc}$ are completely different, the
former invariance is a dynamical symmetry reflecting the internal
space structure of mesons and the centrosymmetric character of
interactions between the constituents, while the latter one is a
classical symmetry of the QCD Lagrangian. The $O(4)_H$ symmetry
can relate states with different spin, while the $O(4)_{pc}$
symmetry relates states of equal spin only.
Consider as an example the $\rho_J$-mesons.
The degenerate states of equal spin value can be obtained with the
help of certain combinations of the $P$, $C$, and $I$
transformations in the way depicted in Fig.~\ref{f4}. The presented
diagram provides also all other spin-preserving transformations,
they can be trivially performed through the "center" $\rho_J$ taking
into account that double transformation of any kind is unity.
For instance, the line
$a_J\xrightarrow{PC}\rho_J\xrightarrow{P}b_J$
gives the C-parity doubling for $a_J$ and $b_J$.
\begin{figure}
\vspace{-4cm}
\hspace{3cm}
\includegraphics[scale=0.8]{diagramma.ps}
\vspace{-15.5cm}
\caption{\label{f4} A diagram for the spin-preserving transformations
with the center $\rho_J$. The symbols $J_o$ and $J_e$ mean that
the given transformation can be performed for the odd or, respectively,
even values of spin $J$ only.}
\end{figure}
The same chain of degeneracies as in Fig.~\ref{f4} follows from
a classification of mesons according to multiplets of $O(4)_{pc}$
and of axial $U(1)_A$~\cite{glozrev}.
However, there exists a crucial difference between the two
classifications: The CSR scenario predicts P-parity doublets for
all highly excited states, while the H-like scenario predicts that
the states lying on the principal Regge trajectories are P-parity
singlets, all other mesons are P-parity doubled. As mentioned above,
experimentally
P-parity doublers for the states belonging to the principal
meson Regge trajectories have not been observed, the Crystal
Barrel experiment confirmed this phenomenological
fact~\cite{mpla,epja,prc}. The absence of such P-parity partners
is a strong advantage of the H-based scheme over the CSR scenario:
Usually the states on the daughter trajectories are less reliable than
the resonances on the principal trajectories, hence, the CSR scheme fails
completely in the most reliable part of the meson spectrum.
Thus, our analysis shows that the hypothetic effective
restoration of chiral and axial symmetries of the classical
QCD Lagrangian in the upper part of the hadron spectrum does not
necessary constitute a piece of the broader degeneracy
$\mathcal{X}$ existing in that part of the spectrum (in contrast
to the point of view taken in~\cite{glozrev}). If the symmetry
$\mathcal{X}$ is of the type advocated in the present paper, the predictions
of the CSR scheme are included into $\mathcal{X}$ partly only. It is
quite important to emphasize that the "not overlapped" with $\mathcal{X}$
part of the CSR predictions lies completely in the unobserved part of the
meson spectrum.
It is interesting to mention that a pattern of P-parity
singlets similar to that of $O(4)_H$ assignment emerged
naturally in the geometrical string like and bag
like models proposed in~\cite{iachello}.
Let us try to figure out qualitatively a possible
physical origin of the $O(4)_H$ symmetry in the meson spectrum. On
the intuitive level, it is clear that both in the H-atom and in
the mesons one deals with quantum two-body systems interacting via
centrosymmetrical forces, the appearance of an universal
dynamical symmetry is then quite conceivable. In QCD, the CSB
disturbs drastically the low-energy part of the spectrum, for this
reason a manifestation of this universal dynamical symmetry should
be naturally expected above the CSB scale. The observation of the
same symmetry among the excited light baryons may indicate on
their quar-diquark structure, in fact, historically the $O(4)_H$
symmetry was first proposed for baryons on the base of analyses of
a rather rich baryon spectrum, which was available already at
1960s, see~\cite{ijmpa,barut,barut2} for references. On the other hand,
it is not excluded that the $O(4)_H$ symmetry might be given an
interpretation as a "survived" part of a broken fundamental classical
symmetry. Indeed, in the very high energy limit, the QED and QCD
Lagrangians possess the conformal invariance $O(4,2)$
(more generally, the high-energy density of states of any $d$-dimensional
renormalizable field theory is that of $O(d,2)$ conformal theory), which is
incompatible with the existence of bound states as long as the
spectrum of conformal theories is massless or continuum. From the
group-theoretical point of view, the $O(4,2)$ is also incompatible
with the existence of a finite number of degenerate states at some
energy since the unitary irreducible representations (UIR) of
$O(4,2)$ are infinite-dimensional. However, the group $O(4,2)$
contains subgroups with finite-dimensional UIR, which already are
able to accommodate the discrete spectrum and certain degeneracies
in their multiplets. The maximal such subgroup is exactly $O(4)$.
This intriguing relation of $O(4)$ and $O(4,2)$ might give a chance
to relate the observed spectral degeneracy to the fundamental theory.
\section{Conclusions}
We have proposed a classification scheme for light nonstrange
mesons which explains completely the observed approximate mass
degeneracies, only a few of states are missing and we hope they
are to be discovered in future experiments. By and large, the
accuracy of the mass degeneracies in the proposed multiplets is
similar to that of the unitary $SU(3)_f$ symmetry.
The classification looks most naturally in terms of unobservable
angular momentum of quark-antiquark pair, but it can be
reformulated also in terms of observable hadron spin.
The main message of the present work is that the observed spectrum
of light nonstrange mesons is similar to nothing but the discrete
spectrum of the classical hydrogen atom. Such ideas appeared about
forty years ago in the baryon spectroscopy, so the present
analysis may be regarded as a revival of those forgotten ideas in
application to mesons.
If this result is correct, a natural question arises as to why
the nonrelativistic symmetries can work in the excited light
hadrons, which represent ultrarelativistic systems? This question
reminds the old question why the nonrelativistic model of constituent
quarks works in the domain where naively it should not work? The
understanding of the latter problem took a long way, now we know that
clue lies somewhere in the fact that at low energies the effective
physical degrees of freedom are not those of the QCD Lagrangian, but
the exact implementation of this mechanism is still a riddle. It may
be that with the nonrelativistic symmetries in the highly excited light
hadrons we are also staying at the beginning of a long way...
In conclusion, we have tried to demonstrate that a mere observation
of hadron clusters may open the door to a new line of research,
where far-reaching results could be obtained. At present,
there exists only one experiment which systematically looked for
the excited unflavored mesons in a broad energy range, the Crystal
Barrel one~\cite{bugg}, and its results we have actively used in
this work. It would be really nice if experimentalists taught
us more about the particle content of the hadron clusters,
elevating thereby the clustering from the present somewhat speculative
level to a rather unexpected new direction in the particle physics.
A tentative program of relevant physical experiments is proposed
in~\cite{bugg2}.
\section*{Acknowledgments}
The work was supported by the Ministry of Education of
Russian Federation, grant RNP.2.1.1.1112, by the Government
of Sankt-Petersburg, grant 29-04/23, and by the Alexander von
Humboldt Foundation.
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 9,195
|
Q: Github Pull Request Builder fails due to java.io.FileNotFoundException I'm scratching my head over this one. One of my PR builders triggered when there's new pull requests but it kept failing with ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier. I have "write and push" to this repository like my 2 other pull request builders which work fine on 2 other repositories. Has anyone run into same problem? Thanks,
plugin versions:
git v2.3.4, GitHub API v1.59, GitHub v1.10, Github Pull Request Builder v1.16-8
error log:
...
Setting commit status on GitHub for https://github.com/Company/repos-one/commit/fab14d3b033743c186b66abcda8ba0a00f70f73c
01:06:44 Setting commit status on GitHub for https://github.com/Company/repos-one/commit/fab14d3b033743c186b66abcda8ba0a00f70f73c
01:06:44 ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception
01:06:44 java.io.FileNotFoundException: api.github.com/repos/Company/repos-one/statuses/fab14d3b033743c186b66abcda8ba0a00f70f73c
01:06:44 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
01:06:44 at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
01:06:44 at org.kohsuke.github.Requester.parse(Requester.java:383)
01:06:44 at org.kohsuke.github.Requester._to(Requester.java:185)
01:06:44 at org.kohsuke.github.Requester.to(Requester.java:160)
01:06:44 at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:702)
01:06:44 at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:714)
01:06:44 at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:127)
01:06:44 at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:84)
01:06:44 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
01:06:44 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:780)
01:06:44 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:744)
01:06:44 at hudson.model.Build$BuildExecution.post2(Build.java:183)
01:06:44 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:693)
01:06:44 at hudson.model.Run.execute(Run.java:1770)
01:06:44 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
01:06:44 at hudson.model.ResourceController.execute(ResourceController.java:89)
01:06:44 at hudson.model.Executor.run(Executor.java:240)
01:06:44 Disconnecting from VPN service.
01:06:44 sudo: no tty present and no askpass program specified
01:06:44 Setting status of 56b8b7a5d0595d321c46cd3450c6a68873a97480 to FAILURE with url company.ci.cloudbees.com/job/HL-Pull-Request-Builder/7/ and message: Merged build finished.
01:06:44 Finished: FAILURE
A: problem caused by having authorized tokens of users who don't have push to the repository. Remove those tokens solved it
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 5,137
|
{"url":"https:\/\/byjus.com\/question-answer\/chalk-contains-calcium-carbon-oxygen-in-proportion-10-3-12-find-the-percentage-of-each\/","text":"Question\n\n# Chalk contains calcium, carbon, oxygen in proportion 10:3:12 .Find the percentage of each in a chalk if the mass of chalk stick is 5gms.\n\nSolution\n\n## The proportion of calcium, carbon and oxygen in chalk is given by 10:3:12 ie 10 parts of calcium, 3 parts of carbon and 12 parts of oxygen exist out of a total no of parts given by 10 + 3 + 12 = 25 parts. ie Fraction of calcium in chalk = 10 \/ 25 Fraction of carbon in chalk = 3 \/ 25 Fraction of oxygen in chalk = 12 \/ 25 Hence, percentage of\u00a0\u00a0calcium in chalk = (10 \/ 25) * 100 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= 40 % Percentage of\u00a0\u00a0carbon in chalk = (3 \/ 25) * 100 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= 12 % Percentage of\u00a0\u00a0oxygen in chalk = (12 \/ 25) * 100 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0= 48 % NOTE: The mass of the chalk is not required in calculating the percentage of each component. However, we can use this information to find the mass of each component in the chalk stick that has a mass of 5 gms. ie Mass of calcium in 5g chalk = 40 % * 5 = (40\/100) * 5 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0=2 g Mass of carbon in 5g chalk = 12 % * 5 = (12\/100) * 5 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0=0.6 g Mass of oxygen in 5g chalk = 48 % * 5 = (48\/100) * 5 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0=2.4 g \u200b\u200b\u200b\u200b\u200b\u200b\u200bMathematics\n\nSuggest Corrections\n\n0\n\nSimilar questions\nView More\n\nPeople also searched for\nView More","date":"2022-01-27 00:33:11","metadata":"{\"extraction_info\": {\"found_math\": false, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.9056898951530457, \"perplexity\": 2619.613400562788}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2022-05\/segments\/1642320305006.68\/warc\/CC-MAIN-20220126222652-20220127012652-00207.warc.gz\"}"}
| null | null |
Emiliano Redondo Ares (Peñarroya-Pueblonuevo, Córdoba, 15 de agosto de 1937 - Madrid, 15 de noviembre de 2014) fue un actor español.
Biografía
Tras finalizar sus estudios de Bachillerato, se traslada a Madrid donde comienza la carrera de Derecho. Su paso por la Universidad le permite tener sus primeros contactos con el mundo de la interpretación a través del Teatro Español Universitario. Se matricula igualmente en la Escuela Oficial de Cinematografía (en la que llegaría a impartir clase entre 1968 y 1971) para debutar, finalmente, en cine y televisión en el año 1959.
En las siguientes cuatro décadas desarrolla su trayectoria artística alternando los tres medios: radio, cine y televisión, casi siempre en papeles de reparto.
Teatro
Sobre los escenarios ha desfilado por varias compañías, como la de Aurora Bautista para finalmente formar la suya propia. Ha participado en decenas de montajes, que incluyen:
Cuento en los bosques de Viena
La loca de Chaillot
Los Pelópidas (1966)
Enséñame tu piscina (1977)
La dama de Alejandría (1980)
Los sobrinos del Capitán Grant (1981) (Zarzuela).
La señora presidenta (1982), con Manolo Gómez Bur.
Cuentos de los bosques de Viena (1984), de Ödön von Horváth.
Los caciques (1987)
La loca de Chaillot (1989)
Esto es amor y lo demás... (1993), con María Garralón.
Anfitrión (1996)
Trampa mortal (1999), de Ira Levin, con Francisco Valladares, María Kosty y Marisol Ayuso.
El atolondrado (2001), de Molière.
La duda (2006)
Televisión
Para la pequeña pantalla ha intervenido durante más de cuarenta años en numerosos espacios y series de prestigio en la historia de la televisión en España, y entre los que figuran Estudio 1, Cuentos y Leyendas (1975), Las aventuras del Hada Rebeca (1976), Novela, El Hotel de las mil y una estrellas (1978-1979), con Luis Aguilé o Segunda enseñanza (1986), con Ana Diosdado. Entre 1961 y 1964 participó en el programa musical Escala en Hi-Fi.
Cine
Especializado en papeles cómicos, su registro sin embargo, ha abarcado igualmente otros géneros incluidos los Spaghetti Western. Ha trabajado a las órdenes de directores como Carlos Saura, Luis Lucia, José Luis Sáenz de Heredia, Antonio Giménez Rico, José María Forqué, Mariano Ozores y Pedro Almodóvar. En su filmografía figuran entre otros, los siguientes títulos:
Tiempo de amor (1965)
Megatón Ye-Ye (1965)
Zampo y yo (1966)
Las 4 bodas de Marisol (1967)
Peppermint frappé (1967)
La madriguera (1969)
Marco Antonio y Cleopatra (1972)
Los muertos, la carne y el diablo (1974)
Viaje al centro de la Tierra (1976)
Último deseo (1976)
La noche de los cien pájaros (1976)
Los liantes (1981)
Cristóbal Colón, de oficio... descubridor (1982)
De camisa vieja a chaqueta nueva (Rafael Gil, 1982)
Los caraduros (1983)
El currante (1983)
¡Qué tía la C.I.A.! (1985)
¡Átame! (1990)
Disparate Nacional (1990)
La ley de la frontera (1995)
Referencias
Actores de la provincia de Córdoba (España)
Actores de teatro de España
Actores de cine de España
Actores de televisión de España
Alumnado de la Escuela Oficial de Cine de España
Nacidos en Peñarroya-Pueblonuevo
Fallecidos en Madrid
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 8,891
|
\section{Introduction}
The recently published neutrino oscillation analysis of the
Soudan-2 atmospheric-neutrino data~\cite{msanchez} used only
Fully Contained (FC) events and Partially Contained (PC) events
in which the neutrino interaction vertex was contained within the
Soudan 2 tracking calorimeter. Not utilized by that study were
two additional, topologically very similar, categories
for which further analysis was needed to separate the samples and to
eliminate their non-neutrino background. Using nomenclature introduced
by the MACRO experiment~\cite{MACRO-USID}, the two categories are
labelled as {\it UpStop} events and {\it InDown} events.
{\it UpStop} events are upward-going stopping muons which arise from
charged-current $\nu_\mu$~and \anumu~interactions occurring in the rock
surrounding the Soudan 2 cavern; only the final state muon is detected
as a stopping, non-interacting track in the detector. The muon may be
accompanied by a small number of hits from a decay electron near its
stopping point.
{\it InDown} events are $\nu_\mu$~and \anumu~interactions in the detector
yielding downward going, exiting muons with three or fewer hits
arising from hadronic track(s) at the production vertex.
Approximately 65\% of these InDown events
are quasi-elastic interactions
with low energy protons. Interactions having more than three
hadronic hits at their primary vertex were
included in the PC sample analyzed previously \cite{msanchez}.
Separation of these two neutrino event samples is made possible
by the fine-grain imaging of the
Soudan-2 honeycomb-lattice tracking calorimeter. Their angular distributions
exhibit features which are indicative of atmospheric
$\numu \rightarrow \nutau$ oscillations. The samples can be
incorporated in a straightforward way into the likelihood
analysis described in Ref. \cite{msanchez}. Their inclusion
has enabled an improved determination of the
$\numu \rightarrow \nutau $ oscillation parameters from this experiment
and a more stringent rejection of the no oscillation hypothesis.
Analyses of upward through-going muons
\cite{MACRO-USID, Kam-UT, IMB-USUT, SK-UT}, and
stopping muons \cite{MACRO-USID, IMB-USUT, Frejus-USID, SK-USUT}
have been previously reported. Whereas through-going muon
samples originate from a broad high-energy neutrino spectrum
having a mean \mbox{$E_\nu$}~ of approximately 100 GeV, UpStop events originate
predominantly from interactions with $1 \le \mbox{$E_\nu$} \le 20$~GeV.
Consequently they provide different constraints for oscillation
scenarios. Among the underground tracking calorimeter experiments,
MACRO has provided the most detailed treatment to date of
UpStop and InDown events. In that experiment it was not possible
to separate the two categories, so they were analyzed as a combined
sample. Clearly, it is advantageous to separate the samples,
since comparison of their zenith angle distributions can provide
additional discrimination between low ($\approx 10^{-3}$ eV$^2$)
versus high ($\ge 10^{-2}$ eV$^2$) values of \delmns.
\section{Detector and data exposure}
Soudan 2 was a 963 metric ton (770 tons fiducial) iron tracking calorimeter
with a honeycomb geometry which operated as a time-projection chamber.
The detector was located at a depth of 2070 meters--water--equivalent on the
27th level of the Soudan Underground Mine State Park in northern Minnesota.
The calorimeter started data taking in April 1989 and ceased operation in
June 2001 by which time a total exposure (fiducial exposure)
of 7.36 kton-years (5.90 kton-years) had been obtained.
The calorimeter's tracking elements were 1 m long, 1.5 cm diameter hytrel
plastic drift tubes filled with an argon-CO$_2$ gas mixture. The tubes
were encased in a honeycomb matrix of 1.6~mm thick corrugated steel plates.
Electrons deposited in the gas by the passage of charged particles drifted
to the tube ends under the influence of an electric field. At the tube ends
the electrons were amplified by vertical anode wires which read out a column
of tubes. A horizontal cathode strip read out the induced charge and the
third coordinate was provided by the drift time. The ionization deposited
was measured by the anode pulse height. The calorimeter produced
three-dimensional track hits with a spatial resolution of approximately
1 cm$^3$ and separated by an average of about 3 mm of steel.
The corrugated plates, interleaved with drift tubes, were
stacked to form 1$\times$1$\times$2.5 m$^3$, 4.3-ton modules
from which the calorimeter was assembled
in building-block fashion~\cite{S2:NIM_A376_A381}.
Surrounding the tracking calorimeter on all sides, but mounted on the cavern
surfaces and well separated from the outer surfaces of the calorimeter, was
a 1700 m$^2$ Veto Shield array of two or three layers of proportional
tubes~\cite{S2:NIM_A276}. The shield recorded the presence of cosmic
ray muons coincident in time with events in the main calorimeter
and thus identified background
events, either produced directly by the muons or initiated by secondary
particles coming from muon interactions in the rock walls of the cavern.
Additionally, for neutrino-induced muons which enter or exit the tracking
calorimeter, the shield array recorded the muon in time-coincidence with
the event in the central detector.
\section{Separation of UpStop and InDown Events}
\label{sec:attrib}
The event imaging afforded by the Soudan 2 tracking calorimeter
made it possible to distinguish the topologically similar UpStop
and InDown events. Events of both types were isolated during routine
processing.
Events were classified as UpStop candidates
if they satisfied the following criteria:
\begin{enumerate}
\item [(1)] The track was muon-like, devoid of kinks or
scatter vertices.
\item [(2)] The track length was greater than 100 cm.
\item [(3)] The muon endpoint occured in a live detector region. An event
was removed if the candidate endpoint occured in the inactive
region between modules.
\item [(4)] Track ionization and straggling were consistent with the
hypothesis of an upward-going muon which ranges to stopping.
That is, near the edge of the detector the track was straight and
lightly ionizing while, near the interior end, the track exhibited
multiple scattering and/or heavy ionization.
\item [(5)] Associated hits at the track endpoint, if any,
had to be consistent with an electron shower
from muon decay.
\end{enumerate}
An anode-versus-cathode view of an UpStop data event
is shown in Fig.~\ref{fig:fig1} where multiple scattering
can be discerned as the muon ranges to stopping.
Endpoint decay hits, the three hits modestly displaced
from the muon endpoint in Fig.~\ref{fig:fig1}, are observed in some events
(with higher probability for $\mu^+$ than for $\mu^-$
since the former do not undergo nuclear absorption within iron nuclei).
\begin{figure}[htb]
\centerline{\epsfig{figure=fig01.eps,width=10.0cm}}
\caption{An UpStop data event recorded in the anode-cathode matched view
(front view of the calorimeter). Typically, multiple scattering becomes
pronounced as the muon approaches its range endpoint.
The endpoint decay shower of three hits favors identification
as a \mup rather than a \mum.}
\label{fig:fig1}
\end{figure}
InDown events were required to satisfy criteria 1-3 above and in addition:
\begin{enumerate}
\item [(4)] The muon track was straight and lightly ionizing at its interior end.
Near the edge of the detector the track might, but need not,
have exhibited ranging behavior in the form of
multiple scattering and/or heavy ionization.
\item [(5)] Associated hits near the interior
end of the track, if present, must have been consistent
with hits from a proton or $\pi^\pm$ track, lying
in a straight line and heavily ionizing.
\end{enumerate}
These topological features are exhibited by the InDown data event
shown in Fig. \ref{fig:fig2}. At the event vertex, the muon is
accompanied by a track of two hits for which the ionization is
relatively heavy. This pattern is typical of a recoil proton.
The event of Fig. \ref{fig:fig2} is a candidate quasi-elastic
$\numu n \rightarrow \mum p$.
\begin{figure}[!htb]
\centerline{\epsfig{file=fig02.eps,width=10.0cm}}
\caption{An InDown data event recorded in the cathode versus time view
(calorimeter side view). The muon emerges from
an event vertex which is well contained; its
trajectory, a straight line initially, undergoes small angle deflection
as the ranging muon approaches the detector floor. A proton recoil of two
hits is visible at the vertex.}
\label{fig:fig2}
\end{figure}
There were a few events which could not be resolved as UpStop or InDown,
the direction of the track being undetermined. Fortunately, ambiguous
cases were rare for tracks which have visible lengths exceeding one meter
in the detector. For the purpose of analysis, such events were retained
as an {\it Ambiguous} category.
\section{Event processing and simulation}
\label{section:sim}
Both UpStop and InDown data events were selected in the Partially Contained
event sample, and were processed as described in Ref. \cite{msanchez}.
The Monte Carlo sample of the contained-vertex InDown events was also part
of the routine data processing, in which Monte-Carlo events were inserted
into and processed together with the data stream, their identity only being
revealed in the final analysis stage. However, additional simulations, not
included in the main data processing, were needed for the neutrino
interactions in the rock surrounding
the cavern, which give rise to UpStop events \cite{PDK-803}.
\subsection{Simulation of upward-stopping muon events}
The GEANT Monte Carlo program together with modified
Soudan-2 software provided the UpStop simulation (UpStop-MC).
A total of 68.7 million neutrino interactions in greenstone rock
were simulated. The event vertices were distributed randomly through
rock volumes which were centered on the Soudan 2 cavern. Since
high-energy charged-current (CC) events can project muons
to the cavern from more remote rock than low-energy events,
the dimensions of the primary rock volumes were chosen to increase with
increasing $E_{\nu}$. Final-state particles were tracked
through the rock by GEANT and fourvectors of particles that reached
the veto-shield array were saved. These were then passed through the
Soudan-2 Monte Carlo to produce realistic detector hits superimposed
on detector noise represented by random-trigger records.
UpStop-MC events were then processed through the standard Soudan-2
triggering, reconstruction and selection software for PC events.
For UpStop-MC events yielding ionization within the tracking calorimeter
(71,000 events), the survival rates decreased monotonically with increasing
primary \mbox{$E_\nu$}, reflecting the diminishing probability for muons from
energetic events to stop in the detector. Survival rates ranged
from 12.8\% for events with \mbox{$E_\nu$}\ $\leq$ 10 GeV, to 2.5\% for events
with \mbox{$E_\nu$}\ $\geq$ 40 GeV.
\subsection{UpStop cuts and scanning}
\label{sec:cuts}
The PC selection filter required candidate tracks to penetrate to the
fiducial region while not being through-going. Additional requirements,
detailed in Ref. \cite{msanchez}, were imposed in order to reject the
high-flux background of downward-going cosmic-ray muons. A total of
7662 UpStop-MC events passed the filter and simulated trigger requirements.
However, only 34\% of these events yielded a potentially
interesting topology in the detector.
Consequently, additional cuts were applied to the true kinematic variables
to reject those events which were certain not to pass the subsequent
analysis cuts.
These cuts (existence of a final-state muon with cosine zenith angle,
cos $\theta_z < +0.05$, and energy $E_\mu$ upon arrival at the detector
within the range $350~{\rm MeV} < E_\mu < 3500$ MeV)
were designed to ensure that the event had an upward-going muon
that stopped within the calorimeter fiducial volume \cite{PDK-803}.
A 54\% sample of the surviving events was then scanned by physicists,
using scanning rules identical to those used for PC data event scanning.
The additional criteria given in Sec. \ref{sec:attrib} were also applied
to both data and MC events. All events which satisfied the scanning
criteria were then reconstructed manually using the experiment's standard
interactive graphics software. Only the reconstructed sample was used
in the subsequent analysis. It contained a factor of 25 more events
than the data sample.
\subsection{MC event rate normalization}
\label{sect:norm}
The atmospheric neutrino flux used to generate the UpStop events was the
one-dimensional calculation of the Bartol group \cite{bartol89},
modulated by the solar cycle as described in Ref. \cite{msanchez}.
Other fluxes were simulated by applying correctional weights to the
generated events. For consistency with Ref. \cite{msanchez}, the
numbers and plots in Sects. \ref{sec:bgr} and \ref{sec:dist} were
weighted to correspond to the updated 1D Bartol-96 flux \cite{bartol96}.
The oscillation analysis of Sect. \ref{sec:global} of this paper
used the latest three-dimensional fluxes
from the Bartol group \cite{Bartol04} and
Battistoni {\it et al.} \cite{Battistoni_3D}.
The neutrino cross sections were those encoded in NEUGEN3 \cite{neugen}.
The target nuclear composition was that of Soudan rock, described in
Ref.~\cite{demuth}. The effect of Pauli blocking in elastic and
quasi-elastic reactions was accounted for, however nuclear effects
on resonance production and on deep inelastic scattering final states
were neglected.
The event rate calculations have a sizable systematic error.
For the comparison of this data with the MC
presented in Sections \ref{sec:bgr} and \ref{sec:dist}, a normalization
factor of 0.85, determined from the measured
$\nu_e$ rate, assuming no oscillations, was applied.
In the oscillation analysis described in
Sec. \ref{sec:global} the overall normalization was a free ``nuisance''
parameter.
\section{Event rates and backgrounds}
\label{sec:bgr}
\subsection{Backgrounds in UpStop events}
Two sources of background events were considered:
\begin{enumerate}
\item [(1)] Cosmic-ray muons which scatter
in the rock and eventually enter
the detector in an upward direction.
\item [(2)] Charged hadronic tracks, especially pions, produced
at large angles in interactions
of cosmic-ray muons in the rock surrounding the detector.
\end{enumerate}
Unlike experiments which are situated under mountains, the flat
overburden at Soudan ensures that the flux of cosmic-ray muons
becomes less than the flux of neutrino-produced muons significantly
above horizontal angles \cite{demuth}. Thus the background from
the first source is negligible.
Hadronic interactions of neutrons produced in cosmic ray interactions
were shown in Ref. \cite{msanchez} to be a background
to contained neutrino events.
A similar, related, flux of charged hadrons also emerges from the
cavern walls and enters the detector.
There are two distinguishing features of entering hadronic tracks:
\begin{enumerate}
\item [(1)] {\it Veto-Shield signal:} In addition to
the Veto Shield hit corresponding to the passage of the hadron
track, there are likely to be extra hits due to other
particles produced in the muon interaction.
In general, the track in the detector will not be aligned with
these extra hits. It is thus useful to distinguish between the total
number of in-time Veto Shield hits ($n^{VS}_{all}$) and the
number of in-time hits geometrically associated with the
incoming/leaving track ($n^{VS}_{trk}$).
\item [(2)] {\it Range:} Hadronic tracks have a limited range in
the detector before stopping or interacting.
\end{enumerate}
\begin{figure}[htb]
\centerline{\epsfig{figure=fig03.eps,width=10.0cm}}
\caption{Distributions of Veto-Shield hit counts versus track range, (a)
for UpStop data candidates and (b) for UpStop Monte Carlo events,
prior to muon length cuts.}
\label{fig:fig3}
\end{figure}
\begin{figure}[htb]
\centerline{\epsfig{figure=fig04.eps,width=9.0cm}}
\caption{Distribution of track range for candidate UpStop data
events (crosses) compared to the neutrino Monte Carlo sample
(shaded histogram), for events with visible track length
exceeding one meter.
The distributions (normalized to the events with $>$ 500 g/cm$^2$)
are shown (a) before and
(b) after the requirement $n^{VS}_{all} = n^{VS}_{trk}$ has been
applied. Fig. \ref{fig:fig4}b shows good agreement between the
data and the neutrino MC.}
\label{fig:fig4}
\end{figure}
Fig. \ref{fig:fig3} shows $n^{VS}_{all}$ versus the range
of the stopping track for each event of the UpStop data
(Fig. \ref{fig:fig3}a) and of the MC (Fig. \ref{fig:fig3}b). A clear
excess of data events with large $n^{VS}_{all}$ and small
range is observed, corresponding to the expectation for
incoming hadronic tracks. However, at track lengths beyond
the hadronic range, the data is consistent with
the UpStop MC.
The background signature is emphasized in
Fig. \ref{fig:fig4}a which shows the projection onto the
range axis of the UpStop data (points with errors) and the MC
(shaded histogram). The MC is normalized to the data with
range $>$ 500 g/cm$^2$ ($>$ 3.8 pion interaction lengths).
Fig. \ref{fig:fig4}b shows the
same distributions but with the additional constraint that
$n^{VS}_{all} = n^{VS}_{trk}$, i.e. all Veto-Shield hits must be
geometrically associated with the incoming track. The MC is
then in good agreement with the data. However,
to ensure that the residual hadronic background is negligible,
a cut requiring the track range to be
greater than 260 g/cm$^2$, corresponding to two pion interaction
lengths, is also applied. Since the calorimeter is, to good approximation,
a uniform medium of 1.6 g/cm$^3$ density, the range requirement
corresponds to a minimum track length requirement of $\sim$160 cm.
The effective muon momentum threshold for UpStop and InDown events is
$p_\mu \geq 530$ MeV/$c$.
Finally, the cosine of the zenith angle, cos$\theta_z$, of the
reconstructed UpStop track is required to be smaller than +0.05.
\subsection{UpStop backgrounds using hadronic scatter events}
The PC data analysis also recorded events with an incoming
track making a hadronic scatter. A sample of 25 data events was
obtained which can be used to gauge the background from incoming
non-scattering hadrons. A representative event is the upward-going,
stopping, charged pion track shown in Fig. \ref{fig:hadevt}.
There are two coincident hits in the shield which are in close
proximity to the track's entrance point into the cavern, hence
$n^{VS}_{trk} = 2$. There is an additional coincident hit in
the shield floor, hence $n^{VS}_{all} = 3$. Inside the detector,
the track scatters and stops. The scatter, which gives rise
to a recoil proton, plus the track ionization, identifies the track
as a $\pi^{\pm}$ rather than a $\mu^{\pm}$ or a proton.
\begin{figure}[htb]
\centerline{\epsfig{figure=fig06.eps,width=10.0cm} }
\caption{A scattering upgoing pion track (data event) accompanied by three
time-coincident Veto Shield hits.}
\label{fig:hadevt}
\end{figure}
\begin{figure}[htb]
\centerline{\epsfig{figure=fig07.eps,width=10.0cm}}
\caption{Distributions of (a) cos$\theta_z$ and
(b) the number of coincident veto shield hits versus the
track range, for events which exhibit hadronic scatters.
In Fig. \ref{fig:had_3}(a), the shaded (open) histogram includes
events where all the in-time Veto-Shield hits
are (are not) associated with the detected track. }
\label{fig:had_3}
\end{figure}
Distributions of cos$\theta_z$ and of track range versus $n^{VS}_{all}$
for the incoming hadronic sample are shown in Fig. \ref{fig:had_3}.
Fig. \ref{fig:had_3}a shows that most of the events are downgoing.
Among the seven upward-going tracks, five have
$n^{VS}_{all} > n^{VS}_{trk}$ (open histogram); the remaining two events
with $n^{VS}_{all} = n^{VS}_{trk}$ (shaded histogram) are close to
horizontal, and have short range. No hadronic events pass the shield and
track length selections for upgoing tracks (ignoring their visible scatters).
On the basis of this observation, plus the agreement in track range
distributions between the UpStop data and the neutrino MC of
Fig. \ref{fig:fig4}, backgrounds from non-scattering charged pions
and protons are estimated to contribute less than two events to the UpStop
data and are hereafter neglected.
\subsection{Backgrounds in InDown events}
A potential background for InDown events arises from
downward, through-going cosmic ray muons
whose entrance into the detector was not detected due to a rare episode
of poor or non-existent ionization drifting within a calorimeter module.
Great care was taken to record all such incidents during data taking
and additional checks were made by studying individual
module efficiencies as a function of time. A special scan was carried
out which rejected events for which there was a possibility of
such an occurrence. Additional discrimination against this background was
provided by the active shield array, since through-going muons yielded pairs
of time-coincident hits having widely separated spatial locations.
Using the same minimum track range as was used for the UpStop sample
($\ge$ 260 g/cm$^{2}$), no InDown events had $n^{VS}_{all} > n^{VS}_{trk}$.
Other backgrounds for PC events were shown to be negligible in
Ref. \cite{msanchez}, thus the InDown sample was assumed to be
background-free in the analysis presented below.
\subsection{Event rates}
A final sample of 1081 fully reconstructed UpStop-MC events was retained
for subsequent analysis. Within this simulation sample, 80\% of events
originate with neutrino interactions having \mbox{$E_\nu$}~$\leq$ 10 GeV.
Charged-current quasi-elastic scattering
accounts for about one third of the interactions.
The neutrino fraction \numu /(\numu + \anumu) of the sample is 64\%.
The numbers of candidate data neutrino events which survive are listed in
Table \ref{tbl:counts}, where the MC numbers have been scaled to an
exposure of 5.90 fiducial kton-years and include the factor of 0.85
to normalize to the \nue event rate of Ref. \cite{msanchez}.
Comparison of the data with the neutrino MC
predictions, the sum of columns 2 and 3, shows that the observed InDown
rate is consistent with the prediction, whereas the UpStop data rate appears
suppressed by a factor of approximately two. These trends are in agreement
with the expectation from the oscillation analysis of Ref. \cite{msanchez}.
Note also the small size of the ambiguous sample and the small
misidentification rate between the UpStop and InDown samples.
\begin{table}[hbt]
\centering
\caption{Numbers of data and Monte Carlo events which pass all cuts.
The no-oscillation MC event rate is normalized to the measured e-flavor
event rate of Ref. \cite{msanchez} assuming no oscillations.}
\begin{tabular}{|l|c|c|c|}
\hline
{\it Assigned as} & \multicolumn{2}{c|}{\it No-osc. MC Truth} &
\emph{Data}\\ \cline{2-3}
& InDown & UpStop & \\
\hline
InDown & 12.4$\pm$1.4 & 0.3$\pm$0.1 & 16 \\
UpStop & 1.8$\pm$0.5 & 53.3$\pm$1.8 & 26 \\
Ambig & 0.8$\pm$0.3 & 3.4$\pm$0.4 & 2 \\
\hline
\end{tabular}
\label{tbl:counts}
\end{table}
\section{Energy and angular distributions of UpStop/InDown neutrinos}
\label{sec:dist}
The neutrino energy, $E_\nu$, for Monte Carlo UpStop and InDown events
is shown in Fig. \ref{fig:truen}. The UpStop events have an average
$E_\nu$ of 6.2 GeV. In contrast, the InDown events have lower $E_\nu$
values with an average of 2.4 GeV.
\begin{figure}[hbt]
\centerline{\epsfig{figure=fig08.eps,width=10.0cm}}
\caption{Comparison of the primary $E_\nu$ spectra for UpStop and InDown
events.}
\label{fig:truen}
\end{figure}
The muon track provides a good estimator for the incident neutrino
direction. For UpStop events the average angle between the incoming
neutrino and the muon is 11$^\circ$. For the lower energy InDown sample,
the average angle is 13$^{\circ}$.
In the likelihood analysis of Ref. \cite{msanchez}, the variable
log$_{10}(L/E)$ was used, where $L$ is the neutrino pathlength in
kilometers and $E$ is the neutrino final state visible energy in GeV.
As demonstrated in Ref. \cite{msanchez}, multiple scattering of the
exiting muon in PC events allows sufficient neutrino energy determination
to permit the reconstruction of the log$_{10}(L/E)$ distribution.
Fig. \ref{fig:ind} shows the log$_{10}(L/E)$
distribution for InDown data (crosses) compared to the no-oscillation MC.
The solid-line histogram represents the sum of the partially-contained
InDown events from the contained-vertex PC Monte Carlo (PC-MC, dark
shading), plus misidentified UpStop-MC events (light shading).
Good agreement is observed between the data and the unoscillated Monte
Carlo. Hence no evidence is found for oscillations in $\nu_\mu$ atmospheric
neutrinos which are incident from directions above the horizon.
\begin{figure}[hbt]
\centerline{\epsfig{figure=fig09.eps,height=8.0cm}}
\caption{Distribution of log$_{10}(L/E)$ for the InDown events.
The data are shown as crosses; the solid-line histogram shows the
neutrino MC expectation for no oscillations. The MC prediction
arises mostly from contained vertex PC events (PC-MC, dark shading),
but receives a small contribution from UpStop-MC events which were
misidentified as InDowns (light shading).
}
\label{fig:ind}
\end{figure}
\begin{figure}[hbt]
\centerline{\epsfig{figure=fig10.eps,height=8.0cm}}
\caption{Distribution of cos$\theta_z$ for the UpStop events.
The crosses represent the data, and the solid-line histogram shows the
expected MC distribution for no oscillations. Light and dark-shaded
areas show the contributions of UpStop and InDown events
for no oscillations.}
\label{fig:upt}
\end{figure}
For the UpStop events, however, the whole of the hadronic-shower energy
plus a fraction of the muon energy is missing. Thus, whereas $L$ can
be calculated accurately from $cos\theta_z$, $E$ is essentially
undetermined. The average difference between log$_{10}(L/E)_\nu$
and log$_{10}(L/E)_\mu$ is 0.69 (FWHM=0.66),
spanning four bins used in the oscillation analysis. Therefore
log$_{10}(L/E)$ is not a useful variable for analysis of oscillations
in these events. In this section we show data as a function of
cos$\theta_z$. In the analysis described in Section \ref{sec:global}
it is convenient to fit as a function of log$_{10}L$. Fig. \ref{fig:upt}
shows the distribution of cos$\theta_z$ for upward-stopping muon data
events. The distribution decreases steadily towards the nadir.
Fig. \ref{fig:upt} also includes the simulated
UpStop-MC (light shading) and the misidentified
contained-vertex PC-MC (dark shading) distributions, for the no-oscillation
case. Significant disagreement between the neutrino UpStop events and
the no-oscillation expectation is apparent towards the nadir,
which is consistent with the loss of
upward-going $\mu$-flavor events due to oscillations.
The distributions of Figs. \ref{fig:ind} and \ref{fig:upt}
imply constraints on neutrino oscillation scenarios.
These samples have been included in a likelihood analysis together with all
the other neutrino events from the experiment. The method and the
results of this global fit to Soudan-2 neutrino data
are described in Section \ref{sec:global} below.
\section{Oscillation analysis}
\label{sec:global}
\subsection{Outline of the method}
\label{sec:method}
The oscillation analysis is a bin-free likelihood analysis based on
the prescription of Feldman and Cousins \cite{Feldman_Cousins}.
A detailed description of the method can be found in Ref. \cite{msanchez}
and is not repeated here. The main points of the analysis are:
\begin{enumerate}
\item [(1)] As reported in Ref. \cite{SK-USUT} and confirmed by
Ref. \cite{msanchez}, the distributions of neutrino-induced
e-flavor data events are consistent with the null oscillation
MC predictions, up to an overall normalization.
Only the $\mu$-flavor data
exhibit oscillation effects. Thus this analysis
assumes two flavor \numutonutau oscillations.
\item [(2)] The FC and PC samples described in Ref. \cite{msanchez}
are used unchanged in the present analysis. The InDown
events are added to the PC muon-flavor sample,
and the Ambiguous events are used only in the overall normalization.
The UpStop events are treated as a new category and analyzed
as a function of log$_{10}L$ rather than as
a function of log$_{10}(L/E)$.
\item [(3)] A likelihood function for the data is constructed as a function
of \delmns, the mass-squared difference, and of \sqsinns,
where $\theta$ is the mixing angle,
using probability density functions (pdf's) determined from the MC sample.
Details of the formalism are given in Ref. \cite{msanchez}.
\item [(4)] The summed negative log likelihood is evaluated at each point
on a 15 $\times$ 80 grid of \sqsin $\times$ log$_{10}(\Delta m^2)$
with \sqsin varied between 0.0 and 1.0 and
\delm varied between $10^{-5}$ and $10^0$ eV$^2$. The lowest negative
log likelihood on the grid is found and $\Delta \cal{L}$, the difference
between the lowest value and the value in each (\sqdm ) grid square,
is plotted.
\item [(5)] A background contribution of non-neutrino events
arising from neutrons and gammas produced by muon interactions
in the rock around the detector is added to the likelihood
function. The background contribution only affects the FC events; the
PC events and the new InDown and UpStop events are treated as
background-free.
\item [(6)] The overall normalization of the MC and the amounts
of background in the different FC event samples, estimated using
shield-tagged data events and the depth distribution of the event vertices,
are nuisance parameters whose values are optimized at each grid square.
\item [(7)] The allowed confidence level regions are calculated by the
method of Feldman and Cousins \cite{Feldman_Cousins}. That is, MC
experiments are generated and analyzed at each grid square to
calculate the expected likelihood rise for a given confidence
level based on the statistical and systematic errors at that
grid square. In addition to the systematic errors described
in Ref. \cite{msanchez}, a 10\% systematic error
on the relative normalization of the UpStop events to the remainder
of the data was allowed. The latter error represents uncertainties in
density and nuclear composition of rock below the detector, and uncertainties with
variation of neutrino cross sections in rock versus iron.
\item [(8)] The analysis of Ref. \cite{msanchez} used the one-dimensional
flux calculation of the Bartol group \cite{bartol96}.
This analysis uses their new three-dimensional calculation \cite{Bartol04}
and compares it with their 1D calculation and with the 3D calculation
of Battistoni {\it et al.} \cite{Battistoni_3D}.
\end{enumerate}
The 44 new data events documented here are added to
the 488 data events of the previous analysis. However, the new events
are ``high resolution'' $\mu$-flavor events, those most sensitive
to oscillations, consequently they enhance the sensitivity afforded by the
167 events of that type in the previous analysis.
\subsection{Oscillation results}
\label{oscanal}
\begin{figure}[htb]
\centerline{\epsfig{file=fig11.eps,width=12.0cm}}
\caption{The data likelihood difference, $\Delta \cal{L}$, plotted as a
function of \sqsin and log$_{10}(\Delta m^2)$.}
\label{fig:datallh}
\end{figure}
The values of $\Delta \cal{L}$ are plotted
in Fig. \ref{fig:datallh} as a function of \sqsin and log$_{10}(\Delta m^2)$.
The resulting surface is similar to that reported in Ref. \cite{msanchez}.
The main difference is that the likelihood rise for the grid square with the
lowest values of \delm and \sqsin (called
the no oscillation point) is 16.0 compared with 11.3 for
the previous analysis. The new data has
significantly increased the discrimination against the
no-oscillation hypothesis, mostly because of the large
suppression of the UpStop data compared to the MC prediction.
The probability of the validity
of the no-oscillation hypothesis is discussed in Sect. \ref{sec:CL}.
The $\Delta \cal{L}$ surface in Fig. \ref{fig:datallh} exhibits
two nearly equal minima, one at the grid square centered at
\delm~=~0.0017~eV$^2$, \sqsin~=~0.97, and one at
\delm~=~0.0052~eV$^2$, \sqsin~=~0.97.
The first minimum is the ``best fit point" of this
analysis, while the second minimum was the best fit point in the
previous analysis \cite{msanchez}.
The difference of $\Delta \cal{L}$ between the two is only 0.18.
There is a small rise in likelihood between the two minima which peaks
at about 1.8 in the region of the Super-K best-fit point.
However, the 90\%-confidence-level limit of this analysis,
determined in Sect. \ref{sec:CL},
contains all of the Super-K allowed region.
The value of the flux normalization at the best fit point is 91\% of
the Bartol-3D prediction~\cite{Bartol04}.
\begin{figure}[htb]
\centerline{\epsfig{file=fig12.eps,width=10.0cm}}
\caption{(a) The \ltenloe distribution for the PC event sample
that includes the InDown events.
(b) The UpStop events plotted as a function of log$_{10}L$.
The points with error bars are the data. The solid histogram
is the MC prediction at the best fit point, and the dashed
histogram shows the no-oscillation expectation. The dotted histogram depicts
``saturated oscillations" with \sqsin~=~1.0, \delm~=~1.0~eV$^2$.}
\label{fig:inup}
\end{figure}
Although the analysis is carried out using the log-likelihood
function, it is useful to evaluate the goodness of the fit by
projecting out the distributions for the various data sets and
calculating a $\chi^2$ for the data compared to the MC prediction.
Fig. \ref{fig:inup}a shows the data for the total muon PC sample
(including the InDown events) and Fig. \ref{fig:inup}b shows
the UpStop events, compared to
the MC predictions.
The PC events are in good agreement
with the no-oscillation histogram, but disagree,
particularly at low $L/E$ (downward going $\nu$ events),
with the prediction at the highest considered values of
\delm and \sqsin ($\sim$1.0 eV$^2$ and $\sim$1.0), where
the oscillations have the greatest frequency and largest
size (called ``saturated oscillations'').
On the other hand, the UpStop events are in disagreement
with the no-oscillation prediction, particularly at large $L$,
but agree with the saturated oscillation prediction.
This behavior is indicative of oscillations with values
of \delm in the low $10^{-3}$ eV$^2$ region where downward-going
neutrinos have not yet oscillated and upward-going neutrinos
have saturated oscillations. The best-fit prediction agrees
well with both distributions.
Table \ref{tbl:chisq} gives the $\chi^2$ for the comparison
of data and MC for the PC and UpStop distributions as well as
the full data set including the other distributions described
in Ref. \cite{msanchez}. The $\chi^2$ at the best fit point,
using all of the data, is 35.6 for 30 data points.
\begin{table}[hbt]
\centering
\caption{The $\chi^2$ for comparisons of the data to various
MC predictions for the PC events, the UpStop events, and
the full data set.
}
\begin{tabular}{|l|c|c|c|}
\hline
& \multicolumn{3}{c|}{$\chi^2$/Number of data points} \\
\cline{2-4}
& PC & UpStop &All data \\
\hline
Best fit & 5.0/5 & 0.6/4 & 35.6/30 \\
No oscillations & 5.9/5 & 7.9/4 & 66.6/30 \\
Saturated oscillations & 19.8/5 & 1.9/4 & 63.2/30 \\
\hline
\end{tabular}
\label{tbl:chisq}
\end{table}
\subsection{Confidence levels}
\label{sec:CL}
\begin{figure}[htb]
\centerline{\epsfig{figure=fig13.eps,width=12.0cm}}
\caption{(a) The 90\% confidence allowed region from the Feldman-Cousins
analysis of this work (solid line), compared to that of
Ref. [1] \cite{msanchez} (dotted line).
(b) Contours at 68\%, 90\%, and 95\% confidence level (dotted line,
thick solid line, and dashed line respectively), compared to
the 90\% sensitivity contour (thin solid line).}
\label{fig:compnew}
\end{figure}
The 90\%-confidence-level surface $\Delta {\cal L}_{90}$ (not shown),
generated by the MC experiments
under Feldman-Cousins prescription is very similar to that of
the previous analysis. Combining the
$\Delta {\cal L}_{90}$ surface with the data
likelihood surface of Fig. \ref{fig:datallh} gives
the solid-line 90\%-confidence-level contour
shown in Fig. \ref{fig:compnew}a. For comparison, the
90\%-confidence-level contour determined previously
in Ref. \cite{msanchez} is shown by the dotted line. It can be seen
that the allowed region is more restrictive and that some
of the contour structure indicated by the previous analysis has
been smoothed. This is due to the fact that
the likelihood surface is rather flat at the base of the
valley and small changes in the data can move the contours
substantially in this region.
Fig.\ref{fig:compnew}b shows the 68\%, 90\% and 95\% contours,
a further indication of the shape of the likelihood surface. Also
displayed in Fig.\ref{fig:compnew}b is the 90\% sensitivity contour obtained
from the Monte Carlo experiments, which denotes the expected 90\% contour
for experiments with this statistical precision and systematic errors.
As was the case in Ref. \cite{msanchez}, the 90\%-CL contour from this
analysis is more restrictive than the estimated sensitivity contour,
due, in part, to a small mismatch of the overall event-rate
normalization in the electron and muon samples.
The probability of no oscillations
can be calculated, under the Feldman-Cousins prescription and
including all of the systematic effects, by generating experiments at the
minimum \delm and \sqsin grid square and counting those
MC experiments that give a larger likelihood difference
than 16.0. In 500,000 simulated experiments,
16 had a larger likelihood difference giving a probability of
$3.2\times10^{-5}$ for the no-oscillation hypothesis.
For UpStop muons and upward-going contained vertex events,
the initiating neutrino may experience Mikheev-Smirnov-Wolfenstein
(MSW) resonance and other matter effects as a result of the
traversal of thousands of kilometers of terrestrial matter.
The magnitude of matter-induced deviations from vacuum oscillations
was studied using simulated event samples; the samples were
weighted in accordance with three-neutrino mixing and the
normal mass hierarchy, using the approximation of a uniform
(path-weighted mean) terrestrial density \cite{G-Garcia_RMP03}.
For the range of plausible \delmns~ values, it was found that
matter effects, even with maximally allowed mixing angles, can only
introduce a few percent additional depletion of muon-flavor neutrinos
beyond that which results from \numutonutau vacuum
oscillations \cite{PDK-811}. Since the scale of
such deviations is well below the statistical sensitivity
afforded by the data, matter effects were neglected
in this analysis.
\subsection{Flux model comparison and event rate normalization}
\label{sec:norm}
\begin{figure}[htb]
\centerline{\epsfig{file=fig14.eps,width=8.0cm}}
\caption{The 90\%-confidence-level allowed region for three
atmospheric-neutrino flux calculations.
The dotted curve is based upon the 1D-model
of the Bartol group from 1996 \cite{bartol96}.
The more recent 3D calculations of
Battistoni {\it et al.} \cite{Battistoni_3D} and of
the Bartol group \cite{Bartol04}
lead to the dashed and solid curve, respectively.}
\label{fig:flux}
\end{figure}
The analysis of this data has been carried out
for three different atmospheric neutrino flux calculations: {\it (i)}
the one-dimensional flux calculation
of the Bartol group \cite{bartol96},
{\it (ii)} the Bartol three-dimensional
calculation \cite{Bartol04},
and {\it (iii)} the three-dimensional calculation of
Battistoni {\it et al.} \cite{Battistoni_3D}.
As well as the flux prediction, the analysis requires an estimate
of the height in the atmosphere at which the neutrino is produced.
This is particularly important for neutrinos coming from overhead
where the path in the atmosphere is a large fraction of the total
path length. A parameterization of the pion and muon decay heights
was made using the formalism of Ref. \cite{Ruddick}
for the one-dimensional Bartol calculation. A similar
parameterization for decay heights was prepared
for the three-dimensional Bartol case. The latter parameterization
was also used for predictions based upon the Battistoni {\it et al.} flux.
Fig. \ref{fig:flux} shows the 90\%-CL region for the three cases.
There is a small change from the one- to three-dimensional flux models,
however the three-dimensional models of Bartol and Battistoni {\it et al.}
give almost identical results.
The only significant difference between the three cases
is in the absolute normalization of the flux.
At the best-fit point of this analysis, the normalization factor
(number of events observed/calculated)
for the Bartol 1D flux is 0.86, while for the Bartol 3D flux the factor
is 0.91 and for the Battistoni {\it et al.} flux it is 1.02.
The authors of the flux calculations typically quote large errors of $\pm$20\%
on the absolute normalization, due to the uncertainties on the
incoming cosmic-ray fluxes and on nucleus-air cross sections.
There are also significant errors on the neutrino cross sections.
It is thus of interest
to determine the experimental error on the
ratio of the measured to the predicted event rate.
The experimental event rate is proportional to the incident neutrino flux,
the neutrino cross sections in the detector, and the detector acceptance.
This experiment can thus determine the normalization of the atmospheric
neutrino flux at the Soudan-2 site
times the neutrino cross sections
encoded in the NEUGEN3 program \cite{neugen},
for an iron calorimeter with a given energy threshold.
Translation of this normalization factor to
other experiments at the Soudan site and at other sites is possible
in principle. However it requires knowledge of the
relative neutrino fluxes at the different sites and
the ratio of the neutrino cross sections
if a different detector medium or a different neutrino generator is used.
The event-rate normalization factor for Soudan 2 is subject
to the following errors:
\begin{enumerate}
\item [(1)] The total number of neutrino events observed in this experiment
above an energy threshold of 300 MeV, obtained from Table I of
Ref. \cite{msanchez} and Table 2 of this paper, is 481.2$\pm$26.2 ($\pm$5.4\%).
The error includes the statistical error and the error on the background
subtraction.
\item [(2)] The statistical error on the Monte Carlo sample is $\pm$1.6\%.
\item [(3)] The variation of the fitted normalization factor over the 68\% confidence
region of the oscillation parameters is $\pm$3\%. The Feldman-Cousins
analysis includes the systematic errors associated with the background
subtraction, cross section uncertainties and energy scale uncertainties.
\item [(4)] Depending on the value of $\theta_{23}$,
$\nu_e \rightarrow \nu_\mu$ oscillations with the solar parameters
could change the flux of $\nu_e$ that have traversed
the Earth \cite{Peres-Smirnov, PDK-807}.
The change can be positive or negative
depending on whether $\theta_{23}$ is smaller or greater than $45^o$.
Using the Super-K limits for $\sin^{2} 2\theta_{23}$ and recent values for
the solar oscillation parameters \cite{SK-USUT, Kamland},
an uncertainty of
$\pm$3.3\% in the calculated electron-event rate is estimated.
\item [(5)] Uncertainty arises in the rate of multi-GeV muon
events due to matter effects \cite{PDK-811}. A $\pm$1.6\% error contribution
to the event rate calculation is inferred.
\item [(6)] Any mismatch between the Monte Carlo representation of
the detector and reality could introduce a relative error in the
acceptance of the two and thus an error in the normalization ratio.
Detailed studies of individual event channels revealed no significant
differences \cite{Chung, PDK-791}. The relative proportions
of different event types
and event rejection modes in data versus Monte
Carlo samples were studied.
A $\pm$2\% systematic error, estimated from
the maximum differences found between the data and Monte Carlo, has been
assigned to account for uncertainties arising from geometric acceptance
and other residual effects.
\end{enumerate}
Based upon the $\pm$8\% quadrature sum of these errors,
an overall normalization factor of 0.91$\pm$0.07
is determined for this analysis.
This normalization is specific to the Soudan 2 site,
the detector medium, the Bartol 3D flux, and to the neutrino cross sections
encoded in the NEUGEN3 event generator.
It is averaged over the years 1989-2001, one full solar cycle.
The same percentage error, $\pm$8\%, is applicable
to the Soudan-2 normalization
factors given above
for the Bartol 1D and Battistoni {\it et al.} 3D
atmospheric fluxes.
As a check, a normalization which is mostly independent of
the $\nu_\mu \rightarrow \nu_\tau$ oscillation parameters can
be obtained from the total electron sample of contained and
partially contained events. Table I of Ref. \cite{msanchez}
lists 208.7$\pm$15.9 background-subtracted electron-neutrino
events to be compared with an expected rate from the 3D Bartol
prediction of 238.1 events, yielding a normalization factor of
0.88$\pm$0.07, where the error is just statistical from the number
of events and does not include the contribution from
$\nu_e \rightarrow \nu_\mu$ oscillations or the other error
sources detailed above.
\section{Conclusions}
\begin{figure}[htb]
\centerline{\epsfig{file=fig15.eps,width=8.0cm}}
\caption{ The Soudan 2 90\% confidence allowed region in \sqdm
(solid line) compared with the allowed regions of MACRO
(dot-and-dashed line) \cite{MACROb}, and of the Super-K
zenith angle \cite{SK-USUT} (dotted line) and
$L/E$ \cite{SuperKallowed} (dashed line) analyses.}
\label{fig:comp}
\end{figure}
Samples of upward stopping muons produced by neutrino interactions
in the rock below the Soudan-2 detector and
partially-contained events with downward-going
muons produced in the detector have been separately isolated.
These two new data sets provide additional support and constraints
for the hypothesis of atmospheric-neutrino oscillations.
The flux of upward stopping neutrino-induced muon events is
observed to be suppressed by a factor of approximately two,
while downward-going muon
events are not suppressed. An oscillation analysis using the method
described in Ref. \cite{msanchez} and adding this new data gives a
more restrictive 90\%-confidence-level allowed region of \delm and \sqsin.
The probability of the no-oscillation hypothesis is reduced by more than
a factor of 10, to $3.2\times10^{-5}$.
The data have been analyzed using three models of the atmospheric flux
at the northern geomagnetic latitude of this experiment. The models include
two recent three-dimensional flux calculations and an older one-dimensional
calculation. The oscillation parameters are found to be essentially
independent of the flux calculation.
The normalization factor for the experiment, 0.91$\pm$0.07, is the
measured event rate divided by the calculated event rate
where the latter is the convolution of neutrino fluxes of the
Bartol 3D flux calculation with neutrino cross sections
encoded in NEUGEN3. The denominator for this
ratio contains elements which are specific to the Soudan-2 detector
analysis, and site. Consequently, the normalization factor
cannot be compared in a straightforward way to other
experiments at other geomagnetic latitudes with different detector
media and using different neutrino interaction generators.
Comparison of this experiment's revised 90\% CL allowed region
with the most recent Super-K \cite{SK-USUT, SuperKallowed} and
MACRO \cite{MACROb} allowed regions is shown in Fig.~\ref{fig:comp}.
This result is in good agreement with both experiments.
\section*{Acknowledgments}
This work was supported by the U.S. Department of Energy, the U.K.
Particle Physics and Astronomy Research Council, and the State and
University of Minnesota. We gratefully acknowledge the Minnesota Department
of Natural Resources for allowing us to use the facilities of the Soudan
Underground Mine State Park. We warmly thank the Soudan 2 mine crew for
their dedicated work throughout the duration of the experiment.
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 7,652
|
{"url":"https:\/\/www.albert.io\/ie\/ap-computer-science-a\/printing-int-values-within-while-loop","text":"Free Version\nEasy\n\n# Printing Int Values Within While Loop\n\nAPCSA-FKEDGA\n\nWhat does the following code segment print to the console?\n\nint c=0;\n\nwhile (c<6)\n{\nSystem.out.print(c + \" + \" + c);\nc++;\n}\n\nA\n0 + 01 + 12 + 23 + 34 + 45 + 5\n\nB\n0 + 1 + 2 + 3 + 4 + 5 +\n\nC\n30\n\nD\n0 + 0 + 1 + 1 + 2 + 2 + 3 + 3 + 4 + 4 + 5 + 5 +\n\nE\n1 + 12 + 23 + 34 + 45 + 56 + 6","date":"2017-03-01 17:53:57","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.19972407817840576, \"perplexity\": 100.09389169132238}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2017-09\/segments\/1487501174215.11\/warc\/CC-MAIN-20170219104614-00061-ip-10-171-10-108.ec2.internal.warc.gz\"}"}
| null | null |
Wądzyn – wieś w Polsce położona w województwie kujawsko-pomorskim, w powiecie brodnickim, w gminie Bobrowo.
W latach 1975–1998 miejscowość należała administracyjnie do województwa toruńskiego.
Demografia
Według Narodowego Spisu Powszechnego (III 2011 r.) liczył 121 mieszkańców. Jest dziewiętnastą co do wielkości miejscowością gminy Bobrowo.
Zobacz też
Wądzyn
Przypisy
Wądzyn (województwo kujawsko-pomorskie)
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 4,657
|
The plays of Sheridan
Posted by argumentativeoldgit in Drama, literature, Uncategorized. Tagged: Moliere, Sheridan. 9 comments
I wonder if Sheridan's literary reputation is on the wane these days. Revivals of his plays are not, I think, so common now as they used to be. We still hear of Edith Evans' splendid Mrs Malaprop, for instance, or of Laurence Olivier's exuberant performance as Mr Puff (a role which he seemingly alternated with Sophocles' Oedipus!), but contemporary luminaries of the stage rarely if ever list Sheridan roles in their credits. And in all the years I have spent here in London, I cannot recall a single performance of a Sheridan play. No doubt I have missed a few, but it's hard to escape the impression that these plays simply aren't performed that much these days as they not so long ago used to be. Or read either, for that matter. This is in great part due, no doubt, to that questionable dictum that has gained ground that plays are meant "to be seen, not read" – a dictum that has resulted in the undervaluing of a great many dramatists in preference to authors of prose fiction – but it could also be, I think, that our age is out of sympathy with Sheridan's dramatic ethos.
I was contemplating this matter only quite recently, when it occurred to me that I had never read Sheridan's plays either. 18th century writers of prose fiction, yes: the novels of Defoe, Fielding, Sterne, Smollett, and even the intimidatingly long Clarissa by Samuel Richardson, have all been duly ticked off the list, and, in many cases, greatly admired and loved; but Sheridan I knew only by reputation. Well, there was only one way to put that right: Penguin Classics do a very useful volume containing his three greatest hits – The Rivals, The School for Scandal, and The Critic – and, while Sheridan is not these days a big enough name for this volume to be readily available in the local bookshop, it is still in print and is easily ordered.
However, on reading these plays, I did, I confess, have a sneaking sympathy with the "meant to be seen, not read" crowd. Imagine never having seen your favourite sitcom, and knowing it only through the script: how much of it would we laugh at? If I had never seen, say, Andrew Sachs' performance as Manuel in Fawlty Towers, would I have laughed at seeing a mere " ¿Qué? " in cold print? The impact of comedy undoubtedly depends to a very great extent on the comic skills and timing of the actors. However, as I was unlikely to see any of Sheridan's plays any time soon; and, further, as I have gained much merely from reading comic plays (I am an aficionado of Molière, after all); I wasn't going to let this stop me. After all, reading the lines and trying to imagine how good comic actors would deliver them is in itself great fun.
All this resulted in a very entertaining week's worth of reading. (Yes, I know … but I'm a slow reader.) In The Rivals, we have all the appurtenances of romantic comedy – young lovers, impossibly eccentric elders, lovers' tiffs that are lunatic storms in tiny teacups, disguises, misunderstandings, and all the rest of it. It's the sort of thing that Oscar Wilde wrought to a pitch of perfection in The Importance of Being Earnest, and which Wodehouse later seized upon (albeit as prose fiction rather than as stage drama). If I am to be entirely honest, both Wilde and Wodehouse improved upon Sheridan here: but it is hardly Sheridan's fault that those who later took up the genre developed it to such an extent. The Rivals still stands up as a fine comedy even on reading: I'd love to see a good comic cast let loose on this.
The tone in The School for Scandal is somewhat darker. Here, Sheridan presents us with a society where gossip, scandalmongering, hypocrisy, gratuitous and mendacious denigration of one's fellow humans, are virtually social graces: it is almost impossible to be part of society without being part of all this. The world Sheridan presents here is not too dissimilar to the world presented by Molière in possibly his greatest work, Le Misanthrope. There, Molière puts at the centre of his play a man of integrity, Alceste, who deplores all he sees about him, but who is nonetheless hopelessly in love with Célimène, an attractive young lady very much at home in this world that Alceste so deplores. But ultimately, Alceste refuses to compromise his integrity, leaving himself lonely and isolated, and, in the midst of all the comedy, almost a tragic figure. But this is not the direction Sheridan wants to go in. He gives us delicious characters, a fine farcical plot (involving that famous scene in Act 4 with various people hidden behind screens on various parts of the stage), and a happy ending where all is resolved, although, given the nature of the dramatic world he presents, a completely happy resolution should be well nigh impossible: even if individuals do reform, the nature of the society they inhabit is too inherently corrupt to change even in the slightest: any man of genuine integrity in such a society must, at best, compromise, as Alceste's friend Philinte does, or, at worst, end up lonely and isolated, like Alceste himself. But this is not Sheridan's concern. The corruption of society is not here a representation of the fallen nature of Man: it is, rather, a backdrop with great comic potential. And Sheridan exploits this potential brilliantly, squeezing as many laughs out of it as he can with considerable ingenuity.
The Critic seemed to me the funniest of the lot. After all, which other play features as a character an author named Sir Fretful Plagiary? In this play, Sheridan dispenses almost entirely with plot. Most of the play consists of a rehearsal of another play, an absurd "tragic drama" about the Spanish Armada, with comments by the exuberant Mr Puff, author of this play, an enthusiast of the theatre, Mr Dangle, and a dramatic critic, Mr Sneer. That's it. No young lovers, no-one hiding behind screens, no disguises and misunderstandings to be smoothed out at the denouement. Indeed, no denouement at all, for that matter.
Without anything resembling plot, everything stands or falls by the quality of the gags, and, even seen only in print, they are hilarious. The play within the play is extraordinarily bad, but Puff is nonetheless delighted by his own invention, and is not in the slightest bit put out by any criticism. When it is pointed out, for instance, that one of his lines is straight out of Othello, he blithely responds:
Gad! now you put me in mind on't, I believe there is, but that's of no consequence: all that can be said is, that two people happened to hit on the same thought, and Shakespeare made use of it first, that's all.
Puff is particularly proud of the "mad scene", and proudly reads out his stage direction:
'Enter Tilburina stark mad in white satin, and her confidant stark mad in white linen.'
Puff patiently explains to the various objectors that, yes, the confidant as well as the heroine must become mad. Stark mad. And once the scene ends, Puff turns to his audience in triumph:
There, do you ever desire to see any body madder than that?
(I must confess this is a line that has run through my mind after reading many a chapter by Dostoyevsky…)
Now that I have read these plays, I don't know that I'll be returning to The Rivals, or even to The School for Scandal: it's not that I didn't enjoy them – I did – but I'm not sure there's enough substance in either play to warrant revisiting (although I certainly wouldn't mind seeing them performed on stage). The Critic I shall most certainly be returning to: it's one of those instances we sometimes encounter (Don Quixote is another) of a parody that remains funny even when that which it is parodying has vanished from sight. This play alone should be enough to cement Sheridan's reputation as one of the great comic authors.
Posted by argumentativeoldgit in Cinema, comedy, Uncategorized. Tagged: John C Reilly, Oliver Hardy, Stan Laurel, Steve Coogan. 4 comments
Given that this blog has been going for nearly nine years now, and given further that I had set this blog up primarily to talk about various things I love, it is strange that I have managed so far not even to mention Laurel and Hardy. I suppose it's because I find it difficult to describe what their films mean to me without gushing. But now that a new film about this duo is doing the rounds to hearteningly popular acclaim, it seems as good a time as any to write something about them on my blog. And I'll do my best not to gush, as those who are fans will already know what I mean, and those who aren't will merely be put off.
Oliver Hardy and Stan Laurel.
I must admit, though, that I am always somewhat shocked when anyone tells me they do not like Laurel and Hardy films. And yes, there are many who think them essentially silly, and simple-minded. And I have to ask myself whether my continued love for them is really justified in terms of their merit, or whether it is merely a leftover from a fondly remembered childhood. I think it's the former, but I cannot, of course, demonstrate it one way or the other. I plead that, as a child, I used to laugh at Abbott and Costello films as well, but that they soon paled, and now I find them merely irritating; but Laurel and Hardy films I continue to love. That doesn't constitute a proof, of course – nothing can constitute a proof in this context – but it does indicate, at least, that my continued enjoyment of Laurel and Hardy is due to more than mere nostalgia. Although what that more is, is difficult to identify, let alone articulate.
We can, at least, say what they aren't. Their humour is not – despite ignorant claims to the contrary – primarily slapstick. Yes, of course they employed slapstick; but so, for that matter, did Cervantes. And yes, of course that slapstick is funny. But what we are laughing at is, I think, more than merely the slapstick, more than the pratfalls that lie in wait of them. And that more lies, I think, in these characters' relationship with the world around them, with each other, and with us, the audience.
Oliver Hardy once said that people enjoyed watching these films because they can feel smarter than these two. (I'm sorry I can't link to this, as I can't find a reference to this quote anywhere: but I'm sure I read this somewhere – though damned if I can remember where!) I'm not sure what context Oliver said this in, but whatever he meant, he was surely only partly right. Yes, of course we feel we are brighter than these two: there would be something very wrong with us if we didn't. And yes, of course, we laugh at their stupidity, their ineptitude. But – and here's the most important thing – we never look down on them. No matter how foolishly they act, no matter how inept they are, we're on their side. To use that lazy cliché – we can identify with them; we can sympathise with these two essentially well-meaning people who are unequal, as, frankly, we all are, to the demands life makes of us. It is partly because the world conspires against them; it is also partly because they are not very bright, or capable. And yes, as we watch Stan and Ollie struggle with living their lives, we laugh: but we laugh not at them, but in the recognition deep down that, no doubt on a somewhat different level, we too aren't up to meeting life's demands.
Flaubert had pulled off this trick in Bouvard et Pécuchet (which often strikes me as Flaubert's masterpiece): here, too, we have two genuinely well-meaning people trying to grapple with the complexities of life, and repeatedly failing. However, we do not look down on them, for we see in them, despite a comic exaggeration, an image of our own state. But Flaubert observed his creations with a studied ironic distance, whereas I don't think even detractors of Stan and Ollie could fail to notice the genuine warmth with which these two characters are portrayed. And frankly, this is a mystery to me. I too sense the warmth in their films; and yet, Ollie is an overbearing, pompous bully who frequently hits Stan. (And Stan occasionally hits back.) I once saw an interview with the late Richard Briers, one of the finest comic actors of his generation, who also admitted that he couldn't explain this. We all hate pompous, self-important people, he said, we all hate bullies, and yet, we watch Oliver Hardy's performance, and we love him. He said he watched these films repeatedly just to see how Oliver Hardy achieved this, but that he never could work it out. He thought it was simply a miracle.
But, whatever life throws at them, they never give up, or give way to despondency. They keep on failing, and not even failing better. But they carry on. Because, like the rest of us I guess, they must.
Fans of Laurel and Hardy are probably a bit cheesed off with me by now. Here I am, talking about Cervantes and Flaubert and what not, while ignoring the most salient aspect of their genius – they were funny.
Yes, they certainly were. Are.
But I challenge anyone to explain what it is about them that makes one laugh. It's an impossible task, and I'm not even going to try. In any case, if anyone needs to ask why they are funny, they're not going to get it anyway.
The recent film Stan and Ollie has excited much comment, especially around my neck of the net. The Laurel and Hardy fan club page on Facebook has been buzzing with excitement, with virtually everyone recommending the film, and praising Steve Coogan's and John C. Reilly's superbly convincing performances. I must admit I tend to steer away from showbiz biopics: if they are hagiographies, I find that boring and pointless; and if they are hatchet jobs, they are equally boring and pointless, and also somewhat repugnant. Sometimes, the middle course is taken, showing both the virtues and the vices of the subjects, but even there, I remain dubious: we all have our character flaws – what purpose does it serve to dramatise these peoples' personal flaws and foibles? But in this case, I must admit I was quite pleasantly surprised.
I do not know much of the biographical details of these two: I am generally more interested in artists' works rather than their lives; but I do know that the two got on really well together, and had for each other a great respect and affection. But the film-makers also take – as I discover from some of the posts on this Facebook page from those who know about their lives far better than I do – a few liberties. Producer Hal Roach was no money-grubbing philistine as is portrayed here; and while Stan and Ollie did have a few differences with him, it was never about pay. More significantly, Laurel and Hardy never quarrelled with each other in real life. No doubt they had some minor disagreements when filming, but it never amounted to a break in their friendly relations. In this film, Stan is somewhat resentful of Ollie going off to make a film on his own: in real life, Stan had actually congratulated Ollie. I assume that the quarrel was introduced into this film to inject some drama into the proceedings: two people getting on just fine is no doubt admirable, but frankly a bit boring. However, it was made clear that neither was at peace till they had made it up and acknowledged to each other that they had not meant the words spoken in anger; and the reconciliation scene was genuinely touching. It is impossible for us fans to think of Stan and Ollie without feeling a sense of warmth, and of generosity: both these qualities came over very strongly.
The film focuses on the tour they made of Britain in 1953, when they were both getting old, and somewhat past it (at least, on the evidence of their later films, which I frankly find a bit painful to watch). And Ollie's health was clearly failing. The film could easily have become sentimental, but it didn't. Even their reconciliation scene, which, fictional or not, no fan of the pair could fail to find touching, consisted of only a few words: no more needed to be said. One thing I hadn't realised, and which, I admit, did leave me a bit tearful, was that for the eight years Stan lived on after Ollie's death, he continued writing gags for the two. Obviously, he knew that these gags would never be performed (and I, for one, hope they never are, not even by the excellent Coogan and Reilly): presumably, Stan wrote these gags because that was his way of keeping in touch with precious, vanished times, and with a precious, vanished friend. I'm glad the film only mentioned this in passing at the end: some things really don't need to be dwelt upon.
John C. Reilly as Oliver Hardy, and Steve Coogan as Stan Laurel, from the film "Stan and Ollie", courtesy of producing companies Entertainment One BBC Films Fable Pictures Laurel and Hardy Feature Productions Sonesta Films
After seeing the film, I came back home, and immediately put on one of their two-reelers. (I chose Midnight Patrol at random.) And I laughed all over again, although I knew all the gags by heart. I think I just enjoy their company. Foolish, inept, pompous (on one side) and vacant (on the other), utterly unable to cope with all that life throws at them, often cruelly defeated – but however stupid we may think them, we never look down upon them: they're still one of us.
If I had to pick a single DVD set to keep from my collection, I would undoubtedly choose the Laurel and Hardy films.
Putting the plebs back in their place
Posted by argumentativeoldgit in Culture, rant, Uncategorized. 16 comments
Imagine that you have a profound artistic vision. And imagine also that you have the ability to communicate this vision. Imagine you have an extraordinary mastery of language, and that there is nothing – no nuance, no shade of thought or feeling – that you cannot communicate with words.
Now, if you are so gifted, what would you do with these gifts? What would you devote your life to? What would you work on assiduously through all hours of day and night?
Keeping the working classes at bay, obviously. I mean, it stands to reason, doesn't it?
I am afraid this is precisely the contention that is made by many. It's not new, of course, but I had rather hoped that this kind of nonsense would have run its course by now. So it's sad to see that it is still very much alive and kicking.
I am not sure when these ideas started, but I first heard them articulated by John Carey, no less. I must confess that I haven't read the book he wrote on this matter – The Intellectuals and the Masses; but I did see a television documentary he fronted at around the time this book was published, in which he expressed his view that modernists had deliberately made their work difficult to keep the "masses" out. I must admit that what I heard on that programme did surprise me considerably. But I am reluctant to attack Carey, as he is someone whom I admire greatly: had it not been for his brilliant edition of Milton, with its superbly detailed and erudite notes and annotations, I am not sure I could have negotiated my way around these immensely difficult poems.
There are, sadly, a great many other very difficult works of literature that I haven't, as yet, been able to get my head around – not even with all the critical commentaries available. Yes, I made a few inroads into Milton (thanks to John Carey and a number of other Milton scholars); but the works of Spenser, say, or of the much-loved Donne, refuse resolutely to penetrate through my thick skull. There are other difficult works where, I can see quite clearly for myself without having to be told, my understanding is at best partial: the late novels of Henry James, say (The Golden Bowl especially). Even my beloved Shakespeare loses me with The Phoenix and the Turtle. All these works, it may be noted, are pre-modernist. In short, difficulty is hardly a modernist invention. So it genuinely puzzles me to read something like this:
If more and more working people were reading the classics, if they were closing the cultural gap between themselves and the middle classes, how could intellectuals preserve their elite status as arbiters of taste and custodians of rare knowledge? They had to create a new body of modernist literature which was deliberately made so difficult and obscure that the average reader did not understand it.
This is written by scholar Jonathan Rose, and is approvingly quoted by Matthew Wills in the article I linked to above.
The contention that certain writers, of a certain era, had deliberately introduced difficulty (a quality that, presumably, had not existed earlier) specifically in order to exclude the "working people" seems, in view of the extreme difficulty I encounter in so many pre-modernist works, frankly absurd. It gives me a mental picture of the likes of Joyce, Woolf, Eliot, etc. all getting together & rubbing their hands with glee – "These plebs are getting a bit above themselves, aren't they? Right, no more easy stuff like Spenser or Milton or Henry James from now on … we'll soon put the bastards back in their place!"
And so they put all their time and effort putting us bastards back in our place. Because, obviously, it's such a worthy cause for gifted people to dedicate their lives to.
In my experience, virtually every contention relating to cultural matters that claims to be egalitarian has at its root a barely disguised contempt for the very people it pretends to champion. Behind the contention that the difficulty of modernism is intended to ward off the "working people" is the insulting belief that the "working people", the "masses", are less capable than others of negotiating difficulty. The very title The Intellectuals and the Masses assumes that the two are distinct groups – that the "masses" are incapable of being intellectuals; or that, those who do become intellectuals are, by definition, no longer authentically one of the "masses". In which case the distinction between the two seems to me to become rather inconsequential: what point would such a distinction serve?
Yet, it seems, this continues to do the rounds. The net result is further denigration and belittlement of anything that smacks of the intellectual. Which, I can't help thinking, has been the aim all along. But since it is impertinent to speculate on what anyone's unstated motives may be, let us not go there. Let me just restrict myself to saying that I, who am most definitely among the "masses" (since I am still waiting for my invitation to join this shady elite of intellectuals), continue to find the whole thing frankly bizarre.
"The Lady from the Sea" by Henrik Ibsen
Posted by argumentativeoldgit in books, Drama, literature, Uncategorized. Tagged: Ibsen, The Lady from the Sea. 2 comments
*** SPOILER WARNING: The following post inevitably reveals some of the plot details of this play, and so, if such things are important to you, it is possibly best not to read this post till you've read or seen the play for yourself.
All quoted passages from "The Lady from the Sea" are taken from the translation by Michael Meyer, published by Methuen
Looking through the mature plays of Ibsen, I am frequently left with an impression of terror, but it is not always easy to pinpoint where this terror comes from. If pressed, I would say it comes from his various depictions of what I, at any rate, would term fanaticism – a single-mindedness that refuses to be deflected, that rejects any form of compromise. Often, perhaps always, this fanaticism is in a good cause: it is on the side of Truth; it looks with fresh eyes at all that custom has dictated, and re-examines without fear or favour; it refuses to live a life based upon a Lie. And it is perhaps for this very reason that I find myself all the more terrified by where such single-mindedness leads us. For it is easy to identify the flaw of that which is based upon a lie, and reject it for that very reason; but when one cannot accept the logical consequences of something based upon Truth, the earth itself seems to open at our feet.
And Ibsen's plays offer us no respite, no consolation: they are deeply uncomfortable works, and, I think, less overtly didactic than is often thought. For while the Lie is rejected, the Truth is often seen as something that most humans cannot live with. And Ibsen populates his plays with characters who make us uncomfortable, who, indeed, terrify us, with their unflinching adherence to what they know, or believe, to be true. Take Nora in A Doll's House, for instance: at the end, she famously walks out on her husband and children, and the last sound we hear before the final curtain is the slamming of the front door. This slam, predictably, outraged Ibsen's audiences. We moderns, on the other hand, are more likely to cheer, and pat ourselves on the back for being so much more enlightened than our predecessors. Both reactions seem to me to underestimate the complexity of what Ibsen presents. For while it is true that Nora's logic is impeccable; and while it is true that her refusing to live a Lie is admirable; it is also true that deserting her beloved children will cause her immense pain, and that the children themselves, deprived so suddenly of a loving mother, will be traumatised. Pursuing the Truth at all costs may indeed be admirable, but there is also about it something that is inhuman, something not consistent with what we generally think of as human values. It is like the "ice church" in which Brand meets his end – holy and beautiful and pristine, but cold, bloodless, and remote from the warmth of humanity.
We may see this pattern repeated throughout Ibsen's plays. Dr Stockmann stands up for an important truth, but does not stop to think what this will mean for the townspeople. Of course, he could have argued against the townspeople on purely utilitarian terms – by pointing out, for instance, that failing to address immediately the issue of the polluted waters will mean storing up even greater problems for the future; but he does not make this argument. Instead, he reviles the people for failing to accept the Truth, which, for him, is by definition absolute, and sacred. In The Wild Duck, the truth-seeker is Gregers Werle, who, with the best of moral intentions, effectively plays the part of Iago, destroying what had till then been a contented marriage, and creating an environment that drives the innocent Hedwig to despair and to death. And, so certain is he of his moral righteousness, that even at the height of the tragedy he does not stop even to question his actions. Is this really the price we need to pay for Truth? – depriving small children of their mother, driving teenage girls to suicide? Ibsen's plays are populated by characters who would insist that it is – that the price for Truth, however high, is worth paying. And since this blog claims to be no more than a record of my own subjective impressions, I must admit that this terrifies me.
So what is the alternative? I think we may dismiss Dr Relling's view that we might as well live by lies, since that is the only way we may lead lives that can at least be contented. Whatever we may think of Gregers Werle, I find it hard not to agree with him when he says that if Relling's view were true, life really would not be worth living. But what about a middle way? What about compromise? What about accepting the importance of Truth, but stopping before we exceed the point where we harm ourselves by pursuing it? Ibsen had touched upon this theme of compromise before: in Ghosts, Mrs Alving, long before the dramatic action we see on stage, had been persuaded to return to her dissolute husband, and live a Lie: that is, she had been persuaded to do that which Nora (despite having been in a very different kind of marriage) had refused to do. And the results were catastrophic. In The Lady from the Sea, Ibsen returns again to the possibility of compromise, and, while the dark clouds are by no means completely banished, he finds in this a possibility, at least, of redemption: at the end of this play, very unusually for this author of deeply troubled dramatic visions, the stage fills with hope, with sunlight. But, just as the heroic and seemingly admirable refusal to stray from the Truth is fraught with immense and possibly insuperable difficulties, compromise is no easy path either: nothing can be straight-forward given our infinitely complex natures.
In the series of twelve plays stretching from The Pillars of the Community to Ibsen's last play, When We Dead Awaken – which we may think of as a cycle – The Lady from the Sea seems to me to mark something of a turning point. Although set, realistically enough, in a small town by the fjord, we seem far from the hurly-burly of public affairs, which, even in the previous play Rosmersholm, was present, albeit off-stage. We may even question to what extent the action presented may be seen as entirely realistic: elements of folklore, and of the supernatural, never seem too far away. On top of that, this is the first play in this series of plays where we find scenes outdoors. This may seem a trivial consideration, but it isn't: the setting of the scenes is always important in Ibsen, and it contributes to the feel of this play – its atmosphere, its texture, as it were – that four of its five acts are set outdoors. No longer do we feel the claustrophobia of those stuffy bourgeois drawing rooms: we are out by the fjord, in the fresh air, in the natural light of a northern summer.
In the first act, the young consumptive Lyngstrand tells of an event that had taken place some three years earlier, involving a man who, unknown to him, had played an important part in the life of the one of his listeners. Such outrageous coincidence to help the plot along had long been staple stuff of the creaky old dramaturgy that Ibsen, in the previous plays in this series, had been trying to move away from: that he is happy to include this here should really warn us that the world we are now in is not quite realistic.
In the opening scene, Ballested, a sort of Jack-of-all-Trades in the town, speaks of a picture he is painting. "The Dead Mermaid", he calls it. It depicts a mermaid who haa become stranded on land, and has died. Ibsen here is alluding to the same folk take that had inspired Hans Christian Andersen's "The Little Mermaid": a creature from the sea comes to land, and, unable to acclimatise, perishes. Ballested himself speaks of how he had acclimatised after the theatrical company he had been working for had broken up. He stutters on the word "acclimatise", thus drawing attention to it: it is an important concept in this play. This ability we have to adapt ourselves, to change in order to accommodate ourselves to our circumstances, allows us to live, and not perish like the mermaid: it may even be our saving grace. But this capacity to adapt – more importantly, perhaps, this willingness to adapt – is a quality generally in short supply in Ibsen's plays, populated as they are with unbending fanatics.
The identity of the mermaid in this play is obvious – Ellida Wangel, the Lady From the Sea herself. Like Rebecca West in Rosmersholm, she is an outsider: and, again like Rebecca, she is originally from the far north – not from the banks of a narrow fjord, as here, but from the shores of the vast, open sea. She cannot keep away from the sea: even here in the fjord, she bathes regularly, and has come to be known locally as "The lady From the Sea". But how she longs for that open sea from her younger days!
ELLIDA: Fresh? Dear God, the water here is never fresh. It's lifeless and stale. Ugh! The water is sick here in the fjord.
ARNHOLM: Sick?
ELLIDA: Yes – sick. I mean, I think it makes one sick. Poisonous too.
Of course, by this stage, we all know a symbol when we see one. Ellida's current environment is as poison to her, and she longs for the open sea of her childhood. But what exactly does that open sea represent? This is a question not even to be asked. Seeing Ellida so obviously unhappy, her husband, the kindly Dr Wangel, offers for her sake to move north, away from the environment in which he had lived all his life; but he mistakes the symbol for that which it symbolises. The narrow fjord, the open sea – these are but symbols: the underlying malaise lies deeper.
Ellida is the second wife of Dr Wangel, a man much older than her. He had been a widower when he had first met her, and when he had proposed to her, she had agreed, because, as she later explains, for no better reason than that she had not been in a position to refuse. But Ellida has never settled into life in her new home, with her husband, and with his daughters from his first marriage: she has remained detached from them all, and, while her husband is pained and concerned by her detachment, the two daughters are resentful: the elder, Bolette, not much younger than Ellida herself, generally tries to keep her dislike hidden under her polite exterior, while the younger daughter, Hilde – who, as her sister correctly intuits, secretly longs to be close to her stepmother – frequently comes close to expressing her dislike openly. Dr Wangel's first marriage had been happy, and Ellida has never come close to replacing the first Mrs Wangel in the family's affection. Nor, frankly, has she tried to: she has throughout remained remote and distant. As with Rebecca West in Rosmersholm, her new surroundings have changed her up to a point; she has, as Ballasted might put it, "acclimatised"; but it is precisely this acclimatisation that troubles her:
ELLIDA: … I've grown so very fond of him. That's what makes it so dreadful.
When she speaks these enigmatic words in the first act, it is hard to see why she should find this acclimatisation "dreadful", why she should keep herself aloof so as not to acclimatise herself further. But before the reason unravels, we find ourselves in a strange world where the real and the unreal seem to mingle. For Ellida is, quite literally, haunted.
Back in the north, where she had grown up, she had once promised herself to an American sailor. He was a mysterious figure, and, most likely, a dangerous man: he had disappeared after the captain of his ship had been found murdered, and it had been generally assumed that it was he who had been the murderer. Indeed, as Ellida reveals later, he had admitted to her that he had killed the captain, and, although he did not go into the details of the matter, gave her to understand that he had not been at fault. But he had to leave. And before he left, he promised Ellida that he would come back for her. They were, in a sense, already married: they had put their rings together on a keychain, and had thrown it far into the sea. They were married themselves to the vast, mysterious sea itself.
And he seemed to exert a strange power over her. His eyes, she claimed, changed colour with the sea itself. And this strange, dangerous man, with eyes the colour of the sea, continued to haunt her.
Three years earlier, this American sailor had, most likely, died in a shipwreck. Lyngstrand, the young consumptive who visits the Wangels, had been a sailor, and had nearly died as well in that same shipwreck. Not knowing of Ellida's connection with this man, he tells her about this American sailor they had taken on, who used to read through Norwegian newspapers, because, he said, he wanted to learn the language. But one day, he found in the papers a wedding announcement: the woman he loved has married another man. Lyngstrand had heard his howl of despair. But later, the American sailor had told him in a calm voice:
"But mine she is, and mine she will always be. And she will come to join me, even if I go as a drowned man to claim her."
And Lyngstrand, who fancies himself a sculptor, imagines a work he will create, with the deceiving woman lying asleep in bed, dreaming, while standing over her was a ghostly drowned man, still wet from the sea, returning to keep his promise.
This story naturally resonates with Ellida. For, we find out later, three years ago, when the shipwreck had happened, and while she had been pregnant with her husband's child (the child had not lived long), this ghostly drowned man did indeed come to her. And he has been visiting her ever since. And he terrifies her.
WANGEL: To think that for three years you have been in love with another man! Not with me.
ELLIDA: I don't love anyone else. Only you.
WANGEL (in a subdued voice): Then why have you refused to live with me as my wife all these years?
ELLIDA: Because I am afraid. Afraid of the stranger.
WANGEL: Afraid?
ELLIDA: Yes, afraid. The sort of fear that only the sea can give you.
We are very far now from the very realistic dramatic world Ibsen had been presenting till now. We are far even from the world of Rosmersholm, with its mythical white horses that presage doom. The setting here is realistic enough, but we have entered the realm of ghost stories, of folklore. And suddenly, all possibilities, possibilities that don't exist in strictly realistic drama, become available. As with perhaps the most famous ghost story of all, The Turn of the Screw, we must ask ourselves whether this ghost is real, or whether it is not, perhaps, an emanation of Ellida's own troubled psyche, a resurgence of her repressed desire. Of course, others too see the ghost (if ghost he is): but the creation of the mind taking on real, physical form should not surprise us from the author of Peer Gynt, a play in which reality and unreality prove infinitely malleable.
The Ghosts of Ibsen's earlier play, Gengangere – literally, "those who walk again" – had been no more than metaphorical; but here, the past takes on a palpable physical form, and the ghost literally walks again. The past cannot remain repressed: it will out. Here, that stranger with eyes like the sea does not merely haunt Ellida at nights: he keeps his promise, and comes to the town claim her. He may be a ghost; or he may be a physical manifestation of a creation of Ellida's mind. Or, more prosaically than either, he may be a living man who had, against expectations, escaped the shipwreck. In a play such as this, in which reality and unreality meld into each other, it hardly seems to matter.
Ellida is not the only one who sees the stranger. Her husband, to whom she confides, also sees her. Lyngstrand and the others see him too. Wangel's reaction is to protect her: he is her husband, after all, and, whatever the state of the marriage, it is the husband's duty to protect the wife. But things are more complicated. In the fourth of the five acts, husband and wife speak openly to each other, much as Nora and Torvald speak openly to each other in the final scene of A Doll's House. And, as in the earlier play, the wife cannot continue to live a lie, and has some serious things to say to her husband that are painful.
ELLIDA: Wangel, it's no use us going on lying to ourselves.
WANGEL: Lying?
ELLIDA: Yes. Or hiding the truth. The real truth of the matter is that you came out there and bought me.
WANGEL: Bought! Did you say bought?
ELLIDA: Oh, I wasn't any better than you. I agreed to the bargain. Left home and sold myself to you.
WANGEL: Ellida!
ELLIDA: Is there any other word for it?
And we begin to understand why Ellida had considered her acclimatising herself to become fond of her husband so "dreadful", for it was acclimatising herself to living a lie. We begin to understand also why she had remained so aloof, so detached: Ellida is at heart another of those terrifying Ibsen characters who cannot bear to live a life based on a lie. And the truth that must be acknowledged is that she had been bought, that her decision to accept Dr Wangel had not been a free decision.
WANGEL: Then have these five or six years we have lived together meant nothing to you at all?
ELLIDA: Oh no, Wangel, no! I have had everything here that anyone could wish for. But I didn't come to your home of my own free will.
The man she had promised herself to, of her own free will, is a ghost. Or maybe not. He has come to claim her. She knows nothing about him – not even, perhaps, whether he is alive. And he is most likely a murderer. It is utterly irrational for Ellida to choose such a man over a kind, loving husband like Dr Wangel. But, as with Dostoyevsky's Underground Man, Ellida would rather choose the irrational, the demonic, if only to assert her freedom to do so.
WANGEL: What do you know about him? Nothing. Not even who he is – or what he is.
ELLIDA (to herself): I know. It's just that that is so – demonic.
WANGEL It certainly is.
ELLIDA: That's why I think I must go to meet it.
WANGEL (looking at her): Because it is demonic?
ELLIDA: Yes.
WANGEL (comes closer to her): Ellida, what exactly do you mean by demonic?
ELLIDA (pauses): The demonic – is something that appals – and attracts.
Or, as she had said earlier, it inspires "the sort of fear that only the sea can give you".
And as they wait for the stranger to come again to claim his bride, Wangel's elder daughter Bolette too is being "bought". Arnholm, Bolette's former tutor and some twenty or so years older than her, proposes to her – but it is a strange sort of proposal. Throughout the play, he had been viewing her almost as if their future marriage was a given, and when Bolette speaks despairingly of being such forever in the dreary backwater, he tells her that he would be happy to prevent that happening. Bolette misunderstands him at first: she could never accept such generosity, she says. But then she realises: he is actually proposing to her. She is taken aback, and is, indeed, quite horrified by the suggestion. But he calmly goes on to explain: if she does not accept him, what future would she have to look forward to? What prospect does she have but to remain for ever in this provincial backwater, merely becoming older and lonelier? So she agrees. As with Ellida and Wangel, Arnholm buys her, and she agrees to the bargain. And we may ask ourselves, what price compromise now?
In an essay in The Cambridge Companion to Ibsen, Janet Garton speaks of a production in which Arnholm, having been accepted, strips Bolette to see what he has bought. I haven't seen this production, but this strikes me as utterly misconceived. For what Arnholm tells her is nothing but the truth. Bolette is coerced not by male brutality, but by reason – the very reason that Ellida cannot reconcile herself to. To put it bluntly, how can we claim to be truly free if our freedom must submit constantly to reason? – to that tyrant reason that brooks no dissent? Maybe, in time, Bolette too will learn to compromise; she too may acclimatise. But a union on terms so unequal that only one party needs to acclimatise is not really a proper marriage at all.
Meanwhile, the younger sister, Hilde, is fascinated with the consumptive Lyngstrand. Lyngstrand is dying, though he doesn't know it. Bolette, aware of his condition, does her best to be kind to him, even despite his comical foolishness and self-regard, and his unshakable belief that he has it in him to become a great sculptor. He tells Bolette at one point that it is a wife's duty to accommodate herself to her husband, but that the husband has no reason to reciprocate: it is the husband's part to develop his talent, and the wife's part to help him do so. (Bolette is not to know that she herself would shortly agree to just such a bargain.) But Hilde shows no such compunction with Lyngstrand. There is in Hilde a strong streak of cruelty: she is fascinated by the fact that Lyngstrand is dying, and teases him mercilessly. We haven't seen here the last of Hilde: she reappears as a major character in The Master Builder, written in 1892, just four years after The Lady from the Sea.
Marriage, Lyngstrand declares somewhat smugly, is a "miracle". Perhaps even he is not quite sure what he means by that word, but this is the very word used in the final scene of A Doll's House: in that play, Nora had said that only a "miracle" could save their marriage; and, as Torvald muses on what that word may mean, we hear the famous slam of the front door as Nora walks out. What the miracle might be, we do not know, any more than Torvald does. But in this play, a miracle does occur. The ghostly stranger re-appears, as he had said he would. Dr Wangel tries at first to protect his wife, but he knows it is no use; and, in one of the most moving moments in all dramatic literature, he gives his wife the freedom she had so long yearned for – complete freedom, to choose, as she wills. "With all your heart?" she asks him, astonished. "Yes, I mean it," he replies, "with all my heart." With all his suffering heart. "Who chooseth me shall give and hazard all he hath," said the leaden casket in The Merchant of Venice, and Dr Wangel, the stolid, respectable, bourgeois doctor, becomes the most unlikely of dramatic heroes: he gives and hazards all he has, and it is indeed heroic. And this is the miracle that Nora did not find, and Ellida did not expect. But once she has the freedom, she knows what her choice is. The ghostly stranger now loses his power over her: no longer can he terrify. It is as if a weight from Ellida's troubled psyche has been lifted, and she is troubled no more. The ghost's exit is almost an anti-climax. And, in the closing moments, the play fills with light. Wangel has given her freedom; he has offered not merely to compromise, but to give up everything he has, everything, for her sake. So now, she can reconcile herself to "acclimatising": it is no longer a "dreadful" thing. Ibsen is not an author we normally associate with joy, but here is little in all dramatic literature to match the what we find at the end of this play.
But this is not, of course, by any means Ibsen's last word. In the course of the journey to this ending, some very dark clouds have been seen, and they aren't going to go away. There is a long way to go yet. Only two years after The Lady from the Sea, Ibsen brought us back down to earth with the uncompromisingly grim and claustrophobic Hedda Gabler. But let's keep that one till later.
I wonder if anyone remembers the game of "slaps". Or indeed, if anyone has encountered it at all. I'm sure mine wasn't the only school in which boys – and it was only boys, girls being presumably too sensible – who played this game. But when I was about 11 or 12, and possibly even older, this game was all the rage. Let me explain.
Two boys would stand facing each other, their hands held out, palms joined as if in prayer. One boy is nominated the slapper, and the other – I suppose – the slappee. That is, one does the slapping, and the other gets slapped. The slapper then gets to slap the hands of the slappee as often as he likes, and as hard as he likes. However, if the slappee moves his hands away I n time, and the slapper misses, then roles change: the slappee becomes the slapper, and the boy who had been the slapper now has to take the slaps.
There are further complications. The slapper can make false moves, that is, make out he is going to slap, but keep his palms in contact with each other. And if the slappee moves his hands away while the slapper still has his palms together, then the slapper gets a "free slap" – that is, the slapper gets to slap the slappee's hands, and this time, the slappee does not have the option of moving his hands away: he has to stand there and take it.
And so the game continued, indefinitely, free slaps and all, roles changing with every missed slap.
I'm not sure what the attraction was of this game, but we played it anyway, despite strict instructions from our teachers not to. And after the breaks, we would return to class, our hands red and raw with being slapped, but determined nonetheless to continue as soon as class finished.
Presumably, you are probably thinking, I am leading up to finding some sort of parallel with this game that will throw some light on some aspect of our lives. Sadly, no. I did think long and hard to find some way to metaphorise this – that is, to find something for which the game of slaps could serve as a metaphor – but I couldn't really come across anything too convincing. The only reason I mention this game of slaps at all is because, reminiscing on the past (as one tends to do at New Year), memories of this long-forgotten game suddenly emerged out of nowhere and flooded my mind, and made me laugh quite immoderately.
So, a pointless post, I suppose. As pointless as the game itself. Possibly, as I slip into old age, there will be many more such pointless posts. Well, why not? It gets so tiresome trying to make points all the time.
So here's to another new year, where, hopefully, I may try, at least, to mingle at least a few pointful posts with all the pointless. Happy New Year, everyone!
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 4,011
|
import functools
import inspect
from oslo_utils import excutils
import six
import nova.conf
from nova.notifications.objects import base
from nova.notifications.objects import exception
from nova.objects import fields
from nova import safe_utils
CONF = nova.conf.CONF
def _emit_exception_notification(notifier, context, ex, function_name, args,
binary):
_emit_legacy_exception_notification(notifier, context, ex, function_name,
args)
_emit_versioned_exception_notification(context, ex, binary)
def _emit_versioned_exception_notification(context, ex, binary):
versioned_exception_payload = exception.ExceptionPayload.from_exception(ex)
publisher = base.NotificationPublisher(context=context, host=CONF.host,
binary=binary)
event_type = base.EventType(
object='compute',
action=fields.NotificationAction.EXCEPTION)
notification = exception.ExceptionNotification(
publisher=publisher,
event_type=event_type,
priority=fields.NotificationPriority.ERROR,
payload=versioned_exception_payload)
notification.emit(context)
def _emit_legacy_exception_notification(notifier, context, ex, function_name,
args):
payload = dict(exception=ex, args=args)
notifier.error(context, function_name, payload)
def wrap_exception(notifier=None, get_notifier=None, binary=None):
"""This decorator wraps a method to catch any exceptions that may
get thrown. It also optionally sends the exception to the notification
system.
"""
def inner(f):
def wrapped(self, context, *args, **kw):
# Don't store self or context in the payload, it now seems to
# contain confidential information.
try:
return f(self, context, *args, **kw)
except Exception as e:
with excutils.save_and_reraise_exception():
if notifier or get_notifier:
call_dict = _get_call_dict(
f, self, context, *args, **kw)
function_name = f.__name__
_emit_exception_notification(
notifier or get_notifier(), context, e,
function_name, call_dict, binary)
return functools.wraps(f)(wrapped)
return inner
def _get_call_dict(function, self, context, *args, **kw):
wrapped_func = safe_utils.get_wrapped_function(function)
call_dict = inspect.getcallargs(wrapped_func, self,
context, *args, **kw)
# self can't be serialized and shouldn't be in the
# payload
call_dict.pop('self', None)
return _cleanse_dict(call_dict)
def _cleanse_dict(original):
"""Strip all admin_password, new_pass, rescue_pass keys from a dict."""
return {k: v for k, v in six.iteritems(original) if "_pass" not in k}
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 483
|
I ceratosauridi (Ceratosauridae) sono una famiglia di grossi dinosauri carnivori caratteristici del Giurassico e del Cretaceo.
Primitivi carnivori cornuti
Noti soprattutto per il loro genere tipo (Ceratosaurus), questi animali erano dei carnivori bipedi dotati di un cranio robusto sul quale erano presenti strutture simili a brevi corna. Fino a qualche decennio fa, i ceratosauridi erano considerati stretti parenti dei più famosi allosauri, ma alcune caratteristiche primitive (ad esempio la mano a quattro dita) li pongono al di fuori del gruppo dei tetanuri. Ora i ceratosauridi sono considerati dei teropodi primitivi che, dopo essersi diffusi in Africa e in Nordamerica, hanno probabilmente dato origine al gruppo ben più diversificato degli abelisauroidi.
Distribuzione
La famiglia dei ceratosauridi comprende, oltre a Ceratosaurus del Giurassico superiore nordamericano, anche Genyodectes del Cretaceo inferiore del Sudamerica. Elaphrosaurus e Spinostropheus, due carnivori dalla struttura gracile vissuti in Africa, potrebbero essere forme ancestrali alla famiglia. È possibile che anche il ben più antico Lukousaurus, del Giurassico inferiore della Cina, appartenga a questo gruppo. Un'altra forma cinese, Chuandongocoelurus del Giurassico medio, potrebbe essere stata simile a Elaphrosaurus. Altri resti frammentari, che potrebbero testimoniare l'esistenza di ceratosauridi giganteschi ("Megalosaurus" ingens), sono stati rinvenuti in Africa orientale, negli strati di Tendaguru.
Altri progetti
Collegamenti esterni
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 7,803
|
Degree Programs in Family Science
NCFR maintains a comprehensive list of accredited institutions in the U.S. and Canada. Find the institution(s) that offer the areas of study, degrees, and accreditation that fit you best.
If you have a question pertaining to the Certified Family Life Educator (CFLE) credential, please email Maddie Hansen, NCFR's certification coordinator.
For Degree Program Administrators:
Do you need to make a change to your degree program listing? Use this webform to submit your change.
Would you like to add your degree program to our guide? Email Dawn Cassidy.
For more precise search results when searching for an institution, try using a key term from the institution's name (e.g. Missouri when looking for the University of Missouri) or writing the entire name of the institution in quotation marks (e.g. "University of Missouri").
(-) 1
(-) al
Facet Facet: State - Accredited Institution
Facet Facet: Program Options - Accredited Institute
Child or Adolescent Science/Studies - Undergraduate
Development (Child, Human, or Family) - Doctoral
Development (Child, Human, or Family) - Master's
Development (Child, Human, or Family) - Undergraduate
Early Childhood - Undergraduate
Family Science/Studies - Doctoral
Family Science/Studies - Master's
Family Science/Studies - Undergraduate
Older Adults (Gerontology) - Undergraduate
Therapy (Couples, Marriage, or Family) - Master's
Facet Facet: Areas of Study - Accredited Institution
Showing 1 - 5 of 5 Resource(s)
Search Degree Programs
Accredited Institute
University of Montevallo
The University of Montevallo Family & Consumer Sciences program was not only the first program of its kind in the State of Alabama, but was also one of the first programs in the entire Southeast to achieve accreditation through the American Association of Family and Consumer Sciences. Our curriculum has pioneered fields including vocational and retail home economics, institutional management, as well as child development throughout the state and region. Further, our program empowers individuals and families across the lifespan to manage the challenges of living and working in a diverse global society. If you are interested in pursuing a degree in this strongly interdisciplinary and highly practical, field, the University of Montevallo is the right place!
CFLE Approved
The Human Development and Family Science major recognizes the crucial role of families in society. The curriculum focuses on personal relationships and their connection to and impact on human living and development. The program continues to hold to their motto, "Enriching the lives of families through education, service and advocacy." Since 1999 the family studies curriculum has met the requirements for the Provisional Certified Family Life Educator (CFLE) designation awarded by the National Council on Family Relations (NCFR). The program is designed to prepare students for professional careers in the helping professions, in human service agencies, the non profit sector, or for graduate school and research. Career options include family life education, parenting education, helping professions, elder care services, family and social services, child development, youth ministry, and education. A significant portion of our students plan to attend a master's degree program in areas such as family law, social work, marriage and family therapy, counseling, early childhood education, occupational therapy and seminary.
The Department of Human Development and Family Studies offers two majors. One in Early Childhood Education and one in Human Development and Family Studies. The major in Human Development and Family Studies has concentrations in Child Life, Family Studies, and Adolescence and Youth. The Department also offers a minor in Addictions in Families. The concentration in family studies provides an understanding of the development of the family system and the dynamics of family relationships. It leads to certification as a Family Life Educator by the National Council on Family Relations. This concentration prepares students to work in a variety of educational and enrichment programs such as parenting programs, family service agencies, industry, schools, social-service, churches, home economics, and 4-H extension. This concentration is also well suited for students interested in pursuing graduate degrees in marriage and family therapy as well as other areas in family studies.
The Department offers a master's degree in human development and family studies with concentrations in Human Development and Family Studies, Marriage and Family Therapy, and Parent and Family Life Education. The Parent and Family Life Education program leads to certification as a Family Life Educator by the National Council on Family Relations. The Department also collaborates with the Department of Psychology to offer doctoral study in Developmental Science.
The Auburn University Department of Human Development and Family Studies is an interdisciplinary program committed to advancing and applying knowledge about individuals and families in a changing world. The Department operates the Center for Children, Youth, and Families that includes the Auburn University Early Learning Center and the Harris Early Learning Center of Birmingham, both accredited by the National Association for the Education of Young Children, and the Marriage and Family Therapy Center. The objective of these centers is to enhance the instruction/service learning, research, and outreach missions of the Department. Further, The Alabama Cooperative Extension System provides the infrastructure to enable the researchers and practitioners affiliated with the Department and its Centers to disseminate knowledge to the citizens of Alabama, the nation, and the world.
University of North Alabama
The Department of Sociology and Family Studies offers an undergraduate major in Sociology leading to a Bachelor of Arts or Bachelor of Science degree. Within the major, the department offers coursework leading to the provisional designation of Certified Family Life Educator (CFLE), concentrations in Gerontology and Criminology, and minor programs in Sociology and Family Studies. The department also offers an online degree in Sociology. At the graduate level, the department offers an online Master of Science in Family Studies.The department aims to prepare students for the many occupations in human services, health care, personnel management, government, and the justice system for which preparation in sociology, family studies, gerontology, and criminology are appropriate, or for advanced study in graduate and professional schools leading to teaching and research position.
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 1,488
|
(4 February 2019 - ArianeGroup) Prometheus is an ESA program, initiated with the French space agency CNES (Centre National d'Etudes Spatiales). The contract awarded to ArianeGroup by ESA in December 2017 covers the design, construction and testing of the first two examples of the very low cost engine demonstrator, which uses liquid oxygen and methane technology and is potentially reusable.
ArianeGroup develops and supplies innovative and competitive solutions for civil and military space launchers, with expertise in all aspects of state-of-the-art propulsion technologies. ArianeGroup is lead contractor for Europe's Ariane 5 and Ariane 6 launcher families, responsible for both design and the entire production chain, up to and including marketing by its Arianespace subsidiary, as well as for the missiles of the French oceanic deterrent force. ArianeGroup and its subsidiaries enjoy a global reputation as specialists in the field of equipment and propulsion for space applications, while their expertise also benefits other industrial sectors. The group is a joint venture equally owned by Airbus and Safran, and employs approximately 9,000 highly qualified staff in France and Germany. Its 2017 revenues amounted to 3.4 billion euros.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 349
|
Baldry's Out! è il nono album di Long John Baldry, pubblicato nel 1979 dalla Casablanca Records.
Tracce
Baldry's Out (Intro)
Baldry's Out (Long John Baldry)
Stealer (Andy Fraser, Rodgers, Phil Spector)
Lonely Night
You've Lost That Lovin' Feelin' (Mann, Spector, Weil)
Come and Get Your Love (Ballard)
Find You (L.J.Baldry, Young)
Like a Dog
Thrill's a Thrill (Amesbury)
So Sad
Darlin' (Blandamer)
Musicisti
Long John Baldry - voce
Kathi McDonald - voce su traccia 5
Roy Young - organo, voce
Mick Clarke - chitarra
James Lee Fish - basso
Jimmy Horowitz - organo
Michael Iceberg - sintetizzatore
Jeff Seitz - batteria
Ray Warleigh - sassofono
Collegamenti esterni
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 1,692
|
Q: Casbah Scala MongoDB driver - a strange error I am trying to use Casbah, I get a strange error right in the beginning, on this line:
val mongoDB = MongoConnection("MyDatabase")
the error on MongoConenction says:
class file needed by MongoConnection is missing. reference type
MongoOptions of package com.mongodb refers to nonexisting symbol.
I do not know what to do with this. The jars that I have attached to my projects are:
casbah-commons_2.9.1-3.0.0-SNAPSHOT.jar
casbah-core_2.9.1-3.0.0-SNAPSHOT.jar
casbah-gridfs_2.9.1-3.0.0-SNAPSHOT.jar
casbah-query_2.9.1-3.0.0-SNAPSHOT.jar
casbah-util_2.9.1-3.0.0-SNAPSHOT.jar
which looks like a full setup of Casbah and I do not understand what it might be yearning for. So there is the question number one - what do I have to do to resolve this problem?
The question number two is - the Casbah tutorial says that I could import just one thing, and get the mongoConn() method, which is also not truth. The mongoConn() simply does not get found if I follow the instructions. So, how can I acheive that everythong works as in the tutorial?
A: I don't know the details of your setup, but it seems like you are not referencing the dependencies of the casbah-commons module.
According to the docs, those are:
mongo-java-driver, scalaj-collection, scalaj-time, JodaTime, slf4j-api
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 5,050
|
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
#error "Only <glib-object.h> can be included directly."
#endif
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GClosure, g_closure_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 9,601
|
\section{Introduction}
\label{sec:intro}
\subsection{The DRAGON Facility}
\label{subsec:dragon}
Radiative capture reactions typically involve the absorption of a light nucleus (typically a proton or an $\alpha$ particle) by a heavy one, followed by $\gamma$-ray emission. These reactions are important in a variety of astrophysical scenarios such as novae~\cite{PhysRevLett.110.262502, PhysRevLett.105.152501, PhysRevC.81.045808, PhysRevLett.96.252501, PhysRevLett.90.162501, PhysRevC.88.045801}, supernovae~\cite{PhysRevC.76.035801}, X-ray bursts~\cite{6208cab5983b4072a365e4e3c7079eed, 0004-637X-735-1-40}, and quiescent stellar burning~\cite{PhysRevLett.97.242503, Schurmann2011557}. They are often difficult to study directly in the laboratory. The cross sections are low, typically on the order of picobarns to millibarns, since the relevant energies are below the Coulomb barrier. Additionally, many interesting reactions involve short-lived nuclei and can only be studied using low-intensity radioactive beams.
The \ac{DRAGON} facility at {\sc Triumf}{}~\cite{Hutcheon2003190}, shown in \figref{fig:dragon}, is a recoil mass separator that was built to study radiative capture reactions using stable and radioactive beams from the \allcaps{isac}-\allcaps{i}{}~\cite{Laxdal2003400} facility. \ac{DRAGON} experiments are typically performed in inverse kinematics with a beam of the heavy nucleus impinging on a windowless gas target containing the lighter one. Beam energies range from $E/A = 0.15$--\meas{1.5}{MeV}. The products of radiative capture (recoils) are transmitted through \ac{DRAGON} and detected in a series of charged particle detectors, while unreacted beam and other products are deposited at various points along the separator's flight path. The recoil detectors consist of a pair of \acp{MCP} to measure local \ac{TOF}~\cite{Vockenhuber2009372} and either a \ac{DSSSD}~\cite{Wrede2003619} or an \ac{IC} to measure energy loss. The $\gamma$ rays resulting from radiative capture are detected in an array of $30$ \ac{BGO} detectors surrounding the target.
For beam normalization, the target chamber houses two \ac{IIS} detectors to record elastically scattered target nuclei. In a typical experiment, the scattering rates measured in the \ac{IIS} detectors are normalized to hourly Faraday cup readings of the absolute beam current. Experiments using low-intensity and possibly unpure radioactive beams may also include a pair of \ac{NaI} scintillators, a \ac{HPGe} detector, or both. These auxiliary detectors are located near the first mass-dispersed focus, and they detect the $\gamma$ rays resulting from the decay of radioactive beam deposited onto the nearby slits. This allows a continuous determination of the beam rate and composition throughout the experiment.
In many experiments, unreacted, scattered, or charge-changed beam particles (``leaky beam'') are transmitted to the end of \ac{DRAGON} along with the recoils of interest. The rates vary depending on experimental conditions but can potentially be as much as a few thousand times the recoil rate~\cite{EPJNe20}. Hence, it is crucial that leaky beam be separable from recoils in the data analysis. In some cases, separation is possible using the signals from recoil detectors alone. In others, it is necessary to require (delayed) coincidences between the heavy ion and a $\gamma$ ray measured in the \ac{BGO} detectors. In such experiments, a measurement of the \ac{TOF} between the $\gamma$ ray and the heavy ion (``separator \ac{TOF}'') is useful for distinguishing genuine coincidences from random background.
\begin{figure}
\centering
\includegraphics{dragon2.eps}
\caption{The \ac{DRAGON} facility at {\sc Triumf}{}.}
\label{fig:dragon}
\end{figure}
\subsection{Data Acquisition Requirements}
\label{subsec:daq}
As mentioned, identification of coincidences between the ``head'' ($\gamma$-ray) and ``tail'' (heavy-ion) detectors is important for many \ac{DRAGON} experiments. As a result, the original \ac{DRAGON} \ac{DAQ} was designed to trigger on singles events from either detector system while also identifying coincidences from hardware gating. The resulting trigger logic was rather complicated and required a moderate amount of hardware reconfiguration when changing the detector setup (for example, swapping the \ac{DSSSD} and \ac{IC}). With this system, the potential for logic problems due to human error or faulty modules was relatively high, resulting in the possibility of wasted beam time or otherwise non-optimal data sets.
In order to alleviate the problems associated with the existing coincidence logic, we have designed and implemented a new \ac{DAQ} system for \ac{DRAGON} that identifies coincidences from timestamps instead of hardware gating. In the course of doing this, we have also upgraded the digital readout from a \ac{CAMAC} system to \ac{VME} and migrated part of the trigger logic from \ac{NIM} hardware to a \ac{FPGA}. In the new set\-up, the head and tail systems are triggered and read out completely independent of each other, and coincidences are identified in the analysis stage from timestamp matching.
In this paper, we provide an overview of the new DRA\-GON \ac{DAQ} system and data analysis codes. We also discuss the results of the \ac{DAQ} commissioning experiment, which consisted of a measurement of the $E_{\text{c}.\text{m}.} = 1113$ keV resonance strength in the \rxnfull{20}{Ne}{p}{\gamma}{21}{Na} radiative proton capture reaction.
\section{Trigger Logic}
\label{subsection:triggerlogic}
\begin{figure}
\centering
\includegraphics{io32.eps}
\caption{Diagram of the generic \allcaps{io32}{} \ac{FPGA} logic. See the text for further explanation.}
\label{fig:io32}
\end{figure}
The majority of the \ac{DRAGON} trigger logic and timestamping functionality is implemented in \ac{FPGA} firmware. For this we use an \allcaps{io32}{}, a general purpose \ac{VME} board designed and manufactured at {\sc Triumf}{}~\cite{NIMIO32}. The \allcaps{io32}{} houses an Altera Cyclone-I \ac{FPGA}~\cite{AlteraCyclone} and has input-output capabilities via sixteen \ac{NIM} and sixteen \ac{ECL} input channels and sixteen \ac{NIM} outputs. It also houses a \meas{20}{MHz} quartz oscillator crystal with an accuracy rating of $20$ parts per million.
The \ac{FPGA} logic is designed in a generic way, allowing identical firmware to be used for both the head and tail systems. A diagram of the \ac{FPGA} logic is shown is \figref{fig:io32}. \eclins{0}{11} accept trigger signals from various detectors and are all routed into a firmware scaler for rate counting, as are \nimins{0}{3}. \eclins{0}{8} are also sent through a programmable bitmask, and the \logical{or} of the unmasked channels is sent to \nimout{7} which is then routed into either \nimin{2} or \nimin{3}. The \logical{or} of \nimin{2} and \nimin{3} is combined with an internal \logical{not} \logical{busy} condition to generate a system trigger. This causes a logic pulse to be emitted from \nimout{4}, and this is then routed back into \nimin{1} which tells the system to begin acquiring data. The input of \nimin{1} is also sent to a \ac{FIFO} data structure that stores the \ac{TSC} value denoting when the signal arrived. These data are used for coincidence matching in the analysis stage, as explained in \secref{sec:coincmatch}. The signal from \nimout{4} is also sent to the other system (head to tail or vice-versa). There it is connected to \nimin{0} which is also routed into the \ac{TSC} \ac{FIFO}.
A system trigger also results in signals being sent from \ac{NIM} outputs $1,$ $5,$ and $6.$ \nimout{1} emits a ``busy'' signal that remains true until cleared by a \ac{VME} register setting. This signal is not necessary to run the system, but it is often useful for debugging purposes. \nimout{5} emits a logic pulse after a programmable time delay. This pulse is sent to the system's \ac{TDC} to act as the stop signal\footnote{
In reality, it is not a ``stop'' that is sent to the TDC, but rather a ``trigger'' signal that must come after all of the measurements in the corresponding event. See \citeref{CAENv1190} for more details.
}.
\nimout{6} emits a pulse of programmable width which is used to gate the system's \ac{ADC} or \ac{QDC}. The \allcaps{io32}{} firmware also includes a programmable pulse generator. This is a square wave of programmable frequency emitted from \nimout{2}.
The \ac{TSC} is run off a clock with \meas{20}{MHz} nominal frequency. Its size is $38$ bits, allowing \meas{\sim 3.8}{hours} of run time before it rolls over. The acquisition software also keeps track of any roll over in the $38$-bit counter, allowing the system to run indefinitely.
The exact clock frequency is set either by the quartz crystal housed on the \allcaps{io32}{} board or by a signal with two times the desired clock frequency (i.e., a nominal frequency of $40$ MHz) sent into \nimin{5}. The \ac{TSC} value can be reset to zero either by writing to a \ac{VME} register or by sending a pulse to \nimin{4}. Zeroing by the \ac{VME} method causes a signal to simultaneously be emitted from \nimout{0}. Multiple boards can be run in master-slave configuration where the master is clocked off its local quartz oscillator and the slave(s) are clocked off the $40$ MHz output of the master. In this setup, the master clock is zeroed by \ac{VME} and the slave(s) by a pulse sent from \nimout{0} of the master. The result is a frequency synchronization and zero-point matching which differs only by the transit time of the zero-reset pulse (which is typically negligible). The \ac{DRAGON} system is run in such a master-slave configuration, with the head \allcaps{io32}{} arbitrarily designated the master and the tail the slave.
\begin{figure}
\centering
\includegraphics{triggerlogic-noio32.eps}
\caption{Diagram of the timestamp-based \ac{DRAGON} trigger logic. See the text for more explanation.}
\label{fig:triggerlogic}
\end{figure}
A diagram of the specific trigger logic used in the \ac{DRAGON} head and tail systems is shown in \figref{fig:triggerlogic}. On the head side, the anode signals from the $30$ \ac{BGO} detectors are split into analog and logic branches. The analog branch is sent through a physical time delay before going to the input of a {\sc Caen}{} \caenv{792} \ac{QDC}~\cite{CAENv792} . The length of the time delay is set such that the signals arrive at the \ac{QDC} more than \meas{15}{ns} after the leading edge of the gate pulse, as required by the \ac{QDC} specifications. Signals in the logic branch are sent to a pair of {\sc Caen}{} \caenv{812} \acp{CFD}~\cite{CAENv812}. The channel-by-channel \ac{CFD} outputs are sent to the inputs of a {\sc Caen}{} \caenv{1190} \ac{TDC}~\cite{CAENv1190}, and the \logical{or} outputs are sent to \eclin{0} and \eclin{1} to generate the system trigger and associated signals (\ac{QDC} gate and \ac{TDC} trigger). A copy of the system trigger is sent to a measurement channel of both the head and tail \acp{TDC}, to facilitate a measurement of separator \ac{TOF}.
On the tail side, the trigger is essentially an \logical{or} of each of the heavy-ion detectors mentioned in \secref{subsec:dragon}. The outputs of each heavy-ion detector are sent through some combination of amplifiers, shapers, and discriminators (whose exact configuration varies and is outside the scope of this paper) until there is an analog signal suitable for amplitude measurement and a digital signal suitable for triggering and timing.
The analog signals are sent to the inputs of a {\sc Caen}{} \caenv{785} \ac{ADC}~\cite{CAENv785}, possibly after a physical time delay to place them within the \ac{ADC} gate. The logic signals are sent to measurement channels of a {\sc Caen}{} \caenv{1190} \ac{TDC} and to \eclins{0}{7} to create the system trigger, \ac{ADC} gate, and \ac{TDC} trigger signals. As with the head system, a copy of the system trigger is sent to measurement channels of both the head and tail \acp{TDC}, resulting in a redundant measurement of separator \ac{TOF}. In some cases, logic signals from detectors that measure incoming beam rates or composition (\ac{IIS}, \ac{NaI}, and \ac{HPGe}) may be downscaled to reduce the total trigger rate and, correspondingly, the dead time.
In both systems, a copy of the $11.8~${}MHz \allcaps{isac}-\allcaps{i}{} \ac{RF} accelerator signal is sent to the \ac{TDC} to be used as an additional timing reference. To avoid swamping the TDC buffers with \ac{RF} pulses, the signal is gated by an adjustable-width copy of the system trigger. Typically, the gate width is set large enough that three full RF pulses are captured for every event.
\section{Data Acquisition and Analysis}
\label{subsection:analysis}
The data acquisition and online data analysis codes are both implemented as part of the \ac{MIDAS} framework~\cite{ritt1997midas}. The acquisition code is implemented in C{}\texttt{++}{} and employs device driver codes that are widely used at {\sc Triumf}{}~\cite{daqplone}. \ac{MIDAS} transition handler priorities are used to specify the order of head and tail initialization routines at the beginning of each data-taking run. This ensures that operations which are required for timestamp matching, such as \ac{TSC} zeroing, are performed in the necessary order.
The analysis codes are also written in C{}\texttt{++}{} and are designed such that they can be used for both online and offline analysis using the {\sc Root}{} data analysis framework~\cite{Brun199781}. Each individual detector in the system is represented in a C{}\texttt{++}{} class, with data fields corresponding to the available measurement parameters. The various detectors in the head and tail systems are then composed into a larger class. For coincidence events, the head and tail classes are further combined as members of a single coincidence class. Such a design facilitates easy integration into the {\sc Root}{} framework, with the class hierarchy naturally transforming to branches and sub-branches in a {\sc Root}{} tree. The entire analysis suite, including the complete development history, is hosted in an online repository that is publicly viewable \cite{dragonGithub}.
\subsection{Coincidence Matching}
\label{sec:coincmatch}
\begin{figure}
\centering
\includegraphics{tsmatch.eps}
\caption{Diagram of the coincidence matching algorithm. See the text for more information.}
\label{fig:tsmatch}
\end{figure}
With the shift in coincidence tagging from the hardware to the analysis phase of the experiment, it was necessary to develop an algorithm that is capable of accurately identifying coincidence events in both an online and an offline environment, for all possible trigger rates. The particulars of the MIDAS system create some challenges for online identification of coincidences. In MIDAS, event data are transferred from the ``frontend'' \ac{VME} processor to the ``backend'' analysis computer via a gigabit ethernet connection. For efficiency reasons, transfers are made only once per second, with events buffered locally in the \ac{VME} processor in between. As a result, events from the head and the tail frontends arrive at the backend asynchro\-nously. This is because the time of arrival is dictated by when the frontends are ready to send a packet of events, not the actual trigger time of any given event. Thus the coincidence matching algorithm must ensure that events with arrival times differing by up to two seconds can still be tagged as coincidences.
A diagram of the coincidence matching algorithm is shown in \figref{fig:tsmatch}. Events from both the head and the tail frontend are placed into a buffer which orders the events based on their trigger time as measured by the TSC FIFO. Whenever a new event is placed into the buffer, the trigger time difference between the earliest and the latest event in the buffer is calculated. If this difference is greater than some set value (the default setting is four seconds), then the entire queue is searched for coincidence matches with the earliest event. Here, a match is defined as any two events whose timestamps are within $10~\mu$s of each other. Regardless or whether or not a match is found, the earliest event is sent to a singles event processor which calculates all of the necessary singles parameters and sends the event on to the next stage of analysis (which is typically either histogramming, writing to disk, or both). After this, the event is removed from the buffer. If a coincidence match \emph{is} found, the matching events are also sent to a coincidence event processor. Note that in the case of coincidences, only the earliest event is removed from the buffer. The other event will remain until it becomes the earliest event, at which time it will be analyzed as a singles event and then removed.
In practice, an \code{std::\allowbreak{}multiset} from the C{}\texttt{++}{} standard library~\cite{cppstdlib} is used as the event buffer. This container automatically maintains sorting between elements, which results in very efficient searches for coincidence matches. Furthermore, the automatic sorting naturally lends itself to checking the time difference between the earliest and the latest event in the buffer. It also allows for multiple coincidences to be stored and tagged. This is not necessary at present since the dead times render multiple coincidences (within a $10~\mu$s window) impossible. However, it allows for easy expansion of the algorithm should multiple coincidences ever become possible. The performance of the \code{std::\allowbreak{}multiset} was checked against a variety of other options, including a \code{std::\allowbreak{}vector} and \code{std::\allowbreak{}deque} which are resorted after every insertion and an unordered hash container, \code{boost::\allowbreak{}unordered\_multiset}~\cite{boosttr1}. The sorted \code{std::\allowbreak{}deque} performed similarly to the \code{std::\allowbreak{}multiset} for small objects. However, for objects the size of a real event, the additional copy operations involved in the resorting reduce performance significantly. The performance of the \code{std::\allowbreak{}multiset} was slightly worse than the \code{boost::\allowbreak{}unordered\_multiset} in terms of searching for coincidence matches. However, the difficulties associated with a lack of ordered elements in the latter container, as well as its reliance on non-standard libraries, do not justify the small performance increase.
\subsection{Live Times}
\label{sec:livetime}
To correctly measure the yield of a reaction, it is necessary to correct the number of recorded events for the live time of the \ac{DAQ}. This can be done by determining the fraction of time, $L$, during which the acquisition is open to new triggers. The real number of events, $N$, is then equal to the number of recorded events, $n$ divided by $L$,
\begin{equation}
\label{eq:livetime}
N = n / L.
\end{equation}
In conventional systems with non-paralyzable dead times, $L$ can be determined simply from the sums of recorded scaler counts. For example, if it is possible to count the number of presented and accepted triggers, then $L$ is simply given by
\begin{equation}
\label{eq:livetime_scaler}
L = N_{\text{acq}} / N_{\text{pres}}.
\end{equation}
In the \ac{DRAGON} \ac{DAQ}, there are two free-running systems with independent singles live times. For each of the singles triggers, the live time corrections can be made by the method outlined above. However, for coincidences this is not possible since coincidence tagging is performed at the analysis stage, making it impossible to count the rate of presented coincidences in a scaler alone.
The lack of an available method for counting presented coincidences means that other methods must be employed to determine live time corrections. One option is to directly measure the busy time associated with each recorded event, that is, to record how long the \ac{DAQ} is blind to incoming triggers on an event-by-event basis. This is part of the standard operating procedure for the \allcaps{io32}{}, which calculates the total busy time for each event from \ac{TSC} measurements and stores it in the data stream. For systems with a non-paralyzable dead time response and reactions generated as a random Poisson process, the number of events lost due to dead time, $n_{\text{lost}}$, is given by
\begin{equation}
\label{eq:nlost}
n_{\text{lost}} = \lambda \sum_{i=0}^{n} \tau_i = \lambda \tau,
\end{equation}
where $n$ is the total number of \emph{recorded} events; $\lambda$ is the rate of \emph{generated} events; $\tau_i$ is the busy time associated with a given event $i$; and $\tau$ is the sum of all busy times across a run. The number of generated events, $N$, over the total run time $T$ is then given by
\begin{eqnarray}
N &=& n + n_{\text{lost}} \label{eq:ntot1} \\
&=& n + \lambda \tau \label{eq:ntot2} \\
&=& n + \left( N / T \right) \tau \label{eq:ntot3} \\
&=& \frac{n}{1 - \tau / T}. \label{eq:ntot4}
\end{eqnarray}
From \eqnref{eq:ntot4}, it is straightforward to calculate the number of generated events from the number of recorded events, the measured dead times, and the total run time. Alternatively, it is possible to define the live time fraction as
\begin{equation}
\label{eq:livetime1}
L = 1 - \tau / T
\end{equation}
and then to use \eqnref{eq:livetime} to calculate $N$.
For a singles analysis, $\tau$ can simply be calculated as the sum of the individual $\tau_i$ over all events. For coincidences, however, more care is required to calculate $\tau$ correctly. There are three classes of possibilities regarding the loss of coincidence events due to dead time:
\begin{enumerate}
\item The event arrives when neither the head nor the tail is busy: the event will be recorded and tagged as a coincidence. \label{enum:coinc1}
\item The event arrives when either the head or the tail is busy, but not both: half of the event will be recorded and tagged as singles.\label{enum:coinc2}
\item The event arrives when both the head and the tail are busy: the event will not be recorded at all.\label{enum:coinc3}
\end{enumerate}
In terms of correcting recorded coincidence events for dead time losses, both cases \eqref{enum:coinc2} and \eqref{enum:coinc3} should count as a loss. Thus $\tau$ should be the total time during which the \emph{head or the tail} is busy (note that this is a true logical \logical{or} as opposed to the exclusive \logical{or} of case \eqref{enum:coinc2}). To calculate $\tau$ for coincidence events, we employ an algorithm which stores the ``start'' and ``stop'' times of all busy periods from both \ac{DAQ}{}s, sorted by their start times. The algorithm then iterates through the list, identifies any cases of overlapping head and tail busy periods, and calculates the sum of busy times with the overlaps removed.
\subsubsection{Non-Poisson Events}
\label{sec:nonpoisson}
\newcommand{\isumfrac}{
\frac{
\sum_{i=0}^{n} \int_{0}^{\tau_i} R\of{t} \der t
}{
\int_{0}^{T} R\of{t} \der t
}
}
The live time analysis presented in Eqns.~\eqref{eq:ntot1}--\eqref{eq:ntot4} is only valid when the rate of generated events is a Poisson process. This is usually the case when studying nuclear reactions such as radiative capture since the underlying physics adhere to Poisson statistics. However, in beam-based experiments such as those at \ac{DRAGON}, the reaction rate is governed by the underlying physics of the reaction, the rate of the incoming beam, and the target density. In cases where the beam rate (or target density) is fluctuating, the rate of occurrence of reactions becomes non-Poisson. Instead, the rate becomes an inhomogenous Poisson process, that is, one where the rate is time dependent. The expected number of events in a interval $[0,~ \tau]$ is then given by
\begin{equation}
\label{eq:inhomogenous_poisson}
\int_{0}^{\tau} \lambda \left( t \right) \der t.
\end{equation}
In an experiment, the time rate of reactions (assuming constant target density) is determined by the yield per incoming beam particle, $Y=N/N_b$, which is a constant, and incoming beam rate as a function of time, $R\of{t}$:
\begin{equation}
\label{eq:tdrate}
\lambda\of{t} = \frac{N}{N_b} R\of{t}.
\end{equation}
The number of true events, $N = n + n_{\text{lost}},$ is then
\begin{eqnarray}
N &=& n + \sum_{i=0}^{n} \int_{0}^{\tau_i} \frac{N}{N_b} R\of{t} \der t \\
&=& n + N~ \isumfrac,
\end{eqnarray}
or solving explicitly for $N$:
\begin{equation}
N = n \left( 1 - \isumfrac \right)^{-1} .
\end{equation}
From here, we can define a live time fraction analogous to that of \eqnref{eq:livetime_scaler}:
\begin{equation}
\label{eq:livetimefull}
L = 1 - \frac{\sum_{i=0}^{n} \int_{0}^{\tau_i} R\of{t} \der t }{\int_{0}^{T} R\of{t} \der t}.
\end{equation}
Note that if the beam rate is a constant with respect to time, $R\of{t} \equiv R$, we recover the definition of $L$ given in \eqnref{eq:livetime1}:
\begin{eqnarray}
\int_0^{\tau} R\of{t} \der t & = & \int_0^{\tau} R \der t = R \tau \\
\Rightarrow L & = & 1 - \frac{\sum_{i=0}^{n} R \tau_i}{R T} \\
& = & 1 - \frac{\sum_{i=0}^{n} \tau_i}{T} \\
& = & 1 - \tau / T.
\end{eqnarray}
In \ac{DRAGON} experiments, the beam rate is monitored continuously by measuring the rate of elastically scattered target nuclei with \ac{IIS} detectors (c.f. \secref{subsec:dragon}). Thus it is possible to construct $R\of{t}$ from these measurements and use the full form of \eqnref{eq:livetimefull} for live time corrections. In \secref{sec:livetime_analysis}, we discuss the effect of including this full live time calculation in the analysis of the \rxnfull{20}{Ne}{p}{\gamma}{21}{Na} data reported in \citeref{PhysRevC.88.038801}. We show that the change in the live time after accounting for beam fluctuations is small even in the presence of substantial rate changes. However, as a general rule, the sensitivity of the final result of a measurement to higher-order live time effects will be different for each experiment. Hence the appropriate live time analysis must be considered on a case-by-case basis.
\section{DAQ Commissioning Experiment}
\label{sec:commissioning}
\begin{figure*}
\centering
\includegraphics{coinc.eps}
\caption{
\panel{a}: difference in trigger times (tail minus head) as measured by the \allcaps{io32}{} \ac{TSC}.
\panel{b}: difference in trigger times as measured by the head \ac{TDC}, with the hatched regions denoting cuts applied to the spectra in \panel{d}. The inset shows the correlation between the \allcaps{io32}{} and \ac{TDC} trigger time difference measurements.
\panel{c}: close up of the recoil peak region of the \ac{TOF} spectrum. The structure of the peaks and the meaning of the hatched regions are discussed in the text.
\panel{d}: sum of coincidence $\gamma$-ray energies measured in the \ac{BGO} array. The shaded histogram consists of events from the recoil peak in separator \ac{TOF} (diagonal-hatched region in \panel{b}), while the unshaded histogram is composed of an arbitrary background region (cross-hatched region in \panel{b}).
}
\label{fig:coinc}
\end{figure*}
The new \ac{DRAGON} \ac{DAQ} was commissioned by measuring the strength of the $E_{\text{c}.\text{m}.} = 1113$ keV resonance in the \rxnfull{20}{Ne}{p}{\gamma}{21}{Na} radiative proton capture reaction. This reaction was also used in the original \ac{DRAGON} commissioning experiment~\cite{Engel2005491, EngelThesis}. Since the separator hardware has not changed appreciably since its inception, revisiting this reaction provides a reliable means to check for any inconsistencies that might be introduced by the new \ac{DAQ}. This resonance also serves as an important calibration point for measurements of direct radiative capture in \rxnfull{20}{Ne}{p}{\gamma}{21}{Na} at lower energies. As the starting point of the NeNa cycle, these are important for the nucleosynthesis of intermediate mass elements in ONe classical novae and the production of sodium in yellow supergiants~\cite{Rolfs1975460, 1999ApJ...520..347J, 1991ApJ...379..729P, Bloch1969129, Iliadis201031}.
A heavy-ion singles analysis of the \ac{DAQ} commissioning experiment has already been reported in \citeref{PhysRevC.88.038801}, with the results proving consistent with the original \ac{DRAGON} commissioning. It was also shown that the commonly accepted value of the $E_{\text{c}.\text{m}.} = 1113$ keV resonance strength was incorrectly derived from a 1960 measurement~\cite{ThomasAndTanner} that was reported in the laboratory frame of reference and later misinterpreted as being in the center-of-mass frame. As shown in \citeref{PhysRevC.88.038801}, recalculating the resonance strength of \citeref{ThomasAndTanner} in the center-of-mass frame brings it into agreement with other published measurements~\cite{Engel2005491, PhysRevC.15.579}. As a result, it was recommended that the accepted value be lowered to account for this new information.
Since we have already reported the singles analysis in \citeref{PhysRevC.88.038801}, here we focus on the coincidence aspects of the data. A summary of relevant coincidence parameters is presented in \figref{fig:coinc}. \panel{a} shows the difference in trigger times for the head and tail \ac{DAQ} systems, as measured by their respective \allcaps{io32}{} \ac{TSC}{}s. As indicated in the figure, the peak around \meas{1.5}{$\mu$s} consists of true recoil events. This sits on top of a flat random background resulting from accidental coincidences between a heavy ion and an uncorrelated $\gamma$ ray. \panel{b} shows the difference in trigger times as measured by the head \ac{TDC}, which shows the same structure as the \allcaps{io32}{} measurements. The inset shows the correlation between the \allcaps{io32}{} and \ac{TDC} time difference measurements. As expected, they show a near $1$:$1$ correlation, with a slight offset due to differing signal propagation delays.
\panel{c} shows a zoomed-in view of the recoil peak in the separator \ac{TOF}, which reveals additional structure. The main peak around \meas{1.7}{$\mu$s} is made up of normal recoil events which are transmitted through both \ac{MCP}{}s to the \ac{DSSSD}. The small cross-hatched peak to the left of the main one consists of events in which a valid \ac{MCP}{}0 signal is coincident with noise in \ac{MCP}{}1. This is evidenced by looking at the relative timing of \ac{MCP}{}0 and \ac{MCP}{}1, which shows a random distribution of times for the \ac{MCP}{}1 trigger relative to \ac{MCP}{}0. The diagonal-hatched peak to the right of the main one likely consists of events which scatter in the carbon foil of \ac{MCP}{}0 and are transmitted to \ac{MCP}{}1 with a reduced velocity compared to unscattered recoils. These events have the same \ac{TOF} from the target to \ac{MCP}{}0 as events in the main peak, but their \ac{TOF} from \ac{MCP}{}0 to \ac{MCP}{}{1} is around \meas{60}{ns} longer, and it has a significantly broader distribution compared to normal recoils. This is indicative of events which originated as normal recoils at the target and then changed velocity due to some reaction process in \ac{MCP}{}0. For events that trigger off the \ac{MCP}{}s (as opposed to the \ac{DSSSD}), the \ac{MCP}{}1 signal defines the trigger, so as a result the separator \ac{TOF} is taken relative to \ac{MCP}{}1. This means that any delay in \ac{MCP}{}1 timing due to recoils changing velocity in \ac{MCP}{}0 will manifest as a delay in the separator \ac{TOF} by the same amount, which is the case for events in the cross-hatched peak. Furthermore, the cross-hatched events do not come with a valid signal in the \ac{DSSSD} as would be expected for recoils which scatter and change their trajectory to one outside the \ac{DSSSD} acceptance.
\panel{d} in \figref{fig:coinc} shows the \ac{BGO} $\gamma$-ray energy sum for events in the recoil peak (shaded histogram) superimposed with events from an arbitrary background region outside the recoil peak (unshaded histogram). As expected, the recoil $\gamma$ rays are almost all concentrated in a strong peak at the \meas{3.5}{MeV} decay energy of the state populated in the reaction. The background histogram, on the other hand, has a significant enhancement near threshold resulting from room background $\gamma$-rays.
\subsection{Resonance Strength Calculation}
\label{sec:wgcoinc}
\newcommand{\numBeam} {\ee{\left( 2.296 \pm 0.032 \right)}{15}}
\newcommand{\numRecoil} {\ee{\left( 5.923 \pm 0.062 \right)}{5}}
\newcommand{\effTrans} {94 \pm 3 \%}
\newcommand{\effLive} {91.486 \pm 0.002 \%}
\newcommand{\effBgo} {55.9 \pm 10.0 \%}
\newcommand{\effTot} {21.1 \pm 3.9 \%}
\newcommand{\yieldC} {\ee{\left(1.221 \pm 0.221 \right)}{-9}}
\newcommand{\wgC} {0.969 \pm 0.210}
\newcommand{\yieldS} {\ee{\left(1.225 \pm 0.051 \right)}{-9}}
\newcommand{\wgS} {0.972 \pm 0.119}
To verify that the timestamp-based coincidence matching is working as intended, we have performed a full coincidence analysis of the $E_{\text{c}.\text{m}.} = 1113$ keV resonance strength in \rxnfull{20}{Ne}{p}{\gamma}{21}{Na}, using data taken during the \ac{DAQ} commissioning experiment. The details of the experiment and the resonance strength calculation, including the employed stopping power, are identical to \citeref{PhysRevC.88.038801}. However, the recoil event selection and overall efficiency are different in the present analysis. A summary of the recoil event selection is shown in \figref{fig:recoilgates}. The final recoil cut is an \logical{and} of the \ac{DSSSD} energy cut used in \citeref{PhysRevC.88.038801}, a cut on the recoil peak in separator \ac{TOF}, and a cut on the energy deposited by the most energetic $\gamma$-ray.
\tableref{tab:yield} shows a summary of the detection efficiency, yield, and resonance strength in the coincidence analysis. The detection efficiency differs from that of \citeref{PhysRevC.88.038801} in two ways: the live time is different as a result of the coincidence trigger requirement, and the $\gamma$-ray detection efficiency becomes part of the total efficiency product. The live time was calculated using \eqnref{eq:livetime1}, with the total dead time $\tau$ being the logical \logical{or} of dead times in the head and tail systems, as explained in \secref{sec:livetime}. The uncertainty on the live time is equal to the $20$ parts per million accuracy rating of the \allcaps{io32}{} quartz crystal, i.e. a \emph{relative} uncertainty of $0.002 \%.$ The \ac{BGO} efficiency was calculated from a \GEANT{3} simulation~\cite{darioThesis}, with the branching ratios for the decay of the \meas{3.54}{MeV} state in \nuc{21}{Na} taken from \citeref{Firestone2004269}. The simulated events were analyzed with the same energy cut as the data:
\begin{equation*}
1.1~\text{MeV} < E_{\gamma}^{\mathrm{(max)}} < 4.5~\text{MeV},
\end{equation*}
where $E_{\gamma}^{\mathrm{(max)}}$ is the energy deposited by the most energetic $\gamma$ ray. This accounts for any effect of hardware thresholds since the lower limit of \meas{1.1}{MeV} is beyond the range of the threshold function. The uncertainty on the \ac{BGO} efficiency calculation was estimated at $10\%$ as explained in \citeref{darioThesis}.
We have also assigned an uncertainty of $3\%$ to the gas target transmission. This was estimated from the standard deviation of Faraday cup readings taken upstream and downstream of the gas target. Each set of readings sampled the beam current approximately every \meas{0.2}{s} over the course of \meas{30}{s.}
This transmission uncertainty was not included in the singles analysis of \citeref{PhysRevC.88.038801}. In \tableref{tab:yield} we also report the updated singles yield and resonance strength when including the $3\%$ gas target transmission uncertainty in the calculation. The overall effect is minor, appearing only in the last quoted digit of the uncertainty on the resonance strength.
As indicated in \tableref{tab:yield}, the present yield and resonance strength are in very good agreement with the singles values, as well as the measurements of Refs.~\cite{Engel2005491, ThomasAndTanner, PhysRevC.15.579} (with the appropriate center-of-mass corrections made to \citeref{ThomasAndTanner}). Note that the increased uncertainty on the coincidence yield and resonance strength as compared to their singles counterparts is a consequence of the $10\%$ uncertainty attached to the \ac{BGO} efficiency.
\begin{figure}
\centering
\includegraphics{recoilgates.eps}
\caption{
Summary of cuts used in the coincidence resonance strength analysis.
\panel{a}: \ac{DSSSD} energy cut; \panel{b}: separator \ac{TOF} cut on the prompt recoil peak; and \panel{c}: cut on the energy deposited by the most energetic $\gamma$-ray. In each panel, the cut limits are indicated by vertical lines. The final recoil cut is an \logical{and} of all three conditions. All histograms consist of coincidence events only, and those in Panels (b) and (c) consist only of events which pass the cuts shown in the panels above them.
}
\label{fig:recoilgates}
\end{figure}
\newcommand{\sdiff}[1]{\textbf{#1}}
\newcommand{bold face}{bold face}
\begin{table}
\caption{
Summary of the coincidence yield calculation. Quantities which are different from or supplementary to those in \citeref{PhysRevC.88.038801} are labeled in bold face{}. The table also includes the singles yield and resonance strength, with the uncertainties on these quantities updated relative \citeref{PhysRevC.88.038801}. They now include propagation of the $3\%$ uncertainty on the gas target transmission.
}
\label{tab:yield}
\begin{tabular}{ll}
\noalign{\smallskip}\hline
\hline\noalign{\smallskip}
Quantity & Value \\
\noalign{\smallskip}\hline\noalign{\smallskip}
\ac{DSSSD} detection efficiency \cite{Wrede2003619} & $97.0 \pm 0.7\%$ \\
Ne$^{\left(9+\right)}$ charge state fraction \cite{Engel2005491} & $59 \pm 1\%$ \\
DRAGON transmission \cite{EngelThesis} & $99.9^{+0.1}_{-0.2}\%$ \\
\ac{MCP} transmission \cite{Vockenhuber2009372} & $76.9 \pm 0.6\%$ \\
\sdiff{Gas target transmission} & $\effTrans$ \\
\sdiff{Coincidence live time} & $\effLive$ \\
\sdiff{BGO detection efficiency} & $\effBgo$ \\
\sdiff{Total coincidence efficiency} & $\effTot$ \\
\noalign{\smallskip}\hline\noalign{\smallskip}
Integrated beam current & $\numBeam$ \\
\sdiff{Detected recoils} & $\numRecoil$ \\
\sdiff{Yield} & $\yieldC$ \\
\sdiff{Resonance strength} & $\wgC$ eV \\
\noalign{\smallskip}\hline\noalign{\smallskip}
\sdiff{Singles yield} & $\yieldS$ \\
\sdiff{Singles resonance strength} & $\wgS$ eV \\
\noalign{\smallskip}\hline
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
\subsection{Live Time Analysis}
\label{sec:livetime_analysis}
\newcommand{\Delta}{\Delta}
\newcommand{\Delta_{30}}{\Delta_{30}}
The rate of the incoming \nuc{20}{Ne} beam varied significantly throughout the course of the \ac{DAQ} commissioning experiment. This is because the beam was extracted from the ISAC offline microwave ion source \cite{jayamanna:02C711}, which requires passing the beam through a stripper foil to reach a charge state suitable for acceleration. Degradation of stripper foils resulted in steady decreases in beam intensity on the time scale of a few hours, after which the ISAC operators would replace the foil and return the beam intensity to its initial state. As a result, the present data set provides an ideal case to examine the effect of varying beam rates on the live time calculations.
To examine the effect of varying beam rates on the live time, we calculated heavy-ion \emph{singles} live times on a run-by-run\footnote{Each run represents \meas{\sim 1}{hour} of data taking bookended by Faraday cup readings.} basis using three different methods. The first method (``Poisson'') calculates the live time from the total sum of busy times divided by the total run time, as represented by \eqnref{eq:livetime1}. This method was employed both in the present coincidence resonance strength calculation (\secref{sec:wgcoinc}) and the singles result reported in \citeref{PhysRevC.88.038801}. The second method (``scaler'') uses the ratio of acquired to presented triggers measured by the \allcaps{io32}{} scalers, viz.\ \eqnref{eq:livetime_scaler}. The third method (``non-Poisson'') involves treating the trigger rate as an inhomogeneous Poisson process as outlined in \secref{sec:nonpoisson}. For this method, we treat the incoming beam rate, $R\of{t},$ as being proportional to the the \ac{IIS} trigger rate, $R_{\mathrm{iis}}\of{t}.$ The proportionality constant cancels out in \eqnref{eq:livetimefull}, so we can set $R\of{t} \equiv R_\mathrm{iis}\of{t}.$
To evaluate \eqnref{eq:livetimefull} from the measured \ac{IIS} rates, we divide each run into \meas{30}{second} periods. For each period $j$ we treat the rate as being a constant $R_j$ equal to the average \ac{IIS} rate over the period. To evaluate the integrals over $R\of{t} \der t,$ we use a simple rectangle method with one second bin sizes.
Expressed mathematically, our approximation to \eqnref{eq:livetimefull} is
\begin{equation}
\label{eq:livetimefull_numerical}
L \simeq 1 -
\frac{
\sum_{j=0}^{n_j} \left. R_{j} \sum_{i:~ \tau_i \in S_j}\tau_{i} \right.
}{
\sum_{i=0}^{n_i} R_i \Delta
},
\end{equation}
where the index $i$ corresponds to the one second bins used for integral evaluation; $\Delta$ is equal to one second; $n_i$ is the number of one-second divisions per run, i.e. $T/\Delta$; $R_i$ is the measured \ac{IIS} rate during each bin $i$; and $\tau_i$ is the sum of measured busy times within the bin $i$. The index $j$ is over the \meas{30}{second} periods during which we treat the \ac{IIS} rate as constant, and $n_j$ is the number of $30$ second periods per run. $S_j$ is the time interval corresponding to a period $j$, i.e. the range $t_j \leq t \leq t_j + 30~${}s where $t_j$ deontes the start of the period $j$. Finally, $R_j$ is the average \ac{IIS} rate over a division $j$:
\begin{equation}
\label{eq:r30sec}
R_{j} \simeq
\frac{
\sum_{k :~ t \in S_j} R_k \Delta
}{
\sum_{k :~ t \in S_j} \Delta
}
.
\end{equation}
The results of the live time analysis are shown in \figref{fig:livetime}, along with the \ac{IIS} trigger rate as a function of time. The figure presets the scaler and non-Poisson live times as ratios to the Poisson live time, $L_0 / L^\prime,$ where $L_0$ is the Poisson live time and $L^\prime$ is either the scaler or non-Poisson live time. This represents the fractional change in the yield that would result from using either the scaler or non-Poisson live time instead of the Poisson. The scaler and non-Poission live times agree well with each other. For the runs with the most significant rate fluctuations, they trend towards being slightly lower than the Poisson live time (resulting in a higher $L_0 / L^\prime$ ratio) but still differ by no more than $1.5\%.$ We have also calculated live times across the entire experiment, $L_{\mathrm{full}},$ by taking the weighted average of the inverse of the run-by-run live times with the weights being the number of recoils detected:
\begin{equation}
\label{eq:overall_livetime}
L_{\mathrm{full}}
= \left( \frac{
\sum_{i} n_{r,i} / L_i
} {
\sum_{i} n_{r,i}
} \right)^{-1}.
\end{equation}
Calculated this way, correcting the total sum of detected recoils using $L_{\mathrm{full}}$ is the mathematical equivalent of making live time corrections run-by-run, i.e.
\begin{equation}
\label{eq:lfull}
\sum_i \frac{n_{r,i}}{L_{i}} = \frac{\sum_i n_{r,i}}{L_{\mathrm{full}}}.
\end{equation}
The respective $L_{\mathrm{full}}$ values for the Poisson, scaler, and non-Poisson methods are $95.6\%,$ $94.8\%$, and $94.9\%$. These translate to fractional yield changes $(Y^\prime / Y_0 - 1)$ of $0.86\%$ and $0.71\%$ for the scaler and non-Poisson methods, respectively. We have also calculated the non-Poisson live time for the coincidence measurement presented in \secref{sec:wgcoinc}, arriving at an overall live time of $90.7\%$, which translates to a fractional yield change of $0.91\%.$
Such changes are small compared to the overall error budget. Since the present analysis represents a particularly extreme case of beam rate fluctuations, this can be taken as an indication that the final result of a \ac{DRAGON} experiment is not likely to be sensitive to the particular method of live time calculation.
\begin{figure}
\centering
\includegraphics{livetime.eps}
\caption{
Effect of beam fluctuations on the heavy-ion singles live time calculations. The solid histogram shows the \ac{IIS} trigger rate as a function of time. The filled squares and triangles denote the ratio of live times $L_0/L^{\prime},$ where $L_0$ is the live time calculated using \eqnref{eq:livetime1} and $L^{\prime}$ is the live time calculated using an alternative method. The alternative methods are the ``scaler'' method (squares) using \eqnref{eq:livetime_scaler} and the ``non-Poisson'' method (triangles) using \eqnref{eq:livetimefull}. The horizontal positions of the markers denote the end times of runs throughout the experiment. The run-by-run live times calculated using the Poisson method are also displayed textually across the top of the figure.
}
\label{fig:livetime}
\end{figure}
\section{Conclusions}
\label{sec:conclusions}
In conclusion, we have developed a new \ac{DAQ} for the \ac{DRAGON} recoil mass separator at {\sc Triumf}{}. The new \ac{DAQ} consists of two free-running acquisition systems with completely independent triggering and readout, one for the $\gamma$-ray detectors surrounding the target and the other for heavy-ion detectors at the end of the separator. Events are recorded with timestamps from a local \meas{20}{MHz} clock, with the clock frequencies and zero-point offsets synchronized between the two systems. Comparison of timestamp values allows coincidence events to be identified in the first stage of data analysis, and we have implemented and successfully employed a coincidence-matching algorithm that is suitable for both online and offline analysis.
The new \ac{DRAGON} \ac{DAQ} was commissioned by measuring the strength of the \meas{E_{\text{c}.\text{m}.} = 1113}{keV} resonance in the \rxnfull{20}{Ne}{p}{\gamma}{21}{Na} radiative capture reaction. The experiment ran successfully, and the measured coincidence resonance strength, \meas{\omega \gamma = \wgC}{eV}, is in good agreement with our previous singles result~\cite{PhysRevC.88.038801}, as well as earlier publications~\cite{Engel2005491, ThomasAndTanner, PhysRevC.15.579}. All activities to date indicate that the \ac{DAQ} upgrade is successful and that the new system can be used in future \ac{DRAGON} experiments.
\section{Acknowledgements}
\label{sec:acknowledgement}
We are grateful to the ISAC operations and offline ion source groups for delivery of a high quality \nuc{20}{Ne} beam during the \ac{DAQ} commissioning experiment. We also thank P. Amadruz for his guidance and efforts in developing the new \ac{DAQ} system. This work was supported in part by the National Research Council and National Sciences and Engineering Research Council of Canada.
\bibliographystyle{apsrev4-1}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 4,906
|
using System;
namespace Thinktecture
{
/// <summary>
/// Event handler context of an abstraction.
/// </summary>
/// <typeparam name="TImplementationDelegate">Type of the delegate.</typeparam>
public class AbstractionEventHandlerContext<TImplementationDelegate>
where TImplementationDelegate : class
{
/// <summary>
/// Event handler.
/// </summary>
public TImplementationDelegate Handler { get; }
/// <summary>
/// Indication how many times the handler has been attached.
/// </summary>
public int Count { get; set; }
/// <summary>
/// Initializes new istance of <see cref="AbstractionEventHandlerContext{TImplementationDelegate}"/>.
/// </summary>
/// <param name="handler">Event handler</param>
public AbstractionEventHandlerContext(TImplementationDelegate handler)
{
Handler = handler ?? throw new ArgumentNullException(nameof(handler));
}
}
}
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 6,580
|
\section{Introduction}
The Wasserstein distance is a powerful tool for measuring distances between distributions.
It has recently been applied in many fields, such as feature matching \cite{sarlin2020superGlue, yabin2020semantic}, generative models \cite{kolouri2019sliced}, similarity metrics \cite{kusner2015from, gao2016supervised, yurochkin2019hierarchical}, and so on.
The Wasserstein distance can be computed by solving the optimal transport problem.
For similarity metrics of documents,
\citet{kusner2015from} proposed the Word Mover's Distance (WMD).
Given the word embedding vectors \cite{mikolov2013distributed} and a normalized bag-of-words, the
WMD is the cost of the optimal transport
between two documents in the word embedding space.
WMD has been used for document classification tasks
and has achieved high $k$-nearest neighbors ($k$NN) accuracy.
To solve the optimal transport problem, linear programming can be used.
However, using linear programming requires cubic time with respect to the number of data points \cite{pele2009fast}.
\citet{cuturi2013sinkhorn} proposed to add entropic regularization to the optimal transport problem,
which can be solved by using a matrix scaling algorithm in quadratic time.
To further reduce the computational cost of the optimal transport problem,
there are two main strategies.
(1) The first approach is to relax the constraint of the optimal transport problem. Specifically,
\citet{kusner2015from} relaxed the constraints of the optimal transport problem and transport the mass of each coordinate to the nearest coordinate, called the Relaxed WMD (RWMD).
\citet{kubilay2019linear} attached additional constraints to RWMD and proposed a more accurate approximation of WMD.
(2) The second approach is to construct a tree metric and compute the Wasserstein distance on the tree metric (tree-Wasserstein distance).
\citet{indyk2003fast} proposed a method to embed the coordinates into the tree metric, called Quadtree.
Recently, \citet{le2019tree} proposed a method to sample tree metrics and achieved a high accuracy in document classification tasks.
\citet{arturs2020scalable} proposed a more accurate method than Quadtree.
These tree-based methods aim to approximate the Wasserstein distance on the Euclidean metric with the tree-Wasserstein distance.
The tree-Wasserstein distance can be computed in linear time with respect to the number of nodes in the tree
and can quickly compare a large number of documents.
In general, the similarity between documents must be designed in a task-specific manner.
However, the methods mentioned above are unsupervised and do not learn task-specific distances.
\citet{gao2016supervised} proposed supervised metric learning based on WMD, called Supervised WMD (S-WMD).
S-WMD learns a task-specific distance by leveraging the label information of documents, and improves the $k$NN accuracy.
However, it requires quadratic time to compute S-WMD
and there is no supervised metric learning for the tree-Wasserstein distance.
Moreover, for the tree-Wasserstein distance, it is challenging to construct the tree metric by leveraging the label information of documents.
In this work,
we propose the \textit{Supervised Tree-Wasserstein} (STW) distance,
a fast supervised metric learning method for the tree metric.
To this end, we propose the \textit{soft tree-Wasserstein distance}, which is a soft variant of the tree-Wasserstein distance.
Specifically, we rewrite the tree-Wasserstein distance by the probability of the parent–-child relationships of a tree.
We then consider learning the probability of the parent--child relationships of a tree by leveraging the label information of documents.
By virtue of the soft tree-Wasserstein distance, the STW distance is end-to-end trainable using backpropagation
and is formulated only by matrix multiplications, which can be implemented with simple operations on a GPU.
Thus, the STW distance is suitable for batch processing and can simultaneously compare multiple documents.
Through synthetic and real-world experiments on document classification tasks,
we show that the STW distance
can build a tree that represents the task-specific distance and has improved accuracy.
Furthermore, we show that the STW distance is more efficient than the existing methods for computing Wasserstein distances,
especially when comparing a large number of documents.
Our contributions are as follows:
\begin{itemize}
\item We propose a soft variant of the tree-Wasserstein distance, which is differentiable with respect to the probability of the parent--child relationships of a tree. It can be computed by simple operations on a GPU and is suitable for batch processing.
\item Using the soft variant of the tree-Wasserstein distance, we propose fast supervised metric learning for a tree metric, which is formulated as a continuous optimization problem.
\item Experimentally, we show that our method is fast and improves the accuracy of document classification tasks.
\end{itemize}
\textbf{Notation:}
In the following sections,
we write $\mathbf{1}_n$ for an $n$-dimensional vector with all ones,
$\mathbf{0}_n$ for an $n$-dimensional vector with all zeros,
$\mathbf{I}$ for the identity matrix,
and $\delta$ for the Dirac delta function.
\section{Related Work}
\label{sec:related_work}
In this section, we introduce the existing Wasserstein distances and the methods for continuous optimization for learning a tree structure,
and then present their drawbacks.
\subsection{Wasserstein Distances}
Given a simplex $\mathbf{a} \in \mathbb{R}_{+}^{n}$ and $\mathbf{b} \in \mathbb{R}_{+}^{m}$,
we write $U(\mathbf{a}, \mathbf{b})$ for the transport polytope of $\mathbf{a}$ and $\mathbf{b}$ as follows:
\begin{equation*}
U(\mathbf{a}, \mathbf{b}) = \{ \mathbf{T} \in \mathbb{R}_{+}^{n \times m} \; | \; \mathbf{T} \mathbf{1}_m = \mathbf{a}, \mathbf{T}^\top \mathbf{1}_n = \mathbf{b} \},
\end{equation*}
Given a cost $c(\mathbf{x}_i, \mathbf{x}_j)$ between coordinates $\mathbf{x}_i$ and $\mathbf{x}_j$,
the optimal transport problem between $\mathbf{a}$ and $\mathbf{b}$ is defined as follows:
\begin{equation*}
\min_{\mathbf{T} \in U(\mathbf{a}, \mathbf{b})} \sum_{i,j} \mathbf{T}_{i,j} \; c(\mathbf{x}_i, \mathbf{x}_j).
\end{equation*}
If $c(\mathbf{x}_i, \mathbf{x}_j)$ is a metric, then
the cost of the optimal transport is a metric, which is a special case of Wasserstein distances.
In document classification tasks,
given word embedding vectors $\mathbf{x}_i$ and $\mathbf{x}_j$,
\citet{kusner2015from} defined the cost $c(\mathbf{x}_i, \mathbf{x}_j) = \| \mathbf{x}_i - \mathbf{x}_j \|^2_2$
and simplex $\mathbf{a}$ and $\mathbf{b}$ as the normalized bag-of-words,
and proposed to use the optimal transport cost as the dissimilarity of documents, called Word Mover's Distance (WMD).
To further improve the classification accuracy,
\citet{gao2016supervised} proposed supervised metric learning based on WMD, called Supervised WMD (S-WMD).
S-WMD transforms word embedding vectors and re-weights the bag-of-words via supervised learning.
To solve the optimal transport problem, linear programming can be used.
However, using linear programming requires cubic time with respect to the number of coordinates \cite{pele2009fast}.
To reduce this time complexity,
\citet{cuturi2013sinkhorn} proposed the entropic regularized optimal transport, which is called the Sinkhorn algorithm
and can be solved in quadratic time.
\textbf{Tree-Wasserstein Distances:}
Given a tree $\mathcal{T} = (\bm{V}, \bm{E})$ rooted at $v_1$ with non-negative edge lengths, the tree metric $d_{\mathcal{T}}$ between two nodes is the total length of the path between the nodes.
Let $\Gamma(v)$ be a set of nodes contained in the subtree of $\mathcal{T}$ rooted at $v \in \bm{V}$.
For all $v \in \bm{V} \setminus \{ v_1 \}$, there exists a unique node $u \in \bm{V}$ which is the parent node of $v$
and we write $w_v$ for the length of the edge from $v$ to its parent node.
Given two measures $\mu$ and $\nu$ supported on $\mathcal{T}$,
the tree-Wasserstein distance between $\mu$ and $\nu$ is calculated as follows:
\begin{equation}
W_{d_{\mathcal{T}}}(\mu, \nu) = \sum_{v \in \bm{V} \setminus \{ v_1\}} w_v \left| \mu(\Gamma(v)) - \nu(\Gamma(v)) \right|.
\label{eqn:tree_wasserstein}
\end{equation}
The parent node of the root $v_1$ does not exist, and the length of the edge $w_{v_1}$ is not defined.
However, because $\mu(\Gamma(v_1)) = \nu(\Gamma(v_1)) = 1$, we define $w_{v_1}=1$ for simplicity;
the tree-Wasserstein distance can be written as $W_{d_{\mathcal{T}}}(\mu, \nu) = \sum_{v \in \bm{V}} w_v \left| \mu(\Gamma(v)) - \nu(\Gamma(v)) \right|$.
The key property of the tree-Wasserstein distance is that it can be computed in linear time with respect to the number of nodes.
Furthermore, the tree-Wasserstein distance between $\mu$ and $\nu$ is regarded as the L1 distance between their corresponding $|\bm{V}|$-dimensional vectors whose elements corresponding to $v$ are $w_v \mu(\Gamma(v))$ and $w_v \nu(\Gamma(v))$.
In practice, these embedding vectors are sparse. This allows for faster implementation \cite{arturs2020scalable}.
In the unbalanced setting,
\citet{sato2019unbalanced} proposed a method to compute the tree-Wasserstein distance in quasi-linear time.
To compute the tree-Wasserstein distance, we need to construct a tree metric.
\citet{indyk2003fast} proposed a method to embed the coordinates into the tree metric in the context of image retrieval, which is called Quadtree.
\citet{le2019tree} proposed the tree-sliced Wasserstein (TSW) distance, which is a variant of the sliced-Wasserstein distance \cite{rabin2011wasserstein, kolouri2018sliced, kolouri2019generalized, deshpande2019max}.
The TSW distance is the average of the tree-Wasserstein distances on the sampled tree metrics.
Recently, \citet{arturs2020scalable} proposed Flowtree,
which computes the optimal flow on Quadtree,
then computes the cost of the optimal flow on the ground metric, unlike Quadtree and the TSW distance.
Flowtree is slower than Quadtree in computing the optimal flow,
but can theoretically approximate the Wasserstein distance more accurately.
These previous works aimed to approximate the Wasserstein distance on the Euclidean metric with the tree-Wasserstein distance.
In contrast to these previous works,
our goal is not to approximate the ground metric, but to construct a tree metric that represents the task-specific distance
by leveraging the label information of the documents; so that the tree-Wasserstein distance between documents with the same label is small, and the tree-Wasserstein distance between documents with different labels is large.
\subsection{Continuous Optimization for a Tree}
When solving the task of learning a tree structure as a continuous optimization problem,
learning in hyperbolic space is highly related.
Hyperbolic space has a property that is similar to that of a tree, where the volume increases exponentially with the radius,
and the number of nodes increases exponentially with the depth of the tree.
Using this property,
various methods that solve continuous optimization to learn a tree structure by representing the nodes with coordinates in hyperbolic space have been proposed \cite{nickel2017poincare, ganea2018hyperbolic}.
In hierarchical clustering,
\citet{monath2019gradient, chami2020from}
formulated the probability or the coordinates of the lowest common ancestors in hyperbolic space
and constructed a tree by minimizing a soft variant of Dasgupta's cost \cite{dasgupta2016cost},
which is the well-known cost for hierarchical clustering.
However, these methods are not applicable to the tree-Wasserstein distance
because it is necessary to formulate whether a node is contained in a subtree (i.e., $\Gamma(v)$).
In contrast to these works,
we introduce the conditions of an adjacency matrix to be the adjacency matrix of a tree,
formulate the probability that a node is contained in a subtree, and
then propose a continuous optimization problem with respect to the adjacency matrix.
\section{Proposed Method}
\label{sec:proposed_method}
In this section,
we first introduce a soft variant of the tree-Wasserstein distance;
then we propose the STW distance.
\subsection{Problem Setting}
We have a finite size vocabulary set $\bm{Z}=\{ z_1, z_2, \ldots, z_{N_{\text{leaf}}}\}$ consisting of $N_{\text{leaf}}$ words
and a training dataset $\mathcal{D} = \{(\mathbf{a}_i, y_i)\}_{i=1}^{M}$
where $N_{\text{leaf}}$-dimensional vector $\mathbf{a}_i = (a_i^{(1)}, a_i^{(2)}, \ldots, a_i^{(N_{\text{leaf}})})^\top \in [0,1]^{N_{\text{leaf}}}$ is the normalized bag-of-words (i.e., $\mathbf{a}_i^\top \mathbf{1}_{N_{\text{leaf}}} =1$), and $y_i \in \mathbb{N}$ is a label of document $i$.
In the following sections, we assign words to leaf nodes of the tree, as in Quadtree and the TSW distance.
We refer to the nodes corresponding to each word as \textit{\text{leaf}} nodes
and the nodes not corresponding to any word as \textit{internal} nodes.
Note that leaf nodes have no child nodes, but there may be internal nodes that do not have child nodes.
To construct the tree metric by leveraging the label information of documents,
assume that we have a set of nodes $\bm{V} = \{v_1, v_2, \ldots , v_N\}$, in which $v_1$ is the root.
We consider constructing the tree metric by learning the parent–child relationships of these nodes.
Let $N_{\text{in}}$ be the number of internal nodes ($N = N_{\text{in}} + N_{\text{leaf}}$).
$\bm{V}_{\text{in}} = \{v_1, v_2, \ldots, v_{N_{\text{in}}} \}$ is a set of internal nodes.
$\bm{V}_{\text{leaf}} = \{v_{N_{\text{in}} + 1}, \ldots, v_{N} \}$ is a set of leaf nodes.
$w_v$ is the length of an edge from $v$ to the parent node of $v$.
For simplicity, we define $w_{v_1}=1$.
We assume that the word $z_i$ corresponds to $v_{N_{\text{in}} + i}$.
We denote the training dataset using the discrete measure $\mathcal{D} = \{ (\mu_i, y_i)\}_{i=1}^M$,
where $\mu_i = \sum_j a_i^{(j)} \delta({v_{N_{\text{in}} + j}}, \cdot)$ is the discrete measure that represents the document $i$.
\subsection{Soft Tree-Wasserstein Distance}
Our goal is to construct a tree metric such that
the tree-Wasserstein distance between documents with the same label is small and
the distance between documents with different labels is large.
To achieve this, we first show the conditions of the parent--child relationships of a tree,
formulate the probability that a node is contained in a subtree using these conditions,
and then propose a soft variant of the tree-Wasserstein distance.
The parent--child relationships of a tree with a specific root can be represented by the adjacency matrix of the directed tree, which has edges from child nodes to their parent nodes.
We show the conditions for an adjacency matrix to be an adjacency matrix of a tree.
\begin{theorem}
If the adjacency matrix $\mathbf{D}_{\text{par}} \in \{0, 1\}^{N \times N}$ of a directed graph $G=(\bm{V}, \bm{E})$ satisfies the following conditions:
\begin{enumerate}
\renewcommand{\labelenumi}{(\arabic{enumi})}
\setlength{\itemsep}{0.1cm}
\item $\mathbf{D}_{\text{par}}$ is a strictly upper triangular matrix. \label{cond:strictly_upper}
\item $\mathbf{D}_{\text{par}}^\top \mathbf{1}_N = (0, 1, \cdots ,1)^\top$. \label{cond:eqn}
\end{enumerate}
then $G$ is a directed tree with $v_1$ as the root.
\label{th:condition_of_adjacency_matrix}
\end{theorem}
Appendix details the proof.
To introduce a soft variant of the tree-Wasserstein distance, we relax
$\mathbf{D}_{\text{par}} \in \{0, 1\}^{N \times N}$ to $\mathbf{D}_{\text{par}} \in \left[0, 1\right]^{N \times N}$ while satisfying the conditions of Theorem \ref{th:condition_of_adjacency_matrix}.
In $\mathbf{D}_{\text{par}}$,
the elements in the first column are all zero;
in the second and subsequent columns,
the sum of the elements in each column is one.
In other words, the element in the $i$-th row and $j$-th column of $\mathbf{D}_{\text{par}}$ is the probability that $v_i$ is a parent of $v_j$.
The elements in the $i$-th row and $j$-th column of $\mathbf{D}^{k}_{\text{par}}$ denotes the probability
that there exists a path from $v_j$ to $v_i$ with $k$ steps.
The element in the $i$-th row and $j$-th column of the sum of the infinite geometric series is
the probability that there exists a path from $v_j$ to $v_i$.
In other words,
it means the probability that $v_j$ is contained in the subtree rooted at $v_i$.
We refer to this probability as $P_{\text{sub}}(v_j | v_i)$ and define it as follows:
\begin{align}
\begin{split}
P_{\text{sub}}(v_j | v_i) &= \left[ \sum_{k=0}^\infty \mathbf{D}_{\text{par}}^k \right]_{i, j} = \left[ (\mathbf{I} - \mathbf{D}_{\text{par}})^{-1} \right]_{i,j}.
\label{eqn:psub}
\end{split}
\end{align}
$\mathbf{D}_{\text{par}}$ is a nilpotent matrix
because it is an upper triangular matrix and all the diagonal elements are zero.
Therefore, the sum of the infinite geometric series converges to $(\mathbf{I} - \mathbf{D}_{\text{par}})^{-1}$.
We show more details in the Appendix.
By using this probability,
we define the \textit{soft tree-Wasserstein distance} $W_{d_{\mathcal{T}}}^{\text{soft}} (\mu_i, \mu_j)$ as follows:
\begin{multline}
\label{eqn:soft_tree_wasserstein}
W_{d_{\mathcal{T}}}^{\text{soft}} (\mu_i, \mu_j) \\
= \sum_{v \in \bm{V}} w_v \left| \sum_{x \in \bm{V}_{\text{leaf}}}\!\!\!P_{\text{sub}}(x | v) \left( \mu_i (x) - \mu_j(x) \right) \right|_{\alpha},
\end{multline}
where $| \cdot |_{\alpha}$ is a smooth approximation of the L1 norm, defined as follows:
\begin{equation*}
| x |_\alpha = \frac{x (e^{\alpha x} - e^{- \alpha x})}{2 + e^{\alpha x} + e^{- \alpha x}}.
\end{equation*}
It has been shown that if $\alpha$ approaches $\infty$, then $|\cdot|_{\alpha}$ converges to the L1 norm \cite{smoothabs}.
Other differentiable approximations for the L1 norm can also be used.
The soft tree-Wasserstein distance satisfies the identity of indiscernibles and the symmetry,
but does not satisfy the triangle inequality, because $| \cdot |_{\alpha}$ does not satisfy the triangle inequality.
Thus, the soft tree-Wasserstein distance is not a metric.
However, the soft tree-Wasserstein distance satisfies the following theorem;
the proof is shown in the Appendix.
\begin{theorem}
If the tree metric is given and $\alpha$ approaches $\infty$, then the soft tree-Wasserstein distance converges to the tree-Wasserstein distance.
\label{th:soft}
\end{theorem}
\subsection{Fast Computation Method}
Because the size of $\mathbf{D}_{\text{par}}$ is large,
calculating the inverse matrix in Eq. \eqref{eqn:psub} has high computational cost and memory consumption.
Next, we introduce a method to reduce this cost by utilizing the property of $\mathbf{D}_{\text{par}}$.
We arranged the index of nodes such that the index of an internal node was less than the index of a leaf node.
As pointed out earlier, leaf nodes have no child nodes.
Then, the lower block of $\mathbf{D}_{\text{par}}$ is a zero matrix
and $\mathbf{D}_{\text{par}}$ can be partitioned into four blocks as follows:
\begin{equation}
\mathbf{D}_{\text{par}} = \begin{pmatrix}
\mathbf{D}_1 & \mathbf{D}_2 \\
\bm{0} & \bm{0}
\end{pmatrix},
\label{eqn:block}
\end{equation}
where $\mathbf{D}_1$ is an $N_{\text{in}} \times N_{\text{in}}$ matrix, and $\mathbf{D}_2$ is an $N_{\text{in}} \times N_{\text{leaf}}$ matrix.
$\mathbf{D}_1$ denotes the parent--child relationships of a tree consisting of internal nodes,
and $\mathbf{D}_2$ represents which internal nodes the leaf nodes connect to.
Utilizing this property and the constraints of $\mathbf{D}_{\text{par}}$,
we can calculate the inverse matrix as follows:
\begin{equation}
(\mathbf{I} - \mathbf{D}_{\text{par}})^{-1} = \begin{pmatrix}
(\mathbf{I} - \mathbf{D}_1)^{-1} & (\mathbf{I} - \mathbf{D}_1)^{-1}\mathbf{D}_2 \\
\bm{0} & \mathbf{I}
\end{pmatrix},
\label{eqn:fast_inverse}
\end{equation}
where $\mathbf{I} - \mathbf{D}_1$ is a regular matrix, and there exists an inverse matrix
because $\mathbf{D}_1$ is an upper triangular matrix, and all diagonal elements are zero.
The bottom two blocks do not need to be retained because they are not learned
and we can reduce the memory consumption.
Since $N_{\text{in}}$ is, in general, $150$ to $4000$,
the computation of the inverse matrix $(\mathbf{I} - \mathbf{D}_1)^{-1}$ is not expensive.
Thus, we can reduce the computational cost and memory consumption.
\subsection{Supervised Tree-Wasserstein Distancce}
Our goal is to construct a tree metric such that
the tree-Wasserstein distance between documents with the same label is small and
the tree-Wasserstein distance between documents with different labels is large.
To achieve this, we use a contrastive loss similar to prior works \cite{raia2006dimensionality} as follows:
\begin{dmath*}
\mathcal{L}(\mathbf{D}_{\text{par}}, \mathbf{w}_v) =
\frac{1}{|\mathcal{D}_p|} \sum_{(i, j) \in \mathcal{D}_p} W^{\text{soft}}_{d_{\cal{T}}} (\mu_i, \mu_j) - \frac{1}{|\mathcal{D}_n|} \sum_{(i, j) \in \mathcal{D}_n} \!\!\min \left\{ W^{\text{soft}}_{d_{\cal{T}}} (\mu_i, \mu_j), m \right\},
\end{dmath*}
where $\mathbf{w}_v = (w_{v_1}, w_{v_2}, \cdots, w_{v_N})^\top$ is an $N$-dimensional vector,
$\mathcal{D}_p = \{(i, j) | y_i = y_j\}$ is a set of index pairs of documents that have the same label,
$\mathcal{D}_n = \{(i, j) | y_i \not = y_j\}$ is a set of index pairs of documents that have different labels, and $m$ is the margin.
However, it is difficult to minimize this loss function with respect to $\mathbf{D}_{\text{par}}$ and $\mathbf{w}_v$
because the joint optimization of $\mathbf{D}_1$, $\mathbf{D}_2$, and $\mathbf{w}_v$ has too many degrees of freedom.
To solve this problem,
we propose initializing $\mathbf{D}_1$ as an adjacency matrix of a tree consisting of internal nodes
and $\mathbf{w}_v=\mathbf{1}_N$,
fix $\mathbf{D}_1$ and $\mathbf{w}_v$ at the initial value,
and minimize the loss with respect to only $\mathbf{D}_2$.
In other words, given a tree $\mathcal{T}^{\prime} = (\bm{V}_{\text{in}}, \bm{E}_{\text{in}})$ whose adjacency matrix is $\mathbf{D}_1$
and edge lengths are all one,
we optimize where to connect leaf nodes to $\mathcal{T}^{\prime}$.
As a by-product, the inverse matrix in Eq. (\ref{eqn:fast_inverse}) needs to be calculated only once before training.
To optimize the loss function while satisfying the conditions of Theorem \ref{th:condition_of_adjacency_matrix},
we propose to calculate $\mathbf{D}_2$ using the softmax function as follows:
\begin{align*}
[\mathbf{D}_2]_{i,j} &= \frac{\exp\left([\bm{\Theta}]_{i,j}\right)}{\sum_{i' = 1}^{N_{\text{in}}}\exp\left([\bm{\Theta}]_{i',j}\right)},
\end{align*}
where $\bm{\Theta} \in \mathbb{R}^{N_{\text{in}} \times N_{\text{leaf}}}$ is the parameter to be optimized.
Using the softmax function,
$\mathbf{D}_2^\top \mathbf{1}_{N_{\text{in}}} = \mathbf{1}_{N_{\text{leaf}}}$
and $\mathbf{D}_1$ is initialized such that $\mathbf{D}_1^\top \mathbf{1}_{N_{\text{in}}} = (0, 1, \cdots, 1)^\top$;
then $\mathbf{D}_1$ and $\mathbf{D}_2$ satisfy the conditions of Theorem \ref{th:condition_of_adjacency_matrix}.
Note that other softmax-like functions can also be used \cite{martins2016from, kong2019rankmax}
as long as the constraint that the sum is one is satisfied.
In summary, our optimization problem is given as follows:
\begin{align}
\label{eqn:objective}
\min_{\bm{\Theta} \in \mathbb{R}^{N_{\text{in}} \times N_{\text{leaf}}}} \mathcal{L}(\mathbf{D}_{\text{par}}, \mathbf{w}_v),
\end{align}
where $\mathbf{D}_1$ is fixed at initial values and $\mathbf{w}_v=\mathbf{1}_N$.
Since this objective function is differentiable with respect to $\mathbf{\Theta}$,
we can optimize it by stochastic gradient descent.
After optimization,
for each leaf node, we select one of the most probable parents and construct the tree metric:
\begin{align*}
\mathbf{D}_2^\ast & = (\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_{N_{\text{leaf}}}) \in \{0, 1\}^{N_{\text{in}} \times N_{\text{leaf}}},
\end{align*}
where $\mathbf{e}_j \in \{0,1\}^{N_{\text{in}}}$ is the one-hot vector whose $k^\ast = \text{argmax}_{k} [\mathbf{D}_2]_{k,j}$ th element is one and the other elements are zero.
We substitute $\mathbf{D}_2^\ast$ and $\mathbf{D}_1$ in Eq. \eqref{eqn:block} and obtain the tree metric that represents the task-specific distance.
We refer to this approach as the \textit{Supervised Tree-Wasserstein} (STW) distance.
The tree-Wasserstein distance between $\mu_i$ and $\mu_j$ can be considered as the L1 distance between their corresponding vectors.
Using the formulation of the soft tree-Wasserstein distance, the
tree-Wasserstein distance can be computed as the L1 norm of the following vector:
\begin{align*}
\mathbf{w}_v
\circ
\left\{
\begin{pmatrix}
(\mathbf{I} - \mathbf{D}_1)^{-1} & (\mathbf{I} - \mathbf{D}_1)^{-1}\mathbf{D}_2^\ast \\
\bm{0} & \mathbf{I}
\end{pmatrix}
\left(
\begin{array}{c}
\mathbf{0}_{N_{\text{in}}} \\
\mathbf{a}_i - \mathbf{a}_j
\end{array} \right) \right\},
\end{align*}
where $\circ$ is the element-wise Hadamard product.
As can be seen above, this formulation can be generalized to the case of comparing one document $\mathbf{a}_1$ with $M-1$ documents $\mathbf{a}_2, \mathbf{a}_3, \ldots, \mathbf{a}_M$.
Then $M-1$ documents can be compared simultaneously by replacing the right vector in the above equation with
$\left( \begin{array}{ccc}
\mathbf{0}_{N_{\text{in}}} & \cdots & \mathbf{0}_{N_{\text{in}}} \\
\mathbf{a}_2 -\mathbf{a}_1 & \cdots & \mathbf{a}_M - \mathbf{a}_1
\end{array} \right)$.
Therefore, the STW distance can be computed on a GPU and can compare multiple documents simultaneously.
\subsection{Implementation Details}
We initialize $\mathbf{D}_1$ such that the tree $\mathcal{T}^{\prime}$ with this adjacency matrix is a perfect $k$-ary tree of depth $d$.
We show the pseudo-code of the STW distance for inference in Algorithm \ref{alg:implementation}.
In practice, lines 4--7 need to be computed only once before inference.
During training, we skip line 6,
use the approximation of the L1 norm in line 8,
compute the loss, and update the parameter $\mathbf{\Theta}$.
Since all operations can run on a GPU and are differentiable,
we can optimize $\mathbf{\Theta}$ using backpropagation and mini-batch stochastic
gradient descent.
This can be easily extended to an implementation that is suitable for batch processing.
We found that when the number of unique words contained in a document is large, the optimization is difficult because the elements of the normalized bag-of-words reach zero.
To address this issue, we multiply a fixed value $5$ to $\mathbf{a}$ in Algorithm \ref{alg:implementation} during training.
For all $v_i \in \bm{V}_{\text{in}}$ and $v_j \in \bm{V}_{\text{leaf}}$,
the number of nodes contained in a path from $v_j$ to $v_i$ is at most $d+2$.
If a node $v_{j + N_{\text{in}}}$ is contained in the subtree rooted at $v_i$,
then $[\mathbf{C}]_{i, j}$ is one, and is zero otherwise.
Therefore, $\mathbf{C}$ is a sparse matrix that has at most $(d+1) \times N_{\text{leaf}}$ non-zero elements,
and $\mathbf{a}$ is a sparse vector because $s \ll N_{\text{leaf}}$,
where $s$ denotes the number of unique words contained in the two documents to be compared.
In general, since GPUs are not suitable for multiplications of sparse matrices,
it is faster to compute them as multiplications of dense matrices when computing on a GPU.
In the following experiments, we evaluate the STW distance on a GPU as multiplications of dense matrices.
However, when run on a CPU, it can be computed in $O(sd)$ by using this sparsity.
\begin{algorithm}[tb]
\caption{Implementation of the STW distance, using PyTorch syntax.}
\label{alg:implementation}
\begin{algorithmic}[1]
\STATE {\bfseries Input:} normalized bag-of-words $\mathbf{a}_i$, $\mathbf{a}_j$, $\mathbf{w}_v=\mathbf{1}_N$.
\STATE {\bfseries Output:} tree-Wasserstein distance between $\mathbf{a}_i$ and $\mathbf{a}_j$.
\STATE $\mathbf{a} = \mathbf{a}_i - \mathbf{a}_j$
\STATE $\mathbf{A} = (\mathbf{I} - \mathbf{D}_1)^{-1}$
\STATE $\mathbf{D}_2$ = softmax($\bm{\Theta}$, dim=0)
\STATE $\mathbf{D}_2^\ast = \mathbf{D}_2.\text{ge(}\mathbf{D}_2\text{.max(}0, \text{keepdim=True)[0]).float()}$
\STATE $\mathbf{C}$ = mm($\mathbf{A}$, $\mathbf{D}_2^\ast$)
\STATE {\bfseries return} abs(mv($\mathbf{C}$, $\mathbf{a}$)).sum() + abs($\mathbf{a}$).sum()
\end{algorithmic}
\end{algorithm}
\section{Experimental Results}
We evaluate the following methods in document classification tasks on the synthetic and six real datasets following S-WMD
in the test error rate of the $k$-nearest neighbors ($k$NN) and the time consumption:
\textsc{TWITTER}, \textsc{AMAZON}, \textsc{CLASSIC}, \textsc{BBCSPORT}, \textsc{OHSUMED}, and \textsc{REUTERS}.
Datasets are split into train/test as with the previous works \cite{kusner2015from, gao2016supervised}.
Table \ref{table:dataset} lists the number of unique words contained in the dataset (bag-of-words dimension) and the average number of unique words contained in a document for all real datasets.
\begin{table}[t!]
\vskip -0.15 in
\caption{Datasets used for the experiments.}
\label{table:dataset}
\vskip 0.1in
\begin{center}
\begin{small}
\begin{sc}
\begin{tabular}{lcc}
\toprule
& bow dimension & average words \\
\midrule
TWITTER & 6344 & 9.9 \\
CLASSIC & 24277 & 38.6 \\
AMAZON & 42063 & 45.0 \\
BBCSPORT & 13243 & 117 \\
OHSUMED & 31789 & 59.2 \\
REUTERS & 22425 & 37.1 \\
\bottomrule
\end{tabular}
\end{sc}
\end{small}
\end{center}
\vskip -0.2in
\end{table}
\subsection{Baseline Methods}
\textbf{Word Mover's Distance (WMD) \cite{kusner2015from}:}
The document metric formulated by the optimal transport problem,
as described in Section \ref{sec:related_work}.
\textbf{Supervised Word Mover's Distance (S-WMD) \cite{gao2016supervised}:}
Supervised metric learning based on WMD.
\textbf{Quadtree \cite{indyk2003fast}:}
To construct the tree metric,
we first obtain a randomly shifted hypercube containing all word embedding vectors.
Next, we recursively divide the hypercube into hypercubes with half side length until there is only one word embedding vector in the hypercube.
Each hypercube corresponds to a node, which has child nodes that correspond to hypercubes with half side length created by the split.
The tree constructed in this way is called Quadtree.
After constructing Quadtree,
we compute the tree-Wasserstein distance in Eq. \eqref{eqn:tree_wasserstein}.
\textbf{Flowtree \cite{arturs2020scalable}:}
Flowtree computes the transport plan on Quadtree,
and then computes the cost on the ground metric.
\textbf{Tree-Sliced Wasserstein (TSW) Distance \cite{le2019tree}:}
The TSW distance samples the tree metrics,
and then computes the average distance of tree-Wasserstein distances on these tree metrics.
A previous work \cite{le2019tree} showed that increasing the sampling size results in higher accuracy, but requires more computation time,
and recommended 10 samples.
Following this, we evaluated the TSW distance with the deepest level of the tree of 6
and the number of child nodes of 5 with sampling numbers of 1, 5, and 10.
For sampling size, we refer to TSW-1, TSW-5, and TSW-10, respectively.
\textbf{Supervised Tree-Wasserstein (STW) Distance:}
We initialize $\mathbf{D}_1$ such that the tree whose adjacency matrix is $\mathbf{D}_1$ is a perfect 5-ary tree of depth 5,
and optimize Eq. (\ref{eqn:objective}) using Adam \cite{adam} and LARS \cite{LARS}.
After optimization, the deepest level of the tree is 5 or 6.
To select the margin $m$,
we use 20\% of the training dataset for validation.
We then train our model at a learning rate of $0.1$ and a batch size of $100$ for $30$ epochs.
To avoid overfitting, we evaluated the STW distance using the parameters with the lowest loss in $30$ epochs of the validation dataset.
\subsection{Experimental Setup}
We use word2vec \cite{mikolov2013distributed}, which is pre-trained on Google News \footnote{\url{https://code.google.com/p/word2vec}}
as the word embedding vectors for WMD, S-WMD, Quadtree, Flowtree, and the TSW distance.
For measuring the time consumption,
we use the public implementation \footnote{\url{https://github.com/mkusner/wmd}} of \cite{kusner2015from} for WMD
and the public implementation \footnote{\url{https://github.com/ilyaraz/ot_estimators}} of \cite{arturs2020scalable}, which is written in C++ and Python,
for Quadtree and Flowtree.
We implement S-WMD, and the TSW and STW distances in PyTorch.
The public implementation of WMD is written in C and Python and uses the algorithm developed by \cite{pele2009fast}, which requires cubic time.
Additionally, we implement WMD with Sinkhorn algorithm in PyTorch, which we refer to as WMD (Sinkhorn).
The parameter of the Sinkhorn algorithm for WMD (Sinkhorn) and our implementation of S-WMD
is same as the public implementation \footnote{\url{https://github.com/gaohuang/S-WMD}} of \cite{gao2016supervised}.
We evaluated WMD (Sinkhorn), S-WMD, and the TSW and STW distances on Nvidia Quadro RTX 8000,
and WMD, Quadtree, and Flowtree on Intel Xeon CPU E5-2690 v4 (2.60 GHz).
\subsection{Results on the Synthetic Dataset}
\begin{figure}[t]
\vskip -0.0in
\subfigure[Quadtree]{
\includegraphics[width=0.3\columnwidth]{pic/quadtree_synthetic.png}
}
\subfigure[TSW]{
\includegraphics[width=0.3\columnwidth]{pic/tsw_synthetic.png}
}
\subfigure[STW]{
\includegraphics[width=0.3\columnwidth]{pic/stw_synthetic.png}
}
\begin{center}
\vskip -0.15 in
\caption{Trees constructed by Quadtree, the TSW distance, and the STW distance on the synthetic dataset. Flowtree computes the optimal flow on Quadtree. Nodes that correspond to internal nodes are black-filled; nodes that correspond to the words ``piano'' and ``violin'' are blue-filled; and others are green-filled.}
\label{fig:visualization_of_synthetic}
\end{center}
\vskip -0.3in
\end{figure}
\begin{table}[t]
\caption{The $k$NN test error rate on the synthetic dataset.}
\label{table:accuracy_on_syntheric}
\vskip 0.1in
\begin{center}
\begin{small}
\begin{sc}
\begin{tabular}{cccc}
\toprule
Quadtree & Flowtree & TSW-1/5/10 & STW \\
\midrule
0.3 & 1.6 & 7.5 / 4.2 / 3.9 & 0.0 \\
\bottomrule
\end{tabular}
\end{sc}
\end{small}
\end{center}
\vskip -0.2in
\end{table}
\begin{table*}[t!]
\vskip -0.1 in
\caption{The $k$NN test error for real datasets.
WMD and S-WMD give the results from \cite{gao2016supervised}.}
\label{table:accuracy}
\vskip 0.1in
\begin{center}
\begin{small}
\begin{sc}
\begin{tabular}{lcccccc}
\toprule
& TWITTER & AMAZON & CLASSIC & BBCSPORT & OHSUMED & REUTERS \\
\midrule
WMD & 28.7 $\pm$ 0.6 & 7.4 $\pm$ 0.3 & 2.8 $\pm$ 0.1 & 4.6 $\pm$ 0.7 & 44.5 & 3.5 \\
S-WMD & 27.5 $\pm$ 0.5 & 5.8 $\pm$ 0.1 & 3.2 $\pm$ 0.2 & 2.1 $\pm$ 0.5 & 34.3 & 3.2 \\
Quadtree & 30.4 $\pm$ 0.8 & 10.7 $\pm$ 0.3 & 4.1 $\pm$ 0.4 & 4.5 $\pm$ 0.5 & 44.0 & 5.2 \\
Flowtree & 29.8 $\pm$ 0.9 & 9.9 $\pm$ 0.3 & 5.6 $\pm$ 0.6 & 4.7 $\pm$ 1.1 & 44.4 & 4.7 \\
TSW-1 & 30.2 $\pm$ 1.3 & 14.5 $\pm$ 0.6 & 5.5 $\pm$ 0.5 & 12.4 $\pm$ 1.9 & 58.4 & 7.5 \\
TSW-5 & 29.5 $\pm$ 1.1 & 9.2 $\pm$ 0.1 & 4.1 $\pm$ 0.4 & 11.9 $\pm$ 1.3 & 51.7 & 5.8 \\
TSW-10 & 29.3 $\pm$ 1.0 & 8.9 $\pm$ 0.5 & 4.1 $\pm$ 0.6 & 11.4 $\pm$ 0.9 & 51.1 & 5.4 \\
STW & 28.9 $\pm$ 0.7 & 10.1 $\pm$ 0.7 & 4.4 $\pm$ 0.7 & 3.4 $\pm$ 0.8 & 40.2 & 4.4 \\
\bottomrule
\end{tabular}
\end{sc}
\end{small}
\end{center}
\vskip -0.1in
\end{table*}
\begin{figure*}[t!]
\vskip 0.0 in
\begin{center}
\centerline{\includegraphics[width=0.9\hsize]{pic/depth.png}}
\vskip -0.1 in
\caption{The $k$NN test error rate on real datasets when varying the depth level of the tree. For the STW distance, if the tree consisting of internal nodes is initialized so that its depth is $d$, the depth of the tree after optimization is $d$ or $d+1$. In this figure, when the depth of the tree consisting of internal nodes is initialized such that its depth is $d$, the depth of the STW distance is considered to be $d+1$.}
\label{fig:depth}
\end{center}
\vskip -0.3in
\end{figure*}
By using the synthetic dataset, we first show that the STW distance can construct a tree metric that represents a task-specific distance
and improves the accuracy of the document classification task.
We generated the synthetic dataset so that documents consist of only ten words: ``piano," ``violin," ``cello," ``viola," ``contrabass," ``trumpet," ``trombone," ``clarinet," ``flute," and ``harpsichord." Each word contains zero or one
and documents are classified into two classes based on whether the word ``piano'' or ``violin'' is contained.
We initialize $\mathbf{D}_1$ so that the tree whose adjacency matrix is $\mathbf{D}_1$ is a perfect 5-ary tree of depth 1 for easy visualization.
We show the trees constructed by Quadtree, Flowtree, the TSW and STW distances in Figure \ref{fig:visualization_of_synthetic}
and the $k$NN test error rate in Table \ref{table:accuracy_on_syntheric}.
Quadtree constructs a tree so that the distance between all words is the same because the dimension of the word embedding vector is high and each word is assigned to a different hypercube.
The TSW distance constructs a tree so that the words ``piano'' and ``violin'' are not far from other words.
However, the STW distance constructs a tree so that the words ``piano'' and ``violin'' are close and far from other words,
and the words except for the words ``piano'' and ``violin'' are close together.
As a result, the STW distance outperforms Quadtree, Flowtree, and the TSW distance.
\subsection{Results on Real Datasets}
\begin{figure*}[t!]
\vskip 0.0 in
\begin{center}
\centerline{\includegraphics[width=\hsize]{pic/speed_batch_max.png}}
\vskip -0.15 in
\caption{Average time consumption for comparing $500$ documents with one document. For the STW distance and the TSW distance, the batch size is set to the number of documents contained in the training dataset. For WMD (Sinkhorn) and S-WMD, the batch size is set to $500$ due to the memory size limitations. To obtain the average time consumption, we sample $100$ documents as queries and measure the time consumption.}
\label{fig:speed}
\end{center}
\vskip -0.3in
\end{figure*}
\begin{figure}[t]
\vskip -0.0in
\begin{center}
\centerline{\includegraphics[width=\columnwidth]{pic/batch_emphasize2.png}}
\vskip -0.15 in
\caption{Average time consumption to compare one document with 500 documents.
The number in the bracket indicates the batch size
and \textit{MAX} means the number of documents contained in the training dataset.}
\label{fig:speed_batch}
\end{center}
\vskip -0.4in
\end{figure}
We first discuss the accuracy of document classification tasks on real datasets, and then discuss the time consumption to compute the distances.
We list the $k$NN test error rates in Table \ref{table:accuracy}.
On TWITTER, BBCSPORT, OHSUMED, and REUTERS,
the STW distance outperforms Quadtree, Flowtree, and the TSW distance.
On AMAZON and CLASSIC,
the STW distance outperforms the TSW-1 distance and is competitive with Quadtree, Flowtree, the TSW-5 distance, and the TSW-10 distance, respectively.
In particular, the error rate of the TSW distance is approximately $10\%$ higher than that of WMD on BBCSPORT and OHSUMED,
but the STW distance improves the error rate and outperforms WMD.
On the other hand, the STW distance still underperforms WMD in other datasets
and all tree-based methods underperform S-WMD in all datasets.
To construct the tree metric in the TSW and STW distances,
we need to set the depth level of the tree as the hyperparameters.
We evaluated how the tree's depth level affects the accuracy of the TSW and STW distances.
In Figure \ref{fig:depth}, we show the $k$NN test error rate
when the STW distance is initialized, such that $\mathbf{D}_1$ is an adjacency matrix of the depth level of trees 3, 4, and 5,
and the TSW distance is sampled so that the depth level of the tree is 4, 5, and 6.
The results show that, in general,
the deeper the depth level of the tree, the higher the accuracy.
When the depth level of the tree is 4,
the accuracy of the TSW-1 distance is considerably worse than when the depth level of the tree is 6,
whereas the STW distance is only approximately $2\%$ worse.
The results indicate that the STW distance is more accurate than the TSW-1 distance, especially when the tree is shallow.
Next, we discuss the average time consumption to calculate distance.
We show the time required to compare $500$ documents with one document in Figure \ref{fig:speed}.
Quadtree, Flowtree, and the TSW and STW distances are faster than WMD, WMD (Sinkhorn), and S-WMD on all datasets.
The TSW-10 distance calculates the tree-Wasserstein distance 10 times, which is approximately 10 times slower than Quadtree, and the TSW-1 and STW distances.
The public implementation of Quadtree uses an algorithm that is suitable for CPUs, which runs in linear time with respect to the number of unique words in the document.
The time complexity of the implementation of the STW distance
depends on the number of unique words in the dataset,
but runs on a GPU and is suitable for batch processing.
Therefore, when comparing a large number of documents, our algorithm is more efficient than the existing algorithm for computing the tree-Wasserstein distance.
In Figure \ref{fig:speed_batch}, we show the average time consumption when varying the batch sizes on TWITTER, CLASSIC, and AMAZON for Quadtree and the STW distance.
The results indicate that, if the batch size is sufficiently large, the STW distance is faster than Quadtree.
In particular, on AMAZON, when the batch size is set to the number of documents contained in the training dataset,
the STW distance is about six times faster than Quadtree.
Additional experiments when varying the batch size are included in the Appendix.
\section{Conclusion}
In this work, we proposed the soft tree-Wasserstein distance and the supervised tree-Wasserstein distance.
The soft tree-Wasserstein distance is differentiable with respect to the probability of the parent--child relationships of a tree and is formulated only by matrix multiplications.
By using the soft tree-Wasserstein distance, we formulated the STW distance as a continuous optimization problem,
which is end-to-end trainable and constructs the tree metric by leveraging the label information of documents.
Through the experiments on the synthetic and real datasets,
we showed that the STW distance can be computed quickly and can improve the accuracy of document classification tasks.
Furthermore,
because the STW distance is suitable for batch processing,
it is more efficient than existing methods for computing the Wasserstein distance, especially when comparing a large number of documents.
\section*{Acknowledgement}
We thank Hisashi Kashima and Shogo Hayashi for their useful discussions.
M.Y. was supported by MEXT KAKENHI 20H04243.
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 5,638
|
Народна скупштина Србије се може односити на скупштину Србије назначен у следећим периодима:
Народна скупштина Републике Србије (од 1990)
Скупштина Социјалистичке Републике Србије (од Другог светског рата до 1990)
Народна скупштина Краљевине Србије (1882–1918)
Народна скупштина Кнежевине Србије (1815–1882)
Народна скупштина у време Првог и Другог српског устанка (1804–1815)
За појединачно сазване Народне скупштине Србије погледајте:
Народне скупштине Србије
Види још
Дом Народне скупштине Републике Србије
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 3,125
|
{"url":"https:\/\/answers.ros.org\/questions\/199561\/revisions\/","text":"Revision history [back]\n\nrplidar driver installation problem on Ubuntu\n\nApologies for posting here, but since robopeak's rplidar does not seem to have very much on the support side since it does appear to be R&D hardware. My ultimate goal here is to get RPLIDAR to work with rvis so I thought I would attempt as asking here.\n\nI have attempted to get RPLIDAR to talk to Linuxmint 17 system and an Ubuntu 14.04 system. And when I run:\n\n$roslaunch rplidar_ros view_rplidar.launch Error, cannot bind to the specified serial port \/dev\/ttyUSB0. And the GUI warns: No tf data. Actual error: Fixed Frame [laser] does not exist I believe the problem is that the USB to UART driver is installed with root permissions because I get the same error when I run the rplidar example program: $ .\/ultra_simple \/dev\/ttyUSB0\nError, cannot bind to the specified serial port \/dev\/ttyUSB0.\n\n\nBut it runs correctly when I run the above command under root:\n\n$sudo .\/ultra_simple \/dev\/ttyUSB0 theta: 151.48 Dist: 00124.75 Q: 10 theta: 152.72 Dist: 00126.00 Q: 10 theta: 153.95 Dist: 00127.00 Q: 10 theta: 155.19 Dist: 00128.00 Q: 11 theta: 156.41 Dist: 00130.00 Q: 11 theta: 157.64 Dist: 00132.25 Q: 10 theta: 158.88 Dist: 00134.00 Q: 11 theta: 160.11 Dist: 00137.50 Q: 10 theta: 161.33 Dist: 00141.00 Q: 10 Is there way to install the driver without root permissions? Below is how I installed the driver: $ cd Linux_3.x.x_VCP_Driver_Source\n~\/Linux_3.x.x_VCP_Driver_Source$make ~\/Linux_3.x.x_VCP_Driver_Source$ sudo cp cp210x.ko \/lib\/modules\/3.13.0-43-generic\/kernel\/drivers\/usb\/serial\/usbserial.ko\n~\/Linux_3.x.x_VCP_Driver_Source$sudo insmod \/lib\/modules\/3.13.0-43-generic\/kernel\/drivers\/usb\/serial\/usbserial.ko$insmod: ERROR: could not insert module \/lib\/modules\/3.13.0-43-generic\/kernel\/drivers\/usb\/serial\/usbserial.ko: File exists\n$sudo insmod cp210x.ko Can I do a simple chmod? Or is there a way to run ROS as root? When I run it with sudo it get 'command not found': \/catkin_ws$ sudo roslaunch rplidar_ros view_rplidar.launch","date":"2020-01-24 13:43:19","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 1, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.2710873484611511, \"perplexity\": 6518.034105095916}, \"config\": {\"markdown_headings\": false, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2020-05\/segments\/1579250620381.59\/warc\/CC-MAIN-20200124130719-20200124155719-00361.warc.gz\"}"}
| null | null |
Q: Circle_2 and Line_2 intersection with CGAL I'm trying to use CGAL to find the intersection between two objects: a Circle_2 and a Line_2. The code compiles but the result is not correct.
This is my code:
typedef CGAL::Exact_circular_kernel_2 Circular_k;
typedef CGAL::Point_2<Circular_k> Point_2;
typedef CGAL::Circular_arc_point_2<Circular_k> CircularArcPoint_2;
typedef CGAL::Direction_2<Circular_k> Direction_2;
typedef CGAL::Line_2<Circular_k> Line_2;
typedef CGAL::Circle_2<Circular_k> Circle_2;
typedef CGAL::CK2_Intersection_traits<Circular_k, Circle_2, Circle_2>::type Intersection_cc_result;
typedef CGAL::CK2_Intersection_traits<Circular_k, Circle_2, Line_2>::type Intersection_cl_result;
int main() {
Point_2 a(0.15, 0.15), b(-0.15, -0.15), c(-0.15, 0.15), d(0.15, -0.15);
double u = 0.5;
double theta = atan(u);
Line_2 r2(b, Direction_2(sin(-1.5708+theta),cos(-1.5708+theta)));
Circle_2 cir(Point_2 (0,0), 4);
std::vector<Intersection_cl_result> out1s;
intersection(cir,r2,back_inserter(out1s));
std::cout<<"size intersection: "<<out1s.size()<<std::endl;
CircularArcPoint_2 v1s;
assign(v1s, out1s[0]);
std::cout <<"v1s = "<< v1s << std::endl;
return 0;
}
This is my output:
size intersection: 2
v1s = EXT[0/1,0/1,0/1] EXT[0/1,0/1,0/1]
I don't understand why i get this: "v1s = EXT[0/1,0/1,0/1] EXT[0/1,0/1,0/1]
". The point "v1s" should be the first result from the intersection of the
Circle_2: "cir" and the Line_2: "r2".
What could i do to define this intersection point?
A: Solved.
Changed my code to:
using boostRetVal = std::pair<CGAL::Circular_arc_point_2< CGAL::Filtered_bbox_circular_kernel_2<CGAL::Circular_kernel_2<CGAL::Cartesian<CGAL::Gmpq>, CGAL::Algebraic_kernel_for_circles_2_2<CGAL::Gmpq>>>> , unsigned >;
std::vector<Intersection_cl_result> out1s;
intersection(cir,r2,back_inserter(out1s));
const auto v1_s =std::get<0>( boost::get<boostRetVal>(out1s[0]));
const auto v1s =Point_2(to_double(v1_s.x()), to_double(v1_s.y()));
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 2,592
|
package org.xtuml.bp.mc.masl.preferences;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PropertyPage;
import org.xtuml.bp.core.Component_c;
import org.xtuml.bp.core.Deployment_c;
import org.xtuml.bp.core.SystemModel_c;
import org.xtuml.bp.core.common.NonRootModelElement;
import org.xtuml.bp.mc.masl.MaslExportBuilder;
import org.xtuml.bp.ui.explorer.ModelLabelProvider;
public class MaslExporterPreferencePage extends PropertyPage {
private MaslExporterPreferences prefs;
private CheckboxTreeViewer elementListViewer;
private Button automaticallySelectButton;
Button enableFormatButton;
Button emitActionLanguageButton;
Button cleanBuildButton;
Text outputFolderTextbox;
@Override
protected Control createContents(Composite parent) {
prefs = new MaslExporterPreferences(getProject());
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
Group elementListGroup = new Group(composite, SWT.NONE);
elementListGroup.setLayout(new GridLayout());
elementListGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
elementListGroup.setText("Build elements");
elementListViewer = new CheckboxTreeViewer(elementListGroup, SWT.NONE | SWT.BORDER | SWT.MULTI);
elementListViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
elementListViewer.setLabelProvider(new ModelLabelProvider());
elementListViewer.setContentProvider(new ITreeContentProvider() {
@Override
public boolean hasChildren(Object parentElement) {
return false;
}
@Override
public Object getParent(Object element) {
return null;
}
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof List) {
return ((List<?>) inputElement).toArray();
} else {
return new Object[0];
}
}
@Override
public Object[] getChildren(Object element) {
return null;
}
});
elementListViewer.setInput(getBuildElements());
automaticallySelectButton = new Button(elementListGroup, SWT.CHECK);
automaticallySelectButton.setText("Automatically select elements to build");
automaticallySelectButton.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent evt) {
if (automaticallySelectButton.getSelection()) {
elementListViewer.getTree().setEnabled(false);
setDefaultCheckedElements();
} else {
elementListViewer.getTree().setEnabled(true);
}
}
@Override
public void widgetDefaultSelected(SelectionEvent evt) {
}
});
Group outputControlGroup = new Group(composite, SWT.NONE);
outputControlGroup.setLayout(new GridLayout(2, true));
outputControlGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
outputControlGroup.setText("Output settings");
enableFormatButton = new Button(outputControlGroup, SWT.CHECK);
enableFormatButton.setText("Format output MASL");
emitActionLanguageButton = new Button(outputControlGroup, SWT.CHECK);
emitActionLanguageButton.setText("Emit activity definition files");
cleanBuildButton = new Button(outputControlGroup, SWT.CHECK);
cleanBuildButton.setText("Remove old files before export (clean)");
@SuppressWarnings("unused")
final Label blankLabel = new Label(outputControlGroup, SWT.NONE);
Label outputFolderLabel = new Label(outputControlGroup, SWT.NONE);
outputFolderLabel.setText("Output destination:");
outputFolderTextbox = new Text(outputControlGroup, SWT.LEFT | SWT.BORDER);
outputFolderTextbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
updateUI();
return composite;
}
@Override
public void performDefaults() {
prefs.restoreDefaults();
updateUI();
performApply();
}
@Override
public boolean performOk() {
performApply();
return super.performOk();
}
@Override
public void performApply() {
if (automaticallySelectButton.getSelection()) {
prefs.setSelectedBuildElements(new ArrayList<>());
} else {
prefs.setSelectedBuildElements(Stream.of(elementListViewer.getCheckedElements()).map((element) -> {
if (element instanceof Component_c) {
return ((Component_c) element).getId();
} else if (element instanceof Deployment_c) {
return ((Deployment_c) element).getDeployment_id();
} else {
return null;
}
}).collect(Collectors.toList()));
}
prefs.setAutoSelectElements(automaticallySelectButton.getSelection());
prefs.setFormatOutput(enableFormatButton.getSelection());
prefs.setEmitActivities(emitActionLanguageButton.getSelection());
prefs.setCleanBuild(cleanBuildButton.getSelection());
prefs.setOutputDestination(outputFolderTextbox.getText());
prefs.savePreferences();
}
private List<NonRootModelElement> getBuildElements() {
return MaslExportBuilder.getPossibleBuildElements(getProject());
}
private void updateUI() {
elementListViewer.setInput(getBuildElements());
automaticallySelectButton.setSelection(prefs.isAutoSelectElements());
if (automaticallySelectButton.getSelection()) {
elementListViewer.getTree().setEnabled(false);
setDefaultCheckedElements();
} else {
elementListViewer.getTree().setEnabled(true);
for (NonRootModelElement element : getBuildElements()) {
if (prefs.getSelectedBuildElements().stream().anyMatch((id) -> {
if (element instanceof Component_c) {
return ((Component_c) element).getId().equals(id);
} else if (element instanceof Deployment_c) {
return ((Deployment_c) element).getDeployment_id().equals(id);
} else {
return false;
}
})) {
elementListViewer.setChecked(element, true);
} else {
elementListViewer.setChecked(element, false);
}
}
}
enableFormatButton.setSelection(prefs.isFormatOutput());
emitActionLanguageButton.setSelection(prefs.isEmitActivities());
cleanBuildButton.setSelection(prefs.isCleanBuild());
outputFolderTextbox.setText(prefs.getOutputDestination());
}
private void setDefaultCheckedElements() {
for (NonRootModelElement element : getBuildElements()) {
if (MaslExportBuilder.getDefaultBuildElements(getProject()).stream().anyMatch((nrme) -> {
return nrme.equals(element);
})) {
elementListViewer.setChecked(element, true);
} else {
elementListViewer.setChecked(element, false);
}
}
}
private IProject getProject() {
if (getElement() instanceof IProject) {
return (IProject) getElement();
} else if (getElement() instanceof SystemModel_c) {
return (IProject) ((SystemModel_c) getElement()).getAdapter(IProject.class);
} else {
return null;
}
}
}
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 2,189
|
887 Alinda é um asteróide a orbitar o Sol. Foi descoberto pelo astrónomo alemão Max Wolf em 3 de janeiro de 1918.
Ver também
Sol
Ligações externas
Asteroides da cintura principal
Família Alinda
Objetos astronômicos descobertos em 1918
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 108
|
Ли́га чемпио́нов УЕФА — самый престижный европейский клубный футбольный турнир, в котором принимают участие сильнейшие клубы национальных футбольных чемпионатов зоны УЕФА. Со своего первого розыгрыша в сезоне 1955/56 и по сезон 1991/92 турнир назывался Кубком европейских чемпионов, в статье эти сезоны не учтены; не учитываются также квалификационные раунды Лиги чемпионов.
Хет-триком в футболе называют три гола, забитые в одном матче одним игроком. Покер и пента-трик — четыре и пять голов соответственно. Первым игроком, сделавшим хет-трик в мачте Лиги чемпионов УЕФА, стал игрок ПСВ Юл Эллерман. Это произошло 16 сентября 1992 года в матче против «Жальгириса». Самый быстрый хет-трик сделал Мохаммед Салах из «Ливерпуля» — 12 октября 2022 года он забил три мяча в ворота «Рейнджерс» с разницей в 6 минут и 12 секунд. Самый быстрый покер исполнил Луис Адриано — за 17 минут 21 октября 2014 года (и ещё 1 гол забил в конце матча). Лидерами по количеству хет-триков являются Лионель Месси и Криштиану Роналду на счету которых по восемь хет-триков. Шесть хет-триков у Роберта Левандовского. Левандовский — единственный в истории, кто делал хет-трики в составе трёх клубов («Боруссия» Д, «Бавария», «Барселона»). Четыре хет-трика на счету Карима Бензема. Только Месси и Левандовский дважды забивали более трёх мячей в одном матче.
Всего было зафиксировано 16 покеров и 3 пента-трика (Лионель Месси, Луис Адриано и Эрлинг Холанн). Больше всего хет-триков было в сезоне 2019/20 — 10. А турниры 1994/95 и 2001/02 годов прошли без них.
Список хет-триков
Статистика
В таблице приведены игроки, которые сделали как минимум два хет-трика в своей карьере.
Статистика по клубам
«Реал Мадрид» (14)
«Барселона» (14)
«Бавария» (11)
«Манчестер Юнайтед» (7)
«Манчестер Сити» (7)
«Арсенал» (6)
«Ювентус» (6)
«Ливерпуль» (6)
«Милан» (5)
«Пари Сен-Жермен» (5)
«Валенсия» (4)
«Шахтёр» (4)
«Интернационале» (3)
«Олимпик Марсель» (3)
ПСВ (3)
«Тоттенхэм Хотспур» (3)
Статистика по странам
На 14 марта 2023 года хет-триком отметились игроки из 37 стран. Лидером является Бразилия (21 хет-трик); среди европейских стран — Франция и Англия.
(21)
(18)
(12)
(11)
(10)
(8)
(8)
(8)
(7)
(7)
(5)
(5)
(4)
(3)
(2)
(2)
(2)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(1)
См. также
Список хет-триков Кубка европейских чемпионов
Комментарии
Примечания
Ссылки
Все хет-трики за всё время
Официальный сайт Лиги чемпионов
Все хет-трики с сезона 1992-93 по 2013-14
По пятибалльной системе
Х
Списки хет-триков в футболе
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 8,822
|
Q: Feasibility with LDAP I use OpenLDAP on windows with Apache Directory Studio, and I try to set up a LDAP database that should represent hierarchically data as follow:
*
*root
*
*users (email)
*
*applications (application code)
*
*companies (company code)
In order to retrieve:
*
*the list of applications for a specified user
*the list of companies for a specified user and a specified application
Do you know if it is realisable with OpenLDAP (the database creation and the searches)?
A: Can you create such a model using LDAP? The answer is yes, and you can do it in multiple ways (hierachical, flat with réferences etc.).
But the thing you must understand is that LDAP is a directory not a Database :
*
*You can modify the base Schema to add your classes and attributs, but you do not create tables with records.
*It's operational, for data you are going to look for, but not for data that you will change a lot.
A: Best practice is to use a nearly Flat directory structure. Complex structures change and reorganization can be very difficult.
A multi-valued attributes for company and applicaitons would probably work.
-jim
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 2,673
|
{"url":"https:\/\/stats.stackexchange.com\/questions\/112689\/standard-error-for-expected-value?noredirect=1","text":"# Standard error for expected value [duplicate]\n\nI have a computer simulation from which I get a sample of values of some microscopic quantity $X$, i.e. $\\{ x_1,\\ldots,x_N \\}$. I'm interested in estimating the expected value of $X$, i.e. $E[ X]\\approx\\frac{1}{N}\\sum x_i$, and the variance associated with this estimate.\n\nNow, do I understand correctly that:\n\n1. taking the estimate of the variance of $X$, $Var[X]\\approx\\frac{1}{N}\\sum (x_i-\\bar{x})^2$, is NOT what I'm looking for (which in this notation would be $Var[E[X]]$)?\n\n2. I need to make use of some statistical technique, such as bootstrapping?\n\n## marked as duplicate by whuber\u2666Aug 20 '14 at 21:29\n\n\u2022 The duplicate showed up in a site search for \"standard error\" + mean. Many more related posts can be found in the same way. Please note that \"$E[X]$\" usually refers to a number--the expectation of $X$--and that your formula is the sample mean, which is a realization of a random variable. It is often written $\\bar{X}$ and its realization (as given by the formula) as $\\bar{x}$. This question seeks information about computing the standard error of the sample mean qua estimator of the expectation. \u2013\u00a0whuber Aug 20 '14 at 21:31","date":"2019-08-22 18:04:04","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.9023228287696838, \"perplexity\": 266.4631557666366}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2019-35\/segments\/1566027317339.12\/warc\/CC-MAIN-20190822172901-20190822194901-00483.warc.gz\"}"}
| null | null |
let btn1 = document.getElementById("btn1");
let btn2 = document.getElementById("btn2");
let btn3 = document.getElementById("btn3");
let btn4 = document.getElementById("btn4");
let btn5 = document.getElementById("btn5");
let btn6 = document.getElementById("btn6");
let btn7 = document.getElementById("btn7");
let btn8 = document.getElementById("btn8");
let btn9 = document.getElementById("btn9");
function clockwiseRotation() {
[btn1.innerHTML,
btn2.innerHTML,
btn3.innerHTML,
btn4.innerHTML,
btn6.innerHTML,
btn7.innerHTML,
btn8.innerHTML,
btn9.innerHTML] =
[btn4.innerHTML,
btn1.innerHTML,
btn2.innerHTML,
btn7.innerHTML,
btn3.innerHTML,
btn8.innerHTML,
btn9.innerHTML,
btn6.innerHTML]
}
btn5.addEventListener("click", clockwiseRotation)
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 7,219
|
_To Lois and Jacques Beckwith, who encouraged me to follow my passion_
**_" We had a kettle; we let it leak:_**
**_Our not repairing made it worse._**
**_We haven't had any tea for a week..._**
**_The bottom is out of the Universe."_**
**_—_ Rudyard Kipling, "Natural Theology"**
CONTENTS
**Introduction**
**A little on the tea plant**
**A little on the six types of tea**
**A little on shape and size**
**A little on the taxonomy**
**A little on names**
**A little history**
**A little on choosing tea**
**A little on altered tea**
**A little on dark tea, also called fermented tea or _heicha_**
**A little on labels**
**A little on health**
**A little confusion**
**A little to add**
**A little on preparation**
**Glossary**
**List of Photographs**
**Recommended Reading**
**Index**
INTRODUCTION
You're holding this book because you love tea. Perhaps you can't begin a morning without a cup of English Breakfast. You may have a favorite mug. You might carry that mug to work, along with an assortment of tea bags. Yet you don't know much about your beloved brew, and exploring it further seems to require fancy porcelain, a NASA thermometer, and a sheepdog's discerning nose. As the venues expand—your local café may now sell loose teas—and choices proliferate, it's even more intimidating. Quick searches on your phone ( _tea, Sencha Fukamushi, what???_ ) leave you baffled.
_A Little Tea Book_ is for you.
There are many lengthy texts, authored by great minds, which delve into every aspect of tea. _A Little Tea Book_ is different: It's an accessible primer delivering basic, but thorough, information. You will find here a wide range of material, but it's not a workbook or encyclopedia. Instead, I'm offering you a little about a lot. _A Little Tea Book_ will _start_ you on your way, offering a solid foundation (and a boatload of confidence) from which you can then continue the exploration—by yourself, and with family, friends, and colleagues.
Over the past two decades I've forded high rivers in Bhutan, hiked through remote Lao villages, and climbed miles of terraced land in China, all to find the best-quality tea for the finest restaurants in the country. I started my company, In Pursuit of Tea, to source these single-lot, traditionally made, loose-leaf teas direct from origin.
During my adventures I've talked to scores of tea fanatics, discussed flavor and pairings with every manner of foodie, and exchanged ideas with tea purveyors and farmers around the world. But my true joy is talking tea with people who are new to it. I've trained sommeliers and servers at restaurants that include Eleven Madison Park, Daniel, and Blue Hill at Stone Barns. I've sat for hours with curious friends sampling fresh picks from my travels. Over the years, many people have begun their tea journey with me, and have been inspired to continue it.
Welcome, I'm happy you're here. My life's work has been teaching people about tea, and now I am honored to teach you.
**A little on the tea plant**
All tea comes from just one plant, _Camellia sinensis_. One plant! This is the first of many facts that surprise even the most enthusiastic tea drinker. There are six basic types of tea—white, green, yellow, oolong, black, and dark—and all of them originate only from the leaves of _Camellia sinensis_.
This means that many of the beverages you've assumed are teas are not technically teas at all. Chamomile? Ginger Spice? Licorice Heaven? Jasmine Soothing Nighty Night?
They can be tasty. But they're not tea.
You can call them tisanes (if you're European), infusions (if you're a tea-o-phile), herbals (if you're Californian), or just hot drinks (if you're me). The real stuff is made from the caffeine-containing _Camellia sinensis_ , meaning white, green, yellow, oolong, black, and dark teas are all true teas; anything else is made from other plants.
A general rule of thumb is that if there isn't caffeine, it isn't _Camellia sinensis_ (unless, of course, it's a tea that's been decaffeinated).
**A little on the six types of tea**
To understand what ultimately ends up in our cup, let's pluck a leaf from the tea plant, _Camellia sinensis_. This is the first step in the tea-making process.
When the _Camellia sinensis_ leaf is picked, oxidation begins. With tea, oxidation means that the polyphenols (chemical compounds such as tannins, flavonoids, and theaflavins) and the enzymes in the leaf react with the oxygen in the air. Depending on the type of tea being made, this process will occur over a short or long time. For green tea, no oxidation is allowed to occur, so the leaf retains its fresh smell and vegetal flavor; black tea is as fully oxidized as possible, which accounts for its dark color.
The order of tea categories from least to most oxidized is generally green, yellow, white, oolong, black, and dark.
Other influential roles are played by air temperature, humidity, heat source, and storage time. This means things like withering, twisting, rolling, heating, drying, resting, and fermenting the leaves all have an effect. Though oxidation is usually the prime determinant, every one of these components may have a say in what type of tea emerges at the end. Are we just picking the leaf and laying it out, doing very little except allowing some natural oxidation (white tea)? Or are we intervening by heating the leaf, then rolling it into various shapes (green tea)? Are we making green tea, but then storing it on a shelf to undergo fermentation (dark tea)?
Let's look at all six types of tea, in order of those that we influence the least to those we influence the most.
**White tea:** Minimal interference here: This leaf is generally only picked and air-dried (also known as withered). It is usually harvested in the spring, when there are fresh new leaves and the unopened buds are still covered with silky white hair. During the drying process there may be some oxidation, which stops naturally when enough moisture evaporates from the leaf. It can be made up of just the downy buds when picked early in the season, as with Yinzhen Silver Needle; when picked a few weeks later, there will be both buds and small leaves, as in White Peony Bai Mudan. White tea originated in China's Fujian Province.
**Green tea:** When the leaf is picked and then heated almost immediately by pan-firing or steaming, oxidation is prevented. This accounts for the green tea leaf's color, ranging from an earthy olive to a deep emerald. The leaf is then formed into a variety of shapes. The first kind of tea ever produced, this category is traditionally made in China, Japan, and Korea. Long Jing, Bi Luo Chun, sencha, matcha, and gyokuro are just a few of hundreds of distinctive green teas.
_What's really happening to the tea leaf during processing? We now commonly use the term_ oxidation _, but the preferred term for many years was_ fermentation _(a direct translation of the Chinese_ fa jiao _). In fact, the complex chemical reaction between the leaf's enzymes and polyphenols can be more accurately described as_ enzymatic browning _. This is a well-known concept in food science; a common example is the gradual darkening of sliced avocado or apple when exposed to air. The more general term_ oxidation _, however, is currently widely accepted._
**Yellow tea:** Found mostly in Anhui and Sichuan Provinces in China, this type is made much like green tea, but it is heated to a lower temperature. More moisture is retained in the leaf, which is then allowed to dry slowly and oxidize slightly over a low charcoal fire for a few days. This style was common centuries ago. But yellow tea takes more effort and time to produce than green tea, which is why it is now increasingly hard to find.
_Tea plants can grow to more than thirty feet, but are commonly pruned to waist height for easy plucking. When a tea plant is three to five years old, its leaves are usually ready to be picked and processed._
**Oolong tea:** Picked and often bruised to encourage interactions between the leaf's enzymes and polyphenols, this style is allowed to partially oxidize before undergoing shaping and heating. The shaping, which entails extensive rolling or twisting, makes oolongs more processed than white, green, and yellow teas. This type of tea requires great skill to make, and yields a wide range of flavor and fragrance. Oolongs have incredible complexity and the ability to be steeped over and over, offering nuanced flavors and aromas with each infusion. High-quality oolongs come from regions in China (such as Wuyishan, Phoenix Mountain, and Anxi) and Taiwan (notably Taipei, Nantou, and Hsinchu counties).
**Black tea:** This type of tea likes as much oxidation as possible. First the leaf is withered, losing moisture, stiffness, and weight. Then it is rolled, which encourages oxidation by breaking open cell walls. After several hours' rest, it is fired. This is the most widely produced style of tea, and is often what people in the West expect when asking for a "regular tea." Assam and Darjeeling are well-known styles from northern India; Ceylon, from Sri Lanka, and Keemun, from China, are also very popular. English Breakfast falls in this category, though this is usually comprised of commercial black teas grown in many countries, mechanically harvested and processed, and then blended for consistency.
**Dark tea:** This category encompasses subsets of tea that can be quite different. The most common is called pu-erh, which is roughly processed as green tea then set aside to age and mellow. During this period the tea continues to undergo change, including fermentation, from several months to many decades, which is why I consider this the tea type subject to the most outside influences. Pu-erh was originally the name of a trading town in Yunnan Province, China, where farmers would bring their tea to sell.
**LOST IN TRANSLATION**
_Matcha is a powdered Japanese green tea. In recent years it has expanded from its traditional roots, such as with this delicious cocktail created by Marcie Andersen at Daniel in New York City._
**2 tablespoons Avua Prata Cachaca**
**2 tablespoons Mizu Shochu**
**1 tablespoon lime juice**
**1½ tablespoons simple syrup**
**1 gram matcha, plus more for garnish**
**1 egg white**
**Pour all ingredients into a cocktail shaker. Dry shake, then shake with ice; strain into wide clay bowl or preferred vessel without ice. Garnish with dusting of matcha powder. Makes one cocktail.**
**A little on shape and size**
As mentioned previously, the many steps to transform the tea leaf might include changing its shape and size. It can be left in its natural leafy form (like white tea); it can be pressed into a brick (like many dark teas, especially pu-erhs); it can be spiraled, balled, or twisted by hand (oolongs have some beautiful examples). It may also—and this is my least favorite, because it blunts flavor—be mechanically chopped up and stuffed into tea bags. All these processes influence the appearance, smell, and taste in the cup. While there are shapes typical of each type of tea, there are no absolute guidelines.
Tip _refers to the immature leaf bud of the tea plant. If a particular lot is_ tippy _, it indicates a careful hand-picking and may taste sweeter (although not always). It may also be more expensive, as the bud often has better flavor._
_I am often asked whether there is a word like_ cheers _or_ prost _to signal that tea drinking should begin. There isn't, though the act of pouring is one signal to drink. There may also be an almost imperceptible nod or bow. When a cup is poured in China, tapping the index and middle fingers twice on the table is a traditional way to indicate appreciation._
One shape I had heard of but never seen was from a green tea called Bang Laa, made only in the northern province of Phongsaly in Laos. I was curious to try it, so in 2000 I set off from the capital Vientiane, first waiting for an old Soviet helicopter that never came, settling instead for two long days of riding in the back of a hired truck. When I finally arrived at a small village, I watched as men and women steamed green tea and stuffed it into hollow stalks of bamboo to dry. They told me they would then remove the tea, which would retain the tube shape, and secure it with bamboo laces. They were intrepid tea makers and also excellent hosts, offering me food prepared over an open fire inside their thatched home, and so much of the local rice-based spirit that I had to pour every other glassful through the floorboards when they weren't looking. I brought home as much Bang Laa as I could carry, delighted by this unique way of making and packaging tea. It was a brilliant use of local materials, and the tea had a wonderful smoky taste, which no doubt came from the nearby cooking fire.
**A little on the taxonomy**
I've shown you how one plant, _Camellia sinensis_ , transforms into six different categories of tea. But there's a little more to it: Much as all wine can be said to derive from the one _Vitis vinifera_ (wine grape) though there are countless varietals, there are many different kinds of the tea plant as well.
Tea is classified like any organism. It comes from the genus _Camellia_ , and the species _Camellia sinensis_ ( _sinensis_ is Latin for China). There are two main varieties: _Camellia sinensis assamica_ and _Camellia sinensis sinensis_. The _Camellia sinensis assamica_ variety has large leaves, can reach up to three stories high, and grows well in warm climates. It is often found in southern and southwestern China, India, and Sri Lanka. _Camellia sinensis sinensis_ is prevalent in the rest of China, as well as throughout Japan and Taiwan. This variety has smaller leaves, is hardier, and can grow at higher elevations.
_Yunnan, in southern China, is the home of pu-erh tea and one of the origins of the tea plant itself. If you're game for a tough jungle trek, you can ogle, like I once did with open-mouthed joy, a 2,700-year-old tea tree, one of the oldest in existence._
_True matcha is made by depriving tea bushes of sunlight three weeks before harvest—this increases the level of chlorophyll. The leaf is hand-picked, then steamed and dried into a green tea called tencha. After the tough stems and veins are removed, the leaf is ground on a granite wheel into a fine powder. The color of traditional matcha should be a vibrant neon green. Lower-quality matcha may be brown because veins or yellowing leaves remain, or the plants were not well shaded._
A variety refers to an adaptation of the plant that occurs naturally. A tea plant bred by humans, on the other hand, is called a _cultivar_. Cultivars lock in certain traits such as color, disease resistance, or general hardiness (so a Fuji apple is a variety, but an Autumn Glory, which is a Fuji crossbred with a Golden Delicious, is a cultivar). Varieties reproduce naturally through seeds, which means that they never come out exactly the same as the previous generation (much as we humans are a random blend of our two parents' traits). When certain characteristics evolve in a plant, tea producers may clone that plant using grafts to preserve the desired traits, propagating it as a cultivar. For instance, a tea estate in Darjeeling may make its black tea from _Camellia sinensis sinensis_ , using the specific cultivar Happy Valley 36—one of many developed by the local tea research institute for that area's distinct terroir and environmental conditions.
**A little on names**
You may ask for green tea at a café counter only to be overwhelmed by the many names the barista offers you. Hojicha? Misty Cloud? Lu'an Gua Pian? All are green teas, but they vary widely in taste because of factors such as the weather and soil in which they were grown, the time of harvest, and the way the leaves were manipulated and heated (pan-fired or steamed).
_"What's English Breakfast?" asked my friend David. He's from England and grew up familiar with regional names for black teas, such as Assam, Keemun, and Ceylon, but he'd never heard of this type. That's because the term_ English Breakfast _—which refers to any strong black tea or black tea blend served in the morning—probably came from the United States, though its exact origin is unclear._
**JASMINE COOLER**
_Recipe by Yana Volfson, Beverage Director at Cosme and Atla, New York City._
**¼ cup Zirkova vodka**
**1½ tablespoons cucumber water**
**3 tablespoons lime juice**
**1 tablespoon simple syrup**
**⅓** **cup jasmine water (recipe below)**
**cucumber**
**Pour all ingredients in a cocktail shaker, and mix. Strain over fresh ice into your choice of highball-like glassware, such as a Moroccan tea glass. Garnish with a thin slice of cucumber. Makes 1 cocktail.**
**JASMINE WATER**
**Add 1 tablespoon Jasmine Pearls tea to 3⅓** **cups hot water. Allow infusion to sit for 5 minutes, then strain.**
To make it more complicated, the same name does not always mean the same tea. A green tea of high quality may have the same name as that of a low-quality green tea and taste entirely different. For example, sencha is the most common Japanese green tea. This tea is steamed after picking and can be made from many different cultivars or often, a blend of several. Depending on the region of origin and how it was produced, the resulting tea and quality level will be quite different. It might be hand-rolled by a skilled artisan, or machine-rolled and made in larger batches. The most valuable sencha may be shaded ( _kabuse_ in Japanese) for two weeks before picking—this decreases UV light and slows the rate of photosynthesis, which helps the tea develop a prized umami flavor and sweetness—while other senchas may not be shaded, and might not hail from a top-quality leaf.
Sometimes the name will refer to the cultivar, like Sencha Yabukita or Sencha Okuyutaka. Other times the name describes the process a tea goes through. So Sencha Asamushi (which means "light steamed") undergoes about a minute of steaming, while Sencha Fukamushi (which means "deep steamed") is steamed longer, usually for around two minutes. The length of steaming affects appearance and flavor: increased exposure to heat degrades the leaf of Sencha Fukamushi, resulting in a more broken appearance, instead of the finer needle-shaped leaves possible after a lighter steaming. Broken leaves will infuse in your teapot more quickly because of the greater surface area, resulting in a stronger flavor.
_Chinese tea names can be deciphered by using the simple but brilliant website babelcarp.org. For instance, Lu'an Gua Pian means green tea melon flake (or seed), referring to the tapered oval shape of this tea's leaves._
On my first trip to Taiwan I drank an unnamed tea that consisted entirely of twigs discarded during the making of a fine oolong. The farmer had decided there was no need to waste any part of the tea plant, and had roasted these twigs over charcoal. While twig tea is more popular in Japan, this impromptu Taiwanese version tasted great—it was the perfect everyday tea. I brought some home to sell, but now it needed a name. I decided on Tung Ting (the region it came from) Kukicha (the term for twig tea in Japan). I soon realized that this appellation, while it had a certain ring, was probably too confusing for my customers, so I changed it to Wood (because of the twigs) Dragon (because the word oolong translates to black dragon). Sales went up, proving that tea names, while inconsistent and incomplete, can make a difference!
**A little history**
Years ago, while working as an adventure travel guide in Bhutan, I heard that the royal family had planted a private tea garden. I'd seen only compressed Chinese tea and Indian black tea consumed in Bhutan so I wondered if the tale was true. Little else was known about this mysterious garden except that it might be located in the remote Trongsa Valley. I traveled there and eventually found a crumbling estate, once a winter palace, now a half-abandoned school for monks. I met the head monk, who allowed me to sleep on the top floor, empty except for beautiful fading murals on the walls. The next day I explored the dilapidated grounds and finally found a group of overgrown tea plants as big as apple trees. The locals told me they'd been brought here from India about a half century before. After further research I discovered the plants probably came from Kalimpong in West Bengal, carried over by a cook who worked for the second king, and that the leaves had been picked to make a rough black tea for the royal family. The plants were vibrant and healthy, so I worked with the Ministry of Agriculture and a local family and today a cooperative of twenty-seven women produce a wonderful tea—Thunder Dragon Green—in that valley.
That tea is tended and sold in Bhutan doesn't sound miraculous to most of us. Indeed, tea is now grown around the world. But for thousands of years the tea plant could be found only in a tiny area of the planet: the mountainous jungles of what is now southern China, eastern Burma, northern Laos, and northeast India. The leaf may have been chewed at first, but by roughly 500 B.C.E.* people had learned to tend and process it. Consumed mostly for medicinal purposes, including wakefulness, tea as a drink became entrenched in daily life as its cultivation spread through Asia.
Archeologists recently unearthed tea particles which show that Chinese merchants were selling tea along the Silk Road to fellow merchants in India, Tibet, and across the Arab world around the second or third century C.E. By the ninth century, Chinese royalty were trading tea for Mongolian war horses in an era where horses were the equivalent of fighter planes. Monks also traveled across borders at this time, spreading Buddhism, Daoism, and the tea leaf. Japan began to grow tea in the early 800s after a few plants and seeds were brought over from China. As tea became increasingly lucrative, however, China began to keep the plant and the mystery of its cultivation to itself—with a penalty of death for anyone who let that secret out.
_Climate change is wreaking havoc on tea in Assam and other regions: Dependable weather patterns have given way to unpredictable droughts followed by downpours, leaving farmers unable to plan their harvest. However, tea-plant-loving bugs like the leaf hopper can now thrive at higher altitudes due to climate change's warming weather. This has actually helped some high mountain oolongs in Taiwan, because when leaf hoppers bite the tea leaf, defense chemicals are sent out to repel the attacker. This gives the leaf a very fragrant, honeyed character, which can be quite desirable in certain styles of tea._
In the seventeenth century China traded tea with Russia, where it was first considered a cure for inebriation, imbibed either before or after vodka consumption. Tea gradually became embedded in Russian culture, as shown by the ornate metal heaters called samovars specially crafted for the hot drink and considered treasured household items.
Around this time Europeans arrived in Asia, and trade with the West began. Europeans quickly became enamored of tea. But Chinese merchants accepted payment in silver bullion only, and the western coffers quickly ran low. Desperate, Britain and other European countries decided to sell opium grown in colonized areas of India and Burma to the Chinese in exchange for silver. Flooding the country with the drug, and paying for tea with the proceeds, the Europeans were soon back in the game. The Chinese emperor then outlawed opium, destroying a few shiploads to show just how serious he was. Britain wasn't happy. Thus began the First Opium War, and a second soon followed.
By this point the British had pilfered plants and taken them to India, but none had taken hold; the tea bushes were low quality and cultivation and processing techniques were still a highly guarded secret in China. What was needed was a large number of high-quality seedlings and careful husbandry. Enter Scottish botanist Robert Fortune, a man with an obsession for horticulture, a penchant for hardship, and a simple disguise (of a Chinese merchant). Hired by the British East India Company, Fortune snuck deep inside China in 1848, bought tea plants, enticed some willing tea workers, and all traveled to India to successfully set up shop. For the first time, the tea plant was no longer under the almost exclusive domain of the Chinese.
_Going far away to China_
_to seek the sacred shoots_
_Old Eisai brought them back_
_sowed them in our land._
_Uji tea has a taste infused_
_with Nature's own essence_
_a pity folks only prattle_
_about its color and scent._
_—_ Baisaō, _The Old Tea Seller,_ 1675–1763 (Japan)
By the late nineteenth century Britain was growing tea in many of its colonies (notice that the countries of many of today's biggest tea producers were once under British rule), exporting it throughout Europe and beyond. With the theft of the tea plant, China's international tea trade dropped precipitously. Tea plantations spread quickly from India and took hold around the world. Tea can now be found in places as varied as Iran, the Azores, Argentina, and Kenya—and China's tea production is again thriving.
Tea bags were invented in the late 1800s but became wildly popular only after a New York tea purveyor named Thomas Sullivan sent samples of tea in silk bags. These were intended to be opened, the tea emptied out and then brewed, but customers instead dropped the bags straight into the water—and then complained that the material did not allow for the tea to steep. Sullivan turned to a more porous cloth and the tea bag was quickly embraced in America (though most of Britain turned up its nose, using loose tea until the mid-1970s).
In the spring of 2000, I boarded a sleek wooden boat on the Lao side of the Mekong River and traveled across to northern Thailand, eager to taste the oolongs I'd heard so much about. The oolong industry thrives here because of an unlikely event in 1949: China's national army (Kuomintang) was routed by the rebel Maoists, and while most retreated to their home of exile in Taiwan, one unit fled instead to nearby Burma. Known as China's Lost Army, many of these soldiers remained in the mountains after the war. They continued to battle the Communists for the Thai government, and in exchange were given homes in the northern hills of Thailand. In the mid-1980s, with no more wars to fight, these men and their families began to farm, and their strong ties to Taiwan gave rise to an oolong tea industry that is continuing to improve. I spent many weeks exploring remote corners of these hills, finding homemade soy sauce along with oolong tea and even a Chinese family making and pressing pu-erh from the local wild assamica plants.
Throughout its history, tea has crossed not only geographic boundaries but political, socioeconomic, cultural, and religious ones as well.
* * *
* Pinpointing exact dates for much of tea's history is challenging: As is to be expected with such an ancient beverage, we have only general ranges for some events.
**A little on choosing tea**
I often encourage people to think of tea the same way they think of wine. For example, you might like Sauvignon Blanc, but not Chardonnay or Pinot Grigio. Maybe at some point you realize your tastes are even more refined: you prefer a Sauvignon Blanc made in California to any from Australia. You might narrow it further to a region (Santa Ynez Valley), and then even to a specific winery. Or not—you could be happy with any and all Sauvignon Blancs, and leave it at that.
_Wuyi oolong is grown in the Wuyi Mountains, a small range in northern Fujian Province known for its soaring cliffs and staggering biodiversity (including more than 4,000 botanical species). The tea plants here grow amongst rocks and stones, giving this famous oolong its distinctive mineral character. Six of these plants are at least 350 years old and yield a rare and revered oolong so expensive that the area is watched by cameras and patrolled by guards: it sells for the equivalent of $10,000 a pot! The Wuyi Mountains became a UNESCO site in 1999._
_There are so many ways to describe tea! Chef Ignacio Mattos, of Estela, Café Altro Paradiso, and Flora Bar in New York City, tasted Spring Fortune (an oolong from Taiwan) and claimed it reminded him of pizza—with its deep fruitiness, like cooked tomatoes, and its intense savory element, like cheese._
It is the same with tea. I encourage you to try as many teas as possible to understand how they differ in taste and aroma. You could do this randomly, switching up your morning choice every now and then. Or you could proceed with more purpose, by lining up a selection and tasting them alongside one another. This means taking a small sip, then aerating that sip across all your taste buds with your mouth slightly open. Do this with friends and discuss each tea as it is tasted. If you are unsure how to start, remember that tea flavors fall into basic categories of **fruit** , **floral** , **marine** , **mineral** , **sweet** , **spice** , **wood** , and **earth** , among others. Feel free to offer specific, possibly poetic, descriptions such as pineapple, lychee, burnt sugar, saddle leather, ocean air, freshly mown grass, stone, chalk, roasted chestnut, pine, resin, mushroom, boggy moor, or even barnyard.
Perhaps you find you are a fan of green teas, while the earthy taste of dark teas suits you less. Perfect! Now venture out and explore the nuances: Green teas grown in China often have a nutty, roasted, vegetal profile while those from Japan tend to be more grassy and rich. Prefer the latter? Go one step further: Japanese green teas differ from each other based on the cultivar, the tea garden's terroir, the time of year the tea was harvested, and the amount of time the leaf has been steamed.
I select teas primarily on taste, but I'm also mindful of the way the tea was grown, its effect on the environment, and how the workers are treated. I recently started sourcing a delicious black tea made by a man named Tenzing Bodosa, who owns a tiny eleven-acre farm in Assam, India, near the Bhutanese border. When I met him, Mr. Bodosa had only recently quit a job in construction to produce tea full time. He grows his tea without any chemicals, instead concocting herbal elixirs to repel pests. He also intercrops with pomegranates and mangoes to maintain the health of the soil, and leaves his land unfenced so that the wild elephants can pass through his garden with minimal hassle. When I last visited I wasn't lucky enough to catch sight of those grand beasts, but I saw their massive footprints and formidable scat, marveled at the underbrush they had toppled, and heard them trumpeting in the distance.
**A little on altered tea**
Some teas are flavored or scented with oils or flowers (or chocolate or roots or lemongrass). Common examples include chai, an Indian style of black tea mixed with spices and simmered with water, milk, and sweetener; jasmine tea, traditionally made by letting green tea intermingle overnight with fresh jasmine flowers for a series of several nights; and Earl Grey, a strong black tea flavored with bergamot oil.
_The term English Breakfast refers not to a particular blend but to any caffeinated tea you might drink in the morning—usually a bold black tea that goes well with milk and a sweetener. Companies make their own proprietary English Breakfast. For instance, one might mix 50 percent Keemun and 50 percent Ceylon. Another might not blend at all, marketing Assam as English Breakfast. Many people don't realize this and ask specifically for English Breakfast, so restaurants offer it on their menus—and then serve whatever black tea is in house._
_Earl Grey is the name for any black tea flavored with citrus oil. Bergamot, a citrus grown in the Mediterranean, is the traditional source. But this oil is quite expensive, so tea companies often mix in other citrus oils. I like to use 100 percent bergamot oil mixed with Ceylon, a brisk black tea from Sri Lanka, though I sometimes offer a special Darjeeling infused with pure bergamot for a slightly different flavor._
Altered teas also refer to those that are blended. This means that different cultivars or lots may be mixed together and branded with a particular name. Most commercial teas are blended, assuring a consistent taste. If you like Twinings English Breakfast you're in luck, because when you order it in Miami next week it's going to taste just like the one you had in San Francisco last year and will have in London in the future.
Most tea consumed today is what is referred to as "commodity tea"—mass-produced in many countries around the world and blended for consistency. This is the low-quality tea found in basic tea bags, iced tea, and most other bottled tea beverages.
**THE EARL GREY MARTEANI**
_Audrey Saunders, cocktail industry luminary and co-founder of Pegu Club, created this for Bemelmans Bar at the Carlyle Hotel in New York City._
**3 tablespoons Earl Grey gin infusion (recipe below)**
**1½ tablespoons lemon juice**
**2 tablespoons simple syrup**
**1 egg white**
**1 lemon**
**½ cup lemon zest sugar (recipe on following page)**
**Measure Earl Grey gin, lemon juice, simple syrup, and egg white in a mixing glass. Dry shake. Add ice, shake well. Strain into a chilled cocktail glass that has been half-rimmed with lemon zest sugar. Garnish with a lemon twist. Makes 1 cocktail.**
**EARL GREY GIN INFUSION**
**Measure 4 tablespoons of loose Earl Grey tea into a 1-liter bottle of Tanqueray gin. Replace cap and shake well to agitate. Allow tea to steep in gin for 2 hours.**
**Pour gin infusion through a strainer into an empty bottle or bowl (in order to catch loose tea leaves) but do not press down on tea to extract excess gin. Pressing the tea may add unwanted bitterness to the gin.**
**LEMON ZEST SUGAR**
**Grate fresh lemon peel (yellow rind only; avoid grating bitter white pith) and mix with ½ cup sugar.**
I prefer unblended teas, also called single origin teas. What they lack in consistency they make up for in surprise. I like the flavor, as well as the connection to the regions, the producers, and their traditions and craft. Many fine restaurants used to offer bagged tea blends to their customers, and when I first started selling tea in the late '90s, I had to convince these chefs that the unpredictability of a single origin tea was worth it. But they quickly understood: boxed wine offers consistency, yet wine in bottles is much preferred. That's the beauty of a single origin tea as well. Innovative restaurateurs saw that people wanted to go beyond what was so common in the marketplace and try teas that they didn't have access to elsewhere.
There is an unusual altered tea in Burma called _lephet_ which is not drunk, but eaten as a pickled relish or condiment. I first visited Burma in 2000. While there I pried myself away from Bagan, possibly the most beautiful place I have ever seen, and headed toward Mogok, famed for its rubies, to meet some tea farmers who made both green and black tea and sold it locally. It was there that I discovered lephet which, once processed, is left to sour in a ten-foot-deep pit, and then removed after a few months. Lephet has been described as both a fermented tea and a pickled tea, but it is unclear what the actual process is. I consider it an altered tea because it begins as a green tea and becomes something quite different. It is usually mixed with tiny dried shrimp, fried garlic, sesame seeds, and a light dressing, and enjoyed as a salad in tea houses and bars.
There are many levels of excellence with every agricultural product, and it may be hard to tell just what you're getting. I advise trusting your palate and judging your tea by taste. If you enjoy what you've chosen, it is perfect for you!
**A little on dark tea, also called fermented tea or _heicha_**
The sixth type of tea is called dark tea. In China, these fermented teas are known as _heicha_. The most popular type of tea in this category is called pu-erh. Pu-erh comes only from Yunnan Province; similarly, Champagne originates from a certain region in France and everything else is sparkling wine. Japan and Korea also produce dark teas, using slightly different techniques. Dark teas are often pressed into bricks and cakes or packed into bamboo sticks, but they can also be found loose. They may then be aged while stored in a protected area, away from light.
The older pu-erh cakes, which weigh about three quarters of a pound and are called _bingchas_ , can be quite expensive due to their increasing scarcity. A friend in Hong Kong recently bought two bingchas from the 1950s; he paid $45,000 for each!
_I divide pu-erh into three categories. The first is referred to as_ sheng _, and like all pu-erhs, it must be made from the broad leaf_ Camellia sinensis assamica _plant. It must be heated so that oxidation is slowed but not stopped, it must be dried in the sun, and it must be from Yunnan Province. When consumed in its first few years it can be tannic and astringent, an aspect some people appreciate._
_The second type occurs when this sheng tea is allowed to age even further, and is called aged sheng pu-erh (_ chen nian pu-erh _). It changes over time: Sometimes this means mellowing, and often the taste becomes more complex. Varying humidity and temperature, combined with the ambient yeast and bacteria of the storage environment, allow this tea to go on a unique journey._
_The third type was invented at the Kunming Tea Factory in Yunnan about fifty years ago, and is called_ shu _pu-erh. To make shu, the base tea is heaped on factory floors, left there for a number of weeks, and turned every so often (depending on the tea maker's personal recipe) while moisture is added. This process is called pile fermentation (_ wo dui _) and mimics the effects of the long-term storage that sheng pu-erh undergoes naturally over time._
**A little on labels**
We look to labels for clarification whenever we buy something. Unfortunately, every country—or even region—has its own set of tea label conventions. Each puts different information on its packages or describes the same information differently. Like tea names themselves, tea labels vary greatly, with little rhyme or reason. In general, however, tea labels typically try to describe things such as shape, origin, origin myth, quality, and time of harvest.
_The term "orange pekoe" refers not to the citrus fruit, but to a particular leaf shape. Orange was a nod to the Royal House of Orange, which ruled Holland when the Dutch East India Company began to trade in tea. Pekoe allegedly comes from the foreigners' inability to pronounce_ bai hao _, or white tip, which refers to the bud of the tea plant._
One thing the label doesn't offer is evidence of the product's quality, no matter how much you are assured that the tea is "extra fancy" or "finest supreme." I have seen tea described as "Extra Choicest Rich Bouquet," while another has boasted "An Exceptional Tea of Quality Grown in the Himalayas." How about one that promises "Organic Serenity Now"? None of these gives much of a clue about the vendors' tea, only insight into their marketing minds.
Does this mean that teas are just randomly labeled with no attempt at evaluation? No. In order to set a value, and ultimately a price, a tea is assessed—but unfortunately there are no universal metrics. So Kenyan tea producers may judge aspects like thickness (mouthfeel) and vaguer notions like high and sharp or pure and sweet. Meanwhile an estate in Darjeeling scrutinizes nose, vitality of color, and briskness. All of these will also be very subjective, much like wine descriptions.
Sometimes a label will refer to the leaf grade. The term "grade" does not necessarily refer to quality, but often to size and shape. Labels might mention grades like full leaf, broken leaf (including fannings and dust), and CTC (cut, tear, curl), a type of machine processing. Orange pekoe (pronounced either peck-o or peek-o) is also a leaf grade, describing a long, twisted leaf; it is not, as some think, an assessment of flavor. (If you've had a tea labeled orange pekoe and you've exclaimed about the fine citrus taste, you may have been influenced by the power of suggestion.) Other shape and size descriptions include flowery orange pekoe and tippy orange pekoe. Sometimes words are eschewed for an alphabet-soup-looking acronym like SFTGFOP, which stands for **s** pecial **f** inest **t** ippy **g** olden **f** lowery **o** range **p** ekoe (consider also BOPF— **b** roken **o** range **p** ekoe **f** annings). Usually full leaf teas are considered superior in taste while the broken leaves and dust are set aside for blends and tea bags. That said, even the category of dust has a range of quality and corresponding value. And high-end tea bags may now use full or broken leaves.
_The first harvest of the season is often considered to be the highest quality, and can be the most expensive. This is called first flush in India;_ shincha _("new tea") in Japan; ming qian (before the Qing Ming Festival) in China; and_ ujeon _(before the spring rains) in Korea._
To avoid nonsense and market-speak, I keep my own tea labels factual and limit the adjectives to just a few succinct descriptors. There is the name (Nantou Four Seasons), the location (Nantou County, Taiwan), the type and shape (oolong, ball shape), the cultivar ( _si ji chun_ ), a few words on the aroma or taste (fragrant, lilac, sweet), and the ingredients ( _Camellia sinensis_ leaves).
Here's another example, from one of my tea labels:
My advice is not to get too caught up on what labels say; instead, concentrate more on the origin of the tea and the taste, as well as the price you are willing to pay.
**A little on health**
There are many claims about the healing magic of tea; it has been touted as medicinal for centuries. This may have its origins in the benefits derived from consuming boiled water, which was otherwise often dirty, and not from the tea itself. Perhaps the alertness that comes from the caffeine was seen as a sign of improved health. Certainly the sensory uplift from a good cup of tea—and the soothing qualities of any hot beverage—has always been a boon to well-being.
_The famous sixteenth-century Chinese herbalist Li Shizhen claimed that tea dampened inner fire, and was healthy for young people with robust energy but not necessarily for those with weaker inner qi. He also cautioned against tea's addictive qualities, though he advised these could be countered—by eating tea leaves from a woman's shoe._
While many modern studies point to healthful qualities—the tea plant contains antioxidants, for example—the exact effects on human bodies are inconclusive and research is ongoing. In addition, many of these studies involve different parameters, so it's hard to compare them. Ultimately, there is no definitive scientific evidence that tea is a curative. My answer to the question, "Which is the healthiest tea?" depends on my mood. I either suggest my favorite tea or the truth: Drink a tea that you enjoy, take a walk, and eat an apple!
What about caffeine? Many of us drink tea to wake up at the beginning of our day. You may even have heard that _Camellia sinensis_ contains more caffeine than coffee beans. This is true, but misleading. We use much less tea than coffee by weight for a serving, so your cup of tea actually has at most one half the amount of caffeine as a cup of coffee. The relative level varies depending on the leaf used (the buds have higher concentrations), the cultivar, the leaf shape (a larger leaf results in a slower infusion because there is less surface area than, say, a fanning tea grade in your cup), and the brew time and technique (since caffeine is water-soluble, the longer tea steeps, the more caffeine is extracted; powdered tea like matcha has more caffeine because the leaves are consumed, not infused). It is important to note that caffeine does not correspond with tea type, so one cannot categorically say that black tea has more than green, or yellow tea has more than white.
Tea also contains the unique calming and relaxing—but not sedative—amino acid theanine, which has been found only in _Camellia sinensis_ and one mushroom, _Boletus badius_. Theanine has been shown to improve mood and increase focus when combined with caffeine. This may be why tea drinkers often avoid the anxiety and jitters of those who imbibe coffee (known to some of us tea lovers as "devil juice").
**GREEN TEA PUNCH**
_Speaking of feeling good, this is how Jim Meehan, author of_ The PDT Cocktail Book _and_ Meehan's Bartender Manual _, makes a rum punch using tea._
**1** ⅓ **cups brewed sencha tea (4 grams leaves brewed with 1½ cups 170°F water for 5 minutes)**
**1** ⅓ **cups brewed mint infusion (3 grams leaves brewed with 1½ cups boiling water for 1½ minutes)**
**1 cup cane sugar**
**4 cups crushed ice**
**1¼ cups lime juice**
**750 ml bottle Banks 5 Island rum**
**nutmeg**
**Brew the sencha and mint, and mix together in a large container. Stir in the sugar until it dissolves, then add ice to chill the mixture.**
**Add the lime juice and rum, then chill the mixture before serving, or serve in a punch bowl over one large block of ice. Ladle into small cups filled with ice and garnish with grated nutmeg. Makes 10 cups.**
**A little confusion**
There are several aspects of tea that are confusing, even to those in the tea world. Here are a few in case you want to delve deeper:
While the chemical process that occurs in the first five types of tea is oxidation, you may hear the word fermentation used instead. This is because the science has only recently become clearer, though there are many aspects of traditional tea production that are still not understood.
First flush Darjeeling is often categorized as a black tea, though most of the estates I've visited in this region allow virtually no oxidation to the leaf. This makes it closer to a green tea, although its long hard wither differentiates it too. Production techniques have changed in the last forty years, but people are used to seeing Darjeeling in the black tea category, even when it doesn't fit there quite so neatly.
There is not full agreement on what exactly dark tea refers to. Sheng pu-erh is not always aged; it is sometimes drunk before the fermentation process kicks in. Does this make it simply green tea? And how long is a tea left on a shelf before it is considered aged sheng pu-erh? Some say several years, although there is a lack of consensus.
I've divided tea into six types but sometimes they are divided into more. The categories might be based on how the leaves are heated, how they are rolled, or which specific leaves on the plant are used to make the tea.
_While green teas have been made in China for thousands of years, oolong and black tea emerged at the time trading with Europeans began. It is unclear how this happened_ — _did a tea merchant screw up the processing and sell oxidized tea to an ignorant European buyer, which the Europeans then liked? One origin story for black tea is that soldiers came through a tea farm in Fujian; while they occupied it as a barracks the tea had to sit longer than it usually did. After the soldiers left, workers dried the leaves over pine smoke in an attempt to salvage what could no longer be used for green tea. Buyers liked the taste and eventually it became a huge export to Europe—called Lapsang Souchong._
**A little to add**
Through time, and across different cultures, tea has been made and enjoyed with more than just heated water. In the Himalayas, for example, it's common to mix butter and salt into a black tea. This may sound unappealing to Westerners, but for those who live in a harsh climate at high elevation and perform difficult manual labor, a warm and salty beverage high in fat is ideal sustenance.
Lemon was originally added to tea to change the acidity of the water. This helped to limit the surface scum that forms when tea is made with hard water. We don't see this offered as much anymore—probably because water quality is better today than it was in the past. Some habits die hard, however, and even the finest restaurants might add a lemon slice; personally, I always remind the server not to, since I want to taste the tea itself and not a harsh citrus edge.
_George Orwell felt so strongly about his tea that he wrote an essay enumerating eleven vital elements. Tea, he said, "should be drunk without sugar. I know very well that I am in a minority here. But still, how can you call yourself a true tea-lover if you destroy the flavour of your tea by putting sugar in it? It would be equally reasonable to put in pepper or salt."_
It is often assumed that Europeans first added milk to tea. However, _The True History of Tea_ cites the tradition of tea with milk by Mongolians as well as Manchurians, so the Europeans may simply have copied what they saw in China.
If you do want milk, should it be added before or after the tea is poured? There is lively discussion on this point. High-born Europeans supposedly poured milk in first. This may have been so that their delicate porcelain would not crack from a sudden increase in temperature. On the other hand, George Orwell stated in no uncertain terms that milk must be carefully stirred in after, which ensured the correct amount. Personally, I side with Orwell, as well as with my Scottish friend, Colin Campbell, Thane of Cawdor, who says, "Only ever after, as in happily or milkily!"
Sugar was initially added to tea by Europeans because of tragic historical coincidence: a booming slave trade from Africa to South America and the Caribbean provided labor for sugar production at a time when tea was also becoming popular. A prominent writer named Thomas Tryon decided that sugar was highly nutritious, and encouraged small doses, which some say accounts for why the British began to add it to their tea. Sugar and tea were also heavily taxed, so government officials ignored or simply didn't care about sugar's origins and encouraged its import and consumption.
_"Now you understand the Oriental passion for tea," said Japhy. "Remember that book I told you about the first sip is joy the second is gladness, the third is serenity, the fourth is madness, the fifth is ecstasy."_
_—_ Jack Kerouac, _The Dharma Bums_
What's up with honey? Savvy marketing has convinced the American public that honey is healthier than sugar. It's true that honey contains less glucose and more complex sugars, so it metabolizes a tad slower, slightly minimizing the sugar rush. But any healthy enzymes touted by honey lovers are probably neutralized by hot tea water. Ultimately honey tastes good and that's why many add it to their tea. But tea tastes good too, so enjoy both, and consider doing so separately.
**A little on preparation**
Restaurants often make three big mistakes with your tea. They start with water, often unfiltered, at an incorrect temperature; they neglect to rinse and warm the teaware and tea leaves; and they don't decant the tea when it's ready, instead leaving it to oversteep in the pot. Even if you start with a great tea, these factors can lead to a disappointing cup.
Making good tea is actually very simple. First, **choose the tea** you want to drink. Avoid the tea bag and the metal tea ball, and leave the tea loose! This allows the leaves to open and release their fullest flavor.
Now **choose a teapot** or a cup with a large infuser—no need to fuss over a fancy tea set. (It is, however, important to fill the receptacle with hot water, then pour it out. This preheats the teaware, keeping the water temperature from dropping drastically when poured in.)
**Choose your water.** Avoid straight tap water; it may contain chemicals which will affect the taste of the tea. Use spring or filtered water instead.
**Heat the water.** Many people tell me that this step can be intimidating because optimal temperatures vary with different teas. It is true that black tea is best in water that is just below boiling. Most green tea and white tea tastes better with cooler water (around 180°F). Aged pu-erhs shine when infused at a rolling boil, while young pu-erhs should be prepared with water closer to 195°F. Some Japanese green teas, like gyokuro, are sweetest at a relatively cool 118°F infusion. There is no need to run out and buy a thermometer, though; I mention specific temperatures only to give you an idea of the differing degrees of heat that tea responds to. Definitions like pretty hot, sort of hot, or kind of warm are fine too. Poetic descriptions are even better. Centuries ago, Chinese and Japanese green tea drinkers heated their water until it gently roiled with a sound like "the wind in pine trees."
_I stress that people should use good-tasting water to prepare tea. If you have chlorinated tap water, boil it or let it sit for twenty-four hours so that the chlorine dissipates. One can go down a rabbit hole in this department—spring water, tap water, mineral water, reverse osmosis water, distilled water, bottled water—so keep in mind there is no one water that is best for every tea. Each water will affect a tea differently. Try tasting various types of water. Then taste one tea made with each water, and you will start to understand the complexity._
_Keep in mind three things when considering how to make tea: the amount of tea, the length of time that the leaves steep, and the water temperature. Understanding the relationship between these three factors leads to confidence in your tea preparation. For example, when I use a gaiwan, I use a lot of leaf and a very short infusion time. In a larger Western-style teapot I use a small amount of leaf and let it steep longer. The flavor will not be exactly the same, but both are within the sweet spot for the tea that I'm preparing. In some cases I will use hotter water, which will extract more from the leaf, needing only a short steep. This may be when I'm trying to push a tea to get more flavor after many infusions. Or I might let it sit a long time in cooler water. You can tweak these parameters to influence the finished cup in countless subtle ways._
**_White or green teas:_** _(Well below boiling, about 170°–180°F). These teas are less processed, and often made from more delicate leaves, so a lower temperature helps avoid astringency and maintain their inherent sweetness._
**_Oolongs:_** _(185°–210°F). The more oxidized ball-shaped oolongs need more heat to open and extract their flavor, while others like Oriental Beauty or a twisted-leaf oolong like Bao Chong react favorably to slightly lower temperatures._
**_Black teas:_** _(210°F). To extract the fullest flavor, prepare the hardy black just off a boil._
**_Dark teas:_** _Use a full rolling boil (212°F) for shu and most other dark teas; pour slightly off the boil (around 195°F) for sheng._
Okay, your water has been heated. How much tea should you use? I suggest four grams in a small teapot, if you are using Western-style teaware. If you like to eyeball your measurements instead of weighing them, remember that you will need less if your tea is broken-leafed, balled, or otherwise dense than if it is a twisted full leaf tea (which is lighter). If you are using a small traditional pot or a _gaiwan_ (lidded cup), consider foregoing weighing completely—just fill it a quarter- to half-full with leaf, depending upon the tea density.
Now pour the water over the leaves and let the tea steep for a minute or so. Watch the way the leaves respond. This is part of the sensory pleasure of tea! Tea that is rolled, twisted, or balled will unfurl in what I consider a beautiful dance, and which is sometimes called "the agony of the leaves." After this, try a sip. Pay attention to its flavor rather than its color. Steep longer for a stronger flavor. Two to three minutes is an average steeping time for a Western-style serving; perhaps closer to twenty or thirty seconds for traditional Asian vessels, which tend to be smaller. Most important, rely on your tongue and not the clock. When the tea is as you like it, pour through a strainer or decant completely to avoid over-steeping. Re-infuse the tea when you're ready for more, and enjoy the flavor progression with each subsequent pour.
The number of possible infusions vary according to how much leaf you are using, and the tea itself. A green tea will often yield only a few steeps and not much more, but oolongs and pu-erhs are known for their ability to please throughout multiple pours. It all depends on how strong you like your tea, and how interested you are in the nuances of its flavor as the strength dilutes.
When it comes to tea, I believe in rules of thumb rather than rules, so feel free to play with water temperature, brewing time, and proportion of tea to water. When the tea tastes good to _you_ , it's ready. Enjoy!
GLOSSARY
**agony of the leaves:** The unfurling of tea leaves during infusion; best observed in a transparent vessel. Certain teas provide a spectacular show while steeping.
**antioxidant:** A polyphenol compound which scavenges cell-damaging free radicals, impairing their ability to harm beneficial molecules. These compounds are abundant in the tea plant.
**aroma:** The odor of brewed tea leaves and the resulting liquor; also known as the nose.
**Assam:** A major production region in northeastern India, and one of the largest tea growing regions in the world. Also the eponymous black tea produced in this area, known for its strong, malty flavor.
**astringency:** A drying sensation in the mouth; most noticeable with more oxidized teas.
**autumnal:** Tea produced in the fall, which is usually near the end of growing season; often used in reference to Darjeeling fourth-flush teas.
**Bai Mudan:** "White Peony," a popular style of lightly oxidized white tea containing the bud and top two leaves; originated in Fujian Province, China.
**bergamot:** A citrus fruit grown in the Mediterranean, from the rind of which a fragrant oil can be extracted. This is the original source of orange essence used to flavor Earl Grey tea.
**Bi Luo Chun:** "Green Snail Spring," a tightly spiraled green tea first made in Jiangsu Province, China.
**bingcha:** "Cake tea," a disk-shaped, compressed form of pu-erh.
**black tea:** A style of tea in which the leaves are as fully oxidized as possible. This is the most popular type of tea worldwide; in China, it is also known as red tea due to the color of the infusion.
**blend:** A combination of various lots of tea, often from diverse locations, mixed to establish consistency in flavor. Can also refer to a combination of different teas with other ingredients to achieve a desired flavor or visual profile.
**body:** Traditional term to denote strength and viscosity of a brewed tea.
**bohea:** Former term for early Chinese oolong and black teas; mispronunciation of Wuyi.
**brick tea:** Pu-erh tea leaves which have been steamed and compressed into a brick shape. Also known as _zhuan cha_.
**caffeine:** A bitter alkaloid produced by the tea plant which deters insect attacks. Also acts as a stimulant and diuretic in humans.
**catechin:** A type of flavonoid found in tea which functions as an antioxidant. The most prominently studied example is epigallocatechin gallate, or EGCG.
**Ceylon:** Tea produced in Sri Lanka, usually black, with a characteristic brisk, bright flavor.
**cha:** Romanized spelling of Chinese and Japanese character which denotes the word tea.
**chai:** The word for tea on the Indian subcontinent. In the West, generally refers to sweetened black tea infused with milk and spices (masala chai).
**chen nian:** Chinese term for aged tea leaves.
**chest:** Traditional shipping container for tea, made of wood with a metal lining.
**congou:** Former term for Chinese black tea; mispronunciation of _gong fu_.
**CTC:** Acronym for cut, tear, curl, a machine process that gained popularity in the mid-1900s; it reduces withered tea leaves into uniform particles to speed processing and often facilitate oxidation. Typical of most black tea grown in India and other lowland producing countries, and used in bagged tea to create a rapidly infusing, more darkly colored tea.
**Darjeeling:** A fragrant type of tea produced in the mountainous Darjeeling region of West Bengal, India.
**dust:** The smallest grade of tea, typically low value and low quality. Dust is prized for its quick extraction and is commonly used in commercial-grade tea bags.
**Earl Grey:** Traditionally a strong black tea blend flavored with bergamot oil; named for England's second Earl Grey, Charles Grey (1764–1845).
**fang cha:** Square-shaped, compressed form of pu-erh.
**fannings:** Small particles of tea, one grade larger than dust; commonly used in tea bags.
**fermentation:** Former term for what is now called oxidation; still in common use at origin to describe the browning of the leaf. Can also refer to the maturation process of pu-erh.
**firing:** Process in which tea leaves are dried using heat to prevent further enzymatic changes. This renders tea shelf-stable, fit for packing and storing.
**flush:** A unique plucking season, usually out of four throughout the year; each is often known for its distinctive flavor.
**gaiwan:** Chinese lidded cup and saucer that is used to steep tea.
**gao shan:** Taiwanese high mountain oolong, produced at elevations beginning around 3,300 feet.
**genmaicha:** Japanese green tea blended with roasted rice.
**golden:** Refers to copper-colored buds present in high-quality black tea.
**gong fu:** Skill and practice; a style of brewing tea with a high proportion of leaf to water and a series of short infusions.
**green tea:** Unoxidized style of tea in which the leaf is heated shortly after harvest; traditionally produced in China and Japan. The first style of tea ever produced.
**gyokuro:** "Jade dew," a rich-flavored Japanese green tea made from plants shaded before harvest.
**heicha:** "Dark tea," a distinct style from China in which the leaves are aged and usually fermented; encompasses the popular subcategory pu-erh.
**hojicha:** Roasted, twig-style green tea from Japan.
**hou fa jiao:** "Post fermentation," the microbial action which causes maocha to deepen in color and complexity.
**jasmine tea:** Typically a green or oolong tea scented with jasmine flowers; first produced in China.
**jin cha:** "Tight tea," a mushroom-shaped form of compressed pu-erh.
**kabuse:** "Covered," a unique Japanese process of shading tea leaves before harvesting in order to alter their chemical composition.
**Keemun:** A rich Chinese black tea from Anhui Province, named after the town of Qimen. Often used in English Breakfast blends.
**lao cha:** "Old tea," refers to an aged tea plant, or an aged tea leaf; used primarily with pu-erh.
**Lapsang Souchong:** Chinese black tea from Fujian Province, traditionally smoked over local red pine wood; considered the first black tea ever made.
**Long Jing:** "Dragon Well," a classic Chinese green tea with distinctive sword-shaped leaves.
**matcha:** "Powdered tea," a style refined in Japan that traditionally refers to a shaded, stone-ground green tea.
**nose:** Aroma of brewed tea leaves or liquor.
**oolong:** Derived from "wu long," the Chinese term for black dragon. A semi-oxidized type of tea traditionally made in China and Taiwan; usually ball shaped or twisted; renowned for its complex tastes and aromas and ability to be steeped several times.
**orange pekoe:** A grading term that refers to larger leaves of the tea plant; does not refer to flavor characteristics. Commonly used in Indian and Sri Lankan tea production.
**Oriental Beauty:** Also known as Bai Hao, a heavily oxidized, deeply fragrant oolong from Taiwan that is bitten by leaf-hopper insects before harvest.
**orthodox:** Traditional method for hand-picking and processing teas in India without using CTC techniques.
**oxidation:** The process of enzymic browning, in which elements in the tea leaf react with internal catalysts and air. This creates a dark brown-red color and characteristic deeper aroma and flavor in the resulting tea.
**pan-firing:** Method of heating the leaf and arresting enzymatic oxidation of tea; also known in Chinese as "sha qing."
**pekoe:** Term for the largest leaves used to produce whole leaf teas. Can also refer to an undistinctive blend of commodity black teas.
**phoenix oolong:** Also known as "dan cong," a partially oxidized, twisted-leaf style of oolong native to the Phoenix Mountains in Guangdong Province, China.
**plucking:** Process of harvesting and collecting tea leaves from the plant.
**polyphenols:** Organic compounds, also referred to as flavonoids, which are present in tea and have antioxidant qualities.
**pu-erh:** Style of tea produced in China's Yunnan Province from the large leaf variety _Camellia sinensis assamica_ which undergoes a sun-drying process. Made in two main styles ( _sheng_ and _shu_ ); prized for its ability to gain complexity and value with proper aging, and to be infused many times.
**rolling:** Process by which withered tea leaves are shaped, and enzymatic oxidation is encouraged by rupturing the cell walls.
**sencha:** Steamed green tea widely produced in Japan.
**sheng:** Green or raw form of pu-erh; the original style, which ages slowly and gains complexity over decades.
**shu:** Brown or ripe form of pu-erh in which additional moisture is introduced to the leaves; tends to not change as much as sheng when aged.
**Spring Fortune:** Unique, deeply aromatic oolong made in northern Taiwan.
**Taiping Huo Kui:** Classic Chinese green tea with large, flattened leaves; made in Anhui Province.
**tea:** The processed leaves, or the infused beverage brewed from the processed leaves, of the _Camellia sinensis_ plant.
**theaflavin, thearubigin:** Antioxidant flavonoids, or catechol tannins, that are produced during the process of oxidation. These compounds are what contribute the deep gold, red, and brown colors to black tea.
**theanine:** Chemical unique to the tea plant, notable for its calming yet not sedative effects.
**Thunder Dragon:** Green tea made in central Bhutan; the first style to be exported from this region.
**Tieguanyin:** Ball-shaped oolong produced in the Anxi area of Fujian, China (and to a lesser extent in Taiwan). Historically it had more oxidation and strength; currently the style is lightly oxidized with a floral fragrance.
**tippy:** Denotes tea that contains white or golden tips, indicative of careful plucking; often high quality.
**tisane:** Infused beverage made from plants other than _Camellia sinensis_.
**tuocha:** Chinese for "bowl tea," a common shape for pu-erh teas.
**white tea:** The least processed type of tea, native to Fujian Province, China, in which the leaves are withered and slowly dried.
**withering:** Natural process of moisture evaporating from recently plucked leaves, making them less brittle and more supple for further processing. Generally done by spreading leaves out, allowing air to pass over and through.
**wo dui:** "Moisten pile," the process of adding additional moisture to pu-erh leaves in order to speed up fermentation. First attributed to the Kunming Tea Factory in Yunnan in 1973.
**yabukita:** Most common _Camellia sinensis_ cultivar used for Japanese sencha.
**yancha:** "Cliff tea," a heavily roasted style of twisted-leaf oolong produced in the Wuyi Mountains of Fujian Province, China; considered the first oolong ever made.
**yellow tea:** Type of tea, similar to green tea, in which oxidation is not completely halted; the leaves are finished over low charcoal heat. Historically produced in Anhui Province, China.
**Yixing:** Region of China noted for its purple clay, which produces distinctive, small, unglazed teapots often used for gong fu style service with a single type of tea.
PHOTOGRAPHS
Here: | Early morning on the Mekong River in Laos.
---|---
Here: | The rough road down to Tumsong Tea Estate in Darjeeling, India.
Here: | Standing nearly eighty feet tall in Yunnan Province, China, this tea plant is thought to be around 2,700 years old.
Here: | Harvesting tea leaves from old plants in northern Laos.
Here: | Freshly picked tea leaves undergoing oxidation.
Here: | Oriental Beauty oolong production in Taiwan.
Here: | Halting oxidation with dry heat in a series of woks in Anhui Province, China.
Here: | Spring Fortune oolong leaves unfurling.
Here: | Terraced tea plants on Wudong Mountain, China.
Here: | Maocha, the base of all pu-erh tea, drying in the sun.
Here: | New growth of the cultivar Rou Gui, used for oolong production.
Here: | Well twisted leaves, with plentiful golden buds, from Fujian Province, China.
Here: | The collection of new leaves for the first tea of the year in Kakegawa, Japan.
Here: | Harvesting high mountain oolong on the steep slopes of Shan Lin Xi in Nantou County, Taiwan.
Here: | Tea plants growing in the mineral-rich soil of China's Wuyi Mountains.
Here: | Handmade tea cups in Robert Yellin Yakimono Gallery in Kyoto, Japan.
Here: | Tea cultivation in the greater Wuyi area of Fujian, China.
Here: | These young plants in Guangdong Province, China, will soon become distinctive phoenix oolongs.
Here: | Sign in a tea factory in Haputale, Sri Lanka.
Here: | A prized pu-erh bingcha from the 1950s.
Here: | Close up of leaves and golden buds in a compressed cake of pu-erh tea.
Here: | Cupping second flush teas at the Goomtee Estate in Darjeeling, India.
Here: | Young second flush leaves and buds ready for harvest.
Here: | Display of pu-erh bingchas at LockCha Tea House in Hong Kong.
Here: | Traditional European tea service.
Here: | Tiny frog on qing xin cultivar in Taiwan.
Here: | Teahouse built by my father in northwestern Connecticut.
Here: | Tools for tea plant cultivation on Wudong Mountain, China.
Here: | Matcha prepared as a thick paste is called koicha in Japan.
Here: | Wingchi Ip preparing tea gong fu style in Hong Kong.
Here: | Nepali tea pluckers carry the morning harvest from fields to the factory to be weighed.
Here: | Quality tea can now often be found in contemporary restaurants in the United States.
Here: | In tea-growing regions, tastings take place throughout the day.
Here: | Gaiwans of various sizes on a tea tray.
Here: | Antique gaiwan and yixing pot from a private collection in China.
Here: | Two leaves and a bud bitten by the tea leaf hopper ( _Empoasca onukii_ ).
Here: | First flush leaves of early spring in a tasting cup.
RECOMMENDED READING
Baisaō. _The Old Tea Seller: Life and Zen Poetry in 18th Century Kyoto_. Translated by Norman Waddell (Berkeley: Counterpoint, 2008).
Chan, Kam Pong. _First Step to Chinese Puerh Tea_ (Taiwan: WuShing Books Publication, 2006).
Fortune, Robert. _A Journey to the Tea Countries of China_ (London: John Murray, 1852).
Gascoyne, Kevin, François Marchand, Jasmin Desharnais, and Hugo Américi. _Tea: History, Terroirs, Varieties_ (Ontario: Firefly, 2014).
Griffiths, John. _Tea: The Drink That Changed the World_ (London: Carlton, 2007).
Koehler, Jeff. _Darjeeling: The Colorful History and Precarious Fate of the World's Greatest Tea_ (New York: Bloomsbury Publishing, 2015).
Mair, Victor H., and Erling Hoh. _The True History of Tea_ (London: Thames & Hudson 2009).
Owyoung, Steven D., www.tsiosophy.com.
Pasqualini, Dominique T., and Bruno Suet. _The Time of Tea_ (Paris: Vilo International, 2000).
Pitelka, Morgan. _Japanese Tea Culture: Art, History, and Practice_ (Abingdon: Routledge, 2003).
Tanaka, Sen'ō. _The Tea Ceremony_ (New York: Harper & Row, 1973).
Wong, Anita, ed. _Tea, Wine and Poetry: Qing Dynasty Literati and Their Drinking Vessels_ (Hong Kong: University Museum and Art Gallery, University of Hong Kong, 2006).
Zhang, Jinghong. _Puer Tea: Ancient Caravans and Urban Chic_ (Seattle: University of Washington Press, 2014).
INDEX
NOTE: Page numbers in _italics_ indicate illustrations.
additives, , 94–95
agony of the leaves, ,
altered teas, , 62–65
Assam, India, , __ , , , ,
Assam Kachibari, __
Bai Mudan (White Peony), , __ , __
ball-shaped oolongs, __ , __ , ,
Bang Laa, 24–25
bergamot,
Bhutan, ,
Bi Luo Chun (Green Snail Spring), ,
bingcha (cake tea), __ , , __ ,
black teas, __ , ,
with butter and salt,
leaf shapes, __
origin story,
processing, __ , __
water temperature,
blended teas,
brick tea (zhuan cha), , , ,
Burma, 64–65
caffeine, , , ,
cake tea (bingcha), __ , , __ ,
_Camellia sinensis_ , , , 30–31
Ceylon, ,
chlorinated tap water,
choosing tea, , _52–53_ , 54–55, ,
climate change,
cocktail recipes, , , 63–64,
commodity teas,
CTC (cut, tear, curl), ,
cultivars, 30–31,
Darjeeling, , __ , __ , __ ,
dark tea flavors, __
dark teas, __ ,
disagreements about, ,
heicha, ,
processing, __
water temperature,
_See also_ pu-erh
Dragon Well, __
Earl Grey, ,
Earl Grey Marteani (cocktail), 63–64
English Breakfast, , ,
fermentation, , , , , , . _See also_ oxidation
firing, ,
first harvest of the season,
flavored teas, ,
flavors of tea, _52–53_ , 54–55
Fortune, Robert,
gaiwan, ,
Green Snail Spring (Bi Luo Chun), ,
Green Tea Punch,
green teas, __ , , ,
Bang Laa, 24–25
matcha, , , __ , , __ ,
processing, __
water temperature,
gyokuro (Jade dew), ,
health benefits of tea, 81–84
heicha (dark tea), ,
Himalayan Black, __
history of tea, , _40–41_ , 42–43, 46–49
honey as additive,
infusions, , , ,
Jade dew (gyokuro), ,
Jasmine Cooler (cocktail),
Jasmine Pearls, __
Jasmine Water,
Keemun, , , ,
Kerouac, Jack,
Kipling, Rudyard, vii
labels, , 74–75,
Lapsang Souchong, ,
lemon as additive, ,
lephet, 64–65
Li Shizhen,
matcha, , , __ , , __ ,
milk as additive,
Nantou Oolong, __
needle leaf shape, __
nose, ,
_Old Tea Seller, The_ (Baisaō),
oolong teas, __ , ,
discovery of, __
flavors, _52–53_ ,
leaf shapes, __
processing, __ , __
water temperature,
Opium Wars,
orange pekoe, , 74–75,
Orwell, George, ,
oxidation, , , , ,
of black tea, , ,
of oolong tea, 121–122
and processing, , ,
of sheng pu-erh,
of yellow tea,
_See also_ fermentation
pan-firing, ,
Phoenix oolong, __
pile fermentation (wo dui), ,
polyphenols, , , ,
preparing tea, , 100–101, _102–103_ , 104–107
pu-erh, , , ,
bingchas, __ , , __ ,
origin of,
sheng pu-erh, __ , , ,
shu pu-erh, __ , ,
rolling, , ,
scented teas, ,
sencha, , 34–35, __ , __ ,
shapes and sizes of tea leaves, , _22–23_ , 24–25
sheng, ,
sheng pu-erh, __ , , ,
shu pu-erh, __ , ,
silver needle buds, __ , __
single origin tea,
snail leaf shapes, __
spiral leaf shapes, __
Spring Fortune oolong, __ , ,
sugar as additive, 94–95
Sullivan, Thomas,
taxonomy of the tea plant, , 30–31
tea label conventions, , 74–75,
tea leaves
grade of, 74–75
shapes and sizes, , _22–23_ , 24–25
tip of,
tea plants,
and climate change,
growing, , ,
taxonomy, , 30–31
teapots or cups,
teas
additives, , 94–95
altered teas, , 62–65
choosing, , _52–53_ , 54–55, ,
flavors, _52–53_
health benefits, 81–84
history of, , _40–41_ , _42–43_ , 46–49
names for, 33–34,
preparing for drinking, , 100–101, _102–103_ , 104–107
protocol for drinking,
_See also_ types of teas
Thailand, 48–49
theanine, ,
Thunder Dragon Green, ,
Tieguanyin oolong, __ ,
twig tea, __ ,
twisted oolong leaves, __
types of teas, _8–9_ ,
white teas, __ , , __ , ,
yellow teas, __ , , __ ,
_See also_ black teas; dark teas; green teas; oolong teas
water for making tea, , 100–101, _102–103_ , __
White Peony (Bai Mudan), , __ , __
white teas, __ , , __ , ,
withering, ,
wo dui (pile fermentation), ,
Wood Dragon, __ , __
Wuyi Mountains, China,
Wuyi oolong, , __
yellow teas, __ , , __ ,
zhuan cha (brick tea), , ,
A NOTE ON THE AUTHORS
**Sebastian Beckwith** is a preeminent tea authority and co-founder of In Pursuit of Tea. He travels to remote farms throughout Asia several times a year, tasting and selecting teas that are served at some of the finest restaurants in the country. Between sourcing trips, he has led educational seminars and lectures about tea, including at Columbia University, Princeton University, the American Museum of National History, the Guggenheim Museum, and the Institute of Culinary Education.
He divides his time between New York City and the hills of northwestern Connecticut.
**Caroline Paul** is the _New York Times_ bestselling author of _The Gutsy Girl_ , _Lost Cat: A True Story of Love, Desperation, and GPS Technology_ , the memoir _Fighting Fire_ , and the novel _East Wind, Rain_. She is a longtime member of the San Francisco Writers' Grotto and lives in San Francisco.
**Wendy MacNaughton** is the _New York Times_ bestselling illustrator of _Salt, Fat, Acid, Heat_ , _The Gutsy Girl_ , _Knives & Ink_, _Pen & Ink_, _Lost Cat_ , _The Essential Scratch-and-Sniff Guide to Becoming a Wine Expert_ , and _Meanwhile in San Francisco_. Her work has appeared in places such as the _New York Times_ , _California Sunday Magazine_ , _AFAR_ , and elsewhere. She lives in San Francisco.
BLOOMSBURY PUBLISHING
Bloomsbury Publishing Inc.
1385 Broadway, New York, NY 10018, USA | www.bloomsbury.com
This electronic edition published in 2018 by Bloomsbury Publishing Plc
BLOOMSBURY, BLOOMSBURY PUBLISHING, and the Diana logo are trademarks of Bloomsbury Publishing Plc
First published in the United States 2018
Copyright © Sebastian Beckwith and Caroline Paul, 2018
Illustrations © Wendy MacNaughton, 2018
Photographs © Sebastian Beckwith, 2018
All rights reserved
You may not copy, distribute, transmit, reproduce or otherwise make available this publication (or any part of it) in any form, or by any means (including without limitation electronic, digital, optical, mechanical, photocopying, printing, recording or otherwise), without the prior written permission of the publisher. Any person who does any unauthorised act in relation to this publication may be liable to criminal prosecution and civil claims for damages.
Bloomsbury Publishing Plc does not have any control over, or responsibility for, any third-party websites referred to or in this book. All internet addresses given in this book were correct at the time of going to press. The author and publisher regret any inconvenience caused if addresses have changed or sites have ceased to exist, but can accept no responsibility for any such changes.
ISBN: 978-1-63286-902-9 (HB)
ISBN: 978-1-63286-904-3 (eBook)
Library of Congress Cataloging-in-Publication Data
Names: Beckwith, Sebastian, author. | Paul, Caroline, author.
Title: A little tea book : all the essentials from leaf to cup / Sebastian Beckwith with Caroline Paul ; illustrated by Wendy MacNaughton.
Description: New York : Bloomsbury Publishing Inc., 2018. | Includes bibliographical references.
Identifiers: LCCN 2017057967| ISBN 978-1-63286-902-9 (hardcover) | ISBN 978-1-63286-904-3 (ebook)
Subjects: LCSH: Tea.
Classification: LCC TP650 .B43 2018 | DDC 641.3/372—dc23
LC record available at <https://lccn.loc.gov/2017057967>
Designed by Sara Stemen
To find out more about our authors and their books please visit www.bloomsbury.com where you will find extracts, author interviews and details of forthcoming events, and to be the first to hear about latest releases and special offers, sign up for our newsletter.
Bloomsbury books may be purchased for business or promotional use. For information on bulk purchases please contact Macmillan Corporate and Premium Sales Department at specialmarkets@macmillan.com.
#
1. Cover
2. Title Page
3. Contents
4. Introduction
5. A little on the tea plant
6. A little on the six types of tea
7. A little on shape and size
8. A little on the taxonomy
9. A little on names
10. A little history
11. A little on choosing tea
12. A little on altered tea
13. A little on dark tea, also called fermented tea or heicha
14. A little on labels
15. A little on health
16. A little confusion
17. A little to add
18. A little on preparation
19. Glossary
20. List of Photographs
21. Recommended Reading
22. Index
23. eCopyright
|
{
"redpajama_set_name": "RedPajamaBook"
}
| 2,319
|
{"url":"https:\/\/homework.cpm.org\/category\/CCI_CT\/textbook\/apcalc\/chapter\/3\/lesson\/3.4.1\/problem\/3-151","text":"### Home > APCALC > Chapter 3 > Lesson 3.4.1 > Problem3-151\n\n3-151.\n\nState the domain and the range of each function below. Homework Help \u270e\n\n1. $y = \\large\\frac { x ^ { 2 } - x - 6 } { x + 1 }$\n\nFactor first.\n\nThis function has a vertical asymptote at $x=\u22121$. How does that affect range?\n\n1. $y = \\large\\frac { x ^ { 2 } - x - 6 } { x + 2 }$\n\nFactor first.\n\nThis function has a hole at $x=\u22122$. It's end behavior is $y=x\u22123$, which can help you find the $y$-value of the hole.","date":"2020-04-05 21:19:36","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 6, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 0, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.747169017791748, \"perplexity\": 1156.444672927318}, \"config\": {\"markdown_headings\": true, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2020-16\/segments\/1585371609067.62\/warc\/CC-MAIN-20200405181743-20200405212243-00423.warc.gz\"}"}
| null | null |
Q: What is globalThis in Javascript? What will be the ideal use case for this? Recently I have come across about globalThis in Javascript. I am not sure how it is going to behave if it is called from a function. Every time it is returning the window object. if that is the case, then why don't we directly use the window object. What is necessary of using globalThis?
If I call the from a function, then it is returning window object
Example:
(function test(){
console.log(globalThis); // returns window
})();
var obj = {
key1: function(){
console.log(globalThis)
},
key2: ()=>{
console.log(globalThis)
},
key3: function(){
var arrFn = () => {
console.log(globalThis);
}
arrFn();
}
};
obj.key1(); // returns window object
obj.key2(); // returns window object
obj.key3(); // returns window object
I believe the internal implementation of globalThis is like the below code:
const getGlobalThis = () => {
if (typeof globalThis !== 'undefined') return globalThis;
if (typeof self !== 'undefined') return self;
if (typeof window !== 'undefined') return window;
if (typeof global !== 'undefined') return global;
// Note: this might still return the wrong result!
if (typeof this !== 'undefined') return this;
throw new Error('Unable to locate global `this`');
};
const theGlobalThis = getGlobalThis();
Can anyone please explain to me the exact use case of the globalThis? What will be the ideal scenario to use this?
A: As MDN says:
The global globalThis property contains the global this value, which is akin to the global object.
Why it's useful:
Historically, accessing the global object has required different syntax in different JavaScript environments. On the web you can use window, self, or frames - but in Web Workers only self will work. In Node.js none of these work, and you must instead use global.
The globalThis property provides a standard way of accessing the global 'this' value (and hence the global object itself) across environments. Unlike similar properties such as window and self, it's guaranteed to work in window and non-window contexts. In this way, you can access the global object in a consistent manner without having to know which environment the code is being run in. To help you remember the name, just remember that in global scope the this value is globalThis.
If you don't know for certain what environment the code is going to be run in, or don't feel like keeping track of it (less cognitive overhead is a good thing, after all!), you can use globalThis instead.
If you know for sure what environment your code is going to be running in, and that the code will never be ported to a different environment, feel free to just keep using window (or the appropriate other property for the environment's global object).
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 8,983
|
Home » Bankruptcy • Consumer proposal • Debt • Financial Help • Licensed Insolvency Trustees » What Should I Do If I Can't Pay My Bills?
Another demand for payment has fallen in your lap – the second this week. You shake your head, with one thought: "I can't pay my bills." This is a familiar issue today. If the problem is caused by a short-term cash flow glitch, you may be able to ride it out. You may need to decide who is going to get paid this week. You may need to juggle your bills. But soon you'll be back on track.
However, if it is an issue that has been going on for some time, you may have some tough choices. Often, the best option will be to make a consumer proposal or declare bankruptcy. Here's why.
What happens if I can't pay my bills?
If you don't pay your bills, your creditors will start sending reminder letters. Then those letters become demands for payment. If you still don't pay your bills, the debts are likely to be sent to a collection agency. Things get messier from here. You'll now deal directly with debt collectors. They may try to bully you into paying more than you can afford. This will make your debt problem worse.
For many people in this situation, bankruptcy will be the best solution. Alternatively, a consumer proposal could be the best route out of debt. We'll examine why in a moment. First, let's look at the alternatives.
If I can't pay my bills, should I just ignore them?
Ignoring your debts won't make them go away. They will just mount up. Eventually, you'll be faced with a mountain to climb and debt collectors on your back as you do so.
These two cases apply to very few people. If you have a job, your creditors are likely to use wage garnishment to take their payment before you get your wages. This is going to make paying other debts harder. It's going to make living harder. You may find your assets are grabbed, too.
In short, don't ignore your debt. Acknowledging "I can't pay my bills" is the first step to a genuine solution.
If I can't pay my bills, should I consolidate my debts?
Another possible solution is debt consolidation. You borrow to repay what you have borrowed.
On the face of it, debt consolidation is a viable solution. You replace a multitude of debt payments with one easily managed payment per month. Instead of paying extortionate interest rates (like those on your credit cards and store cards), the interest rate is much lower. Thus, your monthly payments will be lower.
Debt consolidation loans can also be difficult to obtain. Many lenders will only consolidate their own lending, so you may have several consolidation loans.
Borrowing money to repay borrowed money. It's a little like using a naked flame as first aid treatment to a burn.
Should I consider a consumer proposal if I can't pay my bills?
A Licensed Insolvency Trustee negotiates with your creditors.
They arrange a manageable payment for you to make each month.
You make these payments for a maximum of five years.
No further interest is added to your debt.
At the end of your payment period, your total debt is declared paid in full.
A consumer proposal that is agreed to by more than 50% of your creditors is binding on all your creditors. While in force, your assets are protected. This means you get to keep your home and live your life, free from the debt stress.
Should I consider bankruptcy if I can't pay my bills?
In a bankruptcy, depending on the province in which you live, most, if not of your assets, will be exempt from seizure. The Trustee will go through this in detail with you, in case there are any non-essential assets that might be liquidated for the benefit of our creditors.
Whether looking at a consumer proposal or bankruptcy, there are a few debts that do not get discharged by the process. Statutory debts like alimony and student loans less than 7 years old are not discharged in either a proposal or bankruptcy.
If you are battling against debt, contact LCTaylor today. As Licensed Insolvency Trustees, we are the only ones able to advise on and arrange consumer proposals and bankruptcy. We'll talk to you in confidence. Together, we'll ensure that you take the best course of action for your personal financial situation.
Make that call. Use our online contact form.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 2,664
|
{"url":"https:\/\/nbviewer.jupyter.org\/urls\/www.numfys.net\/media\/notebooks\/fixed_point_iteration.ipynb","text":"# Fixed-Point Iteration\u00b6\n\n### Modules - Root Finding\u00b6\n\nLast edited: March 11th 2018\n\n## Introduction\u00b6\n\nAn equation $f(x) = 0$ can always be written as $g(x) = x$. Fixed-point iteration can be applied to approximate the fixed number $r = g(r)$.\n\nAfter selecting an initial guess $x_0$, the fixed-point iteration is $x_{n+1} = g(x_n)$. That is,\n\n\\begin{equation*} x_0 = \\textrm{initial guess} \\\\ x_1 = g(x_0) \\\\ x_2 = g(x_1) \\\\ x_3 = g(x_2) \\\\ \\vdots \\end{equation*}\n\nThe algorithm is repeated until either a testing condition $e_{i+1} = \\left|\\:x_{i+1} - x_{i}\\:\\right| < \\alpha$, where $\\alpha$ is some tolerance limit is met, or until a fixed number of iterations $N$ is reached. Note that the method may or may not converge. Note that the choice of $g(x)$ is in general not unique.\n\n## Example 1\u00b6\n\nAs a simple introductory example we use the fixed-point iteration to solve the equation\n\n$$\\frac{1}{2}\\sin(x) - x + 1 = 0.$$\n\nThe most natural is to use $g(x)= \\sin(x)\/2 + 1$ and then use the fixed-point iteration to solve $g(x)=x$.\n\nIn\u00a0[5]:\nimport math\n\nx = 1 # initial guess\nN = 10 # iterations\n\nfor i in range(1, N):\nx = math.sin(x) + 1\nprint(\"x%i:\\t%.5f\"%(i, x))\nx1:\t1.84147\nx2:\t1.96359\nx3:\t1.92384\nx4:\t1.93832\nx5:\t1.93322\nx6:\t1.93504\nx7:\t1.93439\nx8:\t1.93462\nx9:\t1.93454\n\n## Convergence\u00b6\n\nFor the iteration scheme to return a fixed point $r$, it needs to converge. A criterion for convergence is that the error, $e_i = \\left|\\:r - x_i \\:\\right|$, decreases for each iteration step. This means that the change from $x_i$ to $x_{i+1}$ also has to decrease for each step. The convergence criterion is explained in the following theorem [1]:\n\nTheorem 1 Assume that $g$ is continuously differentiable, that $g(r) = r$, and that $S = \\left|\\:g'(r)\\:\\right| < 1$. Then fixed-point iteration converges linearly with rate $S$ to the fixed point $r$ for initial guesses sufficiently close to $r$.\n\nNote that in the example above we have $|g'(x)|=\\cos(x)\/2 < 1$ which means that the method will converge for all initial guesses.\n\nThe convergence can in fact be of higher order. This is explained in the following theorem [2]:\n\nTheorem 2 Assume that $g$ is $p$ times continuously differentiable and that the fixed-iteration converges to $r$ for some initial guess $x_0$. If $g'(r)=g''(r)=\\cdots=g^{(p-1)}(r)=0$ and $g^{(p-1)}(r)=0$, then the order of convergence is $p$.\n\nThe convergence is said to be of order $p$ when $\\lim_{i\\to\\infty}e_{i+1}\/e_{i}^p = \\text{constant}$.\n\nExcercise: Prove theorem 1 using the mean value theorem and the theorem 2 using Taylor's theorem.\n\n## Example 2: Babylonian Method for Finding Square Roots\u00b6\n\nAs mentioned in the introduction, the choice of $g(x)$ is far from unique. We will now use fixed-point iteration to estimate the square root of a real and positive number $a$. That is, we want to solve $f(x) = x^2-a^2=0$. Two natural choices for $g(x)$ are $g_1(x)=a\/x$ and $g_2(x)=x$. However, none of these converges since $|g_1'(\\sqrt a)| = |g_2'(\\sqrt a)| =1$. We can choose the mean as $g(x)$:\n\n$$g(x) = \\frac{1}{2}\\left(\\frac{a}{x} + x\\right).$$\n\nIn this case we have\n\n$$\\left|\\:g'(x)\\:\\right|_{x=\\sqrt a}=\\left|\\:\\frac{1}{2}(1-\\frac{a}{x^2})\\:\\right|_{x=\\sqrt a} = 0 < 1$$\n\nThe theorem above thus implies that method converges for some initial guess $x_0$. The method is in fact globally convergent due to the convexity of $f(x)$.\n\nIn\u00a0[1]:\na = 0.07 # square of root\nx = 1 # initial guess\nN = 10 # iterations\n\nfor i in range(1, N):\nx = (a\/x + x)\/2\nprint(\"x%i:\\t%.5f\"%(i, x))\nx1:\t0.53500\nx2:\t0.33292\nx3:\t0.27159\nx4:\t0.26467\nx5:\t0.26458\nx6:\t0.26458\nx7:\t0.26458\nx8:\t0.26458\nx9:\t0.26458\n\nThis method can also be derived from Newton's method (see the section on Newton's method below). The method was however first used by the Babylonian people long before Newton [2].\n\n## Example 3: Adding Stopping Conditions\u00b6\n\nUnderneath follows an implementation of the Fixed-Point Iteration with a testing condition $\\left|\\:x_{i+1} - x_i\\:\\right| < \\alpha$. There are other stopping criteria that may be relevant such as the backward error $\\left|\\:f(x_a)- f(0)\\right|$. We need an additional stopping criteria in case convergence fails. We therefore stop the computation if the a given number of iterations $N$ is reached.\n\nIn\u00a0[14]:\ndef FPI(g, x, maxit=100, alpha=1e-5):\n\"\"\" A function using fixed-point iteration to compute\nan approximate solution to the fixed point problem g(r) = r.\n\nArguments:\ng callable function, g(x)\nx float. The initial guess\nalpha float. Error tolerance\nmaxit int. Maximum number of iterations\n\nReturns:\narray of each fixed-point approximation\n\"\"\"\n\nresult = [x]\nx_next = g(x)\ni = 0 # Counter\ne = abs(x_next - x)\n\nwhile e > alpha :\nif i > maxit:\nprint(\"No convergence.\")\nbreak\nx = x_next\nx_next = g(x_next)\nresult.append(x)\nif x - x_next > e:\nprint(\"Divergence.\")\nbreak\ne = abs(x_next - x)\ni += 1\nreturn result\n\nWe want to solve the equation,\n\n\\begin{equation*} f(x) = x^4 + x - 1 = 0 %\\label{eq:example} \\end{equation*}\n\nusing fixed point iteration. First, we rewrite the equation to the form, $x = g(x)$. This particular equation may be rewritten in three ways:\n\n$$g_1(x) = x = 1 - x^4,$$$$g_2(x) = x = \\sqrt[4]{1 - x},$$$$g_3(x) = x = \\frac{1 + x^4}{1 + 2x^3}.$$\n\nEach of these has its own convergence rate. One of the solutions is clearly somewhere between 0 and 1, so we will use $x_0=0.5$ as initial guess.\n\nIn\u00a0[13]:\nx_0 = 0.5\nN = 100\nalpha = 1e-5\n\ndef g1(x): return 1 - x**4\ndef g2(x): return (1 - x)**(1\/4)\ndef g3(x): return (1 + 3*x**4)\/(1 + 4*x**3)\n\ndef print_result(result):\nfor i in range(len(result)):\nprint(\"x%i:\\t%.5f\"%(i, result[i]))\nIn\u00a0[10]:\nresult_g1 = FPI(g1, x_0, N, alpha)\nprint_result(result_g1)\nDivergence.\nx0:\t0.50000\nx1:\t0.93750\nIn\u00a0[11]:\nresult_g2 = FPI(g2, x_0, N, alpha)\nprint_result(result_g2)\nx0:\t0.50000\nx1:\t0.84090\nx2:\t0.63157\nx3:\t0.77909\nx4:\t0.68557\nx5:\t0.74883\nx6:\t0.70794\nx7:\t0.73514\nx8:\t0.71739\nx9:\t0.72912\nx10:\t0.72143\nx11:\t0.72650\nx12:\t0.72317\nx13:\t0.72536\nx14:\t0.72392\nx15:\t0.72487\nx16:\t0.72425\nx17:\t0.72465\nx18:\t0.72439\nx19:\t0.72456\nx20:\t0.72445\nx21:\t0.72452\nx22:\t0.72447\nx23:\t0.72451\nx24:\t0.72448\nx25:\t0.72450\nIn\u00a0[12]:\nresult_g3 = FPI(g3, x_0, N, alpha)\nprint_result(result_g3)\nx0:\t0.50000\nx1:\t0.79167\nx2:\t0.72986\nx3:\t0.72453\nx4:\t0.72449\n\nThe method does not converge for $g_1$, but both $g_2$ and $g_3$ converges towards the fixed number $0.72449$, which is a solution of the equation $f(x) = 0$. The method converges much faster for $g_3$ than for $g_2$.\n\nThis result can be verified by calculating the convergence rates $S = \\left|\\: g'(r) \\:\\right|$:\n\n\\begin{equation*} \\left|\\:g_1'(0.72449)\\:\\right| \\approx 1.521 > 1, \\\\ \\left|\\:g_2'(0.72449)\\:\\right| \\approx 0.657 < 1, \\\\ \\left|\\:g_3'(0.72449)\\:\\right| \\approx 0.000 < 1. \\\\ \\end{equation*}\n\nTheorem 1 tells us that the method will converge for $g_2$ and $g_3$ for some inital guess. Moreover, from theorem 2 we know that the method converges linearly for $g_2$ and the order of convergence for $g_3$ is two.\n\nExercise: Verify that the convergence for $g_2$ is linear and that the convergence of $g_3$ is of second order by using the numerical results above.\n\n## In comparison with the Newton-Rhapson method\u00b6\n\nThe Newton-Rhapson method is a special case of fixed-point iteration where the convergence rate is zero - the fastest possible. The method estimates the root of a differentiable function $f(x)$ by iteratively calculating the expression\n\n\\begin{equation*} x_{n+1} = x_n -\\frac{f(x_n)}{f'(x_n)}. \\end{equation*}\n\nBy using theorem 2, we can show that Newton's method is of second order (if $f'(r)\\neq 0$). If $f''(r)=0$, then the method has a third order convergence.\n\nThis Newton iteration may be rewritten as a fixed point iteration\n\n\\begin{equation*} x_{n+1} = g(x_n), \\: n = 1, 2 ,3, ... \\end{equation*}\n\nwhere\n\n\\begin{equation*} r = g(r) = r - \\frac{f(r)}{f'(r)} %\\label{eq:newton} \\end{equation*}\n\nProvided that the iteration converges to a fixed point $r$ of $g$. From this we obtain\n\n$$\\frac{f(r)}{f'(r)} = 0 \\: \\Rightarrow \\: f(r) = 0$$\n\nand thus the fixed point $r$ is a root of $f$.\n\nThe Newton's method is further discussed in the module Root Finding - Newton-Rhapson Method.\n\nWe have now used the fixed-point iteration method to solve the equation $f(x) = 0$ by rewriting it as a fixed-point problem. This is a simple method and which is easy to implement, but unlike the Bisection Method it only converges if the initial guess is sufficiently close to the root $r$. It is in general only locally convergent. However, the convergence rate may, or may not, be faster than that of the Bisection Method, which is 1\/2.","date":"2021-07-29 15:53:13","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 1, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.9920049905776978, \"perplexity\": 386.0961338999071}, \"config\": {\"markdown_headings\": true, \"markdown_code\": false, \"boilerplate_config\": {\"ratio_threshold\": 0.3, \"absolute_threshold\": 10, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-31\/segments\/1627046153860.57\/warc\/CC-MAIN-20210729140649-20210729170649-00385.warc.gz\"}"}
| null | null |
Q: redirect with https only for specific url on nginx I'm trying to get the https working with some urls. but it seems that the https goes everywhere. In details, I have created 2 vhosts on Nginx. The first virtual host with port 80 and the other one with 443 containing SSL. now my site .i.e domain.com works for both http and https and this is not what I want. I want the https working on one some urls I specify with rules in Nginx vhost.
The main issue is when I try that I get my main site first with http then when I go to a url that contains https "secure_area", it works fine. However, whenever I go after that somewhere else in my site, the https keep going on all other urls.
here is my 443 vhost config:
ssl_session_cache shared:SSL:5m;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
#server_name www.mydomain.com;
ssl_session_timeout 5m;
root /vars/www/public_html/;
index index.php index.html index.htm;
ssl_certificate /path_to_ssl/certificate.pem;
ssl_certificate_key /path_to_key/server.key;
ssl_ciphers 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
# Serve static files directly
location ~* \.(png|jpe?g|gif|ico)$ {
expires 1y; access_log off; try_files $uri $uri/ @rewrite; gzip off;
}
location ~* \.(css)$ {
expires 1d; access_log off;
}
location ~* \.(js)$ {
expires 1h; access_log off;
}
location /secure_area/ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
rewrite ^ https://$http_host$request_uri? permanent;
}
}
and here is my 80 vhost config:
server {
listen 80 default_server;
server_name mydomain.com;
return 301 http://www.mydomain.com;
}
server {
listen 80;
server_name www.mydomain.com;
root /vars/www/public_html/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
location /secure_area/ {
rewrite ^ https://$http_host$request_uri? permanent;
}
}
in case no one noticed, Nginx is working as reverse proexy at front end Apache
now does anyone have any idea how to force https only on some urls and in my case secure_area and force http on all other urls?
Thanks
A: You can tell the SSL server to redirect back to http if any other URL is visited
server {
listen 80;
server_name example.com;
# normal http settings
location /secure_area/ {
return 301 https://$http_host$request_uri$is_args$query_string;
}
}
server {
listen 443 ssl spdy;
server_name example.com;
# ssl settings;
location /secure_area/ {
#serve secure area content
}
location / {
return 301 http://$http_host$request_uri$is_args$query_string;
}
}
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 3,399
|
Items from The News, Navy News and Warship World are reproduced by kind permission of David Brown, Sarah Fletcher and Steve Bush respectively. Click on the thumbnails to enlarge them.
23 Dec 08 - Remembrance Service for Lt Walter Erskine Prior RNVR
Yesterday I was privileged to convey wartime bomb & mine disposal officer Lt Noel Cashford MBE RNVR and his wife Brenda, a former Wren, to Aldwick near Bognor Regis for a Service of Remembrance for Lt Walter Erskine Prior RNVR.
Noel and Brenda Cashford
Close-up of Noel Cashford's wreath
Exactly 63 years previously, Walter Prior, a friend and colleague of Noel Cashford, was killed while attempting to render safe a mine on the beach at Aldwick. The service was held near the spot where he met his untimely end on 22 December 1945 at the age of 23. It was conducted by the Revd Canon Dr Lawson Nagel, Vicar of Aldwick, and attended by Nick Gibb MP, local councillors, representatives of the Royal Naval Association and the Royal British Legion and others. Wreaths were laid by Noel Cashford and Cllr Jill Ostler, wife of Richard Ostler who organises this annual event.
Local RNA and RBL representatives
Attendees at the Service of Remembrance
Left: Nick Gibb MP reads the lesson
Right: Noel Cashford after laying his wreath
Left: Plaque commemorating the death of Lt Walter Erskine Prior RNVR
Right: Adjacent beach where Lt Walter Erskine Prior RNVR was killed in December 1945
A reception was held afterwards at the Aldwick Parish Council offices. Lt Walter Erskine Prior RNVR has no surviving relatives and I would like to express my deep appreciation on behalf of our Branch to everyone involved in helping to keep his memory alive.
14 Dec 08 - Former RN diver has ashes scattered by torpedo explosion
Troy Tempest, Secretary of the RN First Class Divers' Association, has drawn my attention to this article on the Daily Telegraph website which describes how the ashes of ex-RN clearance diver Derick Redfern were scattered off Plymouth by Southern Diving Unit 1 during an underwater training exercise earlier this month.
12 Dec 08 - MCDOA members attend TCA Christmas Lunch
MCDOA members Doug Barlow, Brian Dutton, Bob Lusty, Martyn Holloway and Rob Hoole were among those who attended yesterday's Ton Class Association's Portsmouth area Christmas lunch in the Royal Maritime Club (formerly the Home Club). Les Sharpe of the Association of RN First Class Divers also joined in the fun.
Sharpe, Dutton, Holloway, Barlow, Hoole and Lusty
at TCA Christmas lunch
Other TCA revellers enjoy themselves
11 Dec 08 - News from HMS Ramsey
I am grateful to Lt Marc Taylor RN, the Navigating Officer of HMS Ramsey, for sending us this update:
HMS RAMSEY – NOVEMBER WEB SITE UPDATE
November proved to be a busy month for HMS RAMSEY……….
The month started with a joint UK-US mine clearance exercise, aptly named 'Find A Way Or Make One'! This included the hunting and disposal of exercise mines as part of a task group that comprised both US and UK Mine Hunters. The exercise provided excellent training for Ramsey's mine warfare and diving teams who had the opportunity to detect, classify and dispose of realistic mine contacts using explosive charges. The whole team also faced a significant challenge from the weather which was uncharacteristically bad for the Arabian Gulf with winds up to 40 knots experienced at times. It should however prove to be good preparation for the forthcoming winter passage back to the UK.
Following the exercise, Ramsey was tasked to accompany HMS Chiddingfold to Umm Qasr in Iraq. The visit, the first overnight stay by UK warships since 2003, was aimed at supporting the crucial role of the Naval Transition Team (NaTT) in delivering an additional element of afloat-training to the Iraqi Navy, also coincided with Remembrance Sunday commemorations. The Ships' Companies of Chiddingfold and Ramsey, along with their Iraqi, American and NaTT counterparts, each fielded a platoon of Officers and Ratings to take part in a service of remembrance. After laying a wreath on behalf of his ship, the Commanding Officer of HMS Ramsey, Lt Cdr Nick Borbone RN said:
"Conducting the ceremony here in Iraq is a poignant reminder that Remembrance Day is not just about those who gave their lives in past wars and conflicts, but also about those who today continue to make the ultimate sacrifice in the service of their country."
Sailors from Ramsey and Chiddingfold attend
a Remembrance Day service in Umm Qasr
Following the Remembrance Day service, members of the Iraqi Navy were invited onboard Ramsey and Chiddingfold for tours, with Iraqi personnel keen to see how the Royal Navy operates on a daily basis. On completion of the tours, the sailors were given capability demonstrations on both ships, including seamanship drills, diving, launching and recovering the Remote Controlled Mine Disposal Vehicle (RCMDV) and ship borne fire fighting. The demonstrations will hopefully have provided some ideas to the Iraqi Navy on how best to develop their own procedures for operating the similar sized Patrol Boats which are expected to be in service in 2009.
Gunnery Officer Lt Matt Besant oversees
a Light Line Transfer with HMS Blyth
On departing Umm Qasr after a successful visit Ramsey and Chiddingfold were joined for the passage down the river by members of the Iraqi Navy. During the river transit Ramsey and Chiddingfold conducted Officer of the Watch Manoeuvres and a force protection exercise with an escorting Iraqi Patrol Boat before commencing the transit back to Bahrain.
Ramsey departs Umm Qasr after a successful visit
After a brief period of respite in Bahrain, Ramsey once more headed out into the Central Arabian Gulf to conduct underwater survey operations in company with HMS Blyth. This often painstaking work is essential to ensure that detailed mapping of the sea bed along heavy shipping lanes is maintained thereby contributing to overall regional maritime security. At the end of the tasking, Ramsey's Ship's Company enjoyed a good, if expensive, visit to Abu Dhabi.
A hazy Abu Dhabi skyline
Following the delay into the Arabian Gulf of the two ships due to relieve Ramsey and Blyth caused by defects to one of the units in the Mediterranean, Ramsey's team now prepares for Christmas in Bahrain. While it is not quite what we all hoped for, the Ship's Company is determined to make the best of it and there are several events being planned to mark the festive season in style and several people will also take the opportunity for their families to join them for a short break over Christmas.
Ramsey and the team will continue with operations in the Arabian Gulf in the New Year until relieved by the incoming ships sometime in January after which we will head for home. All of us in HMS Ramsey would like to wish our friends, affiliates and readers a very happy Christmas and best wishes for 2009.
10 Dec 08 - Northern Diving Group kept busy
The RN website contains this article describing how NDG has been called to deal with two explosive devices found at sea within 15 hours of each other.
Archive picture of sea mine disposal operation
(RN website photo)
9 Dec 08 - Upcoming Events
The 'Upcoming Events' page in the Members Only area has been updated to show the full programme of MCD-related functions for the forthcoming year.
8 Dec 08 - News of former Fleet Diving Tender Datchet
I am grateful to MCDOA member Martyn Holloway for forwarding this notice from the Chichester Harbour Conservancy website:
LOCAL NOTICE TO MARINERS NO. 18 OF 2008
DREDGE AND BENEFICIAL DISPOSAL
Mariners are advised that a maintenance dredge of Emsworth Yacht Harbour will commence Monday 8 December 2008. The dredged material will be towed in 27-metre split hopper barges by the 23-metre MV Datchet.
2. Disposal
The dredged material will be released at the Treloar site in the harbour entrance in position: 50° 46´.895 N, 00° 56´.050 W. Disposal of dredged material will take place during the period HW -6 hours to HW -2 hours and will follow the tides through the full 24 hour period.
3. Towed Vessels
The towing and towed vessels will display the lights prescribed by the collision regulations. The tows may be alongside or astern. MV Datchet will maintain a listening watch on channels 16 and 14.
4. Mooring
A mooring for MV Datchet has been laid in the Emsworth Channel in approximate position: 50° 49´.3 N, 00° 56´.8 W. This vessel is now on site.
These works are expected to continue for six weeks, a further notice will be issued on completion.
JQ Davis OBE
Manager & Harbour Master 4 December 2008
Chichester Harbour Conservancy
Harbour Office
Itchenor
PO20 7AW
W: www.conservancy.co.uk
E: harbourmaster@conservancy.co.uk
Having last seen Datchet some 30 years ago when she was my first 'Command' in the Plymouth Clearance Diving Team (PCDT), I find it fascinating that this long-soldiering vessel should end up working not a million miles away from the MCDOA's 'Not Quite the Last of the Summer Wine' trio's favourite haunt of Emsworth and my sailing club at Thorney Island. Lt Col John Davis OBE RM, Chichester's Harbour Master, has kindly sent this recent photo of Datchet at work in the harbour together with this data sheet.
MV Datchet at work in Chichester Harbour
(Chichester Harbour Conservancy photo)
She's definitely the same 'Ratshit Datchet' as she was affectionately known by Royal Navy divers all those years ago. Originally used in UK waters for deep diving training by HMS Vernon in the mid-1970s, she was swapped for PCDT's MFV, FDT Ixworth, in 1979 and sold in 1994. As PCDT's diving tender, she became the only Royal Maritime Auxiliary Service (RMAS) craft with an RN crew and was thus entitled to wear the white ensign. She had an HP compressor, air bank and a six-man compression chamber on her quarterdeck. Since then, she's obviously had a paint job, been re-engined and fitted with bow thrust and other auxiliary machinery such as the deck crane.
Left: Members of LMCDO '76 on board FDT Datchet as she leaves Falmouth in 1976
Right: Hoole exiting FDT Datchet's chamber after a 54m dive with surface decompression in 1976
Built by Vospers in Singapore for the Far East Fleet Clearance Diving Team, Datchet was named on 18 December 1968 and given the pendant number A357 after sea trials (see The Far East Clearance Diving Team by Brian Braidwood in the website's Dit Box). She had a steel hull and, if memory serves me right, a comparatively fragile marine plywood superstructure. One of the Malaysian clearance diving officers I trained at Vernon in the 1980s told me that her sister ship was employed by the Singaporean Navy. I will always have a soft spot for her so it's nice to see that she's still going strong. I won't dwell on the stories I could tell but suffice it to say that she led an interesting and improbably charmed life in all manner of places.
Left: FDT Datchet and Plymouth CD Team in 1981 with your humble webmaster top left
Right: MV Datchet photographed by MCDOA member Duncan Bridge at Cowes in 2006
One of Datchet's less endearing attributes while in RN service was her propulsion machinery comprising two Gray Marine diesels originally destined for use in landing craft. These turned both screws in the same direction and made ship-handling a nightmare. I literally have the scars to prove it, sustained while manoeuvring her alongside Queen's Jetty in Falmouth at low water when I dipped my head in order to see the positions of the shoreside bollards through the bridge window. As I spun the wheel, the pointed end of one of the spokes took a neat chunk out of my chin; one of the reasons I've sported a 'full set' almost continuously ever since!
7 Dec 08 - RN Minewarfare Heritage
I have received this e-mail about CPO Torpedoman Robert Bloxsome who was decorated for mine disposal early in the Second World War:
"Sir,
I have recently looked at your website, concerning Mine Clearance Awards, and found it very interesting. Of particular interest was the information on my great grandfather, Robert Charles Bloxsome. I am in possession of CPO Bloxsome's divisional documents and can confirm that his war service was as follows:
6 Sep 39 - 7 Sep 39 - Pembroke
8 Sep 39 - 13 Sep 39 - Vernon
14 Sep 39 - 24 Mar 42 - Pembroke
25 Mar 42 - 12 Sep 44 - Daedelus
12 Sep 44 - 14 Oct 44 - Pembroke - discharged on compassionate grounds
After 31 years in the Mob - I think he had done his bit!! I am also in possession of his trade certificates as a Torpedo Engineer. I am however puzzled as to the awarding of a DSM on the 24 April 1940. I do not appear to have any guidance as to what this was for - other than stripping mines, though family legend has it that he was on a team that stripped the first mine of a certain type. I have read the book 'Service most Silent' (which though dated is interesting), and see no indications of a particular incident which could lead to this award. It is also interesting to see that he was based at Pembroke at this time - was that the Eastern region MCD team in the war???
Many thanks for your help, and any further help you could provide would be greatfully appreciated, likewise if I can be of any further assistance please get in touch.
R G Anders"
At the time of his award, CPO Bloxsome was a member of the Torpedo Branch which was then responsible for all things minewarfare. This responsibility passed to the combined Torpedo & Anti-Submarine (TAS) Branch on its formation in 1946. In 1975, the Operations Branch was formed and TAS ratings transferred to either the Sonar or the Minewarfare sub-branch. Since then, the Minewarfare sub-branch has remained virtually intact despite the introduction of the Warfare Branch in 1993. I sent Mr/Ms Anders the following reply:
"Hello Mr/Ms Anders,
Thank you for your interesting query.
This is an excerpt from pages 1 & 2 of the online London Gazette of 23 April 1940, Issue number 34835 (link):
"To be a Companion of the Distinguished Service Order
Lieutenant - Commander Roy Berryman Edwards, Royal Navy, H.M.S. Watchful; for courage and skill in securing and stripping live enemy mines, without regard for his own safety.
His Majesty has also been graciously pleased to approve the following Awards for services of the same kind:-
The Distinguished Service Cross.
Commander Edward Owen Obbard, Royal Navy.
Lieutenant Harold West, Royal Navy.
The Distinguished Service Medal.
Chief Petty Officer Edward George Spriggs, C/J-47033, H.M.S. Watchful.
Chief Petty Officer Charles Edward Syrett, C/J.9062.
Chief Petty Officer Robert Charles Bloxsome, C/J.28834.
Able Seaman Douglas Walter Wilson, C/JX.I46933, H.M.S. Watchful.
Able Seaman Sydney Charles Keen, Pens. 6356, 01.36458, H.M.S. Watchful.
Mention in Despatches.
Lieutenant Geoffrey Ambrose Hodges R.N.V.R."
Your information helps fill in the gap regarding your great-grandfather's unit at the time of his award. Among other things, HMS Pembroke was home to the RN's Chatham-based Torpedo School (equivalent of HMS Vernon at Portsmouth) and he must have been involved in stripping some of the earliest mines of the war. I suspect the award was made for a series of tasks rather than for any one in particular. Mind you, the Germans were always changing something about their mines to keep our people on the hop so he is quite likely to have helped defeat a certain type.
Of note, Cdr Obbard and Lt West were attached to HMS Pembroke's Torpedo School at the same time and it is possible that your great-grandfather worked with one if not both of them. Later in 1940, several RN Render Mines Safe Officers (RMSOs) and Bomb Safety Officers (BSOs) were based with their teams at HMS Pembroke for bomb disposal operations all over the country during the Blitz.
I am blind copying this to some other people who might be able to help.
Rob Hoole"
Wartime RNVR Bomb & Mine Disposal Officer and author Noel Cashford MBE has since provided the following additional information:
"Hi Mr/Ms Anders,
I am not 100% certain but if I saw a photograph of CPO Bloxsome it may ring a bell.
I seem to think that he worked with Lt E Tewson RNVR who was awarded the GM after rendering safe the first 'T' mine (acoustic/magnetic) which washed ashore at Portland. Unfortunately in those days the names of NCOs and seamen crew were frequently not reported despite the fact that torpedo/mine CPOs were the lifeblood of we who became Bomb & Mine Disposal officers in the 1940s. They tended to be moved about, not staying with any officer for long. In the early months of WW II CPOs worked alone rendering safe dozens of mines washed ashore and recovering them. CPO Bloxsome may have been one of these brave men.
If he was at HMS Watchful he would possibly be with Cdr Roy Berryman Edwards DSO RN based at Great Yarmouth who was killed with USN Ensign John M Howard on the 11th June 1942 at Corton near Lowestoft. Any honours or awards CPOs received were richly deserved.
Having published four books I will search my records and if I find reference I will contact you.
Yours aye,
Noel Cashford MBE
ex-Lt RNVR Bomb & Mine Disposal Officer"
If anyone can provide any further background, please let me know.
Service of Thanksgiving for the late Lt Cdr Chris Beresford-Green RN
MCDOA member Peter Waddington has kindly provided this account of the Service of Thanksgiving held at noon today for the late MCDOA member Chris Beresford-Green:
"Rob,
I have just returned from Pitlochry, where I attended the Service of Thanksgiving for Chris Beresford-Green. It was very well attended, both by ex RN personnel and by friends from Pitlochry; indeed the small church was virtually full. On the MCD side Nigel Davies, Hamish Loudon and I were there, together with Alf Slingsby, Albert Chapman and a number of other divers, whom I regret I didn't recognise and didn't get a chance to speak to, amongst all the family and other people there. Nigel gave a very nice tribute during the service, covering Chris's naval career,and concluding with the traditional "Five Bells", and this was followed by a tribute to his involvement with the work and social life of Pitlochry, by one of his local friends.
We were greeted on arrival at the Church by Lieutenant Commander Paul Beresford-Green (in uniform), and later by Virginia and the remainder of the family (except brother David, who was unable to make it from Canada). They were all very friendly, pleased to see us, and grateful for the condolences which we conveyed, and we were all invited to the local hotel for refreshments and to meet the family and friends after the service.
Peter"
I know that other naval divers present included Sandy Bruce, Andy Lettice, Bill McGovern, Ginge Reynolds, Pete Wannerton and Leo Whelan.
Former HMS Cottesmore and HMS Dulverton to join Lithuanian Navy
The Thales UK website contains this press release describing the reactivation of the former RN Hunt Class minehunters HMS Cottesmore and HMS Dulverton for sale to Lithuania. I was privileged to be with them when they were last at sea under the white ensign on 28 September 2005 as covered in News Archive 11.
The former RN Sandown Class minehunters HMS Sandown, HMS Inverness and HMS Bridport are already in the Baltic serving in the Estonian Navy.
A message from our President:
Captain Colin Welborn RN
WOW! What can I say? Thank you and the team for dining us out on Friday. The evenings get better and better and it will just get harder each year to do better still. All the ingredients were there on Friday: venue, food, wine, music but all surpassed by the people. Very emotional moment for me, especially with Paul Jones 'roasting' me!! He and I go back a long way (as do many others) but he came to my aid during a particular crisis and I will always be in his debt. He, like all in that mess, would be first choice as a 'wingman'.
The day is a master class for which you and the committee need to be thanked. I remember the lean years where it may have simply failed but for the stalwarts. Tony is an unsung hero for the way he just cracks on and grips the socials plus plus. I appreciate it's wrong to single individuals out when it is such a team effort but ... he gets my vote each time. What a fantastic afternoon it had been, the formal evening hit all the right notes: spectacular music, outstanding meal, great conversation and raucous sea shanties. What else could one ask for, especially in such a setting? To think we once used NELSON!!
I must say how impressed I am by the young people, both serving and sons; clearly meeting those golden strands of fulfilling potential in their academic, spiritual and social lives, all within a framework of order and high expectations. It's not about winning, but wanting to is what really matters and the dynamics between us older ones and the youngsters clearly works. There was an atmosphere that night to covet: any future enemies should be afraid because you cannot buy that sort of camaraderie. It really has been a rare privilege to be on the journey with all the MCDOA. I count myself lucky to have so many friends and the Royal Navy should reflect that our community represent many large pieces that make up the mosaic which is the history of the Naval Service. So, finally - thank you for your generous hosting of us. It was a real privilege and I look forward to helping sustain the momentum of the Vernon project.
Of course, Rob and Frank, there is the 'last' word. Rob - Vernon and Harlequin nights are an important but close memory as is your guitar coupled with those moments when you were the Duty Diving Officer and shared much with us on course - the man with a 'tingle' who said he had not peed for 18 hours who you then pressed down and he simply could not stop when it was explained how we might extract the pee if he didn't fill the bucket - those were the days! Frank who provided guidance to those 1st Lts (ex-'79 LMCDO Course) who were the bane of his life in MCM2 but you have to admit Frank, CTPs and the parties after were never, ever, never dull!
On, on!
P.S. In my next life I shall be a 'webmaster'. They have far more power than either a Time or Sea Lord."
From Robin Bennett, Secretary of the Royal Engineers Bomb Disposal Officers' Club:
It was great to see you and the guys at the dinner yesterday. As ever, a splendid evening with good food, good company and good singing. Many thanks for inviting me and my fellow REBDOC members.
Robin"
From MCDOA member John Giddens in Singapore:
Thank you very much for a splendid MCD event last night. I know these things don't organise themselves!! Unfortunately there were so many people there who I hadn't seen for years and there was not enough time to speak to everyone for very long – including yourself. You seem to be keeping well, and I hope there is another time to catch up with you.
I am heading back to Singapore this afternoon with a suitably sore head, and re-charged memories of a great team of people in the MCD world.
John Giddens"
From MCDOA member Dave Forsey:
"One nameless member appeared to develop a mysterious rash between leaving the dinner and reaching his digs! Was it something he ate (or drank)?"
From MCDOA member John Staveley in La Spezia:
"Just a quick thanks for the dinner last Friday, and the effort y'all must have devoted to putting it on. The food, speeches, company and service were all great - even the singing was quite impressive. A faultless evening really, expect that it seemed not to last long enough for me to get round everyone I wanted to speak to.
JRS"
From MCDOA member Bob White:
Very many thanks for all your hard work and organisation to make the dinner such a success. It was good to catch up with "old" friends. I must try and get there again before I am "50". A most enjoyable evening and I am grateful to you for all the arrangements you made.
Bob"
From MCDOA member Darroch Woodward in Canada:
"Paul, Rob, Tony and Soapy,
Believe it or not, this has sat in my drafts box for five days - and I have only just realised I have not sent it. Absurdly overdue, I must still express my thanks for a splendid day on Friday 28 November. The morning brief and lunch was a particularly good update on the state of the branch, its people and equipment, and a good chance to chat socially and professionally with some legends, as well as some of those I have served with. The dinner was quite outstanding and obviously a special night for me, which often played on my emotions. Having flown from Vancouver, I was particularly grateful to see most of my own course there, but with so many people coming up to show envy for my 5 month ski sabbatical and / or wish the best for establishing a civilian career thereafter in Canada just as the world plunges into major recession, I don't think I ever got the chance to talk in depth until at dinner sat amongst those much older, those I have served with, including two Canadians, those who have followed, and guest serving or civilian sons. In danger of sounding old at a mere 46, I have to endorse what Captain Welborn has already alluded to. Those much younger still clearly have the mental and social skills and the mindset that is key to the future of the branch, the RN and Britain. With the current trend to moan about the quality of our youth and how "Bah humbug, it's not as good as it used to be", it is a pleasure to observe such detractors are often wrong.
Paul, thank you for your own kind comments in your speech. Having worked with you at various times in my career and had the pleasure of you being my Boss at Fleet HQ (as was), I am always impressed by your countless jokes and dits. I was particularly amused to be proclaimed at the outset of your speech as the poshest MCDO in the branch, and have my panic with an O2 fire on my back in a chamber regaled at the end. I do hope, however, that I remain the only diver in the world to ever have that type of fright! One of the last to leave in a state of wobbly reverie with other stragglers, I suddenly recalled your parting reminder to collect my glass diver; I reassure you I found it and thank the association. Tony you obviously have much to do behind the scenes for such a day and knowing your character from our time on both MWO and XO desig course, I know you are quietly key to much that happens. But Rob in particular, your own longstanding dedication to the MCDOA and in particular the website is all too often taken for granted by us all; long may your commitment remain as it will be hard for others to emulate - thank you.
To end, having invested much passion in the MCD business, I will always remain interested to know what is going on, and particularly wish the branch much with CDLSE and a resurgence in MCM diving capability. I will always treasure the strong camaraderie that ties the branch together and gives us our reputation within the RN service. It has been a privilege to serve as an MCDO as our people at all ranks and rates represent the finest, most enduring, perhaps greatest egos, and certainly some of the most amusing characters. Having also had the privilege to work with many NATO and ABCANZ divers throughout my career, particularly as a result of one exchange and one loan service appointment, I know that trait is in fact present in all our clan worldwide, be they from one of the four other nations who speak English as their first language rather badly, speak it better even though a second language (the Dutch), or come from completely different cultures. An extraordinary and exceptional body of people.
Take care all, and if anybody in the branch is skiing or boarding this winter in Whistler, I look forward to seeing you on the slopes or serving you in some bar.
Darroch Woodward"
Ledbury's back with a stowaway
The Portsmouth News website contains this article, featuring AB(D) James Shell, which describes how HMS Ledbury has returned from the Mediterranean with a stowaway.
3 Dec 08 - Updates on HMS Cattistock and HMS Ledbury
The RN website contains this article about the latest activities of HMS Cattistock and this article about HMS Ledbury.
HMS Ledbury with USS Barry
Significant Developments for Project Vernon
Last week saw some significant developments for Project Vernon, the campaign to erect a statue at Gunwharf Quays to commemorate the Minewarfare and Diving heritage of HMS Vernon. Australian Les Johnson FRBS was selected as the sculptor of choice following his presentation of a maquette judged as most closely satisfying the criteria established by the project committee. More details and pictures are available on the Home Page of the Project Vernon website.
Les Johnson's maquette
John Terry FCSD, Head of Fleet Graphics and ex-Portsmouth Graphics Pool at HMS Vernon, has produced a stunning oil painting entitled 'Danger at Depth'. This was initially intended to provide guidance to the competing sculptors but he has now donated it to the cause. It has already gone the rounds of the Defence Diving School on Horsea Island, the Minewarfare Operational Training Centre at HMS Collingwood and the MCDOA Annual Dinner at HMS Excellent and will be displayed at gatherings of other participating organisations throughout the coming months. Individuals will be given the opportunity to purchase limited edition prints with the proceeds going towards Project Vernon but advanced orders can be placed now via the project website's Purchases page. Hurry as they are already proving extremely popular and your early action will help the project committee gauge future fundraising requirements more accurately.
John Terry's painting
'Danger at Depth'
Navy team in action
The Portsmouth News website contains this article describing the disposal of a wartime shell off Harwich, presumably by SDU2.
Navy News Items
The December e-edition of Navy News contains the following MCD-related items:
It's Happy H hour again: The re-appearance of HMS Hurworth following her six-month maintenance period.
Ag-a-dir, dir, dir, to the north, to the south: A visit to Agadir in Morocco by HMS Ledbury.
Crimson kings: The activities of RN ships in the Gulf including HMS Chiddingfold, HMS Ramsey and HMS Blyth.
Long time no see for Gulf ships: The Faslane departure of HMS Grimsby and HMS Pembroke for the Gulf.
Egg-centric behaviour in MCMs: Charity fundraising by HMS Chiddingfold featuring PO(MW) 'Pinta' Beer, PO(D) 'Mac' Macpherson and LS(MW) Chris 'Chip' Miles.
Rain Runners: The participation of CPO(D) Ian Fleming and other divers from the Defence Diving School in the Great South Run.
Warrior force: The participation of units including HMS Quorn and HMS Middleton in Exercise JOINT WARRIOR.
30 Nov 08 - RN EOD Heritage - Leading Seaman Harry Fenemore RAN
Regular visitors to this website will know how much I cherish our historical links with other Commonwealth navies. I was therefore delighted to receive this e-mail from Mike Turner concerning LS Harry Fenemore RAN:
"Dear Rob,
From 1957 to 1990 I was a boffin at the RAN Research Laboratory in charge of the Mine Warfare Group providing scientific and technical support to RAN minesweepers and the Clearance Diving Branch. Currently I am writing a history book for the Naval History Section at the Sea Power Center-Australia and have found your website on honours and awards very useful. There is an omission from the listing. Leading Seaman Harry Fenemore RAN was awarded the DSM as per the London Gazette, 1 January 1942, page 33, position 1. I have not been able to access this notice for the citation but am told that it makes no specific reference to B & MD.
Harry Fenemore was born in Tringford, England on 17 June 1900. He joined the RN in 1916 and saw active service in HM Ships Ganges, Bacchante, and Barham during WW I. He emigrated to Australia and transferred to the RAN in 1920. After active duty in the Med in HMA Ships Stuart, Vampire and Vendetta he was loaned to the (Suez) Canal Mine Clearance Party as a diver from 28 March 1941 to 31 December 1941 (see attachment). The DSM was awarded for diving on a German GD mine that was lying too close to three ships to be swept or countermined. He dived in magnetically safe Standard Dress not knowing if the mine was an active acoustic mine (which would almost certainly have proved fatal). He rendered the mine safe by removing the primer extender and primer spring, removing the primer, cutting the detonator leads and removing the detonator. This is described in the attached USN letter from Mine Explosive Investigation Unit No.1 that was operating with two RANVR officers of note (Cliff and Goldsworthy) in the Solomons and Borneo in 1945.
Tragically Harry Fenemore died on 5 February 1947 during a routine underwater inspection of a wharf as a civilian contractor.
Mike Turner"
I have confirmed that Harry Fenemore's award of the Distinguished Service Medal (DSM) in the 1942 New Year Honours appears in Seedie's Roll of Naval Honours and Awards 1939-1959. His name and the circumstances of his award have now been added to the list of recipients of 'WW II Awards for RN Diving and Bomb & Mine Disposal' in the website's 'Branch History' section and I have informed Mike accordingly.
29 Nov 08 - MCDOA Operational Updates, AGM and Annual Dinner
Rear Admiral Cooling speaks
Yet again I can't believe our luck in having Tony Griffiths as our Honorary Secretary. Yesterday's highly informative operational updates, convivial lunch and productive AGM at Horsea Island followed by the superb dinner in the Wardroom at HMS Excellent went like a dream, all thanks to his tireless efforts and remarkable organisational skills.
We are also in debt to our Guest of Honour, Rear Admiral Bob Cooling, for his encouraging and entertaining speech, Cdr Simon Howell for graciously giving permission to use his mess in Whaley, Band Colour Sergeant Doug Scott BMus (Hons) PGDip RM and the stalwart players of HMS Nelson's Volunteer Band for their marvellous virtuosity, Chef de Cuisine Mark Stockwell and his brigade for our tasty fare and Maitre d'Hotel Richard Croughan and his staff for their efficient service and enthusiastic participation in the after-dinner singing. Those of us who were accommodated overnight on board HMS Bristol are also grateful to Lt Cdr Adrian Elston for granting us this very welcome privilege.
Our service leavers were well-roasted and it was good to see so many from the 1968 and 1983 LMCDO courses celebrating their 40th and 25th anniversaries respectively as well as guests from the Australian, Canadian and US Navies plus the odd Royal Marine, Sapper and Police Superintendent. The dinner was announced in the Daily Telegraph and The Times (online version here). I have published photographs of the day's events in the Members Only area of the website (N.B. Not for the faint-hearted!).
27 Nov 08 - A bit of Vernon nostalgia
On the eve of our annual dinner when we will celebrate, among other things, the 40th anniversary of the 1968 LMCDO Course of which the late-lamented Chris Beresford-Green was a member, I thought it appropriate to display the photo below, kindly supplied by Peter Waddington. It shows members of Deepwater Division being inspected by Admiral Sir Horace Law CB OBE DSC (then Commander-in-Chief Naval Home Command) during ceremonial divisions at HMS Vernon in 1971. Astern of him are LMCDO '68 Course Officer Lt Cdr Peter Waddington (then 'IDiving') and LMCDO '68 student Lt Tim Hildesley (then 'DO1') with Captain Stuart Farquharson-Roberts OBE (then Captain of HMS Vernon) bringing up the rear. I am reliably informed that the divers standing nearest in the front rank of the Deepwater platoon are the then PO(D) Dudley North, PO(D) Les Sharpe and LS(D) Jan Peacey - unless others know different.
CINCNAVHOME Divisions
at HMS Vernon in 1971
Service of Thanksgiving for Chris Beresford-Green
From today's edition of The Scotsman:
"BERESFORD-GREEN Christopher (Pitlochry, Perthshire) Peacefully, in hospital, on Saturday, November 22, 2008, Christopher (Chris) Edward, Lieutenant Commander Royal Navy (Retired), much loved husband of Virginia, brother of David and father of Paul and Mark and their families. Service of Thanksgiving to be conducted at Holy Trinity Church, Perth Road, Pitlochry, at 12 noon, on Friday, December 5, followed by a private cremation. Donations, if desired, for the Royal British Legion, Scotland, c/o Gaulds Funeral Directors, 34 Atholl Road, Pitlochry, PH16 5BX, tel 01796 474001, email davidgauld@aol.com."
I will ask Soapy Watson, our Honorary Teasurer, to make a donation to the Scottish RBL on behalf of the MCDOA in lieu of a floral tribute.
MCDOA Committee Meeting Minutes
The minutes of the MCDOA Committee meeting held at Fleet Diving HQ on 28 Oct 08 have now been added to the Members Only area.
Death of Chris Beresford-Green
I regret to report the sad news from MCDOA member Dan Nicholson and Alf Slingsby that MCDOA member Chris Beresford-Green (LMCDO '68) passed away in hospital on Friday night as the result of the stroke he suffered several months ago. His funeral is expected to take place in Pitlochry and details will be published if and when known. I have contact details for Chris's wife, Virginia, for anyone who would like to send their personal condolences. In the meantime, I can only offer her and the rest of Chris's family, including his son Paul, a Lt Cdr in the RN, and his brother David in Canada, our deepest sympathy on Chris's untimely death. One could never hope to meet a nicer or a fairer man.
From MCDOA member John Lang:
Just seen the sad news about Chris. If memory serves me right we served together in the Hong Kong squadron 69/70. Please pass on my condolences to his widow.
John Lang
RN Diving Technology
Today's Portsmouth News contains the following item featuring PO(D) Al Reilly as part of a two-page article about the use of new technology in the Royal Navy following Staff College Sea Days at Plymouth last month:
24 Nov 08 - HMS Ledbury destroys mines in English Channel
The RN website contains this article describing how HMS Ledbury has been finding and destroying wartime ordnance in the English Channel over the past week. The article features PO(MW) Mark 'Ginge' Wilcockson and AB(D) Toby Jones.
HMS Ledbury destroys a mine in the English Channel
23 Nov 08 - Update from HMS Cattistock
Lt Cdr David Morgan, the Commanding Officer of HMS Cattistock, has kindly sent this update:
"Greetings from Portsmouth! Having crew-swapped from HMS Cattistock to HMS Atherstone in September last year, we successfully deployed to the Gulf and have now returned to HMS Cattistock.
Although I say greetings from Portsmouth, we seem to have spent very little time in port. On our return, we became the first Royal Navy ship in 25 years to visit the Channel Island of Sark, where I think we managed to meet almost half of the 600 inhabitants during our two-day stop-off. Next, we escorted the Funchal 500 Tall Ships Race on their first leg from Falmouth to Ilhavo in Portugal. The second leg has since taken them to their final destination in Madeira where they are celebrating the 500th anniversary of the first settlement on the island. On the way back, we stopped off in Villegarcia de Arosa in Spain, which was a forward operating base for the Royal Navy in the 19th Century with apparently some 30,000 of our sailors based there.
We visited the Channel Islands again last month, this time Guernsey, to take part in the annual celebrations that commemorate the islanders' defiance of the German regime during the Second World War. In 1943, the inhabitants turned out in large numbers to attend the funerals of the ships' companies of HMS Charybdis and HMS Limbourne. These ships had been sunk in the vicinity of the islands after attempting to intercept German convoys and many bodies from their ships' companies had washed up on Guernsey. Although the Germans continued to go through the required formalities of a military funeral, the islanders were forbidden from attending again.
Most recently, we have been patrolling the west coast of the UK on Fishery Protection duties and managed a short stand-off in Liverpool at the same time as HMS Illustrious. After our short stint employed on Fishery Protection we returned here to Portsmouth where we are now alongside for maintenance which also gives us the opportunity to catch up with family and friends."
AB Taff Slee, AB Buckley and AB Jay Lynch catch
the liberty boat ashore in Sark to attend Church
22 Nov 08 - Memorial Service for former CPO(D) Dougie Stewart
Altar in St Barbara's Church
HMS Excellent
A strong contingent of naval divers attended the Memorial Service for former CPO(D) Dougie Stewart today in St Barbara's Church at HMS Excellent. Serving divers in uniform included MCDOA members Chris Baldwin and Paul McDermott plus Kevin Ameira, Dan Archer, Paul Bhathena, Andy Carrs, Peter Digweed, Richard Ellis, Tim Gates, Chris Greenaway, Knocker Knowles, Alastair Reilly, Chris Rumming, Ken Smith, Col Taylor, Rex Turnbull (with his son Alex) and Scouse Vernon. Former RN divers included MCDOA members Rob Hoole and Graham 'Tug' Wilson plus Dave Barrett, Kevin Bell, Tony Candler, Mark Cheeseman, Dave Cherry, Ian Devine, Jim Donnelly, Eamon Fullen, Tim Gates, Richard Harker, Bob Lothian, John Meekin, Alan Murphey, Steve Reese, Dean Rushforth, Tim Sizer, Adrian Slater, Pete Still and Yorky Tudor. Dougie's former colleagues from the HSE included MCDOA members Steve Field, Mike Leaney and Chris Sherman plus Richard Martins, Brian McGlinchy, Pete Sieniewicz and Judith Tetlow.
The service was conducted by the Revd Tim Wilkinson RN of HMS Collingwood and started with a welcome that included Psalm 107 verses 23-4:
"They that go down to the sea in ships
and occupy their business in great waters.
These men see the works of the Lord,
his wonderful deeds in the deep."
After the singing of the hymn 'Immortal, Invisible, God Only Wise' to the organ accompaniment of Lyndon Ford, and the saying of prayers, Steve Field described how Dougie joined the Royal Navy in 1980 and served as a Radio Operator in the frigates HMS Diomede and HMS Argonaut before qualifying as a ship's diver. He qualified as an AB(D) in 1985 and then joined the Plymouth CD Team. He followed this by qualifying as a saturation diver in the Seabed Operations Vessel HMS Challenger and undertaking deep diving trials. After qualifying as a LS(D), he served with FDU3 and spent six months on exchange with the Royal Australian Navy as a participant in Exercise LONG LOOK. He then served with FDU1 and qualified as a PO(D) in 1998. As coxswain of HMS Quorn, he was involved in trials of the new CDBA and supervised its first 80m dive. He then served with FDU2 which included a deployment to Macedonia on Operation BESSEMER. This was when he impressed Army observers with his ability to blow the turret off a T-55 tank so that it landed back on upside down. Dougie's final job in the RN was at DDS on Horsea Island where he served with Steve Field. After leaving the Service, he spent two years with DIVEX and a further three years with the HSE's diving inspectorate before his untimely death last August Bank Holiday. Apart from testifying to Dougie's impressive professional skills as a diver and instructor, including his photographic memory of the Diving Manual, Steve also paid tribute to his wonderful sense of humour and his renowned talent for 'spinning dits'.
Mike Leaney then paid his personal tribute to Dougie which included the fact that they had served together in HMS Diomede. He read several tributes from people unable to be present including Mike Loane and Beach Younger, Martin Jenrick, Richard 'Soapy' Watson, Paul Guiver and Hazel Hancock of the HSE's Aberdeen office.
The congregation sang 'Lead us Heavenly Father' before John Meekin read from St John's Gospel 14.1 verses 1 to 7 and 25 to 37 (In my house there are many mansions). The Revd Tim Wilkinson then gave an address which tied in the Gospel reading's theme of fellowship and story-telling with Dougie's relationship with the naval diving community. Prayers, including the Naval Prayer, were followed by the Naval Hymn incorporating Uncle Bill Filer's special verse for divers. After the benediction, most attendees went on to raise a glass in Dougie's memory at the Mermaid in Port Solent, adjacent to Horsea Island.
Dougie's two young daughters, Rachael and Ella, did their father's memory proud today. They have our deepest sympathy, as does their mother Louise. We also extend our condolences to Dougie's parents, Bob and Betty, and to his sister, Jackie.
Douglas Robert Stewart
21 Nov 08 - 2008 MCDOA Annual Dinner attendees
This is the final list of attendees for the dinner in HMS Excellent on Friday 28 November:
Rear Admiral Bob Cooling
(Assistant Chief of the Naval Staff)
Official Guests
Captain Peter Lambourn RN (Captain Minewarfare, Diving & Fishery Protection)
John Terry FCSD (Head of Fleet Graphics)
Séan Sweeney MBE (Operations Manager, Gunwharf Quays)
Service Leavers
Colin Welborn (MCDOA President)
Charlie Wilson (LMCDO '83A)
Darroch Woodward
Other Members and their Guests
(Host's name in brackets)
Capt R S 'Jock' Alexander RN (Bob Hawkins)
Martyn Allen
John Bainbridge
Robin Bennett ACIS (RE BD Officers' Club)
John Bray OBE (Tony Griffiths)
Keith Broughton
Benjamin Butterworth (Nigel Butterworth)
Nigel Butterworth (LMCDO '83A)
David Carey (LMCDO '83B)
Oliver Carey (David Carey)
Ryan Carey (David Carey)
Adrian Cassar
Jon Cox
Mike Critchley
Don Crosbie
Tim Curd
Cdr Chris Deere CN
Morty Drummond
Edward Durkin (Mark Durkin)
Mark Durkin
Brian Dutton
Simon Edwards (Keith Broughton)
Mike Emary (LMCDO '68)
Steve Field
John 'JJ' Forbes (RE BD Officers' Club)
Dave Forsey (LMCDO '68)
John Giddens (LMCDO '83A)
David Giles OBE (Tony Griffiths)
Kev Giles
Lt Richard Gobey RNR (Steve Gobey)
Steve Gobey
Pete Greenwood
Geoff Goodwin
Tony Griffiths
Alan Hares
Cliff Hares
Paul Hares (Cliff Hares)
Stu Harper
Bob Hawkins
Neil Hemmings (Jon Cox)
John Herriman
Peter Hicks
Martyn Holloway
Rob Hoole (LMCDO '83A & '83B Boss)
Cdr Gareth Hughes RN (Bob Hawkins)
David Hunkin
Phil Ireland
Mike Leaney
Rollie Leyte CN (Bill Kerr)
Martin Mackey
Dougie MacDonald
Ralph Mavin
Paddy McAlpine
Paul McDermott
Lt Col Peter McMullen RM (Don Crosbie)
Simon Neil
Toby Neil (Simon Neil)
Al Nekrews
Lt Cdr Mike Oborn RAN (Don Crosbie)
Chris Flaherty
Sean O'Reilly
Richard Osbaldestin
Gary Pascoe (David Hunkin)
Simon Pressdee
Mr P Redman (Tom Russell)
Ian Richardson
Keith Riches
Simon Ridout (LMCDO '83B)
Stuart Robinson
Les Rutherford
Mark Savage
Chris Sherman (LMCDO 83A)
Tim Sizer (Tug Wilson)
Lt Ash Spencer RN (Simon Pressdee)
John Staveley
Lt Chris Stephenson RN (Paul Jones)
Kev Stockton
Capt Simon Thomas RN (Colin Welborn)
Capt Kevin Tokarick USN (Bob Hawkins)
Alan Trevarthen
Peter Waddington (LMCDO '68 Boss)
Frank Ward
Richard 'Soapy' Watson
Bob White (LMCDO '68)
Graham 'Tug' Wilson
Iain Wood
Mr C Young (Tom Russell)
MRUs: Chris Ashcroft, David Bartlett, Alan Bayliss, John Beavis, Capt Martin Brooker RAN, Jon Chapple, Adrian Elston, John Higham, Tim Hildesley (LMCDO '68), Nigel Hill, Ken Kempsell, Mike Loane, Alex Manning, Steve Marshall, Jim Nisbet, Alexandra Norton, David 'Doc' O'Connell, Harry Parker, Tony Rose, Graeme Symes, David 'Topsy' Turner (LMCDO '83B) and Andy 'Sharkey' Ward.
See entry for 8 Oct for further details.
19 Nov 08 - TV programme about RAN Clearance Divers
The fourth and final episode of the Australian Broadcasting Corporation's excellent TV documentary series 'Navy Divers', which follows the progress of a Royal Australian Navy Clearance Divers' course, is now available to watch online via this link. All four episodes can be accessed via this link.
16 Nov 08 - Update from HMS Ramsey
I am grateful to Marc Taylor, Navigating Officer of HMS Ramsey, for sending this update:
"RAMSEY completed a five week maintenance period on the 11 Oct which included some much needed work to ensure the ship was well prepared to meet the rest of the programme in the Gulf and also for the long passage back to the UK. As a result of some re-structuring of programmes for the OP TELIC MCMVs, Ramsey learned in October that her deployment in the Gulf was to be extended until Feb 09 with the obvious impact to the ship's company being away from home for Christmas. In true naval tradition this was taken in good heart by the ship's company who realise that there is an important job for Ramsey to do in the Gulf but they were also pleased to hear that there likely to be an opportunity for all to take some leave to go home from Bahrain over the Christmas period. The remainder of October has been very active for the ship with a shakedown period following close on the heels of the extensive maintenance to ensure all elements of the ship were fully functional. This was followed by two periods of route survey tasking in the Central Arabian Gulf in company with our sister ship HMS Blyth. Route Survey operations are a very methodical but necessary operation within the Gulf that allow detailed maps of the seabed along major shipping routes to be compiled; it also provides an ideal opportunity to practice the majority of our mine hunting and diving skills which was fully exploited to ensure the team was well prepared for the forthcoming combined US/UK MCM exercise scheduled for November. The visit to Dubai was enjoyed by all and was a welcome, although expensive, change of scenery after Bahrain.
The final event of the month was a visit by the officer in overall charge of the Sandown MCMVs, Captain Garrett, Captain Faslane Flotilla, who spent time on board both Ramsey and Blyth to provide assurance to the Commander-in-Chief Fleet that the ships are performing to a high standard and have no issues that are likely to affect their operational capability. It is pleasing to say that he went back to the UK satisfied with what he had seen in both ships.
The highlight for October has been recovering the ship from an extensive maintenance period and taking her to sea in very good condition after five long weeks alongside. Ramsey now has a varied and interesting programme for the remainder of her time in the Gulf and we shall be sure to keep the website updated with the details."
Apparently, the Atlantis Water Park in Dubai was very popular with the ship's company.
Atlantis Water Park in Dubai
A memorial service for ex-CD Douglas 'Dougie' Stewart, late of the Health & Safety Executive's Diving Inspectorate, will be held in St Barbara's Church at HMS Excellent on Whale Island, Portsmouth at 1000 on Saturday 22 November. Non-serving members who wish to attend should contact MCDOA member Mike Leaney of the HSE in advance so that he can arrange access to the establishment.
HMS Blyth update
The Navy News website contains this article describing HMS Blyth's preparations for returning to the UK after her 27-month deployment to the Gulf.
AB(MW) Mellor of HMS Blyth after
successfully hitting a gunnery target
(Navy News website photo)
TV programme about RAN Clearance Divers
The third episode of the Australian Broadcasting Corporation's four-part TV documentary 'Navy Divers', which follows the progress of a Royal Australian Navy Clearance Divers' course, is now available to watch online via this link.
11 Nov 08 - Bill Bauckham's Funeral
It was standing room only in the chapel at Portchester Crematorium yesterday with many past and present members of the Clearance Diving Branch supporting Bill's family and friends. Apart from MCDOA members Brian Dutton, Rob Hoole and John O'Driscoll, naval divers present included Chris Christie and Donkey Bray in uniform plus Cris Ballinger, Stan Bowles, John Dadd, Paddy Doonan, Bob Fraser, Don 'Jimmy' Green, Gabby Haines, Mike Handford, Vic Humphrey, Colin 'Scouse' Kidman, Gerry 'Pincher' Martin, Spud Murphy, Nobby Noble, Buck Rogers, Stew 'George' Sissons, Spike Spears, Stan Stanley, Pete Still, Troy Tempest, Tommo Thomson, Tiny Timms, Yorky Tudor, Willy Wilkes and many others. WO(MAA) Kev 'Taff' Williams also attended in uniform. I apologise to those I've missed out.
The service started with a reading of the 23rd Psalm. After prayers, the Reverend Ron Robinson of the Church of the Ascension in Stubbington Avenue, Portsmouth described Bill's life and career and paid tribute to his commitment to the Royal Navy and to his family. We learned that Bill was born on the River Tees in Cleveland and joined the Navy at the age of 16, eventually serving for 35 years before retiring as a CPO(D). He met his wife Nancy at a dance in Southsea while serving at HMS Vernon. Within days of their wedding in 1964, he joined the cruiser HMS Sheffield. The Revd Robinson quoted several glowing testimonials to Bill's prowess as a diver and as a diving instructor and of his other skills as a cook, handyman and gardener; he fed his family from his allotment for 34 years. During the committal, the congregation listened to a recording of Sarah Brightman singing Bilitis-Generique and the service finished with the Naval Hymn. Most people then moved on to a lively reception at the Cormorant in Portchester where we raised a glass in Bill's memory.
Our thoughts remain with Bill's widow Nancy, their children Alison, Eleanor, Ann and Robert and their grandchildren Anna, Andrew and Mia. I hope they take strength from the support we provided and the obvious esteem in which we all held Bill.
10 Nov 08 - Act of Remembrance by HMS Atherstone
The RN website contains this article describing the Act of Remembrance performed by HMS Atherstone in Bahrain on Sunday.
Remembrance Sunday on board
HMS Atherstone
9 Nov 08 - Lest We Forget
They shall grow not old, as we that are left grow old;
Age shall not weary them, nor the years condemn.
8 Nov 08 - RNZN Divers use 'Classic Kiwi Ingenuity' to recover helicopter and body of pilot
The following online articles describe how RNZN Clearance Divers using REMUS and Seaeye ROVs helped detect and recover a helicopter and the body of its pilot from a 74m deep lake in New Zealand yesterday:
Six targets identified in search for missing pilot
Navy divers focus on finding pilot's body
Missing pilot's body found
'Classic Kiwi ingenuity' used in recovery of pilot's body
7 Nov - 08 Navy News Items
The November e-edition of Navy News has just been published online and contains the following MCD-related items:
Readying for the long road home: Preparations by HMS Ramsey and HMS Blyth to return home from the Gulf after their 27-month Aintree deployment.
...as does Brocklesby/Chiddingfold: The achievements of MCM2 Crew 2 which has manned both HMS Chiddingfold and HMS Brocklesby in recent months. The article features PO(MW) Tony 'Pinta' Beer.
Plume with a view: The disposal of a wartime German mine off North Kent by Southern Diving Unit 2 featuring CPO(D) Sid Lawrence.
Divers diversify to running: MCDOA member Chris Baldwin (CO of the Southern Diving Group) and SDG members Lt Alex Gillyon, WO(D) Rick Rickard, CPO(D) Andy Coulson, CPO Phil 'Butty' Butterworth, CPO Steve Vernon, Ldg Diver Sean Dunstan and AB(D) Simon Wharton in a 128 mile sponsored run along the Leeds to Liverpool Canal for the Against Breast Cancer charity.
Chris Baldwin with other SDG runners
on the towpath
The golden touch: A double-page spread describing the activities of HMS Ledbury and Standing NATO MCM Group 1, under the Command of MCDOA member Chris Davies embarked in HMS Roebuck, during Exercise NOBLE MIDAS in the Mediterranean. The article includes mention of the former RN Hunt Class minehunter HMS Bicester (now HS Europa in the Greek Navy) and the former RN Sandown Class minehunter HMS Sandown (now ENS Admiral Cowan in the Estonian Navy).
Long Term Dates for the Diary:
20-22 February 2009 - RN Minewarfare Association Northern Reunion
Polly Porter of the RN Minewarfare Association is organising an all-ranks Minewarfare reunion at the Norbreck Castle Hotel in Blackpool over the weekend of 20-22 February 2009. See this entry on the Minewarfare Association's website for further details.
27 Feb 2009 (TBC) - MCDOA Northern Dinner
MCDOA member Andy 'Sharkey' Ward, CO of the Northern Diving Group, has assured me that he will brief his relief, fellow MCDOA member Jason White, to organise the Association's 2009 Northern Dinner at HMS Neptune as usual. Traditionally, it is held on the closest Friday to the anniversary of the formation of the MCD Branch (25 Feb 1966).
22 April 2009 - Service of Thanksgiving for Lt Cdr Ian Fraser VC DSC RD* RNR
The Service of Thanksgiving for wartime X-craft submariner and diver Lt Cdr Ian Fraser VC DSC RD* RNR will be held in St Martin-in-the-Fields, Trafalgar Square on Wednesday 22 April 2009 starting at 1400. A formal announcement of the event will be made in The Times, Daily Telegraph, Independent and Navy News early in the New Year. Further details will be provided in due course.
12th June 2010 - RN Clearance Divers' Reunion on board HMS Warrior
Troy Tempest of the Association of RN First Class Divers is organising an all-ranks Clearance Divers' reunion on board HMS Warrior 1860 in Portsmouth for Saturday 12 June 2010. Full details will be promulgated on the new RN CD website in a couple of months but names and numbers will be required by 12 June 2009 with a deposit of £10 to secure a place. This will be open to all RN Divers and their guests on a first come, first served basis. Numbers will be limited so prospective attendees are advised to book early.
Divers' Dinner at Kimbell's Corner House, Portsmouth c.1960
Speaking of dinners, former FCPO(D) Dave 'Mona' Lott in Australia has sent me the following e-mail and photos of a divers' dinner at Kimbell's Corner House opposite the Theatre Royal in Commercial Road, Portsmouth c.1960. The establishment enjoyed a second life as the Portsmouth Playboy Club during a brief period in the mid-1970s.
"I'm having a very nostalgic day after hunting down the photo of Taff Roberts CD1 RIP. Recent talk of the future divers' bash on board HMS Warrior and a call for the old days at Kimbell's Corner House in Portsmouth set me thinking which can be quite dangerous.
Among the "olde" happy but sad collection of my snaps is this one of some well remembered faces but the year definitely stumps me. Late 1950s early 1960s perhaps? From memory the blokes are as follows: nearest the camera Paul Scott - a Steamer converted to CD1 (deceased); then Trevor Gibson - CD1 (one of Shiner Brassington's old mates); Dadd Davis - CD2; Mick Corbett - CD1 (nice bloke, wonder where he went); Ted Rose - CD1 (deceased - he was always good for a laugh); I forget the name of the next person but I think he was a Diving section Schoolie. Opposite him is Taff Lawrence - MCDO (deceased); I forget the name of the next bloke but I believe he was a steamer; then there's a South African - CD(Q) and whose name is rattling around in my brain very annoyingly (just remembered surname of Dewey); yours truly is next; followed by Ken Blaylock CD1 (deceased); next is Thommo Thomas who was an AB CD3 on the Dingley with me; and at the end Dave Audoire - CD1. Between these last two in the distance facing the camera is MCDO Jim Cook who was to lose an eye in a car accident involving Johnny Lett - CD1. I think that MCDO John Grattan is maybe the second from Jim Cook's right.
The Toffs at the next table are from front right to left: Willy Wilkes - CD1; Geoff Burgess D1 (deceased); Scobbie Beasley Artificer Diver; next is unknown; Mr Barrington ex-QDD and later civil servant at AEDU (deceased); diagonally to his left coming back along the table is Tag Caisley MCDO; next is unknown; I think the next is the one and only Tom Norman; next is D1 later converted to CD1 Ron (Flannel) Flanagan now Maitland-Flanagan; then good old Ernie Foggin - CD1 thoroughbred (deceased); and finally to Paul Scott ex-D1 converted to CD1 (deceased).
As some of you can probably remember, these functions were organised and thoroughly well run by Uncle Bill Filer and there were always several hundred highly enthusiastic members in attendance. It must have taken considerable expertise to organise these annual get togethers so they certainly had hold of the right bloke.
Hope you enjoyed this trip to visit old buddies.
Dave (Mona)"
5 Nov 08 -TV programme about RAN Clearance Divers
The second episode of the Australian Broadcasting Corporation's four-part TV documentary 'Navy Divers', which follows the progress of a Royal Australian Navy Clearance Divers' course, is now available to watch online via this link.
3 Nov 08 - Death of former CD1 Hugh 'Taff' Roberts BEM
Troy Tempest of the Association of Royal Navy First Class Divers (AORNFCD) has informed me of the recent death of Hugh 'Taff' Roberts. He served throughout the world, including the Far East, and was awarded the British Empire Medal for his services to clearance diving in the 1960 New Year Honours. The funeral took place at 1400 on Friday 31 October at St John's Church, Sleights, Whitby, North Yorkshire.
2 Nov 08 - Funeral arrangements for former CPO(D) Bill Bauckham
The funeral of Bill Bauckham (see entry for 26 Oct 08) will take place at Portchester Crematorium on Monday 10 November at 1330. Flowers to Barrells Funeral Directors, 245 Fratton Road, Portsmouth PO1 5PA (Tel: 02392 824831). A wake will be held in the Cormorant on completion.
Hamish Loudon in the news
From the Lochaber News of 23 Oct:
"Typical school holiday weather
I met Ken Jones of the P&J [Press & Journal] in the blustery, rain-lashed High Street this morning. "You need a master mariner's certificate to negotiate your way along from one end to the other," he remarked. Just then, Hamish Loudon, RN, hove into view. But, of course, unlike the press gang landlubbers, he wasn't making heavy weather of steering a middle course through the town..."
My thanks to ex-CD1 Perry Mason for providing this snippet about MCDOA member (and an old CO of mine) Hamish Loudon of Fort William.
DDS Divers complete Great South Run
The RN website contains this article about the participation of CPO(D) Ian 'Scouse' Fleming and a team from the Defence Diving School in last weekend's Great South Run in Southsea (also see entry for 24 Oct 08).
DDS Divers after Great South Run
28 Oct 08 - TV Documentary about Australian Clearance Divers
The first episode of a four-part Australian Broadcasting Corporation TV documentary called 'Navy Divers' describing the progress of an RAN Clearance Diver course can now be watched online here. It show candidates being put through the ten day clearance diver assessment test (CDAT).
HMS Grimsby and HMS Pembroke sail for the Gulf
The RN website contains this article announcing today's departure of HMS Grimsby and HMS Pembroke from Faslane. They are due to relieve HMS Blyth and HMS Ramsey who have been in the Gulf for the past 27 months.
HMS Brocklesby's Ship's Company earns another trophy
The RN website contains this article describing the award of the Desmond Wettern Fleet Media Award for Small Ships to the current ship's company of HMS Brocklesby, mostly for their work while manning HMS Chiddingfold in the Gulf.
26 Oct 08 - Death of Bill Bauckham
Bill Bauckham
Troy Tempest, the Secretary of the Association of RN First Class Divers, has passed me the sad news of the death of former CPO(D) Bill Bauckham from mesothelioma on Thursday 23 October. Bill was the Course Instructor for LMCDO '73 (Course Boss Ed Thompson), LMCDO '74 (Course Boss John O'Driscoll) and LMCDO '80 (Course Boss Pat Gale).
The family would like to keep things low key for the moment so please do not contact his wife who has been devastated during these past few months. Funeral arrangements will be promulgated when known.
From MCDOA past-President Richard Moore (former COMMW):
I am very sorry to hear the news concerning Bill Bauckham - please pass on my sincere condolences to his family. As the MCDO Course instructor he took charge of a disjointed group of junior officers and welded them into a pretty effective team - most of the time!
He was a first class instructor who was well respected by his superiors and juniors alike. Bill employed his dry sense of humour to great effect and showed calmness when he and the Course were under stress.
Bill will be sorely missed - a true professional.
Richard"
From MCDOA member Ed Thompson:
Many thanks for keeping the rest of us in touch with this sad news and all other happenings in the branch. Bill and I worked together with the LMCDO 1973 course, my contribution to it was made so very easy thanks to Bill.
He not only was an excellent Petty Officer and first class instructor, but a truly gentle, gentleman, the best of the best, whom I feel very privileged to have known for far too short a time.
My heart goes out to Bill's family.
Ed Thompson"
From MCDOA member Mike Kooner:
"Hello Rob,
So sorry to hear about Bill. He was my course instructor and helped me and many others during that time and later
as we progressed through the branch. A splendid and very kind man. I never heard anyone say a bad word about him, which is a remarkable achievement for our branch and speaks volumes.
Regret we do not return to UK until 14 November and suspect will miss his funeral. When appropriate please pass on my condolences to his wife and family.
Mike"
From MCDOA member Alan Bayliss:
"Thank you Rob for letting me know of the sad loss of a perfect Gentleman.
Billy was an inspiration to my LMCDO course. He got the best from us in a quiet, firm, efficient manner. He made men out of us boys.
Alan"
From MCDOA member Geoff Goodwin:
"Gentlemen,
Sorry for the delay in responding but I have been away.
Bill Bauckham was my Long Course instructor in 1974. He was, without question, an excellent and highly knowledgeable instructor and a shining example to us Lieutenants on course. As an instructor he had the ability to teach many of the aspects of theory, equipment and practical diving that were never in the BR. After qualifying, when supervising or planning some complicated job, I remember often thinking, "What would Bill do in this situation?" Even later on, when working on policy and the future of RN diving in the MOD, at Northwood running some operation or serving in a frigate, he would be the first person I would call to seek advice. I am one of many who have Bill to thank for my successes.
Bill had a dry and ready wit; he was able to relate to people at all levels and he was popular with everyone I know who met him. I was very saddened to hear of his death.
Geoff Goodwin."
From MCDOA member Andy Stribley:
I was very sorry and saddened to hear of Bill Bauckham's death. He was a tower of strength and expertise as my course instructor, not to mention having a well-judged ability to turn a blind eye now and again.
A first rate person in all respects.
Andy Stribley"
From MCDOA member Stu Harper:
Very sad news indeed. Bill was a total professional who skillfully shaped so many Branch careers.
Stu"
From former FCPO(D) Dave 'Mona' Lott in Australia:
While on the website I saw that you have posted the extremely sad news about Bill Baukham, one of our old contemporaries. I would like to pass the sincere condolences of both Les Maynard and myself to Bill's family.
Memories are often recalled at sad times. One such memory comes from the night in 1965 when we hung Bill and Charlie Charlwood back over the side in Reclaim's bell during the six hundred feet bounce dive trials. They had both suffered significant bends that needed to be pressurised to depths greater than the Deck Decompression Chamber could provide. That was a very long night and one of considerable concern to all. We were all very glad to receive them back on board the following day. I guess this latest sad news places them together again on their longest and final stop.
Rest in peace old chums.
Les and Dave"
From MCDOA member Dougie MacDonald:
Bill was also the 1980 course instructor - I echo all the comments - a gentleman!
Dougie"
25 Oct 08 - New Personal Update
The Members Only area contains an update from MCDOA member Jon Chapple who settled in Canada eight years ago. It includes an attractive UK-based job offer for an ex-MCD.
Great South Run in Southsea on Sunday
This is a reminder that CPO(D) Ian 'Scouse' Fleming and a team from the Defence Diving School will participate in the BUPA Great South Run in Southsea on Sunday 26 October. Two of the team will be wearing 'new' CDBA weighing around 98 lbs. Ian's step-daughter Claire died from meningitis in 1989 and donations can be made to the Meningitis Trust via the team's web page at www.justgiving.com/navydiver. Well done to the divers of HMS Shoreham, among many others, for their magnificent contribution.
Former CPO(MW) Dorian 'Simmo' Simmonds will also be running in this event. His 11-year old daughter Neve has been suffering from Crohn's Disease for the past four years and donations to the Crohn's in Childhood Research Association can be made via his web page at www.justgiving.com/doriansimmonds.
This photo shows AB(MW) Ben Murphy with Paula Radcliffe MBE (Women's Marathon World Record Holder), Lt Cdr Oscar Whild RN (CO HMS Victory) and Luke Kibet (reigning World Marathon Champion and winner of last year's Great South Run) at the media launch of the Great South Run on board HMS Victory today.
Media launch of Great South Run on board HMS Victory
23 Oct 08 - RN Diving Heritage
I was contacted recently by author Philip Baker who is writing a novel featuring a 'P' Party diver during the final months of WWII. He needed some technical advice so I put him in touch with former AB David Shane, now 82, who was awarded a Mention in Despatches for his wartime service with 'P' Party 1571 in Western Europe under the Command of Lt Cdr George Gosse GC RANVR. The 'P' Parties, or Port Clearance Parties, were the direct antecedants of the Clearance Diving Branch and Gosse was the first man to render safe and recover one of several German GD 'Oyster' pressure mines found in the docks at Bremen in May 1945. David Shane, who discovered an Oyster mine in Ubersee Hafen himself, is mentioned in Open the Ports - The Story of Human Minesweepers by Grosvenor & Bates as having launched a newspaper called Noseclip in Bremen on VE Day. This was the daily paper of 'P' Party 1571 and, incidentally, the only paper in Bremen at that time. It was no respecter of rank or persons, the highlights of the day being given in an editorial by Penelope Protosorb. There was a serial, a personal column and even advice to the love-lorn from Wren Dell.
After the war, David helped dispose of legacy bombs and mines around the UK with some of the few remaining ex-'P' Party members. This photo shows him with fellow divers during an operation to find a German bomb in the Manchester Ship Canal in 1946. The divers are wearing the 'P-party Mk II Suit'.
Manchester Ship Canal Bomb Disposal 1946
L to R: McCallum, Clarke, Rixon and Shane
This newspaper clipping describes the operation:
In 1947, David found himself in Haifa with a Royal Naval diving team under the Command of Lt Cdr (later Cdr) Lionel 'Buster' Crabb OBE GM RNVR. Their task was to search for improvised explosive devices in and around the harbour and under ships during this difficult time when the newly emerging state of Israel was being established in Palestine. Under a United Nations mandate, British forces were trying to control the immigration of post-Holocaust Jewish refugees and were the frequent targets of bombings by fiercely Zionist groups such as the Hagana, the Irgun and the Stern Gang. These photos are from David's collection:
Left: Lionel 'Buster' Crabb (centre) and Lt W 'Jacko' Jackson RANVR (left) with RN Divers in Haifa 1947
Right: RN Divers in Haifa 1947 (David Shane second from right)
Left: Shane, Murray and Power in St Andrew's Hostel, Haifa - later bombed by the Irgun
Right: Hut used as diving store in Haifa 1947
Jewish refugee ships off Haifa 1947
Diving tender in Haifa 1947 (Destroyer HMS Chevron in background)
Left: Diver in 'P-party Mk II Suit' in Haifa 1947
Right: Power, Shane, Murray and McCallum in Haifa 1947
David Shane in Haifa 1947
I am most grateful to David for sharing these pictures of such a little-reported chapter of RN diving history.
21 Oct 08 - TV Programmes involving Clearance Divers
Last night's episode of 'The Unbreakables' on Channel Five TV featured contestants living on board HMS Bristol, completing circuits and a mud run at Horsea Island under the supervision of CPO(D) John Ravenhall, undertaking the DRIU (Damage Repair Instructional Unit) at HMS Excellent, experiencing the Dunker underwater helicopter escape trainer at RNAS Yeovilton, performing the 'Cliff & Chasm' field gun challenge and competing on the obstacle course at the RN Leadership Academy at HMS Collingwood. The programme can be watched again online for free via the Five TV website here but requires registration and downloading of the special player.
On 28 October, ABC1 TV in Australia will start broadcasting a four-part documentary series called 'Navy Divers' about the progress of an RAN Clearance Diver course. The first episode will show candidates being put through the the week-long clearance diver assessment test (CDAT) and it will be possible to watch the series online via the ABC website here. Producer Ed Punchard from Prospero Productions has first-hand experience of diving in dangerous environments. He was on board the North Sea oil rig Piper Alpha in 1988 and was one of only 62 survivors when it exploded killing 167 men.
20 Oct 08 - RN EOD Heritage and HMS Vernon photos
No prizes but who can spot the obvious safety hazard in these two photos taken during wartime RN Bomb & Mine Disposal days at Chatham Dockyard?
RN Bomb & Mine Disposal at Chatham Dockyard during WWII
That's right. It's the yard brush carelessly left lying on the ground by the workmen, ready to clout any unsuspecting sailor. But why isn't that man wearing a hat? I am grateful to Mike Friend for these photos from the collection of his father, Lt Peter Friend GM RNVR, a naval Bomb Safety Officer based at Chatham during the Second World War.
My thanks also to Peter Dick, editor of the Historical Diving Society's journal, the Historical Diving Times for the following photos taken at HMS Vernon in February 1957.
Left: HMS Vernon main gate
Right: HMS Vernon figurehead
Left: Diver in standard dress
Right: Diver in old style SABA (Swimmer's Air Breathing Apparatus)
Left: Ton Class minesweepers of the Vernon Squadron
Right: Vernon Squadron ship's screw change
18 Oct 80 - Minesweeper Books and Paintings
Author Cdr David Bruhn USN (Rtd) has sent me images of three paintings by Richard DeRosset for wider dissemination. Hidden Death at Wonsan depicts the mining of USS Pirate (AM 275) while sweeping Wonsan harbour on the east coast of Korea on 12 October 1950. USS Pledge (AM 277), the Japanese Minesweeper No.14 and the Republic of Korea Navy minesweeper YMS 516 (ex-RN BYMS 2148) were also lost in the same operation. This picture is used for the dust jacket of David's forthcoming book Wooden Ships and Iron Men: The U.S. Navy's Coastal & Motor Minesweepers, 1941-1953.
Hidden Death at Wonsan
by Richard DeRosset
Sea Battle off the Cua Co Chien River Mouth depicts a night encounter between the Ocean Minesweeper USS Endurance (MSO 435) and an armed trawler attempting to bring supplies into beleaguered Viet Cong forces on the Ca Mau Peninsula at the sourthern end of Vietnam in November 1970. The picture is used for the dust jacket of David's previous book Wooden Ships and Iron Men: The U.S. Navy's Ocean Minesweepers, 1953-1994.
Sea Battle off the Cua Co Chien River Mouth
Richard DeRosset's latest painting, Moonlit Assault in the Aegean, depicts an attack on the British Yard Minesweeper BYMS 72 (also known as BYMS 2072) off Alinda Bay on the east side of Leros, one of the Greek islands comprising the Dodecanese archipelago, on 11 November 1943. After surviving three or four near misses, she was struck on her port side by a German aircraft-launched Henschel HS293 glider bomb. Badly damaged and with many of her crew dead and wounded, she tried to enter harbour at Portalago early the following morning for temporary repairs. However, while attempting to locate the narrow entrance, she was captured by units of a German invasion force on the eve of the battle for Leros. The graphic story of her loss can be read in this extract from David's forthcoming book, Wooden Ships and Iron Men: The U.S. Navy's Coastal & Motor Minesweepers, 1941-1953, published on the Naval History website.
Moonlit Assault in the Aegean
David Bruhn would welcome any comments on this painting via his e-mail address here. His books may be ordered via his website here.
17 Oct 08 - Paddy McAlpine in The News
Today's Portsmouth News contains the following article describing MCDOA member Paddy McAlpine's role as Director of the Joint Tactical Exercise Planning Staff (JTEPS - formerly JMOTS) in overseeing the conduct of Exercise JOINT WARRIOR (previously NEPTUNE WARRIOR and JMC):
16 Oct 08 - HMS Ledbury Westward Bound
The RN website contains this article describing the recent activities of HMS Ledbury as she heads west through the Mediterranean. She has just completed Exercise NOBLE MIDAS in Greek waters with fellow members of Standing NATO MCM Group 1 (SNMCMG1), under the Command of MCDOA member Chris Davies embarked in HMS Roebuck, and is now heading for Spain.
Ledbury's Clearance Diving Team - Lt Doc Morris, Lt Dave Louis,
PO Eddy Edmundson, LD Si Kimberley, AB Si Smyth,
AB Toby Jones and AB James Shell
New Personal Update
The Members Only area contains an update with photos from MCDOA past-Secretary David 'Topsy' Turner who transferred to the Royal New Zealand Navy in early 2004.
CTF 152 (Cdre Peter Hudson CBE ADC RN)
with Topsy Turner in Bahrain earlier this year
HMS Ramsey in the Northern Gulf
The RN website contains this article describing the latest activities of HMS Ramsey.
HMS Ramsey and HMS Blyth alongside in Bahrain
14 Oct 08 - Bill Chambers 'snapped up' by NATO
I have only just had my attention drawn to this article on the BBC News website describing how MCDOA member Bill Chambers is leaving after only nine months as Weymouth's harbour master to fill a billet at the NATO Joint Warfare Centre in Stavanger, Norway. See also this article from last July.
Outgoing Weymouth harbour master
Bill Chambers
SDU2 deals with hand grenade
The Portsmouth News website contains this article describing the disposal by SDU2 of a hand grenade found in a box of car boot sale curios on Saturday. The article features PO(D) Paul Bhathena.
Ton Class Association Reunion
Fellow MCDOA member Doug Barlow and I have just returned from the Ton Class Association's 21st Annual Reunion at Babbacombe in Devon. During a weekend blessed with fine weather, we renewed acquaintance with many members of the minewarfare and diving community, including MCDOA member Colin Churcher and his wife Hilda among the other 230 attendees, and had a thoroughly enjoyable time. Friday night was a warm-up for the main dinner on Saturday for which the guest of honour was Rear Admiral Mark Kerr CB CVO, now Chief Executive of Powys County Council, who reminded me that I had been his MCMG course officer in HMS Vernon. Also present was the TCA's President, Rear Admiral John Lippiett CBE MBE, now Chief Executive of the Mary Rose Trust.
Left: Admiral Lippiett and his wife Jenny draw their tot before dinner
Right: Other diners join the queue for their tot
Rob Hoole & Doug Barlow flanking Doug's partner Jill
On Sunday, about a hundred of us attended a traditional naval church service before boarding the Dart Valley Railway steam train from Paignton to Kingswear where we took the ferry across to Dartmouth for lunch and a stroll around the town. We then cruised up the river on a pleasure boat, complete with bar and restaurant. The scenery along the sunlit river bank was glorious, particularly with the Cecile Oaks in their autumnal foliage, and I had much more time to enjoy it than as a naval cadet engrossed in 'boatwork' all those years ago. Incidentally, did you know that the name Dart is derived from a Celtic word meaning 'many oaks'? (Wiki link)
Left: Dart Valley Railway locomotive Hercules
Right: Dart Valley steam train passes Floating Bridge
Britannia Royal Naval College looked as impressive as ever and I spotted the former Sandown Class minehunter HMS Cromer, now resurrected as the College's harbour training ship Hindostan, alongside Sand Quay with an unsightly classroom erected on her superstructure.
Left: BRNC Dartmouth in all its glory
Right: Former HMS Cromer at Sand Quay
In the entry for 4 Oct 08, I mentioned that Philip & Son of Dartmouth had built all eight ships of the Miner class of controlled minelayers. Philips also built the WWII Bangor Class minesweepers HMS Whitehaven and HMS Worthing, the 105 ft motor minesweepers MMS 88 and MMS 300 and the 126 ft motor minesweepers MMS 1030 and MMS 1090 as well as the post-war Ton class minesweepers HMS Dartington, HMS Iveston, HMS Jackton and HMS Wotton. Sadly, the yard closed in 1999 and is due to be redeveloped as apartments with a hotel, spa, conference centre, expanded marina and sea training college (see here).
Left: Philip & Son Ltd shipyard at Noss, Dartmouth
Right: Stoke Gabriel up a quiet creek
After an hour and a quarter, we arrived at Totnes where we disembarked and returned to our hotel before dispersing for another year or two.
Totnes - End of the line
The Members Only area contains an update from Nigel 'Pusser' Hill in Florida.
The Members Only area contains an update with photos from MCDOA member John Beavis on exchange with the Canadian Navy in the Experimental Diving and Undersea Group (EDUG) at the Defence Research and Development Centre (DRDC - formerly DCIEM) in Toronto. He is due to be relieved at the end of the year by fellow MCDOA member Neil Holden.
John Beavis conducting equipment trials
in Victoria, BC
Dan Nicholson afloat
Messing about in boats seems to be a particularly popular pastime with MCDOA members. Dan Nicholson has sent this photo of himself with his wife Christine on board their recently acquired narrow boat Waymark in Derbyshire earlier this year.
Dan & Chris Nicholson on board Waymark
8 Oct 08 - 2008 MCDOA AGM, Operational Updates and Annual Dinner
The calling notices and application forms for this year's MCDOA AGM and Operational Updates at Horsea Island and the Annual Dinner in HMS Excellent on 28 Nov 2008 are now available for download via the 'Upcoming Events' page in the Members Only area. The date has been specially chosen to provide the best possible window for seagoing members to attend but we will also be thinking of all those other members serving or living in far-off places and unable to join us this time round.
The day will start at Fleet Diving HQ on Horsea Island at 1000 with updates on RN minewarfare and diving activity over the past year. Following a free lunch, the AGM will start at 1330 and feature a presentation on the good progress achieved with Project VERNON, the erection of a statue at Gunwharf Quays in Portsmouth to commemorate the minewarfare and diving heritage of HMS Vernon, the site's former occupant.
The Annual MCDOA Dinner in the Wardroom Mess, HMS Excellent will start at 1930 for 2000. Thanks to the kind support of the Mess, the cost remains at a very reasonable £35 per head (£40 for guests). N.B. This function is subsidised by the MCDOA so entitled non-members must join the Association to attend; no masquerading as 'guests'. The time-honoured format will commence with pre-dinner drinks followed by an excellent meal, refreshments and service with a hearty sing-song to the fine musical accompaniment of the HMS Nelson Volunteer Band culminating in a nightcap or two. It is also hoped to display details of the Vernon Monument Project and the Clearance Diver's Life Support Equipment which is scheduled to replace CDBA next year.
Rear Admiral Bob Cooling, ACNS
This year we are very fortunate to have Rear Admiral Bob Cooling, Assistant Chief of the Naval Staff, as our Guest of Honour. We also expect to dine at least some of the following MCDOA members out of the Royal Navy: MCDOA Honorary President Colin Welborn, Mike Loane, Charlie Wilson and Darroch Woodward. These and any other leavers are requested to confirm their attendance with Tony Griffiths and tell him their choice of glass mine/diver 'gizzit'. Much as we would wish it otherwise, only our Guest of Honour and service leavers will dine for free. However, please note that service leavers must be of at least two years' standing as an MCDOA member to qualify for free dinner and a 'gizzit'. As membership only costs a tenner per year, payable by standing order, this is hardly unreasonable.
As customary, we will toast the 25th anniversary of LMCDO '83A (Course Officer: Rob Hoole, Course Instructor: Ray Ramsay, Second Dickies: the late MCDOA member Ned Kelly and the late Charlie Smithard plus Students: Roger Baileff (MW only), Nigel Butterworth, John Giddens, Dave Hosking, Chris Sherman and Charlie Wilson) as well as LMCDO '83B (Same instructional staff plus Students: Dave Carey, Mike Croome-Carroll, Andy Davies, Peter Harrison, Simon Ridout and Topsy Turner). Several members of the 1968 Long Course (Course Officer: Peter Waddington, Course Instructor: Dutchy Holland plus Students: Chris Beresford-Green, Jim Cook, Mike Emary, Dave Forsey, Tim Hildesley, Gerry 'Pincher' Martin, John Rayner and Bob White) are also expected to put in an appearance to celebrate their 40th anniversary. There will also be the usual international theme with members and guests expected from various parts of the globe.
Unfortunately, no accommodation will be available in the Mess but we have again secured the use of a mess-deck in HMS Bristol through the good offices of her Commanding Officer. It should be noted however that this is a very busy time for Bristol so priority will be given to our long-distance travellers. To ensure that you don't miss out on this great evening (and remembering that convention dictates that we only discuss those not present) please complete and return applications to Tony Grifiiths, our Hon Sec, by 21 November 2008.
HMS Brocklesby awarded James Acton Trophy
The Navy News website contains this article describing the award of two mine warfare trophies to the ship's company of HMS Brocklesby for their achievements while manning HMS Chiddingfold in UK waters, the Mediterranean and the Gulf. One of the awards is the James Acton Mine Warfare Efficiency Trophy, instituted to perpetuate the memory of the late MCDOA member Jim Acton who was killed in an earthquake while on duty as MCM2's SOO in Turkey in 1999. The article also features PO(MW) Antony 'Pinta' Beer.
HMS Brocklesby with the James Acton
Mine Warfare Efficiency Trophy
(Navy News photo by LA(Phot) Pete Smith)
RN Diving Heritage - George 'Sarge' Sarginson
A couple of months ago, I received this e-mail:
I have been looking at your website with interest, and this is the only contact address I can find, as I am not eligible to become a member. My late father was Sarge Sarginson and he is featured in two of the news archives. A John Grattan has included a photo of him and some anecdotal stories as has a George Wookey. I'd really love to contact anyone who knew my dad as I was only 12 when he died. If you could pass my email address to these people I would be really grateful. I also have lots of photos of diving and mine clearance stuff. I located this site after seeing an article in the paper about the Vernon monument.
Thank you for taking the time to read my message.
Katherine Lewry (nee Sarginson)"
1959 RN Divers' Dinner
Left to right: John Grattan, George Wookey,
'Sarge' Sarginson and Stuart 'Jazz' Honour
Fellow MCDOA members will be aware of my admiration for many of the larger than life characters among our forebears in the RN minewarfare and diving community. I was already aware that Sarge Sarginson had been a clearance diver who had lost an arm while dealing with a moored mine on a beach but I knew little more about him. I have since discovered that he was born on 15 April 1931 and joined the RN in 1949 at HMS Royal Arthur when it was the new entry training establishment. His son Pete believes he qualified as a CD at HMS Lochinvar before joining HMS Vernon where he was in the Bomb & Mine Disposal Team led by Lt Cdr W Y McLanachan (or 'Mr Mac' as he was affectionately known). After leaving the RN c.1960, he worked on the civilian staff at the Royal Naval Physiological Laboratory (RNPL) at Alverstoke until 1966 when he worked for various commercial diving contractors until suffering a fatal heart attack in 1980.
As the result of Katherine's e-mail, I contacted several people of the same vintage as Sarge. Sadly, MCDOA member George Wookey had passed on but former FCPO(D) Dave (Mona) Lott, now living in Australia, sent Katherine this e-mail:
"Being also a vintage CD (age wise) I also knew your father and remember him with considerable affection. We shared the same large A1 divers mess in HMS Vernon during the early 1950's, long since converted to smaller more comfortable accommodation and now demolished. We had a couple of runs ashore in Portsmouth, he riding in the sidecar of my motorbike at considerable risk.
Sarge was quite an extrovert and extremely popular. We were all devastated when he got invalided out after losing an arm hit by shrapnel during a mine disposal job with Mr McLanahan, the Portsmouth Bomb & Mine Disposal Officer at the time. Very few details were released regarding the cause of this.
I don't think that I came across Sarge again till much later (1965) when I was in the Admiralty Experimental Diving Unit during the 600 foot dving trials from HMS Reclaim. Sarge was in charge of a very long and unwieldy (about 4 feet long) underwater camera. This camera didn't like being underwater and tried desperately to escape the clutches of any user. It was far too buoyant. I think that was the last time that I saw Sarge mainly due to my movements by naval drafting. I was pretty devastated to subsequently hear of his death. Sarge was one of those that I remember from days long gone with much regret at his loss, although there are now many in this same category and unfortunately not too many left of that same vintage. As his daughter you can certainly be proud of having been able to call him your Dad."
MCDOA member Bob Lusty then provided this snippet:
"Hi Katherine,
Your dad and I and ten others qualified CD3 in the early 1950s. Your dad was a Chatham rating. I was from Plymouth and we all met up at Portsmouth to complete the course. It was very demanding as reflected in the pass rate: 100 started from the three Naval Divisions and only ten qualified. We had joined an élite band of brothers and were chuffed. I was then posted to the Bomb & Mine Dispoal Team at HMS Lochinvar where the boss at that time was P J Messervy, a tough cooky but we had some realy good jobs. Your dad joined us later and I was pleased to have a classmate and friend in the team. They were exciting times.
I think I have a photo of us all on course at Broad Bridge Heath with the army learning about bombs. The last time I had contact with your dad was in industry circumstances. He was demonstrating a bell with an articulated arm which we took on contract and did the job somewhere in the North Sea."
Then MCDOA member John Grattan added his own contribution:
"Dear Katherine,
You probably know the full details of how your father lost his arm so I will not repeat the 'dit' unless you wish me to.
I sent Rob the photograph taken at the 1959 Diver's Dinner because Stuart Honour and I picked up your father and Joe Brooks that evening - we all had a giggle about our passengers having only two legs and three arms between them. That dinner was only three weeks after the accident, if I remember correctly. Isn't that a measure of Sarge's courage and spirit? I do know what happened because I was also on a B & MD job that day as there were just too many calls for Mac to deal with alone and I had to de-brief him later for the overall record. It was not unusual for the duty diving officer to take off another part of the unit to deal with something reported by the police as we felt it unfair on everyone if they had to wait for attention.
Lovely to be in touch - good luck - you deserve it with such a wonderful father.
John"
Pete has sent me these photos which belonged to his father:
HMS Reclaim divers
Sarge Sarginson tending diver in CDBA
Sarge Sarginson standing on mine
Ginger Bitchard and Sarge Sarginson
Sarge Sarginson in work boat
If anyone can put names to any other individuals in the photos, please contact me via my webmaster e-mail address.
"G'day Rob,
I have just finished perusing your website that is, as always, full of interest. Perhaps just a small piece of help with one of the photos of Sarge and Ginger? This Ginge is Ginger Bitchard who qualified on the same 3's course as myself under the guidance of Hugh (Taff) Roberts. Ginge was resident at the King's Head pub in Weymouth, run by Mabel and her husband. I had a report from Gabby Haines about two years ago that he had been revisiting Weymouth and district and had bumped into Ginger during a visit to Shorty Barrett's (another character from the branch's old days) antique shop. Viewing the photo took my mind back many years....what a pity it can't do the same for the body.
My regards,
6 Oct 08 - HMS Ledbury finds wreck of WWII aircraft
The RN website contains this article describing the discovery of the wreck of a Second World War German bomber on the seabed off Southern Italy by HMS Ledbury. It features AB(MW) Gavin Twigden and LS(D) Simon Kimberley.
AB(D) Simon Smyth of HMS Ledbury
5 Oct 08 - New book relating to Wartime Bomb Disposal
Front cover of 'Come if ye Dare'
When I was a young lad during the 1950s, men and women of all ages wearing black battledress and berets occasionally descended on the local common at weekends. They erected shelters from bits of timber and corrugated iron and were adept at assembling makeshift ovens and grills from odd bricks, gratings and pieces of sheet metal. My friends and I were fascinated by the whole experience and enjoyed sampling the results of cooking on these pioneering barbecues. These uniformed people of all ages were not members of some paramilitary organisation but belonged to the local Civil Defence (CD) Corps unit. They were rehearsing action to be taken in the aftermath of nuclear conflict but were also trained to deal with any other civil emergencies such as natural disasters.
The original Civil Defence Services were formed by the Home Office at the time of the Munich Crisis in 1938, a year before the start of the Second World War. They comprised members of the Air Raid Precautions (ARP) service, the Fire Prevention Service and the Auxiliary Fire Service. At their height during the Blitz, these services had 1,900,000 volunteers working as air raid wardens, fire-fighters, members of search & rescue teams, members of heavy and light rescue teams, first-aiders, stretcher bearers, auxiliary ambulance drivers, gas decontamination team members and messengers, etc. 7,000 of them were killed as the result of enemy action. The Civil Defence Services were disbanded in 1945 but the Civil Defence Corps, formed in 1948 largely due to the threat posed by atomic weapons, soldiered on until 1968.
Terry Hissey has kindly sent me a review copy of his first book, 'Come if ye Dare - The Civil Defence George Crosses'. It contains the fascinating stories of 11 wartime civilian recipients of the George Cross, instituted by King George VI in 1940 "...for acts of the greatest heroism or of the most conspicuous courage in circumstances of extreme danger". Although the GC is awarded to service personnel, it remains the highest decoration available to civilians and several awards were made for fire-fighting and the rescue of survivors from bombed buildings. However, MCDOA members should find the stories of civilians connected with bomb disposal of particular interest.
Take for example Dr Arthur Merriman OBE, GC, MA (Cantab), MEd (Dunelm), DSc, CEng, FIMechE, FRSE, DL. As a Senior Experimental Officer in 1939, he joined an organisation called the Directorate of Scientific Research in the Ministry of Supply. This was made responsible for the research, development and dissemination of bomb disposal methods and specialised equipment for all three services. Dr Merriman not only served as the Joint-Secretary of the Unexploded Bomb Committee but, in November 1939, he recovered the first German electric fuzes from bombs at Sullom Voe in the Shetland Isles. On 28 July 1940 he removed three fuzes from 50 kg bombs on the Isle of Wight and in August he defuzed 17 bombs over a period of ten days from as far afield as King's Lynn and Bristol. He defuzed many other bombs but, perhaps more importantly, he also designed the 'Steam Steriliser' for melting the explosive content of a bomb and allowing it to run out. This was first used on 11 Sep 1940 on a German 250 kg bomb containing two No.17 clockwork delay fuzes. Dr Merriman was gazetted for the award of the George Cross on 3 December 1940. He was also appointed an OBE and continued to work until long after the war as a Principal Scientific Officer (Technical Intelligence) at what is now DSTL Fort Halstead in Kent. The entry for him in Terry Hissey's book also describes his many other personal and professional interests, activities and achievements and makes for rapt reading.
Then there was Staff Officer Roy Harris GC. In 1938 he became the Chief Combustion Officer for Croydon Council but volunteered for the ARP Engineers Service at the outbreak of war. He was subsequently appointed to liaise between the ARP and the nearest Royal Engineers bomb disposal unit which was at Kingston although his Army record states he was attached to No.2 BD Section at Wallington. Initially he was responsible for pin-pointing unexploded bombs for the Sappers to deal with but, as they became over-stretched, he often became OIC at incidents and eventually undertook bomb disposal himself, sometimes disarming sensitive bombs using little more than the light of a dimmed torch. He was involved in 88 incidents altogether and on 18 September 1940, he removed the fuze of a 50 kg bomb that had fallen through a house because it had been impossible to obtain the services of an RE party. It was for this incident, plus another in which he dealt with a 6 ft long UXB in a garden, that Roy Harris was gazetted for the award of the George Cross on 17 December 1940.
My favourite account in the book describes the intriguing Charles 'Jack' Henry George Howard, the 20th Earl of Suffolk and Berkshire GC, BSc Hons (Edin), FRSE, and not simply because I have been assisting another author in New Zealand who is writing his biography. In his youth, the Earl of Suffolk sailed around the world as a deckhand on the clipper Mount Stewart. In 1925 he joined the Army but had to leave after six months owing to chronic rheumatism. He then bought and worked on a sheep farm in Australia before returning to the UK in 1934 to study at Edinburgh University. In 1938 he became the first person to graduate from Edinburgh with a First Class Honours Bachelor of Science degree in Pharmacology.
At the outbreak of the Second World War, the Earl had his application to join the Scots Guards refused owing to his age and the effects of the rheumatic fever. He subsequently joined the Directorate of Scientific Research at the Ministry of Supply and was sent to represent his Director General, Dr Herbert Gough, in Paris as liaison officer with the French Ministry of Armaments. In the face of the German invasion, he returned to the UK in the company of his long-time secretary, Miss Beryl 'Eileen' Morden, and Major Ardale Golding of the Royal Tank Regiment. The Earl personally obtained an armed escort from the French Navy to commandeer a ship, the SS Broompark, in which they arrived at Falmouth on 21 June 1940 together with a large and 'unusual' cargo comprising machine tools, £3,000,000 worth of industrial diamonds, scientific apparatus, the only supply of 'Heavy Water' then in existence and over 20 Professors and Chief Engineers with their families.
This part of the Earl's life would have been interesting enough if he had not formed the 'Holy Trinity' comprising himself, his secretary, Beryl Morden, and his chauffeur, Frederick Hards who drove their lorry emblazoned with a 'Bomb Disposal' sign. On behalf of the Ministry of Supply's newly formed Scientific Research Experimental Unit, the eccentrically-dressed Earl defuzed unexploded bombs in and around London with his secretary taking notes before taking the carcasses in the lorry to a corner of Richmond Park for steaming out. The Earl developed the idea of destroying bombs by burning rather than exploding them, or sawing the case in half to remove the charge. He also designed several bomb disposal devices and techniques for their use which were issued to the service bomb and mine disposal teams. These included thermite charges (courtesy of Brock's fireworks) that penetrated the cases and burned the explosive charges to destruction as well as trepanners and steam generators. The Earl's solution to the ZUS 40, a fuze that lay underneath the main fuze and set off the bomb or mine if disturbed, was to cut a hole through the bomb casing enabling him to remove a core containing the ZUS 40 as a complete unit. A further development was to ignore the ZUS 40 altogether and remove the main charge with a high-pressure steam jet.
Sadly, on 12 May 1941, the Earl was beaten by a particular bomb he had transported to Erith Marshes in North Kent. It exploded and killed the Holy Trinity as well as four members of 25 BD Company, Royal Engineers. He was gazetted for the posthumous award of the George Cross on 18 July 1941. Beryl Morden and Fred Hards, the Earl's partners in the 'Holy Trinity', were gazetted for the posthumous award of the King's Commendation "for Brave Conduct in Civil Defence" at the same time.
I thoroughly recommend this book to anyone with an interest in the history of explosive ordnance disposal. Written in an easy style, it is full of useful black and white illustrations and is well-researched and referenced. Above all, it brings to life some colourful and extremely brave individuals whose astonishing deeds should be recognised more generally. This 104-page paperback is published by the Civil Defence Association and is available direct from the author, Terry Hissey, or via Amazon Books. It is priced £12.50.
4 Oct 08 - Who remembers Miner III?
I have received the following e-mail:
"Good afternoon,
My late uncle was Lt Cdr A (Sandy) Sandison RN and he was the CO of HMS Miner III, certainly in 1964. I have had a look at your most interesting web site for information regarding the above and I am hopeful that this enquiry could be passed on to your membership.
I appreciate that technically neither my uncle nor the majority of the ship's company at that time would be members of the Association but hopefully some of the ratings and officers that were trained on board the ship would be.
Chris Harris"
HMS Miner III in October 1964
HMS Miner III was one of eight 'M' Class controlled minelayers built during the Second World War. With a complement of 32, they had a length of 110 ft, displaced 300 tons and possessed two shafts powered by Ruston & Hornby diesels of 720 bhp total providing a maximum speed of 10 kts. They could each carry ten mines and, during the war, they were armed with a 20mm Oerlikon and two .303 machine guns on single mountings.
HMS Miner I - Launched 6 July 1939 at Philip & Son, Dartmouth. Renamed HMS Minstrel 7 Sep 1962. Sold 1967.
HMS Miner II - Launched 18 Aug 1939 at Philip & Son, Dartmouth. Renamed HMS Gossamer 1949. Sunk 18 Mar 1970 as a target off Portland.
HMS Miner II
HMS Miner III - Launched 16 Nov 1939 at Philip & Son, Dartmouth. Commissioned as one of 12 minelaying lighters in February 1940. Capable of laying 26 mines (13 each side through the stern) and supplying and laying harbour defence cables. In reserve 1949-50 then became mining tender to HMS Vernon in 1951. Some mining rails removed during conversion to a diving tender in 1952 but remained able to lay six mines each side. Fitted with light alloy compression chamber aft and facilities for diving forward. Compression chamber re-sited closer to diving position in 1954 to facilitate surface decompression. Used mainly for 180 ft diving training from Falmouth in the summer and Tarbert, Loch Fyne in the winter. Also participated in several NATO minelaying and minesweeping exercises around the coast and assisted in sea training of SD officer candidates and juniors in her spare time. Replaced by HMS Laleston in 1967. Sold Feb 1977. Broken up at Sittingbourne.
HMS Miner III circa 1957
HMS Miner IV - Launched 6 Aug 1940 at Philip & Son, Dartmouth. Broken up May 1964.
HMS Miner IV when attached to
HMS Vernon in June 1958
HMS Miner V - Launched 2 Nov 1940 at Philip & Son, Dartmouth. Converted to cable layer HMS Britannic 1960. Sunk as RAF target 6 Jun 1979.
HMS Miner VI - Launched 7 Feb 1942 at Philip & Son, Dartmouth and used as minelayer and minelaying training ship then for seaward defence training and possibly as a diving tender. Employed as torpedo recovery vessel by 1st Submarine Squadron in Malta during 1950s. Sold mercantile 16 Aug 1968 Malta. Converted into ferry and successively renamed Minor Eagle, Jylland II and Cominoland based in Malta. Sunk in 2006 as an artificial diving reef off Gozo.
HMS Miner VI in April 1949
HMS Miner VII (i) - Ordered 3 Oct 1940 in Singapore. Destroyed on stocks Feb 1942 on fall of Singapore.
HMS Miner VII (ii) - Launched 29 Jan 1944 at Philip & Son, Dartmouth. Converted to stabilisation trials vessel and renamed HMS Steady in 1960. Sold Pounds Mar 1980 for breaking up.
HMS Miner VIII - Launched 24 Mar 1943 at Philip & Son, Dartmouth. Renamed HMS Mindful 7 Sep 1962. Sold 22 Feb 1965 to D. Arnold and renamed Rawdhan.
The Miners were based at HMS Vernon for the purposes of 'general administration and organisation' from 1950 as a result of the Korean War and the build-up of the seaward defence organisation at Portsmouth but they were also used for seaward defence training. At the time, Vernon was still using the pre-war mining tenders HMS Plover, HMS Nightingale and HMS Vesuvius for mining trials and clearance diving training. In 1955 it was finally decided to replace Nightingale and Vesuvius with Miner III and Miner IV. Nightingale and Vesuvius were sold for disposal in 1957 but Plover was refitted for further service under C-in-C Portsmouth's command until sold in 1969. Miner IV was used by Vernon for clearance diving training until 1961 when she was replaced by Miner III. In turn, Miner III was replaced by HMS Laleston, one of my old ships, in 1967. She was handed over to the Director of Marine Services at Pembroke Dock for buoywork until sold in 1977.
I have ascertained that Chris's uncle, Lt Cdr Archibald (Sandy) Sandison RN, was an SD TAS officer when in command of HMS Miner III in 1964 and 1965. His First Lieutenant was another SD TAS officer, Sub Lt T J Heppell RN, whom I believe I knew at Vernon as Tom before his retirement in 1977 as a Lt Cdr. Sandy Sandison was relieved as CO of Miner III by MCDOA member Jack Smith, a Qualified Deep Diver (QDD). Jack handed Miner III over to the Director of Marine Services at Pembroke Dock in Wales in 1967 before assuming Command of HMS Laleston, her replacement as HMS Vernon's deep diving tender.
If anyone has any memories of Miner III during the mid-1960s, please let me know via my webmaster address and I will put you in touch with Chris.
Since I published the article above, Chris has sent the following addendum:
Thank you for your response and placing my enquiry on the MCDOA website. I recognised the name of my Uncle's 1st Lt as soon as I saw it. It was indeed Tom Heppel. I spent the best part of a week on board HMS Miner III in the early summer of 1964 at Falmouth. The ship was tasked with training divers at that time. I'm not sure if these were ship's divers or specialist divers and have fond memories of the experience to this day. The ship would make the daily transit from Falmouth harbour to a location in the adjacent bay and anchor whilst the diving training was carried out and return each afternoon to tie up along side an old floating dock that was at Falmouth Docks. As for me, I was a 3rd year Shipwright Apprentice at the time at HM Dockyard, Devonport and I can still feel the cold salt water on my bare feet when, armed only with a broom and a fire hose, I was introduced to the art of scrubbing decks by the Buffer.
I attach some photographs of Sandy. One of these concerns post-war mine disposal and at that time he held a Commisioned rank. I'm not sure where this was taken - somewhere on the south or west coast of the UK? The other photo I think was taken at the time of his involvement with Miner III and is probably at Vernon. This shows Miner III inboard of three Ton class minesweepers.
When I saw the details of the Miner class that you posted on the website, I was reminded about Miner VI. You'll probably be aware that she spent most if not all of her service life in the Med and, as you've recorded, she was sold to mercantile interests after the war. I've made several visits to Malta over the past six or so years and spotted the unmistakeable shape of a Miner class hull + funnel at anchor in Sliema Creek, albeit painted orange. Well that was up to a couple of years ago when she was sunk as part of an artificial reef between the main island of Malta and Gozo. I've got some photos of her at Sliema and of her "sinkex" if you would like them.
The picture on the left shows Sandy Sandison as a Sub Lt 'dealing with' a British Mk 17L moored contact mine. The picture on the right shows Sandy in front of Miner III and three Ton Class minesweepers of the 3rd MCM Squadron, probably alongside their base at Portland.
SDU2 detonates artillery shell off Southsea
The Portsmouth News website contains this article describing the disposal of an artillery shell found on Southsea beach today. It was blown by members of SDU2 led by CPO(D) Kevin Amaira.
More publicity for Vernon Statue
The Portmouth News website contains this article about Project VERNON, the campaign to erect a statue in Gunwharf Quays to commemorate the Minewarfare and Diving heritage of HMS Vernon. It features the Project Manager, MCDOA member David Carey.
MCM 1 Crew 8 Returns from Gulf
The RN website contains this article describing the return of members of HMS Walney's latest ship's company from the Gulf where they have been manning HMS Blyth.
2 Oct 08 - HMS Cattistock joins the Tall Ships
The RN website contains this article describing the role of HMS Cattistock as official guardship for the regatta and first leg of the Funchal 500 Tall Ships Race which saw her escort the fleet from Falmouth to Ilhavo in Portugal.
HMS Cattistock facing Alexander von Humboldt
and Cuauhtemoc in Falmouth
1 Oct 08 - Navy News items
Now that Navy News has begun archiving e-editions of the paper on its website here, I will no longer be scanning items and posting them on the MCDOA website. The October issue contains the following MCD-related articles:
Going for (Pem)broke: The latest activities of HMS Pembroke including preparations for her and HMS Grimsby to relieve HMS Blyth and HMS Ramsey in the Gulf.
Brocklesby Channels her energies: A visit to Alderney by HMS Brocklesby.
Back to Iraq: The activities of HMS Blyth and HMS Atherstone in the Gulf including their visit to Umm Qasr, the first visit by RN warships to an Iraqi port since 2003.
A testing time with NATO: The continuing deployment of HMS Ledbury in the Mediterranean with Standing NATO MCM Group 1 (SNMCMG1) under the Command of MCDOA member Chris Davies embarked in HMS Roebuck. The well-illustrated article contains a photo of AB(D) Si Smith returning to the Gemini from a minehunting dive.
Captain tours minesweeper: A visit by Captain Jonathan Fry RN (Captain Sea Cadets) to the former Ton Class minehunter HMS Iveston at Thurrock Sea Cadet Unit.
Back to News Archives
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 576
|
'Are You a Citizen?': The Dangerous Question Coming to the Next Census
Undocumented immigration
The decision to add a citizenship question will have consequences long after Trump leaves office.
By Julianne HingTwitter
US Postal Service mail carrier Thomas Russell holds a Census form while working his route on April 10, 2010. (AP Photo / Jason E. Miczek)
After months of preparation—and despite plenty of pushback—Department of Commerce Secretary Wilbur Ross announced Monday night that the 2020 Census will include a question about respondents' immigration status. State attorneys general and immigration and civil-rights groups were quick to slam the move and, within hours of the announcement, California Attorney General Xavier Becerra filed a lawsuit challenging the decision.
The move will have profound consequences for US democracy. The Census, which happens only once every 10 years, is used to determine the allocation of $700 billion in federal grant money, apportion representatives in Congress, and determine how electoral boundaries are drawn and how many votes each state is given in the Electoral College. Critics have long warned that a question about people's immigration status will depress participation and lead to inaccurate responses, both of which could warp the administration of these immensely consequential programs and institutions.
Still, Ross determined, the question is necessary for the enforcement of the Voting Rights Act. "The reinstatement of a citizenship question will not decrease the response rate of residents who already declined not to respond," Ross wrote in a memo released Monday, brushing off concerns about lower participation. "And no one provided evidence that there are residents who would respond accurately to a decennial census that did not contain a citizenship question but would not respond if it did."
Becerra and California Secretary of State Alex Padilla wrote in an op-ed Monday that Ross is not just wrong but that the query is unconstitutional: "Including a citizenship question on the 2020 census is not just a bad idea—it is illegal. The Constitution requires the government to conduct an 'actual enumeration' of the total population, regardless of citizenship status." This question, Becerra and Padilla warned, will do the opposite.
The 7,383-Seat Strategy
Joan Walsh
It's not just crusading Democrats who are concerned. Multiple previous directors of the Census Bureau have warned against adding a question about immigration status back to the Census. "It will drive the response rate down enormously," Kenneth Prewitt, a former director of the Census Bureau and now a professor at Columbia, told The Washington Post. "If you drive those people out of the Census, the consequence is that they're not in it. It's a step toward not counting the people you don't want to count. And that goes very far in redrawing legislative boundaries."
As early as September of last year, months before the announcement that the question was a possibility, Census researchers spoke up about exactly these concerns. "[Center for Survey Measurement] researchers have noticed a recent increase in respondents spontaneously expressing concerns about confidentiality in some of our pretesting studies conducted in 2017." Researchers said respondents had specific fears about sharing confidential information with researchers, and attributed it to moves from the Trump administration to target immigrants and people of color, such as the Muslim travel ban, the dismantling of DACA, and the empowerment of ICE agents.
Respondents, researchers found, were uncomfortable "registering" and possibly endangering other household members by answering questions, and sometimes even made up inaccurate responses.
And as it is, the Census Bureau itself estimated that its 2010 count undercounted the Latino population in the United States by 1.5 percent and the black population by 2.1 percent, numbers that experts say will be much worse with the new question.
The Trump administration is the embodiment of reactionary white anxiety about the country's changing demographics, and this one simple question, "Are you a citizen?" is another swipe at the power and presence of people of color. But this decision, unlike bad or illegal policy, can't be repealed or dismantled. The Census is a one-time event, and the consequences of it will be felt long after Trump leaves office.
Julianne HingTwitterJulianne Hing is a contributing writer at The Nation, where she covers immigration and the politics of the changing demography of the United States.
In order to comment, you must be logged in as a paid subscriber. Click here to log in or subscribe.
Logged in as Log out?
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 1,224
|
A Hersir was a local Viking military commander of a hundred (a county subdivision) of about 100 men and owed allegiance to a jarl or king. They were also aspiring landowners, and, like the middle class in many feudal societies, supported the kings in their centralization of power. Originally, the term Hersir referred to a wealthy farmer who owned land and had the status of a leader. Throughout the Viking Age, Hersir was eventually redefined as someone who organized and led raids. In the 10th century, the influence of Hersirs began to decrease due to the development of effective national monarchies in Scandinavia. Hersir was again redefined later on to mean a local leader or representative. The independence of the Hersir as a military leader eventually vanished, to be replaced only by the title of a royal representative. The "Hávamál", which was the mythical advice of the supreme creator Odin to humankind, contains a number of verses emphasizing the virtue of cautious consideration and strategical attack. This theme, in its oral form, was one of the major influences on the mind of the Viking Hersir.
Equipment
The main weapon of the Hersirs was the Viking sword. This sword is clearly distinguished by its "Type H" hilt. It was the most prominent type of hilt during the Viking Age. The material of the hilt ranged, depending on the wealth of the owner, from polished steel and with decorative wire inlays of silver, copper, and/or tin. The pommel and upper guard of the sword are formed in two separate parts, then bolted together with a twisted sterling silver wire between the pommel and upper guard. The blade is classified as a Geibig Type 3, which is defined by a moderate taper in width and a fuller taper in width towards the point. The type can be dated to the period between second half of the 8th century to the second half of the 10th century. The sword is designed to symbolize power and authority, as well as cool level-headedness.
For long-distance travel, men would often be on horseback. For overseas journeys, Viking longboats were capable of transporting thirty people to their destination, which would even include the reaches of inner Russia.
Hersirs were always equipped with a shield, which was normally wooden and that accompanied the sword.
Dress
Armour was often used as means of displaying wealth as much as functional battle purposes. The hersir was often equipped with a rounded or conical helmet and a short mail coat. The type of helmet, sword, and ringmail corselet worn by the Viking, demonstrated the wealth of the warrior. Armour finds from this period are rare. Perhaps the most famous example is the mail coat and helmet found at Gjermundbu. Hersirs are typically thought to be very well groomed.
Shoes and boots were typically made from cattle, seals, or reindeer. Hersirs usually wore more elegant boots than that of the ordinary military personnel. There are two main types of Viking shoe. The first and most common is by thonging around the top of the shoe. This can be seen in the Jorvik II ankle boot. The Jorvik I type is closed by a flap crossing over and closing with a button. The Hedeby shoe is an early type of turn shoe. This is the least common type found, but could be less costly, but less protective. Any of these types of shoes may have been worn by the Hersir.
Baggy trousers made out of linen or woven wool that were either mid-calf or just below the knee were the typically worn. Tight fitting trousers became the popular style during the late 10th century. Tunics were usually knee length and gathered at the waist with a belt. The sleeves of the tunic were to the wrist or longer. From the elbow to the shoulder, the sleeve was tight fitting. The overtunic would be constructed along the same pattern as the undertunic and made of wool. A richer Hersir would have had a tunic dyed in a bright color with tablet woven strips around the neck and cuffs. There is some evidence the undertunic would be longer than the overtunic, showing a contrasting color at the sleeves and hem.
Military tactics
Vikings were very skilled sailors. Sailing instructions passed down from generation to generation paired with the advancements in technology allowed for the Vikings to dominate the waters. A common military tactic first used in 866, was the transfer from boat to land by the use of captured horses. Despite the fact that Vikings often used horses, they were not cavalry men primarily due to the low number of horses in Scandinavia. Horses were often used for overland routes but the Vikings always fought on foot. Ordinarily, they would align themselves in a shield wall formation with the Hersir at the front and archers and slingers in the back. In the shield wall, the Vikings would stand close together in order to overlap their shields, thus creating a wall out of shields. Another formation that was also used, called the Svinfylking, was a variation to the shield wall but with several wedge-like formations pointing towards the enemy, creating a zig-zag pattern.
Religious views
Hersirs' religious beliefs are somewhat unclear although they seemed to lie somewhere between Christianity and Paganism. Sometimes, Hersirs would be baptised, although it was most often not done for religious purposes. In many cases, Hersirs would be baptised in order to improve trade with the Christians or in obedience to a new king.
Hersirs in history
Hersir was the name of a man in Rígsþula whose daughter Erna married Jarl, the first earl.
A Swedish hersir, Jarlabanke Ingefastsson, has become notable for the about 20 Jarlabanke Runestones that he raised together with his relatives.
Ketill Flatnose was a Norwegian hersir of the 9th century.
Aud the Deep-minded Ketilsdóttir (Auður Djúpúðga Ketilsdóttir) Aud the Deep-Minded (Ketilsd%C3%B3ttir) was the daughter of Ketill "Flatnose" Bjornsson.
In the Sagas of Icelanders there is mention of several hersirs, such as a powerful hersir in Sognefjord called Bjorn"Buna"Grimsson, who lived at Aurland and the father of Ketill "Flatnose" Bjornsson. As related in Egil's Saga, he was a traveler, adventurer, and Viking raider.
Thorgerdur Eylaugsdottir (Þorgerður Eylaugsdóttir) was a female Hersir of Sogn. In Landnáma Björns lineage is traced to his foremothers rather than his forefathers. Only his father Grímur is mentioned in Bjorns lineage that continues to grandmother Hervör and great-grandmother Thorgerdur Eylaugsdóttir hersir. This is rare in the stories of the Icelanders indicating the importance if Thorgerdur.
References
Characters in Norse mythology
Viking warriors
Noble titles
Medieval occupations
Legendary progenitors
Middle class culture
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 1,090
|
\section{Introduction}
Actuarial and clinical assessments of risk have long been mainstays of decision making in domains such as criminal justice, health care and human services. Within the criminal justice system, for instance, recidivism prediction instruments and judicial discretion commonly enter into decisions concerning bail, parole and sentencing. In these high-stakes settings, decisions made based on erroneous predictions can have a direct adverse impact on individuals' lives. Institutions are therefore continually seeking to improve the accuracy of their risk predictions, and many are turning to proprietary commercial tools and more complex ``black-box'' prediction models in pursuit of accuracy gains.
When determining whether to replace or augment an existing risk assessment method, it is important to compare the proposed model to the existing approach across a range of task-relevant accuracy and fairness metrics. As we will demonstrate, a comparison that looks only at overall performance can present an incomplete and potentially misleading picture.
\vspace{0.5em}
\noindent \textbf{A motivating example.} In May 2016 an investigative journalism team at ProPublica released a report \cite{propublica2016} on a proprietary recidivism prediction instrument called COMPAS\cite{compasfaq}, developed by Northpointe Inc. The data set \cite{propublica2016data} released as part of this report contains COMPAS decile scores, 2-year recidivism outcomes and a number of demographic and crime-related variables for defendants scored as part of pre-trial proceedings in Broward County, Florida. In particular, the data set contains information on the number of prior offenses (hereon denoted \texttt{Priors}) for each defendant. Since criminal history is itself a good predictor of future recidivism, it is reasonable to suppose that before \texttt{COMPAS} was introduced, judges could have based their risk assessments on \texttt{Priors} instead. Our question is thus: \emph{Does} \texttt{COMPAS} \emph{produce more accurate (and/or equitable) predictions of recidivism than} \texttt{Priors} \emph{alone}?
The table below summarizes the classification performance of the two models on the Broward county data.\footnote{Following the ProPublica analysis, we restrict our attention to the $6150$ defendants in the data whose race was recorded as either African-American or Caucasian. }
\vspace{1em}
\begin{center}
\begin{tabular}{lrrrrr}
\toprule
Model & Accuracy & AUC & PPV & TNR & TPR \\
\midrule
\texttt{Priors} & 0.64 & 0.67 & 0.62 & 0.71 & 0.56 \\
\texttt{COMPAS} & 0.66 & 0.70 & 0.65 & 0.75 & 0.55 \\
\bottomrule
\end{tabular}
\end{center}
\vspace{0.25em}
\noindent The numeric scores were converted to classification rules using a cutoff of $2$ for \texttt{Priors} and $5$ for \texttt{COMPAS}. These cutoffs were selected so that both models would classify approximately the same proportion of defendants as high-risk (42\% and 39\%, respectively). While \texttt{COMPAS} is somewhat more accurate according to the various metrics, the difference in performance is overall not very large. One might therefore be inclined to conclude that the choice of model does not make much difference, and that the results are similar perhaps because \texttt{COMPAS} likely puts a large weight on criminal history and thus reaches the same conclusion as \texttt{Priors}. This conclusion is \emph{incorrect}. As it turns out, the two classifiers disagree on 32\% of all cases. Furthermore, as we will see in Section \ref{sec:compas_vs_priors}, they differ tremendously in terms of error rates and racial disparities for certain subgroups of defendants. Model choice matters.
\vspace{0.5em}
\noindent \textbf{Main contributions.} We introduce a model comparison framework based on a recursive binary partitioning algorithm for automatically identifying subgroups in which the differences between two classification models are most pronounced. The methods presented in this paper specifically focus on identifying subgroups where the models differ in terms of fairness-related quantities such as racial or gender disparities in error or acceptance rates. Our methods can be applied to black-box models trained according to an unknown mechanism, do not require knowledge of what inputs the models use to make predictions, and do not require the models to use the same input variables.
One noteworthy application of our method is in the model training phase, where one may wish to understand the effect that including a particular set of (potentially sensitive) variables has on the resulting classifications. While there are certainly settings where using a sensitive attribute in decision-making is prohibited by law, this is far from always being the case. Many domains permit the consideration of sensitive attributes when doing so improves the welfare of traditionally disadvantaged groups. Indeed, depending on the problem setting, there may be good reason to expect predictive factors or mechanisms to differ across groups. As \citet{hardt2014big} argues, ``statistical patterns that apply to the majority may be invalid within a minority group.'' In settings where using information on sensitive attributes may be permitted, it is important to understand the implications that this choice has for fairness. Our framework provides a principled approach to investigating these kinds of issues. We explore this matter further in the hypothetical lending example of Section \ref{sec:adult}.
\vspace{-0.6em}
\subsection{Outline}
We begin with an overview of some related literature on model transparency and subgroup analysis. In Section \ref{sec:method} we describe the general framework for our model comparison approach and provide some details on the implementation. We conclude with experimental results where we investigate (i) how racial disparities differ across models in the ProPublica COMPAS data, and (ii) how gender disparities in acceptance rates change when additional sensitive attributes are added to a hypothetical model of creditworthiness.
\vspace{-0.6em}
\subsection{Related Work}
Within the algorithmic fairness literature, notable recent work has introduced new variable importance measures for quantifying the influence of variables on classification decisions (see, e.g., \citep{henelius2014peek, adler2016auditing, datta2015influence, datta2016algorithmic}). A motivation common to much of this body work has been the problem of assessing whether sensitive attributes such as race or gender have direct or indirect influence on model outcomes. We also note the recent work of \citet{zhang2016identifying}, which considers the single-model problem of identifying subgroups in which the estimated event probabilities differ significantly from observed proportions. This existing literature differs from our proposal in that we seek to quantify and characterize the difference in fairness across different models rather than to assess the direct or indirect influence of features in a single pre-trained model. Our proposed method for characterizing differences in fairness across models has connections to recent work on subgroup analysis and recursive binary partitioning approaches for heterogeneous treatment effect estimation \citep{su2009subgroup, athey2015machine}.
\vspace{-0.6em}
\subsection{Fairness Metrics}
Throughout the paper we will make references to ``fairness metrics'' or ``disparities'', which often correspond to differences in a particular classification metric across groups. For instance, \emph{statistical parity} or \emph{equal acceptance rates} with respect to a binary gender indicator would be satisfied if men and women were classified to the positive outcome at approximately equal rates. \emph{False positive rate balance} with respect to race would be satisfied in the COMPAS example if non-reoffending Black defendants were misclassified as high-risk at the same rate as non-reoffending White defendants. The work of \cite{hardt2016equality, kleinberg2016inherent, chouldechova2017fairlong, corbett2017algorithmic, berk2017fairness} describes numerous commonly used metrics, and provides a discussion of inherent trade-offs that exist between them. \citet{romei2014multidisciplinary} provide a broader survey of multidisciplinary approaches to discrimination analysis that go beyond simple classification metrics.
\section{Model Comparison framework}\label{sec:method}
We now describe our methodology for identifying subgroups in which a given
disparity differs across models. The central components of this approach are as follows. First, we define a quantity of interest, $\Delta$, that captures differences in model fairness, and we show how this quantity is a simple function of the parameters of an exponential family model. We then apply a recursive binary partitioning algorithm that uses a score-type test for $\Delta$ to partition the covariate space into regions within which $\Delta$ is homogeneous.
\vspace{0.25em}
\noindent \textbf{Notation.} We begin with some notation.
Let $A\in\{a_1,a_2\}$ indicate a sensitive binary attribute (e.g., race in the
COMPAS example), and let
$Y \in \{0,1\}$ indicate the true outcome (e.g., 2-year recidivism). Let
$\hat{Y}_{m_1}, \hat{Y}_{m_2}\in\{0,1\}$ denote the classifications made by two
classifiers, $m_1$ and $m_2$. Due to space limitations, we focus our
description on disparities in the False Positive Rate. Extensions to other
fairness metrics involving expressions of the form $\hat Y \mid A, Y$ (e.g., FNR, acceptance rates) are entirely analogous, and are discussed in Section \ref{sec:extensions}.
The false
positive rate (FPR) for classifier $m_j$, among individuals in group $A=a$ is
denoted
$\mathrm{FPR}_{m_j}^a = \P(\hat{Y}_{m_j}=1|Y=0, A=a)$. Disparities in FPR across
values of $A$ for model $m_j$ are captured by $\mathrm{FPR}_{m_j}^{a_2} -
\mathrm{FPR}_{m_j}^{a_1}$, and hence differences in these disparities between
classifiers can be captured by the difference-in-differences of the FPR:
\begin{align}
\Delta &= \left(\mathrm{FPR}_{m_2}^{a_2} - \mathrm{FPR}_{m_2}^{a_1}\right) -
\left(\mathrm{FPR}_{m_1}^{a_2} - \mathrm{FPR}_{m_1}^{a_1}\right).
\label{eq:delta}
\end{align}
We focus on the difference-in-differences instead of difference in \emph{absolute} differences because it is important to be able to capture cases where the disparity differs in sign between two models but not necessarily in magnitude.
The goal of the proposed method is to partition the covariate space into
subgroups such that $\Delta$ is homogeneous within each subgroup and different
between subgroups. We say that $\Delta$ is homogeneous within a group if
that group cannot be partitioned into subgroups with significantly different
$\Delta$ values. In Section \ref{sec:partition}, we will describe the
application of test-based recursive partitioning to obtain subgroups
homogeneous in $\Delta$. In Section \ref{sec:model}, we describe the
likelihood model which underlies the tests of homogeneity.
\begin{table*}[ht]
\begin{minipage}{0.49\textwidth}
\centering
\begin{tabular}{r|cc}
\toprule
$A = a_1$ & $\hat{Y}_{m_2}=0$ & $\hat{Y}_{m_2}=1$\\
\hline
$\hat{Y}_{m_1}=0$ & $p_{00}^{a_1}$ & $p_{01}^{a_1}$\\
$\hat{Y}_{m_1}=1$ & $p_{10}^{a_1}$ & $p_{11}^{a_1}$ \\
\bottomrule
\end{tabular}
\end{minipage}
%
\begin{minipage}{0.49\textwidth}
\centering
\begin{tabular}{r|cc}
\toprule
$A = a_2$ & $\hat{Y}_{m_2}=0$ & $\hat{Y}_{m_2}=1$\\
\hline
$\hat{Y}_{m_1}=0$ & $p_{00}^{a_2}$ & $p_{01}^{a_2}$\\
$\hat{Y}_{m_1}=1$ & $p_{10}^{a_2}$ & $p_{11}^{a_2}$\\
\bottomrule
\end{tabular}
\end{minipage}
\caption{Conditional on the sensitive attribute $A\in\{a_1,a_2\}$, the observed $(\hat{Y}_{m_1},\hat{Y}_{m_2})$ can be modeled as a multinomial
with parameters $p_{ij}^a$. For the case of FPR disparities discussed in Section \ref{sec:model}, all quantities in this table should be interpreted as being further conditioned on $Y = 0$. }
\label{tab:multinom}
\end{table*}
\subsection{Partitioning scheme}
\label{sec:partition}
Given a set of partitioning covariates $X_1, \ldots, X_p$---which need not
correspond in any way to the inputs used by either classifier---we recursively
partition the covariate space using tests of the homogeneity of $\Delta$. Our
partitioning procedure follows the approach of \cite{rpartykit, rmob} for
model-based recursive binary partitioning, and relies on a modified version of the
corresponding software. Our implementation uses custom fitting functions supplied to the \texttt{R} package \texttt{partykit}. We briefly describe the procedure for the simple
case where all of the splitting variables are categorical. The approach and software both fully extend to also handle numeric and ordinal variables.
Let $K_j$ denote the number of distinct levels of variable $X_j$, and let $\Delta^j_k$ denote the (population) value of $\Delta$ in level $k$ of variable $X_j$. Beginning with all observations in the root node,
recursively split according to the following procedure:
\begin{enumerate}
\item For each partitioning variable $j = 1, \ldots, p$, apply a score-type test (see Section \ref{sec:model} and Appendix \ref{appendix:likelihood}) for detecting when $\Delta^j_k$ varies across the levels $k \in \{1, \ldots, K_j\}$. \\
Select the splitting variable with the most
significant difference in $\Delta$ (the smallest $p$-value for this test).
\item For the selected variable, partition its levels into the two groups
which minimize the total deviance of the resulting model.
\end{enumerate}
The recursion terminates when nodes cannot be further split without falling below a user-specified minimum size
threshold, or no further splits can be identified for which the Bonferroni-adjusted $p$-value is smaller than a user-specified significance threshold. As a final step,
the tree is pruned to eliminate splits where the differences in $\Delta$ are not of practical significance, but which were statistically significant due to large sample sizes.
This partitioning scheme produces what we will refer to as a \emph{parameter instability tree}, with splits defined based on individual
covariates, similar to the familiar trees produced by CART
\citep{breiman1984classification} in classification settings. The leaf nodes
of the tree correspond to subgroups where $\Delta$ appears homogeneous.
Figure \ref{fig:compas_tree} shows an example of the parameter instability tree for the COMPAS data, with $\Delta$ taken to be the difference in racial FPR disparity between the \texttt{Priors} and \texttt{COMPAS} model. Section \ref{sec:compas_vs_priors} provides more details on the experimental setup.
\subsection{Modeling classifications}
\label{sec:model}
To carry out the recursive partitioning of Section \ref{sec:partition}, we need
a model for the classifications which is (a) reasonable, and (b) easily
captures $\Delta$ in its parametrization. Given a population, a natural
joint model of classifications
$(\hat{Y}_{m_1}, \hat{Y}_{m_2})$ is as a multinomial conditional on sensitive
attribute $A \in \{a_1,a_2\}$, as illustrated in Table \ref{tab:multinom}. This multinomial is parameterized by the probabilities
\begin{align*}
p_{ij}^a &= \P(\hat{Y}_{m_1}=i, \hat{Y}_{m_2}=j| Y=0, A=a),
\end{align*}
where $a\in\{a_1,a_2\}$. The conditional multinomial is a convenient
formulation, since all relevant FPR quantities can be represented in terms of
these parameters:
\begin{align*}
\mathrm{FPR}_{m_2}^{a_2} &= p_{01}^{a_2} + p_{11}^{a_2}\qquad
\mathrm{FPR}_{m_2}^{a_1} = p_{01}^{a_1} + p_{11}^{a_1}\\
\mathrm{FPR}_{m_1}^{a_2} &= p_{10}^{a_2} + p_{11}^{a_2}\qquad
\mathrm{FPR}_{m_1}^{a_1} = p_{10}^{a_1} + p_{11}^{a_1}
\end{align*}
An important observation is that, for the purpose of computing the quantity of interest $\Delta$, it suffices to consider the coarser conditional multinomial over the three events
$\{\hat{Y}_{m_1}=0,\hat{Y}_{m_2}=1\}, \{\hat{Y}_{m_1}=1,\hat{Y}_{m_2}=0\},
\{\hat{Y}_{m_1}=\hat{Y}_{m_2}\}$. This reduced multinomial is parameterized by
$p_{10}^{a_1}, p_{01}^{a_1}, p_{10}^{a_2}, p_{01}^{a_2}$. We summarize this observation in the proposition below.
\begin{proposition}
The FPR difference-in-difference, $\Delta$, can be written as
\begin{align*}
\Delta &=
p_{01}^{a_2} - p_{01}^{a_1} - p_{10}^{a_2} +p_{10}^{a_1}
\end{align*}
\end{proposition}
\begin{proof}
The proposition follows directly from the definition of $\Delta$ and the
identity,
\begin{align*}
&\P(\hat{Y}_{m_2}=1|Y=0,A=a) - \P(\hat{Y}_{m_1}=1|Y=0,A=a)\\
&= p_{01}^a - p_{10}^a.
\end{align*}
\vspace{-1em}
\end{proof}
To obtain the score-type test statistic for $\Delta$ required in Step (1) of the partitioning scheme described in Section \ref{sec:partition}, we further reparameterize the model according to the transformations:
\newcommand{\eta^+}{\eta^+}
\newcommand{\eta^-}{\eta^-}
\newcommand{\delta^+}{\delta}
\newcommand{\delta^-}{\Delta}
\begin{align*}
\eta^+ &= p_{01}^{a_1} + p_{10}^{a_1}\qquad \delta^+ = p_{01}^{a_2} + p_{10}^{a_2} - \eta^+\\
\eta^- &= p_{01}^{a_1} - p_{10}^{a_1}\qquad \Delta = p_{01}^{a_2} - p_{10}^{a_2} - \eta^- .
\end{align*}
In this parameterization, $\eta^+, \delta^+$ and $\eta^-$ are treated as nuisance parameters in the model likelihood for the purpose of forming the score-type test statistic for $\Delta$. A more complete derivation of the test statistic can be found in Appendix \ref{appendix:likelihood}.
\subsection{Extensions}\label{sec:extensions}
The methodology in Section \ref{sec:method} focuses on identifying subgroups
with where two models differ in terms their FPR disparities. To target disparities in False Negative Rates (FNR), the same procedure can be
carried out by conditioning on $Y=1$ instead of $Y=0$, and exchanging the role of
$\hat{Y}_m=1$ and $\hat{Y}_m=0$ in expression \eqref{eq:delta}. $\Delta$ would then correspond precisely to the difference in FNR disparity. Similarly, to target disparities in the acceptance rates $\P(\hat{Y}_m = 1| A=a)$,
the procedure can be carried out without conditioning
on $Y$. Certain other metrics may similarly be considered.
In principle, the methodology can also be extended to sensitive attributes $A$ that have more than two levels. One would first need to define a quantity $\Delta$ that reflects the disparity of model predictions with respect to $A$. For instance, in the case of acceptance rates, $\Delta$ could be taken to be the variance in acceptance rates across race (now understood to be non-binary). An extension of the proposed procedure to this quantity would thus identify subgroups where one model exhibits greater variability in acceptance rates across race compared to another model. Alternatively, the proposed approach can be applied directly in an all-pairs or one-versus-all manner.
Lastly, we note that the score-type test for testing the null hypothesis in Step (1) of Section \ref{sec:partition} can be replaced with any other valid statistical test. One could thus use a test that has greater power against particular types of alternatives. Note, however, that the score test is a computationally efficient choice. This is because, unlike most tests, the score test only requires that maximum likelihood parameters be computed under the null. This obviates the need for model refitting under the alternative for each splitting variable.
\begin{figure}[t]
\includegraphics[width = 0.51\textwidth]{compas_tree.pdf}
\caption{Parameter instability tree for identifying differences in racial FPR disparities between \texttt{COMPAS} and \texttt{Priors}. Sample sizes $n_0$ indicate number of observations in the terminal node for which $Y = 0$. Negative values of $\Delta$ correspond to subgroups where the FPR disparity in favor of White defendants is smaller for \texttt{Priors} than for \texttt{COMPAS}.}
\label{fig:compas_tree}
\end{figure}
\begin{figure}[t]
\includegraphics[width = 0.51\textwidth]{compas_fpr_full.pdf}
\caption{Differences in racial FPR disparities between \texttt{COMPAS} and \texttt{Priors}.}
\label{fig:compas_fpr}
\end{figure}
\section{Evaluation}
\subsection{Recidivism risk prediction} \label{sec:compas_vs_priors}
We begin by revisiting our motivating example with ProPublica's COMPAS data from Broward County, Florida. So far we have seen that the \texttt{COMPAS} score performs similarly to the priors count, \texttt{Priors}, in terms of overall classification metrics. To delve deeper into differences between these two recidivism prediction models, we apply our method to identify subgroups where \texttt{COMPAS} and \texttt{Priors} differ in terms of the \emph{disparity in false positive rates between Black and White defendants}. The candidate splitting variables are taken to be \verb|sex|, \verb|age_cat|, \verb|c_charge_degree|, \verb|juv_misd_count|, \\ \verb|juv_fel_count|, and \verb|juv_other_count|. Figure~\ref{fig:compas_tree} shows the resulting parameter instability tree, and Figure~\ref{fig:compas_fpr} provides a more easily interpretable representation of the findings.
Our method identifies $7$ subgroups defined in terms of \verb|sex|, \verb|age_cat| and \verb|c_charge_degree| splits where the extent or nature of the disparity in FPR between Black and White defendants is different between the two models. For instance, as we can clearly see in rightmost panel of Figure~\ref{fig:compas_fpr}, the racial FPR disparity among young men is large for \texttt{COMPAS} but is nearly $0$ for \texttt{Priors}.
We emphasize two key points. First, we observe that the Overall difference in racial FPR disparity is not reflective of differences at the subgroup level. Furthermore, we note that while the differences in FPR across the $7$ subgroups are at least in part due to differences in recidivism prevalence across the subgroups, the same argument does not explain the differences between \texttt{COMPAS} and \texttt{Priors} \emph{within} the subgroups.
\subsection{Sensitive attributes as inputs} \label{sec:adult}
\begin{figure}[t]
\includegraphics[width = 0.51\textwidth]{adult_tree.pdf}
\caption{Parameter instability tree for identifying differences in acceptance (``lending'') rates between men and women between the \texttt{Small} and \texttt{Full} models. Negative values of $\Delta$ correspond to subgroups where the acceptance rate disparity in favor of Male applicants is smaller for \texttt{Full} than for \texttt{Small}. Nodes \{3, 5, 6\} are later collapsed in the pruning stage as the corresponding $\Delta$'s of $0.001, 0.006$ and $-0.006$, while statistically significant due to large sample sizes, are not of practical significance.}
\label{fig:adult_tree}
\end{figure}
For our next example we use the \texttt{Adult} data set from the UCI database \cite{Lichman:2013} to frame a hypothetical lending problem. We fit two random forest models to the data to predict whether individuals are in the \verb|>50K| income (``loan-worthy'') category. The \texttt{Small} model uses \verb|sex, age, workclass, education.years| as inputs, while the \texttt{Full} model \emph{additionally} uses \verb|race| and \verb|marital.status|, both of which are typically considered to be sensitive attributes. While we do not claim that either model is realistic, this setup does illustrate an interesting phenomenon.
We apply our method to identify subgroups where the \emph{disparity in lending rates between Male and Female applicants differs between the \texttt{Small} and \texttt{Full} model}. More precisely, $\Delta$ in this example is taken to be:
\begin{align*}
\Delta &= \left(\P(\hat Y_\texttt{Full} = 1 \mid \texttt{Male}) - \P(\hat Y_\texttt{Full} = 1 \mid \texttt{Female})\right) - \\
&\left(\P(\hat Y_\texttt{Small} = 1 \mid \texttt{Male}) - \P(\hat Y_\texttt{Small} = 1 \mid \texttt{Female})\right).
\end{align*}
The candidate splitting variables are taken to be \verb|education|, \verb|age|, \verb|marital.status| and \verb|race|. Figure~\ref{fig:adult_tree} shows the resulting parameter instability tree, and Figure~\ref{fig:adult_accept} provides a more interpretable representation of the results. Unlike in the COMPAS example, the number of terminal nodes presented in the tree differs from the number of subgroups presented in the Figure~\ref{fig:adult_accept} summary. This is because the tree is shown \emph{prior} to pruning, a final step that collapses nodes 3,5 and 6 into a single \verb|{Education <= High School}| subgroup.
We observe that overall acceptance (lending) rates go up for both men and women when marital status and race is included in the model. We also find that the gender disparity in lending rates \emph{decreases}---and even \emph{inverts}---among Married individuals who have more than a High School education. The disparity also decreases considerably among unmarried individuals with at least a College education. However, this is largely due to the massive drop in lending rates among Men in this subgroup.
{
\begin{figure}[t]
\includegraphics[width = 0.51\textwidth]{adult_accept.pdf}
\caption{Differences in acceptance (``lending'') rates between men and women when \texttt{marital.status} and \texttt{race} are \emph{not} included as inputs (\texttt{Small}) compared to when they are (\texttt{Full}).}
\label{fig:adult_accept}
\end{figure}
}
\section{Conclusion}
This paper introduced a test-based recursive binary partitioning approach to identifying subgroups where two models differ considerably in terms of their fairness properties. Using examples in recidivism prediction and lending, we showed how this approach can be used to detect large subgroup differences in fairness that are not apparent from an overall performance comparison. The methodology can be further extended to target other kinds of disparity parameters and to use other statistical tests for parameter instability.
\section{Acknowledgements}
We thank the anonymous FAT/ML referees for their helpful comments on the initial version of this manuscript.
\bibliographystyle{ACM-Reference-Format}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 5,114
|
Cheese of the Year, Fromagerie L'Ancêtre, Le Baluchon
Baluchon: Acquisition by L'Ancêtre ensures the love child lives on
Childhood sweethearts Michel Pichet and Marie-Claude Harvey of award-winning Fromagerie F.X. Pichet near Québec City.
Baluchon is the story of a love lost and, two decades later, found again.
Marie-Claude Harvey and Michel Pichet were childhood sweethearts in the village of Champlain, Québec, on the north shore of the St. Lawrence River near Québec City. But by the time they graduated from high school, they had drifted apart. She found a husband, he found a wife, they both had families before their marriages ended.
Twenty years later they met again. He owned an organic dairy farm. She wanted to make cheese. Obviously, their love was still there, now fired by a common passion for dairy farming and cheesemaking. Thus, they married and 10 years ago, in 2004, Fromagerie F.X. Pichet came to be in Sainte-Anne-de-la-Pérade, Québec. Baluchon was their first-born cheese.
(The creamery was sold in 2017 to Abdel Ould Baba Ali and his son Yacine and became known as Fromagerie Baluchon. In August 2020, the fromagerie was purchased by Fromagerie L'Ancêtre, Québec's leading producer of organic cheese and butter. L'Ancêtre will relocate Baluchon production to its huge dairy plant in nearby Bécancour but continue ripening the cheese in the Sainte-Anne-de-la-Pérade facility which features a retail store. The re-born Baluchon should be back on the market before Christmas 2020. Now, back to the Baluchon love story first published in December 2014.)
Le Baluchon: Canadian Cheese of the Year in 2014.
The name Baluchon in French refers to the small bundle of belongings travelers carried before the advent of mass transportation. Such a traveler, as a mouse character called Hapi, appears on all packaging for cheeses produced at the fromagerie on the 260-acre farm called La Ferme F.X. Pichet, after Michel's father.
Michel and Marie-Claude are devoted to organic farming and cheesemaking. In Québec, the certification process is rigorous, but they cannot see proceeding otherwise. Michel says: "It's our way of life."
Their way of life lead them to dominate the 2014 Canadian Cheese Awards/Le Concours des fromages fins canadiens with Baluchon being named Canadian Cheese of the Year in addition to Best Organic Cheese and Best Semi-Soft Cheese.
In Sélection Caseus 2014, the prestigious competition for Québec cheese, Baluchon was awarded Prix du Public in the semi-soft category. Even five years ago, in the Canadian Cheese Grand Prix, Baluchon was declared best organize cheese.
Even as Baluchon begins to curdle, already the sweet dairy taste is there.
Baluchon is exquisite, exemplifying the best in an organic, semi-soft cheese with a washed rind. It is made with thermized cow's milk and ripened for a minimum of two months. In Québec, thermized milk—heated to 60 degrees Celsius for 15 seconds—is considered raw milk.
Baluchon is a creamy, melt-in-your-mouth cheese that tastes of hazelnut, cream, butter and leaves a slight clover aftertaste, so you really do taste the terroir.
Tour the terroir at La Ferme F.X. Pichet and meet Michel Pichet and his cows in a pictorial we posted on Facebook after a visit in August in 2014.
The compact cheese plant is located on the farm in Champlain steps from the family home. Affinage rooms and the retail store are 20 kilometres away in Sainte-Anne-de-la-Pérade.
Fromagerie F.X. Pichet in Sainte-Anne-de-la-Pérade, Québec.
When they were getting started more than a decade ago, Marie-Claude and Michel consulted André Fouillet, a cheese expert from France, who recommended they use a cheesemaking process he developed when working with Oka, the Canadian classic. Fouillet consulted with a number of Québec fromageries, witness the many semi-soft, washed-rind cheeses produced in the region. Jonathan Portelance, a collaborator at the time, was inspired by the fruity aroma and floral taste of the French Comté.
"But Balachon is unique," says Marie-Claude, "because of our milk and our way of making cheese. Right from the start, we wanted to use non-pasteurized milk—for the taste. Good cheese starts with good milk. We prefer to use pure, organic milk because the integrity of milk is important to us. With conventional milk, you just don't know what's all in the milk."
An organic milk producer and cheesemaker (who, incidentally, works at giant Saputo) suggested the name Baluchon as the cheese could be served on tables around the world. She still supplies some milk and remains a good friend.
Michel Pichet's talents as an artist are visible at the fromagerie.
Why has Baluchon been so successful?
"Because of the distinctive aroma and taste that's stems from a certain synergy," says Marie-Claude. "Our milk comes from a mix of breeds, Holsteins, Swiss Browns and the Canadienne. In our pastures, we have a mix of five or six different plants, grasses, clover, sweat peas and so on. In the plant, we have a mix of talented people. All that 'team work' comes together in le Baluchon."
Cheesemaker Remi Gélinas starts a new batch of Baluchon.
Cheesemaker Remi Gélinas is a key member of the team. He's been with the fromagerie less than two years but has 25 years of experience in cheese and milk production.
Click here for a pictorial of cheesemaking at Fromagerie F.X. Pichet in August 2014.
What pairs well with Baluchon?
"Any tasty wine, red or white, that has a lot of aroma," Marie-Claude says, expressing a preference for shiraz. In beer, she suggests a good amber or red.
Where is Baluchon available outside of Québec?
Baluchon now is widely available in cheese shops and Loblaws stores, especially since it was named Cheese of the Year in the spring. Baluchon and F.X. Pichet's other cheeses are distributed by Fromages CDA which represents members of the Québec Artisan Cheese Guild. Telephone 1-866-448-7997 or 514-648-7997, email info@fromagescda.com.
Marie-Claude Harvey and Michel Pichet: poster children for organic dairy farming and cheesemaking in Québec.
Georgs Kolesnikovs, cheese-head-in-chief at CheeseLover.ca, is founder of Canadian Cheese Awards/Le Concours des fromages fins canadiens.
Makers+Mongers: Sausage shares stage with cheeseburgers
Hobby to business—Ian Treuer's winding road in cheese
Say artisan cheese, say craft beer, please!
Cheese is for lovers
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 3,963
|
Cameron McAllan Gordon (né en 1945) est un mathématicien britannique qui travaille en topologie géométrique, notamment en théorie des nœuds. Il est professeur au département de mathématiques de l'université du Texas à Austin, titulaire d'une chaire Regents Foundation de la Fondation Sid W. Richardson.
Recherche
Gordon a obtenu son doctorat en 1971 à l'Université de Cambridge sous la direction de John F. P. Hudson (Knots and Embeddings).
En 1987 il démontre, avec Marc Culler, John Edwin Luecke et Peter Shalen, le théorème de la chirurgie cyclique. Partant de là, lui et Luecke (son doctorant en 1985) démontrent que les nœuds sont déterminés par leur complément ( théorème de Gordon-Luecke)) : tout homéomorphisme entre deux compléments de nœuds dans la 3-sphère peut être étendu en un homéomorphisme de 3-sphères sur lui-même.
Il a participé à la résolution de la conjecture de Smith (formulée par Paul A. Smith). Avec Andrew Casson, il introduit les invariants de Casson-Gordon en théorie des nœuds et prouve des théorèmes fondamentaux sur les décompositions de Heegaard fortement irréductibles.
Il est Guggenheim Fellow en 1999, il était Sloan Fellow et est membre de la Royal Society of Edinburgh.
Publications (sélection)
Éditeur
.
.
Auteur
.
.
.
.
.
.
.
.
.
.
.
.
.
Notes et références
Liens externes
Page d'accueil
Mathématicien britannique du XXe siècle
Membre de la Royal Society of Edinburgh
Naissance en 1945
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 7,578
|
We talked about actually as a peripheral.
The mechanical sensory channel, and also the temperature.
So, with those information, connect to the peripheral.
This is a signal to again, to send to the brain, okay?
The pass way will be from the, there's no ending to the aorta neuron right?
And then will go to the spinal column.
Spinal cord, then you will have two pathways.
then they relay the information to the brain.
result in a way to the spine goes directly to the brain.
let's see, this is the pathway for the tough.
This is the spinal cord.
This is the DRG, the cell body, right?
as we discussed before, so what are the other kinds?
For the pain pathways, it's a little bit different.
This is a pain pathway.
Now, the pain information connected by the neuron.
And then, they will again, enter through the dorsal horn.
So, these too pass away had different, right?
[FOREIGN] spinal cord [FOREIGN] okay?
to the cortex, let's take a look at this cortex.
the signal already different, okay?
[FOREIGN] let's take a look at the cortex.
the somatosensory cortex [FOREIGN], okay?
receive most intense input from the sediment.
For this cortex, we talked about it before.
because this is the somatosensory cortex, right?
it means the texture of the stimulus, okay?
then send it to region two.
We talked about, actually, the cortex organization before.
Six layers, and also, we talked about actually.
This is the cortex organization, okay?
a small region, that is responsible for similar future stimulation.
especially there are some nerves there.
you see in the retina, that kind of map.
We talk about that, also, in the auditory system.
was a map this one again similar.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 3,044
|
\section{Introduction}
The Hooke-Jeeves pattern search method \cite{HookeJ61} proposed in 1961 is one of the most classical black-box optimizers.
Throughout this paper, HJ denotes the Hooke-Jeeves method.
HJ generates a new search point $\vector{x}^{\mathrm{new}}$ by perturbing only one variable in the current one $\vector{x}$.
This operation is called a pattern move.
After all variables in $\vector{x}$ have been perturbed, the so-called exploratory move is performed.
If the pattern move was successful for at least one variable, HJ generates a new search point $\vector{x}^{\mathrm{new}}$ by taking the difference from the previous one $\vector{x}^{\mathrm{prev}}$ to the current one $\vector{x}$, i.e., $\vector{x}^{\mathrm{new}} := \vector{x} + (\vector{x} - \vector{x}^{\mathrm{prev}})$.
Multiple trajectory search (MTS) \cite{TsengC08} was designed for large-scale black-box optimization.
MTS was the winner of the IEEE CEC2008 competition on large-scale global optimization (LSGO).
MTS adaptively uses three local search methods: MTS-LS1, MTS-LS2, and MTS-LS3.
In this paper, we focus only on MTS-LS1 rather than MTS.
Some hybrid optimizers use MTS-LS1 as a local search method, including iCMAES-ILS \cite{LiaoS13}, MOS \cite{LaTorreMP11,LaTorreMP13}, and SHADE-ILS \cite{MolinaLH18}.
Here, they were the winners of the IEEE CEC2013, CEC2013 LSGO, and CEC2018 LSGO competitions, respectively.
MTS-LS1 is similar to HJ.
Their two essential differences are as follows.
MTS-LS1 does not adopt the exploratory move.
MTS-LS1 also reinitializes the step-size $\sigma$ for the perturbation operator when $\sigma$ is smaller than a pre-defined threshold.
BSrr (also known as NDsqistep and BrentSTEPrr) \cite{PosikB15,BaudisP15} is one of the state-of-the-art optimizers for the five separable noiseless BBOB functions ($f_1, \dots, f_5$) \cite{hansen2012fun}.
Some previous studies on feature-based algorithm selection \cite{KerschkeT19,DerbelLVAT19,JankovicPED21} incorporated BSrr into algorithm portfolios.
The Brent-STEP algorithm \cite{BaudisP15} is a hybrid algorithm of two line search methods: the Brent method \cite{Brent73} and STEP \cite{LangermanSB94}, which perform particularly well for unimodal and multimodal functions, respectively.
Roughly speaking, the Brent-STEP algorithm first applies the Brent method to a partition of the one-dimensional space.
If the search fails, the Brent-STEP algorithm then runs STEP.
Note that the Brent-STEP algorithm is available only for univariate optimization.
BSrr is an extended version of the Brent-STEP algorithm for multivariate optimization.
BSrr applies the Brent-STEP algorithm to each variable in a round-robin manner.
We believe that the separability rarely appears in real-world applications.
However, just in case, it is better for an algorithm portfolio and a hybrid method to contain an optimizer that can exploit the separability, e.g., BSrr.
This paper investigates the performance of HJ, MTS-LS1, and BSrr on the large-scale BBOB function set \cite{varelas2020benchmarking} to address the following three research questions:
\noindent \textbf{RQ1} \textit{How does the performance of BSrr scale to large dimensions?}
BSrr was not designed for large-scale optimization.
BSrr has been benchmarked on problems with up to 20 dimensions.
Thus, we are interested whether BSrr works well even for more than 20 dimensions.
\noindent \textbf{RQ2} \textit{Does MTS-LS1 perform well on the large-scale BBOB function set?}
MTS-LS1 has not been benchmarked on any BBOB function set.
We are interested whether MTS-LS1 can handle various transformations (e.g., asymmetry breaking) in the BBOB functions.
We are also interested in comparing MTS-LS1 with BSrr, which has shown its effectiveness on the five separable noiseless BBOB functions.
\noindent \textbf{RQ3} \textit{Do HJ and MTS-LS1 perform similar?}
Although HJ and MTS-LS1 are very similar, their performance has not been compared.
It is interesting to compare MTS-LS1 proposed in 2008 and HJ proposed in 1961 in a systematic manner.
\section{Experimental setup}
We implemented HJ and MTS-LS1 in C.
Their code is available at \url{https://github.com/ryojitanabe/largebbob2022}.
We believe that there are no ``\textit{the} HJ'' and ``\textit{the} MTS-LS1''.
We referred to the description in \cite{Caraffini14} to implement HJ.
We also referred to the code of MTS-LS1 in MOS (\url{https://sci2s.ugr.es/EAMHCO}) to implement MTS-LS1.
For the sake of clarity, Algorithms \ref{alg:hj} and \ref{alg:mtsls1} show \textit{the} HJ and \textit{the} MTS-LS1 which we understood.
Here, $\vector{x} = (x_1, ..., x_D)^{\top}$ is the current $D$-dimensional search point, $\vector{x}^{\mathrm{prev}}$ is the previous one, $\vector{x}^{\mathrm{new}}$ is the new one, $\vector{x}^{\mathrm{upper}}$ and $\vector{x}^{\mathrm{lower}}$ are the upper and lower bounds of a problem.
In addition, $\sigma$ is the step-size, $\sigma^{\mathrm{init}}$ is the initial value of $\sigma$, and $c$ is the learning rate for $\sigma$.
If $x^{\mathrm{new}}_i$ is out of the range $[x^{\mathrm{lower}}_i, x^{\mathrm{upper}}_i]$, $x^{\mathrm{new}}_i$ is replaced with the closest bound.
We used the Python implementation of BSrr provided by the authors of \cite{BaudisP15} (\url{https://github.com/pasky/step}).
For HJ and MTS-LS1, we set $\sigma^{\mathrm{init}} = 0.4$ and $c=0.5$ as in \cite{TsengC08}.
We also investigate the performance of HJ and MTS-LS1 with $c=0.9$.
We denote HJ and MTS-LS1 with $c=0.5$ and $c=0.9$ as ``HJ-5'', ``HJ-9'', ``MTS-LS1-5'', and ``MTS-LS1-9'', respectively.
We used the default parameter setting for BSrr.
We set the maximum number of function evaluations (\texttt{max\_budget}) for HJ and MTS-LS1 to $10^4 \times D$.
Because BSrr implemented in Python is time-consuming for large dimensions, we set \texttt{max\_budget} for BSrr to $10^3 \times D$.
\IncMargin{0.5em}
\begin{algorithm}[t]
\small
\SetSideCommentRight
Initialize $\vector{x}$, $\sigma \leftarrow \sigma^{\mathrm{init}}$\;
\While{not happy}{
$\vector{x}^{\mathrm{prev}} \leftarrow \vector{x}$\;
\For{$i \in \{1, \dots, D\}$}{
$\vector{x}^{\mathrm{new}} \leftarrow \vector{x}$, $x^{\mathrm{new}}_i \leftarrow x_i + \sigma (x^{\mathrm{upper}}_i - x^{\mathrm{lower}}_i)$\;
\lIf{$f(\vector{x}^{\mathrm{new}}) < f(\vector{x})$}{
$\vector{x} \leftarrow \vector{x}^{\mathrm{new}}$
}
\Else{
$\vector{x}^{\mathrm{new}} \leftarrow \vector{x}$, $x^{\mathrm{new}}_i \leftarrow x_i - \sigma (x^{\mathrm{upper}}_i - x^{\mathrm{lower}}_i)$\;
\lIf{$f(\vector{x}^{\mathrm{new}}) < f(\vector{x})$}{
$\vector{x} \leftarrow \vector{x}^{\mathrm{new}}$
}
}
}
\uIf{$f(\vector{x}) < f(\vector{x}^{\mathrm{prev}})$}{
$\vector{x}^{\mathrm{new}} \leftarrow \vector{x} + (\vector{x} - \vector{x}^{\mathrm{prev}})$\;
\lIf{$f(\vector{x}^{\mathrm{new}}) < f(\vector{x})$}{
$\vector{x} \leftarrow \vector{x}^{\mathrm{new}}$
}
}
\lElse{
$\sigma \leftarrow c \times \sigma$
}
}
\caption{The Hooke-Jeeves method (HJ)}
\label{alg:hj}
\end{algorithm}\DecMargin{0.5em}
\IncMargin{0.5em}
\begin{algorithm}[t]
\small
\SetSideCommentRight
Initialize $\vector{x}$, $\sigma \leftarrow \sigma^{\mathrm{init}}$\;
\While{not happy}{
$\vector{x}^{\mathrm{prev}} \leftarrow \vector{x}$\;
\For{$i \in \{1, \dots, D\}$}{
$\vector{x}^{\mathrm{new}} \leftarrow \vector{x}$, $x^{\mathrm{new}}_i \leftarrow x_i - \sigma (x^{\mathrm{upper}}_i - x^{\mathrm{lower}}_i)$\;
\lIf{$f(\vector{x}^{\mathrm{new}}) < f(\vector{x})$}{
$\vector{x} \leftarrow \vector{x}^{\mathrm{new}}$
}
\Else{
$\vector{x}^{\mathrm{new}} \leftarrow \vector{x}$, $x^{\mathrm{new}}_i \leftarrow x_i + 0.5 \times \sigma (x^{\mathrm{upper}}_i - x^{\mathrm{lower}}_i)$\;
\lIf{$f(\vector{x}^{\mathrm{new}}) < f(\vector{x})$}{
$\vector{x} \leftarrow \vector{x}^{\mathrm{new}}$
}
}
}
\If{$f(\vector{x}) = f(\vector{x}^{\mathrm{prev}})$}{
$\sigma \leftarrow c \times \sigma$\;
\lIf{$\sigma (x^{\mathrm{upper}}_1 - x^{\mathrm{lower}}_1) < 10^{-15}$}{
$\sigma \leftarrow \sigma^{\mathrm{init}}$
}
}
}
\caption{MTS-LS1}
\label{alg:mtsls1}
\end{algorithm}\DecMargin{0.5em}
\section{CPU Timing}
In order to evaluate the CPU timing of the algorithms, we have run the three optimizers \textit{without} restarts on the entire {\ttfamily bbob-largescale} test suite \cite{varelas2020benchmarking} for $2 D$ function evaluations according to \cite{hansen2016exp}.
We conducted our experiments on a Ubuntu 18.04 with Intel(R) 52-Core Xeon Platinum 8270 (26-Core$\times 2$) 2.7GHz and (compile) options \texttt{-O2}.
Table \ref{tab:time} shows the computation time.
As seen from Table \ref{tab:time}, the C code is much faster than the Python code in terms of the CPU time.
\begin{table}[t]
\setlength{\tabcolsep}{1pt}
\centering
\caption{\small Computation time of the three optimizers ($10^{-5}$ seconds).}
\label{tab:time}
{\footnotesize
\begin{tabular}{lccccccccccccccccccc}
\toprule
Optimizers & Languages & 20-D & 40-D & 80-D & 160-D & 320-D & 640-D\\
\midrule
HJ & C & Na & $4.2$ & $5.9$ & $11$ & $21$ & $41$\\
MTS-LS1 & C & $4.1$ & $2.0$ & $5.8$ & $11$ & $21$ & $42$\\
BSrr & Python & $13$ & $20$ & $33$ & $62$ & $120$ & $270$\\
\bottomrule
\end{tabular}
}
\end{table}
\section{Results}
Results from experiments according to \cite{hansen2016exp} and \cite{hansen2016perfass} on the
benchmark functions given in \cite{varelas2020benchmarking} are
presented in
\ifthenelse{\equal{\numofalgs}{1}}{
Figures~\ref{fig:ERTgraphs}, \ref{fig:ECDFs}, and \ref{fig:ECDFsingleOne} and Tables~\ref{tab:ERTs80} and \ref{tab:ERTs320}.
}{\ifthenelse{\equal{\numofalgs}{2}}{
Figures~\ref{fig:scaling}, \ref{fig:scatterplots}, \ref{fig:ECDFs80D}, \ref{fig:ECDFs320D} and \ref{fig:ECDFsingleOne}, and Tables~\ref{tab:ERTs80} and \ref{tab:ERTs320}.
}{\ifthenelse{\(\numofalgs > 2\)}{
Figures~\ref{fig:scaling}, \ref{fig:ECDFs80D}, \ref{fig:ECDFs320D}, \ref{fig:ECDFsingleOne80D}, and \ref{fig:ECDFsingleOne} and Tables~\ref{tab:ERTs80} and \ref{tab:ERTs320}.
}{}}}
The experiments were performed with COCO \cite{hansen2020cocoplat}, version
2.5, the plots were produced with version 2.6.
The \textbf{expected runtime (ERT)}
depends on a given target function value, $\ensuremath{f_\mathrm{t}}=\ensuremath{f_\mathrm{opt}}+\ensuremath{\Delta f}$, and is
computed over all relevant trials as the number of function
evaluations executed during each trial while the best function value
did not reach \ensuremath{f_\mathrm{t}}, summed over all trials and divided by the
number of trials that actually reached \ensuremath{f_\mathrm{t}}\
\cite{hansen2012exp,price1997dev}.
\textbf{Statistical significance} is tested with the rank-sum test for a given
target $\Delta\ensuremath{f_\mathrm{t}}$ using, for each trial,
either the number of needed function evaluations to reach
$\Delta\ensuremath{f_\mathrm{t}}$ (inverted and multiplied by $-1$), or, if the target
was not reached, the best $\ensuremath{\Delta f}$-value achieved, measured only up to
the smallest number of overall function evaluations for any
unsuccessful trial under consideration.
\begin{figure*}[htp]
\centering
\begin{tabular}{@{}c@{}c@{}c@{}c@{}}
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f001.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f002.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f003.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f004.pdf}\\[-0.25em]
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f005.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f006.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f007.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f008.pdf}\\[-0.25em]
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f009.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f010.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f011.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f012.pdf}\\[-0.25em]
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f013.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f014.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f015.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f016.pdf}\\[-0.25em]
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f017.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f018.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f019.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f020.pdf}\\[-0.25em]
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f021.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f022.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f023.pdf}&
\includegraphics[width=0.24\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/ppfigs_f024.pdf}
\end{tabular}
\vspace*{-0.2cm}
\caption[Expected running time (\ensuremath{\mathrm{ERT}}) divided by dimension
versus dimension in log-log presentation]{
\label{fig:scaling}
\bbobppfigslegend{$f_1$ and $f_{24}$}.
}
\end{figure*}
\begin{figure*}[htp]
\begin{tabular}{@{}l@{}l@{}l@{}}
separable fcts & moderate fcts & ill-conditioned fcts\\
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_separ_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_lcond_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_hcond_.pdf}\\
multi-modal fcts & weakly structured multi-modal fcts & all functions\\
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_multi_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_mult2_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_80D_noiselessall_.pdf}
\end{tabular}
\caption{
\label{fig:ECDFs80D}
\bbobECDFslegend{80}
}
\begin{tabular}{@{}l@{}l@{}l@{}}
separable fcts & moderate fcts & ill-conditioned fcts\\
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_separ_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_lcond_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_hcond_.pdf}\\
multi-modal fcts & weakly structured multi-modal fcts & all functions\\
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_multi_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_mult2_.pdf} &
\includegraphics[height=0.19\textheight]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany_320D_noiselessall_.pdf}
\end{tabular}
\caption{
\label{fig:ECDFs320D}
\bbobECDFslegend{320}
}
\end{figure*}
\begin{figure*}
\newcommand{\widthvar}{0.2}
\centering
\begin{tabular}{@{}l@{}l@{}l@{}l@{}l@{}}
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f001_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f002_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f003_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f004_80D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f005_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f006_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f007_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f008_80D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f009_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f010_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f011_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f012_80D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f013_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f014_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f015_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f016_80D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f017_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f018_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f019_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f020_80D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f021_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f022_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f023_80D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f024_80D_.pdf}
\end{tabular}
\caption{\label{fig:ECDFsingleOne80D}
\bbobecdfcaptionsinglefunctionssingledim{80}
}
\end{figure*}
\begin{figure*}
\newcommand{\widthvar}{0.2}
\centering
\begin{tabular}{@{}l@{}l@{}l@{}l@{}l@{}}
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f001_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f002_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f003_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f004_320D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f005_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f006_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f007_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f008_320D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f009_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f010_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f011_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f012_320D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f013_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f014_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f015_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f016_320D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f017_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f018_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f019_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f020_320D_.pdf}\\
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f021_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f022_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f023_320D_.pdf}&
\includegraphics[width=\widthvar\textwidth]{ppdata/BSrr_HJ-5_HJ-9_MTSLS_MTSLS_LBFGS/pprldmany-single-functions/pprldmany_f024_320D_.pdf}
\end{tabular}
\caption{\label{fig:ECDFsingleOne}
\bbobecdfcaptionsinglefunctionssingledim{320}
}
\end{figure*}
\begin{table*}\tiny
{\normalsize \color{red}
\ifthenelse{\isundefined{\algorithmG}}{}{more than 6 algorithms: please split the tables below by hand until it fits to the page limits}
}
\mbox{\begin{minipage}[t]{0.495\textwidth}
\centering
\pptablesheader
\input{\bbobdatapath\algsfolder pptables_f001_80D}
\input{\bbobdatapath\algsfolder pptables_f002_80D}
\input{\bbobdatapath\algsfolder pptables_f003_80D}
\input{\bbobdatapath\algsfolder pptables_f004_80D}
\input{\bbobdatapath\algsfolder pptables_f005_80D}
\input{\bbobdatapath\algsfolder pptables_f006_80D}
\input{\bbobdatapath\algsfolder pptables_f007_80D}
\input{\bbobdatapath\algsfolder pptables_f008_80D}
\input{\bbobdatapath\algsfolder pptables_f009_80D}
\input{\bbobdatapath\algsfolder pptables_f010_80D}
\input{\bbobdatapath\algsfolder pptables_f011_80D}
\input{\bbobdatapath\algsfolder pptables_f012_80D}
\end{tabularx}
\end{minipage}
\hspace{0.002\textwidth}
\begin{minipage}[t]{0.499\textwidth}\tiny
\centering
\pptablesheader
\input{\bbobdatapath\algsfolder pptables_f013_80D}
\input{\bbobdatapath\algsfolder pptables_f014_80D}
\input{\bbobdatapath\algsfolder pptables_f015_80D}
\input{\bbobdatapath\algsfolder pptables_f016_80D}
\input{\bbobdatapath\algsfolder pptables_f017_80D}
\input{\bbobdatapath\algsfolder pptables_f018_80D}
\input{\bbobdatapath\algsfolder pptables_f019_80D}
\input{\bbobdatapath\algsfolder pptables_f020_80D}
\input{\bbobdatapath\algsfolder pptables_f021_80D}
\input{\bbobdatapath\algsfolder pptables_f022_80D}
\input{\bbobdatapath\algsfolder pptables_f023_80D}
\input{\bbobdatapath\algsfolder pptables_f024_80D}
\end{tabularx}
\end{minipage}}
\caption{\label{tab:ERTs80}
\bbobpptablesmanylegend{dimension $80$} \cocoversion
}
\end{table*}
\begin{table*}\tiny
{\normalsize \color{red}
\ifthenelse{\isundefined{\algorithmG}}{}{more than 6 algorithms: please split the tables below by hand until it fits to the page limits}
}
\mbox{\begin{minipage}[t]{0.495\textwidth}
\centering
\pptablesheader
\input{\bbobdatapath\algsfolder pptables_f001_320D}
\input{\bbobdatapath\algsfolder pptables_f002_320D}
\input{\bbobdatapath\algsfolder pptables_f003_320D}
\input{\bbobdatapath\algsfolder pptables_f004_320D}
\input{\bbobdatapath\algsfolder pptables_f005_320D}
\input{\bbobdatapath\algsfolder pptables_f006_320D}
\input{\bbobdatapath\algsfolder pptables_f007_320D}
\input{\bbobdatapath\algsfolder pptables_f008_320D}
\input{\bbobdatapath\algsfolder pptables_f009_320D}
\input{\bbobdatapath\algsfolder pptables_f010_320D}
\input{\bbobdatapath\algsfolder pptables_f011_320D}
\input{\bbobdatapath\algsfolder pptables_f012_320D}
\end{tabularx}
\end{minipage}
\hspace{0.002\textwidth}
\begin{minipage}[t]{0.499\textwidth}\tiny
\centering
\pptablesheader
\input{\bbobdatapath\algsfolder pptables_f013_320D}
\input{\bbobdatapath\algsfolder pptables_f014_320D}
\input{\bbobdatapath\algsfolder pptables_f015_320D}
\input{\bbobdatapath\algsfolder pptables_f016_320D}
\input{\bbobdatapath\algsfolder pptables_f017_320D}
\input{\bbobdatapath\algsfolder pptables_f018_320D}
\input{\bbobdatapath\algsfolder pptables_f019_320D}
\input{\bbobdatapath\algsfolder pptables_f020_320D}
\input{\bbobdatapath\algsfolder pptables_f021_320D}
\input{\bbobdatapath\algsfolder pptables_f022_320D}
\input{\bbobdatapath\algsfolder pptables_f023_320D}
\input{\bbobdatapath\algsfolder pptables_f024_320D}
\end{tabularx}
\end{minipage}}
\caption{\label{tab:ERTs320}
\bbobpptablesmanylegend{dimension $320$} \cocoversion
}
\end{table*}
\noindent \textbf{Some observations}
For the sake of reference, we show the results of L-BFGS \cite{LiuN89} reported in \cite{bbob2019:Varelas:2019:BLS:3319619.3326893}.
The comparison results show that the five optimizers perform significantly worse than L-BFGS on ill-conditioned nonseparable functions ($f_6, \dots, f_{14}$), except for $f_7$.
Our results and the results in \cite{bbob2019:Varelas:2019:BLS:3319619.3326893} indicate that any optimizer performs poorly on a high-dimensional $f_7$ with plateaus.
However, as shown in the results on $f_6$ for 80 and 320 dimensions in Tables \ref{tab:ERTs80} and \ref{tab:ERTs320}, the ERT values of HJ-9 are just approximately 4.9 and 2.2 times larger than those of L-BFGS, respectively.
These results indicate that the exploratory move in HJ is effective on $f_6$.
As seen from Figures \ref{fig:ECDFsingleOne80D}, and \ref{fig:ECDFsingleOne}, the position of the initial search point significantly influences the performance of optimizers on $f_{19}$.
This unexpected observation may relate to a known issue in $f_{19}$ (\url{https://github.com/numbbo/coco/issues/1851}).
Here, for HJ and MTS-LS1, we initialized the first search point $\vector{x}$ to the center of the search space $[-5, 5]^D$, i.e., $\vector{x} = (0, ..., 0)^{\top}$.
In contrast, BSrr and L-BFGS select the first search point uniformly at random in $[-1, 3]^D$ and $[-4, 4]^D$, respectively.
Tables \ref{tab:ERTs80} and \ref{tab:ERTs320} show that HJ-5 and HJ-9 reach the smallest target value $f_{\mathrm{opt}} + 10^{-8}$ in $f_5$ for 80 and 320 dimensions within approximately 122 and 481 function evaluations, respectively.
We believe that the excellent performance of HJ-5 and HJ-9 on $f_5$ is due to the replacement-based bound handling operation in our study.
Although the optimal solution in $f_5$ is on the bounds, the replacement operation moves infeasible solutions to the bounds.
\noindent \textbf{Answers to RQ1}:
Figure \ref{fig:scaling} shows that BSrr performs the best on $f_1$ with $D=640$, $f_2$ with $D \leq 160$, $f_3$ with any $D$, and $f_4$.
Especially, the performance of BSrr on $f_3$ and $f_4$ is notable.
Although BSrr cannot reach the smallest target value $f_{\mathrm{opt}} + 10^{-8}$ on $f_4$ for 320 and 640 dimensions, BSrr reaches other target values, e.g., $f_{\mathrm{opt}} + 10^{-6}$.
The performance of BSrr unexpectedly deteriorates on $f_2$ as the dimension increases.
This may be because we set the maximum number of function evaluations in BSrr to $10^3 \times D$.
The round-robin dimension selection strategy may also not be suitable for large dimensions.
Benchmarking of other variants of BSrr \cite{PosikB15} (e.g., BSqi) with a large budget of function evaluations is a future research topic.
\noindent \textbf{Answers to RQ2}
As shown in Figures \ref{fig:ECDFsingleOne80D} and \ref{fig:ECDFsingleOne}, all 15 runs of MTS-LS1-9 on $f_3$ are successful while those of MTS-LS1-5 are unsuccessful.
These observations suggest that the default value of $c$ is not suitable for the BBOB functions.
However, as seen from the ERT values for 320 dimensions in Table \ref{tab:ERTs320}, MTS-LS1-9 performs approximately 6.1 and 6.3 times worse than MTS-LS1-5 on $f_1$ and $f_2$, respectively.
Interestingly, MTS-LS1 with any $c$ performs poorly on $f_4$.
Since MTS-LS1 uses (almost) the symmetric operation, MTS-LS1 can perform poorly on multimodal functions with a highly asymmetric landscape structure like $f_4$.
\noindent \textbf{Answers to RQ3}
Due to the exploratory move, HJ performs better than MTS-LS1 on the unimodal separable $f_1$ and $f_2$.
The unexpected high performance of HJ on $f_6$ may also be due to the exploratory move.
In contrast, HJ performs significantly worse than MTS-LS1 on $f_3$.
The reinitialization strategy for $\sigma$ in MTS-LS1 may make the difference.
We believe that the performance of HJ on $f_3$ can be improved by using the reinitialization strategy in MTS-LS1.
\section*{Acknowledgment}
This work was supported by Leading Initiative for Excellent Young Researchers, MEXT, Japan.
\clearpage
\bibliographystyle{ACM-Reference-Format}
|
{
"redpajama_set_name": "RedPajamaArXiv"
}
| 8,789
|
Q: External storage devices not listed while init script is running I have an /etc/init.d script that is supposed to detect an external drive mounted at /dev/sda1, if it's there it mounts it. This works fine on my odroid device with the following specs:
pi@odroid64:~$ uname -a
Linux odroid64 3.14.65-73 #1 SMP PREEMPT Tue Aug 2 08:21:02 BRT 2016 aarch64 aarch64 aarch64 GNU/Linux
But when I run the same script on my raspberry pi with these specs:
pi@box:~ $ uname -a
Linux box 4.4.13-v7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux
It's unable to finish. By outputting lsblk in my script when I detect failure, I can see that the device has yet to appear under /dev/sda by the time the script is running. Here is the output of lsblk when the script is ran
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 63M 0 part /boot
└─mmcblk0p2 179:2 0 7.3G 0 part /
And here is the output of lsblk by the time I login
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
└─sda1 8:1 0 111.8G 0 part
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 63M 0 part /boot
└─mmcblk0p2 179:2 0 7.3G 0 part /
So if, after I login, I run
sudo /etc/init.d/usbstorage restart
It mounts the drive as expected, and lsblk outputs
pi@camio-box:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
└─sda1 8:1 0 111.8G 0 part /mnt/usbstorage
mmcblk0 179:0 0 7.4G 0 disk
├─mmcblk0p1 179:1 0 63M 0 part /boot
└─mmcblk0p2 179:2 0 7.3G 0 part /
And mounts the drive as expected.
So I think that I have the wrong headers on my init-script, like I'm not waiting for the system to detect external drives before the script it being ran. Here is the header for my script.
#! /bin/bash
### BEGIN INIT INFO
# Provides: usbstorage
# Required-Start: $local_fs $remote_fs $network $named $portmap
# Required-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Mounts an external drive to /mnt/usbstorage for the cam process
### END INIT INFO
What am I doing wrong?
A: I didn't exactly figure out what went wrong, but I found a much easier way of accomplishing the same thing. Simply add this line to /etc/fstab
/dev/sda1 /mnt/usbstorage auto defaults,user,rw,uid=pi,gid=pi 0 0
the auto keyword will detect the device formatting automatically, which is what my last script was doing. Setting the uid and gid explicitly makes it work with FAT-formatted drives as well.
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 3,205
|
Q: How can I loop through an unknown number of buckets in python? I want to obtain a sequence like this
a,b,c,.....,x,y,z,aa,ab,ac,....,az,ba,bb,....,bz,....,aaa,....,azz....,zzz,...
and so on, until I achieve a given length.
My problem is that I don't know how to code an infinite number of loops.
abc = 'abcdefghijklmnopqrstuvwxyz'
def next_plate(i):
for letter in abc:
i += 1
yield letter, i
num_plates = 10000
i = 0
all_plates = {}
for plate,i in next_plate(i):
if i > num_plates:
break
all_plates[i] = plate
if i < num_plates:
for plate_1, _ in next_plate(i):
for plate_2,i in next_plate(i):
if i > num_plates:
break
all_plates[i] = plate_1 + plate_2
if i < num_plates:
for plate_1, _ in next_plate(i):
for plate_2, _ in next_plate(i):
for plate_3,i in next_plate(i):
if i > num_plates:
break
all_plates[i] = plate_1 + plate_2 + plate_3
Could someone help me with this?
A: Here is an itertools based generator:
import itertools, string
def plates():
n = 1
while True:
for plate in itertools.product(string.ascii_lowercase,repeat = n):
yield ''.join(plate)
n += 1
#test:
p = plates()
test = [next(p) for _ in range(10000)]
print(test[:30])
print(test[-30:])
output:
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'aa', 'ab', 'ac', 'ad']
['nsm', 'nsn', 'nso', 'nsp', 'nsq', 'nsr', 'nss', 'nst', 'nsu', 'nsv', 'nsw', 'nsx', 'nsy', 'nsz', 'nta', 'ntb', 'ntc', 'ntd', 'nte', 'ntf', 'ntg', 'nth', 'nti', 'ntj', 'ntk', 'ntl', 'ntm', 'ntn', 'nto', 'ntp']
A: You need to use the while loop and set it to true(adding the condition to break when your condition is met). I don't have my computer now so the answer is very brief.
|
{
"redpajama_set_name": "RedPajamaStackExchange"
}
| 1,145
|
{"url":"https:\/\/www.gradesaver.com\/textbooks\/math\/calculus\/thomas-calculus-13th-edition\/chapter-14-partial-derivatives-section-14-1-functions-of-several-variables-exercises-14-1-page-787\/16","text":"Thomas' Calculus 13th Edition\n\nEquate $f(x,y)=c$ for each value of c $\\sqrt{25-x^{2}-y^{2}}=c$ square both sides, $25-x^{2}-y^{2}=c^{2}$ $x^{2}+y^{2}=(25-c^{2})$ We have concentric circles about the origin with radii $\\sqrt{25-c^{2}}$ $\\sqrt{25-0^{2}}=5,$ $\\sqrt{25-1^{2}}=\\sqrt{24}=2\\sqrt{6}$ $\\sqrt{25-2^{2}}=\\sqrt{21},$ $\\sqrt{25-3^{2}}=4,$ $\\sqrt{25-4^{2}}=3,$","date":"2021-05-09 20:22:25","metadata":"{\"extraction_info\": {\"found_math\": true, \"script_math_tex\": 0, \"script_math_asciimath\": 0, \"math_annotations\": 0, \"math_alttext\": 0, \"mathml\": 0, \"mathjax_tag\": 0, \"mathjax_inline_tex\": 1, \"mathjax_display_tex\": 0, \"mathjax_asciimath\": 0, \"img_math\": 0, \"codecogs_latex\": 0, \"wp_latex\": 0, \"mimetex.cgi\": 0, \"\/images\/math\/codecogs\": 0, \"mathtex.cgi\": 0, \"katex\": 0, \"math-container\": 0, \"wp-katex-eq\": 0, \"align\": 0, \"equation\": 0, \"x-ck12\": 0, \"texerror\": 0, \"math_score\": 0.9072796702384949, \"perplexity\": 150.45881328148772}, \"config\": {\"markdown_headings\": false, \"markdown_code\": true, \"boilerplate_config\": {\"ratio_threshold\": 0.18, \"absolute_threshold\": 20, \"end_threshold\": 15, \"enable\": true}, \"remove_buttons\": true, \"remove_image_figures\": true, \"remove_link_clusters\": true, \"table_config\": {\"min_rows\": 2, \"min_cols\": 3, \"format\": \"plain\"}, \"remove_chinese\": true, \"remove_edit_buttons\": true, \"extract_latex\": true}, \"warc_path\": \"s3:\/\/commoncrawl\/crawl-data\/CC-MAIN-2021-21\/segments\/1620243989012.26\/warc\/CC-MAIN-20210509183309-20210509213309-00165.warc.gz\"}"}
| null | null |
Reggie Bush, Tim Tebow headline 2023 College Football Hall of Fame class
Sam Cooper
January 9, 2023, 4:36 p.m. ·2 min read
The College Football Hall of Fame's class of 2023 was announced Monday ahead of the national championship game.
The group features 18 players and four coaches and is headlined by two Heisman Trophy winners, Florida quarterback Tim Tebow and USC running back Reggie Bush.
Tebow won the Heisman in 2007 and also helped lead the Gators to two national championships during his time in Gainesville. Like Tebow, Bush won two national championships and the Heisman Trophy during his college career, though many of his accomplishments — including the Heisman — were later vacated following a controversial NCAA investigation.
Though he's still not considered an official Heisman winner, Bush will now be a Hall of Famer following a vote from the National Football Foundation, which runs the College Football Hall of Fame.
Other notable figures included in the 2023 class include Syracuse defensive end Dwight Freeney, Boston College linebacker Luke Kuechly, Missouri receiver Jeremy Maclin and former Georgia and Miami head coach Mark Richt.
Tim Tebow, who won the Heisman in 2007, was elected to the College Football Hall of Fame, Monday, Jan. 9, 2023. (AP Photo/Michael Clubb, File)
The class was chosen from a ballot of 80 players and nine coaches. The official induction will take place at the annual NFF awards dinner in Las Vegas on Dec. 5, 2023.
"We are extremely proud to announce the 2023 College Football Hall of Fame Class," said NFF chairman Archie Manning. "Each of these men has established himself among the absolute best to have ever played or coached the game, and we look forward to immortalizing their incredible accomplishments."
College Football Hall of Fame Class of 2023
Eric Berry – DB, Tennessee (2007-09)
Michael Bishop – QB, Kansas State (1997-98)
Reggie Bush – RB, Southern California (2003-05)
Dwight Freeney – DE, Syracuse (1998-2001)
Robert Gallery – OT, Iowa (2000-03)
LaMichael James – RB, Oregon (2009-11)
Derrick Johnson – LB, Texas (2001-04)
Bill Kollar – DT, Montana State (1971-73)
Luke Kuechly – LB, Boston College (2009-11)
Jeremy Maclin – WR/KR, Missouri (2007-08)
Terance Mathis – WR, New Mexico (1985-87, 1989)
Bryant McKinnie – OT, Miami [FL] (2000-01)
Corey Moore – DL, Virginia Tech (1997-99)
Michael Stonebreaker – LB, Notre Dame (1986, 1988, 1990)
Tim Tebow – QB, Florida (2006-09)
Troy Vincent – DB, Wisconsin (1988-91)
Brian Westbrook – RB, Villanova (1997-98, 2000-01)
DeAngelo Williams – RB, Memphis (2002-05)
Monte Cater – 275-117-2 (70.1%); Lakeland [WI] (1981-86), Shepherd [WV] (1987-2017)
Paul Johnson – 189-99-0 (65.6%); Georgia Southern (1997-2001), Navy (2002-07), Georgia Tech (2008-18)
Roy Kramer – 83-32-2 (71.8%); Central Michigan (1967-77)
Mark Richt – 171-64-0 (72.8%); Georgia (2001-15), Miami [FL] (2016-18)
Pope begins trip to the Democratic Republic of the Congo
The Pontiff's visit to the Congo and South Sudan aims to bring a message of peace to the two countries riven by poverty.View on euronews
Chelsea has already spent more in the January transfer window — around $225 million — than every club in the top leagues in Spain, Italy, Germany and France combined. The London team might not be finished. The final day of the window was another busy one for Chelsea and its new American ownership, with the club reportedly close to signing Argentina midfielder Enzo Fernandez from Benfica for a British-record fee of 105 million pounds ($130 million) after selling Jorginho to Premier League leader
Toronto residents shocked to see coyote running through the streets, 'steps from the CN Tower'
A coyote was spotted running around Toronto on Monday morning.
|
{
"redpajama_set_name": "RedPajamaCommonCrawl"
}
| 8,671
|
As a homeowner you have a choice between two kinds of locks for your doors. You can buy ordinary locks from a serve-youself hardware store or high-security lock from Pre-Lock Security. We are a professional Toronto locksmith service provider that will insure your home has unparalleled levels of security that truly is only available when you install Mul-T-Lock High Security products. Serve-your self hardware stores locks have keys that can be copied easily. High security locks provide superior protection against unauthorized key duplication. Mul-T-Lock key technology is superior to ordinary sawtooth keys that prevent keys from being copied by just about anyone.
Did you know there are tens of thousands of places where you can get a key duplicated in Toronto? How many locksmith shops, hardware stores, malls, and shipping/mailbox stores do you have in your area alone? They all have key duplicators. Without a key control system, you cannot be sure who has keys or how many keys have been made for your locks.
The Mul-T-Lock patented key system offers total key control. The Mul-T-Lock ID Card is given to you with your initial order. Your personal information will be securely kept on file, and keys can be requested in the future only by you and with your Mul-T-Lock ID Card. Give yourself peace of mind knowing there aren't any unauthorized keys floating around. Install Mul-T-Lock Today!!!
In addition to most major credit cards, we accept purchase orders from. Fortune 100 corporations, educational institutions, and government agencies located in Ontario. All purchase order terms are Net 30 days.
The Pre-Lock® Name & Pre-Lock® Logo & Better Lock Next Time® & Pre-Alarm® are Registered Trade Marks of Pre-Lock Security Services Inc.
|
{
"redpajama_set_name": "RedPajamaC4"
}
| 5,552
|
Marguerite Frances Cowley (née Baird; 1890 – September 23, 1970), known as Peggy Cowley and also as Peggy Baird and by her first married name Peggy Johns, was an American landscape painter. She was married to poet-playwright Orrick Johns and writer Malcolm Cowley and was the lover of playwright Eugene O'Neill and poet Hart Crane.
Activism
Baird was a member of the women's suffrage movement. In 1917, she invited Dorothy Day to join the National Woman's Party. They were jailed for 60 days for their protests but were released after 16 days and pardoned by President Woodrow Wilson.
Personal life
After divorcing her first husband, Johns, she married Malcolm Cowley in 1919. In 1931 she moved to Mexico to obtain a divorce. While there her long friendship with poet Hart Crane turned into Crane's first and only documented heterosexual affair. As Crane wrote to a friend about his romance with Peggy Cowley, "Rather amazing things have happened to me since Xmas. Peggy Cowley ... is mainly responsible". This affair has since become a major point of interest for Crane scholars—particularly for those reading him with an eye toward his sexuality—as his engagement with heterosexual life is a determining theme in his last major poem, "The Broken Tower". Appearing at moments to be a highly symbolic affirmation of their relationship, as well as a denial of his homosexual past (the 'broken tower' can be read as a defeated phallus), the poem was written just months before Crane committed suicide by jumping off of a passenger ship in 1932, following a trip to Mexico.
Though their relationship had begun to deteriorate by that time (Crane said he had "misunderstood and misinterpreted Peggy's character quite badly"), Cowley was with Crane on the boat, and she figures briefly, but poignantly, in the events leading up to his death.Hart Crane and family papers Almost thirty years later, she wrote about this period in an article for Venture, "The Last Days of Hart Crane."
After Crane's death, Cowley married twice more and converted to Catholicism at the age of 60. Cowley died of cancer at Dorothy Day's Catholic Worker Farm in Tivoli, New York, where Cowley had resided for ten years.
References
External links
Letter from Katherine Anne Porter to Peggy Cowley, October 01, 1931
1890 births
1970 deaths
20th-century American painters
|
{
"redpajama_set_name": "RedPajamaWikipedia"
}
| 9,554
|
#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "hm_parser.h"
#include "hm_buffer.h"
#include "hm_array.h"
#include "http-parser/http_parser.h"
#define MIN_BUFFER_SPACE 1024
#define MAX_HEADERS 512
#define INIT_HEADERS 8
#define GROW_HEADERS 8
#define MAX_CHUNKS 512
#define INIT_CHUNKS 16
#define GROW_CHUNKS 16
#define MAX_PIECES 4096
#define INIT_PIECES ((INIT_HEADERS * 2) + INIT_CHUNKS)
#define GROW_PIECES 128
typedef enum {
hm_piece_url = 0,
hm_piece_header_field,
hm_piece_header_value,
hm_piece_body,
hm_piece_none,
} hm_piece_t;
#define HM_PIECE_INVALID (UINT16_MAX)
typedef struct HMPiece HMPiece;
struct HMPiece {
hm_len_t start; /**< offset to start of piece in the buffer. */
hm_len_t end; /**< offset to end of piece in the buffer. */
};
/**
* HTTP message object.
*
* @ingroup Objects
*/
struct HMParser {
http_parser parser; /**< embedded http_parser. */
HMPiece *pieces;
uint32_t state: 10;
uint32_t last_id: 3;
uint32_t is_eof: 1;
/* HTTP Message fields. */
hm_idx_t url_idx;
hm_idx_t headers_start;
hm_idx_t headers_end;
hm_idx_t body_start;
hm_idx_t body_end;
hm_len_t parsed_off; /**< http parser offset. */
hm_len_t buf_len; /**< number of bytes in buffer. */
HMBuffer *buf; /**< buffer to hold raw http message. */
/* tmp data */
HMHeader tmp_header;
};
static void hm_parser_clear_message(HMParser *hm_parser) {
/* clear parser state. */
hm_parser->state = HM_PARSER_STATE_NONE;
hm_parser->last_id = hm_piece_none;
/* clear HTTP Message fields */
hm_array_set_count(hm_parser->pieces, 0);
hm_parser->url_idx = HM_PIECE_INVALID;
hm_parser->headers_start = HM_PIECE_INVALID;
hm_parser->headers_end = HM_PIECE_INVALID;
hm_parser->body_start = HM_PIECE_INVALID;
hm_parser->body_end = HM_PIECE_INVALID;
}
static HMParser *hm_parser_new(int is_request) {
HMParser* hm_parser;
http_parser* parser;
hm_parser = (HMParser *)malloc(sizeof(HMParser));
/* init. http parser. */
parser = &(hm_parser->parser);
if(is_request) {
parser->type = HTTP_REQUEST;
} else {
parser->type = HTTP_RESPONSE;
}
/* allocate piece array. */
hm_array_new(hm_parser->pieces, INIT_PIECES);
/* allocate buffer. */
hm_parser->buf = hm_buffer_new(MIN_BUFFER_SPACE);
/* initialize parser state. */
hm_parser_reset(hm_parser);
return hm_parser;
}
HMParser *hm_parser_new_response() {
return hm_parser_new(0);
}
HMParser *hm_parser_new_request() {
return hm_parser_new(1);
}
static void hm_parser_compact_buffer(HMParser *hm_parser, size_t offset) {
size_t len = hm_parser->buf_len;
/* Trim some data from the start of the buffer. */
if(offset < len) {
/* Compact the buffer. */
char *data = (char *)hm_buffer_data(hm_parser->buf);
len -= offset;
memmove(data, data + offset, len);
hm_parser->parsed_off -= offset;
hm_parser->buf_len = len;
} else {
/* Trimmed the whole buffer. */
hm_parser->parsed_off = 0;
hm_parser->buf_len = 0;
}
}
void hm_parser_next_message(HMParser *hm_parser) {
/* remove previous message from buffer. */
hm_parser_compact_buffer(hm_parser, hm_parser->parsed_off);
hm_parser_clear_message(hm_parser);
}
void hm_parser_reset(HMParser* hm_parser) {
http_parser* parser = &(hm_parser->parser);
http_parser_init(parser, parser->type);
parser->data = (char *)hm_buffer_data(hm_parser->buf);
/* clear buffer state. */
hm_parser->parsed_off = 0;
hm_parser->buf_len = 0;
hm_parser->is_eof = false;
hm_parser_clear_message(hm_parser);
}
void hm_parser_free(HMParser* hm_parser) {
hm_buffer_free(hm_parser->buf);
hm_parser->buf = NULL;
hm_array_free(hm_parser->pieces);
hm_parser->pieces = NULL;
free(hm_parser);
}
/* in-place string tolower, for HTTP headers. */
static void hm_str_lower(char *p, size_t len) {
char *p_end = p + len;
for(; p < p_end; p++) {
char c = *p;
if(c >= 'A' && c <= 'Z') {
*p = c + 32;
}
}
}
#define HM_PARSER_ARY_GROW_CHECK(hm_parser, _ary, _idx, _grow, _max) do { \
typeof((hm_parser)->_ary) ary = (hm_parser)->_ary; \
size_t count = hm_array_count(ary); \
size_t cap = hm_array_capacity(ary); \
(_idx) = count; \
count++; \
if(count >= cap) { \
if(cap == (_max)) { \
return -1; \
} else { \
cap += (_grow); \
if(cap > (_max)) cap = (_max); \
hm_array_resize(ary, cap); \
if(ary == NULL) return -1; \
(hm_parser)->_ary = ary; \
} \
} \
hm_array_set_count(ary, count); \
} while(0)
#define HM_PARSER_PIECES_GROW_CHECK(hm_parser, _idx) \
HM_PARSER_ARY_GROW_CHECK(hm_parser, pieces, _idx, GROW_PIECES, MAX_PIECES)
/* push piece. */
static int http_push_piece(http_parser* parser, hm_piece_t piece_id, const char *data, size_t len) {
HMParser *hm_parser = (HMParser*)parser;
const char *data_start = (const char *)parser->data;
size_t start = data - data_start;
uint32_t idx;
HMPiece *piece;
bool append_to_last = false;
/* check if we need to append data to last piece. */
if(hm_parser->last_id == piece_id) {
append_to_last = true;
/* don't merge large body pieces. */
if(piece_id == hm_piece_body && len > 512) {
append_to_last = false;
}
}
if(append_to_last) {
size_t end;
/* append data to last piece. */
idx = hm_array_count(hm_parser->pieces) - 1;
piece = hm_parser->pieces + idx;
/* check for buffer gaps. */
end = piece->end;
if(end != start) {
char *end_ptr = ((char *)parser->data) + end;
/* close gap for this piece. */
memmove(end_ptr, data, len);
}
piece->end = end + len;
return 0;
}
/* start new piece. */
HM_PARSER_PIECES_GROW_CHECK(hm_parser, idx);
hm_parser->last_id = piece_id;
/* initialize new piece. */
piece = hm_parser->pieces + idx;
piece->start = start;
piece->end = start + len;
return 0;
}
static int hm_parser_message_begin_cb(http_parser* parser) {
HMParser *hm_parser = (HMParser*)parser;
if(hm_parser->state != HM_PARSER_STATE_NONE) {
hm_parser_clear_message(hm_parser);
}
hm_parser->state = HM_PARSER_STATE_MESSAGE_BEGIN;
hm_parser->last_id = hm_piece_none;
return 0;
}
static int hm_parser_status_complete_cb(http_parser* parser) {
HMParser *hm_parser = (HMParser*)parser;
hm_parser->state = HM_PARSER_STATE_STATUS_COMPLETE;
hm_parser->last_id = hm_piece_none;
return 0;
}
static int hm_parser_url_cb(http_parser* parser, const char* data, size_t len) {
HMParser *hm_parser = (HMParser*)parser;
hm_parser->state = HM_PARSER_STATE_URL;
if(hm_parser->url_idx == HM_PIECE_INVALID) {
hm_parser->url_idx = hm_array_count(hm_parser->pieces);
}
return http_push_piece(parser, hm_piece_url, data, len);
}
static int hm_parser_header_field_cb(http_parser* parser, const char* data, size_t len) {
HMParser *hm_parser = (HMParser*)parser;
if(hm_parser->state >= HM_PARSER_STATE_HEADERS_COMPLETE) {
/* ignore Trailers for now. */
return 0;
}
hm_parser->state = HM_PARSER_STATE_HEADERS;
if(hm_parser->headers_start == HM_PIECE_INVALID) {
hm_parser->headers_start = hm_array_count(hm_parser->pieces);
hm_parser->headers_end = hm_parser->headers_start;
}
return http_push_piece(parser, hm_piece_header_field, data, len);
}
static int hm_parser_header_value_cb(http_parser* parser, const char* data, size_t len) {
HMParser *hm_parser = (HMParser*)parser;
if(hm_parser->state >= HM_PARSER_STATE_HEADERS_COMPLETE) {
/* ignore Trailers for now. */
return 0;
}
hm_parser->state = HM_PARSER_STATE_HEADERS;
return http_push_piece(parser, hm_piece_header_value, data, len);
}
static int hm_parser_headers_complete_cb(http_parser* parser) {
HMParser *hm_parser = (HMParser*)parser;
hm_parser->state = HM_PARSER_STATE_HEADERS_COMPLETE;
hm_parser->last_id = hm_piece_none;
/* mark end of headers. */
if(hm_parser->headers_start != HM_PIECE_INVALID) {
hm_parser->headers_end = hm_array_count(hm_parser->pieces);
}
if(parser->type == HTTP_RESPONSE) {
http_parser_pause(parser, 1);
}
return 0;
}
static int hm_parser_body_cb(http_parser* parser, const char* data, size_t len) {
HMParser *hm_parser = (HMParser*)parser;
hm_parser->state = HM_PARSER_STATE_BODY;
if(len == 0) return 0;
/* mark start of body pieces. */
if(hm_parser->body_start == HM_PIECE_INVALID) {
hm_parser->body_start = hm_array_count(hm_parser->pieces);
hm_parser->body_end = hm_parser->body_start;
hm_parser->last_id = hm_piece_none;
}
return http_push_piece(parser, hm_piece_body, data, len);
}
static int hm_parser_message_complete_cb(http_parser* parser) {
HMParser *hm_parser = (HMParser*)parser;
hm_parser->state = HM_PARSER_STATE_MESSAGE_COMPLETE;
hm_parser->last_id = hm_piece_none;
http_parser_pause(parser, 1);
return 0;
}
static int hm_parser_resume_parse(HMParser *hm_parser, char *data, size_t data_len) {
http_parser* parser = &(hm_parser->parser);
static const http_parser_settings settings = {
.on_message_begin = hm_parser_message_begin_cb,
.on_url = hm_parser_url_cb,
.on_status_complete = hm_parser_status_complete_cb,
.on_header_field = hm_parser_header_field_cb,
.on_header_value = hm_parser_header_value_cb,
.on_headers_complete = hm_parser_headers_complete_cb,
.on_body = hm_parser_body_cb,
.on_message_complete = hm_parser_message_complete_cb
};
/* resume http parser. */
size_t nparsed = http_parser_execute(parser, &settings, data, data_len);
if(nparsed > 0) {
hm_parser->parsed_off += nparsed;
if(hm_parser->state == HM_PARSER_STATE_HEADERS) {
hm_parser->headers_end = hm_array_count(hm_parser->pieces);
}
if(hm_parser->state == HM_PARSER_STATE_BODY) {
hm_parser->body_end = hm_array_count(hm_parser->pieces);
}
}
/* check for error. */
if(parser->http_errno != HPE_OK) {
/* check if parser was paused. */
if(parser->http_errno == HPE_PAUSED) {
/* resume parser. */
http_parser_pause(parser, 0);
/* check if buffer is also empty. */
if(hm_parser->parsed_off == hm_parser->buf_len) {
hm_parser->state |= HM_PARSER_STATE_NEEDS_INPUT;
}
} else {
/* return -1 to indicate a parser error. */
hm_parser->state |= HM_PARSER_STATE_ERROR;
}
return -1;
}
return nparsed;
}
size_t hm_parser_prepare_buffer(HMParser *hm_parser, size_t len) {
HMBuffer *buf = hm_parser->buf;
size_t cap = hm_buffer_capacity(buf);
size_t buf_len = hm_parser->buf_len;
size_t available;
/* buffer length should never be larger then the current capacity. */
assert(cap >= buf_len);
available = cap - buf_len;
/* check if we should try to grow the buffer. */
if(available < len) {
size_t new_cap = buf_len + len;
/* check for overflow. */
if(new_cap <= buf_len) {
/* ignore bad request to grow buffer. */
return 0; /* return zero to signal bad value. */
}
buf = hm_buffer_resize(buf, new_cap);
if(buf) {
/* update parser's buffer. */
hm_parser->buf = buf;
hm_parser->parser.data = (char *)hm_buffer_data(buf);
cap = hm_buffer_capacity(buf);
available = cap - buf_len;
} else {
/* failed to grow buffer. */
available = 0;
}
}
return available;
}
uint8_t *hm_parser_get_buffer(HMParser *hm_parser) {
uint8_t *data = hm_buffer_data(hm_parser->buf);
data += hm_parser->buf_len;
return data;
}
size_t hm_parser_get_buffer_capacity(HMParser *hm_parser) {
size_t cap = hm_buffer_capacity(hm_parser->buf);
cap -= hm_parser->buf_len;
return cap;
}
size_t hm_parser_append_data(HMParser *hm_parser, const char *data, size_t len) {
size_t space = hm_parser_prepare_buffer(hm_parser, len);
if(space < len) {
len = space;
}
memcpy(hm_parser_get_buffer(hm_parser), data, len);
hm_parser->buf_len += len;
hm_parser->state &= ~HM_PARSER_STATE_NEEDS_INPUT;
return len;
}
bool hm_parser_append_buffer_bytes(HMParser *hm_parser, size_t len) {
size_t cap = hm_buffer_capacity(hm_parser->buf);
size_t buf_len = hm_parser->buf_len;
size_t new_len = buf_len + len;
/* check for integer/capacity overflow. */
if(new_len < buf_len || new_len > cap) {
/* invalid `len` value. */
return false;
}
hm_parser->buf_len = new_len;
hm_parser->state &= ~HM_PARSER_STATE_NEEDS_INPUT;
return true;
}
void hm_parser_eof(HMParser *hm_parser) {
hm_parser->is_eof = true;
/* remove the NEEDS_INPUT flag to allow parser to resume. */
hm_parser->state &= ~HM_PARSER_STATE_NEEDS_INPUT;
}
int hm_parser_execute(HMParser* hm_parser) {
char *data = hm_parser->parser.data;
size_t data_len = hm_parser->buf_len;
size_t parsed_off = hm_parser->parsed_off;
int rc = 0;
/* check if parser needs input or is already in an error state. */
if(hm_parser->state & (HM_PARSER_STATE_NEEDS_INPUT|HM_PARSER_STATE_ERROR)) {
return hm_parser->state;
}
/* Calculate how much data is unparsed. */
data_len -= parsed_off;
data += parsed_off;
if(data_len > 0) {
/* have data to parse. */
rc = hm_parser_resume_parse(hm_parser, data, data_len);
if(rc < 0) {
/* paused or error. */
return hm_parser->state;
}
data_len -= rc;
if(data_len == 0 && hm_parser->is_eof) {
data += rc;
/* finished parsing buffer. Now signal EOF. */
hm_parser_resume_parse(hm_parser, data, 0);
hm_parser->state |= HM_PARSER_STATE_NEEDS_INPUT;
}
} else {
if(hm_parser->is_eof) {
/* signal EOF. */
hm_parser_resume_parse(hm_parser, data, 0);
hm_parser->state |= HM_PARSER_STATE_NEEDS_INPUT;
} else {
/* need data. */
hm_parser->state |= HM_PARSER_STATE_NEEDS_INPUT;
}
}
return hm_parser->state;
}
const char *hm_parser_get_url(HMParser *hm_parser, size_t *len) {
const char *str = NULL;
hm_idx_t idx = hm_parser->url_idx;
assert(len != NULL);
if(idx != HM_PIECE_INVALID) {
HMPiece *piece = hm_parser->pieces + idx;
str = hm_parser->parser.data + piece->start;
*len = piece->end - piece->start;
}
return str;
}
uint32_t hm_parser_count_headers(HMParser *hm_parser) {
uint32_t headers_start = hm_parser->headers_start;
uint32_t headers_end = hm_parser->headers_end;
assert(headers_start <= headers_end);
if(headers_start == HM_PIECE_INVALID) {
return 0;
}
return (headers_end - headers_start) >> 1;
}
void hm_parser_clear_headers(HMParser *hm_parser) {
hm_parser->headers_start = HM_PIECE_INVALID;
hm_parser->headers_end = HM_PIECE_INVALID;
}
#include "hm_header_ids.h"
HMHeader *hm_parser_get_header(HMParser *hm_parser, uint32_t idx) {
HMHeader *head = NULL;
uint32_t headers_start = hm_parser->headers_start;
uint32_t headers_end = hm_parser->headers_end;
uint32_t count = headers_end - headers_start;
const hm_header_id *id;
HMPiece *piece;
char *data;
char *name;
size_t name_len;
/* check for headers. */
if(headers_start == HM_PIECE_INVALID) {
/* no headers. */
return head;
}
/* validate 'idx'. */
idx *= 2; /* each header has two pieces. */
if(idx >= count) {
/* idx out of bounds. */
return head;
}
idx += headers_start;
/* get name & value pieces. */
data = hm_parser->parser.data;
piece = hm_parser->pieces + idx;
/* fill tmp. HMHeader. */
head = &(hm_parser->tmp_header);
name = data + piece->start;
name_len = piece->end - piece->start;
/* lookup header in id map. */
id = hm_header_ids_lookup(name, name_len);
if(id) {
/* found common header, use id for faster processing. */
head->name_id = id->id;
head->name = NULL;
head->name_len = 0;
} else {
/*
* Convert unknown HTTP headers to lower case.
*/
hm_str_lower(name, name_len);
head->name = name;
head->name_len = name_len;
}
piece++;
head->value = data + piece->start;
head->value_len = piece->end - piece->start;
return head;
}
const char *hm_parser_next_body(HMParser *hm_parser, size_t *len) {
const char *str = NULL;
hm_idx_t idx = hm_parser->body_start;
assert(len != NULL);
if(idx != HM_PIECE_INVALID) {
HMPiece *piece = hm_parser->pieces + idx;
str = hm_parser->parser.data + piece->start;
*len = piece->end - piece->start;
/* consume piece. */
idx++;
if(idx >= hm_parser->body_end) {
idx = HM_PIECE_INVALID; /* no more pieces. */
hm_parser->body_end = HM_PIECE_INVALID;
}
hm_parser->body_start = idx;
}
return str;
}
int hm_parser_should_keep_alive(HMParser *hm_parser) {
return http_should_keep_alive(&hm_parser->parser);
}
int hm_parser_is_upgrade(HMParser *hm_parser) {
return hm_parser->parser.upgrade;
}
int hm_parser_method(HMParser *hm_parser) {
return hm_parser->parser.method;
}
const char *hm_parser_method_str(HMParser *hm_parser) {
return http_method_str(hm_parser->parser.method);
}
int hm_parser_version(HMParser *hm_parser) {
return ((hm_parser->parser.http_major) << 16) + (hm_parser->parser.http_minor);
}
int hm_parser_status_code(HMParser *hm_parser) {
return hm_parser->parser.status_code;
}
int hm_parser_is_error(HMParser *hm_parser) {
return (hm_parser->parser.http_errno != HPE_OK && hm_parser->parser.http_errno != HPE_PAUSED);
}
int hm_parser_error(HMParser *hm_parser) {
return hm_parser->parser.http_errno;
}
const char *hm_parser_error_name(HMParser *hm_parser) {
return http_errno_name(hm_parser->parser.http_errno);
}
const char *hm_parser_error_description(HMParser *hm_parser) {
return http_errno_description(hm_parser->parser.http_errno);
}
|
{
"redpajama_set_name": "RedPajamaGithub"
}
| 8,089
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.