text
stringlengths
49
10.4k
source
dict
acoustics, software Title: audio signal arithmetic BACKGROUND: I have been messing around with audio signals in Audacity and realized that by inverting a signal and adding it to the same signal I get no signal. Thus (S + invS) is really (S-S). (S+S) = 2S and S increased by 6db is also 2S (checked by subtracting an inverted S+S signal and got no signal). QUESTION: What would be S*S, 1/S, and sqrt(S)? When working with audio signals, you must look at the signals as phasors rather than plain numbers. As such, the signals will be represented as complex numbers. For example, a given sinusoidal signal $Se^{j\phi}$ has an amplitude of S, and a phase angle of $\phi$. Inverting the signal means increasing its phase angle by 180 degrees, or $\pi$ radians. So when adding the two signals together what you are doing is represented by the equation (omitting conjugate pairs): $$S_{sum}=Se^{j\phi}+Se^{j(\phi+\pi)}$$ $$S_{sum}=Se^{j\phi}+Se^{j\phi}e^{j\pi}$$ $$e^{j\pi}=-1$$ $$S_{sum}=Se^{j\phi}-Se^{j\phi}=0$$ In terms of the intensity going up by 6dB when the intensity is doubled, this can be calculated by using the equation: $$ 10log(I_2/I_1)dB$$ Intensity is directly proportional to the square of the amplitude, so doubling the amplitude will result in the equation: $$ 10log(4S^2/S^2)dB=6dB$$ Doing the other calculations you mentioned is a simple matter of trigonometric arithmetic. For example, in the case of squaring the sinusoidal signal, the result is a sinusoid of twice the frequency and half the phase. This is demonstrated by the identity: $$cos^2(x)=\frac{1}{2}(cos(2x)+1)$$
{ "domain": "physics.stackexchange", "id": 6652, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "acoustics, software", "url": null }
-1\leq sin\left(\frac{3}{x}\right) \leq 1\\\ \\ Multiplying\ the\ equation\ with\ x^{4}\\\ \\ -x^{4} \leq sin\left(\frac{3}{x}\right) \leq x^{4}\\\ \\ \\\ \\ Putting\ the\ limit\ in\ the\ equation\\\ \\ \lim_{x\rightarrow 0} -x^{4} \leq \lim_{x\rightarrow 0} sin\left(\frac{3}{x}\right) \leq \lim_{x\rightarrow 0} x^{4}\\\ \\ \\\ \\ \ This\ is\ now\ taking\ the\ form\ of\ sandwich\ theorem\\\ \\ f( x) \leq h( x) \leq g( x)\\\ \\ \\\ \\ \ \ Here\ \ f( x) =-x^{4}\\\ \\ h( x) \ =sin\left(\frac{3}{x}\right)\\\ \\ g( x) \ =x^{4}\\\ \\ \\\ \\ \ \ Solving\ the\ limit\ of\ f( x)\\\ \\ \Longrightarrow \lim {x\rightarrow 0} -x^{4}\\\ \\ \Longrightarrow \ 0\\\ \\ \\\ \\ Solving\ the\ limit\ of\ g( x)\\\ \\ \Longrightarrow \lim {x\rightarrow 0} x^{4}\\\ \\ \Longrightarrow \ 0\\\ \\ \\\ \\ \ Since\ both\ f( x) \ =\ g( x)\\\ \\ Then\ using\ the\ sandwich\ theorem\\\ \\ \lim_ {x\rightarrow 0} h( x) \ =\lim _{x\rightarrow 0}
{ "domain": "wtskills.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109511920161, "lm_q1q2_score": 0.8028498921231654, "lm_q2_score": 0.8152324983301568, "openwebmath_perplexity": 11286.632596645688, "openwebmath_score": 1.0000100135803223, "tags": null, "url": "https://wtskills.com/sandwich-theorem-of-limits/" }
waves is a linear equation. "Linear" means that "if X and Y are solutions", then any linear combination of them $aX + bY$, with $a,b$ real numbers, is also a solution. The equaiton is linear because it is made of derivatives, which are linear (sum of derivatives = derivative of the sum). You can show it explicitly. Yep, it doesn't say anything about multiplication, that's because multiplication ISN'T a solution. a sinus of a multiplication isn't translated as a sum either, $\sin(AB)\neq sin(A) +sin(B)$. Since they are NOT the same, $\sin(AB)$ is not a linear combination of basic solutions, so it's not a solution either. In sum
{ "domain": "physics.stackexchange", "id": 46235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "waves", "url": null }
ros, localization, navigation, ros-melodic Originally posted by TakaHoribe with karma: 181 on 2020-07-29 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by fantasyplus on 2020-08-01: Thanks for you detailed answer!! I reproduce the wf_simulator car moving with only demo gnss data successfully ,and I will try it on my own data and map. BTW,do you know how to create the correct vector map for autoware?I create a map by Tier4(V1.12) and op_global_planner can't show globalpath on that map(with rviz goals config),do you know why? Comment by TakaHoribe on 2020-08-02: @fantasyplus Sorry, I'm not familiar with the vectormap. If you couldn't create any short path from any points, maybe some necessary data is not in your vector map and the related topic is not published. Is there any non-published topic which the op_global_planner subscribes? Comment by fantasyplus on 2020-08-05: I have done it successfully!Thanks for response.
{ "domain": "robotics.stackexchange", "id": 35326, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, localization, navigation, ros-melodic", "url": null }
Selecting $s \leq n$ rows can be done by left-multiplying $\rm A$ by a Boolean diagonal matrix with $s$ ones on its main diagonal. Hence, we have the following Boolean optimization problem $$\begin{array}{ll} \text{minimize} & \| \mathrm A - \mbox{diag} (\mathrm x) \mathrm A \|_{\text{F}}^2\\ \text{subject to} & 1_n^{\top} \mathrm x = s\\ & \mathrm x \in \{0,1\}^n\end{array}$$ Note that $$\mathrm A - \mbox{diag} (\mathrm x) \mathrm A = \left( \mathrm I_n - \mbox{diag} (\mathrm x) \right) \mathrm A = \left( \mbox{diag} (\mathrm 1_n) - \mbox{diag} (\mathrm x) \right) \mathrm A = \mbox{diag} (\underbrace{\mathrm 1_n - \mathrm x}_{=: \mathrm y}) \mathrm A = \mbox{diag} (\mathrm y) \mathrm A$$ Hence, $$\begin{array}{ll} \text{minimize} & \| \mbox{diag} (\mathrm y) \mathrm A \|_{\text{F}}^2\\ \text{subject to} & 1_n^{\top} \mathrm y = n - s\\ & \mathrm y \in \{0,1\}^n\end{array}$$ where
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363494503272, "lm_q1q2_score": 0.8137624631191759, "lm_q2_score": 0.8267117876664789, "openwebmath_perplexity": 281.2863770879159, "openwebmath_score": 0.7358109951019287, "tags": null, "url": "https://mathoverflow.net/questions/270743/sparse-matrix-approximation-using-only-a-few-dense-columns-or-rows/279712" }
ros, callback, topic, rqt Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback cb(msg) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_info.py", line 100, in message_callback self.sizes.append(buff.len) AttributeError: 'cStringIO.StringO' object has no attribute 'len' [ERROR] [1488471809.587778]: bad callback: <bound method TopicInfo.message_callback of <rqt_topic.topic_info.TopicInfo object at 0x7f2ae4bc63d0>> Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback cb(msg) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_info.py", line 100, in message_callback self.sizes.append(buff.len) AttributeError: 'cStringIO.StringO' object has no attribute 'len' [ERROR] [1488471809.591574]: bad callback: <bound method TopicInfo.message_callback of <rqt_topic.topic_info.TopicInfo object at 0x7f2ae4bc63d0>> Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 720, in _invoke_callback cb(msg) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_topic/topic_info.py", line 100, in message_callback
{ "domain": "robotics.stackexchange", "id": 27184, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, callback, topic, rqt", "url": null }
However I feel that my method is too long, is there some kind of way to simplify the answer even more so that I can get an integer solution? You can take a dummy variable $$d\ge 0$$ such that you are actually filling the $$n=3$$ boxes with $$r=99-d$$ balls, so that you have $$a_1+a_2+a_3+d=99$$ where $$a_i$$ is the number of balls in the $$i^{th}$$ box, and we have the restriction, $$a_i,d\ge 0 \forall i\in \{1,2,3\}$$ which has $$\binom{99+4-1}{4-1}=\binom{102}{3}$$ many solutions. However, the sum you have is not too hard to calculate, you just have to use Pascal's identity: $$\binom{n}{r}=\binom{n-1}{r}+\binom{n-1}{r-1}$$ with $$r=3$$ again and again, starting with writing the last term in your obtained sum $$\binom22=1=\binom33$$ and then reducing in each step, the underlined part, to get the last term in the next step $$\binom{101}2+\binom{100}2+\cdots +\binom42+\underline{\binom32+\binom33} \\ =\binom{101}2+\binom{100}2+\cdots +\binom52+\underline{\binom42+\binom43} \\ = \binom{101}2+\binom{100}2+\cdots +\binom62+\underline{\binom52+\binom53}\\ \vdots \\ = \underline{\binom{101}2+\binom{101}3}=\binom{102}3$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9941800417952517, "lm_q1q2_score": 0.8241144275053959, "lm_q2_score": 0.82893881677331, "openwebmath_perplexity": 89.82636486575082, "openwebmath_score": 0.8882494568824768, "tags": null, "url": "https://math.stackexchange.com/questions/3805897/shorter-way-to-calculate-number-of-ways-to-distribute-varying-number-of-balls-in/3805904" }
continuum-mechanics Title: Difference between objectivity and isotropy For a material property to be objective (frame-indifferent) it should not change if another observer is measuring it from his own reference frame. For a material property to be isotropic means that it is the same in all directions. But doesn't that make isotropy and objectivity the same? Since changing observer looks like passive transformation whereas rotating and translating the material itself and observing the properties again looks like active transformation. If they are the same, then why do we have different conditions for strain energy function in case of material objectivity and material isotropy? If you boost to a different velocity, the properties could change but still look the same from all directions. Thus it would be isotropic but not objective. On the other hand, consider a hologram (those laser-etched ones). It shows a different image from each angle, but every observer at those angles would see the same set of images. Objective but not isotropic.
{ "domain": "physics.stackexchange", "id": 88580, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "continuum-mechanics", "url": null }
observational-astronomy, amateur-observing, satellite In regards to radio astronomy, the NRAO were happy enough with SpaceX Starlink, though there might be concerns with other constellations such as Oneweb. NRAO Statement Oneweb concerns In reference to the previous point, all of this comes with the caveat that Starlink is potentially only one of perhaps 4 or 5 LEO constellations. Even if SpaceX acts responsibly you still have to convince all of the others to do so as well, which might be difficult. SpaceX and AAS are working together on ways of reducing the impact of Starlink to astronomy. AAS on mitigating Satellites Constellations impact
{ "domain": "astronomy.stackexchange", "id": 4269, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "observational-astronomy, amateur-observing, satellite", "url": null }
cc.complexity-theory, reference-request The notion of complexity parameter is explained in section 1.1.2 of the paper and simply is a generalization of using the input or solution size to characterize the complexity and/or size of relevant quantities. E.g. for the problem $k$-SAT the complexity parameter could be the number of variables, the number of clauses or the binary length of the SAT expression. Now, suppose we have $2$ SERF reductions $R_{1}$ from $A_{1}$ with complexity parameter $m_{1}$ to $A_{2}$ with complexity parameter $m_{2}$ and $R_{2}$ from $A_{2}$ to $A_{3}$ with complexity parameter $m_{3}$. We will define the composition in a meaningful way and show that it is also a SERF reduction from $A_{1}$ to $A_{3}$. The composition of two SERF reductions must also be a collection, where we compose the two Turing reductions for each fixed $\epsilon > 0$.We need to check that the restriction of the definition still hold for each $\epsilon>0$. To begin with, we can simply compose the two Turing reductions $M_{\epsilon}^{A_{2}}$ and $M_{\epsilon}^{A_{3}}$ to obtain $M_{\epsilon}^{'A_{3}}$. This is possible since Turing reductions are composable. In short, whenever $M_{\epsilon}^{A_{2}}$ queries $A_{2}$ on input $x'$, instead of using the oracle for $A_{2}$ we call $M_{\epsilon}^{A_{3}}$ on input $x'$. It remains only to see if the restrictions are respected:
{ "domain": "cstheory.stackexchange", "id": 5754, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cc.complexity-theory, reference-request", "url": null }
python, pygame frames_per_sec.tick(FPS) if __name__ == '__main__': main() Game play screenshots: Comment The game seems to run fine. I moved some of my code into main() so that I can create a restart feature for the next step. Also some of the additional features I'm thinking about creating: undo function: undoes a previous move redo function: restores a piece deleted by the undo() function leave a mark on the current piece. example: Any criticism/help are very welcome! On the whole, this game works nicely and the design decisions make sense for the size and purpose of the program. Variable names are clear, there's some separation between GUI and game logic and you've made an effort to use functions. Some of my suggestions might be premature, but if you plan to extend the program to add a feature like an AI or undo/redo moves, I'd suggest a redesign. Crash On my screen, a white bar renders on the right side of the game. If you click it, drop_a_piece raises an uncaught IndexError because it has no bounds checking. Avoid unnecessary comments Many of the comments are redundant: # drop a piece def drop_piece(board, row, col, piece): board[row][col] = piece I can tell from the function name that this drops a piece. Comments like this feel insulting to the reader's intelligence. If you want to document your functions, the Python way is to use docstrings and (optionally) doctests to enforce contracts. Occasional # comments are OK, as long as they actually offer deep insight into the code that isn't necessarily apparent otherwise. You have a few of these, like # turn decision, if black(1)/white(2) piece already placed, go back to the previous turn ...but make sure these comments aren't crutches to make up for unnecessarily confusing code. Avoid comments as a substitute for proper code abstractions Other comments are used in place of namespaces or functions, real program structures that organize logic. For example, something as simple as: # colors BLACK = (0,0,0) WHITE = (255,255,255) BROWN = (205,128,0)
{ "domain": "codereview.stackexchange", "id": 41711, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, pygame", "url": null }
experimental-chemistry, analytical-chemistry, polymers Title: Copolymer purity, what does AN / MA / MS mean? I would like to buy some polyacrylonitrile (PAN) powder from GoodFellow and I have the choice between these two products: AN316010, quality : Copolymer (99.5% AN / 0.5% MA) AN316020, quality : Copolymer (93.9% AN / 5.8% MA/ 0.3 % MS) What I do not understand is the meaning of these three acronyms. What is the abbreviation hidden behind AN, MA and MS? This may be an obvious question but I was unable to find any answer so far. I guess this may be somewhat linked to a certain degree of purity of the product, but since polymers can also be sold with different Monomer / Polymer ratios, I wanted to be sure... My best guess for now is that AN may be AcryloNitrile, but I have no idea as for MA and MS... MA may be Methacrylic Acid, but could also be Methylmethacrylate Acrylonitrile or Maleic Anhydride (see here). Any help to answer this question is more than welcome. Although in this particular case I may simply contact the supplier to have my answer I also wonder: Is there a general way to solve these chemical identification issues or is it up to each supplier to name these types of compounds as they see fit? I contacted GoodFellow directly and they gave me the following answer: 93.9% AN: 93.9% AcryloNitrile 5.8% MA: 5.8% Methyl Acrylate 0.3% MS: 0.3% Methyl Sulfonate I guess different manufacturers may name their products as they see fit. In particular, for polymers that can share the same abbreviations, only the context and a good background knowledge of their synthesis pathway may allow one to decide... There are, however, IUPAC guidelines for polymer abbreviations available here[1]. In addition several other websites offer their own abbreviation list e.g. here and there. [1]. J. He et al., Abbreviations of polymer names and guidelines for abbreviating polymer names (IUPAC Recommendations 2014), 2014. DOI: 10.1515/pac-2012-1203
{ "domain": "chemistry.stackexchange", "id": 15084, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-chemistry, analytical-chemistry, polymers", "url": null }
complexity-theory, formal-languages, turing-machines, space-complexity One other thing that I really don't understand is the very last equation, which says "Combining (1.3), (1.4) and (1.5) and taking logs, we get $S(n) \ge \Omega(\log\log n)$." The equations in question state \begin{align} N &= qS(n)d^{S(n)} \\ \frac{n}{2} &\le \frac{N^{m+1}-1}{N-1} \\ m &\le 2N \end{align} The second equation simplifies to $$ n \leq 2N^{2m}. $$ Applying the third equation, $$ n \leq 2N^{4N}. $$ Taking logarithm, $$ \log n \leq 4N\log N + \log 2. $$ If $x \leq y\log y$ then $y = \Omega(x/\log x)$, and so $$ N = \Omega\left(\frac{\log n}{\log\log n}\right). $$ Substituting the value of $N$, $$ qS(n)d^{S(n)} = \Omega\left(\frac{\log n}{\log\log n}\right). $$ Taking another logarithm, $$ \log q + \log S(n) + S(n) \log d \geq \log \log n - O(1). $$ Since $\log q + \log S(n) = o(S(n))$, the left-hand side is $O(S(n))$, and so $$ S(n) = \Omega(\log\log n). $$
{ "domain": "cs.stackexchange", "id": 19204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, formal-languages, turing-machines, space-complexity", "url": null }
machine-learning, data-mining Title: How to connect data-mining with machine learner process I want to write a data-mining service in Google Go which collects data through scraping and APIs. However as Go lacks good ML support I would like to do the ML stuff in Python. Having a web background I would connect both services with something like RPC but as I believe that this is a common problem in data science I think that there is some better solution. For example most (web) protocols lack at: buffering between processes clustering over multiple instances So what (type of libraries) do data scientists use to connect different languages/processes? Bodo I am not 100% if a message queue library will be the right tool for this job but so far it looks to me so. With a messaging library like: nsq zeromq mqtt (?) You can connect different processes operating on different environment through a TCP based protocol. As these systems run distributed it is possible to connect multiple nodes. For nsq we even have a library in Python and Go!
{ "domain": "datascience.stackexchange", "id": 163, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, data-mining", "url": null }
quantum-mechanics \end{align} should vanish. (Even if they did my main question still stands namely if you can always freely change the order of the wavefunctions). Note that the choice of permutation in coordinates or labels is equivalent to the choice whether to expand to rows or columns in a Slater determinant. EDIT: upon request a more elaborate version. Suppose we want to write down a general wave function for 2 identical fermions $\Psi$. This wavefunction has to be antisymmetric. Suppose the single particle states are given by $$ \varphi_{\alpha_i}(r_i,s_i) \,\,\,\,\,\ i \in \{1,2\} $$ Where $\alpha_i$ denotes the quantum numbers of a state, while $r_i,s_i$ denote the spatial and spin coordinates. A way to antisymmeterize $N$-body wavefunction in terms of single particle wavefunctions is often introduced by the concept of a Slater determinant. In the case of two particles a Slater determinant looks like \begin{align} \Psi_{\alpha_1,\alpha_2}(r_1,s_1,r_2,s_2) = \frac{1}{\sqrt{2}} \left| \begin{array}{c c} \varphi_{\alpha_1}(r_1,s_1) & \varphi_{\alpha_2}(r_1,s_1) \\ \varphi_{\alpha_1}(r_2,s_2) & \varphi_{\alpha_2}(r_2,s_2) \end{array} \right|. \end{align} Now we can calculate this determinant by expanding along a row or along a column. Which is equivalent to the choice whether to permute the quantum numbers of the single particle states or the the coordinates of the single particle states. More explicitly, expanding the matrix along the first row (or equivalently, permuting the label of the single particle states) we get, $$
{ "domain": "physics.stackexchange", "id": 8488, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics", "url": null }
quantum-gate, superposition $$\vert \psi \rangle = \vert 1 \rangle$$ which means our qubit will always be "$1$" or $\vert 1 \rangle$ (i.e., our single-qubit collapses to $\vert 0 \rangle$ 0% of the time and $\vert 1 \rangle$ 100% of the time). How about we make $\alpha = \dfrac{1}{\sqrt{2}}$, then, $\beta = \dfrac{1}{\sqrt{2}}$, hence, we have: $$\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle$$ $$\vert \psi \rangle = \dfrac{1}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$$ So, when we measure our single-qubit, it collapses to $\vert 0 \rangle$ 50% of the time and $\vert 1 \rangle$ 50% as well. In general, performing a measurement on a qubit destroys its superposition (i.e., the qubit will behave as a bit after measurement, it could be only 0 or only 1). Furthermore, you should have a look at the Hadamard Gate which takes a qubit and turns it into superposition.
{ "domain": "quantumcomputing.stackexchange", "id": 1162, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-gate, superposition", "url": null }
organic-chemistry, reaction-mechanism Title: Mechanism of SN1 reaction Let us say that we have water reacting with t-butyl chloride. When the chlorine atom departs we have a t-butyl cation which becomes an attractive substrate to the nucleophilic oxygen in water. My question is in the reaction that follows, does the hydrogen break off from water first allowing oxygen to attack the carbocation or does water immediately form a bond with the carbocation and then deprotinates the extra hydrogen? Surely there are both $\ce{H2O}$ and $\ce{OH-}$ which attacks the carbocation, as well as, heaven forbid, $\ce{H3O+}$ (and countless other species formed by the auto-ioniziation of water). Usually textbooks record $\ce{H2O}$ as the attacker because it is much more abundant in the mixture. After that, usually another $\ce{H2O}$ comes and take away the extra $\ce{H}$ with itself converting to $\ce{H3O+}$, but as I mentioned above, this step could also be done by $\ce{OH-}$ among many more species, but the concentration of those other species are too small that they are not worth mentioning. PS: the last step can also be done by the product, i.e. t-butyl alcohol.
{ "domain": "chemistry.stackexchange", "id": 6302, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, reaction-mechanism", "url": null }
beginner, c, datetime, database, to-do-list puts("| Event successfully added.\n"); return e; } // Add an event to an event list at a specified index void addEventAtIndex(event list[], const event e, const int i) { if (isNull(&e)) { // if our event is NULL, return return; } list[i].hour = e.hour; list[i].minute = e.minute; strcpy(list[i].description, e.description); } // Insertion sort by swapping struct members void sort(event list[], const int size) { for (int i = 1; i < size; i++) { for (int j = i; j > 0 && (list[j - 1].hour > list[j].hour || (list[j - 1].hour == list[j].hour && list[j - 1].minute > list[j].minute)); j--) { int hourJ = list[j].hour; int minuteJ = list[j].minute; char descriptionJ[_MAX_DESCRIPTION]; strcpy(descriptionJ, list[j].description); int hourJMinus1 = list[j - 1].hour; int minuteJMinus1 = list[j - 1].minute; char descriptionJMinus1[_MAX_DESCRIPTION]; strcpy(descriptionJMinus1, list[j - 1].description); list[j].hour = hourJMinus1; list[j].minute = minuteJMinus1; strcpy(list[j].description, descriptionJMinus1); list[j - 1].hour = hourJ; list[j - 1].minute = minuteJ; strcpy(list[j - 1].description, descriptionJ); } } } // Add an event to an event list by sorting it into position void sortInsert(event list[], int *size, event e) { addEventAtIndex(list, e, *size); // Add event to the end of the list (*size)++; // Increment size
{ "domain": "codereview.stackexchange", "id": 19170, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, c, datetime, database, to-do-list", "url": null }
scatter(features[:, 1], features[:, 2], color="black") 2. Use the K-means algorithm to categorize human faces in this dataset. This kind of learning can be used later when we encounter a new face, we would be able to determine which group it belongs to. It may be a good idea to reduce the dimensions of the data and scale features to the same ranges. Exclude people who have less than 20 pictures, otherwise the predictions would be too random. Reserve a fraction of the images for testing. (Optional. 3 points) You can read in the images with the Images.jl library: # Install required packages using FileIO The images are in color, but it is easier to work with grayscale. You can either manually change the images to grayscale, or do it with the Gray function from the ColorTypes package (Gray.(img)). To manually convert a color image to a grayscale, you can use one of the following approaches. a) take the mean of the R, G, and B values. b) find the difference between the highest value and the lowest value among R, G, and B, and divide it by 2. c) Use luminosity method, which is a weighted average of the R, G and B values: 0.21 R + 0.72 G + 0.07 B. Tags:
{ "domain": "github.io", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429604789207, "lm_q1q2_score": 0.8172986714318444, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 556.4073856131221, "openwebmath_score": 0.7272329330444336, "tags": null, "url": "https://kavir1698.github.io/aml/kmeans.html" }
functional-programming, scala, immutability SearchQuery: Class to help build search queries. Can be converted to a valid search query string. /** Consult https://developer.github.com/v3/search/ and https://help.github.com/articles/search-syntax/ for details on * parameters and qualifiers. */ case class SearchQuery(query: String, qualifiers: Map[String,Qualifier] = Map(), parameters: Map[String,String] = Map()) { /** * Returns the parameters for the query */ def toParams: Seq[(String, String)] = { ("q", query + qualString) +: parameters.toSeq } /** * Adds a qualifier to the query. Will overwrite other qualifiers of the same type. */ def qualify(qual: Qualifier): SearchQuery = copy(qualifiers = qualifiers + (qual.left -> qual)) def qualify(key: String, value: String): SearchQuery = qualify(Qualifier(key, value)) def exclude(key: String, value: String): SearchQuery = qualify(Qualifier(key, value, negate = true)) /** * Adds a parameter to the query. Will overwrite other parameters with the same name. */ def addParam(param: String, value: String): SearchQuery = { assert(param != "q", "Cannot overwrite the search keyword parameter") copy(parameters = parameters + (param -> value)) } def sortBy(sort: String): SearchQuery = addParam("sort", sort) def orderBy(order: String): SearchQuery = addParam("order", order) def getPage(pageNumber: Int): SearchQuery = addParam("page", pageNumber.toString) def perPage(pageSize: Int): SearchQuery = addParam("per_page", pageSize.toString)
{ "domain": "codereview.stackexchange", "id": 24205, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "functional-programming, scala, immutability", "url": null }
ros, 2d-pose-estimate, 2d-mapping <node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen"> <param name="target_frame_name" type="string" value="/map" /> <param name="source_frame_name" type="string" value="$(arg trajectory_source_frame_name)" /> <param name="trajectory_update_rate" type="double" value="$(arg trajectory_update_rate)" /> <param name="trajectory_publish_rate" type="double" value="$(arg trajectory_publish_rate)" /> </node> <node pkg="hector_geotiff" type="geotiff_node" name="hector_geotiff_node" output="screen" launch-prefix="nice -n 15"> <remap from="map" to="/dynamic_map" /> <param name="map_file_path" type="string" value="$(arg map_file_path)" /> <param name="map_file_base_name" type="string" value="$(arg map_file_base_name)" /> <param name="geotiff_save_period" type="double" value="45" /> <param name="draw_background_checkerboard" type="bool" value="true" /> <param name="draw_free_space_grid" type="bool" value="true" /> <param name="plugins" type="string" value="hector_geotiff_plugins/TrajectoryMapWriter" /> </node>
{ "domain": "robotics.stackexchange", "id": 21138, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, 2d-pose-estimate, 2d-mapping", "url": null }
python, parsing, compression #Group to the conditional statements oneLineAgo,twoLinesAgo=None,None try: twoLinesAgo,oneLineAgo=outputList[-2:] except: pass if oneLineAgo and twoLinesAgo: oneLineAgoStrip=oneLineAgo.lstrip() twoLinesAgoStrip=twoLinesAgo.lstrip() oneLineAgoIndentLevel = len(oneLineAgo)-len(oneLineAgoStrip) #Check the current indent is less than the last line, and the last line indent is greater than the 2nd last line if leadingSpace<oneLineAgoIndentLevel: if int(oneLineAgoIndentLevel-indentLevel*indentMultiplier)==len(twoLinesAgo)-len(twoLinesAgoStrip): #Make sure 2 lines ago was a statement, but the latest line wasn't if any(x in twoLinesAgoStrip[:7] for x in groupableNames) and all(x not in oneLineAgoStrip[:7] for x in groupableNames): outputList[-2] = twoLinesAgo+oneLineAgoStrip outputList.pop(-1) #Add the indent and repeat line=' '*leadingSpace+stripLine outputList.append(line.rstrip()) return '\r\n'.join(outputList[:-1]) Here's an example of how it works: Messy input code: ''' Some example code ''' print "Testing "+ ( str( 1234 ) + '3' )*2 b = 7 c = 46 print ( b + c )/3 def myFunction( x ): #Just a function outputList = [] for i in range( x ): outputList.append( i % 10 ) return outputList print myFunction( b ) Basic: >>>compactCode(input) print "Testing "+(str(1234)+'3')*2 b=7 c=46 print(b+c)/3 def myFunction(x): outputList=[] for i in range(x): outputList.append(i%10) return outputList print myFunction(b)
{ "domain": "codereview.stackexchange", "id": 12767, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, parsing, compression", "url": null }
organic-chemistry, aromatic-compounds, stability The pictures of the molecular orbitals correspond to their energies. The e means that the two orbitals next to each other are degenerate, i.e. have the same energy. Let’s fill 6 $\unicode[Times]{x3c0}$-electrons ($\ce{C5H5-}$) into this scheme. We get three completely filled orbitals and two rather antibonding unoccupied orbitals. Looking good. Now let’s extract a single electron to create the $\ce{C5H5^{.}}$ radical. The electron must come from one of the two HOMOs, so we end up with one degenerate orbital completely occupied, the other one only occupied by a single electron (usually drawn with ↑ or $\unicode[Times]{x3b1}$-spin). Now we’ll abstract another electron to arrive at the $4\unicode[Times]{x3c0}$ $\ce{C5H5+}$ cation. Two of the remaining four electrons can be filled into the lower-lying $\ce{a_1}$ orbital, the other two need to be in $\ce{e1}$ and since the latter is degenerate we arrive at a triplet state: Both electrons have $\unicode[Times]{x3b1}$-spin. This is rather unstable. The triplet state and hence the instability can be avoided by distorting the molecule. If elements of symmetry ($\ce{C5H5^?}$: most importantly the plane of symmetry) are lost, the equivalence of the orbitals here labelled $\ce{e_1}$ is also lost and there is no reason not to pair the electrons into a single orbital. That’s why cyclobutadiene is not a square but a rectangle.
{ "domain": "chemistry.stackexchange", "id": 12252, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, aromatic-compounds, stability", "url": null }
beginner, linked-list, rust (It seems that combinators such as map_or cannot be used here since self.next.as_deref_mut().map_or(self, Self::get_last_element_mut) would alias the mutable reference self.) I would, however, also consider going with an iterative version to prevent unnecessary recursion: fn get_last_element_mut(&mut self) -> &mut Self { let mut last = self; while let Some(ref mut next) = last.next { last = next; } last } impl Index<usize> for List { type Output = List; // ... } I would expect type Output = usize (or type Output = T for a generic List<T>) along with an implementation of IndexMut<usize> for consistency with other containers. I would rename the operation you implemented (get_node?) and perhaps make it return an Option instead of panicking. .expect("line should have {index} more elements") The panic message is literally "line should have {index} more elements" — no substitution is performed for {index}, which is probably not intended. (In fact, such implicit named arguments only work within the formatting macros format!, print!, write!, etc.). The fix is .unwrap_or_else(|| panic!("line should have {index} more elements")) By the way, this is a clever panic message as it mentions the quantity index - len, which conveniently stays constant during the recursion. The standard message is index out of bounds: the len is {} but the index is {}, for comparison, which I personally find more informative. impl PartialEq for List { fn eq(&self, other: &Self) -> bool { self.value == other.value && self.next == other.next } } This is equivalent to the default implementation of PartialEq, which (along with a few other default trait implementations) can be applied using derive when defining struct List: #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct List { // ... }
{ "domain": "codereview.stackexchange", "id": 43742, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "beginner, linked-list, rust", "url": null }
College Physics for AP® Courses # 10.6Collisions of Extended Bodies in Two Dimensions College Physics for AP® Courses10.6 Collisions of Extended Bodies in Two Dimensions ### Learning Objectives By the end of this section, you will be able to: • Observe collisions of extended bodies in two dimensions. • Examine collisions at the point of percussion. The information presented in this section supports the following AP® learning objectives and science practices: • 3.F.3.1 The student is able to predict the behavior of rotational collision situations by the same processes that are used to analyze linear collision situations using an analogy between impulse and change of linear momentum and angular impulse and change of angular momentum. (S.P. 6.4, 7.2) • 3.F.3.2 In an unfamiliar context or using representations beyond equations, the student is able to justify the selection of a mathematical routine to solve for the change in angular momentum of an object caused by torques exerted on the object. (S.P. 2.1) • 3.F.3.3 The student is able to plan data collection and analysis strategies designed to test the relationship between torques exerted on an object and the change in angular momentum of that object. (S.P. 4.1, 4.2,, 5.1, 5.3) • 4.D.2.1 The student is able to describe a model of a rotational system and use that model to analyze a situation in which angular momentum changes due to interaction with other objects or systems. (S.P. 1.2, 1.4) • 4.D.2.2 The student is able to plan a data collection and analysis strategy to determine the change in angular momentum of a system and relate it to interactions with other objects and systems. (S.P. 2.2)
{ "domain": "openstax.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.978712645102011, "lm_q1q2_score": 0.8046869008393497, "lm_q2_score": 0.8221891327004132, "openwebmath_perplexity": 447.78011565599604, "openwebmath_score": 0.6482318043708801, "tags": null, "url": "https://openstax.org/books/college-physics-ap-courses/pages/10-6-collisions-of-extended-bodies-in-two-dimensions" }
<- NULL cat("\n") return(outMAT) } And then he writes: "The input is an ‘nls’ object, a data.frame ‘newdata’ of values to be predicted with the value x_new in the first column and (optional) “errors-in-x” (as sigma) in the second column. The number of simulations can be tweaked with nsim as well as the alpha-level for the confidence interval. The output is f(x_new, beta) (fitted value), mu(y_n) (mean of simulation), sigma(y_n) (s.d. of simulation), median(y_n) (median of simulation), mad(y_n) (mad of simulation) and the lower/upper confidence interval." He has some additional text explaining this further and giving a usage example, but I don't feel like it's really appropriate for me to copy his entire blog post into this answer, so please visit his page, if it still exists, for further details. Anyway it's pretty simple and self-explanatory, and worked for me right out of the box, on the first try. Thanks Andrej! A note regarding confidence intervals (2 above), and the answer by @Etienne Low-Décarie: Even after attaching nls2, the as.lm functions is sometimes unavailable. Based on this (now stale) reference (originally authored by delichon), here's the function's source: as.lm.nls <- function(object, ...) { if (!inherits(object, "nls")) { w <- paste("expected object of class nls but got object of class:", paste(class(object), collapse = " ")) warning(w) } gradient <- object$m$gradient() if (is.null(colnames(gradient))) { colnames(gradient) <- names(object$m$getPars()) } response.name <- if (length(formula(object)) == 2) "0" else as.character(formula(object)[[2]]) lhs <- object$m\$lhs()
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9579122720843811, "lm_q1q2_score": 0.8160960388410113, "lm_q2_score": 0.8519527963298946, "openwebmath_perplexity": 4128.609831917478, "openwebmath_score": 0.5497552156448364, "tags": null, "url": "https://stats.stackexchange.com/questions/25318/how-to-get-p-value-and-confidence-intervals-for-nls-functions/251501" }
quantum-mechanics, quantum-spin Title: Spin about an arbitrary axis This is based off question 4.30 from Griffith's Introduction to Quanum Mechanics. It asks for the matrix $\textbf{S}_r$ representing the component of spin angular momentum about an axis defined by: $$r = \sin{\theta}\cos{\phi}\hat{i}+\sin\theta\sin\phi\hat{j}+\cos\theta\hat{k}$$ for a spin = $1/2$ particle.The problem is, I can't visualize how the spin vectors relate to spatial coordinates. $$\chi_+ = \begin{pmatrix} 1 \\ 0\end{pmatrix}\ \text{ and } \chi_- = \begin{pmatrix} 0 \\ 1 \end{pmatrix}. $$ So these form a basis of some kind of space, but this is a space I don't understand, for example, why does: $$\chi^{(x)}_+ = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\1 \end{pmatrix} ?$$ I was going to try to use a rotation matrix with angles corresponding to my axis of rotation to try and "rotate" the spin vector onto it, but then I realized that not only do the dimensions not match up, but the angle is π/4, which doesn't make much sense to me. So I guess my question is, how does the 'geometry' of spin work and how can I transform the spins corresponding to a transform I do in space? Thanks. Great and important question; I hope this response is illuminating and encourages you and others to explore Lie Groups, Lie Algebras, and their representations. When you want to rotate a vector $\mathbf v$ in three dimensions, then you act on that vector with a rotation matrix $R$ to obtain a rotated vector $\mathbf v'$ related to the original vector by $$ \mathbf v' = R\mathbf v $$
{ "domain": "physics.stackexchange", "id": 90693, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, quantum-spin", "url": null }
electromagnetism, magnetostatics Title: How to justify the direction of the magnetic field formally, in symmetrical situations? I know the right hand rule and I know how to use it, what I am asking for is a formal argument for situations where symmetry is in our favour. The right hand rule is a kind of mnemonic but it doesn't prove anything.
{ "domain": "physics.stackexchange", "id": 88475, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, magnetostatics", "url": null }
inorganic-chemistry, quantum-chemistry Title: Quantum numbers required to specify the position of an electron In a test today, there was this question: How many quantum numbers are required to specify the position of an electron? $$(A)\ 1 \quad (B)\ 2 \quad (C)\ 3 \quad (D)\ 4$$
{ "domain": "chemistry.stackexchange", "id": 12023, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry, quantum-chemistry", "url": null }
The discriminant of a cubic equation tells how many roots there are: $$0 = ax^3+bx^2+cx+d\\ \Delta=18abcd-4b^{3}d+b^{2}c^{2}-4ac^{3}-27a^{2}d^{2}$$ Then $\Delta > 0$ corresponds to 3 real roots, $\Delta < 0$ to 1 real root and 2 complex roots, and $\Delta = 0$ to multiple root with all roots real. I don't know for the case $\Delta = 0$ whether there are two distinct roots (one with multiplicity 2) or one root with multiplicity 3. Maybe both could occur. I plotted the sign of the discriminant, with the parabola and a grid of unit size overlayed. The grey regions correspond to positive discriminant (3 real roots), white regions to negative discriminant (1 real root). Here is the GLSL source code, for use with Fragmentarium: #include "Progressive2D.frag"
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9632305360354471, "lm_q1q2_score": 0.8068211243232899, "lm_q2_score": 0.837619961306541, "openwebmath_perplexity": 802.6337653883553, "openwebmath_score": 0.48603636026382446, "tags": null, "url": "https://math.stackexchange.com/questions/2133724/number-of-normals-to-a-parabola-from-a-given-point?rq=1" }
newtonian-mechanics, statics Similarly, take the calculation of $\mathbf{r}$ and expand out the expression $$ \mathbf{F} \times \mathbf{r} = \mathbf{F} \times \mathbf{r}_A + \frac{ \mathbf{F} \times \left( \mathbf{F} \times \mathbf{M}_A \right)}{ \| \mathbf{F} \|^2} = \mathbf{F} \times \mathbf{r}_A + \frac{ \mathbf{F} \cancel{ \left( \mathbf{F} \cdot \mathbf{M}_A \right)}-\mathbf{M}_A \| \mathbf{F} \|^2 }{ \| \mathbf{F} \|^2} = \mathbf{F} \times \mathbf{r}_A - \mathbf{M}_A$$ Example
{ "domain": "physics.stackexchange", "id": 45804, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, statics", "url": null }
python, parsing for opt, arg in opts: if opt == '-h': usage() elif opt in ("-y", "--year"): target_year = arg if target_year not in map(str, range(first_yr, last_yr + 1)): raise ArgumentError("Argument Error: Invalid year passed. \n " "One valid year is within (%s, %s)" % (first_yr, last_yr)) elif opt in ("-c", "--campaign"): campaign = arg.lower() if campaign not in campaign_type: raise ArgumentError("Argument Error: Invalid 'Campaign type' passed. " "A valid value can be any of %s" % str(campaign_type)) else: raise ArgumentError("Bad argument: I don't know what %s is" % arg) if target_year is None or campaign is None: raise ArgumentError("You need to supply both -y and -c") print 'Year : ', target_year print 'campaign: ', campaign # return argument values return target_year, campaign if __name__ == "__main__": target_year, campaign = parse_arguments(sys.argv)
{ "domain": "codereview.stackexchange", "id": 5354, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, parsing", "url": null }
black-holes, observers, event-horizon, information Remants seem absurd. If this response were taken seriously, it would essentially imply that all the information about the black hole - an object of potentially arbitrary mass! - can somehow be contained within a Planck-scale volume. This would be very odd. Page timescale. It can be shown that about the first half of the black-hole information must be emitted over the same "Page" timescale as it takes to emit about half of the mass. This seems to imply that something poorly-understood is going on even while the hole is large.
{ "domain": "physics.stackexchange", "id": 26363, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "black-holes, observers, event-horizon, information", "url": null }
ros, remap, ros-kinetic Original answer: <launch> <remap from="~input" to="/rectified/left/image"/> ... </launch> This won't work: the ~ there is typically used to refer to the private namespace of a node. Your remap tag is however not a child of any node, so this remapping doesn't make sense. You'll want to move the remap down to where the mask_rcnn_node node is being launched: <node pkg="mask_rcnn_ros" type="mask_rcnn_node" name="mask_rcnn"> <remap from="input" to="/rectified/left/image" /> </node> and drop the ~. Originally posted by gvdhoorn with karma: 86574 on 2019-03-26 This answer was ACCEPTED on the original site Post score: 4
{ "domain": "robotics.stackexchange", "id": 32755, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, remap, ros-kinetic", "url": null }
experimental-physics, home-experiment, data, astrophotography Title: Raw data acquirable from amateur astrophotography What raw data can I possibly acquire from an 8" Classical Dobsonian Telescope, and a DSLR? Could anything eye-opening to amateur astronomers be computed or calculated first-hand with such equipment? I'm sure scientists must've considered this equipment "advanced technology" at some point in history not too far back...Could I rediscover or calculate some Laws (like Kepler's laws) or some other things amateur astronomers would be amazed to calculate themselves (like the distance to a planet) using this equipment? An 8" telescope was state of the art in 1686 (even though a modern amateur instrument is certainly much better than Huygens' lenses were) and a normal DSLR sensor has only slightly better properties than plates that were used in astronomy up to the 1980s, so there isn't much gain there, in terms of instrument performance, over fairly old equipment... it's just MUCH more convenient to use. You can, however,re-live old discoveries with it, if you like and you could also discover new things with relative modest instruments. That, however, may quickly become a full-time job, irrespective of what instrument you use. If you want to understand what Copernicus and Kepler did, it's probably best to read their books, first. They may give you an idea of just how much intellectual and observational effort it took to amass the knowledge that we are teaching in high school, today. The real problem in observational astronomy is that a lot of what astronomers do is not just linked to the performance of their instruments, but to the total amount of time that is needed to perform high quality research. If you look at some of the finest amateur astronomy imagery, you will find that the "amateur" has spent months or years waiting for near optimum conditions (alternatively you can move to Hawaii and camp out on the volcano... just like the professionals), took dozens if not hundreds of frames and then spent days stacking and processing them with the same tools that the professionals are using.
{ "domain": "physics.stackexchange", "id": 27466, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "experimental-physics, home-experiment, data, astrophotography", "url": null }
molecular-orbital-theory Title: 1s orbitals and 2nd period diatomic elements a general chemistry textbook I am reading says this: "In second-period diatomic molecules, the 1s orbitals of the two atoms barely overlap. Because the $\sigma _{g1s}$ bonding and $\sigma _{u1s}$* antibonding orbitals are both doubly occupied, they have little net effect on bonding properties and need not be considered" i'm confused as to what it means... 1s AOs don't and won't form MOs due to weak overlap MOs formed from 1s Aos aren't significant for chemical reactivity I may be missing something, but if anyone can clarify as to what the text meant that will be great. and also can you mention if it extends beyond the 2nd period or even to heteronuclear molecules. The energy splitting between a bonding and the corresponding anti-bonding orbital is dependent on the overlap: the greater the overlap, the greater the splitting. But take note that the relationship is not really linear and that the split is not perfectly symmetrical: the anti-bonding orbital usually rises more strongly than the bonding orbital lowers its energy. This means that the interaction of the 1s orbitals in, say, dinitrogen, is repulsive (in terms of atom-atom distance), but also very small because the 1s orbitals are small (a consequence of the high nuclear charge compared to hydrogen), which leads to poor overlap.
{ "domain": "chemistry.stackexchange", "id": 9336, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "molecular-orbital-theory", "url": null }
python, beginner, matplotlib, raspberry-pi Title: Time and temperature displaying program for Raspberry Pi This program displays either the time, current temperature, 12hr graph of temps, 24 hr graph of temp or a week's graph of temps. Selection is based on user input of one of the GPIO pins. Please review my code, especially the use of the global variables, indentation and comments. from subprocess import * import matplotlib from numpy import genfromtxt matplotlib.use('Agg') import pylab import Image import pygame import os import time from time import strftime #from pygame.locals import* #from matplotlib.dates import DateFormatter import RPi.GPIO as GPIO import datetime def run_cmd(cmd): """Used to run Linux commands""" p = Popen(cmd, shell=True, stdout=PIPE) output = p.communicate()[0] return output def ckyorn( prompt, help="" ): """Used for Y/N prompt""" a= "" ok= False while not ok: a=raw_input( prompt + " [y,n,?]: " ) if a.upper() in [ 'Y', 'N', 'YES', 'NO' ]: ok= True return a.upper()[0] def delete_old_data(): """ Used to delete old data in input file. Will check for data older than 14 days and ask if you would like everything older than 7 days to be deleted. This should not being asked more than once a week""" now = datetime.datetime.now() #get the first line of the data file, which will be the oldest entry getfirstLine = run_cmd("head -1 temperature_logging | awk '{print $2}'") #convert string to time. firstLineTime = datetime.datetime.strptime(getfirstLine, '%m-%d-%Y-%H:%M:%S ')
{ "domain": "codereview.stackexchange", "id": 2918, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, beginner, matplotlib, raspberry-pi", "url": null }
qiskit, programming Title: Using qiskit on mutiple cores I would like to be able to set the number of cores the AerSimulator should be running. For now I've tried backend = AerSimulator() backend.set_options(max_parallel_threads=params['ncores']) where params['ncores'] is an int with the number of cores the simulator should run on. I would expect that changing it from 1 to 4 the run time would change, but this is not the case. Can anyone point to what I'm doing wrong? Although max_parallel_threadssets the maximum number of CPU cores used by OpenMP for parallelization during execution of an experiment, there are other factors that affect the amount of parallelization that will actually occur. Most notably, your circuit must have at least 14 qubits. You can control this value using statevector_parallel_threshold AerSimulator's option. The following example demonstrates how to take advantage of having multiple cores. Let's create 200 circuits: from qiskit.circuit.random import random_circuit num_circuits = 200 num_qubits = 20 depth = 30 circuits = [] for n in range(num_circuits): circuits.append(random_circuit(num_qubits, depth, max_operands = 2, measure = True)) Then we transpile them: from qiskit import transpile from qiskit_aer import AerSimulator backend = AerSimulator(method = 'statevector') tr_circuits = transpile(circuits, backend = backend) Now, we configure the backend for parallelization and run the circuits: backend.set_options( max_parallel_threads = 0, max_parallel_experiments = 0, max_parallel_shots = 1, statevector_parallel_threshold = 16 ) result = backend.run(tr_circuits).result() counts = result.get_counts() Note that:
{ "domain": "quantumcomputing.stackexchange", "id": 4273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "qiskit, programming", "url": null }
data-structures, loops, java Title: What does this condition in the for loop mean? I found a solution of exercise C-8.28 from Data Structures and Algorithms in Java (6th Edition), but I'm having trouble understanding how the for loop condition works here. for(Position<E> c : T.children(p)) I'm having trouble understanding what the condition in the for loop means. From what I've learned so far the for loop is formatted with 3 conditions so I'm not familiar with it and I'm trying to understand the concept behind this solution. I looked it up online, but I haven't been able to find another instance of this, though I did find something about the format for(type variable : collection) in a greek Data Structures book by Panagiotis D. Mpozanis. Yet, I don't understand it. Could you help me a bit with this? This is called a For-each loop. in your example: for(Position<E> c : T.children(p)) the c is a variable of type Position<E> and it takes it's value in each iterate of the for from a list or an array or whatever container of type Position<E>, meaning the T.children(p) must be a container of type Position<E>. For a more simple example in order to understand the mechanism of the For-each loop here is an example: Consider a class named Person and an App class where App creates instances of Person and prints it using the For-each loop: Person: package org.example; public class Person { private String firstName; private String lastName; private String gender; private byte age; public Person(String firstName, String lastName, String gender, byte age) { this.firstName = firstName; this.lastName = lastName; this.gender = gender; this.age = age; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getGender() { return gender; } public byte getAge() { return age; } } App: package org.example; import java.util.ArrayList; import java.util.List; public class App { static void generate(List<Person> personList) {
{ "domain": "cs.stackexchange", "id": 20045, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-structures, loops, java", "url": null }
8 Mechanodroid's solution is great. Here's a slightly different way to look at it. Suppose $\lambda$ is an eigenvalue of $A+B$ with corresponding unit-length eigenvector $v$. Then, $$|\lambda| = \|\lambda v\| = \|(A+B)v\| = \|Av+Bv\| \le \|Av\|+\|Bv\| = \|v\|+\|v\| = 2\|v\| = 2,$$ where we have used the fact that $\|Av\| = \|v\|$ and $\|Bv\| = \|v\|$ since $A,... 7 Since$a^2+b^2+c^2+d^2 = 3$defines a compact set in$\mathbb{R}^4$,$f(a,b,c,d)=abcd+3-a-b-c-d$will have a global minimum and maximum over that set, that will occur (can be easily justified) in critical points of the Lagrangian $$L(a,b,c,d,\lambda) = abcd+3-a-b-c-d -\lambda(a^2+b^2+c^2+d^2-3)$$ So, just compute the critical points, compute the value of$... 6
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9796676442828174, "lm_q1q2_score": 0.8054720929217161, "lm_q2_score": 0.822189134878876, "openwebmath_perplexity": 1707.0191662740683, "openwebmath_score": 0.9997441172599792, "tags": null, "url": "https://math.stackexchange.com/tags/inequality/hot" }
ros, navigation, simulation, kuka, youbot Title: KUKA Youbot navigation simulation Hello, I want to apply navigation with a Youbot in simulation. I used the simulator provided by ROS and I launch it with the following command: roslaunch youbot_gazebo_robot youbot.launch But when I try to move the robot after doing the following indications to bring up the navigation stack: http://wiki.ros.org/youbot_navigation , the robot doesn't move. I have some errors with the hokuyo_node. I found that the youbot_oodl package provided here: https://github.com/youbot/youbot-ros-pkg/tree/master/youbot_drivers/youbot_oodl is not functional (the OODL include files are missing). If someone can help me, I will be grateful, lfr Originally posted by lfr on ROS Answers with karma: 201 on 2016-05-18 Post score: 0 A collaborator and I had gotten that working a few months ago, but not using the official youbot_navigation that you mentioned. Instead, take a look at this: https://github.com/pschillinger/youbot_integration it might help (You can safely ignore the "behavior" stuff; it's specific to our project.) Originally posted by spmaniato with karma: 1788 on 2016-05-19 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 24680, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, simulation, kuka, youbot", "url": null }
4. Blur the sparse array. The raw sparse array isn't pretty, and blurring will reveal make it obvious which points are bright, and which are dim. Using the built-in GaussianFilter is the quickest way, but it's not the best-looking. My preferred way is to FFT-convolve with a Lorentz-like distribution $\left(\frac{\gamma^2}{\gamma^2+x^2+y^2}\right)^\alpha$, where $\alpha$ determines the tail heaviness; $\alpha=1.15$ works pretty good. 5. Colorize the resulting array $M$ and render it using Image. One easy way is to feed Image the tensor-product $M\otimes\mathbf{c}$ where $\mathbf{c}$ is some 3-element RGB vector. In Mathematica 10, TensorProduct preserves PackedArrays, whereas in older versions it doesn't, so beware of RAM consumption if you're using an older version and want large images. Incidentally, that link has some examples of algebraic number plots. Here's an example you can get from the above: IIRC the green points are $N=3$ (cubics), and the yellow ones are $N=2$ (quadratics). Similar with just quartics (I added additional red lighting for points near the origin): And a large image of monic cubics where the linear coefficient is restricted to be an 8th root of unity: https://www.flickr.com/photos/104348204@N05/11637086656/sizes/o/ ## Example Code Here's some code to do the above: The "Root Generator" generates roots, converts them into a sparse array, and exports it to a file (steps 1-3). The "Root Visualizer" imports the files, and renders them (steps 4-5). It's got decent comments/instructions inside, but you may need to tweak the parameters to get what you want.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9615338079816758, "lm_q1q2_score": 0.8053999090877555, "lm_q2_score": 0.8376199592797929, "openwebmath_perplexity": 1361.0269691269978, "openwebmath_score": 0.3480210602283478, "tags": null, "url": "https://mathematica.stackexchange.com/questions/115758/visualisation-of-the-field-of-algebraic-numbers-in-the-complex-plane?noredirect=1" }
quantum-state Title: How many real-valued coefficients does it take to specify an $n$-qubit state? Let a quantum register of size $n$ be in the following state, expressed in the computational basis for $n$-qubit states: $$\left| \psi \right> = \sum_{i=0}^{2^n-1} \alpha_i \left| i \right>, \forall i \in \{0, 1, ..., 2^n-1\}, \alpha_i \in \mathbb{C}$$ Additionally, the normalization condition states that: $$\sum_{i=0}^{2^n-1}|\alpha_i|^2 = 1$$ How many real-valued coefficients would it take to express these $2^n$ complex-valued coefficients (the probability amplitudes of the register's quantum state)? The naïve answer would be two real coefficients per complex coefficient, one for the real part and one for the imaginary part, or one for the modulus and one for the phase, so in total $2^{n+1}$. The correct answer, it seems, is however $2(2^n-1)$, as stated in the lecture notes I am following, on slide 5. Obviously, the normalization condition can be used to reduce the required number of real coefficients, but I can only see it reducing the required number by $1$ (express a modulus using all of the other modulus values) instead of $2$. I just can't find an explanation to the correct answer. You can also rephase. So that gets rid of 1 more real dimension. That is quotient by $\psi ~ e^{i \theta} \psi$. Caution: unlike normalization where you are taking a subset, instead you are identifying many points into one. Edit: Let $| \psi \rangle = \sum_{i=0}^{2^{n}-1} \alpha_i | i \rangle$
{ "domain": "quantumcomputing.stackexchange", "id": 1230, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-state", "url": null }
java, performance, algorithm, array Title: Algorithm to find pair with max sum from two arrays Algorithm to find pair with max sum from two arrays A[0 ... n] and B[0 ... n] A[i] + B[j] = max (A[i] + B[j], with i < j) i,j < 99999; n < 99999 My best result is this: int[] testArrayA = { 7, 1, 4, 5, 1}; int[] testArrayB = { 3, 2, 1, 5, 3}; String res = ""; int maxSum = 0; for (int i = 0; i < testArrayA.length; i++) { int i1 = testArrayA[i]; for (int j = i; j < testArrayB.length; j++) { int j1 = testArrayB[j]; if((j1 + i1) > maxSum) { maxSum = j1 + i1; res = i + " " + j; } } } System.out.println(res); Expected answer "0 3" Current complexity \$O(n^2)\$ I think it must be much lower. Can we do it better? We can solve this in \$O(n)\$ time. The best possible sum for a particular index, \$i\$, is \$S[i] = A[i] + \max(B[i+1:])\$ (using the Python notion of slice). We can update both incrementally by counting from the back, so we have to keep track of two things: \$\max(S[i:])\$ and \$\max(B[i+1:])\$. So for the test arrays: int[] testArrayA = { 7, 1, 4, 5, 1}; int[] testArrayB = { 3, 2, 1, 5, 3}; ↑ starting i
{ "domain": "codereview.stackexchange", "id": 17245, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance, algorithm, array", "url": null }
fft, frequency-spectrum, frequency If your sampling frequency $f_s = 1000$ Hz, and you are taking an $N=1024$ (same-sized) FFT, then your frequency resolution is $\frac{1000}{1024}$, which is equal to 0.9766 Hz/bin. If your $N_{zp} = 1024$ (FFT length after zero-padding), then your frequency granularity is 0.9766 Hz/bin.
{ "domain": "dsp.stackexchange", "id": 1103, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fft, frequency-spectrum, frequency", "url": null }
vision, human-eye, transplantation Title: Retina Transplant Difficulties Why is retina transplant not as easy as the normal eye donation and transplant (I think the latter involves the cornea ) ? This says that a new method has come up but why isnt the process similar and simple as the normal transplant ? What are the difficulties in retina transplant ? This is a diagram of a cross-section of the cornea: It is an amazing but relatively simple structure, the shape of which is responsible for about 60% of our focusing power, and the clarity of which allows light to enter. It is avascular (no blood vessels), and the non-mylenated nerve endings are very tiny and present in the epithelium. Transplanting this relatively simple tissue is easy (well, not do-it-at-home easy, but easy.) The only problem with cutting all those nerve endings is that the new cornea will feel nothing if there's dust in the eye, etc. This is a problem, but nothing compared to blindness. This is a diagram of a cross section of the retina: As you can see, it is not nearly as simple as the cornea. The nerves (to the left: yellow, light blue, medium blue and darker blue), which collect information from the rods and cones (pink and purple) are very numerous, and absolutely vital to the ability of the brain to interpreting information from these photoreceptors. Therefore, a cut piece of retina immediately loses the ability to send any information to the brain. To transplant it into an eye with a damaged retina would do nothing to improve vision. Also, it is not easy surgery. It's very difficult. What has been called "retinal transplants" in the recent past have been tiny pieces of embryonic retina, about... 4 millimetre square of retinal tissue, complete with retinal progenitor cells and the retinal pigment epithelium that nourishes them. The tissues were placed in the sub-retinal space beneath the fovea, the area of the retina responsible for sharp central vision.
{ "domain": "biology.stackexchange", "id": 3562, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "vision, human-eye, transplantation", "url": null }
# Cartesian Equation for the perpendicular bisector of a line Find the Cartesian equation for the perpendicular bisector of the line joining A(2,3) and B(0,6) How do I do this? Thank you! - HINT $\;$ The equation is $\rm\;\: 2\ (A-B)\cdot (x,y) \;=\; |A|-|B|\;\;\;$ where $\rm\;\;\; |(a,b)| \ =\ a^2 + b^2$ which, if worked out, yields $\rm\;\: (-4,6)\cdot (x,y) \;=\; \;36 \;- 13\;\;\:$ for $\rm\; A = (0,6),\;\; B = (2,3)$ which, after simplifying, yields the equation $\rm\; 6y =\; 4x+23$ - I'm confused where the 36 and 13 came from, could you help with this please? – Charlotte Sep 18 '10 at 17:12 Thank you so much! :) – Charlotte Sep 18 '10 at 17:27 @Charlotte: those two quantities are the squares of the distances of $A$ and $B$ from the origin. – J. M. Sep 19 '10 at 4:19 Hints: 1. Get the slope and the midpoint of the segment joining your two given points. 2. Recall the relationship of the slopes of two perpendicular lines 3. Use the point-slope form of the equation of a line. -
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9688561658682131, "lm_q1q2_score": 0.8031224694281497, "lm_q2_score": 0.8289388019824946, "openwebmath_perplexity": 137.23535538100487, "openwebmath_score": 0.8501502871513367, "tags": null, "url": "http://math.stackexchange.com/questions/4914/cartesian-equation-for-the-perpendicular-bisector-of-a-line" }
ds.algorithms, approximation-algorithms, set-cover, permutations Title: Set Cover for Permutation Matrices Given a set S of nxn permutation matrices (which is only a small fraction of the n! possible permutation matrices), how can we find minimal-size subsets T of S such that adding the matrices of T has at least 1 in every position? I am interested in this problem where S is a small subgroup of S_n. I am wondering whether it is possible to find (and implement!) approximation algorithms that are much quicker than the greedy algorithms (run many times until it got 'lucky', which is a very slow procedure but nonetheless it has given some near optimal bounds in small cases), or whether inapproximability guarantees that I cannot. A few easy facts about this problem: A length n cyclic group of permutation matrices solves this problem, of course optimally. (At least n matrices are needed because each permutation matrix has n ones and there are n^2 ones needed.) The sets S of which I am interested do not have a n-cyclic group in them. This problem is a very special case of set cover. Indeed, if we let X be the set (1,2, ... n)*(1,2,... n), with n^2 elements, then each permutation matrix corresponds to a size n subset, and I'm looking for the smallest subcollection of these subsets that cover X. Set cover itself is not a good way to look at this problem, because approximation of the general set cover problem. The only reason why this problem is not much too slow using the greedy approach is because symmetry in the permutation group helps eliminate a lot of redundancy. In particular, if S is a subgroup, and T is a small subset which is a minimal covering set, then the sets sT (multiply T by any element of the group s) are still in S and still are a covering set (of course of the same size, so still minimal.) In case you were wondering, the successful case has n~30 and |S|~1000, with lucky greedy results having |T| ~37. Cases with n~50 have some very poor bounds taking a very long time to get.
{ "domain": "cstheory.stackexchange", "id": 371, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ds.algorithms, approximation-algorithms, set-cover, permutations", "url": null }
ros, serial, usb, ubuntu Title: USB Sensors mess with each other, ROS Ubuntu Mate Hi, Im working with an autonomous sailboat with a raspberry pi 3 that uses these sensors: Gill Ultrasonic Windsensor MTi-G xsesnsor (gyro and gps data) Im having an issue related to the c++ program that connects my software to the wind sensor. The problem is that the wind sensor will connect to usb1 staticly (using serial) in which it will be pure luck that this is the correct usb as it is dynamically assigned when inserted. The xsensor on the other hand will find itself with the driver I got from ROS git rep. Problem occurs when the wind sensor driver will try to use the same USBx as the xsens driver, resulting in the xsens crashing. Is there a way to physically assign say, USB0 to always be the bottom right usb on the raspberry pi? and if so how? I've tried to google this alot without any good results. I'm using Ubuntu mate for ROS by the way. Originally posted by andreasvo on ROS Answers with karma: 7 on 2017-06-15 Post score: 0 Not really a ROS problem, but I would suggest you look into udev and setting up some rules for your USB devices so that they are always assigned a unique symlink. That way you could set things up so your wind sensor gets a device file such as: /dev/sensors/wind_sensor, and your X-sens: /dev/sensors/xsens (these are obviously examples, you can do whatever you want). Originally posted by gvdhoorn with karma: 86574 on 2017-06-15 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by andreasvo on 2017-06-15: Thank you gvdhoorn! udev is just what I was looking for. Yes, not a ROS problem at all. Just wanted to hear here first incase ROS had any features for this that I didn't know about.
{ "domain": "robotics.stackexchange", "id": 28119, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, serial, usb, ubuntu", "url": null }
newtonian-mechanics, work Title: Derivative of a vector with constant magnitude I was reading the definition of work done in terms of a kinetic energy. It read that when a force is applied to a particle moving with constant velocity v, its kinetic energy changes as follows:- $$\frac{dK}{dt} = \frac{1}{2}\frac{d(m\vec v.\vec v)}{dt} = \frac{1}{2}\frac{d(mv^2)}{dt} = m\vec v\frac{d\vec v}{dt}$$ The speed of a particle does not change when the force applied on it is perpendicular to the velocity and as a result, the kinetic energy of the particle also doesn't change. Hence the force acting on the particle must have a tangential component. Therefore:- $$\frac{dK}{dt} = \vec F.\vec v$$ My query: I know that the symbol $\vec v$ represents velocity(which is a vector) and $v^2$ or $\vec v.\vec v$ is a scalar. But then why is $\frac{d\vec v}{dt}$ equal to zero when the force applied on a particle is perpendicular since the velocity clearly is changing,at least its direction is. The last expression should be a dot product: $$\frac{dK}{dt} = m\vec v \cdot \frac{d\vec v}{dt}$$ So when a force is applied perpendicularly to the direction of motion, $\frac{d\vec v}{dt}$ is a vector that is perpendicular to $\vec v$, so their dot product is zero, giving you zero change in the kinetic energy as expected.
{ "domain": "physics.stackexchange", "id": 39221, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, work", "url": null }
classical-mechanics, fluid-dynamics, waves, oscillators Title: Does fluid motion follow some periodic function? I have heard of oscillations (i.e. simple harmonic motions) where a particle repeats its motion after a period of time, due to the restoring force acting opposite to the displacement and proportional to it. Does the same apply for a liquid (especially during streamline flow)? Can we represent it as $$y= A \sin (k x - \omega t)$$ Deterministic motion falls in to two categories: periodic motion and chaotic motion; I'll try to provide a brief overview. In physics, we usually discuss the evolution of dynamical systems in terms of differential equations. Consider a simple pendulum of length $l$. For small oscillations, the angle of the pendulum obeys the equation $$ \ddot{\theta} + {g\over l}\theta=0. $$ The solution to this is a simple sine wave (i.e., $\theta(t) = \theta_0 \cos(\sqrt{g/l} t)$}. Now, lets add a damping term $\beta \dot{\theta}$, and a driving force $\gamma \cos(\omega t)$, the differential equation to solve is now: $$ \ddot{\theta} + \beta \dot{\theta}+ {g\over l}\theta=\gamma \cos(\omega t). $$ Even when we complicate things to this point, the motion of the pendulum is still periodic. To stray from the realms of periodic behavior, we need to introduce a non-linearity. Let us assume the pendulum has a stiffness to it that obeys a cubic version of Hooke's law. We then have the following equation $$ \ddot{\theta} + \beta \dot{\theta}+ {g\over l}\theta + \alpha \theta^3=\gamma \cos(\omega t). $$ This equation goes by the name of the Duffing Equation and it is one of the simplest differential equations that exhibits chaotic behaviour. For certain parameters in the Duffing equation, the motion is very aperiodic. Although the motion is deterministic, the behavior can appear random.
{ "domain": "physics.stackexchange", "id": 38450, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, fluid-dynamics, waves, oscillators", "url": null }
electrostatics, charge, conductors Title: Conducting sphere with a cavity I have a conducting sphere which has a cavity in it. The cavity is not at the center of the sphere. If a charge $+q$ is placed inside the cavity (with the sphere remaining neutral as a whole), what would be the electric field at a point outside the sphere? Would the answer change if the charge is moved to a different location within the cavity? Would the answer depend on the location of the cavity? The field would, strangely enough, be equal to that of a uniformly charged sphere of charge $q$. The placement and shape of the cavity doesn't change the field outside the sphere. By using Gauss's law, we see that $$\oint \mathbf E \cdot d \mathbf a = \frac{Q_{enc}}{\epsilon _0}$$ Where $Q_{enc} = q -q +q = q$ The point charge in the cavity will induce an equal and opposite charge on the cavity wall, canceling out the contribution of the point charge outside the sphere, while the sphere must now take on a uniformly distributed charge of $q$, since the sphere is to remain neutral. $\mathbf E$ inside the cavity depends on the geometry and position of the charge.
{ "domain": "physics.stackexchange", "id": 100060, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electrostatics, charge, conductors", "url": null }
battery, quadcopter, power The graph also shows that one ounce of flight weight would need one watt of power, and the two are linearly correlated. Assuming the craft is 60 ounces, 60 watts of power is needed. This quote is a bit misleading though. The original author is missing the words "per motor" in their conclusion. 230W/4 motors = 57.5 Watts. That's where they got the "60 ounces needs 60 Watts (per motor)" conclusion. However the general method of plotting performance is beneficial to answering the question. If you increase the maximum thrust-to-weight ratio, you can keep your throttle lower, use less power, and stay in the air longer. So you can either increase thrust or decrease weight to achieve longer flight times. To more concisely answer your question, the point of diminishing returns comes when the additional weight added by the battery brings your thrust-to-weight ratio below 1.5:1 on the low end. Something else to consider is the energy density of your battery technology. How much power per unit weight the battery is capable of. You're probably using Lithium-ion batteries which are probably the best available from a price to performance perspective. But if you're really trying to get longer flight times without increasing weight, you can consider some of the more esoteric (and much more expensive) technologies out there. And it's probably worth mentioning that even within the Lithium-ion category, not all batteries are created equal.
{ "domain": "robotics.stackexchange", "id": 757, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "battery, quadcopter, power", "url": null }
c++, arduino Title: Gyrometer/accelerometer sensor fusion with sigmoid transfer function I noticed, that accelerometer and gyrometer sensor data tend to have problems. The gyrometer is not very precise and the accelerometer is getting problems with vibrations. I built a quadrocopter (to be honest more then one). My first one had a poor frame and the motors (very big ones) were vibrating a lot, because the fix-plates were flexible. So I was thinking about a software solution to compensate all the built-problems. I used an approach similiar to neural networks in which (sigmoid or other) transfer functions are used to anneal to a solution. For quadcopters it is easy. The position to hold is normally always the straight/horizontal (equilibrium) one (if no rc input interfering). In this position the accelerometer shouldn't ideally appear much acceleration and give out values close to pitch=0 and roll=0. So I decided that my gyrometer stats, should anneal the faster to the accelerometer values, the closer it is to equilibrium position. In other scenarios I rely more to the gyrometer values (strong vibration or strong g-forces), which means the annealing rate goes down massivly. I tested this approach and I think it is working for me. The attitude is stored in a Vector3f and contains the fused values of the gyrometer and the accelerometer. The raw sensor readings can be filtered previously of course before they get fused like here (high/low path for gyro/accelerometer). I built a very poor model which is vibrating like hell at some degree of throttle, but it is stabilizing itself without flipping or crashs. Just the motors are sometimes upregulated, which results in increasing the height. At the moment I built already better models, but I still think about how to make it better. I mean there are a lot of filter-implementations out there, but I think that e.g. the Kalman filter wouldn't be able to compensate for problems like very strong vibrations and the complementary filter would be a total desaster. Maybe this is even helpful for someone.
{ "domain": "codereview.stackexchange", "id": 6403, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, arduino", "url": null }
### What is the volume of the rectangular prism with the base area of 42 m2 and a height of 8 cm? The volume of a rectangular prism is the length on the side times the width times the height. 42m2 is given as the width times the height, the area of the base. 8cm = .08m .08m * 42m2 = 3.36m3 ### How do you find the length of a rectangular prism? You can compute this only if you know the volume and height, or volume and cross-sectional area. The volume of a rectangular prism is Length X Width X Height. The volume is therefore Length X Area (cross-section). L = V/A L = V/(WH) ### How do you find the volume of a rectangular prism if you have the area? All you need is the area of the base and then multiply that by the height and you have the volume of any 3-D shape. ### How do you find the base area of a rectangular prism? If you know the Volume and the Height of the prism, then you can divide the volume by the height to get the base area. B=V/H If you know the side lengths of the base then you could simply multiply them together to get the base area. ### What is the formula for determining volume? Volume of a right prism: Area of Base times Height. Volume of a cube: Vertex cubed. Volume of a rectangular prism: Length times Width times Depth. ### Formula for area of a rectangular prism? The formula for the area of a rectangular prism is A= 2(wL+hL+hw). A refers to area, w is the width of the prism, h refers to height, and L is the length of the prism. ### Volume of a rectangular prism area of a trapezoid area of a rectangle? Volume of a rectangular prism= LengthXWidthXHeight Area of a Rectangle= LengthXWidth Area of a Trapezoid= (Bottom+Top)/2)XHeight ### What is the base area of a rectangular prism with the height of 10 m and the volume of 320 m3?
{ "domain": "answers.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9805806523850543, "lm_q1q2_score": 0.8084514051742423, "lm_q2_score": 0.8244619177503205, "openwebmath_perplexity": 525.4620918263333, "openwebmath_score": 0.8032235503196716, "tags": null, "url": "https://www.answers.com/Q/How_do_you_find_base_area_of_rectangular_prism_if_you_know_volume_and_height" }
python, python-3.x Title: Python 3 IRCbot (library) Just want you guys to review my python 3 IRC bot code, it is actually a fork of https://github.com/Orderchaos/LinuxAcademy-IRC-Bot You can see the source code at github I also have questions: I really can't find out how to change the ident for the bot, can I change the ident? Can I change the ident by modifying the user authentication code? In addition to answering my question, you can submit a pr at GitHub if you want yourself to be in the contributions list. The ircbot.py file is as below: """ Copyright (c) 2016 Linux Academy Copyright (c) 2021 BK IRCbot team and contributors Licensed under GNU Lesser General Public License v2.1 See the LICENSE file distributed with the source code OR Visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html This project is a fork of https://github.com/Orderchaos/LinuxAcademy-IRC-Bot NOTE This program is distributed in the hope that it will be useful - WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. """ # socket for irc socket import socket # os for file handling, currently not required # import os # conf from conf import server, port, channel, botnick, adminnick, password, exitcode, filename # Create a socket ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) if adminnick == "" or botnick == "": print("Notice: BK_IRCbot: adminnick or botnick is empty!")
{ "domain": "codereview.stackexchange", "id": 41249, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x", "url": null }
Posted in logic, proof | | 7 Comments One-sided inverses, surjections, and injections Several commenters correctly answered the question from my previous post: if we have a function $f : A \to B$ and $g : B \to A$ such that $g(f(a)) = a$ for every $a \in A$, then $f$ is not necessarily invertible. Here are a few counterexamples: • Commenter Buddha Buck came up with probably the simplest counterexample: let $A$ be a set with a single element, and $B$ a set with two elements. It does not even matter what the elements are! There’s only one possible function $g : B \to A$, which sends both elements of $B$ to the single element of $A$. No matter what $f$ does on that single element $a \in A$ (there are two choices, of course), $g(f(a)) = a$. But clearly $f$ is not a bijection. • Another counterexample is from commenter designerspaces: let $f : \mathbb{N} \to \mathbb{Z}$ be the function that includes the natural numbers in the integers—that is, it acts as the identity on all the natural numbers (i.e. nonnegative integers) and is undefined on negative integers. $g : \mathbb{Z} \to \mathbb{N}$ can be the absolute value function. Then $g(f(n)) = |n| = n$ whenever $n$ is a natural number, but $f$ is not a bijection, since it doesn’t match up the negative integers with anything. Unlike the previous example, in this case it is actually possible to make a bijection between $\mathbb{N}$ and $\mathbb{Z}$, for example, the function that sends even $n$ to $n/2$ and odd $n$ to $-(n+1)/2$.
{ "domain": "mathlesstraveled.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9910145725743421, "lm_q1q2_score": 0.8537969150909941, "lm_q2_score": 0.8615382040983515, "openwebmath_perplexity": 219.63282870187984, "openwebmath_score": 0.8304086923599243, "tags": null, "url": "https://mathlesstraveled.com/?cpage=1" }
# Compute Nash Equilibrium in median voter game Consider a spatial model in which two candidates A and B compete for office. The policy space ranges from -1 to 1 and each candidate can take one of three positions, -1, 0, and 1 (so that they have only three pure strategies). Voters vote for the candidate closer to their ideal points, but the location of the median voter is not known to the candidates: the median voter is located at either -1 or 1 with probability s < 1/2 and is located at 0 with probability 1 - 2s. Assume that candidate A is slightly more advantaged than B: A prevails if A and B are equidistant from the median voter but B wins if he is closer to the median voter. Winning yields a payoff of 1 and losing 0. The candidates simultaneously choose a position. Answer the following questions. 1. Draw a 3-by-3 payoff matrix and show if there are any pure-strategy Nash equilibria. My attempt: $\begin{array}{r|ccc} A\backslash B & -1 & 0 & 1\\ \hline -1 & 1, 0 & s, 1-2s+s & 1-2s+s, s\\ 0 & 1-2s+s, s & 1, 0 & 1-2s+s, s\\ 1 & 1-2s+s, s & s, 1-2s+s & 1, 0 \end{array}$ This simplifies to $\begin{array}{r|ccc} A\backslash B & -1 & 0 & 1\\ \hline -1 & 1, 0 & s, 1-s & 1-s, s\\ 0 & 1-s, s & 1, 0 & 1-s, s\\ 1 & 1-s, s & s, 1-s & 1, 0 \end{array}$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9724147209709196, "lm_q1q2_score": 0.8082157410708763, "lm_q2_score": 0.831143054132195, "openwebmath_perplexity": 1013.165166807739, "openwebmath_score": 0.9171469807624817, "tags": null, "url": "https://economics.stackexchange.com/questions/18867/compute-nash-equilibrium-in-median-voter-game" }
climate-change, geothermal-heat, crust, thermodynamics, fossil-fuel Title: Do fossil fuels insulate the crust from the Earth's interior? I was doing a project for my English class, and I came upon the article Energy conservation in the earth's crust and climate change. I can't view the full text of the article, but the abstract piqued my interest: Do long hydrocarbons in the earth actually have a significant effect in insulating the surface? Also, has the lack of these hydrocarbons resulted in any significant warming of the Earth thus far? Quoting from John Russell's response to this article, "This is arrant nonsense!" Russell concludes with How did this paper get through the peer-review and editorial review processes? What technical standards were applied to determine the apparent merit of its contents so as to justify its inclusion in a reputable journal? Just because something is published in a scientific journal does not mean it is fact. Publication is where science starts rather than ends. Sometimes, pure garbage manages to slip through peer review and get published, even in reputable journals. This is one of those times. Moreover, the publisher of the underlying journal, Taylor & Francis, has had issues with shoddy peer review. The Earth's energy imbalance is 0.6±0.17 W/m2. The Earth's internal energy budget, the amount of energy that escapes from the interior of the Earth, is 0.087 W/m2, about half the uncertainty in the Earth's energy imbalance. (That largish uncertainty is because the imbalance is a difficult quantity to measure.) Even if all of that 0.087 W/m2 is due to humans removing the Earth's insulating layer of hydrocarbons (it isn't), it does not come close to accounting for the 0.6±0.17 W/m2 imbalance. The numbers don't add up. Or as John Russell put it in his response to the referenced article, "This is arrant nonsense!"
{ "domain": "earthscience.stackexchange", "id": 2328, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "climate-change, geothermal-heat, crust, thermodynamics, fossil-fuel", "url": null }
# Math Help - Prove using induction on n that 3 divides (4^n)+5 1. ## [Solved] Prove using induction on n that 3 divides (4^n)+5 Hi everyone, First time poster. This is probably an embarrassingly easy problem. I'm a non-maths student working through an intro to proof book in my spare time and there are problem sets with no solutions. I've got stuck on a couple of problems. This is one of them. Question: Prove by induction on $n$ that, for all positive integers $n$, $3$ divides $4^n +5$. I know where I need to go with this, I think, I'm just stuck on the inductive step: Proof: We use induction on n. If $3$ divides $4^n +5$, then $4^n +5=3q$ for some integer $q$. Base case: If $n=1$, then $4^n +5=9=3q$, where $q=3$, proving the base case. Inductive step: Suppose as inductive hypothesis that $4^k +5=3q$ for some integer $k$. Then $4^{k+1} +5=3q$ (by inductive hypothesis). That's as far as I get. Obviously, $4^{k+1} +5=4*4^k +5$ by definition, but I get stuck there. EDIT: not sure how to add the solved prefix, hope this is an okay ad hoc measure. 2. ## Re: Prove using induction on n that 3 divides (4^n)+5 Originally Posted by TimM Hi everyone,
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9830850897067342, "lm_q1q2_score": 0.8394688953372507, "lm_q2_score": 0.8539127529517043, "openwebmath_perplexity": 468.44300335495893, "openwebmath_score": 0.9634061455726624, "tags": null, "url": "http://mathhelpforum.com/number-theory/183906-prove-using-induction-n-3-divides-4-n-5-a.html" }
python, scikit-learn, logistic-regression, class-imbalance Changing the metric you are evaluating on doesn't change the actual training of the model, so I am guessing that your custom implementation of logistic regression should not function significantly differently to the sklearn version in terms of performance (if it does their may be other issues), it seems you are just using a different metric. There are also a number of other metrics besides accuracy that you can use in sklearn (https://scikit-learn.org/stable/modules/model_evaluation.html#model-evaluation) perhaps consider balanced-accuracy to begin with. It is also not to hard to apply your own custom metric to the results from the sklearn logistic regression model. Tools such as the classification_report (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html) and/or confusion matrix (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html) can also be enlightening when dealing with imbalanced data.
{ "domain": "datascience.stackexchange", "id": 9411, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, scikit-learn, logistic-regression, class-imbalance", "url": null }
audio, algorithms, real-time For testing I am using it on a few wave files @ 44.1kHz with an appropriately longer reverb buffer. So, the results we're ... mixed. I've added some logic to create random values for the feedback coefficients (-1.0 to 1.0), the "dryMix" and "wetMix" variables (0.0 to 1.0). Depending on how lucky I either got terrible metallic oscillation or reasonably good results (still nothing I'd call perfect). Is there any method of finding good coefficients for my feedback taps? Apart from bad sound I also had problems with instability and self oscillation. I don't have any professional DSP knowledge but I'd guess that the sum of the absolute values of all my coefficients should not exceed 1.0 (however this didn't seem to be always true for negative coefficients). Also, if there is no way to calculate these coefficients with a lot of sense, is there at least a way of randomly generating these in a way they don't cause self oscillation? PS: I've googled quite a bit about reverb and various things but I didn't find an algorithm which perfectly suits my case. Usually they are too basic (single tap feedback line) or they aren't fast enough (because I need something VERY FAST with low memory footprint). I don't know how to easily calculate stability criteria for your reverb topology, but it is easy to check if a set of delays and weights will give a stable filter (unless it is marginally stable or marginally unstable) by just calculating the impulse response and seeing if it blows up. The easiest way to tune the reverb would be to use global optimization like differential evolution, where you actually try different delays and weights and optimize them against some cost function. The cost function could be such that it calculates the impulse response of the reverb and penalizes for instability, calculates the discrete Fourier transform (DFT) of the impulse response to get the frequency response, using fast Fourier transform (FFT), and rewards for something like spectral flatness. It's a moderate amount of work if you are not familiar with those methods.
{ "domain": "dsp.stackexchange", "id": 5627, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "audio, algorithms, real-time", "url": null }
image-processing, fft, dft Making a broad assumption that at least one of those darker pixel is a null would imply that the computed min is close to 0. With this assumption we can proceed to find max as follows: $$ \begin{align} 32 &= \left\lfloor \ln(3.858) \frac{253}{\ln(r_\max)} + 1.5 \right\rfloor \\ 31 &\approx \frac{253 \ln(3.858)}{\ln(r_\max)} \\ \ln(r_\max) &\approx \frac{253\ln(3.858)}{31} \\ \ln(r_\max) &\approx 11.02 \\ r_\max &\approx 61020 \end{align} $$ Since most of the image is white, I would expect a large spike at the 0 frequency point with an amplitude near $NM = 256^2 = 65536$ (where $N$ and $M$ are the width and height of the image). So $r_\max \approx 61020$ is quite plausible. So for this image (and this image only, since different images would have a different dynamic range), the approximate scaling would be: $$ \begin{align} \mbox{value} &\approx \left\lfloor 22.96 \ln(\sqrt{X_\text{Re}^2 + X_\text{Im}^2}) + 1.5 \right\rfloor \\ &\approx \left\lfloor 11.48 \ln(X_\text{Re}^2 + X_\text{Im}^2) + 1.5 \right\rfloor \end{align} $$
{ "domain": "dsp.stackexchange", "id": 5006, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "image-processing, fft, dft", "url": null }
python, parsing What's good about it? The use of typed functions will help us be sure the code is doing what we intend it to do. I could actually have taken this further by moving more stuff out into individual functions. The use of list comprehensions and other "functional programming" styles means that we're never mutating the state of a variable. This also helps us be sure everything is working as intended. The use of pure functions also helps us be sure everything is working as intended. Basically every "line" can be read as "build a value", and the nature of those values is clearly (?) indicated by the names of the variables we assigning to or the functions we're returning from.
{ "domain": "codereview.stackexchange", "id": 36156, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, parsing", "url": null }
pr2 Title: How to send raw velocity commands to joints of pr2 I want to send raw velocity commands to joints of pr2 instead of high level joint action commands. I want to apply a reinforcement learning to pr2 arm manipulation. So I need to send raw velocities to pr2 gazebo simulator. I googled and found that I can use robot_mechanism_controllers/JointVelocityController But I don't know how to use it to send a velocity command to /r_shoulder_pan_joint. Could anyone provide me with a simple command line example to publish a such command? I am testing this on pr2_gazebo for now. I hope a solution would work on gazebo, too. And are there better ways to send raw velocities rather than robot_mechanism_controllers/JointVelocityController? Originally posted by JollyGood on ROS Answers with karma: 58 on 2017-04-20 Post score: 0 I could finally publish raw joint velocity command to a joint. Here are what I did: create a parameter yaml file as follows; e.g. l_shoulder_pan_velocity_controller.yaml l_shoulder_pan_velocity_controller: type: robot_mechanism_controllers/JointVelocityController joint: l_shoulder_pan_joint pid: p: 5.0 i: 20.0 i_clamp: 100.0 Then load the file on the parameter server $ rosparam load l_shoulder_pan_velocity_controller.yaml Load the joint velocity controller rosrun pr2_controller_manager pr2_controller_manger load l_shoulder_pan_velocity_controller Stop the l_arm_controller which is running rosrun pr2_controller_manager pr2_controller_manager stop l_arm_controller Start the joint velocity controller for l_shoulder_pan_joint rosrun pr2_controller_manager pr2_controller_manager start l_shoulder_pan_velocity_controller Publish joint velocity command topic rostopic pub -1 l_shoulder_pan_velocity_controller/commad std_msgs/Float64 1.0 Originally posted by JollyGood with karma: 58 on 2017-05-02 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 27667, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pr2", "url": null }
structural-engineering, structural-analysis, applied-mechanics, statics, strength for this task? How to add the stresses when they are all of different nature? Thank you. If you have multiple load cases of the same structure with the same supports, you can calculate elastic stress components for each load case separately and then simply add the resulting stresses to get stress for all the loads acting together. Adding the stresses is straight forward, you just have to be careful about coordinates or directions. Stress at a point is tensor with respect to specific orientation, so if you need to add 2 stress tensors (by components), they both need to be in the same coordinates. In your case, principal Lamé stresses will be in cylindrical coordinates (axial, radial, circumferential) and the principal stress from bending moments would be only in axial direction (if the moments are torque, you get shear circumferential/axial shear stresses), so you would be adding only axial stress components. When in doubt, just write down the whole stress tensors from both loads in the same coordinates and add their corresponding components.
{ "domain": "engineering.stackexchange", "id": 5188, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "structural-engineering, structural-analysis, applied-mechanics, statics, strength", "url": null }
monte-carlo-tree-search, alphago-zero Title: How does Alpha Go Zero MCTS work in parallel? I am trying to better understand the article "Mastering the Game of Go without Human Knowledge" (link) and I'm confused about the parallel implementation of Monte-Carlo-Tree-Search. On page 25 under "Search Algorithm", the authors say (emphasis mine) AlphaGo Zero uses a much simpler variant of the asynchronous policy and value MCTS algorithm (APV-MCTS) Multiple simulations are executed in parallel on separate search threads. On page 26 under "Select", an action is selected according to the statistics in the search tree There are some math details on how an action is selected based on (among other things) the mean action value (Q). I find this confusing because the choice of action at each simulation depends on the statistics of the previous simulations (the value of Q). How can simulations be run in parallel given that the choice of action in each simulation depends on the value obtained by the end of the last simulation? To understand how AlphaGo Zero performs parallel simulations think of each simulation as a separate agent that interacts with the search tree. Each agent starts from the root node and selects an action according to the statistics in the tree, such as: (1) mean action value (Q), (2) visit count (N), and; (3) prior probability (P). The agent then follows the action to the next node and repeats the process until it reaches a leaf node. At the leaf node, the agent evaluates the state using the neural network and propagates the value back to the root node, updating the statistics along the way. However, since there are multiple agents running in parallel, they may not have access to the most updated statistics in the tree. For example, one agent may select an action that another agent has already explored and updated its value. To avoid this problem, AlphaGo Zero uses a virtual loss mechanism that temporarily reduces the Q value of a node when an agent visits it. This discourages other agents from selecting the same node until the first agent finishes its evaluation and restores the Q value. This way, each agent can explore different parts of the tree without waiting for each other. Pseudo code of the parallel search engine
{ "domain": "ai.stackexchange", "id": 3970, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "monte-carlo-tree-search, alphago-zero", "url": null }
datetime, batch 9) Your code to convert the hour into zero padded 24 hour format is flawed. It gives a value of 12 for 12 AM when it should be 00. It is also needlessly wordy. Here is one concise way to do it: if %H_NUM% equ 12 set "H_NUM=00" if %AM_PM% equ PM set /a H_NUM=1%H_NUM%+12-100 if %H_NUM% lss 10 set "H_NUM=0%H_NUM%" And here is an even more concise way: set /a "AM=0, PM=12, H_NUM=(1%H_NUM%-100)%%12+%AM_PM%" if %H_NUM% lss 10 set "H_NUM=0%H_NUM%" Here is how I would write the code: @echo off setlocal set "file=my.xml" set "execTime=15" :: get full path to file for %%F in ("%file%") do set "file=%%~fF" :: escape the backslashes set "file=%file:\=\\%" :: get the last modified timestamp for the file set "fileTime=" for /f "skip=1" %%A in ( 'wmic datafile where "name='%file%'" get lastModified' ) do if not defined fileTime set "fileTime=%%A" :: convert file timestamp to unix time format call :UnixTime fileTime %fileTime% :: get current timestamp in unix time format call :Unixtime currentTime :: compute interval in seconds, and convert execTime into seconds set /a "diff=currentTime-fileTime, execSec=execTime*60" :: what should we do? if %diff% gtr %execSec% ( echo greater than %execTime% min: let's delete ) else ( echo less than or equal to %execTime% min: just leave alone ) :: Must exit so we don't fall into the function below exit /b
{ "domain": "codereview.stackexchange", "id": 10346, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "datetime, batch", "url": null }
I got my SS number when I was 14 and got a part-time job delivering newspapers. Now, however, newborn babies get their number at birth. Some employers used to use an employees SS number as their personnel number, but I think that pretty much stopped when the bad guys got active. When I worked for a grocery store back in the 1960's they used my SS number as my employee number, and it always had the number 5 added to the end, and I wondered about that until years later I realized it was the checkdigit! I once programmed a dedicated data entry system (Entrex), and its programming language had built-in routines for checkdigit verification. Now, the challenge: try to derive my 9-digit SS number from the fact that its checkdigit is 5. If you could do that, the bad boys will pay you millions I'm sure. Here is a link to a site with some interesting trivia information about the first SS card, back in 1936. Don 07-27-2015, 01:03 AM Post: #12 Bill (Smithville NJ) Senior Member Posts: 437 Joined: Dec 2013 RE: checkdigit calculation for HP-17b (07-26-2015 11:42 PM)Don Shepherd Wrote:  Now, the challenge: try to derive my 9-digit SS number from the fact that its checkdigit is 5. If you could do that, the bad boys will pay you millions I'm sure. Hi Don, Researchers have long figured out how to "guess" your SS number by using public data. SS numbers are not really random - or at least parts of it aren't. Do a search for plenty of articles on predicting SS numbers. There's been plenty of news stories about this. When I lived in Indiana, they used to use your SS number for the drivers license number. To get around the law that says you can't use SS numbers for other purposes, they just appended the Letter 'S' to it - that would magically make it NOT a SS number. I don't think they do that anymore.
{ "domain": "hpmuseum.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9802808733328717, "lm_q1q2_score": 0.8370743373913717, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 1543.6137833049002, "openwebmath_score": 0.38739073276519775, "tags": null, "url": "https://www.hpmuseum.org/forum/thread-4432.html" }
gazebo-plugin, drcsim Title: IMU sensor plugin in drcsim hi all, where does the .cpp code exist for this imu plugin. This is from drcsim / ros / atlas_description / urdf / atlas.gazebo 1 1000.0 gaussian 0.0 2e-4 0.0000075 0.0000008 0.0 1.7e-2 0.1 0.001 Thanks Originally posted by peshala on Gazebo Answers with karma: 197 on 2013-06-04 Post score: 0 In Gazebo's gazebo/sensors/ImuSensor.cc Originally posted by ThomasK with karma: 508 on 2013-06-04 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by peshala on 2013-06-05: @ThomasK Thanks. In my standalone installation (1.7.1) I could find ImuSensor.hh at /usr/include/gazebo-1.7/gazebo/sensors/ImuSensor.hh but ImuSensor.cc or a .so file is nowhere to be found. I am wondering why? Comment by Jose Luis Rivero on 2013-06-05: Lack of .cc file is expected, debian packages are not including source files. Headers files are needed for developing against gazebo and binary code for Imu Sensor is part libgazebo_sensors.so. (try to run nm -D libgazebo_sensors.so | grep Imu). I would recommended download source code from bitbucket if you plan on looking at code. Comment by peshala on 2013-06-05: @Jose Luis Rivero Thanks!
{ "domain": "robotics.stackexchange", "id": 3329, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo-plugin, drcsim", "url": null }
java Title: Reordering an array: Even elements descending, odd elements ascending I am trying to work out a solution. I have to order the elements in the array a, such that a[0] is greater than a[1], a[1] is less than a[2], a[2] is greater than a[3], and so on... Basically my method checks if the index is odd or even , and simultaneously makes a decision to swap elements to suit the criteria of the question. I am getting the following output: 7, 1, 6, 2, 5, 3, 4 public class ArrayRearrange { public static void main(String[] args) { // TODO Auto-generated method stub int[] a = { 2, 1, 4, 6, 5, 3, 7 }; for (int i = 0; i < a.length; i++) { for (int j = i + 1; j < a.length; j++) { if (i % 2 == 0 && a[i] < a[j]) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } if (i % 2 != 0 && a[i] > a[j]) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } } } for(int i=0;i<a.length;i++) System.out.print(a[i]+" "); } } Let me know if there's a better way to do it. Putting everything in the main method is bad practice, and is hard to maintain. Separate it into methods. This also removes duplicate code, such as when you swap values. // TODO Auto-generated method stub is generated in eclipse, and is only there to remind you to finish the method. It is not really to stay. Don't use one-letter variable names, except for counters. a should be array. Don't be lazy when you print something out. Still follow conventions. The two if statements are doing identical things. Combine them with an OR. Final code: public class ArrayRearrange {
{ "domain": "codereview.stackexchange", "id": 17151, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
tools Title: What's this tool? This isn't mine, but I own one of these and I have no idea what it is. With the spike attached it looks like a marking gauge of some sort. It appears to be a base holding a scribe. Normally they are used to hold indicators (which are like touch sensors that measure how far the arm is deflected from their neutral position). You mount whatever you want on the post. This particular style is apparently called a "surface gauge". I know them as universal bases, indicator bases, holders, etc. but those are apparently a different style. I've never seen one actually used with a scribe; Always an indicator. Basically a base with an adjustable vertical post that you mount measuring devices to. The base is ground flat and you place it on a surface plate or machine table. You slide it around. For example, you can check to see if two things are the same height by sliding an indicator between the two pieces and seeing of the dial reads the same, or if a horizontal beam/rod or surface is flat and parallel by sliding an indicator along the piece, or if something is round and by finding the high spot, zeroing the dial, then spinning it in the lathe or rotary table or indexing head and seeing if it the dial moves. I am not sure what you are supposed to do with the scribe though. Seems super imprecise, has no give to climb onto higher surfaces...it just crashes and leaves marks, and no way to tell if you are touching a surface you have slid over or if it is imperceptibly lower. Way more useful with an indicator...and surface plate or machine table. The base currently looks detached from the post and is just laid down and resting on top.
{ "domain": "engineering.stackexchange", "id": 4197, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tools", "url": null }
c#, performance, algorithm, chess private static void Dvijenie(int red, int kolona) { var comparer = new ListComparer<int>(); var tempHodove = new List<Tuple<bool, int[]>>(); int novMinatRed = red; int novaMinataKolona = kolona; for (int i = 0; i < numberOfVariations; i++) { var minatRed = new List<int>(); var minataKolona = new List<int>(); minatRed.Add(nachalenRed); minataKolona.Add(nachalnaKolona); tempHodove.Clear(); var hodove = UpdateList(novMinatRed, novaMinataKolona,minatRed,minataKolona); int x = i; for (int j = 0; j < size; j++) { result[j] = tempArr[x % size]; x /= size; } for (int k = result.Length - 1; k >= 0; k--) { tempHodove.Add(hodove[result[k]]); } bool trueValue = tempHodove.Any(c => c.Item1); while (trueValue) { foreach (var hod in tempHodove.Where(hod => hod.Item1)) { novMinatRed += hod.Item2[0]; novaMinataKolona += hod.Item2[1]; minatRed.Add(novMinatRed); minataKolona.Add(novaMinataKolona); count++; break; } if (novMinatRed == kraenRed && novaMinataKolona == krainaKolona) { if (minCount > count) { minCount = count; }
{ "domain": "codereview.stackexchange", "id": 19141, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, performance, algorithm, chess", "url": null }
Homework Help: Calculating functions for wave problems 1. Jan 12, 2012 into space 1. The problem statement, all variables and given/known data A wave travels along a string in the positive x-direction at 30 m/s. The frequency of the wave is 50 Hz. At x = 0 and t = 0, the wave velocity is 2.5 m/s and the vertical displacement is y = 4 mm. Write the function y(x,t) for the wave. 2. Relevant equations velocity = (wavelength)(frequency) = (angular velocity)/(wave number) angular velocity = 2*pi*frequency What the function should look like: y(x,t) = Asin(kx - wt + θ) A = amplitude k = wave number w = angular velocity t = time (s) θ = initial phase shift 3. The attempt at a solution Figuring out the wave number (k) as well as the wavelength and angular velocity was the easy part: w = 2*pi*(50 Hz) = 100*pi wavelength = velocity/frequency = (30 m/s)/(50 Hz) = .6 m wave number (k) = w/v = (100*pi)/(30 m/s) = 10.47 m^-1 So far the function looks like: y(x,t) = Asin(10.47(x) - 314.16(t) + θ) The only variables left to find are the amplitude (A) and initial phase shift (θ). I tried plugging in the initial conditions the problem gave me, but I end up with: y(x,t) = Asin(θ) = .004 differentiating the function y(x,t) = Asin(10.47(x) - 314.16(t) + θ) with respect to time gives the velocity equation, which is: v(x,t) = -A(314.16)cos(10.47(x) - 314.16(t) + θ) and plugging in the initial conditions for velocity gives: -A(314.16)cos(θ) = 2.5
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104962847373, "lm_q1q2_score": 0.8214210693677025, "lm_q2_score": 0.8499711794579723, "openwebmath_perplexity": 699.8096756578516, "openwebmath_score": 0.8192601203918457, "tags": null, "url": "https://www.physicsforums.com/threads/calculating-functions-for-wave-problems.567046/" }
python, c++, programming-challenge #endif //LEETCODE_LONGEST_COMMON_PREFIX_H longest_common_prefix.cpp #include <iostream> #include <string_view> #include <vector> std::string_view get_common_prefix(const std::vector<std::string_view> &words) { if (words.empty()) return ""; std::string_view common = words[0]; for (auto word: words) { while (word.find(common, 0) != 0) { common = common.substr(0, common.size() - 1); } } return common; } int main() { std::vector<std::string_view> xxx{"flow", "flower", "fly"}; std::cout << "Longest prefix:\n" << get_common_prefix(xxx); } Leetcode stats: Runtime: 0 ms, faster than 100.00% of C++ online submissions for Longest Common Prefix. Memory Usage: 9.9 MB, less than 7.29% of C++ online submissions for Longest Common Prefix. I'm only going to review the C++ code here, as all I could suggest for the Python code also applies to the C++, so is included in this review. Firstly, the interface is quite limiting - the inputs need to be converted to vector of string-view objects, which is inconvenient if I have a linked-list of strings, or an input stream yielding QStrings. I recommend changing to accept a pair of iterators, or in sufficiently modern C++, a std::ranges::range object. This test is inefficient: word.find(common, 0) != 0
{ "domain": "codereview.stackexchange", "id": 39804, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, c++, programming-challenge", "url": null }
c, array sampleString = createArray(v_varray, 2); /* * Each varray can contain one string. Initialize each element * with the createArray command. */ printf("The size of sampleString is: %d\n", sampleString[0].size); /* * As noted above, the size is stored in a varray at position 0 * in the container */ sampleString[1] = varrayPush("This is a sample string"); sampleString[2] = varrayPush("This is also a sample string!"); /* * To store a string within a varray, the function varrayPush is used * with the desired string as the argument. The function initializes * another varray object within the container. */ printf("The string at position 1 is: %s\n", sampleString[1].str); printf("The size of the string stored at position 1 is: %d\n", sampleString[1].size); printf("The char at position 5 in sampleString[1] is: %c\n", sampleString[1].str[5]);
{ "domain": "codereview.stackexchange", "id": 45043, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, array", "url": null }
physical-chemistry, acid-base Then $$\ce{[H+]} = \sqrt{K_\mathrm{a1}K_\mathrm{a2}}\tag{EQ1-3}$$ DERIVATION OF EQUATION 2 $\ce{[H^+]} = \sqrt{\dfrac{K_\mathrm{a1}K_\mathrm{w}}{\ce{[C_T]}}}$ Sodium is a spectator ion. Thus it is be possible to model the system as a monoprotic Brønsted–Lowry acid which has $\ce{H^+}$ as the acid and $\ce{HCO3^-}$ as the conjugate base. This derivation has two problems. First it ignores the autoionization of water. Second the equation models the system as a monoprotic base, but the carbonate system has three species - carbonic acid, bicarbonate, and carbonate, and all three are likely to be present in significant quantities in alkaline solutions. Start with the reaction of the conjugate base $$\ce{HCO3^- + H2O <=> H2CO3 + OH^-}\tag{EQ2-1}$$ and the equilibrium expression $$\ce{K_\mathrm{b1}} = \dfrac{\ce{[H2CO3][OH^-]}}{\ce{[HCO3^-]}}\tag{EQ2-2}$$ Assume that little of $\ce{HCO3^-}$ accepts a proton, thus $\ce{[HCO3^-] = [C_T]}$ and $\ce{[H2CO3] = [OH^-]}$. Now substituting: $$\ce{K_\mathrm{b1}} = \dfrac{\ce{[OH^-]^2}}{\ce{[C_T]}}\tag{EQ2-3}$$
{ "domain": "chemistry.stackexchange", "id": 10472, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, acid-base", "url": null }
solar-system, planetary-systems Title: Is the argument of perihelion random? I am currently designing star and planet systems in the RPG framework GURPS. This game system has a very elaborate set of rules to set up a star system, complete with planets and the like. However, one (for me at least) critical issue is not addressed in the book: The argument of perihelion. Now, since I am writing a program to generate these systems for me, I would like to know what steps I can take to make a planet system as realistic as possible. Looking at data from our own planet system, the argument of perihelion looks to be pretty evenly distributed over all angles $[0, 2\pi)$. Is there scientific evidence that this is actually the case, or are there any good suggestions on how I could proceed with my program? (The related question on RPG.SE can be found here.) Argument of perihelion or most planets/bodies changes very slowly over time due to higher order perturbations from other planets' motions (mostly Jupiter and Saturn for the solar system). General relativistic effects also cause the perihelion to advance over time, though this effect is smaller than the others for most purposes. So given enough time, the arguments of the planets' perihelia would likely end up being fairly randomly distributed at any given time. Also, the planets' orbits are often dynamic on such timescales due to the effects of higher order perturbations showing up, which can cause eccentricity changes, which also affect the positions of perihelia. So, my guess would be that it is okay to have the arguments of perihelia randomly distributed, since it is inconceivable (at least for me) that any sort of resonances would be visible at this level in order for the distributions to be non-random.
{ "domain": "astronomy.stackexchange", "id": 469, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "solar-system, planetary-systems", "url": null }
+0 # Suppose $f(x)$ is a rational function such that $3 f \left( \frac{1}{x} \right) + \frac{2f(x)}{x} = x^2$ for all $x \neq 0$. Find $f(-2)$. 0 258 3 Suppose f(x) is a rational function such that $$3 f \left( \frac{1}{x} \right) + \frac{2f(x)}{x} = x^2$$ for all x =\=0. Find f(-2). Guest May 22, 2018 #1 +93629 +1 Suppose f(x) is a rational function such that $$3 f \left( \frac{1}{x} \right) + \frac{2f(x)}{x} = x^2$$ for all $$x\ne0$$. Find f(-2). We have
{ "domain": "0calc.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105321470076, "lm_q1q2_score": 0.8583202376025865, "lm_q2_score": 0.8791467564270271, "openwebmath_perplexity": 3997.661171407632, "openwebmath_score": 0.5469297766685486, "tags": null, "url": "https://web2.0calc.com/questions/suppose-f-x-is-a-rational-function-such-that-3-f" }
neuroscience, brain, neurophysiology, development, synapses Title: How do neurons find each other? Neurons form complicated networks in brains, but their connections can't be random (at least not entirely). Brains function similarly among all members of individual species, and that functionality is largely dependent on neuron organization. Furthermore, various brain regions have predictable functions, and there are even parts of the brain where specific cells carry out specialized functions (place cells are an interesting example). Great! We know neurons can organize into very complex networks, but how? They need to find each other, somehow. The best I can guess is that either: Neurons find other target neurons with specific chemical signals. Neurons don't "find" each other, exactly, but grow in predetermined shapes from from set locations. In this case, the connections would simply be due to neurons bumping into each other as they grow in their predetermined paths. Or both. In the first case, there would be a mechanism for searching each other out. In the second, there would be a mechanism for staying in one spot (and growing from there). What are the names of said mechanisms? How do I find out more about them? Q: We know neurons can organize into very complex networks, but how? The answer is your first guess: Neurons find other target neurons with specific chemical signals. Q: What are the names of said mechanisms? This process is called axon guidance, by which the growth cones of developing axons are directed to reach their targets. This process depends upon a slew of cellular and molecular cues. The first axons to grow in any particular brain region are called pioneer axons and are the most dependent upon these cues. Later axons are able to follow (and diverge from) previous axons by the interaction of cell adhesion molecules on their surfaces. Dendritic development is also important for your question, but dendrites tend not to travel as far. Here are some of the molecules that we know to participate in axon guidance: Cell adhesion molecules and substrate adhesion molecules, including IgSF CAMs and cadherins Some chemokines, e.g. CXCL12 Netrins, ephrins, and semaphorins Slits, via the Slit-Robo cell signaling pathway Developmental morphogens, e.g. Wnts and Hedgehog
{ "domain": "biology.stackexchange", "id": 5831, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "neuroscience, brain, neurophysiology, development, synapses", "url": null }
Now consider the general case. Because \begin{gather*} \left(\frac{a}{(a,c)},\frac{c}{(a,c)}\right)=1,\qquad \left(\frac{b}{(b,d)},\frac{d}{(b,d)}\right)=1, \end{gather*} we have \begin{align*} (ab,cd)&=\left((a,c)(b,d)\frac{a}{(a,c)}\frac{b}{(b,d)}, (a,c)(b,d)\frac{c}{(a,c)}\frac{d}{(b,d)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)}\frac{b}{(b,d)},\frac{c}{(a,c)}\frac{d}{(b,d)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{b}{(b,d)},\frac{c}{(a,c)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{c}{(a,c)},\frac{b}{(b,d)}\right). \end{align*}
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9871787876194204, "lm_q1q2_score": 0.8310324198820089, "lm_q2_score": 0.8418256452674008, "openwebmath_perplexity": 193.48269262494674, "openwebmath_score": 0.9265310764312744, "tags": null, "url": "https://math.stackexchange.com/questions/1394801/prove-that-ab-cd-a-cb-d-left-fracaa-c-fracdb-d-right-left" }
np-hardness, packing Title: Hardness of an extended maximum set packing problem (Edited) The maximum set packing problem when the sets are all of equal size, say $k$, is known to be NP-hard for $k \ge 3$. The requirement in this problem is that the sets in the solution will be pair-wise disjoint. In other words, one have to find as many as possible sets taken from the sets in the problem (each containing $k$ elements) such that no two sets share one element or more. Let us now consider a modified version of the $k$-set packing, which we will call Problem A. Instead of finding the maximum number of pair-wise disjoint sets, we have to find the maximum number of subsets of the original sets, such that each subset contains at least $l$ elements not shared by any other subset. For $l=k$, we get the maximum $k$-set packing. Is Problem A NP-hard for $l<k$? Formally: Input: A collection $A_1,A_2,...,A_n$ of sets of size $k$ each and an integer $l$, $1 \le l \le k$. Output: The maximum number of subsets $A'_i \subseteq A_i$ such that $\left| {A{'_i}} \right| \ge l$ and $\left| {A{'_i} \cap A{'_j}} \right| = \emptyset$. Note that for $l=1$ (for any $k$ such that $l \le k$), we can transform our problem to the maximum bipartite matching problem, so in this case Problem A is solvable in polynomial time. Thus, I ask about the NP-hardness of Problem A in the case $1 < l < k$. Examples:
{ "domain": "cstheory.stackexchange", "id": 2767, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "np-hardness, packing", "url": null }
electricity, electric-circuits, electric-current, electrical-resistance, voltage Title: How does the current remain the same in a circuit? I understand when we say current, we mean charge (protons/electrons) passing past a point per second. And the charges have energy due to the e.m.f. of the power supply. Now tell me, if a lamp has resistance and you hook it in the circuit, how will the current stay the same? The charges obviously lose energy in the lamp and so become SLOWER, which should mean current decreases, right? [Edit] All answers explained a bit of everything, so it was hard to choose one. If YOU are looking for an answer, please check the others too, in case the accepted one doesn't answer your question. The question The charges obviously lose energy in the lamp and so become SLOWER, which should mean current decreases, right? shows that you have a misconception about the motion of the conduction electrons. If you were correct then to maintain the same current around a circuit by a miracle more conduction electrons would need to contribute to the conduction process as you went around the circuit. If this did not happen then the conduction electrons would move slower and slower and . . . . . eventually stop? In fact what happens is that the electrons gain kinetic energy (and lose electric potential energy) between collision with the lattice (bound) ions from the electric field in the wire and then lose that extra kinetic energy to the lattice ions upon collision with them. The net effect is that the temperature of the material increases as the internal kinetic energy of the material has increased (the lattice ions vibrate more) and the conduction electrons move along the conductor with a constant average speed.
{ "domain": "physics.stackexchange", "id": 64535, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, electric-circuits, electric-current, electrical-resistance, voltage", "url": null }
ros, ros-control, ros-kinetic, ros-canopen, controller-manager Comment by Mathias Lüdtke on 2018-06-22: if you prefix it with gdb, some errors might not occur :-/ Can you upload a candump (candump -l can0) e.g. to gist? Start it after init and stop after the position controller spawn attempt. This might help to identify the "unknown throw location". Comment by akosodry on 2018-06-22: Dear Mathias! Thank you for the help! Here is the log file. Comment by akosodry on 2018-06-23: Hello Mathias. I just want to inform you, that i did tried to run the package on a new computer, with a fresh installed ubuntu 16.04, with a fresh installed ros-kinetic, and i get the same error messages. So im totally clueless what to try what to change. Comment by akosodry on 2018-06-23: Maybe i forgot to mention you what is my setup: Microchip CAN BUS Analyzer (driver: mcba_usb), ASD-A2-0721-M driver, ECMA-C10807RS servo motor. Comment by akosodry on 2018-06-23: The motor driver was set up to CANopen mode (0x0C), + Node id to 1, + Baudrate to 500 kBps + Sync (page 7) Comment by jayess on 2018-06-29: @akosodry can you put your solution in an answer instead of your question? Then you can accept it as the correct answer. This will make it easier for others to find the solution should they have the same problem. Comment by akosodry on 2018-06-30: @jayess yes, i updated everything. Solution: *(History:)*Originally I was unable to spawn the controllers after initializing the canopen driver. A lot was discussed here and i was really struggling with my setup, but here are the solutions that made it work finally: First problem was identified by @Mathias Lüdtke. Namely, the original EDS file had a wrong object description, the right one is DataType=0x0007.
{ "domain": "robotics.stackexchange", "id": 31060, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-control, ros-kinetic, ros-canopen, controller-manager", "url": null }
objective-c }); } - (void)saveAchievements:(NSMutableArray *)achievements andThenCheck:(BOOL)check { AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; NSManagedObjectContext *context = delegate.managedObjectContext; NSMutableArray *achievementsToCheck = [NSMutableArray new]; for (PFObject *object in achievements) { Achievement *achievement = [Achievement achievementWithObject:object inManagedContext:context]; if ([achievement.earned isEqualToNumber:[NSNumber numberWithBool:NO]]) { //only add achievements that the user has not earned yet! [achievementsToCheck addObject:achievement]; } } if (check) [self checkAchievements:achievementsToCheck withManagedContext:context]; } - (void)checkAchievements:(NSArray *)achievements withManagedContext:(NSManagedObjectContext *)context { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *achievementItems = [defaults objectForKey:@"achievementItems"]; achievementsToUpdate = [NSMutableArray new]; NSDate *today = [NSDate date]; int userSteps = [[achievementItems objectForKey:@"steps"] intValue]; int userDistance = [[achievementItems objectForKey:@"distance"] intValue]; int userFlights = [[achievementItems objectForKey:@"altitude"] intValue]; NSLog(@"%@------", achievementItems); if (achievements == nil) {
{ "domain": "codereview.stackexchange", "id": 13678, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "objective-c", "url": null }
c#, .net, iterator, rubberduck, com Title: A generic IEnumerator to enumerate COM collections As I wrapped the VBIDE API, I encountered a number of "collection types" (Windows, CodePanes, VBComponents, VBProjects, References, etc.) - these types implement the non-generic IEnumerable interface, so if I wanted to be able to iterate my wrappers like this for example: using (var projects = _vbe.VBProjects) { foreach (var project in projects.Where(p => p.Protection == ProjectProtection.Unprotected)) { yield return project.Name; } } ...then I was going to be needing some custom IEnumerator implementation, because even if I could explicitly .Cast<Rubberduck.VBEditor.DisposableWrappers.Project>() every time, at runtime the cast would fail because the enumerator yields a COM object, not a wrapper type. So I made a generic ComWrapperEnumerator<TComCollection, TWrapperItem>, where TComCollection is the collection type (must implement IEnumerable) and TWrapperItem is the type of the SafeComWrapper<T> to be created and returned - am I doing this right? I don't like the way I'm assuming the constructor only has a single T parameter (where T is the COM type being wrapped by TWrapperItem), is there a better way? using System; using System.Collections; using System.Collections.Generic; namespace Rubberduck.VBEditor.DisposableWrappers { public class ComWrapperEnumerator<TComCollection, TWrapperItem> : IEnumerator<TWrapperItem> where TComCollection : IEnumerable { private readonly IEnumerator _internal; public ComWrapperEnumerator(TComCollection items) { _internal = items.GetEnumerator(); } public void Dispose() { var disposable = _internal as IDisposable; if (disposable == null) { return; } disposable.Dispose(); }
{ "domain": "codereview.stackexchange", "id": 22257, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, iterator, rubberduck, com", "url": null }
fluid-dynamics, rotational-dynamics For brevity I have excluded a discussion of the derivation of $\phi$, which I have obtained by following two published results. If it would be useful I can include a derivation and the references. The direct answer to you question is: No, you may not in general identify $\phi=-\pi/2$ with $\phi=\pi/2$. The points to not correspond to the same physical conditions. The exception is if you are in fact treating a two-dimensional particle (an ellipse) in a two-dimensional world. But as the question stands that does not seem to be the case.
{ "domain": "physics.stackexchange", "id": 13638, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, rotational-dynamics", "url": null }
How many possible ways are there to seat down 20 men and 20 women on a bench of length 40, such that no two women are adjacent? [duplicate] How many possible ways are there to seat down 20 men and 20 women on a bench of length 40, such that no two women are adjacent? At first I was sure the answer was 20!*20!. Because we seat down the women first with spacing between them, and choose their placement. Then we seat down the men and choose their position. Turns out the answer is : 21*20!*20! I dont understand why ? marked as duplicate by Sharkos, RGS, Rohan, N. F. Taussig combinatorics StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 25 '18 at 21:39 Pick one single man (in $20$ ways). Arrange the women in $20!$ ways and then the men in $19!$, putting them in between the women. Now this man can be sitting to the right of any of the $20$ women, or he can be at the rightmost corner of the bench, hence he has $21$ positions to go, making $$21\times 20! \times 19! \times 20 = 21\times20!\times20!$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9814534376578002, "lm_q1q2_score": 0.8091709918602575, "lm_q2_score": 0.8244619263765707, "openwebmath_perplexity": 1022.9125069516009, "openwebmath_score": 0.5002310872077942, "tags": null, "url": "https://math.stackexchange.com/questions/2620450/how-many-possible-ways-are-there-to-seat-down-20-men-and-20-women-on-a-bench-of" }
python, clustering Title: Clustering Data to learned cluster I am new to data science, I have clustered some data using Scipy agglomerative clustering. how can I fit new data into the learned clusters? dm = pdist ( dataset ,lambda u,v: mlpy.dtw_std ( pd.Series(u).dropna().values.tolist(),pd.Series(v).dropna().values.tolist(),dist_only=True )) z = hac.linkage(dm, method='average') cluster = hac.fcluster(z, t=100, criterion='distance') leader = scipy.cluster.hierarchy.fcluster(z, t=100, criterion='distance')
{ "domain": "datascience.stackexchange", "id": 2409, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, clustering", "url": null }
algorithm-analysis, runtime-analysis # Insert tmp in the right place value_of(current) <- tmp end if advance first end while This algorithm takes two sorted ranges [first, middle) and [middle, last) and reorders them to produce a sorted range [first, last). The function compare is used to compare the elements. The algorithm more or less works like this: whenever an element in the left range is greater than the first element of the right range, we replace the first element of the right range in the left range, then we move every element to the left until we find the place where to insert the element that was originally in the left range (I know, plain-text descriptions sound a bit cryptic). What is the complexity of this algorithm, considering that the complexity is determined by the number of comparisons performed between value with <? Your algorithm is very similar to insertion sort or selection sort. Here is some pseudocode which hopefully captures your algorithm: inplace_merge(A[1,...,n], B[1,...,m]) C[1,...,n] = A[1,...,n] C[n+1,...n+m] = B[1,...,m] for i from 1 to n: if C[i] > C[n+1]: find position j in {1,...,m} such that C[n+j] < C[i] <= C[n+j+1] (where C[n+m+1]=∞) C[i], C[n+1,...,n+j-1], C[n+j] = C[n+1], C[n+2,...,n+j], C[i] return C
{ "domain": "cs.stackexchange", "id": 5257, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm-analysis, runtime-analysis", "url": null }
c#, generics, hash-map, enum, extension-methods Title: Distinguish between different types of log items in a dictionary by their key My logging adapter is using a dictionary for storing data that is passed from middleware to middleware. It is a one-liner: public class Log : Dictionary<SoftString, object> {} Since it's using SoftString (like string but case-insensitive and trimmed) for the key and there are also two different types of data there, I was using a workaround by adding weird suffixes to the actual names to be able to tell them apart. This system is very shaky so I'd like to have something stronger and easier to use. I thought I'll replace strings as tokens with some other type. This is how ItemKey<T> was born. API ItemKey<T> still uses a name but it now allows me to use T as a tag that I constrained to be an Enum. Both properties are used for the equality check. public readonly struct ItemKey<T> : IEquatable<ItemKey<T>> where T : Enum { public ItemKey(SoftString name, T tag) { Name = name; Tag = tag; } [AutoEqualityProperty] public SoftString Name { get; } [AutoEqualityProperty] public T Tag { get; } public override int GetHashCode() => AutoEquality<ItemKey<T>>.Comparer.GetHashCode(this); public override bool Equals(object obj) => obj is ItemKey<T> && Equals(obj); public bool Equals(ItemKey<T> other) => AutoEquality<ItemKey<T>>.Comparer.Equals(this, other); public static implicit operator ItemKey<T>((string name, T tag) key) => new ItemKey<T>(key.name, key.tag); } public enum LogItemTag { Property, // These items are ready to be logged Metadata, // These items need to be processed before they can be a 'Property' }
{ "domain": "codereview.stackexchange", "id": 35489, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, generics, hash-map, enum, extension-methods", "url": null }
ros, ros-kinetic from /opt/ros/kinetic/include/velodyne_pointcloud/rawdata.h:33, from /home/joshua/autoware.ai/src/autoware/core_perception/lidar_localizer/nodes/ndt_matching/ndt_matching.cpp:41: /usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h:405:6: note: ‘template<class MatrixType, class RealScalar, class Index> void Eigen::internal::real_2x2_jacobi_svd(const MatrixType&, Index, Index, Eigen::JacobiRotation<RealScalar>*, Eigen::JacobiRotation<RealScalar>*)’ previously declared here
{ "domain": "robotics.stackexchange", "id": 33494, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic", "url": null }
assembly Lastly, set new SS:SP: 589 89DC mov sp, bx 58B 06 push es 58C 17 pop ss 58D FB sti Notice that some procedures are page aligned. This is not done for any sort of optimization, but I can make small changes in a routine with affecting the one below and as I don't use symbols in BOCH's even addresses are just a little easier to remember. At this point, anything the BIOS has passed on the stack is gone, including the return address into it. I've never come across anything indicating this to be of any relevance but would need to be taken into account if so. Anyone interested in experimenting with this can PM me and I'll zip up a tarball with the complete project. 7C09 B8 5000 mov ax, 0x50 I find it confusing to see how the byte dump is presented. I imagine that you separated the numbers yourself to make the immediate operands stand out, but looking at 5000 more resembles 5000h than the actual 0050h that it needs to represent. 7C1A F4 hlt 7C1B EBFE jmp $ If you are going to use hlt then why not jump back to it in case execution gets resumed? 7C1A F4 hlt 7C1B EBFE jmp $-1 You load your boot program at linear address 00500h. That's fine but stay aware that BIOS has its PrintScreenStatus flag here. That's why so many Operating Systems start at linear address 00600h. 7C10 B9 0100 mov cx, 1 ; Re-read sector 0 7C13 B8 0402 mov ax, 0x204 ; 7C16 CD13 int DISKIO I would like to point out 2 things here: You know that sector numbering is 1-based (hence mov cx, 1), then perhaps the comment here should not be talking about "sector 0". You don't setup the drive number in DL and indeed you don't need to since BIOS handed you this value from the start, but can you be sure about the head number in DH ?
{ "domain": "codereview.stackexchange", "id": 26295, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "assembly", "url": null }
can be rewritten as 0 1 . show that any repeating decimal is a rational number. Is 0.444 irrational or rational? n. A number capable of being expressed as an integer or a quotient of integers, excluding zero as a denominator. when we know that 0 can be written as 0/1 with denominator 1, we see that both 0 and 1 are integers, where 1 is not equal to 0. so we conclude that 0 is a rational mumber an not irrational. q can be positive or negative integers. The Rational Zero Theorem helps us to narrow down the number of possible rational zeros using the ratio of the factors of the constant term and factors of the leading coefficient of the polynomial. ! The number ½ is a rational number because it is read as integer 1 divided by the integer 2. There is a difference between rational and Irrational Numbers. Define rational number. Since 0.2=2/10=1/5 is of this form, it isa rational number. Thus, to understand what a nonzero rational number is, we must... See full answer below. the numbers which can be written as p/q where p and q, both are integers and p is not equal to 0 are called rational numbers. Every non-zero real number can be written as the product of two normal numbers. What is a Rational Number? This is the Archimedean property, that is verified for rational numbers and real numbers. A rational number is any number that can be written in the form a/b, where a and b are integers and b ≠ 0. Pi can be written as 22/27 but 22/7 will not give the exact value of pi. It asserts that, for a non-zero rational number < b;a >, a multiplicative inverse exists and equals < a;b >. According to the rational zero theorem, any rational zero must have a factor of 3 in the numerator and a factor of 2 in the denominator. This equation shows that all integers, finite decimals, and repeating decimals are rational numbers. Similarly, 4/8 can be stated as a fraction and hence constitute a rational number.. A rational number can be simplified. Examples: $$0.75, \dfrac{-31}{5}$$, etc. where p and q are integers and q is not equal to zero. (b)
{ "domain": "quali-a.com", "id": null, "lm_label": "1. Yes\n2. Yes", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9693241929723293, "lm_q1q2_score": 0.8455874213852973, "lm_q2_score": 0.8723473813156294, "openwebmath_perplexity": 328.20553820293884, "openwebmath_score": 0.8399621844291687, "tags": null, "url": "https://quali-a.com/4tltokh/20zft.php?af6199=is-zero-a-rational-number" }
java, programming-challenge, linked-list, interview-questions, cache Title: Leetcode #146. LRUCache solution in Java (Doubly Linked List + HashMap) Problem Statement Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item. Follow up: Could you do both operations in O(1) time complexity? Example: LRUCache cache = new LRUCache( 2 /* capacity */ ); cache.put(1, 1); cache.put(2, 2); cache.get(1); // returns 1 cache.put(3, 3); // evicts key 2 cache.get(2); // returns -1 (not found) cache.put(4, 4); // evicts key 1 cache.get(1); // returns -1 (not found) cache.get(3); // returns 3 cache.get(4); // returns 4
{ "domain": "codereview.stackexchange", "id": 43614, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, programming-challenge, linked-list, interview-questions, cache", "url": null }
rviz, openni-launch, openni-camera Title: openni_launch - ROS Fuerte Hi all! Since ROS Fuerte openni_camera and openni_launch are two different packages. When I like to use the Camera topic in rviz, which node do I have to start? Thanks for your help! Originally posted by JaRu on ROS Answers with karma: 153 on 2013-07-13 Post score: 0 Right now, if you are working on fuerte you only have to roslaunch openni_launch openni.launch this will launch all the nodes related to the kinect. If everything is correct you should se the topics with a rostopic list. /camera/rgb/camera_info /camera/rgb/image_raw ... A lot more. You can be sure you are receiving info by typing in the terminal rostopic echo /camera/rgb/image_raw a lot of numbers will full your screen in a few secs. Open Rviz add a display for the topic you want to display. And you should see the data if everything is correct. Originally posted by agonzamart with karma: 88 on 2013-07-13 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by JaRu on 2013-07-13: the rostopic echo works, but when I add the Camera display in rviz --> Image: no image received Comment by agonzamart on 2013-07-13: http://www.ros.org/wiki/rviz/DisplayTypes You can see the displays here, to see what topic to read. The one you need is the image one. Then you need to clic on the new display on the left spread it and choose the topic you have to read. http://www.ros.org/wiki/openni_launch, check tutorials
{ "domain": "robotics.stackexchange", "id": 14905, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, openni-launch, openni-camera", "url": null }
physical-chemistry, thermodynamics, electrochemistry Title: If E° of a Half Cell is based on the chosen reference Electrode (Generally SHE) then how is the equation ΔG°= -nFE° be valid for a Half Cell For example let us take the reaction: Zn(s) ---> Zn^2+(aq) + 2e^-(aq) ;ΔG°, which we are considering as our half cell And now suppose, by taking the value of E° of SHE(Standard Hydrogen Electrode) as zero and using it as reference, we have measured the E° of the zinc electrode. But clearly this value is relative to SHE and not the absolute value. Now we have the equation ΔG°= -nFE° , relating the change in Gibbs energy of the half cell reaction and the value of E°. The change in standard Gibbs energy of a reaction is constant at a constant temperature and has nothing to do with the chosen reference electrode so how can we relate both the values? My another doubt is why even bother defining a reference electrode if we can find the electrode potentials of a half cell with its change in gibbs energy. Or is it the other way around, that we calculate the value of ΔG based on the measured value of E. If we use the tabelated reduction potential $E°$ of a half-reaction in the equation $ΔG° = -nFE°$ the we implicitly assume the reaction $\ce{Ox(aq) + $\frac n2$ H2(g) -> Red(aq) + n H+(aq)}$. If other than SHE half reaction had been chosen as the conventional potential reference, the respective implicit reaction would have been different, with different $ΔG°$ and different $E°$ for both the reaction and the zinc half reaction. If we consider two general half-reactions then $Δ_\text{r}G{^\circ} = -nF(E{^\circ}_\text{cathode} - E{^\circ}_\text{anode} )$
{ "domain": "chemistry.stackexchange", "id": 17659, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, thermodynamics, electrochemistry", "url": null }
statistical-mechanics, partition-function Title: State equation of a partition function in base 2 What is the impact on the state equation of a Gibbs ensemble if we change the base to 2. For example, $$ \begin{align} &Z=\sum_i{2^{-\beta (E_i+pdV)}} & \text{partition function} \\ &dE=TdS-pdV & \text{state equation} \end{align} $$ Does the change of basis changes the state equation? Changing this is the equivalent of changing the temperature of your system. This can be seen just by recasting the new basis into the old basis. First note that $$\gamma^x=(e^{\log\gamma})^x=e^{x \log\gamma},$$ where I choose $\gamma > 1$. Hence your partition function becomes $$Z=\sum_i{e^{-\log\gamma~\beta (E_i+pdV)}} = \sum_i{e^{-\beta' (E_i+pdV)}}.$$ Where we see it is unchanged, if we change our temperature such that $\beta' = \beta\log\gamma $. That is $T'\rightarrow \frac{T}{\log\gamma}$. Hence the equation of state would be $$dE=T'dS-pdV=\frac{T}{\log \gamma}dS - pdV$$
{ "domain": "physics.stackexchange", "id": 42760, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, partition-function", "url": null }
organic-chemistry, stability, hybridization, carbocation Could someone please clear this doubt if whether any other factors were taken into consideration or my basic premise is wrong? Preamble As trivial as this question might seem, it is not. It should certainly never be asked in at an exam level lower than basic quantum chemistry. Any of the tempting explanation schemes will certainly fail. A bonding picture in the Lewis formalism is almost impossible; hybridisation descriptions in these compounds is extremely complex. As a general tip: The smaller the molecule, the more complicated is the bonding. What is stability? This question seems so simple, yet is incredibly complex. As a quantum chemist, I see any molecule as stable if it is an energy well (stationary point) on the potential energy surface (and this might already be a simplification). This concept does not help in any way when you want to compare stabilities, because it is just one property of a particular arrangement of nuclei in a particular state. There is no such thing as absolute stability. We cannot measure it. It is an abstract concept, that we like to think that we understand it. An example from the real world: ice is stable below 0 °C and vapour is stable above 100 °C. Yet ice is not more stable than vapour. Comparing stability, we always need a framework of multiple variables or constants and a reference point. It is therefore often assumed, that the boundary conditions are the same (exactly). Even on a purely theoretical level this it is extremely difficult to find these exact boundary conditions. Sooner or later you have to introduce approximations, which eventually crash your system, especially regarding the reference point. It is difficult, but not impossible. In order to compare the relative stability of those two cations we can assume a hypothetical hydride transfer between them, hence building a closed reference frame. In computational chemistry we use the concept of isodesmic reactions for such purposes. It is obviously not free of any bias and a complete hypothetical, but it can give us some more insight. In this case we can propose the following hypothetical isodesmic reaction:
{ "domain": "chemistry.stackexchange", "id": 17711, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, stability, hybridization, carbocation", "url": null }
field-theory, superposition Title: Do "fields" always combine by addition? "Field" is a fun word which clearly has several meanings. In all fields I can think of in my learning career, the fields obey superposition. I can calculate the fields generated by each object independently, and then sum them to determine the total field. But all the fields I can think of are relatively simple. Are there fields for which this superposition principle does not apply? In other words, if I have a system where two mathematical vector spaces do not add (perhaps they saturate due to nonlinear effects), would a a physicist say "that's not a field because it doesn't admit the superposition principle?" Is there another name which is used in such circumstances instead? There are really two parts to your question: first, given two field configurations $\phi_A$ and $\phi_B$, does it make sense to think of a field configuration $\phi_C = \phi_A + \phi_B$? Second, is the time evolution of $\phi_C$ the same as the sum of the time evolutions of $\phi_A$ and $\phi_B$? If it isn't, there's not much point in writing $\phi_C$ as a sum in the first place. To answer the first question: not always. Essentially by definition, field combinations can be added if the space of possible field values is a vector space. This is the simplest option, but not the only one. For example, for a permanent magnet at low temperature, the local magnetization field has a constant magnitude but can vary its direction; it can take on values in a sphere. But the sum of two vectors on a sphere doesn't necessarily lie on the same sphere, so taking sums doesn't make sense. For a more sophisticated example, the Higgs field does something quite similar. Sometimes one refers to theories with fields of this type as nonlinear sigma models. We still call these entities fields; my impression is that any function either from or to spacetime can be called a field.
{ "domain": "physics.stackexchange", "id": 56086, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "field-theory, superposition", "url": null }