text:
# Homework Help: Work done by vector field on straight path

1. May 4, 2014

### sa1988

1. The problem statement, all variables and given/known data

2. Relevant equations

W= ∫F.dr

3. The attempt at a solution

I'm fairly sure I've done the right thing, however my lecturer hasn't uploaded any solutions to any of these problems (which is ridiculous - how am I supposed to learn if I don't know when I'm right or wrong?!) So I'm putting it over to physics forums for some general opinion on my answer.

The path between (1,4,2) and (0,5,1) is a simple move of (-1,-1,-1),

This parameterises to a move of (-t,-t,-t) for 0<t<1

and means x= -t, y= -t, z= -t

so dr = (-t,-t,-t) = (-1,-1,-1)dt

and F = (x, 3xy, -(x+z)) = (-t, 3t2, 2t)

Which gives ∫F.dr = (-t, 3t2, 2t )(-1,-1,-1)dt

= ∫ (t -3t2 - 2t) dt

= [t2/2 - t3 - t2] , 0<t<1

= -3/2 units of work

So am I right? Or mostly right? Or mostly wrong? Or totally wrong?

Thanks a lot!

2. May 4, 2014

### pasmith

No. The path in the question is a straight line from (1,4,2) to (0,5,1). The path (-t,-t,-t) with $0 \leq t \leq 1$ is a straight line from (0,0,0) to (-1,-1,-1).

You can always parametrize the straight line between $\mathbf{a}$ and $\mathbf{b}$ as $\mathbf{r}(t) = \mathbf{a} + (\mathbf{b} - \mathbf{a})t$ for $0 \leq t \leq 1$.

3. May 4, 2014

### sa1988

Hmm I think my method of parameterisation worked?

I actually made a mistake in the straight line. It's not (-1,-1,-1), it's (-1, 1,-1).

However, even in the form r(t) = a+(b-a)t, I still get dr=(-1, 1,-1)dt, just as I had before (apart from the sign error for one of the terms).

So I presume the part I'm wrong with is the bit where I suggested x=-t, y=-t, z=-t ?

I need to be able to set the the vector F so it's represented by the parameter t, so F[x(t),y(t),z(t)].

So then I can do the dot product F.dr = F(t).r(t)dt to bring out an integral purely in t.

How would I do that? I think my main problem now is giving F in terms of t.

Thanks

4. May 4, 2014

### pasmith

That is indeed $\dfrac{d\mathbf{r}}{dt}$. What's $\mathbf{r}(t)$?

Having found $\mathbf{r}(t)$, and my previous post tells you all you need to find it, you substitute it into the given expression for $\mathbf{F}(\mathbf{r})$ in order to calculate $\mathbf{F}(\mathbf{r}(t)) \cdot \dfrac{d\mathbf{r}}{dt}$, which is the function you need to be integrating with respect to $t$ from 0 to 1.

5. May 4, 2014

### sa1988

Aaaaaahhhhhhhhhhh.

From r(t) I get:

x= 1-t
y= 4+t
z= 2-t

So then I have

F[r(t)].(dr/dt)dt

= (x, 3xy, -(x+z).(-1, 1,-1)dt

= (1-t, 3(1-t)(4+t), 2t-3).(-1,1,-1)dt

= -3t2-10t+13

Then do the integral between 0<t<1


text:
# Digital signature algorithms within the European Union

I've just noticed that US NIST has accepted DSA as a digital signature standard. Does the European Union have a similar standard, specifying an algorithm to use when digitally signing messages?

I have been looking this up for some time now, but I fail to find a reasonable answer.

• I don't know for sure if there's anything else, but europe actually accepted DSA as signature algorithm - no need to invent their own. The only exception may be (EC)GDSA which is just a minor modification. For ECGDSA refer to TR-03111 – SEJPM Aug 23 '15 at 15:35
• @SEJPM - thanks for your comment, it has helped in searching by using alternative wording. I found that enisa.europa.eu has a wealth of information on the subject. In short: there are a lot of recommendations, but each member state applies its own algorithms for the moment. The PDF on this page is from 2011, but sums it up enough, for me enisa.europa.eu/activities/identity-and-trust/library/… – twan163 Aug 23 '15 at 16:59

Except if you are picky with updates of references, there is such standard. DSA, RSA, ECDSA-$F_p$, ECDSA-$F_{2^n}$, are approved by ETSI TS 102 176-1 V2.1.1 (2011-07) (Electronic Signatures and Infrastructures (ESI); Algorithms and Parameters for Secure Electronic Signatures; Part 1: Hash functions and asymmetric algorithms), which essentially is an update of ETSI SR 002 176 V1.1.1 (2003-03) (Algorithms and Parameters for Secure Electronic Signatures), which is referenced by CWA 14169:2004 (Secure signature-creation devices “EAL 4+”), which (in an earlier edition that it supersedes) is referenced by Commission decision 2003/511/EC (on the publication of reference numbers of generally recognised standards for electronic signature products in accordance with Directive 1999/93/EC of the European Parliament and of the Council).

format: plain


text:
# Do M-estimators and L-estimators overlap?

In my self-study, I have read the wikipedia entries and some books in regards to M-estimators and L-estimators.

I understand that M-estimators are so called "M" because they "Maximize" the likelihood function, and/or functions of the data itself. I also understand that L-estimators are so called because they use "Linear" combinations of order-statistics of the data.

It seems to me though that there are overlaps between M-estimators and L-estimators, is this not correct? (For example, the mean seems to me that it can be derived as an M-estimator, or as an L-estimator).

Put another way, if we were to draw a Venn Diagram of all M and L estimators, how much would they overlap with each other, if at all?

Edit:

Thanks to the feedback, I understand that such a Venn Diagram might have infinite elements. What I would like however, is very rough percentages of overlap, based on ones' experience, since I know that this experience is far greater than mine! I am just after a rough estimate based on what experts and practitioners in the field have seen and come across.

Thank you.

There are certainly M-estimators that are L-estimators.

An example: the sample median is both an M-estimator and an L-estimator. It's maximum likelihood for the location parameter of a Laplace (double exponential).

The sample midrange is arguably both an M-estimator and an L-estimator, too. I believe it's the maximum likelihood estimator for the center ($\theta$) of a uniform on $(\theta-\phi/2,\theta+\phi/2)$.

the mean seems to me that it can be derived as an M-estimator, or as an L-estimator

Yes, that's another example.

Put another way, if we were to draw a Venn Diagram of all M and L estimators, how much would they overlap with each other, if at all?

I don't know that this is an especially useful way to look at it; my guess is that the number of estimators in the intersection could well be infinite, but may well be a vanishingly-small fraction of the union. But I think it would be very difficult to actually do this calculation, and I believe most of the estimators contained in it would not be interesting for any real-world application.

What might be of more relevance is the proportion of estimators in wide use (amongst those that are M-, or perhaps L-), that are both. But this then gets into issues of personal opinion about definitions and difficulties of estimation (what's 'wide'? how would we measure this?)

I'd think there's probably quite a few that are both, but as a proportion of say all M-estimators that get used/discussed, probably not that large a fraction.

• Thanks Glen_b. Yes, that last sentence is where I was headed, in regards to the proportion of M- and L- estimators that are in 'common' use. – Creatron Dec 24 '13 at 1:59
• I agree that in that form, it's an interesting question to consider, but we'd have to pin down what we mean ... and then figure out some way to work it out/estimate it. It's either going to be pretty much opinion (if possibly somewhat educated opinion) or a study beyond the scope of the short-answer format. – Glen_b -Reinstate Monica Dec 24 '13 at 2:08
• Glen_b, I would settle for an educated opinion based on your experience. Cheers! – Creatron Dec 24 '13 at 16:38
• If you can see some way to make the question rely more on actual expertise, it's probably okay, but to my eye, any attempt to answer it is likely to reflect cognitive bias more than actual fact. I don't see a way to properly back up any answer I might give. – Glen_b -Reinstate Monica Dec 24 '13 at 16:48
• Glen_b, I understand you, no worries. I have edited the question accordingly. – Creatron Dec 24 '13 at 17:28

Here is a Venn Diagram showing the overlap between M- and L-estimators.

• I figured as much - what (rough) percentage would you say that the intersection has of all the M- and L- estimators that are 'common'? Something rough just to get a first order idea. 10%? 20%? – Creatron Dec 24 '13 at 2:26
• As Glen_b noted, the green part of the diagram could have infinite size. We have not yet exhausted the world of estimators - just as we have not exhausted the world of statistics to be estimated. – alex keil Dec 24 '13 at 2:34
• To be only slightly less unhelpful, my particular (applied) field is mainly interested in estimating means and standard deviations. The mean fits under both, whereas the standard deviation does not. Thus, in this group of two, the overlap is 50%. If we draw in more of the field than just the main set of standard analyses, the number of L-estimators does not grow as quickly as M-estimators. This is coming from a very non-theoretically inclined field, mind you. – alex keil Dec 24 '13 at 2:44
• Alex, I realize that. Like I said, I am not looking for an esoteric theoretical quantity. I am just trying to get an admmitedly rough idea based on estimators that are in common use. – Creatron Dec 24 '13 at 2:54
• Ok, that is a good idea based in your field, cheers for that! – Creatron Dec 24 '13 at 2:55


text:
# 6.25. Reading trajectories from memory — MDAnalysis.coordinates.memory¶

Author: Wouter Boomsma 2016 GNU Public License v2 Wouter Boomsma , wouterboomsma on github

New in version 0.16.0.

The module contains a trajectory reader that operates on an array in memory, rather than reading from file. This makes it possible to operate on raw coordinates using existing MDAnalysis tools. In addition, it allows the user to make changes to the coordinates in a trajectory (e.g. through MDAnalysis.core.groups.AtomGroup.positions) without having to write the entire state to file.

## 6.25.1. How to use the MemoryReader¶

The MemoryReader can be used to either directly generate a trajectory as a numpy array or by transferring an existing trajectory to memory.

### 6.25.1.1. In-memory representation of arbitrary trajectories¶

If sufficient memory is available to hold a whole trajectory in memory then analysis can be sped up substantially by transferring the trajectory to memory.

The most straightforward use of the MemoryReader is to simply use the in_memory=True flag for the Universe class, which automatically transfers a trajectory to memory:

import MDAnalysis as mda
from MDAnalysisTests.datafiles import TPR, XTC

universe = mda.Universe(TPR, XTC, in_memory=True)

Of course, sufficient memory has to be available to hold the whole trajectory.

### 6.25.1.2. Switching a trajectory to an in-memory representation¶

The decision to transfer the trajectory to memory can be made at any time with the transfer_to_memory() method of a Universe:

universe = mda.Universe(TPR, XTC)
universe.transfer_to_memory()

This operation may take a while (with verbose=True a progress bar is displayed) but then subsequent operations on the trajectory directly operate on the in-memory array and will be very fast.

### 6.25.1.3. Constructing a Reader from a numpy array¶

The MemoryReader provides great flexibility because it becomes possible to create a Universe directly from a numpy array.

A simple example consists of a new universe created from the array extracted from a DCD timeseries():

import MDAnalysis as mda
from MDAnalysisTests.datafiles import DCD, PSF

universe = mda.Universe(PSF, DCD)

coordinates = universe.trajectory.timeseries(universe.atoms)
universe2 = mda.Universe(PSF, coordinates, format=MemoryReader, order='afc')

Creating an in-memory trajectory with AnalysisFromFunction()

The timeseries() is currently only implemented for the DCDReader. However, the MDAnalysis.analysis.base.AnalysisFromFunction() can provide the same functionality for any supported trajectory format:

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PDB, XTC

from MDAnalysis.analysis.base import AnalysisFromFunction

u = mda.Universe(PDB, XTC)

coordinates = AnalysisFromFunction(lambda ag: ag.positions.copy(),
u.atoms).run().results

### 6.25.1.4. Creating an in-memory trajectory of a sub-system¶

Creating a trajectory for just a selection of an existing trajectory requires the transfer of the appropriate coordinates as well as creation of a topology of the sub-system. For the latter one can use the Merge() function, for the former the load_new() method of a Universe together with the MemoryReader. In the following, an in-memory trajectory of only the protein is created:

import MDAnalysis as mda
from MDAnalysis.tests.datafiles import PDB, XTC

from MDAnalysis.analysis.base import AnalysisFromFunction

u = mda.Universe(PDB, XTC)
protein = u.select_atoms("protein")

coordinates = AnalysisFromFunction(lambda ag: ag.positions.copy(),
protein).run().results
u2 = mda.Merge(protein)            # create the protein-only Universe

The protein coordinates are extracted into coordinates and then the in-memory trajectory is loaded from these coordinates. In principle, this could have all be done in one line:

u2 = mda.Merge(protein).load_new(
AnalysisFromFunction(lambda ag: ag.positions.copy(),
protein).run().results,

The new Universe u2 can be used to, for instance, write out a new trajectory or perform fast analysis on the sub-system.

## 6.25.2. Classes¶

class MDAnalysis.coordinates.memory.Timestep(n_atoms, **kwargs)[source]

Timestep data for one frame

Methods: ts = Timestep(n_atoms) create a timestep object with space for n_atoms

Changed in version 0.11.0: Added from_timestep() and from_coordinates() constructor methods. Timestep init now only accepts integer creation. n_atoms now a read only property. frame now 0-based instead of 1-based. Attributes status and step removed.

Changed in version 2.0.0: Timestep now can be (un)pickled. Weakref for Reader will be dropped. Timestep now stores in to numpy array memory in ‘C’ order rather than ‘F’ (Fortran).

Create a Timestep, representing a frame of a trajectory

Parameters: n_atoms (int) – The total number of atoms this Timestep describes positions (bool, optional) – Whether this Timestep has position information [True] velocities (bool (optional)) – Whether this Timestep has velocity information [False] forces (bool (optional)) – Whether this Timestep has force information [False] reader (Reader (optional)) – A weak reference to the owning Reader. Used for when attributes require trajectory manipulation (e.g. dt) dt (float (optional)) – The time difference between frames (ps). If time is set, then dt will be ignored. time_offset (float (optional)) – The starting time from which to calculate time (in ps)

Changed in version 0.11.0: Added keywords for positions, velocities and forces. Can add and remove position/velocity/force information by using the has_* attribute.

copy()[source]

Make an independent (“deep”) copy of the whole Timestep.

copy_slice(sel)[source]

Make a new Timestep containing a subset of the original Timestep.

Parameters: sel (array_like or slice) – The underlying position, velocity, and force arrays are sliced using a list, slice, or any array-like. A Timestep object of the same type containing all header information and all atom information relevant to the selection. Timestep

Note

The selection must be a 0 based slice or array of the atom indices in this Timestep

Example

Using a Python slice object:

new_ts = ts.copy_slice(slice(start, stop, step))

Using a list of indices:

new_ts = ts.copy_slice([0, 2, 10, 20, 23])

New in version 0.8.

Changed in version 0.11.0: Reworked to follow new Timestep API. Now will strictly only copy official attributes of the Timestep.

dimensions

View of unitcell dimensions (A, B, C, alpha, beta, gamma)

lengths a, b, c are in the MDAnalysis length unit (Å), and angles are in degrees.

dt

The time difference in ps between timesteps

Note

This defaults to 1.0 ps in the absence of time data

New in version 0.11.0.

forces

A record of the forces of all atoms in this Timestep

Setting this attribute will add forces to the Timestep if they weren’t originally present.

Returns: forces – force data of shape (n_atoms, 3) for all atoms numpy.ndarray with dtype numpy.float32 MDAnalysis.exceptions.NoDataError – if the Timestep has no force data

New in version 0.11.0.

classmethod from_coordinates(positions=None, velocities=None, forces=None, **kwargs)[source]

Create an instance of this Timestep, from coordinate data

Can pass position, velocity and force data to form a Timestep.

New in version 0.11.0.

classmethod from_timestep(other, **kwargs)[source]

Create a copy of another Timestep, in the format of this Timestep

New in version 0.11.0.

has_forces

A boolean of whether this Timestep has force data

This can be changed to True or False to allocate space for or remove the data.

New in version 0.11.0.

has_positions

A boolean of whether this Timestep has position data

This can be changed to True or False to allocate space for or remove the data.

New in version 0.11.0.

has_velocities

A boolean of whether this Timestep has velocity data

This can be changed to True or False to allocate space for or remove the data.

New in version 0.11.0.

n_atoms

A read only view of the number of atoms this Timestep has

Changed in version 0.11.0: Changed to read only property

positions

A record of the positions of all atoms in this Timestep

Setting this attribute will add positions to the Timestep if they weren’t originally present.

Returns: positions – position data of shape (n_atoms, 3) for all atoms numpy.ndarray with dtype numpy.float32 MDAnalysis.exceptions.NoDataError – if the Timestep has no position data

Changed in version 0.11.0: Now can raise NoDataError when no position data present

time

The time in ps of this timestep

This is calculated as:

time = ts.data['time_offset'] + ts.time

Or, if the trajectory doesn’t provide time information:

time = ts.data['time_offset'] + ts.frame * ts.dt

New in version 0.11.0.

triclinic_dimensions

The unitcell dimensions represented as triclinic vectors

Returns: A (3, 3) numpy.ndarray of unit cell vectors numpy.ndarray

Examples

The unitcell for a given system can be queried as either three vectors lengths followed by their respective angle, or as three triclinic vectors.

>>> ts.dimensions
array([ 13.,  14.,  15.,  90.,  90.,  90.], dtype=float32)
>>> ts.triclinic_dimensions
array([[ 13.,   0.,   0.],
[  0.,  14.,   0.],
[  0.,   0.,  15.]], dtype=float32)

Setting the attribute also works:

>>> ts.triclinic_dimensions = [[15, 0, 0], [5, 15, 0], [5, 5, 15]]
>>> ts.dimensions
array([ 15.        ,  15.81138802,  16.58312416,  67.58049774,
72.45159912,  71.56504822], dtype=float32)

New in version 0.11.0.

velocities

A record of the velocities of all atoms in this Timestep

Setting this attribute will add velocities to the Timestep if they weren’t originally present.

Returns: velocities – velocity data of shape (n_atoms, 3) for all atoms numpy.ndarray with dtype numpy.float32 MDAnalysis.exceptions.NoDataError – if the Timestep has no velocity data

New in version 0.11.0.

volume

volume of the unitcell

class MDAnalysis.coordinates.memory.MemoryReader(coordinate_array, order='fac', dimensions=None, dt=1, filename=None, velocities=None, forces=None, **kwargs)[source]

MemoryReader works with trajectories represented as numpy arrays.

A trajectory reader interface to a numpy array of the coordinates. For compatibility with the timeseries interface, support is provided for specifying the order of columns through the order keyword.

New in version 0.16.0.

Changed in version 1.0.0: Support for the deprecated format keyword for MemoryReader.timeseries() has now been removed.

Parameters: coordinate_array (numpy.ndarray) – The underlying array of coordinates. The MemoryReader now necessarily requires a np.ndarray order ({"afc", "acf", "caf", "fac", "fca", "cfa"} (optional)) – the order/shape of the return data array, corresponding to (a)tom, (f)rame, (c)oordinates all six combinations of ‘a’, ‘f’, ‘c’ are allowed ie “fac” - return array where the shape is (frame, number of atoms, coordinates). dimensions ([A, B, C, alpha, beta, gamma] (optional)) – unitcell dimensions (A, B, C, alpha, beta, gamma) lengths A, B, C are in the MDAnalysis length unit (Å), and angles are in degrees. An array of dimensions can be given, which must then be shape (nframes, 6) dt (float (optional)) – The time difference between frames (ps). If time is set, then dt will be ignored. filename (string (optional)) – The name of the file from which this instance is created. Set to None when created from an array velocities (numpy.ndarray (optional)) – Atom velocities. Must match shape of coordinate_array. Will share order with coordinates. forces (numpy.ndarray (optional)) – Atom forces. Must match shape of coordinate_array Will share order with coordinates TypeError if the coordinate array passed is not a np.ndarray

Note

At the moment, only a fixed dimension is supported, i.e., the same unit cell for all frames in coordinate_array. See issue #1041.

Changed in version 0.19.0: The input to the MemoryReader now must be a np.ndarray Added optional velocities and forces

OtherWriter(filename, **kwargs)

Returns a writer appropriate for filename.

Sets the default keywords start, step and dt (if available). n_atoms is always set from Reader.n_atoms.

Reader.Writer()

Writer(filename, **kwargs)

A trajectory writer with the same properties as this trajectory.

add_auxiliary(auxname, auxdata, format=None, **kwargs)

Auxiliary data may be any data timeseries from the trajectory additional to that read in by the trajectory reader. auxdata can be an AuxReader instance, or the data itself as e.g. a filename; in the latter case an appropriate AuxReader is guessed from the data/file format. An appropriate format may also be directly provided as a key word argument.

On adding, the AuxReader is initially matched to the current timestep of the trajectory, and will be updated when the trajectory timestep changes (through a call to next() or jumping timesteps with trajectory[i]).

The representative value(s) of the auxiliary data for each timestep (as calculated by the AuxReader) are stored in the current timestep in the ts.aux namespace under auxname; e.g. to add additional pull force data stored in pull-force.xvg:

u = MDAnalysis.Universe(PDB, XTC)

The representative value for the current timestep may then be accessed as u.trajectory.ts.aux.pull or u.trajectory.ts.aux['pull'].

Note

Auxiliary data is assumed to be time-ordered, with no duplicates. See the Auxiliary API.

add_transformations(*transformations)[source]

Add all transformations to be applied to the trajectory.

This function take as list of transformations as an argument. These transformations are functions that will be called by the Reader and given a Timestep object as argument, which will be transformed and returned to the Reader. The transformations can be part of the transformations module, or created by the user, and are stored as a list transformations. This list can only be modified once, and further calls of this function will raise an exception.

u = MDAnalysis.Universe(topology, coordinates)
workflow = [some_transform, another_transform, this_transform]

Parameters: transform_list (list) – list of all the transformations that will be applied to the coordinates
aux_list

Lists the names of added auxiliary data.

check_slice_indices(start, stop, step)

Check frame indices are valid and clip to fit trajectory.

The usage follows standard Python conventions for range() but see the warning below.

Parameters: start (int or None) – Starting frame index (inclusive). None corresponds to the default of 0, i.e., the initial frame. stop (int or None) – Last frame index (exclusive). None corresponds to the default of n_frames, i.e., it includes the last frame of the trajectory. step (int or None) – step size of the slice, None corresponds to the default of 1, i.e, include every frame in the range start, stop. start, stop, step – Integers representing the slice tuple (int, int, int)

Warning

The returned values start, stop and step give the expected result when passed in range() but gives unexpected behavior when passed in a slice when stop=None and step=-1

This can be a problem for downstream processing of the output from this method. For example, slicing of trajectories is implemented by passing the values returned by check_slice_indices() to range()

range(start, stop, step)

and using them as the indices to randomly seek to. On the other hand, in MDAnalysis.analysis.base.AnalysisBase the values returned by check_slice_indices() are used to splice the trajectory by creating a slice instance

slice(start, stop, step)

This creates a discrepancy because these two lines are not equivalent:

range(10, -1, -1)             # [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
range(10)[slice(10, -1, -1)]  # []

close()

Close the trajectory file.

convert_forces_from_native(force, inplace=True)

Conversion of forces array force from native to base units

Parameters: force (array_like) – Forces to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input force is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

New in version 0.7.7.

convert_forces_to_native(force, inplace=True)

Conversion of force array force from base to native units.

Parameters: force (array_like) – Forces to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input force is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

New in version 0.7.7.

convert_pos_from_native(x, inplace=True)

Conversion of coordinate array x from native units to base units.

Parameters: x (array_like) – Positions to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input x is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.

convert_pos_to_native(x, inplace=True)

Conversion of coordinate array x from base units to native units.

Parameters: x (array_like) – Positions to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input x is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.

convert_time_from_native(t, inplace=True)

Convert time t from native units to base units.

Parameters: t (array_like) – Time values to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input t is modified in place and also returned (although note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.) In-place operations improve performance because allocating new arrays is avoided.

Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.

convert_time_to_native(t, inplace=True)

Convert time t from base units to native units.

Parameters: t (array_like) – Time values to transform inplace (bool, optional) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input t is modified in place and also returned. (Also note that scalar values t are passed by value in Python and hence an in-place modification has no effect on the caller.)

Changed in version 0.7.5: Keyword inplace can be set to False so that a modified copy is returned unless no conversion takes place, in which case the reference to the unmodified x is returned.

convert_velocities_from_native(v, inplace=True)

Conversion of velocities array v from native to base units

Parameters: v (array_like) – Velocities to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input v is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

New in version 0.7.5.

convert_velocities_to_native(v, inplace=True)

Conversion of coordinate array v from base to native units

Parameters: v (array_like) – Velocities to transform inplace (bool (optional)) – Whether to modify the array inplace, overwriting previous data

Note

By default, the input v is modified in place and also returned. In-place operations improve performance because allocating new arrays is avoided.

New in version 0.7.5.

copy()[source]

Return a copy of this Memory Reader

dt

Time between two trajectory frames in picoseconds.

frame

Frame number of the current time step.

This is a simple short cut to Timestep.frame.

get_array()[source]

Return underlying array.

get_aux_attribute(auxname, attrname)

Get the value of attrname from the auxiliary auxname

Parameters: auxname (str) – Name of the auxiliary to get value for attrname (str) – Name of gettable attribute in the auxiliary reader
get_aux_descriptions(auxnames=None)

If no auxnames are provided, defaults to the full list of added auxiliaries.

Passing the resultant description to add_auxiliary() will allow recreation of the auxiliary. e.g., to duplicate all auxiliaries into a second trajectory:

descriptions = trajectory_1.get_aux_descriptions()
for aux in descriptions:

Returns: List of dictionaries of the args/kwargs describing each auxiliary. list
iter_as_aux(auxname)

Iterate through timesteps for which there is at least one assigned step from the auxiliary auxname within the cutoff specified in auxname.

iter_auxiliary(auxname, start=None, stop=None, step=None, selected=None)

Iterate through the auxiliary auxname independently of the trajectory.

Will iterate over the specified steps of the auxiliary (defaults to all steps). Allows to access all values in an auxiliary, including those out of the time range of the trajectory, without having to also iterate through the trajectory.

After interation, the auxiliary will be repositioned at the current step.

Parameters: auxname (str) – Name of the auxiliary to iterate over. stop, step) ((start,) – Options for iterating over a slice of the auxiliary. selected (lst | ndarray, optional) – List of steps to iterate over. AuxStep object
next()

Forward one step to next frame.

next_as_aux(auxname)

Move to the next timestep for which there is at least one step from the auxiliary auxname within the cutoff specified in auxname.

This allows progression through the trajectory without encountering NaN representative values (unless these are specifically part of the auxiliary data).

If the auxiliary cutoff is not set, where auxiliary steps are less frequent (auxiliary.dt > trajectory.dt), this allows progression at the auxiliary pace (rounded to nearest timestep); while if the auxiliary steps are more frequent, this will work the same as calling next().

See the Auxiliary API.

static parse_n_atoms(filename, order='fac', **kwargs)[source]

Deduce number of atoms in a given array of coordinates

Parameters: filename (numpy.ndarray) – data which will be used later in MemoryReader order ({"afc", "acf", "caf", "fac", "fca", "cfa"} (optional)) – the order/shape of the return data array, corresponding to (a)tom, (f)rame, (c)oordinates all six combinations of ‘a’, ‘f’, ‘c’ are allowed ie “fac” - return array where the shape is (frame, number of atoms, coordinates). n_atoms – number of atoms in system int
remove_auxiliary(auxname)

Clear data and close the AuxReader for the auxiliary auxname.

rename_aux(auxname, new)

Change the name of the auxiliary auxname to new.

Provided there is not already an auxiliary named new, the auxiliary name will be changed in ts.aux namespace, the trajectory’s list of added auxiliaries, and in the auxiliary reader itself.

Parameters: auxname (str) – Name of the auxiliary to rename new (str) – New name to try set ValueError – If the name new is already in use by an existing auxiliary.
rewind()

Position at beginning of trajectory

set_array(coordinate_array, order='fac')[source]

Set underlying array in desired column order.

Parameters: coordinate_array (ndarray object) – The underlying array of coordinates order ({"afc", "acf", "caf", "fac", "fca", "cfa"} (optional)) – the order/shape of the return data array, corresponding to (a)tom, (f)rame, (c)oordinates all six combinations of ‘a’, ‘f’, ‘c’ are allowed ie “fac” - return array where the shape is (frame, number of atoms, coordinates).
set_aux_attribute(auxname, attrname, new)

Set the value of attrname in the auxiliary auxname.

Parameters: auxname (str) – Name of the auxiliary to alter attrname (str) – Name of settable attribute in the auxiliary reader new – New value to try set attrname to
time

Time of the current frame in MDAnalysis time units (typically ps).

This is either read straight from the Timestep, or calculated as time = Timestep.frame * Timestep.dt

timeseries(asel=None, start=0, stop=-1, step=1, order='afc')[source]

Return a subset of coordinate data for an AtomGroup in desired column order. If no selection is given, it will return a view of the underlying array, while a copy is returned otherwise.

Parameters: asel (AtomGroup (optional)) – Atom selection. Defaults to None, in which case the full set of coordinate data is returned. Note that in this case, a view of the underlying numpy array is returned, while a copy of the data is returned whenever asel is different from None. start (int (optional)) – stop (int (optional)) – step (int (optional)) – range of trajectory to access, start and stop are inclusive order ({"afc", "acf", "caf", "fac", "fca", "cfa"} (optional)) – the order/shape of the return data array, corresponding to (a)tom, (f)rame, (c)oordinates all six combinations of ‘a’, ‘f’, ‘c’ are allowed ie “fac” - return array where the shape is (frame, number of atoms, coordinates).

Changed in version 1.0.0: Deprecated format keyword has been removed. Use order instead.

totaltime

Total length of the trajectory

The time is calculated as (n_frames - 1) * dt, i.e., we assume that the first frame no time as elapsed. Thus, a trajectory with two frames will be considered to have a length of a single time step dt and a “trajectory” with a single frame will be reported as length 0.

transformations

Returns the list of transformations


text:
# Write data to a table¶

A database table may not always match the data in the related AIMMS model. In addition, we may want to write all possible elements explicitly, or just a predetermined selection of rows instead of just the non-zeros. Last but not least, from the context in the application, it may be clear that all of the data is changed, or just one or a few rows.

This is why it is important to select the number of rows to be written (all or few) and there are several tactics available to help you make this selection. We discuss the following tactics in this article:

• Writing non-zeros directly to the database table.

• Writing all possible elements to the database table.

• Writing a selection of rows to the database table.

• Insert a single row into a database table.

## An example project description¶

As we are viewing the same data over and over again; and want to focus on the difference between the various tactics, we use an abstract example.

Two sets with a few elements: s_A and s_B with indices i_a and i_b respectively.

In addition, there is a parameter p_Dat declared over these sets; which may or may not be sparse, may or may not be stored sparse in the database, or we may want to store just a modification.

We use SQLite with the following database table declaration:

 1 2 3 4 5 6 7 CREATE TABLE TableAB ( NamesA TEXT NOT NULL, NamesB TEXT NOT NULL, Vals1 REAL, vals2 REAL, PRIMARY KEY(NamesA,NamesB) )

The AIMMS data is mapped to this SQLite database table as follows:

  1 2 3 4 5 6 7 8 9 10 DatabaseTable db_AB { DataSource: sp_Conn; TableName: "TableAB"; Property: NoImplicitMapping; Mapping: { "NamesA" -->i_a, "NamesB" -->i_b, "Vals1" -->p_dat( i_a, i_b ) } }

## Methods of writing data¶

Below we discuss several methods for writing data to a table.

### Write in replace mode¶

The most direct way of writing data is:

 1 2 3 4 5 Procedure pr_Write { Body: { write p_dat(i_a, i_b) to table db_AB ; } }

Line #3 in the above code block is is equivalent to:

write p_dat(i_a, i_b) to table db_AB
in replace mode ;

Given the data in the table on the left of the following WebUI image:

This will result in the following database table.

Remarks:

• Nine rows are written to this table; only for the non-zeros of p_Dat.

• Reading back p_Dat results in the same data, see the table on the right in above WebUI image.

### Write in dense mode¶

When we also want the zeros to be stored in the database table, we can use the “in dense mode” using the following code:

 1 2 3 4 5 6 Procedure pr_Write { Body: { write p_dat(i_a, i_b) to table db_AB in dense mode ; } }

With this procedure, the data written and read back is illustrated in the left and in the right table of the WebUI image below.

This is actually the same as in the previous section except that the number of rows written now is 25, as the 0.0’s are also written.

### Write selection¶

In the above section, a lot of rows are written. To reduce the number of rows written, we can specify a selection as follows:

• By filtering per index,

• Or by filtering over tuples, as illustrated in the following code.

 1 2 3 4 5 6 Procedure pr_Write { Body: { write p_dat(i_a, i_b) to table db_AB filtering (i_a, i_b) in rel_flt; } }

When the data is an almost full matrix, as illustrated in the table on the left, and specify a filter pattern, according to the table in the middle and use that pattern to filter the writing. rel_flt is a relation which contains the combinations of (i_a, i_b) which have a non-zero value in the pattern table.

Reading the data back results in the table on the right. Note that the table on the left and the table on the right are no longer same!

Note also that the database contains less rows:

## Insert Selection¶

When it is clear in the application which rows are added, and these rows are stored in a relation, say ref_flt, then we can limit the database IO to just inserting those rows as follows:

 1 2 3 4 5 6 7 Procedure pr_Write { Body: { write p_dat(i_a, i_b) to table db_AB in insert mode filtering (i_a, i_b) in rel_flt; } }

Some data entry applictions explicitly track which data is newly entered, which data is modified, and which data is left untouched.

When we start with the p_Dat table in the section Write in Replace mode and only insert one element p_Dat('a3','b3') = 33`, this will result in only one SQL insert statement executed. The AIMMS data is shown here:

and the database table data is shown here:

Apparently, SQLite appends the new element to the end.


text:
## What is Aleph-Null?

August 8, 2011

Someone asked for an explanation of $\aleph_{0}$ (Aleph-null) for non-mathematicians.

Here goes.  Begin with the concept of counting a set of objects.  We can count a set of objects if we can arrange the objects in a list: first object, second object, third object, and so on, so that each object in the set appears on the list.  Listing the objects in a set is the same as assigning a positive integer to each member of the set.  Some countable sets are infinite.  For example, the set of positive integers itself, the set of positive even integers, the set of positive odd integers as well as the set of primes.

To see that the positive even integers are countable just line up the members of that set and match each member of the positive even integers to a member of the positive integers.  The function $f(n) = 2n$ expresses this matching of the two sets because each positive even number $2n$ is matched up with just one positive integer $n$.

Having the property of being able to be put into such a correspondence is called a set’s cardinality.  The cardinality of finite sets is just the number of elements they have; two sets have the same cardinality if, and only if, they have the same number of members/elements.  For example, the cardinality of a set of a dozen eggs and a set of a dozen pencils is 12.

Any infinite set that can be put into a one-to-one correspondence with the positive integers is countably infinite. We can also speak of the cardinality of countably infinite sets (like the set of positive integers and the set of positive even integers).  We can speak of the number of elements in these sets, which is an infinite, or transfinite number, denoted by $\aleph_{0}$.  So we can say that the number of positive even integers is $\aleph_{0}$.

So the set of positive integers $(1, 2, 3, \cdots)$ has cardinality $\aleph_{0}$. Say we list out each positive integer and say  we want to add the number 0 at the beginning of this list.  Well, we can just add it and shift every other number out to the right (to position $n+1$).  The cardinality of this set is still $\aleph_{0}$ since this set can also be matched up to the positive integers. This means that $\aleph_{0} + 1 = \aleph_{0}$.  Suppose we go off the deep end and want to add a countable infinity of other numbers to the set of positive integers, say the negative integers $(-1, -2, -3, \cdots)$.  We can do this by letting each $n$ in the original set move over to position $2n$. We can match this resulting list to the positive integers, and the cardinality of the resulting set will also be $\aleph_{0}$.  This means that $\aleph_{0} + \aleph_{0} = \aleph_{0}$.

Finally, suppose we’re really crazy and want to add $\aleph_{0}$ sets each of $\aleph_{0}$ members to our original list.  The list can always be “expanded” to accommodate each member of each set. For example, since each of the sets we want to accommodate are countably infinite, each of their members can be listed $1, 2, 3, \cdots$ Take the first set and list out each element in this fashion: for each $n$ place the first element of the set in position $n$ and leave $n$ spaces open on the list before placing the subsequent element. The first element will be in the first position, the second element will be in the third position, the third member will be in the 6th position, etc.  So now we have 1 empty space after the first element, two spaces after the second, three spaces after the third, four after the fourth, and so on and so forth. Taking the second countably infinite set, place each of its members in the leftmost space open after setting out the first countably infinite set. The situation now is analogous to when we laid out the first countably infinite set: place each member of the third countably infinite set and place it in the leftmost open space available after having set out the second countably infinite set.  You can do this for each of the countably infinite sets of countably infinite members. The resulting list can be matched up to the positive integers, meaning that $\aleph_{0} \times \aleph_{0} = \aleph_{0}$.

So we have shown that $\aleph_{0} + \aleph_{0} = \aleph_{0} = \aleph_{0} \times \aleph_{0}$. These are elementary equations of the arithmetic of infinite cardinals that are a bit different from those of the arithmetic of finite cardinals that everyone is familiar with, like, $2 +1 = 3, 1 \neq 3; 2 + 2 = 4, 2\neq 4; 2 \times 2 = 4, 2 \neq 4$.

While $\aleph_{0}$ can accommodate quite a bit, there are sets that have a cardinality higher than $\aleph_{0}$.  I’ll produce two such cardinal numbers in the next update.

## FOM Discussion on Consistency of Peano Arithmetic and Foundations of Mathematics

May 20, 2011

I’ve been folloiwing a discussion on the Foundations of Mathematics List (FOM) regarding these two videos (1, 2) on what noted Field’s Medalist Vladimir Voevodsky thinks regarding the consistency of Peano Arithmetic and the foundations of mathematics.  His comments have caused quite a stir on the list.  Below is a message to Voevodsky by Harvey Friedman and Voevodsky’s reply.

“Dear Professor Voevodsky,

I have become aware of your online videos at http://video.ias.edu/voevodsky-80th and http://video.ias.edu/univalent/voevodsky. I was particularly struck by your discussion of the “possible inconsistency of Peano Arithmetic”. This has created a lot of attention on the FOM email list. As a subscriber to that list, I would very much like you to send us an account of how you view the consistency of Peano Arithmetic. In particular, how you view the usual mathematical proof that Peano Arithmetic is consistent, and to what extent and in what sense is “the consistency of Peano Arithmetic” a genuine open problem in mathematics. It would also be of interest to hear your conception of what foundations of mathematics is, or should be, or could be, as it appears to be very different from traditional conceptions of the foundations of mathematics.

Respectfully yours,

Harvey M. Friedman
Ohio State University
Distinguished University Professor
Mathematics, Philosophy, Computer Science”

And Voevodsky’s reply:

“Dear Harvey,

such a comment will take some time to write …

“To put it very shortly I think that in-consistency of Peano arithmetic as well as in-consistency of ZFC are open and very interesting problems in mathematics. Consistency on the other hand is not an interesting problem since it has been shown by Goedel to be impossible to proof [sic].

Vladimir.”

I think that this reply still leaves a lot of room for interpretation. It could simply mean that Hilbert’s program is no longer interesting or it could be an call for finitism in foundations or it could indicate the possibility of fruitful mathematics by means of searching for an inconsistency proof of these well established systems.  “Curiouser and curiouser!” Cried Alice …

## Clarity In Talking About The Status Of Attributes

October 13, 2010

When the ontological status of a property or attribute is in question, the central issue is the ontological status of an object’s possessing or exemplifying a property.  When the ideological status of a property or attribute is in question, the central issue are the kinds of predicates that express the property.  The following example brings this out starkly:  A property can be mental, but not physical (ideologically), but can be ontologically physical, but not mental.

If a mental predicate $\textup{A}(x) \in \Psi$ is not lawlike coextensive with a physical predicate $\textup{B}(x) \in \Phi$, where $\Psi$ and $\Phi$ are appropriate vocabularies, the attribute expressed by $\textup{A}(x)$ is mental, but not physical.  Nevertheless, by the principle of physical exhaustion (PE), the attribute is physical, but not mental (ontologically), as it is possessed solely by physical objects.

Entity-wise, every attribute is mathematical-physical, but only those attributes are mathematical-physical that are expressible by mathematical-physical predicates.  So, if physical reductionism is false (which is likely the case), there are attributes which are mathematical-physical entities, but are not mathematical physical attributes.

The confusion arises when terms like “mental” or “material” are used to call out properties or attributes without clearly setting out whether one is talking about the ontological or ideological status of the attribute.  This is an important point by Hellman, and we will see how this distinction and physicalist materialism in general are useful in clarifying questions of reductionism and materialism in the philosophy of mind when we turn to an analysis of Chalmers’ anti-materialist claims.

## The Ontological and Ideological Status of Attributes

October 12, 2010

With the principle of Physical Exhaustion (PE: $(\forall x)(\exists \alpha)(x \in \textup{R}(\alpha))$ where $\textup{R}(\alpha)$ is a rank in the hierarchy of the physical), which allows us to say that everything is exhausted by the physical, every attribute is mathematical-physical (i.e., existing somewhere (possibly high-up) on the set-theoretic hierarchy; see this and this). Thus the ontological status of attributes is mathematical-physical.  Now, for a given vocabulary $\psi$, and for any attribute that expressed by a predicate that makes essential use of members of $\psi$, call that attribute a $\psi$-attribute. So, for example, attributes expressed by physical predicates are physical attributes and those expressed by psychological predicates are psychological. This is their ideological status.

The ontological status of a thing has to do with which extensions of predicates (of ontological kind) under which the thing falls. The most encompassing of such predicates is “is mathematical physical’.  But there are other, narrower ways to distinguish the ontological status of things.  For example, some metaphysical predicates, “is abstract”, “is concrete”, or some scientific ones, “is an elementary particle”, “is an event”, “is a person”, “is a social process”, “is a physical magnitude”, etc. Some other ontological kind predicates have empty extensions: “is a soul”, “is a phenomenally raw feel not identifiable with any entity in the hierarchy of the physical”.  But if something were to satisfy these predicates, the predicates would indicate the ontological kind of these things.  So the important semantic relationship here is satisfaction of ontological kind predicates.

This is different than in the case of the ideological status of attributes, where the important semantic relationship is expression of an attribute by a predicate –i.e., the relationship between the argument and value of a universalizing function. Every entity has an ontological status, but only universals have ideological status determined by the types of predicates for which the universal under consideration is the value of the universalizing function.

So the ideological status of an attribute, is given by the predicates that express it.  These predicates themselves can be classified, for instance, according to scientific discipline, psychological-predicates, physical-predicates, Economic/Sociological-predicates, etc.  These classifications are historical and are subject to change due to a variety of factors –not all of them scientific.  Hellman explains that attributes themselves may have more than one ideological status: for the predicate ‘is in pain at t‘ is coextensive in a law-like fashion with a complex physical predicate then ‘being in pain’ is both a psychological and a physical attribute since it is expressed by both psychological and physical predicates.

In the next update I’ll go into Hellman’s discussion of the confusion that results when the ideological and ideological status of attributes is not clearly stated in debates concerning materialism and the mental.

## Introduction To Hellman’s Treatement of Universals

October 12, 2010

Universals, for our purposes, are sets, predicates, properties, relations and attributes –the same universal can instantiate or subsume numerically distinct things.  Among universals we distinguish between those that are extensional, like sets and predicates and those that are intensional, like properties, relations and attributes.

Roughly, the distinction between these two types of universals is the following.  Those that are extensional obey the principle that equivalence implies identity, while those that are intensional are in violation of this principle.  In cases of non-deformity, the property of being a creature with a kidney is extensionally the same as the property of being a creature with a heart insofar as the same things have each, but the properties are different.  Sets and predicates, on the other hand, do satisfy the principle of extensional equivalence: the set of creatures with a kidney and the set of creatures with a heart have the same members, and are thus identical.

Now, universals in general are taken to fall within the range of functions from the set $\textup{P}$ of predicates of a language $\textup{L}$ to the universal they give expression to $f: \textup{P} \mapsto \textup{U}$, where $\textup{U}$ is the set of universals of $\textup{L}$.  Hellman explains that among such functions there are some that assign universals with much discrimination: two predicates are mapped to the same universal only if the predicates are identical. And others do so with less discrimination: coextensionality is enough. Hellman imagines a partial ordering of universals based on discrimination criteria with predicates being among the most discriminating and extensions among the least.

Since Hellman is concerned with properties and relations used in science, so the first thing we need to do is set up identity criteria for these attributes. For example, we want to say that temperature is the very same magnitude as mean molecular kinetic energy. So two predicates $\textup{F}$ and $\textup{G}$ are mapped to the same universal $u$ just in case it is a scientific necessity that these two predicates apply to the same things.  In other words, $\textup{F}$ and $\textup{G}$ express the same attribute only in case in every model in $\alpha$, $\textup{F}$ and $\textup{G}$ have the same interpretation.  Remember that $\alpha$ is the set of structures modeling scientific possibility.

So, how do we express attributes given this way of thinking about them?  Hellman suggests using the technique from modal logic, such that the function from members of $\alpha$ to the extensions assigned to that predicate by each model in $\alpha$ is identified with the attribute expressed by that predicate.  In this way, two predicates express the same attribute in case they do so in every structure representing a scientific possibility; thereby getting the desired necessity.

If we need to represent universals that discriminate differently than scientific attributes, we can use sets or collections of structures different from $\alpha$ insofar as the universalizing function is no more discriminating than those functions that assign predicates to the same universal in case the predicates are logically equivalent.

For these universals, the identity conditions are the following:  functions (i.e., attributes) are identical just in case they assign the same arguments (i.e., members of $\alpha$) to the same values (i.e., extensions of predicates).   Or simply say that two predicates $\textup{F}$ and $\textup{G}$ express the same attribute if, and only if, $\forall (x_{1}, \dots, x_{n})(\textup{F}x_{1}, \dots, x_{n} \leftrightarrow \textup{G}x_{1}, \dots, x_{n})$ is a law of science.

This last bit will be what links the discussion of attributes to that of reducibility –since we need to make use of explicit definability.

In the next set of notes I’ll go into the difference that Hellman notes between the ideological and ontological status of universals.

## Determination and Definability: Newtonian Mechanics & Statistical Dynamics

September 30, 2010

The last determination-without-reduction example I’ll talk about from Hellman is the one he gives regarding classical particle mechanics and statistical mechanics.   A process is reversible, if it could proceed forward in time as well as backwards (think of playing, in reverse, a video of a model of the orbits of the planets around the sun).  A process is irreversible when it can only proceed in one direction of time and would violate physical law proceeding in the opposite time direction (think of playing, in reverse, a video of a gas escaping a bottle).

Newtonian laws governing motion are time-symmetric and reversible: forward motions of Newtonian systems are on par with motions backwards in time.  Statistical mechanics, on the other hand, attempts to explain irreversible behavior of the higher-level observable phenomena of thermodynamics, like temperature, diffusion, pressure and entropy.  The macroscopic properties of thermodynamics are defined in terms of the phase quantities of Newtonian mechanics with the addition of a measure theoretic probability density function as well as some assumptions a-priori about distribution (e.g., equiprobability of equal volumes of phase space).  For macroscopic properties like entropy, more complex probabilistic concepts come into play: dividing phase space into cells and adding to the mechanical motions the periodical average of the cells, then entropy increases and the distribution density tends uniformly to equilibrium.  This is what the Ehrenfests (Paul and Tanya) called coarse-graining and it’s a method for converting a probability density in phase space into a piece-wise constant function by density averaging in cells in phase space. Coarse-grained densities are needed to avoid paradoxical results concerning how irreversible processes of thermodynamics arise from completely reversible mechanical interactions.

The question Hellman poses is: can the higher-level concepts of thermodynamics be explicitly defined in the language of Newtonian mechanics?  Determination, at least, holds: having fixed any two closed particle systems that are identical at the level of Newtonian mechanics, their higher level behavior (studied by thermodynamics) will be identical.  Each of these systems will be represented by the same trajectory in phase space.  Hellman gives the example of one system entering higher entropy regions at a given time, then the same entropy regions will be entered by the other system.

Definiability on the other hand is more difficult to establish, since the language of classical Newtonian mechanics is not as mathematically robust as that of statistical dynamics.  And ultimately, definability in this case requires a significant change to the language of mechanics: additional vocabulary for measure theory or even set theory to speak of mathematical objects more generally.

We’ve covered some examples of determination without reduction: (1) No explicit definition of the truth predicate $\mathsf{Tr}(x)$ in $\textup{L}$ in spite of  $\textup{L}$-truth and $\textup{L}$-reference determining $\mathsf{Tr}$-truth and $\mathsf{Tr}$-reference, respectively, in $\alpha$-structures; (2) in $\alpha^{\textup{C}}$-structures, $\textup{L}$-reference determines $\textup{DF}arith$-reference, but within this same class of structures, $\textup{L} + \textup{G}(x)$ does not inductively define $\textup{DF}arith$; (3) The mechanical properties of two fixed, closed particle systems determine their macro-level thermodynamic properties without thereby establishing definability, as the language of Newtonian mechanics would have to undergo significant changes incorporating the language, at least, of measure theory.

Next, I’m going to cover an important distinction Hellman makes between the ontological and and ideological status of  properties, relations, attributes, etc. beyond predicates and sets.  After that I’ll go into a detailed, critical, evaluation of some of the anti-materialist claims David Chamers makes in The Conscious Mind: In Search of a Fundamental Theory.

## Hellman’s Second Definability Example

September 27, 2010

Tarski’s theorem shows that the set $\mathsf{Th} (\Omega)^\#$ of code numbers of sentences true in $\Omega$ is not definable.  This has negative consequences for the prospects of aritmetically defining a truth predicate for arithmetic. Nevertheless, Tarski showed how to define truth in terms of satisfaction and by giving an inductive definition of satisfaction beginning with atomic sentences and on up with sentences of higher and higher complexity in terms of the satisfaction of their parts. While a stronger set theory or higher-order logic is still required to convert the inductive definition into an explicit one, Hellman investigates how Det-T and Det-R measure up against this weaker type of definability.

Addison’s theorem establishes that the class of arithmetically definable sets of numbers is itself not an arithmetically definable class of sets.  This means that in the language, $\textup{L}$, of arithmetic extended by a one place predicate $\textup{G}(x)$, no formula $\textup{S}$ is true in $\Omega$ when $\textup{G}(x)$ is assigned a set $\textup{A}$ of numbers such that $\textup{A}$ is definable over $\Omega$.  The proof is involved and is clinched by contradiction on the existence of a generic arithmetical set (I may, or may not, get around to explaining what this is in the next post or so, since it involves explanation of the technique of forcing).

The example turns on this: Addison’s theorem shows that the predicate $\textup{DF}arith$ = ‘set of numbers definable in arithmetic’ is not inductively definable in  arithmetic. Nevertheless, $\textup{DF}arith$ is determined by the primitive predicates of $\textup{L}$.  Set out the following: $\alpha$ is the set of standard $\omega$-models of arithmetic.  Now extend each model $m \in \alpha$ by adding the class $\textup{C}$ of all sets $\textup{X}$ of natural numbers from the domain of $m$ such that $\textup{X}$ is in the extension in $m$ of a formula $\textup{B}(x)$ of $\textup{L}$ with one free variable.  Let $\alpha^{\textup{C}}$ be the class of $\alpha$-structures extended in this way.

So, $\alpha^{\textup{C}}$ contains all the standard models of arithmetic that have standard interpretations of $\textup{DF}arith$. This means that in $\alpha^{\textup{C}}$-structures, $\textup{L}$ reference determines $\textup{DF}arith$ reference but within this same class of structures, $\textup{L} + \textup{G}(x)$ does not inductively define $\textup{DF}arith$.  In spite of this lack of definiability,  Det-R still holds since (and this is all up to isomorphism) any two structures that assign the same interpretations to the primitives of $\textup{L}$ must also assign the same extension to the well-formed-formulas of $\textup{L}$ with only one free variable.  So, up to isomorphism, the same sets of natural numbers are assigned to the distinguished elements of $\textup{C}$

The next example from Hellman is not mathematical, but from classical particle mechanics.  After that I will go into Hellman’s clarification on the difference between the ontological and ideological status of attributes, properties and relations before moving into constructive work on the mental.

## Fun With Robinson Arithmetic

September 17, 2010

in yesterday’s notes I mentioned Robinson Arithmetic ($\mathsf{Q}$) as a subsystem of the axiom system $\textup{T}$ in Hellman’s example. Just because it’s so much fun, let’s talk about $\mathsf{Q}$.  The axioms are listed below.  The dot notation distinguishes between the symbol used and the relation it represents (this notation was used earlier without explanation here and here). $\dot{\mathsf{S}}x$ indicates the successor function that returns the successor of $x$.

## Robinson Arithmetic

$(\textup{S1}) \ \forall x (\neg \dot{0} \ \dot{=} \ \dot{\mathsf{S}}x)$
$(\textup{S2}) \ \forall x \forall y (\dot{\mathsf{S}}x \ \dot{=} \ \dot{\mathsf{S}} y \rightarrow x \dot{=} y)$
$(\textup{L1}) \ \forall x (\neg x \dot{<} \dot{0})$
$(\textup{L2}) \ \forall x \forall y [x \dot{<} \dot{\mathsf{S}}y \leftrightarrow (x \dot{<} y \vee x \dot{=} y)]$
$(\textup{L3}) \ \forall x \forall y [(x \dot{<} y) \vee (x \dot{=} y) \vee (y \dot{<} x])$
$(\textup{A1}) \ \forall x (x \dot{+} \dot{0} \dot{=} x)$
$(\textup{A2}) \ \forall x \forall y [x \dot{+} \dot{\mathsf{S}}y \dot{=} \dot{\mathsf{S}}(x \dot{+} y)]$
$(\textup{M1}) \ \forall x (x \dot{\times} \dot{0} \dot{=} \dot {0})$
$(\textup{M2}) \ \forall x \forall y [(x \dot{\times} \dot{\mathsf{S}}y) \dot{=} (x \dot{\times} y) \dot{+} x]$

These axioms are from Hinman and correspond to what Boolos, Burgess and Jeffrey (in chapter 16 of Computability and Logic) call “minimal arithmetic”. Since the Boolos et al book is so widely studied, here is a map linking both axiomatizations.

$(\textup{S1}) \mapsto 1$
$(\textup{S2}) \mapsto 2$
$(\textup{L1}) \mapsto 7$
$(\textup{L2}) \mapsto 8$
$(\textup{L3}) \mapsto 9$
$(\textup{A1}) \mapsto 3$
$(\textup{A2}) \mapsto 4$
$(\textup{M1}) \mapsto 5$
$(\textup{M2}) \mapsto 6$

This is going to be as confusing as keeping track of names in One Hundred Years of Solitude. Boolos et al compare $\mathsf{Q}$/minimal arithmetic to the system $\mathsf{R}$, which has historically been called “Robinson Arithmetic”.  $\mathsf{R}$ differs from $\mathsf{Q}$ in that it contains,

$(\textup{Q0}) \ \forall x [x \dot{=} \dot{0} \vee (\exists y) (y \dot{=} \dot{\mathsf{S}}y)]$

And it replaces $\textup{L1}$-$\textup{L3}$ with,

$(\textup{Q10}) \ \forall x \forall y [x \dot{<} y \leftrightarrow \exists z (\dot{\mathsf{S}}z \dot{+} x \dot{=} y)$

In their comparison Boolos et al conclude that $\mathsf{Q}$ and $\mathsf{R}$ have a lot in common (e.g., some of the same theorems are provable), but in some cases $\mathsf{R}$ is stronger than $\mathsf{Q}$ –e.g., in the non-standard ordinal model of $\mathsf{Q}$ some simple laws (like $\dot{1} \dot{+} x \dot{=} x \dot{+} \dot{1}$) fail to hold, in addition to $(\textup{Q0})$ and $(\textup{Q10})$.  At the same time, howerver, $\mathsf{Q}$ is in some cases stronger than $\mathsf{R}$.  For example, there is a model (with domain $\omega$ and non standard elements $a$ and $b$ and natural interpretations of $\dot{0}$, $\dot{+}$, $\dot{\times}$, $\dot{\mathsf{S}}x$ of $\mathsf{R}$ where basic laws like $x \dot{<} \dot{\mathsf{S}}x$ fail to hold.

While it’s easier to represent all recursive functions in $\mathsf{Q}$ is than it is to do so in $\mathsf{Q}$ than in $\mathsf{R}$, any one of these will do for Hellman’s example.  What’s interesting is that in theories like $\mathsf{Q}$ and $\mathsf{R}$ which lack an induction schema (and thus fall just short of Peano Arithmetic) the truth predicate is undefinable.

Hopefully in the next update I’ll be able to get to Hellman’s second definability example.

## Hellman’s First Definability Example

September 15, 2010

What Tarski’s Theorem shows is that interpreted formal languages that are interesting (i.e., with enough expressive machinery to represent arithmetic or fragments thereof) cannot contain a predicate whose extension is the set of code numbers (e.g., $\mathsf{Th}(\Omega)^\#$) of sentences true in the interpretation.  The extension of any proposed truth predicate in such a system escapes the definitional machinery of the system.  Of course, the truth predicate for first-order arithmetic can be defined with appeal to  a stronger system, like second-order arithmetic, in the case of the Peano Axioms, etc.

Hellman’s first example is the following.  It is a corollary of Tarski’s theorem that a theory in the language, $\textup{L}$, of arithmetic (e.g., an axiom system $\textup{T}$ containing Robinson Arithmetic ($\mathsf{Q}$)) with symbols for zero, successor, addition, and multiplication, when extended with a one place predicate, $\mathsf{Tr}(x)$ (read “true in arithmetic” such that for each closed sentence $\textup{S}$ in $\textup{L}$ a new axiom of the form $\ulcorner \mathsf{Tr}(n) \leftrightarrow \textup{S}\urcorner$ (where $n$ is the numeral for a code number for the sentence $\textup{S}$), the resulting theory $\textup{T}^{*}$ contains no explicit definition of  $\mathsf{Tr}(x)$ in $\textup{L}$.

Connecting this to our ongoing discussion of determination of truth and reference in special collections of models, suppose that $\alpha$ is the class of standard $\omega$-models of $\textup{T}^{*}$.  Then we have:

• In $\alpha$-structures $\textup{L}$-truth determines $\mathsf{Tr}$-truth.
• In $\alpha$-structures $\textup{L}$-reference determines $\mathsf{Tr}$-reference

Which means that once you have the arithmetical truths in the class $\alpha$, then so are the ‘true-in-arithmetic’ truths and the same goes for the reference of the vocabularies.  To avoid collapsing to reductionism via Beth’s theorem, note that there is no first-order theory (like those under discussion) in a language with finitely many non-logical symbols has as it’s models just the models in in $\alpha$.

If you extend $\alpha$ to $\alpha^{*}$ containing all models of $\textup{T}^{*}$, then you do get reductionism, since determination of reference in $\alpha^{*}$ amounts to implicit definability in $\textup{T}^{*}$ -thus showing that there exist non-standard models of arithmetic.

This is a good example because it is clear, based on popular, well established results and firmly shows how determination of truth and reference in one core theory carry over to it’s extension, without thereby reducing the extension to the core.

In the next update I’ll discuss Hellman’s second definability example.

## Tarski’s Theorem

September 14, 2010

Today we’re going to follow Hinman’s proof of Tarski’s theorem. The proof is by contradiction, and employs diagonalization. First, assuming clauses (i)-(iii) on definability, a universal $\textup{U}$-section for the class of $\Omega$-definable sets is established and it’s diagonal is shown to not be definable over $\Omega$.

A $\textup{U}$-section is a set defined for any set $\textup{A}$ and any relation $\textup{U} \subseteq \textup{A} \times \textup{A}$ such that for each $a \in \textup{A}$, $\textup{A}_{a} := \{b : \textup{U}(a, b)\}$$\textup{U}$ is universal for a class $\mathcal{C} \subseteq \wp (\textup{A})$ if, and only if, every member of the class $\mathcal{C}$ is a $\textup{U}$-section.  The diagonal set of $\textup{U}$ is $\textup{D}_{\textup{U}} := \{a : \textup{U}(a, a)\}$.

Second, assuming the definability of $\mathsf{Th}(\Omega)^{\#}$, there is a formula $\phi (y)$ such that for all $p$, $p \in \mathsf{Th}(\Omega)^{\#} \Longleftrightarrow \phi (\dot{p}) \in \mathsf{Th}(\Omega)$.  But since the function $\mathsf{Sb}$ is effectively computable, it is definable  and so, $\mathsf{Sb}(m) = p \Longleftrightarrow \psi (\dot{m}, \dot{p}) \in \mathsf{Th}(\Omega)$, for some $\psi (x, y)$.  But this means that,

$m \in \textup{D}_{\textup{U}} \Longleftrightarrow \exists p [\phi(\dot{p}) \in \mathsf{Th}(\Omega)$ and $\psi(\dot{m}, \dot{p}) \in \mathsf{Th}(\Omega)]$

$m \in \textup{D}_{\textup{U}} \Longleftrightarrow \exists y [\phi(y) \wedge \psi(\dot{m}, y)] \in \mathsf{Th}(\Omega)$,

which means that $\textup{D}_{\textup{U}}$ is definable.  This is a contradiction.  So, $\mathsf{Th}(\Omega)^{\#}$ is not definable and not effectively countable.  Nor is $\mathsf{Th}(\Omega)$ effectively countable.

In the next update (probably on a plane!) I’ll discuss this theorem and get into Hellman’s example.


text:
You've successfully subscribed to The Poor Coder | Hackerrank Solutions
Great! Next, complete checkout for full access to The Poor Coder | Hackerrank Solutions
Welcome back! You've successfully signed in.

Beeze Aal

Classes define new types in C++. Types in C++ not only interact by means of constructions and assignments but also via operators. For example:

int a=2, b=1, c;
c = b + a;

The result of variable c will be 3.
Similarly, classes can also perform operations using operator overloading. Operators are overloaded by means of operator functions, which are regular functions with special names. Their name begins with the operator keyword followed by the operator sign that is overloaded. The syntax is:type operator sign (parameters) { /*... body ...*/ }

You are given a main() function which takes a set of inputs to create two matrices and prints the result of their addition. You need to write the class Matrix which has a member a of type vector<vector<int> >. You also need to write a member function to overload the operator +. The function's job will be to add two objects of Matrix type and return the resultant Matrix.

Input Format.

First line will contain the number of test cases . For each test case, there are three lines of input.

The first line of each test case will contain two integers  and  which denote the number of the rows and columns respectively of the two matrices that will follow on the next two lines. These next two lines will each contain  elements describing the two matrices in row-wise format i.e. first  elements belong to the first row,next  elements belong to the second row and so on.

Constraints

, where  is the element in the  row and  column of the matrix.

Output Format

The code provided in the editor will use your class  and overloaded operator function to add the two matrices and give the output.

Sample Input

1
2 2
2 2 2 2
1 2 3 4

Sample Output

3 4
5 6

Explanation

The sum of first matrix and the second matrix is the matrix given in the output.

### Solution in cpp

Approach 1.

class Matrix{
public:
vector<vector<int> > a;

Matrix & operator + (const Matrix &y) {

for (int m=0; m<y.a.size(); ++m) {
for (int n=0; n<y.a[0].size(); ++n) {
this->a[m][n] = this->a[m][n] + y.a[m][n];
}
}

return *this;
}
};

Approach 2.

class Matrix
{
public:
vector<vector<int>> a;

Matrix & operator + (const Matrix &y)
{
for (int m=0; m<y.a.size(); ++m)
{
for (int n=0; n<y.a[0].size(); ++n)
{
this->a[m][n] = this->a[m][n] + y.a[m][n];
}
}

return *this;
}
};

Approach 3.

class Matrix {
public:
vector<vector<int> > a;
Matrix operator+(const Matrix& b){
Matrix mat;
int n=a.size();int m=a[0].size();
for(int i=0;i<n;++i) {
mat.a.push_back(vector<int>());
for(int j=0;j<m;++j) {
mat.a[i].push_back(this->a[i][j]+b.a[i][j]);
}
}
return mat;
}
};


text:
# ViSiElSe Step by Step

## Few words about ViSiElse

ViSiElse is a graphical tool designed to visualize and to give an overview of behavioral observations realized on individuals and/or groups. ViSiElse allows visualization of raw data extracted from experimental observations (behavioral studies). For example during the realization of a procedure like a medical algorithm. It graphically presents an overview of individuals and group actions usually acquired from timestamps during video recorded sessions. Options of the package allow adding graphical information as statistical indicators (mean, standard deviation, quantiles or statistical tests) but also for each action green or black zones providing visual information about the accuracy of the realized actions.

# A step by step example

Let’s say we want to look at people making coffee. On the basis of this simple example everybody could experience, we are presenting how to create the corresponding simulated data in order to provide a simple and clear overview of this package.

## The process : Making coffee

The process underlying making coffee corresponds to a 5 steps procedure.

• 1- Taking the coffee (named “coffee”)
• 2- Fill the machine with coffee (named “fill_coffee”)
• 3- Fill the tank with water (named “fill_water”)
• 4- Push the Button (named “push-B”)
• 5- Drink the coffee (named “drink”)

All those actions are defined as punctual.

## The Dataset

If people were actually making coffee, we will record when they do each punctual actions and stock it as a data.frame. In addition this data.frame must have a column to identify individuals.

coffee <- c(  58, 11, 5, 53, 53, 59, 24, 59, 46, 20)
fill_coffee <- c(162, 57, 103, 154, 165, 132, 74, 107, 104,  93)
fill_water <- c(  66,  92, 54, 78, 74, 114, 91, 129, 71, 56)
push_B <- c( 74, 99, 62, 84, 83, 120, 95, 129, 80, 63 )
drink <- c( 472, 176, 475, 283, 265, 207, 234, 184, 490, 520)
X <- data.frame(id = seq(1,10), coffee, fill_coffee,fill_water,push_B,drink)
head(X)
##   id coffee fill_coffee fill_water push_B drink
## 1  1     58         162         66     74   472
## 2  2     11          57         92     99   176
## 3  3      5         103         54     62   475
## 4  4     53         154         78     84   283
## 5  5     53         165         74     83   265
## 6  6     59         132        114    120   207

## First plot

Executions of punctual actions are distributed on the axis of time divided in intervals. The amount of individuals having done the action during an interval is represented by intensity of color.

By default :

• The order of Actions in the process is given by columns of the dataset
• Pixel of time is set to 20
• The time units are seconds
• Median and quartiles are drawn
## Loading required package: grid
## Loading required package: chron
## Loading required package: Matrix
## Loading required package: colorspace
## Loading required package: stringr
visi1 <- visielse(X)

Actions are represented on the graphic one under the other. Their executions are distributed along the time axis. A drawn rectangle means that at least one individual has done the action in this interval of time. More a rectangle is drawn dark; more individuals have done this action at this moment.

### The parameter : pixel

For punctual actions, time is divided by intervals of sizes given by the parameter pixel (by default a pixel corresponds to 20 seconds). Data are aggregated into those intervals. For punctual actions, the graphic produced by ViSiElSe represents how many people have done an action in each pixel of time. When this parameter pixel is too large the represented information will be too much aggregated to allow interpretation. Otherwise, when this parameter pixel is too small the represented information will not be enough aggregated to allow interpretation.

#### Changing the pixel of time : smaller

visi1 <- visielse(X, pixel = 5)

#### Changing the pixel of time : larger

visi1 <- visielse(X, pixel = 80)

### Indicators

To help interpretation, ViSiElse proposes by default to plot as white circles median and quartiles, it is also possible to plot mean and standard deviation or nothing at all.

#### Plot Mean and standard deviation

visi1 <- visielse(X,informer = "mean")

#### Do not plot indicators

visi1 <- visielse(X,informer = NULL)

## The ViSibook

The ViSibook is an object containing informations on the studied behavioral process whereas the dataset contains its realizations. This ViSibook contains the structure of the behavioral process: list of actions composing it, constraints of times… When it is not manually defined, the function visielse computes the ViSibook associated this the dataset assuming the process is the ordered list of punctual actions given by the dataset columns names. Also, it is possible to extract the ViSibook from an execution of the visielse function.

### Extraction of the ViSibook from the data

visi1 <- visielse(X,informer = NULL, doplot = FALSE)
book <- visi1@book
plot(book)

The ViSibook obtained orders action as they appear in the dataset X.

### Structure of a ViSibook

A ViSibook is a class of object, and it must follow structural rules. Basically it is a data.frame with particular columns. The minimum structure for a ViSibook must give for each action its name (without special characters but " _ " ), its label, its type (punctual or long), its order in the behavioral process, and two other information “deb” and “fin”, that should not be specified for punctual actions.

Explanations about how to deal with “deb” and “fin” will be given later.

book
##      vars          label         typeA showorder deb fin
## [1,] "coffee"      "coffee"      "p"   "1"       NA  NA
## [2,] "fill_coffee" "fill_coffee" "p"   "2"       NA  NA
## [3,] "fill_water"  "fill_water"  "p"   "3"       NA  NA
## [4,] "push_B"      "push_B"      "p"   "4"       NA  NA
## [5,] "drink"       "drink"       "p"   "5"       NA  NA

#### Changing labels

When producing an output, it is often preferred to use label instead of names of variables. By default, labels are the names of variables which are the dataset colnames, but labels can be changed and functions plot.ViSigrid and plot.ViSibook use labels for drawings.

book[,2] <- c("Taking the coffee",
"Fill the machine with coffee",
"Fill the tank with water",
"Push the Button",
"Drink the coffee")
book
##      vars          label                          typeA showorder deb fin
## [1,] "coffee"      "Taking the coffee"            "p"   "1"       NA  NA
## [2,] "fill_coffee" "Fill the machine with coffee" "p"   "2"       NA  NA
## [3,] "fill_water"  "Fill the tank with water"     "p"   "3"       NA  NA
## [4,] "push_B"      "Push the Button"              "p"   "4"       NA  NA
## [5,] "drink"       "Drink the coffee"             "p"   "5"       NA  NA
plot(book)

visi1 <- visielse(X, book=book, is.ViSibook = TRUE,informer = NULL)

### Order of Actions in the process

As explained above, the order is given by “showorder”. It is the order by which actions are supposed to happen. As long as an order is set, it does not affect calculation, it only change where it is plotted.

#### Change the order

book[,4]<- c(5,1,2,4,3)
plot(book)

visi1 <- visielse(X, book=book, is.ViSibook = TRUE)

## Long Actions

Until now we had only considered punctual actions. However ViSiElse considers two different types of actions: punctual and long. The actions called punctual are brief actions defined as time points, like “Push the button”.

The actions called long (or delays) are the ones defined by a duration. Delays or long actions can be helpful to understand a behavioral process. They are characterized by both a beginning punctual action and an ending one. To define a long action there is no need to change the dataset, only to add a line in the ViSibook. The slot typeA in the ViSibook specifies if the action is punctual (“p”) or long (“l”).

#### Adding a long Actions

Let’s add an action measuring the time between filling the machine with coffee and pushing the button. For that, we convert the ViSibook into a data.frame and add a line for the new action.

visi1 <- visielse( X )

book <- ConvertFromViSibook( visi1@book ) # Convert book into data.frame
add_delay <- c( "delay_coffee_push","Preparation","l","6","coffee","push_B")
book
##                vars       label typeA showorder    deb    fin
## 1            coffee      coffee     p         1   <NA>   <NA>
## 2       fill_coffee fill_coffee     p         2   <NA>   <NA>
## 3        fill_water  fill_water     p         3   <NA>   <NA>
## 4            push_B      push_B     p         4   <NA>   <NA>
## 5             drink       drink     p         5   <NA>   <NA>
## 6 delay_coffee_push Preparation     l         6 coffee push_B

### ViSiElse representation of long actions

ViSiElse represents each individual execution of a long action as an horizontal line when it is done.

visi2 <- visielse( X=X , book=book,informer=NULL)

## Green & Black zones

### Punctual actions

Green and black zone are introduced to help visualize time boundaries. To define green and black zone for punctual actions we will add the columns :

• Green Zone: GZDeb and GZFin.
• Black zone 1: BZBeforeDeb and BZBeforeFin.
• Black zone 2: BZAfterDeb and BZAfterFin.

#### Fill coffee in the machine should be done between 1min and 2min

book$GZDeb <- c(NA,60,NA,NA,NA,NA) book$GZFin <- c(NA,120,NA,NA,NA,NA)
visi2 <- visielse( X=X , book=book,informer=NULL)

#### Fill coffee in the machine should not be done before 30s

book$GZDeb <- c(NA,NA,NA,NA,NA,NA) book$GZFin <- c(NA,NA,NA,NA,NA,NA)
book$BZBeforeDeb <- c(NA,0,NA,NA,NA,NA) book$BZBeforeFin <- c(NA,30,NA,NA,NA,NA)
visi2 <- visielse( X=X , book=book,informer=NULL)

#### Fill coffee in the machine should be done between the second 1min and 2 min but not before 30s or after 3min

book$GZDeb <- c(NA,60,NA,NA,NA,NA) book$GZFin <- c(NA,120,NA,NA,NA,NA)
book$BZBeforeDeb <- c(NA,0,NA,NA,NA,NA) book$BZBeforeFin <- c(NA,30,NA,NA,NA,NA)
book$BZAfterDeb <- c(NA,180,NA,NA,NA,NA) book$BZAfterFin <- c(NA,Inf,NA,NA,NA,NA)
visi2 <- visielse( X=X , book=book,informer=NULL)

### Long Action

ViSiElSe allows representation of two types of black zone for long actions:

• A deadline not to cross : “span”
• A duration not to exceed : “time”

#### The preparation should be done at 1min

visi1 <- visielse( X,  doplot = FALSE )
book <- ConvertFromViSibook( visi1@book ) # Convert book into data.frame
add_delay <- c( "delay_coffee_push","Preparation","l","6","coffee","push_B")
book$BZLong <- c(rep(NA,5),60) book$BZLtype <- c(rep(NA,5),"time")
visi1 <- visielse( X, book=book , informer = NULL)

#### The preparation should not last more than 30s

book$BZLong <- c(rep(NA,5),30) book$BZLtype <- c(rep(NA,5),"span")
visi1 <- visielse( X, book=book ,informer = NULL)

## Group

It might be useful to distinguish groups in the drawing. To define two groups you need to:

• Add a vector containing the group for each individuals
• Select a method of visualizing groups

ViSiElse proposes three methods to plot two groups:

• Each groups is represented one under the other with different colors : “cut”
• Groups are spatially mixed but they are represented by different colors : “join”
• All individuals executions are represented and under executions of the selected group : “within”

### Method : Cut

Each groups is represented one under the other.

group <- c( "group2","group1","group2","group1","group1","group2","group1","group1","group1","group2")
visi1 <- visielse( X,group=group, book=book ,informer = NULL, method = "cut")

### Method : Join

Groups are spatially mixed but they are represented by different colors.

group <- c( "group1","group1","group1","group1","group1","group2","group2","group2","group2","group2")
visi1 <- visielse( X,group=group, book=book ,informer = NULL, method = "join")

### Method : Within

When using the method “Within”, for each action, under the representation of all individuals are represented executions of individuals from the group selected by the parameter grwithin.

group <- c( "group2","group1","group2","group1","group1","group2","group1","group1","group1","group2")
visi1 <- visielse( X,group=group, book=book ,informer = NULL, method = "within",grwithin = "group1")

If you have any question mail it to elodie.garnier@chu-reunion.fr


text:
# New Year's Countdown Day 15: Anti-magical Diagonals

Algebra Level 5

Define a heterosquare to be a square grid containing consecutive positive integers starting from 1 such that the sums of the integers in each row, column, and long diagonal are all different. Furthermore, define an anti-magic square to be a heterosquare whose sums form a consecutive sequence of integers.

If there exists a $15 \times 15$ anti-magic square, then there are $n$ possible values $d_1, d_2, \dots, d_n$ for the sum of its two diagonal sums. Find the value of $n \displaystyle \sum_{i = 1}^n d_i.$

Note: A diagonal sum is the sum of the numbers along a long diagonal of the square. For example, the two diagonal sums of the following square are $1 + 5 + 9 = 15$ and $3 + 5 + 7 = 15:$ $\begin{array}{|c|c|c|} \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline \end{array}$

×

Problem Loading...

Note Loading...

Set Loading...


text:
TH Preprints

2016-02-11
08:20
 Oscillating propagators in heavy-dense QCD / Akerlund, Oscar ; de Forcrand, Philippe ; Rindlisbacher, Tobias Using Monte Carlo simulations and extended mean field theory calculations we show that the $3$-dimensional $\mathbb{Z}_3$ spin model with complex external fields has non-monotonic correlators in some regions of its parameter space. [...] arXiv:1602.02925 ; CERN-PH-TH-2016-030. - 2016. - 10 p. Preprint - Full text

2016-02-02
07:36
 Specialized minimal PDFs for optimized LHC calculations / Carrazza, Stefano (Milan U. ; INFN, Milan ; CERN) ; Forte, Stefano (Milan U. ; INFN, Milan) ; Kassabov, Zahari (Milan U. ; INFN, Milan ; Turin U. ; INFN, Turin) ; Rojo, Juan (Oxford U., Theor. Phys.) We present a methodology for the construction of parton distribution functions (PDFs) designed to provide an accurate representation of PDF uncertainties for specific processes or classes of processes with a minimal number of PDF error sets: specialized minimal PDF sets, or SM-PDFs. [...] arXiv:1602.00005 ; CERN-PH-TH-2015-243 ; TIF-UNIMI-2015-13 ; OUTP-15-24P. - 2016. - 30 p. Preprint - Full text

2016-01-18
07:39
 Aspects of topological actions on the lattice / Akerlund, Oscar (Zurich, ETH) ; de Forcrand, Philippe (Zurich, ETH ; CERN) We consider a lattice action which forbids large fields, and which remains invariant under smooth deformations of the field. [...] arXiv:1601.03905 ; CERN-PH-TH-2015-309. - 2016. - 7 p. Preprint - Full text

2016-01-18
07:38
 Research infrastructures in the LHC era: a scientometric approach / Carrazza, Stefano (CERN) ; Ferrara, Alfio (U. Milan (main)) ; Salini, Silvia (U. Milan (main)) When a research infrastructure is funded and implemented, new information and new publications are created. [...] arXiv:1601.03746 ; CERN-PH-TH-2015-246 ; TIF-UNIMI-2015-17. - 2016. - 39 p. Preprint - Full text

2016-01-16
08:21
 Statistical anisotropy from inflationary magnetogenesis / Giovannini, Massimo (CERN ; INFN, Milan Bicocca) Provided the quantum fluctuations are amplified in the presence of a classical gauge field configuration the resulting curvature perturbations exhibit a mild statistical anisotropy which should be sufficiently weak not to conflict with current observational data. [...] arXiv:1601.03556 ; CERN-PH-TH-2015-196. - 2016. - 27 p. Preprint - Full text

2016-01-08
07:48
 Mean distribution approach to spin and gauge theories / Akerlund, Oscar (Zurich, ETH) ; de Forcrand, Philippe (Zurich, ETH ; CERN) We formulate self-consistency equations for the distribution of links in spin models and of plaquettes in gauge theories. [...] arXiv:1601.01175 ; CERN-PH-TH-2015-291. - 2016. - 11 p. Preprint - Full text

2015-12-29
07:27
 Origins of the di-jet asymmetry in heavy ion collisions / Milhano, José Guilherme (Lisbon, CENTRA ; CERN) ; Zapp, Korinna Christine (Lisbon, CENTRA ; CERN) The di-jet asymmetry --- the measure of the momentum imbalance in a di-jet system --- is a key jet quenching observable. [...] arXiv:1512.08107 ; CERN-PH-TH-2015-310 ; MCNET-15-31. - 2015. - 10 p. Preprint - Full text

2015-12-26
07:26
 Golden Probe of the Top Yukawa / Chen, Yi (Caltech) ; Stolarski, Daniel (CERN) ; Vega-Morales, Roberto (CAFPE, Granada) We describe how the Higgs decay to four leptons can be used to probe the nature and $CP$ structure of the top Yukawa coupling.. arXiv:1512.07859 ; CAFPE 188-15 ; CERN-PH-TH-2015-301 ; UG-FT 318-15. - 2015. - 5 p. Preprint - Full text

2015-12-26
07:26
 Theory Motivation For Exotic Signatures: Prospects and Wishlist for Run II / Stolarski, Daniel (CERN) Here I give some motivations for exotic signatures to search for at Run II of the LHC, focusing on displaced phenomena. [...] arXiv:1512.07857 ; CERN-PH-TH-2015-300. - 2015. - 5 p. Preprint - Full text

2015-12-24
08:39
 Comments on the nilpotent constraint of the goldstino superfield / Ghilencea, D M (CERN ; Bucharest, IFIN-HH) Superfield constraints were often used in the past, in particular to describe the Akulov-Volkov action of the goldstino by a superfield formulation with $L=(\Phi^\dagger \Phi)_D + [(f\Phi)_F + h.c.]$ endowed with the nilpotent constraint $\Phi^2=0$ for the goldstino superfield ($\Phi$). [...] arXiv:1512.07484 ; CERN-PH-TH-2015-292. - 2015. - 16 p. Preprint - Full text


text:
How do you simplify 6n-4+n?

Oct 25, 2016

$6 n - 4 + n = \textcolor{g r e e n}{7 n - 4}$

Explanation:

Combine terms with identical variable components:
$6 n - 4 + n$
$\textcolor{w h i t e}{\text{XXX}} = 6 n + n - 4$

$\textcolor{w h i t e}{\text{XXX}} = 7 n - 4$

Things you might have had problems with:

[1] Note that $- 4 + n \ne - \left(4 + n\right)$
Standard evaluation is from left to right, so the $4$ is subtracted but the $n$ is added (without the parentheses).

[2] Sometimes when starting out people have trouble seeing why $6 n + n = 7 n$

Think of it in concrete terms:
$\textcolor{w h i t e}{\text{XXX}}$Suppose we have boxes of yoyos.
$\textcolor{w h i t e}{\text{XXX}}$We know every box has the same number of yoyos although we are not sure how many this is.
$\textcolor{w h i t e}{\text{XXX}}$Since we don't know how many there are in each box, we just call this number $n$.
$\textcolor{w h i t e}{\text{XXX}}$Then $6$ boxes of yoyos would be $6 \times n$ (commonly written as $6 n$) yoyos.
$\textcolor{w h i t e}{\text{XXX}}$If we add another box of yoyos we would have $7$ boxes (each with $n$ yoyos) for a total of $7 \times n$ (or $7 n$) yoyos.


text:
## Pagen13 one year ago Can someone help me with a few questions??! I have issues with slope!

1. kropot72

Can you post one of the questions.

2. Pagen13

What is the slope of the line that passes through the given points? (3,2) and (5,12) a. 5 b. -5 c. -1/5 d. 1/5

3. hartnn

The slope of the line through points (x1,y1) and (x2,y2) is given by : $$\huge m=\frac{y_1-y_2}{x_1-x_2}$$ now,just put the values and find m.

4. hartnn

in your question, x1= 3 y1 = 2 x2 =5 y2 =12

5. Pagen13

so 2-12/3-5

6. hartnn

yes don't forget the brackets (2-12)/(3-5)

7. Pagen13

-10/-2=5

8. hartnn

good! $$\huge \checkmark$$

9. Pagen13

Can you help with some more?

10. hartnn

sure :)

11. Pagen13

What is the graph of the equation? 2x-y=2

12. hartnn

it would be a line. to get the intercepts of that line plug in x= 0, find y plug in y= 0 find x

13. Pagen13

14. Pagen13

How do I plug it in? Sorry I am lost..

15. hartnn

2x- y =2 to get x intercept, we put y =0 2x = 2 x =1 so x intercept is 1,0 can you now find y intercept ? put x= 0 in 2x-y =2

16. Pagen13

y=0

17. hartnn

-y = 2 so y =-2 y intercept is 0,-2

18. hartnn

now the points 1,0 and 0,-2 should lie on the graph. which graph has these 2 points?

19. Pagen13

C

20. hartnn

correct :)

21. Pagen13

Write an equation of the line, in point slope form that passes through the two given points: (-2,15) and (9,-18) a.y-2=-3(x-15) b.y-2=-1/3(x+15) c.y-15=-3(x+2) d.y-15=-1/3(x+2)

22. hartnn

first find the slope using the above formula. x1 = -2 y1 = 15 x2 = 9 y2 = -18

23. Pagen13

-11/33=3

24. hartnn

-11/33 is -1/3

25. Pagen13

Oh yeah sorry..

26. hartnn

so the equation would be y-y1 = m (x-x1) y -15 = -1/3 (x+2)

27. Pagen13

Thank you! I have 8 more can you help? I am starting to understand!