text:
# 40 CFR § 1066.605 - Mass-based and molar-based exhaust emission calculations.

§ 1066.605 Mass-based and molar-based exhaust emission calculations.

(a) Calculate your total mass of emissions over a test cycle as specified in paragraph (c) of this section or in 40 CFR part 1065, subpart G, as applicable.

(b) See the standard-setting part for composite emission calculations over multiple test intervals and the corresponding weighting factors.

(c) Perform the following sequence of preliminary calculations to correct recorded concentration measurements before calculating mass emissions in paragraphs (e) and (f) of this section:

(1) For vehicles above 14,000 pounds GVWR, correct all THC and CH4 concentrations for initial contamination as described in 40 CFR 1065.660(a), including continuous readings, sample bag readings, and dilution air background readings. This correction is optional for vehicles at or below 14,000 pounds GVWR.

(2) Correct all concentrations measured on a “dry” basis to a “wet” basis, including dilution air background concentrations.

(3) Calculate all NMHC and CH4 concentrations, including dilution air background concentrations, as described in 40 CFR 1065.660.

(4) For vehicles at or below 14,000 pounds GVWR, calculate HC concentrations, including dilution air background concentrations, as described in this section, and as described in § 1066.635 for NMOG. For emission testing of vehicles above 14,000 pounds GVWR, with fuels that contain 25% or more oxygenated compounds by volume, calculate THCE and NMHCE concentrations, including dilution air background concentrations, as described in 40 CFR part 1065, subpart I.

(5) Correct all gaseous concentrations for dilution air background as described in § 1066.610.

(6) Correct NOX emission values for intake-air humidity as described in § 1066.615.

(7) Correct all PM filter masses for sample media buoyancy as described in 40 CFR 1065.690.

(d) Calculate g/mile emission rates using the following equation unless the standard-setting part specifies otherwise:

$\begin{array}{c}{e}_{\left[\mathrm{emission}\right]}-\frac{{m}_{\left[\mathrm{emission}\right]}}{D}\\ \text{Eq. 1066.605-1}\end{array}$

Where:
e[emission] = emission rate over the test interval.
m[emission] = emission mass over the test interval.
D = the measured driving distance over the test interval.
Example:
mNOx = 0.3177 g
DHFET = 10.19 miles

${e}_{\mathrm{NOx}}=\frac{0.3177}{10.19}=0.0312\phantom{\rule{0ex}{0ex}}g/\mathrm{mi}$

(e) Calculate the emission mass of each gaseous pollutant using the following equation:

$\begin{array}{c}{m}_{\left[\mathrm{emission}\right]}={V}_{\mathrm{mix}}·{\rho }_{\left[\mathrm{emission}\right]}·{x}_{\left[\mathrm{emission}\right]}·c\\ \text{Eq. 1066.605-2}\end{array}$

Where:
m[emission] = emission mass over the test interval.
Vmix = total dilute exhaust volume over the test interval, corrected to standard reference conditions, and corrected for any volume removed for emission sampling and for any volume change from adding secondary dilution air.
p[emission] = density of the appropriate chemical species as given in § 1066.1005(f).
x[emission] = measured emission concentration in the sample, after dry-to-wet and background corrections.
c = 10−2 for emission concentrations in %, and 10−6 for emission concentrations in ppm.
Example:
Vmix = 170.878 m 3 (from paragraph (f) of this section)
rNOx = 1913 g/m 3
xNOx = 0.9721 ppm
c = 10−6
mNOx = 170.878·1913·0.9721·10−6 = 0.3177 g

(f) Calculation of the emission mass of PM, mPM, is dependent on how many PM filters you use, as follows:

(1) Except as otherwise specified in this paragraph (f), calculate mPM using the following equation:

$\begin{array}{c}{m}_{\mathrm{PM}}=\left(\frac{{V}_{\mathrm{mix}}}{{V}_{\mathrm{PMstd}}-{V}_{\mathrm{sdastd}}}\right)·\left({m}_{\mathrm{PMfil}}-{m}_{\mathrm{PMbkgnd}}\right)\\ \text{Eq. 1066.605-3}\end{array}$

Where:
mPM = mass of particulate matter emissions over the test interval, as described in § 1066.815(b)(1), (2), and (3).
Vmix = total dilute exhaust volume over the test interval, corrected to standard reference conditions, and corrected for any volume removed for emission sampling and for any volume change from adding secondary dilution air. For partial-flow dilution systems, set Vmix equal to the total exhaust volume over the test interval, corrected to standard reference conditions.
VPMstd = total volume of dilute exhaust sampled through the filter over the test interval, corrected to standard reference conditions.
Vsdastd = total volume of secondary dilution air sampled through the filter over the test interval, corrected to standard reference conditions. For partial-flow dilution systems, set Vsdastd equal to total dilution air volume over the test interval, corrected to standard reference conditions.
mPMfil = mass of particulate matter emissions on the filter over the test interval.
mPMbkgnd = mass of particulate matter on the background filter.
Example:
Vmix = 170.878 m 3 (from paragraph (g) of this section)
VPMstd = 0.925 m 3 (from paragraph (g) of this section)
Vsdastd = 0.527 m 3 (from paragraph (g) of this section)
mPMfil = 0.0000045 g
mPMbkgnd = 0.0000014 g

${m}_{\mathrm{PM}}=\left(\frac{170.878}{0.925-0.527}\right)×\left(0.0000045-0.0000014\right)=0.00133\phantom{\rule{0ex}{0ex}}g$

(2) If you sample PM onto a single filter as described in § 1066.815(b)(4)(i) or (b)(4)(ii) (for constant volume samplers), calculate mPM using the following equation:

$\begin{array}{c}{m}_{\mathrm{PM}}-\left(\frac{{V}_{\mathrm{mix}}}{\frac{\left({V}_{\text{ct-PMstd}}-{V}_{\text{ct-sdastd}}\right)}{0.43}+\left({V}_{\text{s-PMstd}}-{V}_{\text{s-sdastd}}\right)+\frac{\left({V}_{\text{ht-PMstd}}-{V}_{\text{ht-sdastd}}\right)}{0.57}}\right)·\left({m}_{\mathrm{PMfil}}-{m}_{\mathrm{PMbkgnd}}\right)\\ \text{Eq. 1066.605-4}\end{array}$

Where:
mPM = mass of particulate matter emissions over the entire FTP.
Vmix = total dilute exhaust volume over the test interval, corrected to standard reference conditions, and corrected for any volume removed for emission sampling and for any volume change from adding secondary dilution air.
V[interval]-PMstd = total volume of dilute exhaust sampled through the filter over the test interval (ct = cold transient, s = stabilized, ht = hot transient), corrected to standard reference conditions.
V[interval]-sdastd = total volume of secondary dilution air sampled through the filter over the test interval (ct = cold transient, s = stabilized, ht = hot transient), corrected to standard reference conditions.
mPMfil = mass of particulate matter emissions on the filter over the test interval.
mPMbkgnd = mass of particulate matter on the background filter over the test interval.
Example:
Vmix = 633.691 m 3
Vct-PMstd = 0.925 m 3
Vct-sdastd = 0.527 m 3
Vs-PMstd = 1.967 m 3
Vs-sdastd = 1.121 m 3
Vht-PMstd = 1.122 m 3
Vht-sdastd = 0.639 m 3
mPMfil = 0.0000106 g
mPMbkgnd = 0.0000014 g

${m}_{\mathrm{PM}}=\left(\frac{633.691}{\frac{\left(0.925-0.527\right)}{0.43}+\left(1.967-1.121\right)+\frac{\left(1.122-0.639\right)}{0.57}}\right)·\left(0.0000106-0.0000014\right)$

mPM = 0.00222 g

(3) If you sample PM onto a single filter as described in § 1066.815(b)(4)(ii) (for partial flow dilution systems), calculate mPM using the following equation:

$\begin{array}{c}{m}_{\mathrm{PM}}=\left(\frac{\frac{0.43·{V}_{\text{ct-exhstd}}}{{V}_{\text{ct-PMstd}}-{V}_{\text{ct-dilstd}}}+\frac{{V}_{\text{s-exhstd}}}{{V}_{\text{s-PMstd}}-{V}_{\text{s-dilstd}}}+\frac{0.57·{V}_{\text{ht-exhstd}}}{{V}_{\text{ht-PMstd}}-{V}_{\text{ht-dilstd}}}}{3}\right)·\left({m}_{\mathrm{PMfil}}-{m}_{\mathrm{PMbkgnd}}\right)\\ \text{Eq. 1066.605-5}\end{array}$

Where:
mPM = mass of particulate matter emissions over the entire FTP.
V[interval]-exhstd = total engine exhaust volume over the test interval (ct = cold transient, s = stabilized, ht = hot transient), corrected to standard reference conditions, and corrected for any volume removed for emission sampling.
V[interval]-PMstd = total volume of dilute exhaust sampled through the filter over the test interval (ct = cold transient, s = stabilized, ht = hot transient), corrected to standard reference conditions.
V[interval]-dilstd = total volume of dilution air over the test interval (ct = cold transient, s = stabilized, ht = hot transient), corrected to standard reference conditions and for any volume removed for emission sampling.
mPMfil = mass of particulate matter emissions on the filter over the test interval.
mPMbkgnd = mass of particulate matter on the background filter over the test interval.
Example:
Vct-exhstd = 5.55 m 3
Vct-PMstd = 0.526 m 3
Vct-dilstd = 0.481 m 3
Vs-exhstd = 9.53 m 3
Vs-PMstd = 0.903 m 3
Vs-dilstd = 0.857 m 3
Vht-exhstd = 5.54 m 3
Vht-PMstd = 0.527 m 3
Vht-dilstd = 0.489 m 3
mPMfil = 0.0000106 g
mPMbkgnd = 0.0000014 g

${m}_{\mathrm{PM}}=\left(\frac{\frac{0.43·5.55}{0.526-0.481}+\frac{9.53}{0.903-0.857}+\frac{0.57·5.54}{0.527-0.489}}{3}\right)·\left(0.0000106-0.0000014\right)$

mPM = 0.00269 g

(4) If you sample PM onto a single filter as described in § 1066.815(b)(5)(i) or (b)(5)(ii) (for constant volume samplers), calculate mPM using the following equation:

$\begin{array}{c}{m}_{\mathrm{PM}}=\left(\frac{{V}_{\mathrm{mix}}}{\frac{\left({V}_{\text{ct-PMstd}}-{V}_{\text{ct-sdastd}}\right)+\left({V}_{\text{cs-PMstd}}-{V}_{\text{cs-sdastd}}\right)}{0.43}+\frac{\left({V}_{\text{ht-PMstd}}-{V}_{\text{ht-sdastd}}\right)+\left({V}_{\text{hs-PMstd}}-{V}_{\text{hs-sdastd}}\right)}{0.57}}\right)·\left({m}_{\mathrm{PMfil}}-{m}_{\mathrm{PMbkgnd}}\right)\\ \text{Eq. 1066.605-6}\end{array}$

Where:
mPM = mass of particulate matter emissions over the entire FTP.
Vmix = total dilute exhaust volume over the test interval, corrected to standard reference conditions, and corrected for any volume removed for emission sampling and for any volume change from secondary dilution air.
V[interval]-PMstd = total volume of dilute exhaust sampled through the filter over the test interval (ct = cold transient, cs = cold stabilized, ht = hot transient, hs = hot stabilized), corrected to standard reference conditions.
V[interval]-sdastd = total volume of secondary dilution air sampled through the filter over the test interval (ct = cold transient, cs = cold stabilized, ht = hot transient, hs = hot stabilized), corrected to standard reference conditions.
mPMfil = mass of particulate matter emissions on the filter over the test interval.
mPMbkgnd = mass of particulate matter on the background filter over the test interval.
Example:
Vmix = 972.121 m 3
Vct-PMstd = 0.925 m 3
Vct-sdastd = 0.529 m 3
Vcs-PMstd = 1.968 m 3
Vcs-sdastd = 1.123 m 3
Vht-PMstd = 1.122 m 3
Vht-sdastd = 0.641 m 3
Vhs-PMstd = 1.967 m 3
Vhs-sdastd = 1.121 m 3
mPMfil = 0.0000229 g
mPMbkgnd = 0.0000014 g

${m}_{\mathrm{PM}}=\left(\frac{972.121}{\frac{\left(0.925-0.529\right)+\left(1.968-1.123\right)}{0.43}+\frac{\left(1.122-0.641\right)+\left(1.967-1.121\right)}{0.57}}\right)·\left(0.0000229-0.0000014\right)$

mPM = 0.00401 g

(5) If you sample PM onto a single filter as described in § 1066.815(b)(5)(ii) (for partial flow dilution systems), calculate mPM using the following equation:

$\begin{array}{c}{m}_{\mathrm{PM}}=\left(\frac{0.43·\left(\frac{{V}_{\text{ct-exhstd}}+{V}_{\text{cs-exhstd}}}{{V}_{\text{ct-PMstd}}-{V}_{\text{ct-dilstd}}+{V}_{\text{cs-PMstd}}-{V}_{\text{cs-dilstd}}}\right)+0.57·\left(\frac{{V}_{\text{ht-exhstd}}+{V}_{\text{hs-exhstd}}}{{V}_{\text{ht-PMstd}}-{V}_{\text{ht-dilstd}}-{V}_{\text{hs-PMstd}}-{V}_{\text{hs-dilstd}}}\right)}{2}\right)·\left({m}_{\mathrm{PMfil}}-{m}_{\mathrm{PMbkgnd}}\right)\\ \text{Eq. 1066.605-7}\end{array}$

Where:
mPM = mass of particulate matter emissions over the entire FTP.
V[interval]-exhstd = total engine exhaust volume over the test interval (ct = cold transient, cs = cold stabilized, ht = hot transient, hs = hot stabilized), corrected to standard reference conditions, and corrected for any volume removed for emission sampling.
V[interval]-PMstd = total volume of dilute exhaust sampled through the filter over the test interval (ct = cold transient, cs = cold stabilized, ht = hot transient, hs = hot stabilized), corrected to standard reference conditions.
V[interval]-dilstd = total volume of dilution air over the test interval (ct = cold transient, cs = cold stabilized, ht = hot transient, hs = hot stabilized), corrected to standard reference conditions and for any volume removed for emission sampling.
mPMfil = mass of particulate matter emissions on the filter over the test interval.
mPMbkgnd = mass of particulate matter on the background filter over the test interval.
Example:
Vct-exhstd = 5.55 m 3
Vct-PMstd = 0.526 m 3
Vct-dilstd = 0.481 m 3
Vcs-exhstd = 9.53 m 3
Vcs-PMstd = 0.903 m 3
Vcs-dilstd = 0.857 m 3
Vht-exhstd = 5.54 m 3
Vht-PMstd = 0.527 m 3
Vht-dilstd = 0.489 m 3
Vhs-exhstd = 9.54 m 3
Vhs-PMstd = 0.902 m 3
Vhs-dilstd = 0.856 m 3
mPMfil = 0.0000229 g
mPMbkgnd = 0.0000014 g

${m}_{\mathrm{PM}}=\left(\frac{0.43·\left(\frac{5.55+9.53}{0.526-0.481+0.903-0.857}\right)+0.57·\left(\frac{5.54+9.54}{0.527-0.489+0.902-0.856}\right)}{2}\right)·\left(0.0000229-0.0000014\right)$

mPM = 0.00266 g

(g) This paragraph (g) describes how to correct flow and flow rates to standard reference conditions and provides an example for determining Vmix based on CVS total flow and the removal of sample flow from the dilute exhaust gas. You may use predetermined nominal values for removed sample volumes, except for flows used for batch sampling.

(1) Correct flow and flow rates to standard reference conditions as needed using the following equation:

$\begin{array}{c}{V}_{\left[\mathrm{flow}\right]\mathrm{std}}=\frac{{V}_{\left[\mathrm{flow}\right]\mathrm{act}}·{p}_{\mathrm{in}}·{T}_{\mathrm{std}}}{{p}_{\mathrm{std}}·{T}_{\mathrm{in}}}\\ \text{Eq. 1066.605-8}\end{array}$

Where:
V[flow]std = total flow volume at the flow meter, corrected to standard reference conditions.
V[flow]act = total flow volume at the flow meter at test conditions.
pin = absolute static pressure at the flow meter inlet, measured directly or calculated as the sum of atmospheric pressure plus a differential pressure referenced to atmospheric pressure.
Tstd = standard temperature.
pstd = standard pressure.
Tin = temperature of the dilute exhaust sample at the flow meter inlet.
Example:
VPMact = 1.071 m 3
pin = 101.7 kPa
Tstd = 293.15 K
pstd = 101.325 kPa
Tin = 340.5 K

${V}_{\mathrm{PMstd}}=\frac{1.071·101.7·293.15}{101.325·340.5}=0.925{\phantom{\rule{0ex}{0ex}}m}^{3}$

(2) The following example provides a determination of Vmix based on CVS total flow and the removal of sample flow from one dilute exhaust gas analyzer and one PM sampling system that is utilizing secondary dilution. Note that your Vmix determination may vary from Eq. 1066.605-7 based on the number of flows that are removed from your dilute exhaust gas and whether your PM sampling system is using secondary dilution. For this example, Vmix is governed by the following equation:

$\begin{array}{c}{V}_{\mathrm{mix}}={V}_{\mathrm{CVSstd}}+{V}_{\mathrm{gasstd}}+{V}_{\mathrm{PMstd}}-{V}_{\mathrm{sdastd}}\\ \text{Eq. 1066.605-9}\end{array}$

Where:
VCVSstd = total dilute exhaust volume over the test interval at the flow meter, corrected to standard reference conditions.
Vgasstd = total volume of sample flow through the gaseous emission bench over the test interval, corrected to standard reference conditions.
VPMstd = total volume of dilute exhaust sampled through the filter over the test interval, corrected to standard reference conditions.
Vsdastd = total volume of secondary dilution air flow sampled through the filter over the test interval, corrected to standard reference conditions.
Example:

Using Eq. 1066.605-8:

VCVSstd = 170.451 m 3, where VCVSact = 170.721 m 3, pin = 101.7 kPa, and Tin = 294.7 K
Using Eq. 1066.605-8:
Vgasstd = 0.028 m 3, where Vgasact = 0.033 m 3, pin = 101.7 kPa, and Tin = 340.5 K
Using Eq. 1066.605-8:
VPMstd = 0.925 m 3, where VPMact = 1.071 m 3, pin = 101.7 kPa, and Tin = 340.5 K
Using Eq. 1066.605-8:
Vsdastd = 0.527 m 3, where Vsdaact = 0.531 m 3, pin = 101.7 kPa, and Tin = 296.3 K
Vmix = 170.451 + 0.028 + 0.925 − 0.527 = 170.878 m 3

(h) Calculate total flow volume over a test interval, V[flow], for a CVS or exhaust gas sampler as follows:

(1) Varying versus constant flow rates. The calculation methods depend on differentiating varying and constant flow, as follows:

(i) We consider the following to be examples of varying flows that require a continuous multiplication of concentration times flow rate: raw exhaust, exhaust diluted with a constant flow rate of dilution air, and CVS dilution with a CVS flow meter that does not have an upstream heat exchanger or electronic flow control.

(ii) We consider the following to be examples of constant exhaust flows: CVS diluted exhaust with a CVS flow meter that has an upstream heat exchanger, an electronic flow control, or both.

(2) Continuous sampling. For continuous sampling, you must frequently record a continuously updated flow signal. This recording requirement applies for both varying and constant flow rates.

(i) Varying flow rate. If you continuously sample from a varying exhaust flow rate, calculate V[flow] using the following equation:

Where:
Δt = 1/ƒrecord

Eq. 1066.605-11

Example:
N = 505
Q
CVS1= 0.276 m 3/s
Q
CVS2= 0.294 m 3/s
ƒrecord = 1 Hz
Using Eq. 1066.605-11:
Δt = 1/1 = 1 s
VCVS = (0.276 + 0.294 + Q
CVS505) · 1
VCVS = 170.721 m 3

(ii) Constant flow rate. If you continuously sample from a constant exhaust flow rate, use the same calculation described in paragraph (h)(2)(i) of this section or calculate the mean flow recorded over the test interval and treat the mean as a batch sample, as described in paragraph (h)(3)(ii) of this section.

(3) Batch sampling. For batch sampling, calculate total flow by integrating a varying flow rate or by determining the mean of a constant flow rate, as follows:

(i) Varying flow rate. If you proportionally collect a batch sample from a varying exhaust flow rate, integrate the flow rate over the test interval to determine the total flow from which you extracted the proportional sample, as described in paragraph (h)(2)(i) of this section.

(ii) Constant flow rate. If you batch sample from a constant exhaust flow rate, extract a sample at a proportional or constant flow rate and calculate V[flow] from the flow from which you extract the sample by multiplying the mean flow rate by the time of the test interval using the following equation:

$\begin{array}{c}{V}_{\left[\mathrm{flow}\right]}={\stackrel{—}{\stackrel{·}{Q}}}_{i}·\mathrm{\Delta t}\\ \text{Eq. 1066.605-12}\end{array}$

Example:
Q
CVS = 0.338 m 3/s
Δt = 505 s
VCVS = 0.338·505
VCVS = 170.69 m 3
[79 FR 23823, Apr. 28, 2014, as amended at 80 FR 9121, Feb. 19, 2015; 81 FR 74203, Oct. 25, 2016; 86 FR 34583, June 29, 2021]


text:
# Math Help - pythagoras

1. ## pythagoras

the lengths, in centimetres, of the sides of a right-angled triangle are:
x, x+2 and x+5

i) use pythagoras' theorem to write down an equation in x. show that it simplifies to
x^2-6x-21=0
ii) solve the equation

iii) write down the length of hypotenuse of the triangle.

2. Hello, simonmann!

The problem is straight-foward.

The lengths of the sides (in cm) of a right triangle are: $
x,\:x+2,\:x+5$

a) Use Pythagoras' Theorem to write an equation in $x.$
$a^2 + b^2 \:=\:c^2 \quad\Rightarrow\quad x^2 + (x+2)^2 \:=\:(x+5)^2$

Show that it simplifies to : . $x^2-6x-21\:=\:0$
We have: . $x^2 + x^2 + 4x + 4 \;=\;x^2 + 10x + 25\quad\Rightarrow\quad x^2-6x-21 \:=\:0$

b) Solve the equation.
Quadratic Formula: . $x \;=\;\frac{-(\text{-}6) \pm\sqrt{(\text{-}6)^2 - 4(1)(\text{-}21)}}{2(1)} \;=\;\frac{6\pm\sqrt{120}}{2} \;=\;3 \pm\sqrt{30}$

And the positive root is: . $x \:=\:3 + \sqrt{30}$ cm.

c) Find the length of hypotenuse of the triangle.
The hypotenuse is: . $x + 5 \;=\;(3 + \sqrt{30}) + 5 \;=\;8 + \sqrt{30}$ cm.

format: plain


text:
# Virtual sites

The Open Force Field Toolkit fully supports the SMIRNOFF virtual site specification for models using off-site charges, including 4- and 5-point water models, in addition to lone pair modelling on various functional groups. The primary focus is on the ability to add virtual sites to a system as part of system parameterization

Virtual sites are treated as massless particles whose positions are computed directly from the 3D coordinates of a set of atoms in the parent molecule. The number of atoms that are required to define the position will depend on the exact type of virtual site being used

Those atoms used to position the virtual site are referred to as ‘orientation’ atoms. Further, each type of virtual site will denote one of these orientation atoms to be the ‘parent’, which conceptually corresponds to the atom that the virtual site is ‘attached to’.

## Applying virtual site parameters

Virtual sites are incorporated into a force field by adding a [VirtualSites tag], which specifies both the parameters associated with the different virtual sites and how they should be applied to a molecule according to SMARTS-based rules.

As with all parameters in the SMIRNOFF specification, each virtual site parameter has an associated SMIRKS pattern with a number of atoms tagged with map indices. Each mapped atom corresponds to one of the atoms used to orientate the virtual site, and for all the currently supported types, the atom matched as atom :1 is denoted the parent.

Virtual site parameters are applied by trying to match every associated SMIRKS pattern with the molecule of interest. In cases where multiple parameters with the same name would designate the same atom as a parent (i.e. an atom that a virtual site will be ‘attached’ to), then the last parameter to match will be assigned.

In cases where the same parameter matches the same parent atom multiple times, as is the case in the above example of formaldehyde, the value of the match keyword will determine the outcome.

The "match" attribute accepts either "once" or "all_permutations", offering control for situations where a SMARTS pattern can possibly match the same group of atoms in different orders (either due to wildcards or local symmetry) and it is desired to either add just one or all of the possible virtual particles.

• once - only one of the possible matches will yield a virtual site being added to the system. This keyword is only valid for types virtual site whose coordinates are invariant to the ordering of the orientation atoms, e.g. the trivalent lone pair type, to avoid ambiguity as to which atom ordering to retain.

• all_permutations - all the possible matches will yield a virtual site being added to the system, such as in the monovalent lone pair example above.

If multiple parameters with different names would designate the same atom as a parent then the last matched parameter for each value of name would be assigned and yield a new virtual site being added.

The following cases exemplify our reasoning in implementing this behavior, and should draw caution to complex issues that may arise when designing virtual site parameters. Let us consider 4-, 5-, and 6-point water models:

• A 4-point water model with a DivalentLonePair: This can be implemented by specifying match="once", outOfPlaneAngle="0*degree", and distance=-.15*angstrom". Since the SMIRKS pattern "[#1:1]-[#8X2:2]-[#1:3]" would match water twice and would create two particles in the exact same position if all_permutations was specified, we specify "once" to have only one particle generated. Although having two particles in the same position should not affect the physics if the proper exclusion policy is applied, it would effectively make the 4-point model just as expensive as 5-point models.

• A 5-point water model with a DivalentLonePair: This can be implemented by using match="all_permutations" (unlike the 4-point model), outOfPlaneAngle="56.26*degree, and distance=0.7*angstrom, for example. Here the permutations will cause particles to be placed at ±56.26 degrees.

• A 6-point water model with both DivalentLonePair sites above. Since these two parameters look identical, it is unclear whether they should both be applied or if one should override the other. The toolkit never compares the physical numbers to determine equality as this can lead to instability during e.g. parameter fitting. To get this to work, we specify name="EP1" for the first parameter, and name="EP2" for the second parameter. This instructs the parameter handler keep them separate, and therefore both are applied. If both had the same name, then the typical SMIRNOFF hierarchy rules are used, and only the last matched parameter would be applied.

## Ordering of atoms and virtual sites

The toolkit handles the orders the atoms and virtual sites in a topology in a specific manner for internal convenience.

Virtual sites are expected to be added after all molecules in the topology are present. This is because the Open Force Field Toolkit organizes a topology by placing all atoms first, then all virtual sites last. This differs from the OpenMM Modeller object, for example, which interleaves the order of atoms and virtual sites in such a way that all particles of a molecule are contiguous.

In addition, due to the fact that a virtual site may contain multiple particles coupled to single parameters, the toolkit makes a distinction between a virtual site, and a virtual particle. A virtual site may represent multiple virtual particles, so the total number of particles cannot be directly determined by simply summing the number of atoms and virtual sites in a molecule. This is taken into account, however, and the Molecule and Topology classes both implement particle iterators.

Note

The distinction between a virtual site and virtual particle is due to be removed in a future version of the toolkit, and a ‘virtual site’ will simply refer to one massless particle placed on a parent atom rather than to a collection of massless particles.

Intramolecular interactions

The virtual site specification allows a virtual site section to define the policy that should be used to handle intramolecular interactions (exclusions). The toolkit currently only supports the parents policy as outline in the virtual site section of the SMIRNOFF specification, which states that each virtual site should inherit their 1-2, 1-3, 1-4, and 1-n exclusions directly from the parent atom.


text:
Why does \big\setminus not work?

The two macros \setminus and \backslash both produce a backslash in mathmode that is customarily used to denote, well, set differences: $A\setminus B$, $A\backslash B$.

For \backslash there are also a \bigger versions, e.g., \big\backslash, whereas \big\setminus creates an error.

Why is that so? Should we not consider this a bug in \setminus?

• No operation symbol grows with \big; why should \setminus behave differently? – egreg Dec 8 '15 at 15:45
• @egreg How about \big/ or \Bigg/? – Steven B. Segletes Dec 8 '15 at 15:47
• @StevenB.Segletes that's a delimiter (non zero delcode) – David Carlisle Dec 8 '15 at 15:52
• OK, TeXnically, the question is answered. Typographically, is it a bad idea to let the set-difference operator scale up? – Sebastian Dec 8 '15 at 17:51

The difference is in their definition in fontmath.ltx:

\DeclareMathDelimiter{\backslash}    % for double coset G\backslash H
{\mathord}{symbols}{"6E}{largesymbols}{"0F}

\DeclareMathSymbol{\setminus}{\mathbin}{symbols}{"6E}

or, in plain.tex,

\def\backslash{\delimiter"26E30F } % for double coset G\backslash H

\mathchardef\setminus="226E % for set difference A\setminus B

Note that if you do texdef -t latex backslash and texdef -t latex setminus you get

\backslash:
macro:->\delimiter "026E30F

\setminus:
\mathchar"226E

so there's no real difference between the two cases.

There's a substantial definition between a delimiter and a mathchar. The former type will honor \big and friends or \left and \right, the latter won't.

Note that \backslash is defined to be class 0 (ordinary symbol) when used alone, whereas \setminus has class 2 (binary operation symbol); this will affect spacing.

If you need a “bigger \setminus” you can do

\mathbin{\big\backslash}

but \big\setminus would be like \big+ that's not going to work, because \big needs a delimiter after it, that is, either a character with a nonzero \delcode or a macro expanding to \delimiter<27 bit number>.

The usage of \setminus is very different from / that, traditionally, has no space on either side and so TeX treats it as an ordinary symbol, also assigning it a nonzero \delcode

\DeclareMathDelimiter{/}{\mathord}{operators}{"2F}{largesymbols}{"0E}
\DeclareMathSymbol{/}{\mathord}{letters}{"3D}

in LaTeX, and

\mathcode\/="013D
\delcode\/="02F30E

in plain TeX.

• +1 for the workaround, \mathbin{\big\backslash} – Steven B. Segletes Dec 8 '15 at 15:58


text:
# Number of elements in an equivalence class

Let a set X = {1, 2, 3, 4, ... , 2015} and a set Y = {1, 2, 3, 4, ... , 271}. Let S be the relation on P(X) defined by:

For all sets A, B, that are elements of P(X), (A,B) are elements of S if and only if |A n Y| = |B n Y|

How many equivalence classes are there? How many elements are in the equivalence class [{271}]?

I calculated there to be 272 equivalence classes, because Y has 271 elements, the number of elements that A can share with Y is 272, from 0 - 271.

However, for the next question, I don't know if I'm interpreting this right, but I think it's asking for the number of sets where A shares 271 elements with Y. However, since A is an element of the power set of X, it has 2^2015 sets, and if you remove the 271 elements that A shares with Y, there is still 2^1744 sets in A. Each one of those can match up to 2^1744 sets in B, and at this point I think I'm already very wrong. However, I just don't see any other way of going about this question, unless I'm misinterpreting the question itself.

Any help would be greatly appreciated. Thank you.

Your answer to the first question is correct. You’ve misunderstood the second question, however. Let $A=\{271\}\in\wp(X)$. Note that $A\subseteq Y$, so $|A\cap Y|=|A|=1$. Thus, for each $B\in\wp(X)$ we have $\langle A,B\rangle\in S$ if and only if $|B\cap Y|=1$. Now $[\{271\}]$ denotes the equivalence class of $\{271\}$, i.e., the equivalence class of $A$, so
$$[\{271\}]=\{B\in\wp(X):|B\cap Y|=1\}\;.$$
To answer the question, then, we must determine how many subsets of $X$ have a one-element intersection with $Y$.
Let $B$ be such a subset of $X$. Then $B\cap Y=\{k\}$ for some $k\in Y$, and $B\setminus Y$ can be any subset at all of $X\setminus Y$. As you’ve already observed, $|X\setminus Y|=1744$, so there are $2^{1744}$ choices for $B\setminus Y$. Since there are clearly $271$ choices for $k$, the final answer is that $[\{271\}]$ has $271\cdot2^{1744}$ elements.
Equivalence classes are determined by the intersection with $Y$, and so are in correspondence with subsets of $Y$.
• No, they are not: the OP is correct in saying that they are identified with cardinalities of subsets of $Y$. – Brian M. Scott Apr 10 '15 at 18:03


text:
# Citation

Kraemer M, Shoaib M (2021) Demystifying Chronic Fatigue Syndrome/Myalgic Encephalomyelitis - A Systematic Review. J Musculoskelet Disord Treat 7:090. doi.org/10.23937/2572-3243.1510090

# Demystifying Chronic Fatigue Syndrome/Myalgic Encephalomyelitis - A Systematic Review

##### Marius Kraemer1* and Muhammad Shoaib2

1University of Sydney, Camperdown NSW 2006, Australia

2Department of Internal Medicine, Combined Military Hospital, Peshawar 25000, Pakistan

# Abstract

Background: Chronic fatigue syndrome (CFS) is a poorly understood disease and information on effective treatments is sparse. A vast variety of vague treatment regimens including self-treatment with over-the-counter painkillers and muscle relaxants with little definitive evidence in improving the course of disease has further augmented the complexity of management of CFS. The aim of this review article is to compare and contrast the efficacy of different treatment protocols currently in practice based on a four-category regimen system.

Methods: We performed a systematic search of 612 studies on PubMed and other sources and found 51 frequently prescribed medications for CFS. These treatments were classified into four categories I-IV (category I being the most effective therapies and category IV being the least).

Results: Out of 51 frequently prescribed medications for CFS, 3 (Omega 3 Fatty Acids, Nexavir, Amphotericin B) have demonstrated high response rates (50%+), high symptom remission (50%+) and high full remission rates (40%+).

Conclusion: Our understanding of CFS/ME is rapidly evolving. Numerous research discoveries have been made in the key aspects of CFS/ME, disease prevalence, etiology, biomarkers symptom manifestation, and treatment modalities. The four-category drug regimen outlined in our systematic review can be used as a starting point for future CFS/ME treatment and research.

# Keywords

Chronic fatigue syndrome, Treatment, Efficacy, Regimen

# Introduction

For nearly 100 years, [1] Chronic Fatigue Syndrome (CFS), also known as Myalgic Encephalomyelitis (ME) has puzzled doctors and patients alike. Patients fell ill and became severely disabled with a wide range of diffuse symptoms and for seemingly no reason with no chance of recovery.

Due to the lack of understanding of CFS and its diffuse clinical picture, there was not much research funding for CFS/ME until recently and 80% of CFS/ME patients are still undiagnosed and have not received proper treatment [2].

## Treatment

Since 60% of patients do not recover and the recovery in the other 40% of patients is slow, finding effective treatment is paramount [32]. More than 300 different pharmaceuticals and supplements have been considered and trialed by doctors for CFS, and the vast majority of these turned out to have little or no efficacy [4-6].

We evaluated the efficacy of 56 treatments for CFS for which data from trials existed in terms of demonstrated response rate, remission of some symptoms, complete remission of CFS, time to achieve complete remission, and strength of available evidence. Based on these five parameters, four categories (I-IV) of treatment regimen are proposed for devising a prompt and effective management plan. After thorough analysis, six were able to provide Category I efficacy, five Category II efficacy, six Category III efficacy, and 35 medications were included in the Category IV.

Levels of evidence were defined as per the Oxford Criteria for levels of evidence (Figure 2).

Figure 2: Oxford criteria of levels of evidence. View Figure 2

Category I treatment regimen:

The following criteria were adopted for the inclusion of drugs in Category I:

1. Overall response rate

2. Remission rate of CFS symptoms

3. % Responders with 100% remission

4. Time to achieve complete 100% remission/ some improvement

5. Level of evidence (Defined as per the Oxford Criteria fig 2)

There are no FDA approved medications for treatment. Due to the wide range of symptoms of CFS, symptomatic treatment approaches vary but we suggest using a set of criteria based on best practices and evidence-based medicine. The table below shows 5 medications that meet the inclusion criteria for Category I treatment (Table 1).

Table 1: Category I medications with response rate, remission, time to remission and level of evidence. View Table 1

Category II treatment regimen:

The following criteria were adopted for the inclusion of drugs in Category II:

1. More than 50% average response rate

2. More than 50% remission rates of CFS symptoms

3. No documentation on % responders with 100% remission

4. Time to achieve symptom improvement between 3 to 6 months

5. Level I or II evidence

Table 2 below shows 7 medications that meet the inclusion criteria for Category II treatment.

Table 2: Category II medications with response rate, remission, time to remission and level of evidence. View Table 2

Significant remission in symptoms is denoted in a 50% remission percentage. Furthermore, not all studies investigating the above treatments were conducted in a large-scale and double-blinded setting.

Category III treatment regimen:

The following criteria were adopted for the inclusion of drugs in Category III:

1. More than 50% response rate

2. Less than/Equal to 50% remission rate of CFS symptoms

3. No documentation of % responders with 100% remission

4. Time to improvement between 3 and 6 months

5. Level II evidence or higher

Table 3 shows 5 medications that meet the inclusion criteria for Category III treatment;

Table 3: Category III medications with response rate, remission, time to remission and level of evidence. View Table 3

Category IV treatment regimen:

The following criteria were adopted for the inclusion of drugs in Category IV:

1. No documentation of patient response rate

2. No documentation of remission rate of CFS symptoms

3. No documentation of % responders with 100% remission

4. No documentation of time to improvement between 3 and 6 months

5. Level IV or V evidence

A total of 31 supplements fall in this category. These include Sodium bicarbonate/baking soda, Ibudilast, Cordyceps Sinensis and Shiitake Mushroom, Oxytocin, Larorice, Biotin, Curcumin, Inosine, Epicor, Milk Thistle, Colostrum, NAC, Propionic Acid, Microbiotics, Hawthorns, L-Glutathione, Organic Germanium, Artesunate, IP-6, Spinola, Sulforaphane, L-Serine, Moringa Oleifera, Quercetin, NeuroProtek, CoEnzyme Q10 + NADH, St. John's, GcMAF, and Melatonin. Additionally, there are 6 pharmaceutical formulations (Naphazoline, Piracetam, Pentoxifylline, Azithromycin, Guaifenesin, Fludrocortisone) that fulfill the inclusion criteria for Category IV treatment regimen. However, the effectiveness of these supplements and pharmaceuticals has not been published or investigated in scientific studies and their evidence is hypothetical, informal, or based on expert opinion of medical professionals only.

Behavioral treatment or cognitive behavioral therapy (CBT) has been widely used for CFS until recently. However, surveys from patient organizations have found considerable rates of harm from CBT in CFS patients [50,51]. Moreover, the two largest UK patient charities, ME Association and Action for ME, have called for the use of CBT to challenge "illness beliefs" to be withdrawn and for health care providers to warn patients of the potential for harm [52]. What's more, the largest independent patient survey of patient experiences of CBT and GET in the UK found that ME/CFS patients were almost double as likely to have their mental health deteriorate than improve as a result of the course and see new symptoms develop and a negative effect on their physical health [53].

## Recovery

Recovery from CFS is more common than assumed with 40% of CFS patients reporting symptom improvement after several years [54,55].

Longitudinal studies have shown that 17-64% of CFS patients with longer than 6 months of illness improved, less than 10% fully recovered, and another 10-20% worsens during follow-up. Older age, longer duration of symptoms, severity, comorbid psychiatric illness, and poor physical health status are additional factors that worsen the prognosis. Children and adolescents appear to recover more rapidly and have a low incidence of recurrence [56].

Recovery of CFS with long term follow-up of 784 pediatric CFS patients was demonstrated in a study performed in Australia. 35% of patients recovered at 5 years and 68% at 10 years post diagnosis, with 5% remaining very unwell and 20% significantly unwell. However, the study failed to identify predictors for recovery [57].

A review of 14 studies found that on average 5% of patients recovered (range 0%-31%); 40% of patients improved during follow-up (range 8%-63%); 8%-30% returned to work; 5%-20% of patients reported worsening of symptoms. Furthermore, prompt diagnosis and early treatment significantly raises the rate and pace of recovery [54,58].

# Results

CFS/ME is not a mysterious disease anymore, but a disease with known prevalence (0.4%-1%), etiology (12 different causes), biomarkers (2 specific and 17 unspecific), symptom manifestation (50) confirmed by multiple studies. The evidence suggests the 10 different agents as the most effective treatments for CFS.

Furthermore, the evidence suggests the following 10 different agents as the most effective treatments for CFS.

Category I treatment options with the highest response rates (50%+), high levels of evidence and highest full remissions rates:

1. Omega-3 Fatty acids

2. Nexavir

3. Amphotericin B

Category II treatment options with the high response rates (50%+) and high levels of evidence, but no documented full remission rates were:

1. Magnesium injections

2. Vitamin B12

3. Thymic protein A

4. Equilibrant

5. Heparin injections

6. Acetyl-L-Carnitine

7. Amino Acid Complex

# Limitations

There are certain limitations to this review. Around 40% of CFS patients experience recovery over several years regardless of treatment. Thus, 40% of patients receiving the above treatments will see slight improvement regardless. However, most of the above studies were conducted over the time span of a few weeks to 6 months, which should alleviate this limitation.

Moreover, most of the above studies were not independent studies with committee oversight, which can also skew data.

As well, due to the complex nature of CFS, it has varying presentations and a general heterogeneity in etiology. Owing to this, some treatments that might work well for a specific group of CFS patients might not work well for others.

For that reason, future research is required to define the exact classification of subtypes while diagnosing CFS patients for future trials. This is not important only for trials that investigate the effectiveness of treatment, but also for all other medical trials investigating the underlying mechanisms of CFS/ME.

With the number of studies with the title "Chronic Fatigue Syndrome" from 13 studies published on PubMed in the year 2000 study to 121 studies published in 2019, having increased by nine times and significant amounts of newly committed funding, the outlook for future research and better treatments also looks promising.

# Conclusion

Research in CFS/ME treatment has come a long way. Yet, there is no standard scientifically demonstrated evidence-based intervention in practice. This overview has compared the frequently prescribed medications for CFS from available research studies and classified them into four categories in terms of clinical effectiveness.

The evidence suggests that Category III treatments only provide symptomatic relief and can only reduce cognitive symptoms as a consequence while Category I and Category II treatments are causal treatments and are thus able to reduce all symptoms.

With this analysis, CFS patients are now able to make use of a treatment regimen based on the available evidence, which suggests that potentially several million CFS patients could achieve full recovery with the Category I treatments.

# Conflict of Interest

The authors declare they have no conflict of interest.

# Citation

Kraemer M, Shoaib M (2021) Demystifying Chronic Fatigue Syndrome/Myalgic Encephalomyelitis - A Systematic Review. J Musculoskelet Disord Treat 7:090. doi.org/10.23937/2572-3243.1510090


text:
# Unusual approach to tabulation algorithm

Consider simple tabulation algorithm firstly for Fibonacci numbers. We will use the dictionary as a cache (and Python as example PL):

def fib_tab(n):
tab_dict = {1: 1, 2: 1}
for ind in range(3, n + 1):
tab_dict[ind] = tab_dict[ind - 1] + tab_dict[ind - 2]
return tab_dict[n]

Notice that for n < 1 fib_tab(n) raises a KeyError (or returns None if we use dict.get() method)
But we can overload method for missing key so it'll be return some default value (and put it on dictionary):

class MyDict(dict):
__default = 1
…
def __missing__(self, key):
self[key] = self.__default
return self[key]
…

so we now we can start from empty dict:

tab_dict = MyDict()
def fib_tab(n):
for ind in range(3, n + 1):
tab_dict[ind] = tab_dict[ind - 1] + tab_dict[ind - 2]
return tab_dict[n]

And after executing the function, the tab_dict will contain the classic Fibonacci sequence.

Much more interesting things will happen with this approach with Q Hofstadter sequence:

tab_dict = MyDict()
def qh_tab(n):
for ind in range(3, n + 1):
tab_dict[ind] =  tab_dict[ind -  tab_dict[ind - 1]] +  tab_dict[ind -  tab_dict[ind - 2]]
return tab_dict[n]

If we start with an empty dictionary, or the usual initial conditions tab_dict[1] = tab_dict[2] = 1, we will get classic Q Hofstadter_sequence.

But let's try tab_dict[1] = 1, tab_dict[2] = 2 If we used an ordinary dict, then at the very first step we got KeyError because tab_dict[0].
But MyDict just set tab_dict[0] = 1 and tabulation is going on.

How deep will the algorithm dive into empty items for different initial conditions? The results are very different: tab_dict[1] = 5, tab_dict[2] = 6: tab_dict[1] = 4, tab_dict[2] = 5: tab_dict[1] = 8, tab_dict[2] = 3:

I wonder if anyone has studied a similar approach for various recursive functions?

• Or, what if you let $f(1) = 1$ and $f(j) = 1 + \begin{cases} f(3j+1) &\text{if$j$is odd}\\f(j/2) &\text{if$j$is even}\end{cases}$ Jan 3 at 14:49
• @Pål GD, great! Jan 3 at 18:27
• What exactly is your question? We are a question-and-answer site, so we require you to articulate a specific, answerable question. I'm having a hard time identifying your question and I'm not sure what kind of answer you are looking for. If you're asking about something for all recursive functions, that sounds too broad to me. I'm not sure what "similar approach" refers to; can you be more specific?
– D.W.
Jan 3 at 21:11


text:
# How do you find the local extrema for  (x^2)(e^-x)  from [-2,4]?

Jun 3, 2018

$P M I N \left[0 , 0\right] , P M A X \left[- 2 , 4 {e}^{2}\right]$

#### Explanation:

We get
$f ' \left(x\right) = {e}^{- x} \left(2 x - {x}^{2}\right)$
$f ' ' \left(x\right) = {e}^{- x} \left({x}^{2} - 4 x + 2\right)$
solving

$f ' \left(x\right) = 0$
we get
$x = 0$
$f ' ' \left(0\right) > 0$
$x = 2$
$f ' ' \left(2\right) = {e}^{- 2} \left(- 2\right) < 0$

since

$f \left(- 2\right) = 4 {e}^{2} > 4 {e}^{- 2}$

we get the Points as above.


text:
# What exactly is the alpha in the Dirichlet distribution?

I'm fairly new to Bayesian statistics and I came across a corrected correlation measure, SparCC, that uses the Dirichlet process in the backend of it's algorithm. I have been trying to go through the algorithm step-by-step to really understand what is happening but I am not sure exactly what the alpha vector parameter does in a Dirichlet distribution and how it normalizes the alpha vector parameter?

The implementation is in Python using NumPy: https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.dirichlet.html

The docs say:

alpha : array Parameter of the distribution (k dimension for sample of dimension k).

My questions:

1. How do the alphas affect the distribution?;

2. How are the alphas being normalized?; and

3. What happens when the alphas are not integers?

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# Reproducibility
np.random.seed(0)

# Integer values for alphas
alphas = np.arange(10)
# array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

# Dirichlet Distribution
dd = np.random.dirichlet(alphas)
# array([ 0.        ,  0.0175113 ,  0.00224837,  0.1041491 ,  0.1264133 ,
#         0.06936311,  0.13086698,  0.15698674,  0.13608845,  0.25637266])

# Plot
ax = pd.Series(dd).plot()
ax.set_xlabel("alpha")
ax.set_ylabel("Dirichlet Draw")

• Have you problems with the Wikipedia entry on this distribution? – Xi'an Nov 8 '16 at 18:49
• Apologies, I don't think I worded it correctly. I understand what a probability distribution/pdf/pmf is but I was confused on how the normalization was happening. From the wikipedia, it seems that the normalization is occurring via the gamma functions after the ${\prod}{x_i}^{\alpha - 1}$. I've heard it referred to as a distribution over distributions and it's hard to see that from the eqns on wikipedia. – O.rka Nov 8 '16 at 20:51
• If you normalize the alpha's, you get the mean of the distribution. If you normalize the distribution, you insure its integral over its support is equal to 1 and that it is thus a valid probability distribution. – Eskapp Nov 8 '16 at 21:06
• The Dirichlet distribution is a distribution over the simplex, hence a distribution over finite support distributions. If you aim at a distribution over continuous distributions, you should look at the Dirichlet process. – Xi'an Nov 9 '16 at 7:01

The Dirichlet distribution is a multivariate probability distribution that describes $k\ge2$ variables $X_1,\dots,X_k$, such that each $x_i \in (0,1)$ and $\sum_{i=1}^N x_i = 1$, that is parametrized by a vector of positive-valued parameters $\boldsymbol{\alpha} = (\alpha_1,\dots,\alpha_k)$. The parameters do not have to be integers, they only need to be positive real numbers. They are not "normalized" in any way, they are parameters of this distribution.

The Dirichlet distribution is a generalization of the beta distribution into multiple dimensions, so you can start by learning about the beta distribution. Beta is a univariate distribution of a random variable $X \in (0,1)$ parameterized by parameters $\alpha$ and $\beta$. The nice intuition about it comes if you recall that it is a conjugate prior for the binomial distribution and if we assume a beta prior parameterized by $\alpha$ and $\beta$ for the binomial distribution's probability parameter $p$, then the posterior distribution of $p$ is also a beta distribution parameterized by $\alpha' = \alpha + \text{number of successes}$ and $\beta' = \beta + \text{number of failures}$. So you can think of $\alpha$ and $\beta$ as of pseudocounts (they do not need to be integers) of successes and failures (check also this thread).

In case of the Dirichlet distribution, it is a conjugate prior for the multinomial distribution. If in the case of the binomial distribution we can think of it in terms of drawing white and black balls with replacement from the urn, then in case of the multinomial distribution we are drawing with replacement $N$ balls appearing in $k$ colors, where each of colors of the balls can be drawn with probabilities $p_1,\dots,p_k$. The Dirichlet distribution is a conjugate prior for $p_1,\dots,p_k$ probabilities and $\alpha_1,\dots,\alpha_k$ parameters can be thought as pseudocounts of balls of each color assumed a priori (but you should read also about the pitfalls of such reasoning). In Dirichlet-multinomial model $\alpha_1,\dots,\alpha_k$ get updated by summing them with observed counts in each category: $\alpha_1+n_1,\dots,\alpha_k+n_k$ in similar fashion as in case of beta-binomial model.

The higher value of $\alpha_i$, the greater "weight" of $X_i$ and the greater amount of the total "mass" is assigned to it (recall that in total it must be $x_1+\dots+x_k=1$). If all $\alpha_i$ are equal, the distribution is symmetric. If $\alpha_i < 1$, it can be thought as anti-weight that pushes away $x_i$ toward extremes, while when it is high, it attracts $x_i$ toward some central value (central in the sense that all points are concentrated around it, not in the sense that it is symmetrically central). If $\alpha_1 = \dots = \alpha_k = 1$, then the points are uniformly distributed.

This can be seen on the plots below, where you can see trivariate Dirichlet distributions (unfortunately we can produce reasonable plots only up to three dimensions) parameterized by (a) $\alpha_1 = \alpha_2 = \alpha_3 = 1$, (b) $\alpha_1 = \alpha_2 = \alpha_3 = 10$, (c) $\alpha_1 = 1, \alpha_2 = 10, \alpha_3 = 5$, (d) $\alpha_1 = \alpha_2 = \alpha_3 = 0.2$.

The Dirichlet distribution is sometimes called a "distribution over distributions", since it can be thought as a distribution of probabilities themselves. Notice that since each $x_i \in (0,1)$ and $\sum_{i=1}^k x_i = 1$, then $x_i$'s are consistent with the first and second axioms of probability. So you can use the Dirichlet distribution as a distribution of probabilities for discrete events described by distributions such as categorical or multinomial. It is not true that it is a distribution over any distributions, for example it is not related to probabilities of continuous random variables, or even some discrete ones (e.g. a Poisson distributed random variable describes probabilities of observing values that are any natural numbers, so to use a Dirichlet distribution over their probabilities, you'd need an infinite number of random variables $k$).

• Incredible explanation – O.rka Nov 9 '16 at 21:35

Disclaimer: I have never worked with this distribution before. This answer is based on this wikipedia article and my interpretation of it.

The Dirichlet distribution is a multivariate probability distribution with similar properties to the Beta distribution.

The PDF is defined as follows:

$$\{x_1, \dots, x_K\} \sim\frac{1}{B(\boldsymbol{\alpha})}\prod_{i=1}^Kx_i^{\alpha_i - 1}$$

with $K \geq 2$, $x_i \in (0,1)$ and $\sum_{i=1}^Kx_i = 1$.

If we look at the closely related Beta distribution:

$$\{x_1, x_2 (=1-x_1)\} \sim \frac{1}{B(\alpha,\beta)}x_1^{\alpha-1}x_2^{\beta-1}$$

we can see that these two distributions are the same if $K=2$. So let's base our interpretation on that first and then generalise to $K>2$.

In Bayesian statistics, the Beta distribution is used as a conjugate prior for binomial parameters (See Beta distribution). The prior can be defined as some prior knowledge on $\alpha$ and $\beta$ (or in line with the Dirichlet distribution $\alpha_1$ and $\alpha_2$). If some binomial trial then has $A$ successes and $B$ failures, the posterior distribution is then as follows: $\alpha_{1,pos} = \alpha_1 + A$ and $\alpha_{2,pos}=\alpha_2 + B$. (I won't work this out, as this is probably one of the first things you learn with Bayesian statistics).

So the Beta distribution then represents some posterior distribution on $x_1$ and $x_2 (=1-x_1)$, which can be interpreted as the probability of successes and failures respectively in a Binomial distribution. And the more data ($A$ and $B$) you have, the narrower this posterior distribution will be.

Now we know how the distribution works for $K=2$, we can generalise it to work for a multinomial distribution instead of a binomial. Which means that instead of two possible outcomes (success or failure), we will allow for $K$ outcomes (see why it generalises to Beta/Binom if $K=2$?). Each of these $K$ outcomes will have a probability $x_i$, which sums to 1 as probabilities do.

$\alpha_i$ then takes a similar role to the $\alpha_1$ and $\alpha_2$ in the Beta distribution as a prior for $x_i$ and gets updated in a similar fashion.

So now to get to your questions:

How do the alphas affect the distribution?

The distribution is bounded by the restrictions $x_i \in (0,1)$ and $\sum_{i=1}^Kx_i = 1$. The $\alpha_i$ determine which parts of the $K$-dimensional space get the most mass. You can see this in this image (not embedding it here because I don't own the picture). The more data there is in the posterior (using that interpretation) the higher the $\sum_{i=1}^K\alpha_i$, so the more certain you are of the value of $x_i$, or the probabilities for each of the outcomes. This means that the density will be more concentrated.

How are the alphas being normalized?

The normalisation of the distribution (making sure the integral equals 1) goes through the term $B(\boldsymbol{\alpha})$:

$$B(\boldsymbol{\alpha}) = \frac{\prod_{i=1}^K\Gamma(\alpha_i)}{\Gamma(\sum_{i=1}^K\alpha_i)}$$

Again if we look at the case $K=2$ we can see that the normalising factor is the same as in the Beta distribution, which used the following:

$$B(\alpha_1, \alpha_2) = \frac{\Gamma(\alpha_1)\Gamma(\alpha_2)}{\Gamma(\alpha_1+\alpha_2)}$$

This extends to

$$B(\boldsymbol{\alpha}) = \frac{\Gamma(\alpha_1)\Gamma(\alpha_2)\dots\Gamma(\alpha_K)}{\Gamma(\alpha_1+\alpha_2+\dots+\alpha_K)}$$

What happens when the alphas are not integers?

The interpretation doesn't change for $\alpha_i>1$, but as you can see in the image I linked before, if $\alpha_i < 1$ the mass of the distribution accumulates at the edges of the range for $x_i$. $K$ on the other hand has to be an integer and $K\geq2$.

• Thanks for this. Your explanation was super useful. I wish I could have marked both of them as correct. – O.rka Nov 9 '16 at 21:35


text:
Chapter 6.7: Mean Free Path

 Prince George's Community College General Chemistry for Engineering CHM 2000 Unit I: Atoms      Unit II: Molecules     Unit III: States of Matter     Unit IV: Reactions     Unit V: Kinetics & Equilibrium Unit VI: Thermo & Electrochemistry     Unit VII: Nuclear Chemistry

Learning Objective

• The mean free path is the average distance traveled by a moving molecule between collisions.

Introduction

Imagine gas leaking out of a pipe. It would take a while for the gas to diffuse and spread into the environment. This is because gas molecules collide with each other, causing them to change in speed and direction. Therefore, they can never move in a straight path without interruptions. Between every two consecutive collisions, a gas molecule travels a straight path. The average distance of all the paths of a molecule is the mean free path.

Gas molecules do not diffuse nearly as rapidly as their very high speeds might suggest. If molecules actually moved through a room at hundreds of miles per hour, we would detect odors faster than we hear sound. Instead, it can take several minutes for us to detect an aroma because molecules are traveling in a medium with other gas molecules. Because gas molecules collide as often as 1010 times per second, changing direction and speed with each collision, they do not diffuse across a room in a straight line, as illustrated schematically in Figure 6.7.1 The average distance traveled by a molecule between collisions is the mean free pathThe average distance traveled by a molecule between collisions.. The denser the gas, the shorter the mean free path; conversely, as density decreases, the mean free path becomes longer because collisions occur less frequently. At 1 atm pressure and 25°C, for example, an oxygen or nitrogen molecule in the atmosphere travels only about 6.0 × 10−8 m (60 nm) between collisions. In the upper atmosphere at about 100 km altitude, where gas density is much lower, the mean free path is about 10 cm; in space between galaxies, it can be as long as 1 × 1010 m (about 6 million miles).

Figure 6.7.1 The Path of a Single Particle in a Gas Sample The frequent changes in direction are the result of collisions with other gas molecules and with the walls of the container.

Calculations

In reality, the mean free path cannot be calculated by taking the average of all the paths because it is impossible to know the distance of each path traveled by a molecule. However, we can calculate it from the average speed ($$\langle c \rangle$$) of the molecule divided by the collision frequency ($$Z$$). The formula for this is:

$\lambda = \dfrac{\langle c \rangle}{Z} \tag{6.7.1}$

Because $$Z$$ is equal to $$1/ t$$, where $$t$$ is the average time between collisions, the formula can also be:

$\begin{eqnarray} \lambda &=& \dfrac{\langle c \rangle}{\dfrac{1}{t}} \\ &=& \langle c \rangle \times t \end{eqnarray} \tag{6.7.2}$

$\lambda = \sqrt{2} \pi d^2 \langle c \rangle (N/V) \tag{6.7.3}$

where

• $$d$$ is the diameter of the molecule and
• ($$N/V$$) is the density,

The formula can be further modified to:

$\begin{eqnarray} l &=& \dfrac{\langle c \rangle}{\sqrt{2} \pi d^2 \langle c \rangle \dfrac{N}{V}} \\ &=& \dfrac{1}{\sqrt{2} \pi d^2 \dfrac{N}{V}} \end{eqnarray} \tag{6.7.4}$

Factors affecting mean free path

• Density: As gas density increases, the molecules become closer to each other. Therefore, they are more likely to run into each other, so the mean free path decreases.
• Increasing the number of molecules or decreasing the volume causes density to increase. This decreases the mean free path.
• Radius of molecule: Increasing the radii of the molecules decreases the space between them, causing them to run into each other more often. Therefore, the mean free path decreases.
• Pressure, temperature, and other factors that affect density can indirectly affect mean free path.

Practice Problems

1. A gas has an average speed of 10 m/s and a collision frequency of 10 s-1. What is its mean free path?
2. A gas has an average speed of 10 m/s and an average time of 0.1 s between collisions. What is its mean free path?
3. A gas has a density of 10 particles m-3 and a molecular diameter of 0.1 m. What is its mean free path?
4. A gas in a 1 m3 container has a molecular diameter of 0.1 m. There are 10 molecules. What is its mean free path?
5. A gas has a molecular diameter of 0.1 m. It also has a mean free path of 2.25 m. What is its density?

1. l = <c> / = 10 m/s / 10 s^(-1) = 1 m
2. l = <c> X (average time between collisions) = 10 m/s X 0.1 s = 1 m
3. l = 1 / [$\scriptstyle \sqrt{2}$ (pi) d^2 (N/v)] = 1 / [$\scriptstyle \sqrt{2}$ (pi)(0.1 m)^2 (10 m^(-3))] = 2.25 m
4. l = 1 / [$\scriptstyle \sqrt{2}$ (pi) d^2 (N/v)] = 1 / [$\scriptstyle \sqrt{2}$ (pi)(0.1 m)^2 (10 / 1 m^3)] = 2.25 m
5. l = 1 / [$\scriptstyle \sqrt{2}$ (pi) d^2 (N/v)]
2.25 m = 1 / [$\scriptstyle \sqrt{2}$ (pi)(0.1 m)^2 (N/v)]
N/v = 10 m^(-3)

References

1. Chang, Raymond. Physical Chemistry for the Biosciences. California: University Science Books, 2005.
2. Atkins, Peter and Julio de Paula. Physical Chemistry for the Life Sciences. New York: Oxford University Press, 2006.

Contributors

• Tho Nguyen, Michael Dai


text:
# Complex Measure Agreeing on Certain Balls

I came across this problem and am lost as to how to solve it.

Let $r>0$ be fixed. Suppose $\mu, \nu$ are complex Borel measures on $\mathbb{R}^d$ such that for each open ball B of radius $r$, $\mu(B)=\nu(B)$. Then $\mu=\nu$.

I thought this might be an application of $\pi-\lambda$ theorem, but I realized we wouldn’t have a $\pi$-system with the collection of open balls $B$ since intersecting such balls might not necessarily be open or have radius $r$ still. Any help would be greatly appreciated.

#### Solutions Collecting From Web of "Complex Measure Agreeing on Certain Balls"

In which context did you come across this claim/exercise? The claim is indeed true, but it seems to me (see below) to be more of a Fourier-analytic theorem than a theorem of measure theory. If you do not know much about the Fourier transform, the following proof will probably be (almost) useless to you 🙁

By considering $\gamma := \mu – \nu$ it suffices to show $\gamma \equiv 0$ if $\gamma (B_r (x)) = 0$ for all $x \in \Bbb{R}^d$.

Let $f := \chi_{B_r (0)}$ be the indicator function/characteristic function of the ball of radius $r$ around the origin. We consider the convolution (cf. also http://en.wikipedia.org/wiki/Convolution#Convolution_of_measures) of the complex measure $\gamma$ and the function $f$, i.e.

$$\gamma \ast f (x) = \int f(y-x) \, d\gamma(y) = \gamma(B_r (x)) = 0 \text{ for all x } \in \Bbb{R}^d.$$

But by the convolution theorem for the Fourier transform, we have

$$0 \equiv \mathcal{F} ( \gamma \ast f) = \widehat{\gamma} \cdot \widehat{f} \qquad (\dagger)$$

Since $\widehat{f}$ has compact support, the Paley-Wiener theorem (or an explicit differentiation under the integral) shows that the Fourier transform $\widehat{f}$ extends to an entire function $\Bbb{C}^d \to \Bbb{C}$, which we again denote by $\widehat{f}$. Since $f \not\equiv 0$, we also have $\widehat{f} \not\equiv 0$.

As $\widehat{f}$ is analytic, this implies that the zero-set

$$\{\xi \in \Bbb{R}^d \mid \widehat{f}(\xi) = 0\}$$

has empty interior, i.e. $\{\xi \mid\widehat{f}(\xi) \neq 0\}$ is dense in $\Bbb{R}^d$.

Together with the continuity of $\widehat{\gamma}$ and with $(\dagger)$, this yields $\widehat{\gamma} \equiv 0$ and thus $\gamma \equiv 0$, completing the proof.

EDIT: Regarding the zero sets of analytic functions, see e.g. here Zeros set of analytic functions over complex plane with several variables. But this does not really cover our case, since we are considering a real analytic function. Let us assume that we already know that real-analytic functions in one variable have only isolated zero sets. (This follows easily by considering the power series $\sum a_n x^n$ and letting $n$ minimal with $a_n\neq0$, …).

For the multidimensional case, assume $f\equiv 0$ on some open ball $B_r (x_0)$. Let $x\in \Bbb{R}^d$ be arbitrary and consider the analytic(!) single variable function

$$t \mapsto f((1-t)x_0 + txt)$$

This function vanishes on an open neighborhood neighborhood of $0$, so that the 1-dimensional case implies that it vanishes identically. Hence, $f$ vanishes identically.

EDIT 2: It should also be observed that the claim is not true for measures of infinite (but still locally finite) measures: Consider for example

$$d\mu(x)= (1+\cos(\pi x))\,dx$$
on $\Bbb{R}$ with $r=1$. What happens here is that $\hat{\gamma}$ is not a continuous function anymore, but a finite sum of diracs. Thus, the argument above fails, since $\hat{f}$ has some (isolated) zeros.


text:
# Is it worth getting a telescope?

• Stargazing

## Main Question or Discussion Point

I've heard countless stories from my friends saying they only used theirs once or twice before it got old. I've been really interested in astronomy but is it worth the money?

Related Astronomy and Astrophysics News on Phys.org
Bandersnatch
Depends. Do you find the idea of going out of town for a few hours of stargazing every now and then enticing?
If you've never felt it worth the effort without a telescope, then I'd wager you won't change your mind when you get one.

turbo
Gold Member
I have owned many of them over the years, beginning when I was a child over 50 years ago. The enjoyment that you can get out of a telescope is proportional to your interests and your skill in selecting a proper instrument.

I've always enjoyed going out of town at night and looking at stars, but my friends say you don't see much difference through a telescope. I want to get into astronomy but I don't know if buying a telescope is the first step.

turbo
Gold Member
I have generally owned Newtonians or catadioptrics, but when Astro-Physics released their 6" APO, I had to have one. Soon, I added a 90mm APO as a finder/guidescope. I still have an ancient Comet-Catcher, but it is never used, and I intend to give it to a niece or nephew if they express an interest. I live under extremely dark skies, with lots of "faint fuzzies" to sweep up, but somehow I gravitated to planetary observing, and good-quality refractors were the logical choice.

Whenever I go out (even without telescopes), I always have my eyes and a decent pair of Nikon binoculars. A pair of 50mm objectives can sweep a lot of stuff, and the ability to use both eyes and integrate what you see is valuable. If a telescope is going to be used rarely, it's not worth spending the money. I might spring for a light-bucket at some time, but I'm pretty happy with the current stable of instruments.

Bandersnatch
You won't get anything resembling Hubble pictures, that's for sure. With a good telescope and CCD camera, you may get close, but that's a more advanced(and expensive) stuff. Check the astrophotography sticky thread in the general astronomy section to see some examples of people's pictures.

Now, it all depends on what do you need the telescope for. If it's just to see the planets as something more than points in the sky, or resolving details on the Moon's surface, then I'd advise against buying anything expensive. You'll probably end up doing just what your friedns say they did. You'll watch the Moon's craters, then Mars, Venus, Jupiter and Saturn. Then you'll notice that there's not much more to look at. Galaxies are going to look just like fuzzy monochromatic blobs, and there's little point in looking at the same planets and craters all over again.

If that's all you're thinking of, then buy a good pair of binoculars. They can give you similar experience to a small telescope, at much lower price and without being anywhere near as cumbersome logistically.

Now, say you want to do a project of some kind. Like observing the changes of Venus' phases over a year, or repeating Galileo's observation of Jupiter's moons, or drawing a detailed map of the Moon's features, or counting the sunspots(Never look at the Sun directly! Use a screen) - now these are more conveniently done with a telescope.

In my opinion, it's best to figure out what you want to observe first, then decide if you need a telescope to do it. Makes it easier to judge whether the expense is justifiable.

Bottom line is: get binoculars, and upgrade when you'll feel yourself being limited in what you want to do by lack of a proper tool.

Drakkith
Staff Emeritus
2018 Award
I personally don't enjoy visual observing much. It's astrophotography that I enjoy. Not only can I take pretty pictures, but I can also contribute to science as an amateur by doing photometry, astrometry, etc. I've even "seen" a transit of an exoplanet across the disk of its star by plotting the light output of the star over the course of an hour and a half and seeing the dip in the graph.

Hey bandersnatch you really helped thanks!
I think it's best for me to wait till I'm employed! So I can spend money on getting decent equipment.

I never go anywhere on vacation with a pair of Leica 10x50, IPad, astronomy software. My wife plans a vacation then I plan the astronomy I will get to see. On a trip to the Southern hemisphere I spent several hours watching eta carinea. Alas no super nova :)

I am a plebeian astronomer but enjoy sky watching.

davenn
Gold Member
I never go anywhere on vacation with a pair of Leica 10x50
I think you probably meant without ;)

Tyler Wayne said:
Is it worth getting a telescope?

I've heard countless stories from my friends saying they only used theirs once or twice before it got old. I've been really interested in astronomy but is it worth the money?
I sorta giggled when I read this....

If you have to ask that question, then probably not, your astro interest hasnt built up enough yet

Most people with a strong interest in astronomy would not be asking "do I need a scope?"
but rather "how big a scope should I get/can I afford?"

Tyler Wayne said:
I've always enjoyed going out of town at night and looking at stars, but my friends say you don't see much difference through a telescope. I want to get into astronomy but I don't know if buying a telescope is the first step.
well the stars dont look any different, they are still just points of light. But is ALL the other things you see that you cannot see with the naked eye ....
galaxies, star clusters, nebulae, planets and detail on them .... particularly Mars, Jupiter, Saturn
not to mention awesome detail of the Moons surface. Sunspots, eclipses, planet transits with solar observing and the correct filters

There's a lifetime of observing to do with a telescope of objects you cant see or at least cant see well with binoculars
And all the astrophotography like Drakkith, myself and others do with our scopes

cheers
Dave

davenn, thank you. yes, I take my binoculars :).

I realize this forum is international, so I am not sure it will be the same everywhere but in the Dallas / Fort Worth, Texas area there are several Astronomy Clubs. Some of the members are very keen telescope builders, a number of the members are professional Astronomers. As a group they always readily share their experience and knowledge.

Several of the local colleges have an adult night class in Astronomy. well worth taking.

Chronos
Gold Member
If you just want to ogle the night sky, I agree a good set of binoculars is all you really need. Most people need a social reason to maintain interest in observing, be it an astronomy club, ATM, astrophotography or participation in an amateur science program. Once you've seen an astrophysical body, you've seen it. It will generally look exactly the same for the next 50 or so lifetimes. That is not exactly exciting for most people. There are lovely pictures on the net of just about everything you could ever want to see through a scope, only better, so it is difficult to justify spending big money to see a fainter, less detailed image with your own eyes. Most serious amateurs eventually get the AP bug because capturing pictures of astrophysical bodies is incredibly challenging, others get caught up in doing actual science [e.g., AAVSO], or hanging out in clubs. Few remain in it just to be telescope tourists. Those are the ones whose scopes spend most of their time in solitary confinement. So, try to think long term before buying a scope. Do you plan to join a club, an amateur science group, take pictures? This will help greatly in selecting the instrument most amenable to your interests.

Do what Chronos said and join an astronomy club. I'm a part of a great local astronomy club (my friend and I are the only people under 30 years old, but that just means that we have a lot to learn from them ), and once a month we have an observing session at our observatory, which contains a 20" telescope, along with the various large telescopes and accessories that many members bring along.

I would recommend joining an astronomy club before buying anything. You'll get the chance to look through a few telescope before purchasing anything, and some members might be willing to sell you old telescopes for a lot cheaper than what you might find online. One older member even gave me a free eyepiece because he knew that I didn't have anything in the range of 40mm.

davenn
Gold Member
chronos said:
......Once you've seen an astrophysical body, you've seen it. It will generally look exactly the same for the next 50 or so lifetimes......
I sort of agree with that a little bit, but the universe often throws up wonderful suprises, yeah yeah I could have settled, as you suggest, for the Hubble images of Shoemaker-Levy9 hitting Jupiter. But to see the impact sites with my own eyes through my own home built telescope and be able to show that to my neighbours - we were all going WOWOW
30 years on with the various telescopes I have owned over the years, I am still finding new objects I havent seen before etc Every solar eclipse is a little different to the last one as are the transits of Mercury and Venus, the march of sunspot groups across the sun's surface and their waxing and waning through the solar cycles.
Many years ago it was wonderful to see my first transits and occultations of Jupiter's moons.
Or more recently the loss of one of Jupiter's more prominent equatorial regions belts and its slow reappearance.
Even the so called nonchanging galaxies change periodically when a star in one of them goes supernova ... you aint gonna see that with binoculars ;)

There's a joy to learning to find objects in the telescope by star hopping.... that one thing alone ( be it with a scope or binoculars) seriously improves you knowledge of the night sky

I couldnt imagine ever not owning a telescope

cheers
Dave

turbo
Gold Member
I couldnt imagine ever not owning a telescope
Same here. I don't always use them as much as I would like, due to health reasons, but it is so nice to know that they are out there in the garage, ready to go. Apochromatic refractors have gotten terribly expensive since I bought mine, but if you have the \$, they should deserve a decent look.

Also, before you spend a dime go to a star-party or two where you can audition the instruments of the participants. Get there early, so you can get a feel for the transport requirements and ease/difficulty of set-up. These will be very important to you, especially if you own a smaller vehicle. For a couple of decades, I have owned SUVs with fold-down rear seats, but it would be very difficult to fit that 6" refractor, mount and tripod in anything smaller. Some Dobs are modular and can fit into smaller vehicles, but that is not an option with a long refractor OTA.

Do your homework, and good luck.

. . . buy a good pair of binoculars. They can give you similar experience to a small telescope, at much lower price and without being anywhere near as cumbersome logistically.
I second this advice. In fact, I have heard this advice given repeatedly from astronomers and in astronomy forums. If you are just starting to explore an interest in stargazing, buy a pair of binoculars.

If your interest in stargazing does not grow, at least you won't have a one-purpose piece of equipment cluttering your home. Binoculars are useful for much more than stargazing.

It depends on a lot of things... your interest level probably being #1.

A lot of folks these days get a "goto" scope and then get bored after it has shown them a few objects, which don't look much like they do in photos.

Back in the day, astronomy as a hobby started with learning the constellations so that you could find what you were looking for... and that learning itself was a bit of an adventure, carried out over the course of one year. Next, you got used to your scope and how to find things with it by hopping from star to star. Part of that process was learning how to see with your scope, and what you could and couldn't see. By the time you got through all of this, you were a pretty good observer, and could ferret out the last bit of performance from your limited equipment, from the night's atmosphere, and from your particular light pollution situation. And you would have much of the sky memorized, including how to find all of your favorite objects.

I guess the point is, getting started in astronomy used to be a challenge, and that was much of the fun.

As some others have suggested, you really want to attend a few star parties held by local observing clubs. You will get to see exactly what you're getting into, and if your interest is still high after several of these, you might then think about a scope.

Damn. You guys sure talk kids out of getting a telescope. Way to go nerds

russ_watters
Mentor
Damn. You guys sure talk kids out of getting a telescope. Way to go nerds
Welcome to PF!

1. Nerds rule the world, if you hadn't noticed.

2. To each his own. Since basically everyone in the thread owns a telescope, we love them. But we also know that not everyone has the patience or wonderment to actually enjoy them. I love showing-off the night sky with my telescope to people who have never experienced it. But there are two kinds of people when it comes to the view through the telescope: Ones who can't keep their mouth closed and ones who wonder why what they see doesn't look like what is in magazines. If you're the former, a telescope might be for you. If you're the latter, you won't be happy with one. The choice is up to you. All we can do is provide you honest experiences.

+1 on checking out a local astronomy club. Around here, there are periodic Stargazing Open House(s) during the academic year when we can look through a really nice professional Celestron, computer driven scope and see all sorts of amazing stuff, curated by 'one who knows'. I think that this would be a really ideal way to start. Top equipment, curated by a knowledgeable operator. It is more fun than you can imagine. Try it.

diogenesNY

I was joking about the nerd thing. I thought nerds were capable of understanding sarcasm. again joking in case you didn't catch that. :) I was just so disappointed with the amount of posts telling my son not to get a telescope after I worked so hard to try to get him interested. I am willing to spend a lot of money for him to explore the universe but everything we read together turned both of us off. I guess we'll just stick to the usual things society wants our kids to be interested in.

Welcome to PF!

1. Nerds rule the world, if you hadn't noticed.

2. To each his own. Since basically everyone in the thread owns a telescope, we love them. But we also know that not everyone has the patience or wonderment to actually enjoy them. I love showing-off the night sky with my telescope to people who have never experienced it. But there are two kinds of people when it comes to the view through the telescope: Ones who can't keep their mouth closed and ones who wonder why what they see doesn't look like what is in magazines. If you're the former, a telescope might be for you. If you're the latter, you won't be happy with one. The choice is up to you. All we can do is provide you honest experiences.
I was joking about the nerd thing. Thought nerds were capable of understanding sarcasm. I was just disappointed that I was trying to get my son interested in something other than video games and sports and our research was so disappointing. perhaps the amount of money I'm willing to spend to expand his mind is a lot more than what this feed was talking about or he should just stick to video games and sports.

hows the world doing with the "nerds" ruling the world? So disappointed in this experience. Keep up the good work. Sad!

russ_watters
Mentor
I was joking about the nerd thing. I thought nerds were capable of understanding sarcasm. again joking in case you didn't catch that. :)
We do. Sarcasm is our favorite. But be careful, we're really really good at sarcasm and if you aren't careful, we'll take your joke and make it literal, then use it against you.

However, this confuses me:
I was just so disappointed with the amount of posts telling my son not to get a telescope after I worked so hard to try to get him interested.
You joined an hour ago and this thread is three years old. Is Tyler Wayne your son, Andy Simpson? No one in the thread said "don't get a telescope" and I would be willing to bet we weren't talking to your son. You chose a very poor way to get advice.

The correct way to get advice is to describe your goals and your chosen path toward achieving the goals, then ask people if that goal and path make sense and engaging in a discussion to focus-in on how best to achieve the goal.
I am willing to spend a lot of money for him to explore the universe but everything we read together turned both of us off. I guess we'll just stick to the usual things society wants our kids to be interested in...

...perhaps the amount of money I'm willing to spend to expand his mind is a lot more than what this feed was talking about or he should just stick to video games and sports.
Ok, I/we wish you the best. Since this thread is obsolete and doesn't match the new context, I'm locking it. If you wish to make a legitimate effort to ask a real question and engage in conversation about the answer(s), please feel free to start a new thread.


text:
Tags: forensics

Rating: 0

# Home Computer (forensics)

Let's go ahead and unzip the challenge and see what's in store for us.

Looks like we're dealing with an NTFS filesystem, and we're going to be doing some forensics on it. While Linux uses the open source ext4 and Mac OS X uses the proprietary APFS (Apple File System), NTFS stands for the New Technology File System, and is basically the proprietary filesystem that Windows systems use as Windows falls under the Windows NT (New Technology) family of operating systems.

Now, even though we have an NTFS filesystem right here, we can't just cd right on into it as we would a directory. We have the filesystem, not a directory that leads into the filesystem. In order to actually access the contents of the filesystem, we need to mount it to our own system at a specified mount point. After mounting the filesystem, then we can actually access it as if it were a directory.

We first need to create a mount point. The standard for mounting is to create mount points in the /mnt directory. We create a mount point by creating a directory, and so we can use mkdir as we would any regular directory. You'll often times need to do this as a higher privileged user, though, since it is of course being done in the /mnt directory and the nature of this operation warrants higher security measures.

After creating a mount point, we can then mount the NTFS filesystem to the mount point using mount. We'll also pass -t ntfs to specify that the type of filesystem we're mounting is NTFS, and we'll pass into the required positional arguments our filesystem in question as well as the desired mount point.

After successfully mounting, we'll go ahead and cd into the filesystem via the mount point and then list the contents using ls.

Let's navigate around and see if the flag is around here anywhere or if there are otherwise any clues. On Windows NT filesystems, user home directories can be found in C:\Users, so we'll snoop around there.

We stumble upon a hint in C:\Users\Family\Documents\credentials.txt.

It looks like the flag is an image file kept in extended attributes. Extended attributes are an interesting feature part of NTFS filesystems. Extended file attributes are used to attach metadata to files while being basically invisible as the system itself doesn't have much use for the data that they hold. Extended file attributes can store data of arbitrary lengths. They are not necessarily embedded into a file, per se, but are much closer along the lines of "abstractly linked."

On NTFS systems, extended file attributes can be found in alternate data streams, a particularly interesting feature of NTFS filesystems. Alternate data streams are essentially invisible to the untrained person in almost all ways, but anybody who knows what they're looking for can easily uncover them. Alternate data streams are often times used to hide data or, in more malicious circumstances, hide malware or parts of malware.

One of my favorite tools when it comes to filesystem forensics is The Sleuth Kit. I highly recommend them and they are the ones that I used for this challenge. They are, of course, free and open source, as all things should be.

In order to uncover the alternate data stream supposedly associated with C:\Users\Family\Documents\credentials.txt, we need to find its inode, and then we'll display the contents of the said inode. A file's inode is essentially a structure that stores all the information about a file except for its name and data, and in this case, we need to discover it to use as an identifier in order to display its contents.

Before we continue any further, we no longer have a purpose for the mounted filesystem. Everything from here forwards will be done on the NTFS filesystem file. We can go ahead and unmount the mounted filesystem using umount, and then we can remove the mount point created earlier using rmdir. This will, once again, require higher user privileges.

We can list all the file and directory names on the disk image using fls. We'll also pass -r so that it lists files recursively. Then, we're going to pipe the output into grep and look for the credentials.txt file in order to filter out everything else.

Looks like we've uncovered the extended attributes found in the alternate data stream associated with this file! We'll use its identifier, 13288-128-4, in order to display its contents using icat (image cat). We can expect a lot of data to be outputted to the terminal that we don't need to understand since it's just image data, so let's instead do something more useful with it like piping it into file to see if it is indeed the image file (with image in this case meaning picture) that credentials.txt was talking about. We'll pass - into file to specify that we want it to read from STDIN. file, oddly, doesn't understand that from pipes.

Looks like we got it! Let's go ahead and icat its contents again, but this time redirecting the output into a file, and then opening it up using an image viewer.

This challenge was a lot of fun, and I learned a lot from it, especially since I didn't know a single thing about NTFS filesystems before this. Well done, Google. It sent me on a rabbit hole and I learned a lot more than I probably needed to about NTFS filesystems, but the more the merrier.

## Flag

CTF{congratsyoufoundmycreds}

# Next Stop

Next stop: [Government Agriculture Network](https://github.com/shawnduong/ctf-writeups/blob/master/2019-GOOGLE/beginners-quest/day3-government-agriculture-network.md)


text:
babyagelesszj

2022-07-07

Two lines: ${a}_{1}x+{b}_{1}y+{c}_{1}=0$ and ${a}_{2}x+{b}_{2}y+{c}_{2}=0$ are given. I know that the equation of its bisectors is $\frac{{a}_{1}x+{b}_{1}y+{c}_{1}}{\sqrt{\left({a}_{1}^{2}+{b}_{1}^{2}\right)}}=±\frac{{a}_{2}x+{b}_{2}y+{c}_{2}}{\sqrt{\left({a}_{2}^{2}+{b}_{2}^{2}\right)}}$ But I intend to find which one is the obtuse angle bisector and which one is the acute angle bisector. I want to find a general formula Assuming ${c}_{1},{c}_{2}$ both are of same sign, I know if ${a}_{1}{a}_{2}+{b}_{1}{b}_{2}>0$ and if we take the positive sign we get the obtuse angle bisector and vice versa. But I want to prove it using general equation of line, I tried to find the angle between bisector and original line i.e. $tan\theta =\frac{{m}_{1}-{m}_{2}}{1+{m}_{1}{m}_{2}}$ and then if it is greater than one it will be of obtuse angle but calculations are tough if we use general equation of line. May anyone give a simple proof of the following statement: "Assuming ${c}_{1},{c}_{2}$ both are of same sign IF ${a}_{1}{a}_{2}+{b}_{1}{b}_{2}>0$ then if we take positive sign we get the obtuse angle bisector".

Dobermann82

Expert

We have two lines :
${L}_{1}:{a}_{1}x+{b}_{1}y+{c}_{1}=0,\phantom{\rule{1em}{0ex}}{L}_{2}:{a}_{2}x+{b}_{2}y+{c}_{2}=0$
and the angle bisectors :
${L}_{±}:\frac{{a}_{1}x+{b}_{1}y+{c}_{1}}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}=±\frac{{a}_{2}x+{b}_{2}y+{c}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}$
If we let $\theta$ be the (smaller) angle between ${L}_{+}$ and ${L}_{1}$, then we have
$\mathrm{cos}\theta =\frac{|{a}_{1}\left(\frac{{a}_{1}}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}-\frac{{a}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}\right)+{b}_{1}\left(\frac{{b}_{1}}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}-\frac{{b}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}\right)|}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}\sqrt{{\left(\frac{{a}_{1}}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}-\frac{{a}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}\right)}^{2}+{\left(\frac{{b}_{1}}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}-\frac{{b}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}\right)}^{2}}}$
$=\frac{|\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}-\frac{{a}_{1}{a}_{2}+{b}_{1}{b}_{2}}{\sqrt{{a}_{2}^{2}+{b}_{2}^{2}}}|}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}\sqrt{2-2\frac{{a}_{1}{a}_{2}+{b}_{1}{b}_{2}}{\sqrt{\left({a}_{1}^{2}+{b}_{1}^{2}\right)\left({a}_{2}^{2}+{b}_{2}^{2}\right)}}}}×\frac{2\frac{1}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}}{2\frac{1}{\sqrt{{a}_{1}^{2}+{b}_{1}^{2}}}}=\sqrt{\frac{1-\frac{{a}_{1}{a}_{2}+{b}_{1}{b}_{2}}{\sqrt{\left({a}_{1}^{2}+{b}_{1}^{2}\right)\left({a}_{2}^{2}+{b}_{2}^{2}\right)}}}{2}}$
Hence, we can see that

as desired.

(Note that "${c}_{1},{c}_{2}$ both are of same sign" is irrelevant.)

Do you have a similar question?


text:
# How to align 3D viewport along two 3D points using python

I'm trying to figure out how to align my 3D viewport to the line connecting two 3D points.

For example, say I want my 3D viewport to be oriented such that it looks directly along the line connecting (1, 2, 3) to (6, 5, 4). As an added constraint, say I wanted to position the viewpoint a distance of 10 from the point (1, 2, 3).

I know how to query the current view_location, view_matrix, view_distance, and view_rotation, but I am unfamiliar with how to transform it to be in the correct position and orientation.

C = bpy.context
viewports_3D = []
for area in C.screen.areas:
if area.type == 'VIEW_3D':
viewports_3D.append(area)
viewports_3D[0].spaces.active.region_3d.view_location
viewports_3D[0].spaces.active.region_3d.view_matrix
viewports_3D[0].spaces.active.region_3d.view_distance
viewports_3D[0].spaces.active.region_3d.view_rotation

• If no one else does, I might write a full answer later... You basically subtract (1,2,3) from (4,5,6) and normalize the result.. This gives you yaw and pitch, but not roll. Then you multiply the normalized result by -10 and add back the (1,2,3) to get your camera position. – Ron Jensen Dec 8 '20 at 23:37
• Thanks for the reply. I'm still not sure how to get the angles, and how I should feed this into the blender python commands to change the viewport – Will Sni Dec 9 '20 at 13:51

I've been way busier than expected, so I'm going to post some code and skip the explanation for now... Basically, the viewport is a lookat camera that looks at its location from the distance specified.

import bpy
from mathutils import Vector, Euler
from math import atan2, sqrt

start = Vector([1,2,3])
stop  = Vector([4,5,6])

norm = start - stop
print(norm)
norm.normalize()
print(norm)

heading = -atan2( norm.y, norm.x )

pitch = -atan2( sqrt( norm.x**2 + norm.y**2), norm.z )

euler = Euler( (pitch, 0, heading ) , 'XYZ' )
print(euler)
quat  = euler.to_quaternion()
print(quat)

C = bpy.context
viewports_3D = []
for area in C.screen.areas:
if area.type == 'VIEW_3D':
viewports_3D.append(area)

viewports_3D[0].spaces.active.region_3d.view_rotation=quat
viewports_3D[0].spaces.active.region_3d.view_location=stop #lookat this point
viewports_3D[0].spaces.active.region_3d.view_distance=6 # from this far away

Track to quaternion.

Can get the quaternion rotation of any vector using Vector.to_track_quat(track, up) and assign an axis to track and an axis for up.

Test script to make the largest 3d view in the area track from the scene camera to the active object.

import bpy

context = bpy.context
scene = context.scene
cam = scene.camera
ob = context.object

start = cam.matrix_world.translation
stop  = ob.matrix_world.translation

norm = start - stop
norm.normalize()

q = norm.to_track_quat()

viewports_3D = [
a
for a in context.screen.areas
if a.type == 'VIEW_3D'
]

viewports_3D.sort(
key=lambda vp: (vp.width * vp.height),
)

# use max area vp
if viewports_3D:
vp = viewports_3D.pop() # largest
r3d = vp.spaces.active.region_3d
r3d.view_rotation = q
r3d.view_location = start #lookat this point
r3d.view_distance = 0 # from this far away

Note above uses default for track to so vector is flipped, more concise would be

norm = stop - start #start - stop
norm.normalize()

q = norm.to_track_quat('-Z', 'Y')

This is equivalent of the result of adding a track to constraint on camera to object. Have used to test