text:
# Linear-phase crossover filters

Is it possible to design linear-phase filters that sum to a flat frequency response? If so is it practical to use them in real-time audio processing for as many as 10 bands?

My experience has only been with Linkwitz-Riley IIR filters, but I would like to explore the possibilities of linear phase or minimum phase filters.

From my initial research it looks like the frequency sampling method would result in ripples and wouldn't sum to a flat response (especially across several bands).

• How much latency can your application tolerate from the linear-phase crossover filters? Oct 18 '20 at 6:48
• are you band-splitting for the purpose of loudspeaker crossovers? or are you band-splitting for some other purpose, like multiband signal processing? is this like wavelet/filterbank processing? Oct 19 '20 at 2:50
• @OlliNiemitalo I havent put much thought into that, but I would want to keep it fairly low since it is for use in audio mixing. Oct 19 '20 at 3:33
• @robertbristow-johnson This is for the purpose of multiband signal processing. The reason I'm interested in this is because I would like to maintain the integrity of the original phase response as closely as possible. Oct 19 '20 at 3:35
• do you want your bands to be logarithmically spaced? how many bands? how much overlap? Oct 19 '20 at 12:54

Well, by definition of linear phase filter follows that $$A(f)$$ of the filter response $$H(f) = A(f)e^{-j2\pi \frac{N}{2} fT}$$ is a linear combination of cosines of different frequencies therefore is quite impossible to obtain a flat band (basically you need infinite coefficients of the impulse response). But you can always approximate it quite well because there is the so called direct optimization method or Parks-McClellan method that allows you to obtain a linear phase filter from the specifications of error in the passband and the error in the stop band.

The only drawback of this filter is that you have to do lots of calculous. In audio applications for example, if you try to design a filter that attenuate $$40$$dB and has a transition bandwidth of $$100$$Hz you will find that you need $$100$$ coefficient. This is not too much for a CPU and the filter will be really powerful.

I will also want you to focus on an underrated problem that lot of people don't notice. If you try to increase the sampling frequency (because you want more resolution) also the filter coefficients must increase to approximate the same filter impulse response.

• Thanks for answering this! I'm glad to know that this is at least possible. I'm afraid that doing it may be too CPU heavy for 10 bands which also have additional processing going on and also oversampling. This is for an audio application which currently supports up to 8x oversampling. The oversampling alone causes a huge increase in CPU usage. Oct 19 '20 at 3:31
• Any references to material on implementing something like this would be appreciated. I've found it surprisingly diffult to find info on discrete FIR crossovers. Oct 19 '20 at 3:32
• Do you mean 10 times the bandwidth of your signal? Then as I already anticipated, if you oversample a signal then your filter should operate at that frequency which is higher (obviously) and therefore is more task intensive. There are 2 solution to this, the so called polyphase realization which seems to be magic but in reality is really easy, and the multi stage realization but I don't know if those are feasible in your case. Oct 19 '20 at 12:56
• Unfortunately I do not have specific references to this and therefore even in the "discrete time signal processing by A. V. Oppenheim" or the "digital signal processing by Proakis and Manolakis" there isn't the implementation of the algorithms. Fortunately is really simple and I can give you my commented code. There is also a book of Manolakis which is called "applied digital signal processing" that I'm pretty sure gives you at least one algorithm. Try also to see the " the art of Virtual Analog filter by Vadim Zavalishin" to look at some filters realization. Oct 19 '20 at 12:56

Is it possible to design linear-phase filters that sum to a flat frequency response?

Yes, of course.

If so is it practical to use them in real-time audio processing for as many as 10 bands?

That depends on your definition of practical. The problem at audio is that FIR filters at low frequencies get really long. It depends on the lowest frequency, desired steepness and amount cross band rejection. but a few thousand taps is typical. These can be fairly efficiently implemented using an FFT based scheme like Overlap Add, but that introduces a lot of latency: typically it's twice the filter length. That's prohibitive for many real time applications.

If you want to build a standard 10-band audio equalizer: this can be done very efficiently with cascaded biquads where each biquad is a "peakingEQ" filter and simply recalculate the filter coefficients whenever a band changes gain.

Parallel IIR bandpass filters are difficult to phase manage but it's possible. Odd Butterworth and Linkwitz Riley filter sum to a flat magnitude response but NOT a flat phase response, so you need to put compensation allpass filters in the parallel paths

• Thanks this is the answer I was looking for. I'm going to look more into the overlap-add algorithm since it seems fairly straight forward, however, I think my current implementation (using biquads) may be my best bet for now. At least now I know this is possible. Thanks! Oct 19 '20 at 3:29


text:
Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/functions.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/functions.php on line 1

Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/inc/template-tags.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/inc/template-tags.php on line 1

Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/header.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/header.php on line 1
oxidation number of n in n3h oxidation number of n in n3h

Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/searchform.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/searchform.php on line 1

Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/template-parts/content-page.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/template-parts/content-page.php on line 1

# oxidation number of n in n3h

Class-11-science » Chemistry. Assign an oxidation number of -2 to oxygen (with exceptions). 23-11A Oxidation States of Nitrogen in Organic Compounds. How do you think about the answers? For example, the oxidation number of Na + is +1; the oxidation number of N 3-is -3. The other N is part of NO3{-}, so its oxidation number is 5+. Sep 11,2020 - What is oxidation number of N in (NH4)2SO4? NCERT NCERT Exemplar NCERT Fingertips Errorless Vol-1 Errorless Vol-2. 5 years ago. Its a convention which everyone follows. NO 3 − N = +5 compound oxidation # of individual atom total oxidation state caused by each atom-type: adds up to − 1 NO O 3 −-2-6 Using the info that you know about O you can fill in the chart above. The nitrogen is part of the cyano group which is bound to Fe. NCERT RD Sharma Cengage KC Sinha. 6 months ago. Chemistry, 04.12.2020 19:40, boston6686 Determine the oxidation number of C in H In this ion, also known as tetrathionate ion, There are 4 S atoms. Source(s): oxidation number ammonia nh3: https://shortly.im/ilkMk. Request. N.p., n.d. What are the oxidation states of nitrogen in NO and NO_2? Oxidation number of a mono atomic ion is equal to the charge of the ions. You can sign in to vote the answer. Show transcribed image text. Therefore, the oxidation number of the N atom is -3. What is the oxidation number on N in Li3N? Hence it is a neutral molecule. Share. NCERT DC Pandey Sunil Batra HC Verma Pradeep Errorless. Plz explain Share with your friends. Available here. This question is part of Assigning Oxidation Numbers. Nitrogen dioxide (NO 2) is a molecule which contain two oxygen atom and one nitrogen atom. Web. kkujat. … Oxidation number of N in N3H is ? Class 12 Class 11 Class 10 Class 9 Class 8 Class 7 … The oxidation number of each atom can be calculated by subtracting the sum of lone pairs and electrons it gains from bonds from the number of valence electrons. Bonds between atoms of the same element (homonuclear bonds) are always divided equally. 1(b). Download PDF's . The N on the left is part of NH4{+}, so its oxidation number is 3-. Now, this calculates the average oxidation state of the two N atoms. Oxidation Number. If HNO4 exists, it has to be a peroxy acid; that’s the only way to squeeze an extra O in without fouling up the bonding. Share 2. 10 years ago +3. davisoldham. Since there are 3 atoms of Chlorine ==> 3 x ( -1 ) = -3. Oxidation number, also called oxidation state, the total number of electrons that an atom either gains or loses in order to form a chemical bond with another atom.. Each atom that participates in an oxidation-reduction reaction is assigned an oxidation number that reflects its ability to acquire, donate, or share electrons. The oxidation number for N is -3. Please don't post or ask to join a "Group" or "Whatsapp Group" as a comment. Question: What Is The Oxidation Number Of Nitrogen In The Nitrate Ion? if there are two unknowns? Well, as usual, the oxidation number of H is +I as is typical.... And the sum of the individual oxidation numbers is equal to the charge on the ion... And so N_"oxidation number"+4xxI^+=+1 N_"oxidation number"=-III For a few more examples .... see this older answer. You could argue that NH3 is nitrogen(III) hydride and assign hydrogen an oxidation state of -1, making nitrogen have an oxidation state of +3. The oxidation number of N in NO 2 − needs to be determined. rules, but there doesn't appear to be one for carbon. N is -3 and H is +1 . Relevance. Available here. Maths. Follow. What is the oxidation number of nitrogen in Al (NO3)3? how do you find the oxidation no. When it comes to calculation the oxidation number of N in KNO3, we can make a small equation. Expert Answer 100% (3 ratings) Oxidation Number of Nitrogen in NO 2 (Nitrogen Dioxide). In HCN, H has a +1 oxidation number. So nitric oxide NO has an over all charge of 0 and the O has a charge of negative 2 so the N has to be +2. K=+1 N=x O=-2. Oxidation number of nitrogen atom can be found by two methods, algebra method and observing structure of molecule. Oxidation number of N in NH_(4)NO_(3) is: Books. Note. A proton is +1, so carbon and nitrogen together have to be -1. Post an Answer. The sum of the oxidation states has to be zero. Whatvis the oxidation number of N in hydrazoic acid Ask for details ; Follow Report by Saurabhbamborde8 30.12.2018 Log in to add a comment For total oxidation to be 0, N should have an oxidation number of +3 ... :) I hope i helped you...! If I break the N-H bonds I am left with N^(3-) and 3 xx H^+. Compounds do not have oxidation numbers. 2(N) + 4(H) + 3(O) = 0. The oxidation number of N in two species is different as shown below: In NH;, Let the oxidation state of N in NH4 + be x. x + 4x(+l) = +l x = … oxidation number N in HCN? 1 decade ago. NCERT DC Pandey Sunil Batra HC Verma Pradeep Errorless. Try it risk-free for 30 days Try it risk-free Ask a question. This cyano group is virtually identical to the cyano group which is bound to hydrogen in HCN. Now, NH3 = 1(-3) + 3(+1) = -3 + 3 = 0. Physics. Biology. Concept introduction: Oxidation number is the charge assigned to an atom of a molecule or ion according to some arbitrary rules. Chemistry. The oxidation number of nitrogen in ammonia or ammonium ion is -3 because nitrogen in ammonia is assigned an oxidation state of -3. Sign in. That's because the oxidation number is the average of the various oxidation states in the ion/molecule/compound. Oxidation number: charge that results on the atom when the electrons in a bond are assigned to the more electronegative atom (i.e., the charge that an atom would possess if the bonding were ionic) Rules for oxidation numbers: 1(a). Oxidation number of nitrogen is important to decide to whether NO 2 can be oxidized or reduced. Rudyard. Web. Is it 1 or -1? In HCN and in K3Fe(CN)6, the carbon has a +2 oxidation number and N has a -3 oxidation number. Oxidation number of N in N3H is Plz explain - Chemistry - Redox Reactions. The elements in them do. Nitrogen has a wide range of oxidation states in organic compounds. 0 0. Maths. NCERT P Bahadur IIT-JEE Previous Year Narendra Awasthi MS Chauhan. 5 years ago. Lv 7. Lv 5. 1 0. hcbiochem. 1 0. Oxidation number of N in NH_(3) is. Books. | EduRev Class 11 Question is disucussed on EduRev Study Group by 240 Class 11 Students. See the answer. Now, you know that the oxidation number of Cl = -1. ive been given a set of oxidation no. N.p., n.d. The two nitrogens will have very different oxidation states. Umme Aiman. Answer Save. Asked by Kkujat, Last updated: Jan 01, 2021 + Answer. Here the oxidation number of Nitrogen is -3 and that of Hydrogen is +1. It will be deleted. That averages out to +2.5 per S atom and hence corresponds to your oxidation number. The oxidation number of a monatomic ion equals the charge of the ion. Anonymous. Now let's put it all together. Oxidation Number: The number of units of charge that appear in the symbol of an element is the oxidation number for that element. Oxygen has an oxidation state of −2 except when it is in in peroxides, superoxides, ozonides, and oxygen difluorides. Give the oxidation number of the nitrogen in each of the following compounds: a. In Chemistry 5 Answers Available Asked by Stephlove on 30th June, 2019 To get notifications when anyone posts a new answer to this question, Follow New Answers. Oxidation number is the charge left on the central atom when each of the bonding pairs are broken, with the charge going to the most electronegative atom. 2.”Rules for Assigning Oxidation Numbers to Elements.” Dummies. Elements in groups 1,2,and 3 have a charge of +1,+2,+3. HNO4 is not a formula for a normal oxyacid. What is the oxidation number of Ammonia (NH3)? 2(N) + 4(+1) + 3 (-2) = 0. NCERT P Bahadur IIT-JEE Previous Year Narendra Awasthi MS Chauhan. There are 2 with oxidation state +0 while there are 2 with oxidation states +5. With $N_\mathrm{i}(\ce{e-})$ representating the number of electrons in a free atom, and $N_\mathrm{f}(\ce{e-})$ the one after separation (One should not forget the lone pairs). The oxidation number of a free element is always 0. NCERT NCERT Exemplar NCERT Fingertips Errorless Vol-1 Errorless Vol-2. ; When oxygen is part of a peroxide, its oxidation number is -1. . Physics. Favourite answer. For the methylcarbocation (one positive charge), there are three carbon‐hydrogen bonds (hydrogen < carbon); hence: (+3) + n = 1, and therefore n = −II leading to (C −II H 3) +.The carbon oxidation number for carbon in the methylcarbanion can easily be seen to be −IV (C −IV H 3) −.Oxidation numbers of atoms in many compounds of biochemical interest are listed in Table III. Chemistry. ==> The oxidation number of N has to be equal to that of 3 Cl's. Kkujat. Redox Reactions. About the Author: Madhusha. NCERT RD Sharma Cengage KC Sinha. 0. From our rules we know that O= -2 and we can find K on the periodic table, in the first group, thus giving it a +1 charge. ==> Total oxidation number is 0. 5 Answers. Figure 1. What is oxidation no Of Nitrogen in N3H If it is -1/3 then can it be possible - Chemistry - Solutions The oxidation number of an atom of any element in its elemental state is zero. 05 July 2017. Also, NCl3 is a neutral compound. :0: N :0: :0: This problem has been solved! The usual oxidation number of hydrogen is +1. The oxidation state of N in the ammonia molecule is -III. HNO3 is about as high as it gets. Biology. 3.”Coordination Compounds.” Coordination Compounds Help Page. (b) NH 4 NO 3 is an ionic compound consisting of NH4 + and NO3- ion. Class 12 Class 11 Class 10 Class 9 Class 8 Class 7 Class 6. Become a member and unlock all Study Answers. The atoms in He and N 2, for example, have oxidation numbers of 0. Answered Dec 06, 2017 -3 3-Rule 2e. 05 July 2017. Different ways of displaying oxidation numbers of ethanol and acetic acid. N = +1. There are a few exceptions to this rule: When oxygen is in its elemental state (O 2), its oxidation number is 0, as is the case for all elemental atoms. Download PDF's . 3 0. In almost all cases, oxygen atoms have oxidation numbers of -2. NCERT Solutions; Board Paper Solutions; Ask & Answer; School Talk; Login; GET APP; Login Create Account. Answer Anonymously; Answer Later; Copy Link; 1 Answer.

# Our Services

## Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras accumsan enim vel blandit tempus.

### IV Therapies

Our Infusion Center has a wide variety of IV Therapies For Your Cancer Support Treatment....

### Nutrition

Our Team of Nutritionists Will Determine The Best Diet Plan For Your Treatment Protocol....

### Oxidative Therapies

The Healing Power Of Oxygen Is At Your Fingertips At Progressive Oncology....

### BioMedical Therapies

BioMedical Therapies Use Advanced Electro-Magnetic Technology To Heal The Body....

### Chemo-Sensitivity Testing

Every Person Is Different. We Want To Make Sure We Find The Right Treatment For You....

...

...

### Become A Patient

...

Notice: Undefined offset: 11 in /home/progonc/public_html/wp-content/themes/oncology/footer.php on line 1

Warning: assert(): Assertion failed in /home/progonc/public_html/wp-content/themes/oncology/footer.php on line 1

format: plain


text:
# Trig in equation

1. Jan 18, 2007

### Aristodol

we have:

sin^2 x(tan x)=1356

it is very simple I no but I just can't remember the way to go about solving this problem, especially because of the sin^2

2. Jan 18, 2007

### chanvincent

1. $$tan(x) = \frac{sin(x)}{cos(x)}$$
2. $$cos(x) = \sqrt{1 - sin^2(x)}$$
4. do a substitution $$y = sin^2(x)$$, then you will have a 3th order polynomial


text:
This Title All WIREs
How to cite this WIREs title:
WIREs Comput Mol Sci
Impact Factor: 8.836

# Mixing of intermolecular and intramolecular vibrations in optical phonon modes: terahertz spectroscopy and solid‐state density functional theory

Can't access this content? Tell your librarian.

Advances in terahertz (THz) spectroscopy and solid‐state density functional theory (DFT) have enabled a better understanding of low‐frequency molecular phonon modes in the region that includes intermolecular interactions. Normal modes in this region, in particular, may have contributions under the harmonic approximation from both intermolecular and intramolecular nuclear motions. A newly developed mode analysis allows us to characterize molecular optical phonon modes in terms of intermolecular and intramolecular vibrational mixing for the C60 , anthracene, adenine, α‐glycine, and l‐alanine crystals. Through systematic investigation, two forms of the vibrational mixing have been identified. One is strong mixing within similar characteristic frequency regions, while the other is weak mixing of distinct characteristic frequency regions separated by a large gap. The former is predictable from classical mechanics and appears in molecular systems having structural flexibility. The latter is nonclassical and has been illustrated in amino acids. This finding provides new insights into the nature of molecular optical phonon modes and related physical and/or chemical processes such as energy transfer between internal and external modes with large energy separation. WIREs Comput Mol Sci 2016, 6:386–409. doi: 10.1002/wcms.1256

• Structure and Mechanism > Molecular Structures
• Electronic Structure Theory > Density Functional Theory
• Theoretical and Physical Chemistry > Spectroscopy
Structural information for C60 (a), anthracene (b), adenine (c), α‐glycine (d), and l‐alanine (e) crystals. The left side in each panel shows the three principal axes x, y , and z of the irreducible molecular unit(s), while the right side shows the spatial packing structures of all molecules in the unit cell. The red, green, and blue lines represent the three unit cell vectors a, b, and c, respectively. For the cubic C60 and orthorhombic l‐alanine systems, the three Cartesian coordinate axes X, Y, and Z are coincidental with the directions of the three unit cell vectors a, b, and c, respectively. For the other three monoclinic systems, the directions of X and Y are coincidental with that of a and b, while Z points away from c. Their relationships are shown explicitly. Intermolecular CH/π and hydrogen bonds are shown. Molecules in different layers of the anthracene and adenine crystals are shown in different colors for clarity. The dipole moments of C60 and anthracene are zero because of high symmetry. The dipole moments are 0.17 D for both adenine #1 and #2, and 1.05 and 1.01 for glycine and l‐alanine, respectively.
[ Normal View | Magnified View ]
Frequency distribution of vibration (FDV) patterns of the total intermolecular translation and libration and the two intramolecular skeletal and NH3 + torsions. The results are shown for (a) α‐glycine and (b) l‐alanine.
[ Normal View | Magnified View ]
Construction of the bases for internal modes. The nine internal modes of an irreducible molecule in the unit cell are shown for (a) α‐glycine and (b) l‐alanine. All vibrational schemes have been amplified equally.
[ Normal View | Magnified View ]
All inner products of intramolecular vibrational vectors $Q # 1 n , i n t r a$ for all optical phonon modes of α‐glycine in the 0–1050 cm−1 region.
[ Normal View | Magnified View ]
Mode analysis of crystalline l‐alanine. (a) Simulated IR‐active phonon modes in the 0–800 cm−1 region. Lorentzian line shapes with HWHM = 2.0 cm−1 were convolved into all modes for visualization. All optical modes are categorized into nine groups in terms of frequencies. The mode range in each group is labelled. (b) Percentage contributions of the three intermolecular translations, the three intermolecular librations, and the total intramolecular vibration in each mode. (c) Percentage contributions of the nine elementary intramolecular vibrations as well as the residual motion in the total intramolecular vibration in each mode.
[ Normal View | Magnified View ]
Mode analysis of crystalline α‐glycine. (a) Simulated IR‐active phonon modes in the 0–1050 cm−1 region. Lorentzian line shapes with HWHM = 2.0 cm−1 were convolved into all modes for visualization. All optical modes are categorized into nine groups in terms of frequencies. The mode range in each group is labelled. (b) Percentage contributions of the three intermolecular translations, the three intermolecular librations, and the total intramolecular vibrations in each mode. (c) The percentage contributions of the nine elementary intramolecular vibrations as well as the residual motion in the total intramolecular vibration in each mode.
[ Normal View | Magnified View ]
Mode analysis of crystalline adenine. (a) Simulated IR‐active phonon modes in the 0–1000 cm−1 region. Lorentzian line shapes with HWHM = 2.0 cm−1 were convolved for visualization. The mode numbers of the representative IR/Raman bands are labelled. (b) Characteristics of optical phonon modes of adenine in the same spectral region. Each irreducible unit in the unit cell is composed of an adenine dimer; thus, in certain modes, one molecule can be in motion, while the other one is at rest. The percentage contributions of translations, librations, and the total intramolecular vibration in each phonon mode are calculated by averaging their RMSMWDs in the irreducible molecules.
[ Normal View | Magnified View ]
Mode analysis of crystalline anthracene. (a) Simulated IR‐active phonon modes in the 0–1000 cm−1 region. Lorentzian line shapes with HWHM = 2.0 cm−1 were convolved for visualization. The mode numbers of the representative IR bands are labelled. (b) Characteristics of optical phonon modes in the same spectral region. The upper, middle, and bottom panels show the percentage contributions of the three intermolecular translations, the three intermolecular librations, and the total intramolecular vibration in each mode, respectively.
[ Normal View | Magnified View ]
Mode analysis of crystalline C60. (a) Simulated IR‐active phonon modes in the 0–300 cm−1 region. Lorentzian line shapes with a half‐width at half‐maximum (HWHM) = 2.0 cm−1 were convolved for visualization. The mode numbers of the two IR bands are labelled. (b) Characteristics of all the optical phonon modes in this region. The upper, middle, and bottom panels show the percentage contributions of the three intermolecular translations, the three intermolecular librations, and the intramolecular vibrations in each mode, respectively.
[ Normal View | Magnified View ]

### Browse by Topic

Electronic Structure Theory > Density Functional Theory
Theoretical and Physical Chemistry > Spectroscopy
Structure and Mechanism > Molecular Structures


text:
Disambiguating arccosine/arcsine functions

1. Jul 19, 2007

techninja

Hi all,

I'm working on a program, and it seems that I can't get the trigonometry in my head right. I have two equations, sin(omega) = something and cos(omega) = something, and I need to find what omega is.

Given that there are two trig functions, I should be able to disambiguate what quadrant omega is in.

On the other hand, I don't quite understand the process of how this would be done.

Any help or input would be greatly appreciated!

2. Jul 19, 2007

Staff: Mentor

Thread moved to Homework Help forums (where homework and coursework should be posted).

What are the +/- signs of the sin and cos functions in the 4 quadrants?

3. Jul 19, 2007

techninja

Well, if we're going to go thataway, sine is positive in I and II, cosine is positive in I and III. Arcsine is defined in I and IV, arccosine is defined in I and II.

Thanks!

4. Jul 19, 2007

Staff: Mentor

5. Jul 19, 2007

techninja

Nope; not at all. :rofl:

6. Jul 19, 2007

VietDao29

Well, firstly, you have to check for the existence of omega. You know the relation between sine, and cosine function, right?

$$\sin ^ 2 \omega + \cos ^ 2 \omega = 1$$

If the above equation holds, then omega exists, if not, it doesn't. Do you know why?

We don't need the arcsin, and arccos part here.

Ok, so, say, if sin(omega) is positive, and cos(omega) is negative, what quadrant is omega in?

:)

7. Jul 19, 2007

techninja

That's a trig identity, I believe.

And, if sine is positive, it would be arccos(cos(omega)), and if not, it would be... 2*pi-arccos(cos(omega))?

Would that be right?

Thanks. (:

8. Jul 20, 2007

VietDao29

Yup, correct. :)

However, does your omega has any restriction? i.e, say, must it be on the interval [0; 2pi[? Or anything along those line?

If omega must be on [0; 2pi[, then your solution would be:

$$\left[ \begin{array}{ll} \omega = \arccos (\cos (\omega)) , & \quad \mbox{for non-negative } \sin \omega \\ \omega = 2 \pi - \arccos \cos ( \omega ), & \quad \mbox{for negative } \sin \omega \end{array} \right.$$

If, omega can be anything, then the general solution for omega would be:

$$\left[ \begin{array}{ll} \omega = \arccos (\cos (\omega)) + \2 k \pi , & \quad \mbox{for non-negative } \sin \omega \\ \omega = - \arccos ( \cos \omega ) + 2 k' \pi , & \quad \mbox{for negative } \sin \omega \end{array} \right.$$, where k, and k' are both integers.

You got it correctly. Congratulations. ^.^

Can you complete the programme? :)

Last edited: Jul 20, 2007


text:
# [NTG-context] a cross-reference query

Henning Hraban Ramm texml at fiee.net
Tue May 10 08:47:26 CEST 2022

Hi Julian,

while I can’t help you with the real issue, a few hints:

* Look into the .tuc file for the references. Do you find differences
between working and not-working examples?

* Do the examples work if you take them out of your big document or if
you change the order?

* There are “strange” space characters in your message, they disappear
in the quoted version below. That might cause troubles in typesetting
and referencing.

* You don’t need to set "marking" if it’s the same as the title.

render as “1a età“

* I would define a few macros, e.g. for the \in where both parameters
are the same and for stuff like \bullet\enspace – probably you just left
these out to simplify the example.

Hraban

Am 10.05.22 um 04:03 schrieb jbf via ntg-context:
> Hi list,
>
> In an attempt to make a dictionary interactive in certain ways, perhaps
> I am misusing the \in{}[] command here, but sometimes a reference works
> and sometimes it doesn't. I have no idea why it doesn't. Here is the
> situation:
>
> Each dictionary entry is a section that has been defined as 'entry',
> hence we have a \startentry[title=,marking=,reference=]...\stopentry
> structure. Many entries can refer to other entries in the dictionary (in
> most cases the headword is in Italian, but the definitions, explanations
> are in English in all cases). in 90% of cases my referencing is working,
> so here is an example of one that works when
> \setupinteraction[state=start] is set:
>
> \startentry[title={1aetà},marking={1aetà},reference={eta}]\\
>
> 1. youth. 2. first age. {\emnp.} \bullet\enspaceThe age between
> adolescence and maturity and by extension all of the human being’sfirst
> age (as opposed to old age).
>
> Different cultures distinguish} age groupings in different ways. One
> would be unlikely to find, in English, terms like first age, second age
> etc. as recorded here. In fact there are probably only three general
> groupings in English: young, middle-aged, elderly, and the boundaries
> are rather flexible for these. Among the young category, English might
> \rightarrow\enspace \in{giovani}[giovani]
>
> \stopentry
>
> In other words, there is an entry called 'giovani' and it begins
> \startentry[title={giovani},marking={giovani},reference={giovani}]. That
> correctly gives me a bold green clickable link which takes me to
> 'giovani'. There is no number or page reference involved. I simply want
> the link to take me to the entry concerned.
>
> But it does not always work. I have another entry called 'ad nutum'
> (Latin, not Italian in this case) with a reference to 'segretario' many
> pages on. I am absolutely sure I have the reference for segretario
> properly set up, both in its own entry and by calling it as I did for
> 'giovani', namely this time as \in{segretario}[segretario] but it is not
> recognized. This is not the only non-working case. There are several.
>
> Can anyone give me a hint as to what I might be doing wrong? I realise
> that usually these references call on page numbers or section numbers,
> but I don't want/need (or do I?) to use those. I simply the reader to be
> able to click on a hyperlink which takes them to the referenced entry.
>
> Julian


text:
# Damerau–Levenshtein distance

(Redirected from Damerau-Levenshtein distance)

In information theory and computer science, the Damerau–Levenshtein distance (named after Frederick J. Damerau and Vladimir I. Levenshtein[1][2][3]) is a string metric for measuring the edit distance between two sequences. Informally, the Damerau–Levenshtein distance between two words is the minimum number of operations (consisting of insertions, deletions or substitutions of a single character, or transposition of two adjacent characters) required to change one word into the other.

The Damerau–Levenshtein distance differs from the classical Levenshtein distance by including transpositions among its allowable operations in addition to the three classical single-character edit operations (insertions, deletions and substitutions).[4][2]

In his seminal paper,[5] Damerau stated that these four operations correspond to more than 80% of all human misspellings. Damerau's paper considered only misspellings that could be corrected with at most one edit operation. While the original motivation was to measure distance between human misspellings to improve applications such as spell checkers, Damerau–Levenshtein distance has also seen uses in biology to measure the variation between protein sequences.[6]

## Definition

To express the Damerau–Levenshtein distance between two strings ${\displaystyle a}$ and ${\displaystyle b}$ a function ${\displaystyle d_{a,b}(i,j)}$ is defined, whose value is a distance between an ${\displaystyle i}$–symbol prefix (initial substring) of string ${\displaystyle a}$ and a ${\displaystyle j}$–symbol prefix of ${\displaystyle b}$.

The function is defined recursively as:

${\displaystyle \qquad d_{a,b}(i,j)={\begin{cases}\max(i,j)&{\text{ if}}\min(i,j)=0,\\\min {\begin{cases}d_{a,b}(i-1,j)+1\\d_{a,b}(i,j-1)+1\\d_{a,b}(i-1,j-1)+1_{(a_{i}\neq b_{j})}\\d_{a,b}(i-2,j-2)+1\end{cases}}&{\text{ if }}i,j>1{\text{ and }}a_{i}=b_{j-1}{\text{ and }}a_{i-1}=b_{j}\\\min {\begin{cases}d_{a,b}(i-1,j)+1\\d_{a,b}(i,j-1)+1\\d_{a,b}(i-1,j-1)+1_{(a_{i}\neq b_{j})}\end{cases}}&{\text{ otherwise.}}\end{cases}}}$

where ${\displaystyle 1_{(a_{i}\neq b_{j})}}$ is the indicator function equal to 0 when ${\displaystyle a_{i}=b_{j}}$ and equal to 1 otherwise.

Each recursive call matches one of the cases covered by the Damerau–Levenshtein distance:

• ${\displaystyle d_{a,b}(i-1,j)+1}$ corresponds to a deletion (from a to b).
• ${\displaystyle d_{a,b}(i,j-1)+1}$ corresponds to an insertion (from a to b).
• ${\displaystyle d_{a,b}(i-1,j-1)+1_{(a_{i}\neq b_{j})}}$ corresponds to a match or mismatch, depending on whether the respective symbols are the same.
• ${\displaystyle d_{a,b}(i-2,j-2)+1}$ corresponds to a transposition between two successive symbols.

The Damerau–Levenshtein distance between a and b is then given by the function value for full strings: ${\displaystyle d_{a,b}(|a|,|b|)}$ where ${\displaystyle i=|a|}$ denotes the length of string a and ${\displaystyle j=|b|}$ is the length of b.

## Algorithm

Presented here are two algorithms: the first,[7] simpler one, computes what is known as the optimal string alignment distance or restricted edit distance,[8] while the second one[9] computes the Damerau–Levenshtein distance with adjacent transpositions. Adding transpositions adds significant complexity. The difference between the two algorithms consists in that the optimal string alignment algorithm computes the number of edit operations needed to make the strings equal under the condition that no substring is edited more than once, whereas the second one presents no such restriction.

Take for example the edit distance between CA and ABC. The Damerau–Levenshtein distance LD(CA,ABC) = 2 because CAACABC, but the optimal string alignment distance OSA(CA,ABC) = 3 because if the operation CAAC is used, it is not possible to use ACABC because that would require the substring to be edited more than once, which is not allowed in OSA, and therefore the shortest sequence of operations is CAAABABC. Note that for the optimal string alignment distance, the triangle inequality does not hold: OSA(CA,AC) + OSA(AC,ABC) < OSA(CA,ABC), and so it is not a true metric.

### Optimal string alignment distance

Optimal string alignment distance can be computed using a straightforward extension of the Wagner–Fischer dynamic programming algorithm that computes Levenshtein distance. In pseudocode:

algorithm OSA-distance is
input: strings a[1..length(a)], b[1..length(b)]
output: distance, integer
let d[0..length(a), 0..length(b)] be a 2-d array of integers, dimensions length(a)+1, length(b)+1
// note that d is zero-indexed, while a and b are one-indexed.
for i := 0 to length(a) inclusive do
d[i, 0] := i
for j := 0 to length(b) inclusive do
d[0, j] := j
for i := 1 to length(a) inclusive do
for j := 1 to length(b) inclusive do
if a[i] = b[j] then
cost := 0
else
cost := 1
d[i, j] := minimum(d[i-1, j] + 1,     // deletion
d[i, j-1] + 1,     // insertion
d[i-1, j-1] + cost)  // substitution
if i > 1 and j > 1 and a[i] = b[j-1] and a[i-1] = b[j] then
d[i, j] := minimum(d[i, j],
d[i-2, j-2] + cost)  // transposition
return d[length(a), length(b)]

The difference from the algorithm for Levenshtein distance is the addition of one recurrence:

if i > 1 and j > 1 and a[i] = b[j-1] and a[i-1] = b[j] then
d[i, j] := minimum(d[i, j],
d[i-2, j-2] + cost)  // transposition

The following algorithm computes the true Damerau–Levenshtein distance with adjacent transpositions; this algorithm requires as an additional parameter the size of the alphabet Σ, so that all entries of the arrays are in [0, |Σ|):

algorithm DL-distance is
input: strings a[1..length(a)], b[1..length(b)]
output: distance, integer
da := new array of |Σ| integers
for i := 1 to |Σ| inclusive do
da[i] := 0
let d[−1..length(a), −1..length(b)] be a 2-d array of integers, dimensions length(a)+2, length(b)+2
// note that d has indices starting at −1, while a, b and da are one-indexed.
maxdist := length(a) + length(b)
d[−1, −1] := maxdist
for i := 0 to length(a) inclusive do
d[i, −1] := maxdist
d[i, 0] := i
for j := 0 to length(b) inclusive do
d[−1, j] := maxdist
d[0, j] := j
for i := 1 to length(a) inclusive do
db := 0
for j := 1 to length(b) inclusive do
k := da[b[j]]
ℓ := db
if a[i] = b[j] then
cost := 0
db := j
else
cost := 1
d[i, j] := minimum(d[i−1, j−1] + cost,  //substitution
d[i,   j−1] + 1,     //insertion
d[i−1, j  ] + 1,     //deletion
d[k−1, ℓ−1] + (i−k−1) + 1 + (j-ℓ−1)) //transposition
da[a[i]] := i
return d[length(a), length(b)]

To devise a proper algorithm to calculate unrestricted Damerau–Levenshtein distance note that there always exists an optimal sequence of edit operations, where once-transposed letters are never modified afterwards. (This holds as long as the cost of a transposition, ${\displaystyle W_{T}}$, is at least the average of the cost of an insertion and deletion, i.e., ${\displaystyle 2W_{T}\geq W_{I}+W_{D}}$.[9]) Thus, we need to consider only two symmetric ways of modifying a substring more than once: (1) transpose letters and insert an arbitrary number of characters between them, or (2) delete a sequence of characters and transpose letters that become adjacent after deletion. The straightforward implementation of this idea gives an algorithm of cubic complexity: ${\displaystyle O\left(M\cdot N\cdot \max(M,N)\right)}$, where M and N are string lengths. Using the ideas of Lowrance and Wagner,[9] this naive algorithm can be improved to be ${\displaystyle O\left(M\cdot N\right)}$ in the worst case.

It is interesting that the bitap algorithm can be modified to process transposition. See the information retrieval section of[1] for an example of such an adaptation.

## Applications

Damerau–Levenshtein distance plays an important role in natural language processing. In natural languages, strings are short and the number of errors (misspellings) rarely exceeds 2. In such circumstances, restricted and real edit distance differ very rarely. Oommen and Loke[7] even mitigated the limitation of the restricted edit distance by introducing generalized transpositions. Nevertheless, one must remember that the restricted edit distance usually does not satisfy the triangle inequality and, thus, cannot be used with metric trees.

### DNA

Since DNA frequently undergoes insertions, deletions, substitutions, and transpositions, and each of these operations occurs on approximately the same timescale, the Damerau–Levenshtein distance is an appropriate metric of the variation between two strands of DNA. More common in DNA, protein, and other bioinformatics related alignment tasks is the use of closely related algorithms such as Needleman–Wunsch algorithm or Smith–Waterman algorithm.

### Fraud detection

The algorithm can be used with any set of words, like vendor names. Since entry is manual by nature there is a risk of entering a false vendor. A fraudster employee may enter one real vendor such as "Rich Heir Estate Services" versus a false vendor "Rich Hier State Services". The fraudster would then create a false bank account and have the company route checks to the real vendor and false vendor. The Damerau–Levenshtein algorithm will detect the transposed and dropped letter and bring attention of the items to a fraud examiner.

### Export control

The U.S. Government uses the Damerau–Levenshtein distance with its Consolidated Screening List API.[10]

• Ispell suggests corrections that are based on a Damerau–Levenshtein distance of 1
• Typosquatting

## References

1. ^ Brill, Eric; Moore, Robert C. (2000). An Improved Error Model for Noisy Channel Spelling Correction (PDF). Proceedings of the 38th Annual Meeting on Association for Computational Linguistics. pp. 286–293. doi:10.3115/1075218.1075255. Archived from the original (PDF) on 2012-12-21.
2. ^ a b Bard, Gregory V. (2007), "Spelling-error tolerant, order-independent pass-phrases via the Damerau–Levenshtein string-edit distance metric", Proceedings of the Fifth Australasian Symposium on ACSW Frontiers : 2007, Ballarat, Australia, January 30 - February 2, 2007, Conferences in Research and Practice in Information Technology, 68, Darlinghurst, Australia: Australian Computer Society, Inc., pp. 117–124, ISBN 978-1-920682-49-1.
3. ^ Li; et al. (2006). Exploring distributional similarity based models for query spelling correction (PDF). Proceedings of the 21st International Conference on Computational Linguistics and the 44th annual meeting of the Association for Computational Linguistics. pp. 1025–1032. doi:10.3115/1220175.1220304. Archived from the original (PDF) on 2010-04-01.
4. ^ Levenshtein, Vladimir I. (February 1966), "Binary codes capable of correcting deletions, insertions, and reversals", Soviet Physics Doklady, 10 (8): 707–710
5. ^ Damerau, Fred J. (March 1964), "A technique for computer detection and correction of spelling errors", Communications of the ACM, ACM, 7 (3): 171–176, doi:10.1145/363958.363994
6. ^ The method used in: Majorek, Karolina A.; Dunin-Horkawicz, Stanisław; et al. (2013), "The RNase H-like superfamily: new members, comparative structural analysis and evolutionary classification", Nucleic Acids Research, 42 (7): 4160–4179, doi:10.1093/nar/gkt1414, PMC , PMID 24464998
7. ^ a b Oommen, B. J.; Loke, R. K. S. "Pattern recognition of strings with substitutions, insertions, deletions and generalized transpositions". Pattern Recognition. 30: 789–800. CiteSeerX . doi:10.1016/S0031-3203(96)00101-X.
8. ^ Boytsov, Leonid (May 2011). "Indexing methods for approximate dictionary searching". Journal of Experimental Algorithmics. Association for Computing Machinery (ACM). 16: 1. doi:10.1145/1963190.1963191.
9. ^ a b c Lowrance, Roy; Wagner, Robert A. (April 1975), "An Extension of the String-to-String Correction Problem", J ACM, 22 (2): 177–183, doi:10.1145/321879.321880


text:
# Complexometric Calcium Determination (Experiment)

Many metal ions form slightly dissociated complex ions. The formation of these can serve as the basis of accurate and convenient titrations for such metal ions. Such determinations are referred to as complexometric titrations. The accuracy of these titrations is high and they offer the possibility of determinations of metal ions at concentrations at the millimole level. Many cations will form complexes in solution with a variety of substances that have a pair of unshared electrons (e.g. on N, O, S atoms in the molecule) capable of satisfying the coordination number of the metal. The metal ion acts as a Lewis acid (electron pair acceptor) and the complexing agent is a Lewis base (electron pair donor). The number of molecules of the complexing agent, called the ligand, will depend on the coordination number of the metal and on the number of complexing groups on the ligand molecule.

Simple complexing agents such as ammonia are rarely used as titrating agents because a sharp end point corresponding to a stoichiometric complex is generally difficult to achieve. This is true since the stepwise formation constants are frequently close together and not very large, and a single stoichiometric complex cannot be observed. Certain ligands that have two or more complexing groups on the molecule, however, do form well-defined complexes and can be used as titrating agents. One such reagent that is widely used is ethylenediaminetetraacetic acid (EDTA).

An organic agent which has two or more groups capable of complexing with a metal ion is called a chelating agent. The complex which is formed in this manner is called a chelate. Titration with such a chelating agent is called a chelometric titration which is a particular type of complexometric titration. A pair of unshared electrons capable of complexing with a metal ion is located on each of the two nitrogen atoms and each of the four carboxyl groups. Thus there are six complexing groups in EDTA. We represent EDTA by the symbol H4Y, which recognizes the fact that it is a tetraprotic acid. The four hydrogens in the formula refer to the four acidic hydrogens on the four carboxyl groups. It is the unprotonated ligand Y4- that is responsible for the formation of complexes with metal ions.

The present analysis is concerned with the determination of Ca by the use of a complexometric titration of the type that is described above. The titration is performed by adding a standard solution of EDTA to the sample containing the Ca. The reaction that takes place is the following:

$Ca^{2+} + Y^{4-} \rightleftharpoons CaY^{2-}$

Before the equivalence point, the Ca2+ concentration is nearly equal to the amount of unchelated (unreacted) calcium since the dissociation of the chelate is slight. At the equivalence point and beyond, pCa is determined from the dissociation of the chelate at the given pH. The equivalence point is detected through the use of an indicator which is itself a chelating agent. The specific indicator used is Eriochrome Black T. It contains three ionizable protons and we will represent it by the formula H3In. In neutral or somewhat basic solutions, it is a doubly dissociated ion, HIn2-, which is blue in color. Eriochrome Black T cannot be used as an indicator for the titration of calcium with EDTA, since it forms too weak a complex with calcium to give a sharp end point. Therefore, a solution containing the magnesium complex of EDTA, MgY2-, is introduced into the titration mixture. Since Ca2+ forms a more stable complex with EDTA than magnesium, the following reaction occurs:

$MgY^{2-} + Ca^{2+} \rightleftharpoons CaY^{2-} + Mg^{2+}$

The magnesium that is released in this manner then reacts with the doubly ionized ion of the Eriochrome Black T. The complex that is formed between magnesium and that ion is red, hence at the start of the Ca titration the solution is red. This reaction can be written as follows:

$Mg^{2+} + \underbrace{HIn^{2-}}_{blue} \rightleftharpoons \underbrace{MgIn^-}_{red} + H^+$

The solution is then titrated with a standard solution of EDTA. At the beginning of the titration, the EDTA reacts with the remaining calcium ion that has not been complexed. After all the calcium has reacted the next portion of EDTA reacts with the magnesium complex which was formed earlier. The added EDTA competes favorably with the red magnesium-indicator complex (MgIn-), to give MgY2- and HIn2- and thereby giving a blue color at the end point.

$\underbrace{MgIn^-}_{red} + H^+ + Y^{4-} \rightleftharpoons MgY^{2-} + \underbrace{HIn^{2-}}_{blue}$

## Preparation of a 0.0100 M EDTA Solution

Dry about 2 g of EDTA dihydrate, Na2H2Y2 2H2O, in a drying oven at 80C for one hour. Then accurately weigh out about .95 g ± 0.lmg. Quantitatively transfer the EDTA into a 250 mL volumetric flask, add distilled water with mixing then dilute to the mark with distilled water. Mix well by inverting and shaking the tightly stoppered flask. Label this solution "Standard EDTA".

## Preparation of the Mg-EDTA Complex Indicator

Mix 0.744 g of dried EDTA with 0.492 g of MgSO4 in 100 mL of distilled water. Divide the solution into two 50 mL portions. To one portion add a few drops of phenolphthalein. Dropwise, counting the drops, add sufficient 0.1 M NaOH solution to turn the solution faintly pink. ONCE THE NUMBER OF DROPS OF NaOH HAS BEEN DETERMINED, DISCARD THIS Solution. To the second 50mL portion add the same number of drops of 0.1 M NaOH solution as were added to the first portion, then dilute to about 95 mL with distilled water. Add 2 mL of pH 10 buffer solution and add a few drops of Eriochrome Black T indicator solution. At this stage there are two possibilities, the solution is either red or blue. If the solution is red, Mg2+ is in excess. In that case add 0.0100 M EDTA solution dropwise until the solution just turns blue. If the solution is originally blue then EDTA is in excess and in that case add

0.01 M MgSO4 solution dropwise until the solution just turns red, then add 0.100 M EDTA dropwise to just turn the solution blue again.

## Preparation of the Powdered Milk Solution

Dry approximately 5 g of powdered milk at 80C for one hour in a drying-oven. Accurately weigh about 3 g of dry milk into a 250 mL beaker and add approximately 100 mL of distilled water. Stir to dissolve. Transfer quantitatively with repeated washings with distilled water into a 250 mL volumetric flask. Let stand for a sufficient length of time, so that all bubbles disperse. If foaming occurs it can be suppressed by the addition of 1 or 2 drops of n-octanol. Then dilute to the calibration mark with distilled water. Then mix well by stoppering the flask and then inverting and shaking it repeatedly.

## Titration of Milk Solution

Pipet an exact 50 mL aliquot of the milk solution into a 250 mL Erlenmeyer flask. Add about 2 mL of pH 10 buffer, 10 mL of Mg-EDTA Indicator solution and 3 drops of Eriochrome Black T indicator. Titrate with the standard 0.0100 M EDTA solution to a color change from red to blue. Titrate at least two more milk samples using the same procedure as before.

## Treatment of Data and Report

From your experimental data calculate the percentage of Ca in the powdered milk for each aliquot that you titrated. Then calculate an average percentage.

On the report sheet provided report the following data:

1. Milk unknown number
2. Weight of milk sample used.
3. Volume of EDTA solution used for each samples.
4. Percentage of Ca for each sample.
5. The average percentage of Ca.
6. The average deviation from the mean for the percent Ca in the samples
7. Pages in your lab notebook containing the pertinent data.

## Questions on Complexometric Calcium

1. What is the indicator used in this titration?
2. Why can Eriochrome Black T not be used directly as an indicator?
3. What is the color of the doubly ionized Eriochrome Black T indicator in slightly basic solution?
4. What is the purpose of adding NaOH solution dropwise to the Mg-EDTA mixture?
5. Is it possible to use the sodium salt of EDTA as a primary standard?
6. At what pH is the Ca titration carried out?
7. What are the conditional constants for Mg2+ and Ca2+ at the pH at which the titration is carried out?

• Ulrich de la Camp and Oliver Seely (California State University, Dominguez Hills).

Complexometric Calcium Determination (Experiment) is shared under a not declared license and was authored, remixed, and/or curated by Oliver Seely.


text:
The EECS 16 series (Designing Information Devices and Systems) is a pair of freshman-level courses introducing students to EECS, with a particular emphasis on how we deal with systems interacting with the world from an information point of view. Mathematical modeling is an important theme throughout these courses, and students will learn many conceptual tools along the way. Throughout this series, generally applicable concepts and techniques are motivated by, and rooted in, specific exemplary application domains. Students should understand why they are learning something.

EECS 16A focuses on modeling as abstraction – a way to see the important underlying structure in a problem – and introduces the basics of linear modeling, largely from a “static” and deterministic point of view. In EECS 16A, we will use the application domains of imaging and tomography, touchscreens, and GPS and localization to motivate and inspire. Along the way, we will learn the basics of linear algebra and, more importantly, the linear-algebraic way of looking at the world. We will emphasize modeling and using linear structures to solve problems – not on how to do computations per se. We will learn about linear circuits, not merely as a powerful and creative way to help connect the physical world to what we can process computationally, but also as an exemplar of linearity and as a vehicle for learning how to do design. Circuits also provide a concrete setting in which to learn the key concept of “equivalence” – an important aspect of abstraction. Our hope is that the concepts you learn in EECS 16A will help you as you tackle more advanced courses and will help form a solid conceptual framework that will help you learn throughout your career.

I was a 16A Lab/Content TA in Spring 2017. My duties included designing, debugging, and conducting lab sections consisting of roughly 40 students. Also, I had to write homework and exam questions for the circuits portion of the course. My highlight of the course was when I was saw students who just started EE, enthusiastically doing and enjoying the labs.

In the first module – imaging module, the students needed to scan images with a single photodiode using different software masks. Here are a set of cool scans Doreene Kang and Nicholas Te took:

These images were taken for the imaging module of the lab. Check the course website for details.

Another fun module of the labs was the touchscreen module. There students had to work with resistive and capacitive touchscreens. One of the finished touchscreen labs is shown below. Here an MSP430 launchpad senses touch via capacitive touchscreen, then plays the Super Mario tune using an op amp and a speaker.


text:
# beamer warsaw modify heading color (roght side) in relation to sections

I'm using the Warsaw template for beamer class. I would like that the color of the left heading of my presentation vary by section (each section has a customised color.
I saw a solution here: Changing color in beamer header (Singapore) However, this is adapted to Singapore theme and is very customised. Is there any help, please.

You can set the section in head/foot color from section to section:

\documentclass{beamer}
\usetheme{Warsaw}

\begin{document}

\section{sec1}
\subsection{sub1}
\begin{frame}
abc
\end{frame}

\section{sec2}
\subsection{sub2}
\begin{frame}
abc
\end{frame}

\end{document}

You can even make the colour change automatic:

\documentclass{beamer}
\usetheme{Warsaw}

\definecolorseries{foo}{rgb}{last}{red}{blue}
\resetcolorseries[3]{foo}

\AtBeginSection[]{%
}

\begin{document}

\section{sec1}
\subsection{sub1}
\begin{frame}
abc
\end{frame}

\section{sec2}
\subsection{sub2}
\begin{frame}
abc
\end{frame}

\section{sec3}
\subsection{sub3}
\begin{frame}
abc
\end{frame}

\end{document}

• thank you very much for the quick answer, however, I want to modify the right part color, not the left one. So, each subsection group has the same color. Thank you again – Bey Rout Nov 24 '17 at 21:51
• @BeyRout Upps! Please see my edited answer. – samcarter_is_at_topanswers.xyz Nov 24 '17 at 22:02
• A last question please, how can I customise the color series to pick exactly some defined colors! – Bey Rout Nov 24 '17 at 22:40
• and I saw that you gave once a solution to change section subsection font size for the active slide. But, I don't figure out how to adapt it to my case. Can you please help me to do it. Thank you very much – Bey Rout Nov 24 '17 at 23:40
• @BeyRout Colour series only interpolate between the first and the last colour. If you want other colours, do it manually like in my first solution. – samcarter_is_at_topanswers.xyz Nov 24 '17 at 23:46


text:
# Hydraulics

A hydraulic system takes advantage of pressure and a containers cross-sectional area. When dealing with hydraulics you should realize that the pressure theoretically is the same throughout the hydraulic system. To calculate the pressure equation 1 would be used.

(Eq 1)  $P=\frac{F}{A}$

P = Pressure

F = Force

A = Cross-Sectional Area

Notice from equation 1 that pressure is a product of a certain cross-sectional area and an applied force. So this means that if the two different cross-sectional areas are connected a mechanical advantage will result, since this affectively will increase the output force due to the fact the pressure will remain the same throughout the system but the areas change. Refer to equation 2 to calculate the output force of a hydraulic system.

(Eq 2)   $F_1=\frac{F_2A_1}{A_2}$

Now when ever a device is created that provides a mechanical advantage, a loss must follow. This loss is travel. The container that has the smaller cross-sectional area has to travel a much greater distance to cause the container that has the larger cross-sectional area to travel a certain distance. Refer to the figure below.


text:
Lattices in SOL - MathOverflow most recent 30 from http://mathoverflow.net 2013-06-19T11:34:43Z http://mathoverflow.net/feeds/question/71850 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/71850/lattices-in-sol Lattices in SOL Alain Valette 2011-08-02T02:36:11Z 2011-08-02T17:18:43Z
Consider a semi-direct product $\mathbb{Z}^2\rtimes_A\mathbb{Z}$, where $A\in SL_2(\mathbb{Z})$ and $|Tr(A)|>2$. It is clear that it is isomorphic to a lattice in the 3-dimensional solvable Lie group SOL. To what extent do these examples exhaust lattices in SOL? (i.e., up to a suitable equivalence relation, is every lattice in SOL of this form?)

The question comes from a desire to understand better the Eskin-Fisher-Whyte result on quasi-isometric rigidity of SOL: every finitely generated group quasi-isometric to SOL is virtually a lattice in SOL.
 http://mathoverflow.net/questions/71850/lattices-in-sol/71853#71853 Answer by Igor Rivin for Lattices in SOL Igor Rivin 2011-08-02T03:08:53Z 2011-08-02T13:27:15Z
See http://arxiv.org/pdf/1106.4646 the abstract is here:

http://arxiv.org/abs/1106.4646
 http://mathoverflow.net/questions/71850/lattices-in-sol/71901#71901 Answer by Alex Eskin for Lattices in SOL Alex Eskin 2011-08-02T17:18:43Z 2011-08-02T17:18:43Z
To add to Igor Rivin's answer: it seems that all the lattices in SOL are isomorphic as abstract groups to $\mathbb{Z}^2\rtimes_A\mathbb{Z}$ for hyperbolic $A\in SL_2(\mathbb{Z})$. If I am reading the paper correctly, it is in Theorem 2.1 of the paper linked in Igor's answer.

I think that this fact can also be easily derived from the following theorem (Corollary 3.5 in Raghunathan's book, which is due to either Auslander or Mostow):

If $G$ is a connected solvable Lie group, and $N$ is its maximum connected (normal) closed nilpotent Lie subgroup, then for any lattice $\Gamma$ in $G$, $\Gamma \cap N$ is a (cocompact) lattice in $N$.

Thus you always have the short exact sequence $$1 \to \Gamma \cap N \to \Gamma \to \Gamma/(\Gamma \cap N) \to 1.$$ The fact that $\Gamma \cap N$ is cocompact in $N$ implies that $\Gamma/(\Gamma \cap N)$ is a discrete subgroup of $G/N$.

If $G = SOL = \mathbb{R}^2 \rtimes \mathbb{R}$, then $N \approx \mathbb{R}^2$, and so $\Gamma \cap N \approx \mathbb{Z}^2$. Also since $G/N \approx \mathbb{R}$, $\Gamma/(\Gamma \cap N) \approx \mathbb{Z}$. So the short exact sequence above reads $$1 \to \mathbb{Z}^2 \to \Gamma \to \mathbb{Z} \to 1.$$ Such a sequence must split, so $\Gamma$ is a semidirect product.

The linked paper does something much more detailed and impressive, sort of like the classification of crystallographic groups.


text:
## DOE to award $60M to advance clean hydrogen technologies and decarbonize grid ##### 24 August 2022 The US Department of Energy (DOE) announced$40 million in funding to advance the development and deployment of clean hydrogen technologies. To further decarbonize the grid, DOE is also launching a \$20-million university research consortium to help states and Tribal communities successfully implement grid resilience programs and achieve decarbonization goals. (DE-FOA-0002792)

This funding opportunity will advance DOE’s Hydrogen Shot goal of reducing the cost of clean hydrogen to 1 dollar per 1 kilogram in 1 decade (“1 1 1”), while supporting DOE’s H2@Scale initiative, which aims to advance the affordable production, transport, storage, and utilization of clean hydrogen to enable decarbonization and revenue opportunities across multiple sectors.

Areas of interest in support of Hydrogen Shot include:

1. HydroGEN: Solar Fuels from Photoelectrochemical and Solar Thermochemical Water Splitting

2. Development and Validation of Sensor Technology for Monitoring and Measuring Hydrogen Losses

3. Materials-based H2 Storage Demonstrations

4. M2FCT: High Performing, Durable, and Low-PGM Catalysts/Membrane Electrode Assemblies (MEAs) for Medium- and Heavy-duty Applications

DOE envisions multiple financial assistance awards in the form of cooperative agreements, with the period of performance being approximately two to four years. DOE encourages applicant teams that include stakeholders within academia, industry, and national laboratories across multiple technical disciplines. Teams are also encouraged to include representation from diverse entities such as minority-serving institutions or through linkages with Opportunity Zones.

The Hydrogen Shot and University Research Consortium Grid Resilience FOA will also provide three-year funding for a regionally diverse university consortium focused on developing a decarbonized and more resilient electrical power system in coordination with universities in Mexico and Canada. This North American consortium will address cross-border grid dependencies and electrical interconnections throughout region.

The application process for both the clean hydrogen FOA and University Consortium funding will include two phases: a concept paper and a full application.

H2 is an abundant element chemically bound in water / H2O or carbohydrates. It's an excellent energy carrier and when oxidized no pollutant products occur; only water / H2O. H2, in its molecular state, has a high affinity to other gases in the atmosphere. Its adverse short - and long term effect differs considerably. Its short term adverse effect (20 - 30 years duration) on climate is 30 times higher than that of CO2; its long term effect (100 years duration) is approx. 11 times higher than that of CO2.
https://acp.copernicus.org/articles/22/9349/2022/
https://www.rechargenews.com/energy-transition/shell-boss-high-gas-prices-will-make-blue-hydrogen-uncompetitive-with-green-for-some-while/2-1-1271384

@yoatman:

Many thanks for some excellent links.

I am a bit mystified by your selection of stuff to draw from it though, as you don't give the page reference, and the overall conclusions of the report are widely different.

From the Shell link:

' Tightening natural gas supplies and soaring prices will encourage green hydrogen schemes and use in Europe, while making blue hydrogen less attractive, according to the chief executive of UK oil major Shell.'

ie, right now in Europe green hydrogen is cheaper than blue, and rapid expansion of renewables and falling electrolyser costs mean that there is good prospect of that continuing.

I would have thought that good news, not bad, for those of use interested in mitigating climate change.

For the main report, in their conclusion the authors themselves say:

' We found that hydrogen's warming potency strongly depends on the time horizon and (similar to methane) can be at least 3 times more potent in the near term than in the long term relative to carbon dioxide when using the traditional GWP framework with pulses of equal emissions. If a constant emission rate is used in the calculations instead, hydrogen's warming potency may be 50 % higher for time horizons of several decades or longer. When assessing the relative climate impacts of replacing fossil fuel technologies with their hydrogen alternatives (based on a unit of clean H2 deployed relative to the avoided CO2 emissions for a generic case), we found that there are vastly different climate outcomes depending on emission rates, time horizons, and production method. For example, blue hydrogen with high hydrogen and methane emissions (a 10 % and 3 % emission rate, respectively) can be worse for the climate for decades compared with fossil fuel technologies, but green hydrogen with low hydrogen emissions (1 %) can nearly eliminate climate impacts from its fossil fuel counterparts over all timescales. On the other hand, the best-case blue hydrogen alternative (1 % for both hydrogen and methane) can show roughly the same climate benefits as the worst-case green hydrogen alternative (10 % emissions) – far from climate neutral but still halving the impacts of its fossil fuel counterparts within a decade. However, the perceived benefits of clean hydrogen alternatives compared with fossil fuel technologies will depend on how much carbon dioxide and methane are avoided, which needs to be assessed on a case-by-case basis with reliable emission data.'

Which makes the bits you have picked out look pretty much cherry picked, and deeply misleading.

What the study does claim and seeks to support is that in particular short term warming effects of hydrogen have been underestimated.
But the main thrust of the report is to highlight the importance of hydrogen leakage, and that it needs to be minimised.

They are not speaking about gold hydrogen anymore. Maybe it's because there is too much leak.

Well, Gorr, you are always concerned that all the steps in hydrogen production and distribution are being made in Europe, not North America and Canada, you feel.

Perhaps this will perk you up.

There is a largish(!) project in Nova Scotia, using offshore wind to produce hydrogen, stored in their salt caverns there, and for export to Europe, but perhaps they will be able to spare a bit for your car...

In stages it is to expand up to 500GW of capacity and 43billion kgs of hydrogen!:

Glad to see it in canada. We need it now.

I'm giving myself a small pat on the back for having got the BBCto correct some of their misstatements on hydrogen:

' Correction August 22 2022: This article was updated to reflect that hydrogen can be harvested directly from the ground.'

This was the result of a series of emails, as the BBC was previously repeating the canard that hydrogen is not an energy source, can only be got after processing from other sources like NG and water, etc etc.

This is in spite of it having been commercially extracted neat for a decade or so.

Can this be upped to be commercially significant?

The simple answer is no one knows either the size of the resource or how practical and economic it would be to mine directly, as no one has looked.

Certainly the BBC don't know, and fortunately are not now repeating false information on it.

Of course, much of the rest of the article is opinion based, rather than based on demonstrable fact.
So for instance their notion that hydrogen from abroad will be transported as liquified hydrogen, with energy losses given on that assumption.

In fact, ammonia is the usual carrier being looked at, and some of the pathways for that are potentially very efficient, or at least have little to do with their notion that the typical way of transport will be as liquid hydrogen.

And the notion that the relative efficiency of hydrogen production and transport from solar panels in the desert can be directly compared with German solar production is nonsensical, as there is very little solar when it is most needed in northern Germany in winter, whilst hydrogen stores the energy for use when needed.

But at least one bit of missinformation has been addressed.

I've just learnt this:

' Zgonnik says in his ten years of research into the topic, he’s seen many raised eyebrows when natural hydrogen came up. Up until a few years ago, many people were in disbelief that with thousands of wells drilled around the world, natural hydrogen could be overlooked.

One reason may be the technology used to look for natural gas. It was assumed there was no hydrogen in nature and therefore it was used as a vector in gas for detectors used to analyse the composition of natural gas.

“Most of those detectors, they're working on hydrogen like a vector gas. So, in order to inject your sample, you need some gas to bring your sample into the detection chamber, and this vector gas you commonly used was hydrogen. Then of course, if you are using hydrogen, you will not see it in your sample,” explained Zgonnik.

This means when companies and governments were looking for gas deposits underground, they underestimated how much hydrogen was present there. “It’s only now we’re starting to understand it’s much more widespread than previously thought,” said Zgonnik. He added the estimates are increasing by an order of magnitude every decade.'

Oops!

If there was significant free hydrogen in NG deposits, it would have been discovered early on both by the reduction in calorific value and when any attempt was made to liquefy the methane.  That puts a ceiling on the elemental H2 content of the gas.  Helium is often found in NG deposits but it has very different thermodynamic properties from H2 which would make the difference obvious.  Acid gases such as CO2 and H2S are removed in "sweetening" plants, leaving N2 as the major inert gas reducing the fuel value.

Hi EP.

You certainly would have thought that they would know all about associated hydrogen if it were about in any quantity, wouldn't you?

Part of the meme for years is that hydrogen can't exist on its own, naturally occurring, and that was this month that as respected an organisation as the BBC was claiming that, although it has been in commercial production for ten years, and was known about for decades before that!

People are remarkably good at ignoring anything which does not fit in with their preconceptions.

And no one really knows how the hydrogen is formed, some saying biotically, some abiotically, but in any case it can more properly, so far as we know, be viewed as a flux, with hydrogen produced constantly by the earth, with any potential reservoirs a separate, unknown, issue.

Here are a couple of articles discussing it:

https://www.energy-observer.org/resources/natural-hydrogen

' Once considered a rare occurrence as a free gas, recent comprehensive reviews show that hydrogen is in fact much more widespread in nature than previously thought. The misconception of free hydrogen being rare can be explained in various ways. Firstly, if no one expects to find free hydrogen, no one samples for it. And this is why, even today, sensor systems and analysing technics are not that good at detecting hydrogen. Another factor, hindering natural hydrogen discovery, is the fact that most wells around the world have been drilled in sedimentary layers, where oil and other fossil energy sources are found. However, these rocks are not the most likely places for hydrogen to be abundant. Lastly, hydrogen being the lightest element on earth, it diffuses rapidly in air and other environments and cannot be retained in geological traps for long periods of time.

Unlike fossil fuel stocks that require millions of years to form, natural hydrogen is created continuously, with a timeframe for renewal that is about the length of a human life.'

OTOH, a rather different take here:

https://www.renewablematter.eu/articles/article/natural-hydrogen-a-geological-curiosity-or-the-primary-energy-source-for-a-low-carbon-future

' However, this field of study is relatively new so we should not pretend to have a perfect understanding of the system. Nevertheless, available data to date converge towards the concept of continuous production (over years) in significant quantities. Since we now know that hydrogen, in industrial quantities, is produced every day by the water-rock interaction, and that it escapes, its production seems to depend only on us; now we have to determine the most promising locations and according to the context either to separate it on the surface in the geothermal flows or to drill and stimulate the reactions. In parallel with this prospecting, an evolution of the mining law to classify native H2 will be necessary since in some countries it does not yet fall into any category allowing to apply for an exploration or production permit. Overall, our latest data and understanding suggest that natural hydrogen is available at globally-relevant volumes with potentially easier and cheaper accessibility and lower emissions, which means it could be the dominant primary energy source we need for a low-carbon future.'

So we have made progress, as it is now perfectly clear that hydrogen can and does occur on its own.

Whether that can be exploited in significant quantities is an open question which we simply don't have the answers to, but it is entirely possible that we are talking about resources comparable to NG resources.

'I don't know' is always a great starting place in my view! ;-)

BTW, EP, here is a rather good summary of progress in molten salt reactor technology, especially in China:

https://www.nextbigfuture.com/2022/08/chinas-2-megawatt-molten-salt-thorium-nuclear-reactor-has-start-up-approval.html

I certainly fancy the idea of waterless reactors, which would have solved a lot of issues in the drought in Europe, and it is encouraging that the first is to be built by 2030.

You and I are as one in arguing that it would be way better to have 500GW of reactors in Europe rather than 500GW of wind in Canada, and somehow transporting the power, likely as hydrogen, across the Atlantic.

As an interesting aside, the UK is to connect up to Morocco to use their renewable resources by cable, but Morocco is a truly wonderful place for renewables, and the power can be far more continuous than is typically the case, as they have great resources in wind as well as solar.

Presumably for the Canadian venture, should it be decided to build cable of hydrogen pipeline instead of using tankers, the salt cavern storage there could provide similar buffering ability, to enable a smooth flow of power or gas.

The comments to this entry are closed.


text:
# Simple multi-parameter bayesian linear regression returning un-expected results!

The problem is from chapter 10 question 7 of “Regression and Other Stories”, and the general idea is to use data which includes a continuous parameter “beauty” and then several binary predictors. I have solved the problem using stan_glm in R, so I know that out of the 7 predictors only three have sizable effects, beauty (continuous), gender(1,0), and nonnative English speaker (1,0). It is easy to recover these results using julia’s `GLM.jl package, and I show this below:

df = DataFrame(CSV.File("beauty.csv"))

sanity_check = lm(@formula(eval~beauty+female+age+ minority+nonenglish+lower+course_id),df)

These are the results I would expect. However, when I create a Turing model for Bayesian linear regression I get that only beauty is significant.

My code for the Turing model is shown below. I use a small helper function (also shown) to standardize the predictors, HOWEVER, in this version of my turing model I only use the helper function calculate the standard deviations and means in one go. I leave the data un-transformed but center the priors because I am trying to emulate what stan_glm does here: Prior Distributions for rstanarm Models • rstanarm

function standardize(X)
μ_X = mean(X)
σ_X = std(X)
X_std = (X .- μ_X)/σ_X
return X_std, μ_X, σ_X
end

@model function beauty_regression(y,x1,x2,x3,x4,x5,x6,x7)

x1_std,μ_x1,σ_x1 = standardize(x1)
x2_std,μ_x2,σ_x2 = standardize(x2)
x3_std,μ_x3,σ_x3 = standardize(x3)
x4_std,μ_x4,σ_x4 = standardize(x4)
x5_std,μ_x5,σ_x5 = standardize(x5)
x6_std,μ_x6,σ_x6 = standardize(x6)
x7_std,μ_x7,σ_x7 = standardize(x7)

σ_y = std(y)
ϵ ~ Exponential(1/σ_y)

my = 0

β0 ~ Normal(my,2.5*σ_y)

β1 ~ Normal(0,2.5*σ_y/σ_x1)
β2 ~ Normal(0,2.5*σ_y/σ_x2)
β3 ~ Normal(0,2.5*σ_y/σ_x3)
β4 ~ Normal(0,2.5*σ_y/σ_x4)
β5 ~ Normal(0,2.5*σ_y/σ_x5)
β6 ~ Normal(0,2.5*σ_y/σ_x6)
β7 ~ Normal(0,2.5*σ_y/σ_x7)

μ = β0 .+ β1*(x1 .- μ_x1)
+ β2*(x2 .- μ_x2)
+ β3*(x3 .- μ_x3)
+ β4*(x4 .- μ_x4)
+ β5*(x5 .- μ_x5)
+ β6*(x6 .- μ_x6)
+ β7*(x7 .- μ_x7)

y ~ MvNormal(μ,ϵ)

I run my simulation with the following code

model = beauty_regression(df[:,1],df[:,2],df[:,3],df[:,4],df[:,5],df[:,6],df[:,7],df[:,8])
chain = sample(model,NUTS(0.65),3_000);

And these are the results:

Same order but different names (sorry) We see that beauty (b1) is the only significant one…My guess is that I am doing something wrong specifying priors because I have a combination of continuous and binary, however, the stan_glm methodologies makes no such mention of doing anything different. Why am I getting pretty different results with my model? I appreciate any insights

EDIT1: Accidentally submitted the version where I DID standardize the data, should be the non-standardized version now

EDIT2: Fixed some embarrassing simple mistakes, but problem still persists. The code posted above has been updated to remove said mistakes.

Did you mean to call standardize(x1) 7 times?

Also, did you mean for this to be β7?

No and yes, sorry, copied these from an old file. Let me post an updated version, but it’s the same result of only one significant predictor!

Thanks for pointing that out, updated the original post and results

A few things I see:

• rstanarm uses mean(y) as the mean of the intercept prior for a normal likelihood with identity link function, but you are using 0.
• Stan and Distributions use different parameterizations of the exponential distribution. Use Exponential(sy).

In general, the model could be written more succinctly by writing x as Matrix(df[:, 2:8]):

@model function beauty_regression(
y,
x,
μ_x = vec(mean(x; dims=1)),
σ_x = vec(std(x; dims=1)),
x_c = x .- μ_x',
μ_y = mean(y),
σ_y = std(y),
βprior = arraydist(Normal.(0, 2.5*σ_y ./ σ_x))
)
ϵ ~ Exponential(σ_y)
α ~ Normal(μ_y, 2.5*σ_y)
β ~ βprior
y .~ Normal.(μ, ϵ)
end

This implementation moves all of the computations that will not change from one run to another out of the body of the model. muladd fuses the matrix-vector multiplication and addition by a scalar. Another advantage to writing it this way is that the same model can be used for different numbers of predictors.

In case you’re not aware, there’s also TuringGLM, which is the rstanarm/brms of Turing.

4 Likes

Thanks you so much seth! I am aware of TuringGLM, but At least for the next few months I want to try and build my own models because it helps keep me honest about what I do and don’t know (case-in point)! Since I have centered my data and I am just using the normal link function won’t my mean-y just be zero? I appreciate the more concise form, I’m going to take a bit to unpack it and make sure I understand everything that’s going on there hahaha!

Ah, I had interpreted the below quote to mean your data was not centered.

Either way, if the mean is 0, no harm in centering on the mean.

Sounds like a great plan!

Ok so I think that all makes sense! I made one change I want to verify, and then I have a follow up question! If we are setting the priors to have a mean of 0 that means we should center our data, correct? I added a few lines to your code to center x, shown below. Is this the correct thing to do?

@model function beauty_regression_new(
y,
x,
μ_x = vec(mean(x; dims=1)),
σ_x = vec(std(x; dims=1)),
μ_y = mean(y),
σ_y = std(y),
βprior = arraydist(Normal.(0, 2.5*σ_y ./ σ_x))
)
ϵ ~ Exponential(σ_y)
α ~ Normal(μ_y, 2.5*σ_y)
β ~ βprior

N = size(μ_x)[1]
x_c = copy(x)
for i in 1:N
x_c[:,i] = x[:,i] .- μ_x[i]
end

y .~ Normal.(μ, ϵ)

After centering the data as above, I got basically the same results as from GLM :)!

HOWEVER, I went back and changed my old script to have the correct dispersion term Exponential(sy) and it still doesn’t return the same results…which baffles me. I agree your version of the code is much more concise and reusable, but functionally we are doing the same thing… I must be missing something!

This is the current version of my old script:

@model function beauty_regression(y,x1,x2,x3,x4,x5,x6,x7)
x1_std,μ_x1,σ_x1 = standardize(x1)
x2_std,μ_x2,σ_x2 = standardize(x2)
x3_std,μ_x3,σ_x3 = standardize(x3)
x4_std,μ_x4,σ_x4 = standardize(x4)
x5_std,μ_x5,σ_x5 = standardize(x5)
x6_std,μ_x6,σ_x6 = standardize(x6)
x7_std,μ_x7,σ_x7 = standardize(x7)

σ_y = std(y)
ϵ ~ Exponential(σ_y)

my = mean(y)

β0 ~ Normal(my,2.5*σ_y)

β1 ~ Normal(0,2.5*σ_y/σ_x1)
β2 ~ Normal(0,2.5*σ_y/σ_x2)
β3 ~ Normal(0,2.5*σ_y/σ_x3)
β4 ~ Normal(0,2.5*σ_y/σ_x4)
β5 ~ Normal(0,2.5*σ_y/σ_x5)
β6 ~ Normal(0,2.5*σ_y/σ_x6)
β7 ~ Normal(0,2.5*σ_y/σ_x7)

μ = β0 .+ β1*(x1 .- μ_x1)
+ β2*(x2 .- μ_x2)
+ β3*(x3 .- μ_x3)
+ β4*(x4 .- μ_x4)
+ β5*(x5 .- μ_x5)
+ β6*(x6 .- μ_x6)
+ β7*(x7 .- μ_x7)

y ~ MvNormal(μ,ϵ)

I feel like I have to be missing something obvious!

Only the prior of the intercept is sensitive to centering. Let’s write down the same \mu with coefficients for centered and uncentered predictors:

\begin{aligned} \mu_i &= \tilde{\beta}_0 + \sum_{k=1}^n (x_{ik} - m_k) \tilde{\beta}_k\\ &= \tilde{\beta}_0 - \sum_{k=1}^n m_k \tilde{\beta}_k + \sum_{k=1}^n x_{ik} \tilde{\beta}_k\\ &= \beta_0 + \sum_{k=1}^n x_{ik} \beta_k \end{aligned}

So \tilde{\beta}_k = \beta_k for k > 0 and \beta_0 = \tilde{\beta}_0 - \sum_{k=1}^n m_k \tilde{\beta}_k. So we only need to worry about the mean of the intercept prior when we translate our predictors. And yes, it’s only when predictors are centered that the mean of y should be used as the mean of the intercept prior. In general, centering (and standardizing) is recommended both for computational efficiency (all parameters on the same scale) and for interpretability.

It’s best to also do the centering outside of the model body, and you could do it in the signature like this:

...
μ_x = vec(mean(x; dims=1)),
σ_x = vec(std(x; dims=1)),
x_c = x .- μ_x',
μ_y = mean(y),
...

I’ve edited the above post to reflect this.

Yeah I can’t see the issue either, but it’s tricky to diagnose without a complete minimal working example I could run.

That makes it all click, thanks for taking the time to write that out. I also didn’t realize that broadcasting could generalize to work between matrices and vectors like how it works between vectors and scalars, but know that I see it, it makes a lot of sense!

1 Like

My final thought for trying to get at a difference between our two models is trying to see what y (the last line) actually is. Is there a way to extract this information from the model object? I’ve tried a few different things but outside of sampling from the model object, I don’t know how else I can interact with it.

Update: I had both versions @show what y was, and they were both Vector{Float64} of length equal to the number of observations, which is expected! I also moved all of the calculations of mean and std for the x’s out of the body, similar to what’s in your script, but still different results. Mysterious stuff!

No problem! Yes, it’s very useful. Also, broadcasting, mapping, and reducing are generally more friendly when automatically differentiating than rolling your own loops.

Mmm, not that I know of, sorry.

Well thanks for all your help. After tinkering with it this morning, I am just going to chalk it up to my coefficients not being in an array. Turing does find a smaller step size for you script, so perhaps the linear predictors just shouldn’t be loose…it’s the best rationalization I can find hahaha.


text:
NZ Level 8 (NZC) Level 3 (NCEA) [In development]
Limit of (a^h-1)/h as h→0 (investigation)
Lesson

## First principles derivation

The derivative of the exponential function given by $f\left(x\right)=a^x$f(x)=ax can be developed by first principles:

 $f'\left(x\right)$f′(x) $=$= $\lim_{h\rightarrow0}\frac{f(x+h)-f(x)}{h}$limh→0f(x+h)−f(x)h $=$= $\lim_{h\rightarrow0}\frac{a^{x+h}-a^x}{h}$limh→0ax+h−axh $=$= $\lim_{h\rightarrow0}\frac{a^x\left(a^h-1\right)}{h}$limh→0ax(ah−1)h $=$= $a^x\times\lim_{h\rightarrow0}\frac{a^h-1}{h}$ax×limh→0ah−1h

Thus, provided the quantity $\frac{a^h-1}{h}$ah1h converges as $h\rightarrow0$h0, the derivative exists as the product of the original function itself and some constant whose value depends on the base $a$a.

In fact, for the function $f\left(x\right)=2^x$f(x)=2x, as $h\rightarrow0$h0, the quantity $\frac{2^h-1}{h}$2h1h does converge to an irrational number that is approximately $0.693147$0.693147. This means that  $f\left(x\right)=2^x$f(x)=2x, then $f'\left(x\right)\approx0.693147\times2^x$f(x)0.693147×2x

The table shows derivative results for four values of a:

$a$a $\lim_{h\rightarrow0}\frac{a^h-1}{h}$limh0ah1h $f'(x)$f(x)
$2$2 $0.693147...$0.693147... $\approx0.693147\times2^x$0.693147×2x
$3$3 $1.098612...$1.098612... $\approx1.098612\times3^x$1.098612×3x
$4$4 $1.386294...$1.386294... $\approx1.386294\times4^x$1.386294×4x
$5$5 $1.609438$1.609438 $\approx1.609438\times5^x$1.609438×5x

The results suggest that there is a base between $a=2$a=2 and $a=3$a=3 where the quantity in the middle column - namely $\lim_{h\rightarrow0}\frac{a^h-1}{h}$limh0ah1h, is exactly $1$1.

This would reveal the existence of a function that is its own derivative!

Your turn now.  We can see that this function must exist somewhere between 2 and 3.  Pick three values between 2 and 3 and see if you can get closer to this function.

### In fact...

This remarkable and irrational base has the approximate value of $2.718281828459045$2.718281828459045 and has been denoted by the letter $e$e (standing for the word exponential, and first discovered by the mathematician Leonard Euler)

Thus with the base $e\approx2.718$e2.718, we have the important result:

If $f\left(x\right)=e^x,$f(x)=ex, then $f'\left(x\right)=e^x$f(x)=ex.

### Applet

The following applet shows the function $f\left(x\right)=a^x$f(x)=ax and its derivative for a range of values between $a=2$a=2 and $a=3$a=3 . Satisfy yourself that the curves of the function and the differential function coincide when $a\approx2.72$a2.72

### Outcomes

#### M8-11

Choose and apply a variety of differentiation, integration, and antidifferentiation techniques to functions and relations, using both analytical and numerical methods

#### 91578

Apply differentiation methods in solving problems


text:
# Minimal

Geometry Level 4

Find the minimal area of the right triangle with inradius equal to $$1$$ cm. Round your answer to two decimals.

This question appeared in RMO-2014.

×


text:
April 2022

You are currently browsing the monthly archive for April 2022.

Optimal Putting in Disc Golf – Revised

About a year ago, I posted a short article about optimal putting in disc golf.  I gave an approximate rule of thumb to use at the end of the article, but it turns out that there is a better thumb rule, so I’m revising the post accordingly below.

I often have to make a decision when putting at the edge of the green during disc golf.  Should I try to put the disc in the basket (choice 1) or should I just try to put the disc near the basket (choice 2)? If I try to put it in the basket and I miss, sometimes the disc will fly or roll so far way that I miss the next shot.

In order to answer this question, I created a simplified model.  Assume:

• If I do try to put it in the basket (choice 1), I will succeed with probability $p_1$.
• If I do try to put it in the basket (choice 1), fail to get it in the basket, and then fail again on my second try, then I will always succeed on the third try.
• If I don’t try to put the disc in the basket (choice 2), I will land near the basket and get it in the basket on the next throw.

Using these assumptions, I can compute the average number of throws for each choice.

For choice 2, I will always use two throws to get the disc in the basket.

For choice 1, there are three possible outcomes:

• outcome 1.1: With probability $p_1$, I get it the basket on the first throw!
• outcome 1.2: With probability $p_2$, I miss the basket, but get the disc in the basket on the second throw.
• outcome 1.3: With probability $p_3$, I miss twice, and get it on the third throw.

I am assuming that if I miss twice, I will always get it on the third try, so

$$p_1 + p_2 + p_3=1.$$

Let $a$ be the average number of throws for choice 1. Then $$a = p_1\cdot 1 +p_2\cdot 2 +p_3\cdot 3.$$

I should choose choice 1 (go for it) if I average fewer throws than choice 2, i.e. if $a<2$.  This occurs when

\begin{aligned}2 >& p_1\cdot 1 +p_2\cdot 2 +p_3\cdot 3 \\2 (p_1+p_2+p_3) >& p_1\cdot 1 +p_2\cdot 2 +p_3\cdot 3\\p_1\cdot 2+p_2\cdot 2+p_3\cdot 2 >& p_1\cdot 1 +p_2\cdot 2 +p_3\cdot 3\\ p_1 >& p_3.\end{aligned}

So, I should choose choice 1 if $p_1> p_3$.  In words,


text:
## anonymous one year ago Screen shot of problem>>>>

1. anonymous

2. jim_thompson5910

notice how the 10 and x sides correspond so do 8 and 11 sides

3. jim_thompson5910

because the figures are similar, we can form this proportion $\Large \frac{10}{x} = \frac{8}{11}$ cross multiply then solve for x


text:
# Some useful form of the eq. of state of a REAL gas?

1. Oct 30, 2012

### M. next

It is written that:

Another useful form of the equation of state of a real gas is:

Pv= A + B/v + C/v$^{2}$ + ...

Where A, B, C, .. are functions of temperature and are called the "VIRIAL COEFFICIENTS".
(what does this mean?)

Theoretical derivations of the equation of state, based on an assumed law of force between the molecules of a gas, usually lead to an equation in virial form.
(What does this mean as well?)

Last thing:

The van der Waals equation can be put in he virial form as follows:
Pv=RT(1-b/v)$^{-1}$-(a/v)
(where did this come from?)

Thanks in advance people :)!

2. Oct 30, 2012

### Studiot

That's an awfully big and vague question you've asked.

Can you narrow it down a bit?

You have posted the viral equation. Tables of virial constants are available as with other thermodynamic data. What more do you want to know?

3. Oct 30, 2012

### M. next

What is its use in thermodynamics?!

I mean at least in what way does it make eq of state of a real gas USEFUL?!

I don't really get it..

4. Oct 30, 2012

### M. next

What is a virial eq? At least a simple hint will do it.
thanks


text:
## Friday, April 12, 2013 ... /////

### Accidents killing professional climate alarmists

This blog entry will review some recent sad events.

This pretty, 35-year-old lady is Dr Katharine Giles of London. Unfortunately, the bike accident on the picture is no accident. She hit a lorry and died.

Giles focused on the analyses of Arctic and Antarctic ice. Her freezing website featured a blog, too. The most cited paper she co-authored, one with almost 100 citations, was about the 2007 Arctic ice minimum.

The other co-authors were Seymour Laxon and Andy Ridout. And that's where the story gets even more interesting.

This is Seymour Laxon, a 49-year-old researcher who has done some interesting work aside from the unconstrained alarm, and I don't mean his blog that has been silent for years. For example, in 1994, he and David McAdoo started to measure the Arctic gravity field.

What's strange is that two months ago, after a fall, Laxon suffered brain haemorrhage and died, too.

If I were an unhinged climate alarm conspiracy theorist such as Alexander Ač, I would surely start to think about the possibility that the Big Oil is gradually eliminating climate alarmists. And if I were a deeply religious climate skeptic, I could start to believe that it has been the work of God and His ultimate justice instead.

As you may guess, I am neither. But in spite of the missing rational explanation, I would still exploit the 2-event coincidence and recommend Andy Ridout to avoid bikes, mountain-climbing, and falls.

#### snail feedback (23) :

Hai! Good recommendation :).

It is like touching on wood, nobody believes it and most people do it.

Let me give you a personal low probability coincidence:

At Christmas my son broke his arm a bit over the wrist while skiing.

A month later I fell backwards and broke my arm at the same spot.

A month after that , his elder son, 12 years old, broke his arm skiing at the same spot.

I know skiers have a high probability of breaking something. In winter the cafeteria at CERN was full of people in casts. Still.

A month

Frozen to death as fuel bills soar: Hypothermia cases among the elderly double in five years.

http://www.dailymail.co.uk/news/article-2100232/Frozen-death-fuel-bills-soar-Hypothermia-cases-elderly-double-years.html

Don't remember how many times I've read stories like that. Still it's just an abstract, more English pensioners dead in the winter, doesn't mean that much to me.

It's not my grandma. But what if I were in London and it was my grandma who froze to death because the local ordinance forbade her from lighting a fire to keep warm?

I see Gwyneth Paltrow and Mark Wahlberg as the victims; Russell Crow as the vengeful Steve McIntyre.

Did these deaths occur in cooler-than-normal weather? You see, global warming alarmists expect warm weather, so their brains optimize their bodies for it, and whenever it's not warm, they have a higher probability of malfunction. :-)

Still.

You betcha! (There may be something strange going on.)

Meanwhile U.S. public school science books may start incorporating the dogmas of global warming, I.e., that planet has warmed up significantly and humans are playing major role in causing that. Why don't they have the kids look at the data and read the posts here, instead. They might learn some real science then instead of Eco-religious indoctrination. Ugh.

Cyclists in town are dangerous and never respect the highway code. They think that because they don't pollute the air they are the kings the road. I guess the lorry driver will have to live with her death on his conscience all his life. I feel sorry for him too.

Seymour Laxon could have had an aneurysm (growing pocket of blood in the brain) which would have nothing to do with his fall,.

May they rest in peace anyway.

It’s more likely a subdural hematoma caused by the fall. My wife and I have both had bad falls over the past eighteen months. She had a minor hemorrhage while I did not but the doctor did examine me very, very carefully.
We are both in our seventies and are now much more careful. I have known two people who had surgery after a fall in order to relieve the pressure caused by bleeding. It’s pretty common.

Regarding cyclists, Shannon, its a big issue here in Santa Rosa and the cyclist is not always to blame. I have two good cycling friends who were deliberately run down by motorists, one of them on a golf course. The perpetrator will be sentenced on May 1.

Gene, I'm sorry to hear about you and your wife's fall. I hope you'll be ok. According to Lubos' bold innuendo you are safe because you aren't an alarmist ;-)).
The thing with cyclists is that they tend to forget that in some trucks (or 4x4) the visibility and manoeuvrability is limited.

Thanks for your concern, Shannon, but we are now OK and, hopefully, somewhat wiser.

I love the gratuitous attack on my good friend Alex AC. (who would have lost his bet if he actually had the guts to make it).

I broke my left wrist twice a year apart. Must me a one in a million chance of that.

actually I was told to be careful, since it is easier ( more probable) to break again where a break has happened. Also let us not forget psychology and the self fulfilling prophecy effect. In my case I could have been thinking : "Oh, I should be careful at my age", and my grandson "I wonder how dad broke his arm,this way?" . The so called look elsewhere effect.

Well, t least they are carbon neutral now, a fitting end for the stupid.

Luboš,

"I could start to believe that it has been the work of God and His ultimate justice instead." - Indeed, it might be the case! - since for truly good people there is better place than to stay here - only bastards survive, in the end. Gandhi, Luther King, Dian Fossey, Jesus, and many, many others could tell...

Not to mention Hitler, Stalin, Gottwald who was just attending the funeral of his friend I mentioned before him, and others. Maybe you're more high than you planned?

Ouh la la Alexander is mad at some divine injustice.

Hitler had a nice life, so did Stalin (what a trible death of heart attack!), not to mention Gottwald, bastards always have a nice life... but they have to die, eventually ;-)

Considering the death and misery caused by these "climate junk-scientists" I just can't find that I care they are dead. It seems like good karma to me. May it happen to more junk-scientists. The sooner they are gone, the better life will be for the rest of us. It's sort of like life without communists. Well, actually it's the same thing.


text:
location:  Publications → journals
Search results

Search: All articles in the CMB digital archive with keyword reflection group

 Expand all        Collapse all Results 1 - 2 of 2

1. CMB Online first

Nakashima, Norihiro; Terao, Hiroaki; Tsujie, Shuhei
 Canonical systems of basic invariants for unitary reflection groups It has been known that there exists a canonical system for every finite real reflection group. The first and the third authors obtained an explicit formula for a canonical system in the previous paper. In this article, we first define canonical systems for the finite unitary reflection groups, and then prove their existence. Our proof does not depend on the classification of unitary reflection groups. Furthermore, we give an explicit formula for a canonical system for every unitary reflection group. Keywords:basic invariant, invariant theory, finite unitary reflection groupCategories:13A50, 20F55

2. CMB 2000 (vol 43 pp. 496)

Xu, Yuan
 Harmonic Polynomials Associated With Reflection Groups We extend Maxwell's representation of harmonic polynomials to $h$-harmonics associated to a reflection invariant weight function $h_k$. Let $\CD_i$, $1\le i \le d$, be Dunkl's operators associated with a reflection group. For any homogeneous polynomial $P$ of degree $n$, we prove the polynomial $|\xb|^{2 \gamma +d-2+2n}P(\CD)\{1/|\xb|^{2 \gamma +d-2}\}$ is a $h$-harmonic polynomial of degree $n$, where $\gamma = \sum k_i$ and $\CD=(\CD_1,\ldots,\CD_d)$. The construction yields a basis for $h$-harmonics. We also discuss self-adjoint operators acting on the space of $h$-harmonics. Keywords:$h$-harmonics, reflection group, Dunkl's operatorsCategories:33C50, 33C45
 top of page | contact us | privacy | site map |