text stringlengths 49 10.4k | source dict |
|---|---|
scala
ar.update(ERSTerminal)
}
catch {
case t: Throwable => logger.error("[deregisterActorForEvent]", t)
}
parent.registerCount = byEventName.size + actorByEventName.size
endTrans(logger, transKey)
}
def getConditional(name: String): ConditionalDispatcher = {
conditionals.get(name) match {
case None =>
val conditional = new ConditionalDispatcher(name)
conditionals.put(name, conditional)
conditional
case Some(conditional) => conditional
}
}
def doDispatch(event: EFLEvent) {
val transKey = beginTrans(logger, "messageHandler.dispatching." + event.name)
try {
event.context = context
event.update(ESPending)
logger.trace("[doDispatch] {}", byEventName)
logger.trace("[doDispatch] {}", actorByEventName)
Thread.sleep(5)
byEventName.get(event.name) match {
case None => logger.trace("[doDispatch] no regular callbacks.")
case Some(set) =>
logger.trace("[doDispatch] {} callbacks.", set.size)
set.foreach(_.call(event))
}
actorByEventName.get(event.name) match {
case None => logger.trace("[doDispatch] no actor callbacks.")
case Some(set) =>
logger.trace("[doDispatch] actors: {}", set.size)
set.foreach(_.call(event))
}
}
catch {
case t: Throwable => logger.error("[doDispatch] ", t)
}
event.update(ESComplete)
endTrans(logger, transKey)
}
} | {
"domain": "codereview.stackexchange",
"id": 7267,
"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": "scala",
"url": null
} |
python, game, pygame
but your game never uses this property. Consider using the @property decorator instead so that the magnitude only gets computed when you need it:
@property
def magnitude(self):
return math.hypot(self.x, self.y)
(Also note the use of math.hypot from the standard library.)
You have a class method from_magn_and_angle but you only ever call it with angle equal to zero, for example:
self.vector = Vec2D.Vec2D.from_magn_and_angle(BALL_SPEED, 0)
which is the same as:
self.vector = Vec2D.Vec2D(BALL_SPEED, 0)
2.3. Constants
It would make your code clearer if you used Pygame's colour names. Instead of
BLACK = ( 0, 0, 0)
BGCOLOR = BLACK
consider something like:
BACKGROUND_COLOR = pygame.Color('black')
There's no explanation of the meaning of the constants. We can guess from the name that SCREEN_HEIGHT = 480 gives the height of the screen in pixels, but what about GAP? It's the gap betwen something and something else, but what?
Or consider BALL_SPEED = 5. It's probably the speed of the ball in some units. But what units? Pixels per second? Pixels per frame?
From examining the code it seems that BALL_SPEED is in pixels per frame, but PLAYER_SPEED and ENEMY_SPEED are in pixels per second. This is particularly confusing! It also means that if you change the framerate, then the ball will speed up or slow down. Better to specify all speeds per second, so that you can easily change the framerate.
2.4. Text | {
"domain": "codereview.stackexchange",
"id": 4546,
"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, game, pygame",
"url": null
} |
quantum-mechanics, density-operator
\langle\alpha|\rho \left(\frac{d|\alpha\rangle}{dt}\right)=
%
\\
%
=\frac{i}{\hbar}\left( \langle\alpha|H\rho|\alpha\rangle - \langle\alpha|\rho H|\alpha\rangle \right)+ \langle\alpha| \left(\frac{d\rho}{dt}\right)|\alpha\rangle=
%
\\
%
=\frac{i}{\hbar} \langle\alpha|\left[H,\rho\right]|\alpha\rangle -
\frac{i}{\hbar} \langle\alpha|\left[H,\rho\right]|\alpha\rangle=0
$$
Which essentially gives the same information as in the answer below.
The last expression however shouldn't be interpreted the time evolution of any specific population. The time propogation of occupation probability is given by:
$$
P_{\alpha\alpha}(t) = |c_\alpha(t)|^2 = \langle\alpha(0)|\rho(t)|\alpha(0)\rangle=
\left(G(t)\rho(0)G^\dagger(t)\right)_{\alpha\alpha}
$$
where $c_\alpha(t)$ are the time dependent coefficients of some spectral decomposition: $|\psi(t)\rangle = \sum_\alpha c_\alpha(t)|\alpha\rangle$,
and $G(t)$ is the time propagator between the states with time difference $t$. A bounded operator $\rho$ over a Hilbert space is positive iff for all $x$ from the Hilbert-space $$ \langle \rho x, x\rangle \geq 0 $$
Now $\rho$ obeys the von-Neumann-equation, whose formal solution is$^1$ | {
"domain": "physics.stackexchange",
"id": 36808,
"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, density-operator",
"url": null
} |
(Side note: The derivative of $|x|$ does not exist at $x=0$. In physics, we sometimes cheat and write ${d\over dx}|x| = \rm{sgn}(x)$, the "sign" function that gives $-1$ when $x<0$, $0$ when $x=0$, and $+1$ when $x > 0$. But only when we know that the value at $x=0$ will not get us into trouble!)
Another solution would be the function $$x \rightarrow x \frac{e^{kx}}{e^{kx} + e^{-kx}} -x\frac{e^{-kx}}{e^{kx} + e^{-kx}}$$ with higher the $$k$$, closer you will be to the absolute value function. Furthermore it is equal to 0 in 0 wich is sometimes a desirable feature (compared to the solution with the root square stated above). However you lose the convexity.
$$\forall x\neq0,\dfrac{d|x|}{dx} = \frac{x}{|x|} = \begin{cases} -1 & x<0 \\ 1 & x>0. \end{cases}$$
• This is not what @Ono is after. Mar 26 '14 at 19:53
• Upvote, simply because I think the reason for the downvote is nonsense. This is the derivative. Mar 26 '14 at 19:58
• @Arthur The OP said that he wanted the derivative of $|x|$ to be a function of $x$. That is what I did
– user122283
Mar 26 '14 at 19:59
• @SanathDevalapurkar The OP also states that by approximating $|x|$ she wants a smooth solution. That is what the question is about. I.e. what smooth approximations to the absolute value function are useful. Mar 26 '14 at 20:00
• FWIW, I think a good answer should at least refer to OP's proposal, since OP asks whether the proposal is best. Mar 26 '14 at 20:05 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9553191246389618,
"lm_q1q2_score": 0.8333701414551783,
"lm_q2_score": 0.8723473862936942,
"openwebmath_perplexity": 292.653433753072,
"openwebmath_score": 0.8388081789016724,
"tags": null,
"url": "https://math.stackexchange.com/questions/728094/approximate-x-with-a-smooth-function/1115033"
} |
electrostatics, classical-electrodynamics, mass-energy
Title: What does electrostatic self-energy mean? The question at hand is:
"Assume that the rest-mass energy $mc^2$ of the electron is equal to its electrostatic self-energy and that the electron charge is distributed uniformly inside a sphere of radius R. What is the value of R (in unit of meter)?"
My question is, what is electrostatic self-energy? Would this be equivalent to integrating $kQ/r$ over the volume of a sphere?
What is electrostatic self-energy? | {
"domain": "physics.stackexchange",
"id": 33788,
"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, classical-electrodynamics, mass-energy",
"url": null
} |
The exact value of 0.3 + -0.29 is 0.01.
Compute the following:
(float approx of 0.3) + (float approx of -0.29) =
(2.8125) + -0.28125) =
0
Then compare the approximate value (0) to the exact value (0.1) for the number of significant figures of $$z = float(x_1) + float(x_2)$$
1.0 - 0.0 = 1.0
The result has zero significant figures of accuracy.
Note that your textbook's definition of significant figures is probably different than mine. In your homework, explain to your teacher what definition you used. The concept of significant figures is more important that the details. Knowing roughly how many digits of the approximation are correct is more important than knowing exactly how to compute the number of significant figures. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.966914019704466,
"lm_q1q2_score": 0.8312209256468533,
"lm_q2_score": 0.8596637433190939,
"openwebmath_perplexity": 751.7877254236755,
"openwebmath_score": 0.6995863914489746,
"tags": null,
"url": "https://cs.stackexchange.com/questions/109939/floating-point-arithmetic"
} |
radioactivity
Title: how can carbon dating even work? Its at atomic level! I am a homeschooling parent, so pardon me asking stupid questions.
Everywhere I read, it is said carbon based lifeforms eat carbon and after their death that atom starts a decay.
But what I cannot understand, we dont eat or work with food at atomic levels. Yes, life forms breaks down molecules from food and use them as they wish. But that chemical process does not effect the atom structure. I dont think any life form has capacity or energy to break down atoms.
So if one atom of C14 was having a decay already before we ate it, it keeps having it while it gets digested and goes on in the same way if life is alive or dead. If another C14 was not having a decay, then it starting a decay has nothing to with the life form is alive or dead.
As Dr. Manhattan(Watchmen 2009) said atoms dont care if you are alive or dead. They stayed there at the same place before and after.
So how can a lifeform have any effect in the C14 decay at all?
Got some good answers, so I clarifying my questions: | {
"domain": "chemistry.stackexchange",
"id": 12795,
"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": "radioactivity",
"url": null
} |
# Statement about divisors of polynomials and their roots
I am a 10th grade student and there is a statement in my math book
If $a$ is a root of the polynomial $f(x)$ then $(x-a)$ is a divisor of $f(x)$
Why is $(x-a)$ a divisor of $f(x)$? Can you please tell me?
• Since a is a root it is $f(a)=0$. Therefore your polynomial includes the factor $(x-a)$. You might observe an example. $x^2-2x+1=0$ has the solutions $x_1=-1$ and $x_2=-1$. You can factor it as $(x-1)^2=0$ with the binomic formula. – MrTopology Jul 6 '16 at 10:44
• It's an prompt result of factor theorem – Zack Ni Jul 6 '16 at 10:45
• Have you learned about synthetic division? If $f(x),g(x)$ are arbitrary polynomials, we can "divide $f$ by $g$" in the sense that we can write $f(x)=g(x)q(x) +r(x)$ where $q(x), r(x)$ are also polynomials and $deg(r(x))<deg(g(x))$. Can you see that this suffices? – lulu Jul 6 '16 at 10:46
• @TheGreatDuck Why are you saying this??!!! a root of a polynomial is simply a number you plug in that makes it zero, the fact that $(x-\text{root})$ divides the polynomial is a very different story. For instance, one talkes about roots of functions (not necessarily polynomials) where this theorem actually does not hold. – Daniel Jul 6 '16 at 23:22
• @SolidSnake i forgot that the dividing point is zero. – user64742 Jul 7 '16 at 0:46
It's a great thing that you feel curiosity for the reasons of the statements that are taught to you! | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9859363700641144,
"lm_q1q2_score": 0.8419036381639438,
"lm_q2_score": 0.8539127510928476,
"openwebmath_perplexity": 328.9156964158226,
"openwebmath_score": 0.9282742738723755,
"tags": null,
"url": "https://math.stackexchange.com/questions/1850784/statement-about-divisors-of-polynomials-and-their-roots/1850934"
} |
Grade 8 MTAP 2015 Elimination Questions with Solutions – Part 2
This is the second part (questions 11-20) of the solutions of the Grade 8 MTAP 2015 Elimination Questions. You can read the solutions for questions 1-10 here. If you found any errors in the solution, please comment in the box below.
11.) If $x = 4$ and $y = -3$, what is $x^2y + xy^2$?
Solution
$x^2y + xy^2 = (4^2) (-3) + (4) (-3)^2 = (16) (-3) + 4(9)$
$= (-48) + 36 = -12$
12.) Simplify $x(1 + y) - 2y(x - 2) + xy$
Solution
$x(1 + y) - 2y (x - 2) + xy$
$= x + xy - 2xy + 4y + xy$
$= x + 2xy - 2xy + 4y$
$= x + 4y$
Answer: $x + 4y$
13.) If $a$ and $b$ are positive constants, simplify $\dfrac{ab \sqrt{ab}}{\sqrt[3]{a^4} \sqrt[4]{b^3}}$.
Solution
Note that $\sqrt {ab} = (ab)^{1/2}$$\sqrt [3]{a^4} = a^{4/3}$ and $\sqrt [4] {b^3} = b^{3/4}$ | {
"domain": "mtapreviewer.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9896718474806949,
"lm_q1q2_score": 0.8247178856486033,
"lm_q2_score": 0.8333245891029457,
"openwebmath_perplexity": 2690.302515944576,
"openwebmath_score": 0.4944648742675781,
"tags": null,
"url": "http://mtapreviewer.com/2016/01/22/grade-8-mtap-2015-elimination-2/"
} |
quantum-mechanics, quantum-spin, schroedinger-equation
Title: Time evolution unclear Let $$H := \sigma_z \otimes \sum_{k=1}^{n}\mathrm{id} \otimes ...\otimes g_k \sigma_z \otimes...\otimes \mathrm{id}$$ be the Hamiltonian ($\sigma_z$ is the Pauli-matrix of couse)
and $$|\psi_0 \rangle:=(a|\!\uparrow\rangle+b |\!\downarrow\rangle ) \otimes_{k=1}^{n} (\alpha_k |\!\uparrow \rangle + \beta_k |\!\downarrow\rangle).$$
Then my script says that the time-evolution of this state is
\begin{align}
|\psi(t)\rangle
&=a|\!\uparrow\rangle \otimes_{k=1}^{n} (\alpha_k e^{i g_kt}|\!\uparrow \rangle + e^{-i g_k t} \beta_k |\!\downarrow\rangle)
\\ &\quad
+b |\!\downarrow\rangle\otimes_{k=1}^{n} (\alpha_k e^{-i g_kt}|\!\uparrow \rangle + e^{i g_k t} \beta_k |\!\downarrow\rangle).
\end{align}
Does anybody have an explanation for this?
My concern about this equation arises from the fact that for $n=0$, we would have $|\psi(t)\rangle= |\psi(0)\rangle$ which should not be case, but rather $|\psi(t)\rangle= e^{-it}a|\!\uparrow\rangle+ e^{it} b|\!\downarrow\rangle.$
What do you think? | {
"domain": "physics.stackexchange",
"id": 28462,
"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, schroedinger-equation",
"url": null
} |
beginner, tree, iterator, rust
/// Consume a binary tree node, traversing its left subtree and
/// adding all branches to the right to the `right_nodes` field
/// while setting the current node to the left-most child.
fn add_left_subtree(&mut self, root: BTree<T>) {
let mut node: BTree<T> = root;
while let BTree::Branch(left, right) = node {
self.right_nodes.push(*right);
node = *left;
}
self.current_node = Some(node);
}
}
impl<T> Iterator for BTreeIterator<T> {
type Item = T;
fn next(&mut self) -> Option<T> {
// Get the item we're going to return.
let result = self.current_node.take().map(|node|
match node {
BTree::Leaf(n) => n,
_ => { panic!("invariant violation: expected Leaf") },
});
// Now add the next left subtree
// (this is the "recursive call")
match self.right_nodes.pop() {
Some(node) => self.add_left_subtree(node),
_ => {},
};
return result;
}
}
#[test]
fn test_btree_iteration() {
assert_eq!(new_leaf(123).into_iter().collect::<Vec<_>>(), vec![123]);
let btree = new_branch(new_leaf(10), new_branch(new_leaf(20), new_leaf(30)));
assert_eq!(btree.into_iter().collect::<Vec<_>>(), vec![10, 20, 30]); | {
"domain": "codereview.stackexchange",
"id": 16641,
"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, tree, iterator, rust",
"url": null
} |
in an equation. The Matrix, Inverse. Another option would be to look in "The Comprehensive LaTeX Symbol List" in the external links section below.. Greek letters []. Generate diagonal matrices or return diagonal of a matrix Details. Greek letters are commonly used in mathematics, and they are very easy to type in math mode. image/svg+xml. A00 A01 A02 A03 A10 A11 A12 A13 A20 A21 A22 A23 A30 A31 A32 A33 Related Symbolab blog posts. (The main or principal diagonal in matrix B is composed of elements all equal to 1.) Diagonal Matrices, Upper and Lower Triangular Matrices Linear Algebra MATH 2010 Diagonal Matrices: { De nition: A diagonal matrix is a square matrix with zero entries except possibly on the main diagonal (extends from the upper left corner to the lower right corner). The stair matrix S is essentially a diagonal matrix D with some additional off-diagonal elements. Once you have loaded \usepackage{amsmath} in your preamble, you can use the following environments in your math environments: Type L a T e X markup Renders as Plain \begin{matrix} The matrix notation will allow the proof of two very helpful facts: * E b = β . Its symbol is the capital letter I; It is the matrix equivalent of the number "1", when we multiply with it the original is unchanged: A × I = A. I × A = A. Diagonal Matrix. In Mathematica it can be done easily, but when using the module numpy.linalg I get problems. How do I display truly diagonal matrices? For input matrices A and B, the result X is such that A*X == B when A is square. Matrix multiplication is thus a basic tool of linear algebra, and as such has numerous applications in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering. This means that b … DiagonalMatrix[list, k] gives a matrix with the elements of list on the k\[Null]^th diagonal. A diagonal matrix has zero anywhere not on the main diagonal: A diagonal matrix. es. The spectral symbols are useful tools to analyse the eigenvalue distribution when dealing with high dimensional linear systems. Fortunately, there's a tool that can greatly simplify the search for the command | {
"domain": "desperatehomeschoolers.com",
"id": null,
"lm_label": "1. Yes\n2. Yes",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9693242005047408,
"lm_q1q2_score": 0.8258184649920711,
"lm_q2_score": 0.8519527982093666,
"openwebmath_perplexity": 523.6549498507757,
"openwebmath_score": 0.7516106367111206,
"tags": null,
"url": "http://desperatehomeschoolers.com/pages/273302-diagonal-matrix-symbol"
} |
special-relativity, fluid-dynamics
Title: Newtonian limit of a perfect fluid In special relativity, with metric tensor $\eta_{\mu\nu}=\text{diag}(-c^2,1,1,1)$, take a perfect fluid stress-energy tensor : $T^{\mu\nu} = \left( \rho + \frac{p}{c^2} \right) \, U^\mu\otimes U^\nu + p \, \eta^{\mu\nu}$, where $U^\mu$ is the 4-speed, $\rho$ the volumic mass and $p$ the pressure of the fluid.
In the newtonian limit where $U^\mu \simeq (1,0,0,0)$, we find the newtonian fluid at rest $T^{\mu\nu}\simeq \text{diag}(\rho,p,p,p)$. However, if we want the more precise approximation $(U^t)^2=\gamma^2\simeq 1+\frac{v^2}{c^2}$, we get
$$ T^{tt} \simeq \left( \rho + \frac{p}{c^2} \right) \left( 1 + \frac{v^2}{c^2} \right) - \frac{p}{c^2} $$
Two things surprise me in this energy formula,
The pressure term $\frac{pv^2}{c^4}$ remains. It is small but not zero.
It figures $\rho +\rho\frac{v^2}{c^2}$ instead of the newtonian kinetic energy $\rho +\frac{1}{2}\rho\frac{v^2}{c^2}$. | {
"domain": "physics.stackexchange",
"id": 42827,
"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": "special-relativity, fluid-dynamics",
"url": null
} |
>
Order each of the following pairs of numbers, using $<\phantom{\rule{0.2em}{0ex}}\text{or}\phantom{\rule{0.2em}{0ex}}>\text{:}\phantom{\rule{0.2em}{0ex}}0.18___0.1.$
>
Order $0.83___0.803$ using $<$ or $>.$
## Solution | {
"domain": "jobilize.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540698633748,
"lm_q1q2_score": 0.8264721051470547,
"lm_q2_score": 0.8438951045175643,
"openwebmath_perplexity": 1609.5355461471133,
"openwebmath_score": 0.48213860392570496,
"tags": null,
"url": "https://www.jobilize.com/algebra2/course/1-8-the-real-numbers-foundations-by-openstax?qcr=www.quizover.com&page=5"
} |
# Finding inverse of polynomial in a field
I'm having trouble with the procedure to find an inverse of a polynomial in a field. For example, take:
In $\frac{\mathbb{Z}_3[x]}{m(x)}$, where $m(x) = x^3 + 2x +1$, find the inverse of $x^2 + 1$.
My understanding is that one needs to use the (Extended?) Euclidean Algorithm and Bezout's Identity. Here's what I currently have:
Proceeding with Euclid's algorithm:
$$x^3 + 2x + 1 =(x^2 + 1)(x) + (x + 1) \\\\ x^2 + 1 = (x + 1)(2 + x) + 2$$
We stop here because 2 is invertible in $\mathbb{Z}_3[x]$. We rewrite it using a congruence:
$$(x+1)(2+x) \equiv 2 mod(x^2+1)$$
I don't understand the high level concepts sufficiently well and I'm lost from here. Thoughts?
Wikipedia has a page on this we a decent explanation, but it's still not clear in my mind.
Note that this question has almost the same title, but it's a level of abstraction higher. It doesn't help me, as I don't understand the basic concepts.
Thanks.
-
If you can write $2$ as $(x^3+2x+1)f(x)+(x^2+1)g(x)$, then $2g(x)$ is an inverse to $x^2+1$ in $\mathbb Z_3[x]/(x^3+2x+1)$. Does it help? – Pierre-Yves Gaillard Mar 25 '12 at 16:20 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9817357179075082,
"lm_q1q2_score": 0.8546964458456819,
"lm_q2_score": 0.8705972801594706,
"openwebmath_perplexity": 372.49844595970956,
"openwebmath_score": 0.9932308197021484,
"tags": null,
"url": "http://math.stackexchange.com/questions/124300/finding-inverse-of-polynomial-in-a-field/124307"
} |
Do not fragment the terms, keep them as a sum. $$(1-x)\ln(1-x) =(1-x)\left[-\sum_{n=1}^{\infty}\frac{x^n}{n}\right] =-\sum_{n=1}^{\infty}\frac{x^n}{n}+\sum_{n=1}^{\infty}\frac{x^{n+1}}{n} \\[8mm] =\left(-x-\sum_{\color{red}{n=2}}^{\infty}\frac{x^n}{n}\right)+\sum_{n=1}^{\infty}\frac{x^{n+1}}{n} =\left(-x-\sum_{\color{red}{n=1}}^{\infty}\frac{x^{n+1}}{n+1}\right)+\sum_{n=1}^{\infty}\frac{x^{n+1}}{n} \\[8mm] =-x+\sum_{n=1}^{\infty}\left(\frac{1}{n}-\frac{1}{n+1}\right)x^{n+1}=-x+\sum_{n=1}^{\infty}\frac{x^{n+1}}{n(n+1)}$$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018398044144,
"lm_q1q2_score": 0.8288934561350655,
"lm_q2_score": 0.8499711775577736,
"openwebmath_perplexity": 279.1869379026821,
"openwebmath_score": 0.8481487035751343,
"tags": null,
"url": "https://math.stackexchange.com/questions/2125542/multiplying-an-infinite-series-by-a-sum-of-two-terms"
} |
$$2nd$$ case when $$y+3 \lt 0 \Rightarrow y \lt -3$$ and in this case $$y$$ will have infinite values and I am not able to proceed from here.
The answer for the total number of solutions provided is $$10$$ and you can see that I've been able to find out the $$5$$ solutions in my $$1st$$ case. Can someone please guide or help me about how to proceed in the 2nd case?
• Notice that $|x-1||y+3|$ is an integer between $2$ and $5$, so there are only few possibilities to check.
– Sil
Mar 22, 2021 at 11:26
• Since $x$ is a negative integer, $|x - 1| \geq 2.$ This means that $|y+3|$ must be less than $3$. Mar 22, 2021 at 11:27
• thanks for such quick responses...but can you please direct me in the way of how I was trying to solve this rather than taking a whole new solution approach. If you have new approach...please explain down as answers...thanks! Mar 22, 2021 at 11:33
• In your second case we have $|y+3|=(-y-3)$ and also $1-x>1$ (in fact $1-x\geq 2$),and so by $(1-x)(-y-3) \le 5$ we must have $-y-3 \leq \frac{5}{2}$. This gives you a lower bound for $y$ similarly as in first case.
– Sil
Mar 22, 2021 at 11:51
• @Sil : can you please elaborate your last comment? I understood the part that $1-x \ge 2$ but i did not understood after that. If you kindly elaborate the later part of your comment. Mar 22, 2021 at 12:09
Both $$|x-1|$$ and $$|y+3|$$ are non-negative integers. As the product must lie between $$2$$ and $$5$$, the only candidates are: | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9793540698633748,
"lm_q1q2_score": 0.8052142754410744,
"lm_q2_score": 0.8221891348788759,
"openwebmath_perplexity": 310.6554377624969,
"openwebmath_score": 0.8996587991714478,
"tags": null,
"url": "https://math.stackexchange.com/questions/4071839/number-of-possible-solutions-to-2-le-x-1y3-le-5-where-x-and-y-are"
} |
The interquartile range is between the first and third quartiles.
In the box plots shown below the:
• interquartile range is the boxed region, the
• maximum and minimum values are the horizontal lines, and the
• median is the red line in the center of the boxed region.
It is also possible to specify more limited ranges for the whiskers. This is changeable via the whis parameter to the function. The ‘range’ parameter means use the maximum and minimum of the data.
plt.figure()
plt.boxplot([ df['normal'],
df['random'],
df['gamma'] ],
whis='range');
<IPython.core.display.Javascript object>
If the whis parameter is left out, the top whisker defaults to reaching to the last datum less than Q3 + 1.5*IQR, where IQR represents the interquartile range.
Plots like the one shown below are good for detecting outliers. The datapoints beyond the whiskers are called “fliers.”
plt.figure()
plt.boxplot([ df['normal'],
df['random'],
df['gamma'] ]);
<IPython.core.display.Javascript object> | {
"domain": "ryanwingate.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9752018434079933,
"lm_q1q2_score": 0.832737288975336,
"lm_q2_score": 0.8539127510928477,
"openwebmath_perplexity": 2674.2950234223113,
"openwebmath_score": 0.4351652264595032,
"tags": null,
"url": "https://ryanwingate.com/visualization/common-types/box-plots/"
} |
magnetic-fields, laboratory-safety
Title: An appropriate way to store neodymium magnets Okay so I've bought a few small neodymium magnets to play around with, they're very powerful and I really like them, but I was wondering what's the actual best way of storing those magnets in a way that doesn't affect their magnetic fields or degrades them in any way.
I'm currently storing them stuck to one another, is it a good practice? Thanks a lot! Before modern rare earth permanent magnets, magnets required a 'keeper', metal bar that would shunt the flux between poles. This would prevent a loss in magnetization that could occur over time for materials like AlNiCo.
But with rare earth magnets like NdFeB keepers are not required. They will hold their strength, even when stacked.
Perhaps the most important thing regarding storage is to keep them stored in a secure place where small children cannot get to them. Swallowing these magnets can lead to pinching and internal bleeding of the gut. That's for small magnets.
For bigger rare earth magnets there is the danger of the magnet accelerating to high velocity, or metal objects around the magnet accelerating. Pinching forces can cut off circulation in fingers and bones can be broken! So these magnets require extreme care in handling to constantly make sure they are outside the range of other ferromagnetic objects. These magnets should be stored by themselves in sturdy, thick walled wooden boxes. | {
"domain": "physics.stackexchange",
"id": 46089,
"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": "magnetic-fields, laboratory-safety",
"url": null
} |
python, file-system
File_Record(Header=Record_Header(Written=3, Hardlinks=1, Record_Size=416, Base_Record=0, Record_ID=3, In_Use=1, Directory=0), Attributes=(Resident_Attribute(Type='$STANDARD_INFORMATION', Name='', Attribute=Standard_Information(File_Created=datetime.datetime(2021, 3, 21, 9, 41, 47, 819000), File_Modified=datetime.datetime(2021, 3, 21, 9, 41, 47, 819000), Record_Changed=datetime.datetime(2021, 3, 21, 9, 41, 47, 819000), Last_Access=datetime.datetime(2021, 3, 21, 9, 41, 47, 819000), File_Permissions=File_Permissions(Read_Only=False, Hidden=True, System=True, Archive=False))), Resident_Attribute(Type='$FILE_NAME', Name='', Attribute=FileName(Parent_Record=5, Allocated_Size=0, Real_Size=0, Name='$Volume')))), | {
"domain": "codereview.stackexchange",
"id": 45385,
"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, file-system",
"url": null
} |
a, CS1 maint: multiple names: authors list (, https://en.wikipedia.org/w/index.php?title=Chebyshev_distance&oldid=970054377, Creative Commons Attribution-ShareAlike License, This page was last edited on 28 July 2020, at 23:40. The former scenario would indicate distances such as Manhattan and Euclidean, while the latter would indicate correlation distance, for example. It is an example of an injective metric. The distance field stores the Manhattan distance : abs(x-i)+abs(y-j) Pick a point on the distance field, draw a diamond (rhombus) using that point as center and the distance field value as radius. {\displaystyle (x_{2},y_{2})} Euclidean vs Manhattan vs Chebyshev Distance Euclidean distance, Manhattan distance and Chebyshev distance are all distance metrics which compute a number based on two data points. 1D - Distance on integer Chebyshev Distance between scalar int x and y x=20,y=30 Distance :10.0 1D - Distance on double Chebyshev Distance between scalar double x and y x=2.6,y=3.2 Distance :0.6000000000000001 2D ... manhattan distance between two vectors minkowski distance metric On a chess board, where one is using a discrete Chebyshev distance, rather than a continuous one, the circle of radius r is a square of side lengths 2r, measuring from the centers of squares, and thus each side contains 2r+1 squares; for example, the circle of radius 1 on a chess board is a 3×3 square. ( y and Chebyshev distance is a distance metric which is the maximum absolute distance in one dimension of two N dimensional points. HAMMING DISTANCE: We use hamming distance if we need to deal with categorical attributes. methods (euclidean distance, manhattan distance, and minkowski distance) to determine the status of disparity in Teacher's needs in Tegal City. It is also known as Chessboard distance. I am confused by what the purpose of manhattan, euclidian and chebyshev in an A* Algorithm. It is calculated using Minkowski Distance formula by setting p’s value to 2. plane geometry, if | {
"domain": "xigentportal.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.981735723251272,
"lm_q1q2_score": 0.8223214385229796,
"lm_q2_score": 0.837619961306541,
"openwebmath_perplexity": 999.0108520821319,
"openwebmath_score": 0.7239447832107544,
"tags": null,
"url": "http://xigentportal.com/rwvtt/a73b48-chebyshev-distance-vs-manhattan-distance"
} |
cc.complexity-theory, arithmetic-circuits
As pointed out by Joshua Grochow, you cannot say anything useful about the complexity of evaluation of analytic functions at integers. The correct statement you are looking for is that approximation of smooth functions on short real intervals is at least as hard as integer multiplication. This indeed follows from Taylor expansion, though in full generality there are some messy details where the devil is (in particular, we a priori know nothing about the coefficients of the Taylor series).
As usual in this context, it is convenient to restrict attention to time bounds obeying some basic regularity conditions. Let me say that $T(n)$ is a reasonable bound if $T$ is nondecreasing, and
$$c_1T(n)\le T(2n)\le c_2T(n)$$
for some constants $1<c_1\le c_2$. Commonly encountered bounds of polynomial growth involving powers of $n$, $\log n$, and similar, are all reasonable.
In order to avoid issues with representation of real numbers, we will only considered real functions on bounded intervals. An $n$bit approximation of $x$ is then a dyadic rational $x'$ written in the usual binary notation with $n$ bits after the radix point, such that $|x-x'|\le2^{-n}$. A function $f\colon[a,b]\to\mathbb R$ can be computed in time $T(n)$, if given a dyadic rational $x\in[a,b]$ with $n$ bits after the radix point, we can compute in time $T(n)$ an $n$bit approximation of $f(x)$. | {
"domain": "cstheory.stackexchange",
"id": 2831,
"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, arithmetic-circuits",
"url": null
} |
arduino, opencv, rosserial, eclipse
I cant find related tutorials, how can I compile the program successfully?
Thanks a lot
Originally posted by shan333 on ROS Answers with karma: 13 on 2013-01-24
Post score: 0
Original comments
Comment by shan333 on 2013-01-24:
Here are the setup steps I followed: http://www.ros.org/wiki/IDEs
Since you followed the tutorial on IDEs you should have an autogenerated Eclipse project. So in this case you have to change the setting related to a build process in relevant CMakeLists.txt file, not in Eclipse project settings.
To link additional libraries add target_link_libraries directive to your CMakeLists.txt:
rosbuild_add_executable(my_node src/my_node.cpp)
target_link_libraries(my_node GL GLU glut opencv_core opencv_gpu)
In general, though, you may want to use find_package routine -- many of the libraries has relevant "find" modules for CMake. In case there is no such module you can always fall back to FindPkgConfig package which is a wrapper for system pkg-config utility. Please see here for more details.
Originally posted by Boris with karma: 3060 on 2013-01-24
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 12567,
"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": "arduino, opencv, rosserial, eclipse",
"url": null
} |
# Confused about Taylor and Maclaurin Series
1. Oct 1, 2011
### paul2211
Currently, I'm doing some self studying on series, and I'm a bit confused regarding c (the value that the series is expanded about).
For example, does the Maclaurin series expansion of Sin(x) and the Taylor series of Sin(x) about c = 1 both converge to Sin(x)?
If so, what does the value of c do in this case? Can someone explain to me of its significance?
If they are not equal, does the Taylor series add up to Sin(x-1)? If this is the case, then what is the difference between a Taylor series of Sin(x) about c = 1 vs. a Maclaurin series of Sin(x-1)?
Thank you guys in advance, and I'll be really grateful if someone can clear this up for me.
2. Oct 1, 2011
### austintrose
There's not really a difference between a Taylor Series and a MacLaurin Series. Rather, the MacLaurin series is just a special case of the Taylor series. It's a MacLaurin series if it's centered around 0, (c = 0)
The "c" that you see in the Taylor series is simply a horizontal shift of the functions. Exactly like you you would translate any old function.
I.e., the Taylor Series for sin(x), centered at five, would approach the function sin(x-5).
3. Oct 1, 2011
### lurflurf | {
"domain": "physicsforums.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.970687770944576,
"lm_q1q2_score": 0.8088979878696431,
"lm_q2_score": 0.8333245891029457,
"openwebmath_perplexity": 420.93837807933085,
"openwebmath_score": 0.8381496071815491,
"tags": null,
"url": "https://www.physicsforums.com/threads/confused-about-taylor-and-maclaurin-series.535664/"
} |
mathematics, vectors
Title: Can vectors in physics be represented by complex numbers and can they be divided? Below is attached for reference, but the question is simply about whether vectors used in physics in a vector space can be represented by complex numbers and whether they can be divided. | {
"domain": "physics.stackexchange",
"id": 330,
"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": "mathematics, vectors",
"url": null
} |
c++, c++11, mathematics, template
could be an expression template, so that z[i] == x[i] - y[i] for each i. Squaring each element would be another expression template, so that
z = square(x - y)
would have z[i] == w * w for each i, where w = (x - y)[i]. Then,
squared_norm(x - y)
would compute the actual reduction as
template<typename X>
T sum(const X& x) { return std::accumulate(x.begin(), x.end(), X{}); }
template<typename X>
T squared_norm(const X& x) { return sum(square(x)); }
assuming Point or a more general expression template are equipped with begin(), end() (which they should). Note I am not using std::inner_product to avoid the extra cost when x is a (lazy) expression template. Then, squared_distance would be trivial
template<typename X, typename Y>
T squared_distance(const X& x, const Y& y) { return squared_norm(x - y); }
or not needed at all, while distance generalized as
template<typename X, typename Y>
T distance(const X& x, const Y& y) { return std::sqrt(squared_distance(x, y)); }
There's more to be generalized by considering rvalue references and forwading as appropriate, but I wanted to keep this clean.
The user should explicitly use squared Euclidean norms and distances when needed. For instance, consider this scientific article on nearest-neighbor search:
In (1), the distance measures d1 and d2 in R are induced
by d, so that for all a, b : d(a, b) = d1(a1, b1) + d2(a2, b2). The simplest and most important case is setting d, d1, and d2 to be squared Euclidean distances in respective spaces. | {
"domain": "codereview.stackexchange",
"id": 6661,
"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++, c++11, mathematics, template",
"url": null
} |
Neither the bishop nor the knight were hit, but their movement may have been obstructed by the meteors.
For what value of $p$ is the expected number of valid squares that the bishop can move to (in one move) equal to the expected number of squares that the knight can move to (in one move)?
### Solution
Let the knight be at the purple square to begin with
The knight can move to any of the blue squares in one move starting from the central purple square.
The expected number of blue squares that will not contain a meteor is $8(1-p)$ by linearity of expectation.
Staring from the central purple square, the bishop can move to any of the green squares, pink squares provided the corresponding green squares don’t have a meteor, red squares provided the corresponding green and pink squares don’t have a meteor and so on diagonally.
The expected number of green squares without the meteor is $4(1-p)$, pink squares is $4(1-p)^2$, red squares is $4(1-p)^3$ and so on for all the squares located diagonally.
The value of $p$ for which the expected number of valid squares that the bishop can move to (in one move) equal to the expected number of squares that the knight can move to (in one move) is given by
\begin{align} 8(1-p) &= 4\left\{(1-p) + (1-p)^2 + (1-p)^3 + \dots + \right\} \ \implies p &= \frac{1}{2} \end{align}
The squares the bishop and knight can move to in one step(the diagonal squares extend infinitely)
## Problem [Iran TST 2008/6]
Suppose $799$ teams participate in a round-robin tournament. Prove that one can find two disjoint groups $A$ and $B$ of seven teams each such that all teams in $A$ defeated all teams in $B$.
### Solution
A round robin tournament is a complete graph where each vertex is a team and a directed edge indicates the direction of win/loss.
Sample $A$ as a random $7$-set. Let $X$ be the number of guys that are totally dominated by $A$. | {
"domain": "vamshij.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.988491849579606,
"lm_q1q2_score": 0.8149738966436857,
"lm_q2_score": 0.8244619285331332,
"openwebmath_perplexity": 404.23719359452724,
"openwebmath_score": 0.9829915165901184,
"tags": null,
"url": "https://vamshij.com/blog/probabilistic-method/probabilistic-method-combinatorics/"
} |
ros, opencv, ros-melodic, catkin-ws, cmake
Originally posted by jahim44229 on ROS Answers with karma: 20 on 2020-03-09
Post score: 0
find_package(OpenCV 4.2.0 REQUIRED) is enough. You dont need to specify the version later on I think.
Check the following question. It gives a good explanation on how to use CMake macros.
Also dont forget to link the libraries:
target_link_libraries(your_executable
${catkin_LIBRARIES}
${OpenCV_LIBRARIES}
)
Originally posted by pavel92 with karma: 1655 on 2020-03-09
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 34562,
"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, opencv, ros-melodic, catkin-ws, cmake",
"url": null
} |
quantum-mechanics, linear-algebra, time-evolution, unitarity, linear-systems
Title: Can a non-unitary process be made unitary using a transformation or by expanding the phase space? Suppose I have a matrix differential equation:
$$ \frac{d\mathbf{x}}{dt} = A\mathbf{x}$$
The solution to this is
$$\mathbf{x}(t) = e^{At}\mathbf{x}(0)$$
If $A^{\dagger}=-A$, then the time evolution operator $e^{At}$ is unitary. But if that's not the case, is there a way to make the time evolution unitary, either by doing a variable transformation (i.e., $\mathbf{x} = B\mathbf{y}$ for some invertible $B$) or by expanding the phase space such that the system above is embedded in a larger, unitary system?
Could we do this for any system? If not, what conditions allow us to do this?
But if that's not the case, is there a way to make the time evolution unitary, either by doing a variable transformation (i.e., =
for some invertible
)
A mathematical change of variables cannot change the probabilities for physically observable events to occur. Non-unitarity implies that the probability of all possible final states for at least some process does not sum to 1. Since that is phrased in terms of physically observable probabilities, it cannot depend on the choice of variables we use to represent the system, so changing variables cannot make a non-unitary system become unitary.
A more mathematical argument is that unitarity is a property of an operator, and does not depend on the basis in which we express that operator.
or by expanding the phase space such that the system above is embedded in a larger, unitary system? | {
"domain": "physics.stackexchange",
"id": 96281,
"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, linear-algebra, time-evolution, unitarity, linear-systems",
"url": null
} |
frequency-spectrum, phase, fourier-series, magnitude
Note if we were to scale \ref{1} by $K$ and add a phase offset $\phi$ to the above relationship, we would get:
$$2K\cos(\omega t + \phi) = Ke^{j(\omega t + \phi)} + Ke^{-j(\omega t - \phi)}\tag{2}\label{2}$$
And walah! We see how the Fourier Transform of a cosine is complex conjugate symmetric with two impulses in frequency, one in the positive frequency axis and one in the negative frequency axis.
It is satisfying to review a plot of the sum of the two "spinning phasors" as given in equation $\ref{2}$, knowing that when we add such phasors geometrically, we place one on the end of the other and in doing this we see, in this case of complex conjugate symmetry, that the result will always stay on the real axis! The plot below is an example of this, showing the phasors given by $2K\cos(\omega t+\phi)$ with the phasors as shown where they would be at $t=0$. | {
"domain": "dsp.stackexchange",
"id": 11120,
"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": "frequency-spectrum, phase, fourier-series, magnitude",
"url": null
} |
c#, beginner, winforms, ms-word
SOLID Programming
SOLID is 5 object oriented design principles. SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable. This will help you design your objects and classes better.
The Single Responsibility Principle - A class should only have a single responsibility, that is, only changes to one part of the software's specification should be able to affect the specification of the class.
The Open–closed Principle - states software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
The Liskov Substitution Principle - Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
The Interface segregation principle - states that no client should be forced to depend on methods it does not use.
The Dependency Inversion Principle - is a specific form of decoupling software modules. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are reversed, thus rendering high-level modules independent of the low-level module implementation details.
Example
You also might want to look at this code review question that takes data from an excel spreadsheet and generates word documents as an example, the data and logic have been separated out in this question. | {
"domain": "codereview.stackexchange",
"id": 42726,
"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#, beginner, winforms, ms-word",
"url": null
} |
# Why do we represent complex numbers as the sum of real and imaginary parts?
We know complex numbers have a real and an imaginary part. We can visualize the imaginary part by adding another axis, hence a plane for both parts.
My question is really simple but may be unusual.
Why is the plus sign used to represent a complex number? $z=a+bi$. Is it just historically common to use the plus sign, or does one actually do arithmetic by using the sign? Why can't it be represented by a comma, for example, like a vector?
$z=a+bi$ versus $z=a,bi$
I'm really curious to know if $a+bi$ is a way of telling if the real and imaginary parts are connected or if it is a mathematical expression. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.970239909496136,
"lm_q1q2_score": 0.8227321648718715,
"lm_q2_score": 0.8479677622198946,
"openwebmath_perplexity": 214.85089410852518,
"openwebmath_score": 0.8767485618591309,
"tags": null,
"url": "https://math.stackexchange.com/questions/2365475/why-do-we-represent-complex-numbers-as-the-sum-of-real-and-imaginary-parts"
} |
newtonian-mechanics, forces, work, definition, conservative-field
So, our integral is just
$$\int_{t0}^{t1} (dV/dt) dt$$
Which is just simply a nice integration, V(r(t)) Evaluated at T1 and t0
=$$ V(R(t1)) - V(R(t0))$$
$$V(b) - V(a)$$
What does this mean? Well, this proves that my field is Conservative as my line integral is only dependant on the starting and end positions, (a and b), and not the path inbetween
Thus if, $F = \nabla V$ Then my field is Conservative
$$ or \nabla × (\nabla V ) = 0$$
$$\nabla×F = 0$$ | {
"domain": "physics.stackexchange",
"id": 84015,
"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, forces, work, definition, conservative-field",
"url": null
} |
According to Wikipedia https://en.wikipedia.org/wiki/Exponential_distribution, the sum, however, should be Gamma(2,$\lambda$) (in the ($\alpha,\beta$) parameterization).
What did I do wrong here? Was I too ambitious claiming $T_{N(t)}<T_{N(t)}+a<t \Leftrightarrow N(T_{N(t)})=N(T_{N(t)}+a)=N(t)$ ?
If the $\Leftarrow$ can not be claimed, then I can only get $P(A_t>a)>e^{-\lambda a}$. How should I get the distribution for $A_t$ in this case?
First Edit
I take the Poisson process as a limiting process of the Bernoulli process and arrive at the same conclusion $A_t\sim$ Exp($\lambda$). The key steps are as follows:
Step 1: Review the Law of Small Numbers for Bernoulli processes
Step 2: Let $t\in\mathbb{N}$ for the Bernoulli process $\{X_r^m\}_{r\in\mathbb{N}/m}$. Then by time $t$, there are a total of $mt$ trials, and $N^m(t)$ of them are successes. For $N^m(t)>0$, the time that the last success takes place, $T_{N^m(t)}$, takes any value between $\frac{1}{m},\frac{2}{m},...,t$. Let $k\in\mathbb{N}$ such that $0<k<mt$
$P(t-T_{N^m(t)}=\frac{k}{m})$
$=P($ the last $k+1$ trials of the total $mt$ trials are one success and $k$ failures $)$
$=p_m(1-p_m)^k$ | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9706877641608461,
"lm_q1q2_score": 0.8024790188475484,
"lm_q2_score": 0.8267117898012104,
"openwebmath_perplexity": 523.4992645740507,
"openwebmath_score": 0.9608923196792603,
"tags": null,
"url": "https://stats.stackexchange.com/questions/214248/age-and-residual-life-time-of-the-poisson-process?noredirect=1"
} |
Since you ended up using the fact that $\sin \theta \le \theta$ for all $\theta > 0$, let's see if we can use this from the outset. Since the function is odd with respect to $y$, it suffices to only consider $y \ge 0$ as you noticed. Then we have $$\frac{x\sin\frac{y}{\sqrt{x}}}{\sqrt{x^2+y^2}} \le \frac{y\sqrt{x}}{\sqrt{x^2+y^2}} \le \sqrt{x}$$ because $y \le \sqrt{x^2+y^2}$. In other words, the function is positive and bounded above by $\sqrt{x}$. From here, you can quite easily get to where you want.
-
Wolframalpha is not infallible. Your proof looks OK to me.
One trick that sometimes helps for problems like this is to write $y = ax$ and then examine your expression. In this case you get ${1 \over \sqrt{1 + a^2}} \sin (a \sqrt{x})$. Then you can use that $|\sin(\theta)| \leq |\theta|$ for all $\theta$, to get that it is bounded in absolute value by ${a \over \sqrt{1 + a^2}} \sqrt{x}$. Since $\big|{a \over \sqrt{1 + a^2}}\big|$ is at most 1, your expression's absolute value is at most $\sqrt{x}$, which goes to zero as $(x,y)$ approaches the origin. | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9626731126558705,
"lm_q1q2_score": 0.8293796663225192,
"lm_q2_score": 0.8615382058759129,
"openwebmath_perplexity": 135.50718147420633,
"openwebmath_score": 0.9620891809463501,
"tags": null,
"url": "http://math.stackexchange.com/questions/10322/multivariable-limit-lim-x-y-rightarrow-0-0-frac-x-siny-sqrtx"
} |
many-body, greens-functions, self-energy
=\psi_i(\vec r_1)
$$
Or
$$
(\omega - h(\vec r_1))\psi_i(\vec r_1) - \int d^3r_3 \Sigma(\vec r_1,\vec r_3)\psi_i(\vec r_3)
=\psi_i(\vec r_1)(\omega - E_i)
$$
Cancel the $\omega \psi_i(\vec r_1)$ from both sides and then multiply both sides by $-1$ to get:
$$
h(\vec r_1)\psi_i(\vec r_1) + \int d^3r_3 \Sigma(\vec r_1,\vec r_3)\psi_i(\vec r_3)
=\psi_i(\vec r_1)E_i
$$ | {
"domain": "physics.stackexchange",
"id": 58766,
"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": "many-body, greens-functions, self-energy",
"url": null
} |
electromagnetism, forces, magnetic-fields
Cited it from here
Moreover how can I determine the vectors of forces as the directions of the magnetic fields are reversed? I take the fingers of my right hand, and go from one vector into the other across the acute angle, often ninety degrees. My fingers would start pointing in the direction of the first vector I. Then curl into I becoming perpendicular to it and turning another ninety degrees to hit the next vector B. Then my thumb points down which is the resulting direction of cross product. You can experiment by realizing x direction cross y direction in standard 3D coordinates is in the z direction. (And z cross x is y, and z cross y is -x, and the opposite orders give opposite directions, ie y cross z is +x).
Yes the direction is always perpendicular to the plane of the two vectors being crossed. But that leaves two options for direction. Point fingers same as first vector. Curl them into being perpendicular to that first vector and heading toward the second vector, and right thumb points correct way.
Btw theres another situation where you know the axis, and the field or whatever circles around it. Like angular velocity vector, or angular acceleration, or the magnetic field made by a current in a wire (as distinct from force on a wire in a field).
In that case point your right thumb along the axis and your fingers curl around in the correct direction (the direction of the magnetic field encircling the wire, created by the current: or the way the thing is spinning if given angular velocity). | {
"domain": "physics.stackexchange",
"id": 81752,
"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, forces, magnetic-fields",
"url": null
} |
ions, solvents, aqueous-solution
Where $K_{15}$ is the ratio of conductivity of the sea water sample to that of potassium chloride (KCl) solution of mass fraction 32.4356x10$^{-3}$, at 15$^{o}$C and atmospheric pressure.
A formula is also provided for compensation of the conductivity measurement at different temperatures (see http://unesdoc.unesco.org/images/0004/000479/047932eb.pdf)
In 2010, the Intergovernmental Oceanographic Commission released "the international thermodynamic equation of seawater (TEOS-10)" in which it recommended a return to the use of "Absolute Salinity" to take into account variations in the composition of sea water which can occur for example in regions where rivers run into the ocean or where some other regional variability results in "anomalous" sea water composition.
The rational for this approach is based on understanding the effect each chemical component of seawater has on its thermodynamic properties such as density, pressure, temperature and Gibbs function. Various measures of salinity are defined and their relationships with thermodynamic properties described.
The Added-Mass Salinity, which incorporates the Reference Composition Salinity of "standard sea water" (the Practical Salinity Scale) with an adjustment for the Absolute Salinity Anomaly (mass fraction of material which must be added to standard seawater to achieve the concentration levels in the sample) is sometimes difficult to determine in-situ.
Modern techniques for determining Absolute Salinity involve taking various other measurements such as conductivity, temperature, pressure and density by incorporating measurements from sensitive electronic and optical instruments with data-driven computer algorithms.
The Density Salinity, which is the salinity argument in the thermodynamic expression for density which gives the sample's actual measured density, can be used where accurate measurements of density are available, such as a vibrating-tube densimeter or optical refractometer. When combined with Practical Salinity, temperature and pressure measurements, this can provide an accurate and easily determined measure of the amount of dissolved material in seawater (within a certain range). | {
"domain": "chemistry.stackexchange",
"id": 222,
"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": "ions, solvents, aqueous-solution",
"url": null
} |
ros2, moveit
Title: Issue with binary install of moveit2 with ROS2 Humble in Ubuntu 22.02
Hi. I am trying to install moveit2 with ROS2 Humble on Ubuntu 22.02, but I came across the issue https://github.com/ros-planning/moveit2/issues/1442. It says that version 2.5.3 was released about 5 days ago, but the ROS repository still only includes 2.5.1. Is there a way to know when will it be available? (I though replying to the issue, but I was afraid it would reopen the issue)
Originally posted by hcostelha on ROS Answers with karma: 230 on 2022-08-03
Post score: 0
There are two different repositories in ROS ecosystem, namely main and testing. The releases become available in testing repositories almost as soon as they merged to rosdistro (after they are compiled in build farm). They get synced in main repositories every month or so and become available for most people. You can follow the announcements in ROS discourse for syncs. A sample announcement is here: https://discourse.ros.org/t/preparing-for-rolling-sync-2022-07-15/26476. If you want to get access to latest releases before syncs happen you can build from source or use testing repositories. Please note testing repositories are bleeding edge and may contain regressions. To enable testing repositories, simply issue the following command in your terminal:
echo "deb http://packages.ros.org/ros2-testing/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2-latest.list
Originally posted by vatanaksoytezer with karma: 26 on 2022-08-03
This answer was ACCEPTED on the original site
Post score: 1 | {
"domain": "robotics.stackexchange",
"id": 37899,
"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": "ros2, moveit",
"url": null
} |
automata, finite-automata
Title: Non-Deterministic FSA to Deterministic FSA, Two initial states My method of conversion is by creating a reachable set tree and each set within the tree would represent the new states.
I have never dealt with FSAs that has 2 or more initial states. How do i create my reachable set tree with two or more states? The powerset construction converts an NFA to a DFA. You then "optimize" the result by removing states which cannot be reachable from the start state. When the NFA has multiple starting states, you do exactly the same thing. The starting state of the new DFA is the state corresponding to the set of starting states in the NFA (compare that to the usual case, in which the starting state of the DFA is the signleton consisting of the starting state of the NFA).
Given a DFA, you can compute the set of reachable states iteratively: the starting state is reachable; any state which it points to is reachable; any state which these point to is reachable; and so on. (Technically, this is known as BFS. There are also other algorithms, such as DFS.) | {
"domain": "cs.stackexchange",
"id": 2349,
"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": "automata, finite-automata",
"url": null
} |
electrostatics, electric-fields, charge, potential, vectors
We are comparing work on green path and red one. Lets draw two circles with centre at $dq$, one of arbitrary radius $r$ and the second with slightly larger radius $r+dr$. They crosses green path with $AB$ and red path with $CD$. You may have noticed, that $CD = dr$, while $AB$ is longer, since it isn't parallel to radius going through $A$ to $O$. Considering $dr << r$, the work done on $AB$ is $E_x \cdot AB = E\cos\theta \cdot AB = E \cdot AO = E \cdot dr$ which is the work on $CD$ ($\theta$ denotes $\measuredangle BAO$). So both paths can be divided into intervals of the same work, thus full work on them is the same as well. | {
"domain": "physics.stackexchange",
"id": 37645,
"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, electric-fields, charge, potential, vectors",
"url": null
} |
java, beginner, object-oriented, file, git
Random remarks about the code:
Since Joda-Time is already a dependency, it would be good to use it
too. That is, Timer contains way to many instances of raw numeric
calculations of time durations. That is exactly the kind of
calculation this library could make look better (and possibly more
accurate, if that were a concern). So, instead of
.plusSeconds(60 * 60 * 6 * ...), using .plusHours(6 * ...) would
be much more readable. In the same way I'd rather lookup the timezone
for Bangkok by name (forID), instead of hardcoding it to +7.
It's generally better to return the interface for generic collections,
not the specific implementation, e.g. List<LocalTime>. That way the
implementation can be changed while the method signature stays the
same.
getPostsPerDay has a number of problems: The constants are
redundant (org.joda.time.DateTimeConstants), they are wrong
(TUESDAY should be THURSDAY) and after fixing the Thursday bug,
the function will never return -1, as the library won't give out an
instance where that value is outside of the range. Even if it where,
returning -1 while printing to standard output would be wrong - the
better option is to raise an exception and deal with it (at least that
would currently be fine as the program would just do nothing
afterwards). In any case errors should be printed to standard error
(stderr), or rather, using a logging library would be good. Also
consider using a switch statement here with fall-through for the
first four days - that way you save a bit of typing/reading.
That said, if the code is improved a bit, consider posting it here again
to get more in-depth feedback - at this point I haven't even started to
look into the logic much.
Also consider looking into more libraries, e.g. a task scheduler which
could make the main loop redundant, file handling for the input,
logging, testing(!), ... | {
"domain": "codereview.stackexchange",
"id": 16686,
"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, beginner, object-oriented, file, git",
"url": null
} |
kinematics, inverse-kinematics, matlab, python, jacobian
Below is my Python code, which goes into an infinite loop and gives no results. I've looked over the differences between it and the MATLAB code, and they look the exact same to me. I have no clue what is wrong. I would be forever grateful if somebody could take a look and point it out.
def sendArm(xGoal, yGoal, zGoal, right, lj):
ycurrent = xcurrent = zcurrent = 0
theta1 = 0.1
theta2 = 0.1
theta3 = 0.1
xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
xchange = xcurrent - xGoal
zchange = zcurrent - zGoal
while ((xchange > 0.05 or xchange < -0.05) or (zchange < -0.05 or zchange > 0.05)):
in1 = 0.370*math.cos(theta1) #Equations in1-6 are in the pdf I linked to you (inv kinematics section)
in2 = 0.374*math.cos(theta1+theta2)
in3 = 0.2295*math.cos(theta1+theta2+theta3)
in4 = -0.370*math.sin(theta1)
in5 = -0.374*math.sin(theta1+theta2)
in6 = -0.2295*math.sin(theta1+theta2+theta3)
jacob = matrix([[in1+in2+in3,in2+in3,in3],[in4+in5+in6,in5+in6,in6], [1,1,1]]) #Jacobian
invJacob = inv(jacob) #inverse of jacobian
xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
xIncrement = (xGoal - xcurrent)/100 #dx increment
zIncrement = (zGoal - zcurrent)/100 #dz increment | {
"domain": "robotics.stackexchange",
"id": 1382,
"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": "kinematics, inverse-kinematics, matlab, python, jacobian",
"url": null
} |
ros, meta, answers.ros.org
Title: Is ROS answer able to join stackexchange?
Because I can use stackexchange's function to see message on whatever board.
If ROS answer can join them, I can receive notice message on any of stackexchange board.
Thank you~
Originally posted by sam on ROS Answers with karma: 2570 on 2011-12-17
Post score: 4
No, OSQA/Askbot is not compatible with Stackexchange.
If you are explicitly looking for a Robotics QNA site on Stackexchange, Robotics Research is in the commitment phase of it's launch currently. It is not a ROS community like this one is, but a more general robotics QNA hosted on stack exchange.
Originally posted by mjcarroll with karma: 6414 on 2011-12-18
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by mjcarroll on 2011-12-19:
I don't think there is any fix to this. Some people just don't agree with the way that Stack Exchange works, and want more control over their communities. I don't think that it is a high priority for either OSQA/Askbot or Stack Exchange to add this feature.
Comment by sam on 2011-12-18:
Is there any way to suggest them to fix this uncompatible? If yes,this way will also attract more people to use stackexchange.
Comment by bit-pirate on 2012-07-04:
What's the big difference between both? From my user point of view they do the same thing - I can ask questions and people answer. I also think adding the ROS Q&A to stack exchange would be a good idea!
Comment by Orhan on 2016-08-16:
Now, robotics.stackexchange.com is the general robotics platform in stack exchange. | {
"domain": "robotics.stackexchange",
"id": 7678,
"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, meta, answers.ros.org",
"url": null
} |
python, gui, tkinter, framework, tk
self.window.resizable(self.get('rx')['resizex'],
self.get('ry')['resizey'])
self.window.geometry('%s' % self.get('res')['resolution'])
self.window.overrideredirect(0)
if self.get('fs')['fullscreen'] == 'True':
self.window.geometry('%s' % self.get('screenres')['screenres'])
self.toggleFullscreen(None)
self.window.update()
### this function changes the window to be fullscreen or normal ###
def toggleFullscreen(self, event=None):
if self.get('fullscreen')['fullscreen'] == 'True' and event:
self.set(fs = False)
self.window.overrideredirect(0)
return
if self.get('fullscreen')['fullscreen'] == 'False' and event:
if event: self.set(fs = True)
self.window.overrideredirect(1)
self.window.geometry('%sx%s+0+0'
% (self.winfo_screenwidth(),
self.winfo_screenheight()))
return
if not event:
if self.get('fullscreen')['fullscreen'] == 'True':
self.window.overrideredirect(1)
self.window.geometry('%sx%s+0+0'
% (self.winfo_screenwidth(),
self.winfo_screenheight()))
else:
self.window.overrideredirect(0)
self.window.update()
### last-minute cleanup before closing the window ###
def closing(self):
#self.set(fs=False)
self.window.destroy()
### set the values in settings file to keyword arguments ###
def set(self, **kwargs): | {
"domain": "codereview.stackexchange",
"id": 35653,
"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, gui, tkinter, framework, tk",
"url": null
} |
ros2, message-filters
I get this error-
/home/hsharma/Documents/internship/ws/ros2_ws/src/stereo_ground_surface/obstacle_detection/src/multisense_subscriber.cpp: In constructor ‘MultiSenseSubscriber::MultiSenseSubscriber(const string&)’:
/home/hsharma/Documents/internship/ws/ros2_ws/src/stereo_ground_surface/obstacle_detection/src/multisense_subscriber.cpp:68:120: error: use of deleted function ‘message_filters::Subscriber<sensor_msgs::msg::Image_<std::allocator<void> > >::Subscriber(const message_filters::Subscriber<sensor_msgs::msg::Image_<std::allocator<void> > >&)’
: Node(name), image_sub_(message_filters::Subscriber<sensor_msgs::msg::Image>(this, "/multisense/left/image_color"))
^
In file included from /home/hsharma/Documents/internship/ws/ros2_ws/src/stereo_ground_surface/obstacle_detection/src/multisense_subscriber.cpp:10:0:
/opt/ros/eloquent/include/message_filters/subscriber.h:102:7: note: ‘message_filters::Subscriber<sensor_msgs::msg::Image_<std::allocator<void> > >::Subscriber(const message_filters::Subscriber<sensor_msgs::msg::Image_<std::allocator<void> > >&)’ is implicitly deleted because the default definition would be ill-formed:
class Subscriber : public SubscriberBase, public SimpleFilter<M>
^~~~~~~~~~ | {
"domain": "robotics.stackexchange",
"id": 35414,
"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": "ros2, message-filters",
"url": null
} |
opencv, cv-bridge
Original comments
Comment by ahendrix on 2014-05-30:
Are any images published on the /image_converter/output_video topic? You should be able to verify that images are being published with rostopic hz or rostopic echo
Comment by lanyusea on 2014-05-30:
@ahendrix nothing... I ran rostopic echo /image_converter/output_video but got nothing. I think the subscribe of video topic failed.
Comment by lanyusea on 2014-05-30:
I guess maybe the image_transport matters because when I subscribe I just use the code image_sub_ = it_.subscribe("/camera/image", 1, &ImageConverter::imageCb, this); while for image_view, I need to set _image_transport=compressed to see the video. But I don't know what to change here...
Comment by lanyusea on 2014-05-31:
@ahendrix Thanks so much! it works, but could you teach me how to find the parameter need to remap? first I searched the source and wiki of image_transport and cv_bridge with key workcompressed, but I got nothing... I really want to know how to get the answer when I face that kind of problem
Comment by ahendrix on 2014-06-02:
to be honest, I'm not sure what the appropriate parameter to change here is. I suspect it's namespaced to the topic name, but I'd have to read the source for image_transport to really understand it.
Comment by lanyusea on 2014-06-03:
@ahendrix Thanks again, I read the document again and now I can understand it much better. Also, could you convert it into the answer so I can mark it as the correct one.
Try constructing your listener with the extra argument specifying the transport hint:
image_sub_ = it_.subscribe("/camera/image", 1, &ImageConverter::imageCb, this, image_transport::TransportHints("compressed"));
Originally posted by ahendrix with karma: 47576 on 2014-05-30
This answer was ACCEPTED on the original site
Post score: 2 | {
"domain": "robotics.stackexchange",
"id": 18099,
"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": "opencv, cv-bridge",
"url": null
} |
homework-and-exercises, general-relativity, differential-geometry, vector-fields
The last inequality is immediate using the fact that $A^0, B^0 >0$ and proving it into the equivalent version
$$(A^0B^0 - ||\vec{A}||||\vec{B}||)^2 \geq ((A^0)^2- ||\vec{A}||^2)(B^0)^2- ||\vec{B}||^2)$$
whose proof is immediate because it boils down to
$$(A^0||\vec{B}||-B^0||\vec{A}||)^2\geq 0\:.$$ $ \Box$
Finally we observe that $-p_\mu p^\mu = m^2$ and it concludes the proof, using $A=p$ and $B=K$.
PS. There is an even shorter proof. Arrange a pseudo-orthonormal basis with $e_0 \parallel A$. In this frame $-A_\mu B^\mu = A^0B^0 = \sqrt{-A_\mu A^\mu}\sqrt{(B^0)^2} \geq \sqrt{-A_\mu A^\mu}\sqrt{(B^0)^2- ||\vec{A}||^2} = \sqrt{-A_\mu A^\mu}\sqrt{-B_\mu B^\mu}$.
The result is valid in general because the left-most and the right-most terms are invariant. | {
"domain": "physics.stackexchange",
"id": 92069,
"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": "homework-and-exercises, general-relativity, differential-geometry, vector-fields",
"url": null
} |
matlab, audio, video-processing, matlab-cvst
Here's the portion that matches multiple audio samples to a single video frame.
Note that there are 697 video frames and 1336321 audio samples. Some basic fiddling to ensure proper matching. The audio subsampling effect is imperceptible in the output AVI files that I tried.
numAudio = size(signal,1);
numRep = floor(numAudio/length(frames));
numDiff = numAudio - numRep*length(frames); % mismatch
if numDiff
% if length(frames) does not evenly divide nAudioSamples, then
% subsample audio to match numRep*length(frames)
selector = round(linspace(1, numAudio, numRep*length(frames)));
subSignal = signal(selector, :);
end
assert(numRep*length(frames) == size(subSignal,1));
Finally, we use the VideoFileWriter object available in the Computer Vision System Toolbox of MATLAB to write audio and video to file.
videoFWriter = vision.VideoFileWriter(fullfile(shotPath, 'avclip', ...
[num2str(shotNum) '_av_clip.avi']), ...
'AudioInputPort', true, ...
'FrameRate', annot.video.frame_rate);
for i = 1:length(frames)
fprintf('Frame: %d/%d\n', i, length(frames));
step(videoFWriter, frames{i}, subSignal(numRep*(i-1)+1:numRep*i,:));
end
release(videoFWriter); | {
"domain": "dsp.stackexchange",
"id": 6220,
"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": "matlab, audio, video-processing, matlab-cvst",
"url": null
} |
fft, gnuradio
Title: Why am I seeing a negative frequency on FFT graph in Gnu Radio Companion? I have a pretty simple flow here in GRC, but for some reason I'm seeing a negative frequency mirroring the 10khz signal that I'm generating. What's causing this negative frequency to show up in the FFT graph? The stock FFT (in GNU radio?) is a complex-to-complex transform. Thus any positive frequency peak you see represents a complex signal (phasor) that can include both real and imaginary components.
Since your cosine (or sine) waveform is strictly real (has zero or no imaginary component), the complex FFT result also includes a negative complex conjugated mirror image. Since complex conjugation inverts the imaginary component, the two imaginary components (of the positive and negative frequency peaks) cancel out, and thus represent your original strictly real signal (with zero imaginary content). That is why you see a negative frequency peak.
An asymmetric result can occur if you feed the FFT with a complex IQ signal that has non-zero imaginary components (for instance, baseband SSB). Thus, if you want to see only a positive frequency peak, then you need to feed your FFT with a positive rotating IQ signal or phasor (cos(t) + i sin(t), IIRC). | {
"domain": "dsp.stackexchange",
"id": 6701,
"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, gnuradio",
"url": null
} |
c++, snake-game
...
void Snake::step(coordinates position, ...) {
body.erase(body.begin());
body.push_back(position);
...
}
Use std::deque for the body coordinates
The body of the snake is added to from one end, and removed from from the other end. A std::vector is not the best container in this case, because it can only efficiently dd and remove from the back. The std::deque class does provide efficient insertion and removal from both ends, and provides easy functions for that:
class Snake {
std::deque<coordinates> body;
...
};
void Snake::step(coordinates position, ...) {
body.pop_front();
body.push_back(position);
...
}
Avoid using std::endl
Prefer writing "\n" instead of std::endl. The latter is equivalent to the former, but also forces a flush of the output, which can be bad for performance. For more details, see this question.
Use range-for where appropriate
Assuming you can use C++11 features, try to use range-based for-loops where possible. For example, looping over the elements of the snake's body can be done so:
for (auto &element: body) {
if (element.x == position.x && element.y == position.y) {
...
}
}
Separate logic from presentation
Your class Snake encapsulates the logic of the snake's body, but it also prints a game over message. You should try to separate logic from presentation where possible. The function Snake::step() should just check whether the step is valid or not, and return a value indicating this. The caller can then decide whether or not to print a game over message. For example:
bool Snake::step(coordinates position) {
body.pop_front();
body.push_back(position);
for (auto &element: body) {
if (element.x == position.x && element.y == position.y) {
return false;
}
}
return true;
}
... | {
"domain": "codereview.stackexchange",
"id": 39117,
"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++, snake-game",
"url": null
} |
research-level, quantum-hall-effect
Now it is clear that all the zero energy state are given by symmetric polynomial
that satisfy $P(z_1,...,z_N)=0$ if any pair of bosons coincide $z_i=z_j$.
For symmetric polynomial this implies that
$P(z_1,...,z_N) \sim (z_i-z_j)^2$ when $z_i$ is near $z_j$.
The Laughline wave function $P_0=\prod_{i<j}(z_i-z_j)^2$ is one of the symmetric
polynomials that satisfies the above condition and is a zero energy state.
Since any other zero-energy symmetric
polynomial must satisfy $P(z_1,...,z_N) \sim (z_i-z_j)^2$, $P/P_0=P_{sym}$ has no poles and is a well defined symmetric
polynomial. So every zero-energy eigenstate $P$ is of the form of a symmetric polynomial $P_{sym}$ times the Laughlin wave function $P_0$.
More discussions can be found in the first part of arXiv:1203.3268.
However, a physically more relevant math question is: Every energy eigenstate
below a certain finite energy gap $\Delta$ is of the form of a symmetric polynomial times the Laughlin wave function for any number $N$ of particles.
(Here $\Delta$ does not depend on $N$.)
We only have numerical evidences that the above statement is true, but no proof. | {
"domain": "physics.stackexchange",
"id": 3603,
"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": "research-level, quantum-hall-effect",
"url": null
} |
reinforcement-learning, actor-critic-methods, exploration-exploitation-tradeoff
Title: What is the purpose of the actor in actor-critic algorithms? For discrete action spaces, what is the purpose of the actor in actor-critic algorithms?
My current understanding is that the critic estimates the future reward given an action, so why not just take the action that maximizes the estimated return?
My initial guess at the answer is the exploration-exploitation problem, but are there other, more important/deeper reasons? Or am I underestimating the importance of exploration vs. exploitation as an issue?
It just seems to me that if you can accurately estimate the value function, then you have solved the RL challenge.
For discrete action spaces, what is the purpose of the actor in Actor-Critic algorithms?
In brief, it is the policy function $\pi(a|s)$. The critic (a state action function $v_{\pi}(s)$) is not used to derive a policy, and in "vanilla" Actor-Critic cannot be used in this way at all unless you have the full distribution model of the MDP.
It just seems to me that if you can accurately estimate the value function, then you have solved the RL challenge.
Often this can be the case, and this is how e.g. Q-learning works, where the value function is more precisely the action value function, $q(s,a)$.
Continuous or very large action spaces can cause a problem here, in that maximising over them is impractical. If you have a problem like that to solve, it is often an indicator that you should use a policy gradient method such as Actor-Critic. However, you have explicitly asked about "discrete action spaces" here.
The main issue with your statement "if you can accurately estimate the value function" is that you have implicitly assumed the the learning is complete. You are looking at the final output of the algorithm, after it has converged, and asking why not use just half of its output. Whilst choosing between RL algorithms is more often related to how they learn, how efficiently they learn, and how they behave during the learning process.
My current understanding is that the critic estimates the future reward given an action, so why not just take the action that maximizes the estimated return? | {
"domain": "ai.stackexchange",
"id": 1143,
"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": "reinforcement-learning, actor-critic-methods, exploration-exploitation-tradeoff",
"url": null
} |
# How do you deduce that matrices are equal
i wanted to ask for a clarification.
I was looking around in my linear algebra text when i reached this justification:
Considered two coloumn vectors $$X$$ and $$Y$$, and assume $$X ^tC Y = X^t C^t Y$$ for every $$X,Y \in V$$, with $$V$$ an $$n$$-dimensional vectorial space, with $$X^t, Y^t$$ being the transposed of $$X, Y$$.
My book says that because of this is valid for every $$X,Y$$, we can deduce: $$C^t = C$$
Now, it is intuitively true, but i was wondering if ,maybe the general sum (it's a bilinear form) could equals without needing $$C^t = C$$. I've seen this type of justification also in other theorems, but i want to know if there is a way to prove it formally, beacuse i'm not satisfied.
• See what happens if $X=e_i$ and $Y=e_j$ ($i$-th and $j$-th standard basis vectors of $V$). Oct 23 at 0:32
• What does this have to do with the “null” in the title? Oct 23 at 0:40
• The transpose of a linear transformation doesn’t make sense over a general vector space. But it does make sense if the vector space is given an inner product. Oct 23 at 0:43
• Sorry, language translations Oct 23 at 0:45
since these are column vectors, evidently $$V=\mathbb F^n$$
select $$n$$ linearly independent vectors $$\mathbf x_k$$ and $$n$$ linearly independent $$\mathbf y_k$$ (if you like you can set $$\mathbf y_k:=\mathbf x_k$$) | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.98527138442035,
"lm_q1q2_score": 0.8334828801736328,
"lm_q2_score": 0.8459424411924673,
"openwebmath_perplexity": 176.88681712131978,
"openwebmath_score": 0.9437273144721985,
"tags": null,
"url": "https://math.stackexchange.com/questions/4284669/how-do-you-deduce-that-matrices-are-equal"
} |
gravity, space, orbital-motion, material-science, free-fall
Because the acceleration is larger at the bottom, the cable will remain stretched at the top, and only the portion of the cable that falls to the surface will bend and form loops.
However, there is another fictitious force in the reference frame, the Coriolis force, $-2m\Omega\times v$. Before the cable starts to fall/move, the Coriolis force is zero because it's proportional to the velocity $v$ of the segment of the cable. Once the cable starts to fall, $v$ goes towards the Earth's center. $\Omega$ is the Earth's spin, so the vector goes along the Earth's axis. The cross product is tangential to a circle concentric with the equator.
In other words, as the cable starts to increase the velocity in the downward direction, the Coriolis force will try to bend it in the shape of a "spiral" inside the equatorial plane. Some sign calculations would be needed to calculate the direction in which the cable would be bent. The precise shape of the bent cable would require one to solve a partial differential equation depending on two variables (time, spatial coordinate along the cable). It is probably hard enough – and would surely be affected the distribution of the mass in the cable.
Nevertheless, I am confident that the Coriolis force would only bend the cable and wouldn't change the qualitative behavior, namely the conclusion that the cable ultimately falls to the surface, distributed along a piece of the equator. Of course, the result would also depend on whether or not the cable may easily bend (like a rope) or whether it's more solid etc. | {
"domain": "physics.stackexchange",
"id": 5950,
"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": "gravity, space, orbital-motion, material-science, free-fall",
"url": null
} |
gravity, forces, mass, dark-energy
Title: Does dark energy work like gravity, but the opposite way? If a body has more mass gravity will exert a greater force on it.
Does that apply also to dark energy? In other words, if a body has more mass, will it be affected more by dark energy? (that is, will it be pushed with a greater acceleration from another body)? Dark energy is a concept devised to help explain the expansion of the universe. It is presumed to comprise about 68% of the universe (on a mass-equivalence basis), but it is spread so uniformly throughout the universe that its density is on the order of only 10 to the minus 27 kilogram per cubic meter.
Dark energy is not presumed to clump in matter, but rather to exist as a uniform distribution, either as a cosmological constant invariable through time, or as a scalar field that may change with time and/or vary with position.
As dark energy provides negative pressure, rather than attractive pressure, it acts against gravity. But because its density is sparse and uniform throughout space, it would seem to have no measurable effect on, or in the immediate vicinity of, massive objects. If dark energy clumped within massive objects, I would expect the apparent expansion of the universe to be less than otherwise, as all objects, including we and our measuring instruments, might be expanding along with or even more rapidly than space. In that case, space might appear to us to be contracting.
In other words, if dark energy is uniformly distributed throughout space, without regard to the presence of ordinary mass, one can NOT say that the amount of dark energy within the space occupied by a massive object is greater than the amount of dark energy within the space occupied by a less massive object.
So, to answer your question, NO, not necessarily. | {
"domain": "physics.stackexchange",
"id": 26416,
"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": "gravity, forces, mass, dark-energy",
"url": null
} |
c, game, error-handling, memory-management
void place_entities_on_board(t_board *board) {
// First draw Player (S)
t_entity *player = &board->entities[board->player_index];
// 'A' always stays on top of 'S' when they overlap
if (get_cell_at(board, player->pos.x, player->pos.y) != 'A')
set_cell_at(board, player->pos.x, player->pos.y, 'S');
// Then draw Monsters (M) in reverse (right-to-left)
// to satisfy the condition that monsters seen earlier
// should appear before monsters seen at a later point
// in case some monsters overlap at a single position
for (int i = board->num_entities - 1; i >= 0; i--) {
t_entity ent = board->entities[i];
char symbol = ' ';
if (ent.type != MONSTER)
continue;
symbol = map_direction_to_char(ent.facing_dir);
set_cell_at(board, ent.pos.x, ent.pos.y, symbol);
}
}
void print_board(t_board *board, FILE *output) {
place_entities_on_board(board);
for (int row = 0; row < board->num_rows; row++) {
for (int col = 0; col < board->col_size; col++) {
char c = board->cells[row][col];
if (c != 0)
fputc(c, output);
}
fputc('\n', output);
}
clear_entities_from_board(board);
}
void get_board_dims(char *buf, int *num_rows, int *col_size) {
int num_lines = 0;
int longest_line_len = 0;
char* buf_copy = strdup_(buf);
char* pch = strtok(buf_copy, "\n");
while (pch != NULL) {
num_lines++; | {
"domain": "codereview.stackexchange",
"id": 42016,
"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, game, error-handling, memory-management",
"url": null
} |
differential-geometry, metric-tensor, coordinate-systems, tensor-calculus
Title: Question on reciprocal metric tensor First of all, to simplify we will assume 2 dimensional space with a symmetrical metric tensor $g_{\mu\nu}$
It's known that d'Alembert operator (we will use it for example) is defined as $\partial_\nu \partial^\nu$, where $\partial^\nu=g^{\mu\nu}\partial_\mu$, in flat spacetime we define it as
$$\partial_x^2-\partial_t^2.$$
In general case we have
$$g_{\mu\nu}=\begin{bmatrix}
g_t & g_{tx} \\
g_{tx} & g_x
\end{bmatrix}.$$
So, d'Alembert is
$$\frac{\partial_t^2}{g_t}+\frac{\partial_x^2}{g_x}+2\frac{\partial_t\partial_x}{g_{tx}}.$$
In flat spacetime $g_{tx}=0$, so we have an indeterminate result, how do we deal with it? In general, the components of the dual metric $\tilde g$ are not the reciprocals of the components of the metric $g$. That is, $\tilde g^{\mu\nu}\neq 1/g_{\mu\nu}.$ Instead, they are the components of the matrix inverse of $g$, such that $\tilde g g = g\tilde g = \pmatrix{1&0\\0&1}$. In two dimensions, we have that
$$\tilde g = \pmatrix{g_{11} & g_{12} \\ g_{12} & g_{22}}^{-1} = \frac{1}{g_{11} g_{22} - g_{12}^2}\pmatrix{g_{22} & -g_{12} \\ -g_{12} & g_{11}}$$ | {
"domain": "physics.stackexchange",
"id": 89806,
"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": "differential-geometry, metric-tensor, coordinate-systems, tensor-calculus",
"url": null
} |
java, array
contact.welcome();
/**
* While loop created to bring up user's choices - loop written by
* Daniela Villalobos
*/
while (action != 6) {
contact.menu();
reader = new Scanner(System.in);
reader.useDelimiter("\n");
action = reader.nextInt();
/*
* DV - if statement permits only actions 1-6 to execute a case
*/
if (action <= 0 || action > 6) {
System.out.println("Invalid selection. ");
}
/**
* Switch statement written by Daniela Villalobos
*/
switch (action) {
case 1: {
/**
* Gets users contact information and adds the contact as a
* string in our contact arraylist. - written by Daniela
* Vallalobos.
*/
ContactArray.getContact();
break;
}
/**
* Prints out all records from file in alphabetical order
*/
case 2: {
contact.printContacts();
/**
* Reads contacts from file, sorts and prints them to console.
*/
break;
}
/**
* Ask's user to search for a lastname. Matches user input to record
* of contacts, and prints out matching contact. - Coded by Seth &
* Damani
*/
case 3: {
System.out.println("\nEnter the last" + "name to search for: ");
/**
* Gets the searchterm from the user and Matches user input to
* existing contact records.
*/
FileOperations.match();
break;
}
/**
* Ask's user to search for a email. Matches user input to record of
* contacts, and prints out matching contact. - Coded by Seth &
* Damani
*/
case 4: {
System.out.println("\nEnter the email "
+ "address to search for: ");
/**
* Gets the searchterm from the user and Matches user input to
* existing contact records.
*/
FileOperations.match();
break;
} | {
"domain": "codereview.stackexchange",
"id": 3421,
"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, array",
"url": null
} |
cmake
Title: CMake module to make executable as small as possible I wrote this .cmake script when I needed to make smallest possible executables. It makes CMake prefer static libraries, and adds custom command to strip and UPX the end result. I used it only with MinGW on Windows with MSYS2.
My questions:
Can this be made more short and readable?
Are my checks portable enough?
Any way to handle MSVC?
example main.c
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
if(!glfwInit())
return EXIT_FAILURE;
GLFWwindow *window = glfwCreateWindow(1024, 768, "Hello World", NULL, NULL);
if(!window)
{
glfwTerminate();
return EXIT_FAILURE;
}
glfwMakeContextCurrent(window);
glfwSwapInterval(1);
glewExperimental = GL_TRUE;
GLenum code = glewInit();
if(code != GLEW_OK)
{
fprintf(stderr, "[GLEW Error](%d): %s\n", code, glewGetErrorString(code));
return EXIT_FAILURE;
}
}
example CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(staticExe LANGUAGES C)
include(${PROJECT_SOURCE_DIR}/cmake/ReallySmall.cmake)
prefer_static_libs()
find_package(GLEW REQUIRED)
find_package(GLFW3 NAMES glfw glfw3 REQUIRED)
restore_preferred_libs()
find_package(OpenGL REQUIRED)
set(INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${GLFW3_INCLUDE_DIR})
set(LIBS GLEW::GLEW ${GLFW3_LIBRARY} ${OPENGL_gl_LIBRARY})
add_executable(${PROJECT_NAME} WIN32 main.c) | {
"domain": "codereview.stackexchange",
"id": 16662,
"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": "cmake",
"url": null
} |
c++, game, design-patterns, entity-component-system, glfw
A typical solution to the second problem is to never shuffle entries around; this way you avoid invalidating indexes. However, that will create holes in your array or vector. You want to be able to reuse those efficiently, so you can have another vector keep track of the unused indexes in the other vectors.
Consider listening for events instead of polling state
Your code seems to be geared towards polling the state of all the keys you are interested in, every time callbackAll() is called. I assume that will be once per frame. However, most frames nothing will change, and if something changes it most likely be one or two keys at a time. However, with your approach you have to call glfwGetKey() for all keys you are interested in for every frame, and then you also call all registered callback functions every frame, regardless of any activity. All these function calls do have some cost.
Instead, consider having your KeyboardManager call glfwSetKeyCallback() so it will get notified when a key's state has changed. Then it can look up if any of the subscribers are interested in that key, and only then call the registered callback functions of those subscribers. A similar thing can be done with mouse events. Once a frame you have to call glfwPollEvents(), probably at the point where you called the callbackAll() functions before.
Answers to your questions | {
"domain": "codereview.stackexchange",
"id": 44884,
"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++, game, design-patterns, entity-component-system, glfw",
"url": null
} |
# What will be the value of the following determinant without expanding it?
$$\begin{vmatrix}a^2 & (a+1)^2 & (a+2)^2 & (a+3)^2 \\ b^2 & (b+1)^2 & (b+2)^2 & (b+3)^2 \\ c^2 & (c+1)^2 & (c+2)^2 & (c+3)^2 \\ d^2 & (d+1)^2 & (d+2)^2 & (d+3)^2\end{vmatrix}$$
I tried many column operations, mainly subtractions without any success.
• Who comes up with a problem like this?? – imranfat Oct 4 '16 at 18:34
• If I get a constant in a column can it help somehow? – Zauberkerl Oct 4 '16 at 18:38
• This exercise can be found in Golan's book It is Exercise 641 in the 2012 edition and Exercise 584 in the 2007 edition. (BTW it is good to add also source of the problem when posting the question.) – Martin Sleziak Oct 5 '16 at 4:22
• This is also a particular case of Exercise 36 (a) in my Notes on the combinatorial fundamentals of algebra ( web.mit.edu/~darij/www/primes2015/sols.pdf ) in the version of 6 October 2016. (If the numbering changes, see the frozen version of 4 September 2016, at github.com/darijgr/detnotes/releases/tag/2016-09-04 .) Exercise 36 (a) is, in turn, a particular case of Exercise 36 (c). – darij grinberg Oct 7 '16 at 22:39 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9736446479186303,
"lm_q1q2_score": 0.8388320648592148,
"lm_q2_score": 0.8615382076534743,
"openwebmath_perplexity": 232.25404886669062,
"openwebmath_score": 0.8706985116004944,
"tags": null,
"url": "https://math.stackexchange.com/questions/1953843/what-will-be-the-value-of-the-following-determinant-without-expanding-it/1953852"
} |
ros, c++, ros-kinetic, services, array
Regards.
Originally posted by Weasfas with karma: 1695 on 2020-08-06
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by gvdhoorn on 2020-08-06:
I would perhaps even suggest using a range-based for-loop instead.
Comment by LukeAI on 2020-08-06:
Weasfas answered my question, as stated. but using the range-based for-loop is what I really wanted. I didn't realise the an array in a msg or srv was a std vector.
Comment by gvdhoorn on 2020-08-06:
http://wiki.ros.org/msg#Fields | {
"domain": "robotics.stackexchange",
"id": 35378,
"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, c++, ros-kinetic, services, array",
"url": null
} |
triangle and perpendicular to its …. Identify and divide the complex shape into basic shapes for easier computation of moment of inertia. Moment of Inertia of an Equilateral Triangle with Pivot at one Vertex. 4a + 3l ) 8l 0 In a similar manner it can be shown that the moment of inertia of a uniform solid triangular prism of mass m, length 2l, cross section an equilateral triangle of side 2a about an axis through 2 1 2 ) its …. 2 a) Determine the centroidal polar moment of inertia of a circular area by direct integrationarea by direct integration. 16, is given by and moment of inertia …. 15 Centroid and Moment of Inertia Calculations An Example ! Now we will calculate the distance to the local centroids from the y-axis (we are calculating an x-centroid) 1 1 n ii i n i i xA x A = = = ∑ ∑ ID Area x i (in2) (in) A 1 2 0. Part A Suppose a uniform slender rod has length L and mass m. Let the final object have mass m. The moment of inertia of a uniform rod about an axis perpendicular to the rod and through the center …. Using the parallel axis theorem, you can find the moment of inertia about the center by subtracting M r 2, where r is ( 2 / 3) h. Right answer / -L The moment of inertia of an equilateral triangular plate about the axis passing through its centre of mass and lying in the plane is I. The unit of inertia of mass, 24. A piece of thin wire of mass m and length 3a is bent into an equilateral triangle. Seven and three are Ten, and this is said to be the most Sacred and Complete of all, since it represents a return from One to the Primal Nothing of the Beginning. The axis perpendicular to its base. Equilateral triangle; Section Area Moment of Inertia Properties Oblique Triangle. Therefore, height of an equilateral triangle (h) = (√3 / 2) x a = (√3 / 2) x 2 = 1. (i) Moment of inertia of a circular ring about an axis passing through its centre and perpendicular to the plane of the ring: Fig. The positions of the mass m 1, m 2 and m | {
"domain": "thorstenharte.de",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9850429151632047,
"lm_q1q2_score": 0.8271739935020114,
"lm_q2_score": 0.8397339656668287,
"openwebmath_perplexity": 265.07878507484645,
"openwebmath_score": 0.5668525099754333,
"tags": null,
"url": "https://thorstenharte.de/moment-of-inertia-of-an-equilateral-triangle-about-its-center.html"
} |
symmetry, fourier-transform, complex-numbers
We could have written all of this stuff in vector notation and it would make a few conceptual issues super-duper clear, but that's a topic for another post (on Math.SE, probably).
Fourier is too much info
The Fourier transform actually contains redundant information if the the original function is purely real valued.
If $\phi(t) \in \mathbb{R}$, then it turns out that the negative frequency components in the Fourier transform are just the complex conjugates of the positive parts, i.e. $\tilde{\phi}(-\omega) = \tilde{\phi}(\omega)^*$.
Because of this, we can rewrite a Fourier representation of a real signal in terms of only positive frequency parts:
\begin{align}
\phi(t)
=& \int_{-\infty}^\infty \frac{d\omega}{2\pi} \tilde{\phi}(\omega)e^{i \omega t} \\
=& \int_0^\infty \frac{d\omega}{2\pi} \tilde{\phi}(\omega)e^{i \omega t}
+ \int_{-\infty}^0 \frac{d\omega}{2\pi} \tilde{\phi}(\omega)e^{i \omega t} \\
=& \int_0^\infty \frac{d\omega}{2\pi} \tilde{\phi}(\omega)e^{i \omega t}
+ \int_0^\infty \frac{d\omega}{2\pi} \tilde{\phi}(-\omega)e^{-i \omega t} \\
=& 2 \text{Re} \left[ \int_0^\infty \frac{d\omega}{2\pi} \tilde{\phi}(\omega) e^{i \omega t}\right] \, .
\end{align}
So what's up with Hartley?
An arbitrary signal has an amplitude and phase at each frequency. | {
"domain": "physics.stackexchange",
"id": 27635,
"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": "symmetry, fourier-transform, complex-numbers",
"url": null
} |
homework-and-exercises, newtonian-mechanics, angular-momentum
Title: What is the inertia caused by angular momentum when twisted on it's rotating axis? I would like to provide a more thorough answer to this question here
https://aviation.stackexchange.com/q/3709
but I realized I don't know enough about angular momentum. If an airplane wheel is rotating at 100 rpm, and the wheel weighs 10kg, with a diameter of 50cm and a uniform mass (approximations applicable to a standard small aircraft), what is the difference in force necessary to bring the plane to 20 degrees of bank as opposed to when the wheels are stopped?
I know that this involves calculating angular momentum, which I have at 5kgm/s per wheel, so 10kgm/s total, I'm just not sure how I would quantify the affect of this angular momentum when trying to bank the aircraft 20 degrees over a course of 5 seconds (replicating first turn in the airport pattern).
I bet the following terms are involved: $\sin(20), 5s, 10kgm/s.$
Not sure if it's relevant, but we can assume the aircraft wheels are suspended 1 meter below the aircraft. You asked for it.
Here is how you find the forces and moments acting on the wheel from the plane to gauge the effect of spin. Reverse the sign to find the forces acting to the plane by the wheel. | {
"domain": "physics.stackexchange",
"id": 13550,
"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": "homework-and-exercises, newtonian-mechanics, angular-momentum",
"url": null
} |
neural-networks, overfitting, multilayer-perceptrons, generalization
Title: Why don't neural networks project the data into higher dimensions first, then reduce the size of each layer thereafter? Background
From my understanding (and following along with this blog post), (deep) neural networks apply transformations to the data such that the data's representation to the next layer (or classification layer) becomes more separate. As such, we can then apply a simple classifier(s) to the representation to chop up the regions where the different classes exist (as shown by this blog post).
If this is true and say we have some noisy data where the classes are not easily separable, would it make sense to push the input to a higher dimension, so we can more easily separate it later in the network?
For example, I have some tabular data that is a bit noisy, say it has 50 dimensions (input size of 50). To me, it seems logical to project the data to a higher dimension, such that it makes it easier for the classifier to separate. In essence, I would project the data to say 60 dimensions (layer out dim = 60), so the network can represent the data with more dimensions, allowing us to linearly separate it. (I find this similar to how SVMs can classify the data by pushing it to a higher dimension).
Question
Why, if the above is correct, do we not see many neural network architectures projecting the data into higher dimensions first then reducing the size of each layer thereafter?
I learned that if we have more hidden nodes than input nodes, the network will memorize rather than generalize. To better understand this you should think in terms of capacity. Capacity is a theoretical notion that shows how much information your network can model.
The capacity of a network (given sufficient training) ties in directly with the bias/variance tradeoff:
too little capacity and your network isn't able to learn the complex relationships in the data.
too much capacity and your network has the capability of learning the noise in the dataset, besides the useful relationships. | {
"domain": "ai.stackexchange",
"id": 2450,
"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": "neural-networks, overfitting, multilayer-perceptrons, generalization",
"url": null
} |
1. C/V-2
2. Cm
3. Q/V
4. C2/V
Option 3 : Q/V
## Calculating the Capacitance MCQ Question 7 Detailed Solution
CONCEPT:
• Capacitor: A capacitor is a device that stores electrical energy in an electric field.
• It is a passive electronic component with two terminals.
• The effect of a capacitor is known as capacitance.
• Capacitance: The capacitance is the capacity of the capacitor to store charge in it. Two conductors are separated by an insinuator (dielectric) and when an electric field is appliedelectrical energy is stored in it as a charge.
• The capacitance of a capacitor (C): The capacitance of a conductor is the ratio of charge (Q) to it by a rise in its potential (V), i.e.
• C = Q/V
• The unit of capacitance is the farad, (symbol F ).
• Farad is a large unit so generally, we using μF.
CALCULATION:
• From the above, it is clear that the unit capacitance of a capacitor is Q/V. Therefore option 3 is correct.
# The capacitance of a spherical conductor is proportional to
1. C ∝ R2
2. C ∝ R-1
3. C ∝ R-2
4. C ∝ R
Option 4 : C ∝ R
## Calculating the Capacitance MCQ Question 8 Detailed Solution
CONCEPT:
• Capacitor: A capacitor is a device where two conductors are separated by an insulating medium that is used to store electrical energy or electrical charge
• The capacitance is defined as the ability to store charge or it is the number of charges stored per unit potential in a capacitor.
Capacitance is given by:
$$\Rightarrow C=\frac{Q}{V}$$
Where Q = Charge and V = Potential difference
The potential on a charged sphere is given by:
$$\Rightarrow V = \frac{K Q}{R}$$
Where K = Dielectric constant Q = Charge, R = Radius
CALCULATION:
Since potential on a charged sphere:
$$\Rightarrow V = \frac{K Q}{R}$$ | {
"domain": "testbook.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9857180635575532,
"lm_q1q2_score": 0.8256571362452471,
"lm_q2_score": 0.8376199714402812,
"openwebmath_perplexity": 3079.4269749793707,
"openwebmath_score": 0.626459002494812,
"tags": null,
"url": "https://testbook.com/objective-questions/mcq-on-calculating-the-capacitance--5eea6a1339140f30f369f033"
} |
quantum-field-theory, string-theory, quantum-gravity, topological-field-theory, chern-simons-theory
Title: Gravitational Chern-Simons theory for bosons and fermions
Q1: What is the difference of boson and fermions for their Gravitational Chern-Simons theory?
I suppose in general if the metric is not flat, we have vierbein ${e_{\hat{b}}}^{\nu}$, with
$$
g_{\mu\nu} {e_{\hat{a}}}^{\mu} {e_{\hat{b}}}^{\nu} = \eta_{\hat{a}\hat{b}},
$$
where $g_{\mu\nu}$ is curved and $\eta_{\hat{a}\hat{b}}$ is Lorentzian flat. With the spin-connection is
$$
\omega^{\hat{c}}_{\hat{b}\mu} =
{e^{\hat{c}}}_{\nu}\partial_\mu {e_{\hat{b}}}^{\nu} +
{\Gamma^\nu}_{\sigma\mu} {e^{\hat{c}}}_{\nu} {e_{\hat{b}}}^{\sigma},
$$
where ${\Gamma^\nu}_{\sigma\mu}$ are the Christoffel symbols.
SET-UP: Now let us imagine there are some matter fields bosons $\phi$ or fermions $\psi$ coupling to the spacetime metric, and we integrate out the bosons $\phi$ or fermions $\psi$ to get the effective actions involving gravitational Chern-Simons action in 2+1D.
So a 2+1D gravitational Chern-Simons action can be (spin connection $\omega$):
$$
S=\int\omega\wedge\mathrm{d}\omega + \frac{2}{3}\omega\wedge\omega\wedge\omega \tag{1}
$$
I am sure this works for fermions. | {
"domain": "physics.stackexchange",
"id": 13633,
"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-field-theory, string-theory, quantum-gravity, topological-field-theory, chern-simons-theory",
"url": null
} |
newtonian-mechanics
Title: Partial flight of a particle off a table This is an experiment I need help with. A particle rolls from the top of a ramp of length L from a height h above a desk, and which makes an acute angle $\theta$ with the desk.
It then falls from the edge of the ramp off the desk, which has a height of H. I measured the horizontal displacement x of the particle from the base of the desk.
How do I obtain x as a function of h, in terms of L, H, and g?
I've got the velocity off the edge of the table as $V=\sqrt{2gh}$.
Treating the end of the ramp as the origin I've also got the parametric equations $x(t)=Vt\cos(\theta)$ and $y(t)=H-Vt\sin(\theta)-0.5gt^2$, but when I solve these I get this: | {
"domain": "physics.stackexchange",
"id": 35035,
"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",
"url": null
} |
organic-chemistry, physical-chemistry, analytical-chemistry, nmr-spectroscopy
Title: How to assign overlapping multiplets in 1H NMR spectra?
In the above $\ce{^1H}$ NMR spectrum ($\pu{400 MHz}$, $\ce{CDCl3}$) the methyl, alkene, and $\ce{CCl3CH2}$ protons are fairly easy to assign however, the protons in the cyclohexene ring show overlap and complex splitting (which I assume is due to the axial and equatorial arrangements). How would one go about differentiating between and assigning the remaining protons to the overlapping signals (if possible)?
I've actually been trying to find more generalised information to help with the assignment of a different (but similar) cyclohexene compound but couldn't really find anything, so took a suitable example from a paper I found. Referring to your comment on Buttonwood's answer:
Unfortunately, in this case I only have 1D HNMR and IR available to analyse the product
If this is really the case, then you are essentially out of luck. It is not possible to extract much information from a series of overlapping multiplets, which may well be coupled to each other (these strong coupling effects are likely the cause of the "complex splitting" you mention). It may be the case that by going to a higher field you can alleviate some of this, as multiplets will be more dispersed along the frequency axis. However, you will quickly run into a hard limit this way, since our maximum field (as of the time of writing) is ~1.2 GHz and even that is likely not enough to fully resolve your overlapped multiplets.
With that out of the way, let's talk about some other NMR techniques which will be useful in this situation. I want to preface this with a few points:
These are general suggestions which are broadly applicable to a variety of different problems; they are not tailored to the specific molecule which you asked about, and indeed you may find that some of them are less suitable for your specific compound. For the specific case at hand I would suggest talking to a NMR specialist at your institution, if this is at all possible.
There is a caveat in that many of these techniques have slightly poorer performance in situations where there is strong coupling, although it by no means makes them useless. | {
"domain": "chemistry.stackexchange",
"id": 15060,
"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, physical-chemistry, analytical-chemistry, nmr-spectroscopy",
"url": null
} |
field-theory, vector-fields
\tag{04}\label{04}
\end{equation}
with $\:\mathbf a\boldsymbol\equiv\boldsymbol\nabla\Psi\:$ and $\:\mathbf b\boldsymbol\equiv\boldsymbol\nabla\Psi^\dagger\:$ we have
\begin{equation}
\boxed{1}\boldsymbol=\left(\boldsymbol\nabla\Psi\boldsymbol\cdot\boldsymbol\nabla\vphantom{\nabla^2 \Psi^\dagger}\right)\boldsymbol\nabla\Psi^\dagger\boldsymbol+\left(\boldsymbol\nabla\Psi^\dagger\boldsymbol\cdot\boldsymbol\nabla\vphantom{\nabla^2 \Psi^\dagger}\right)\boldsymbol\nabla\Psi\boldsymbol=\boldsymbol\nabla\left(\boldsymbol\nabla\Psi\boldsymbol\cdot\boldsymbol\nabla\Psi^\dagger\right)
\tag{05}\label{05}
\end{equation}
since $\:\boldsymbol{\nabla\times\nabla}\Psi\boldsymbol=\boldsymbol 0\boldsymbol=\boldsymbol{\nabla\times\nabla}\Psi^\dagger\:$.
From equations \eqref{02},\eqref{05} we have
\begin{equation}
\texttt{RHS}\boldsymbol=\boldsymbol\nabla\left(\boldsymbol\nabla\Psi\boldsymbol\cdot\boldsymbol\nabla\Psi^\dagger\right)\boldsymbol\cdot\mathbf A
\tag{06}\label{06}
\end{equation}
Using the following vector formula
\begin{equation} | {
"domain": "physics.stackexchange",
"id": 83028,
"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, vector-fields",
"url": null
} |
javascript, jquery, css
container.updateStyle = function() {
clearTimeout(timeout);
timeout = setTimeout(function() {
context.clearRect(0, 0, canvas.width, canvas.height);
context.beginPath();
context.globalCompositeOperation = "source-over";
image = new Image();
image.setAttribute('crossOrigin', 'anonymous');
image.src = settings.maskImageUrl;
image.onload = function() {
canvas.width = image.width;
canvas.height = image.height;
context.drawImage(image, 0, 0, image.width, image.height);
div.css({
"width": image.width,
"height": image.height
});
};
img = new Image();
img.src = settings.imageUrl;
img.setAttribute('crossOrigin', 'anonymous');
img.onload = function() {
settings.x = settings.x == 0 && initImage ? (canvas.width - (img.width * settings.scale)) / 2 : settings.x;
settings.y = settings.y == 0 && initImage ? (canvas.height - (img.height * settings.scale)) / 2 : settings.y;
context.globalCompositeOperation = 'source-atop';
context.drawImage(img, settings.x, settings.y, img.width * settings.scale, img.height * settings.scale);
initImage = false;
};
}, 0);
};
// change the draggable image
container.loadImage = function(imageUrl) {
if (img)
img.remove();
// reset the code.
settings.y = startY;
settings.x = startX;
prevX = prevY = 0;
settings.imageUrl = imageUrl;
initImage = true;
container.updateStyle();
}; | {
"domain": "codereview.stackexchange",
"id": 33688,
"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": "javascript, jquery, css",
"url": null
} |
signal-analysis, filter-design, python, bandpass
def filter_implementation(sos, data):
y = sosfilt(sos, data)
return y
#------------------------------------------------------------------------
# Create a signal
from scipy import signal
# How many time points are needed i,e., Sampling Frequency
sampling_frequency = 100;
# At what intervals time points are sampled
sampling_interval = 1 / sampling_frequency;
# Begin time period of the signals
begin_time = 0;
# End time period of the signals
end_time = 10;
# Define signal frequency
signal_frequency = 1
# Time points
time = np.arange(begin_time, end_time, sampling_interval);
data = signal.unit_impulse(len(time))
# data = signal.sawtooth(2 * np.pi * signal_frequency * time)
# data = np.sin(2 * np.pi * signal_frequency * time)
plt.figure(figsize = (8, 4))
plt.plot(time, data)
plt.scatter(time, data, alpha=1, color = 'black', s = 20, marker = '.')
plt.xlabel("Time(s)")
plt.ylabel("Amplitude")
plt.title("Unit-impulse Signal")
plt.grid()
plt.show()
#------------------------------------------------------------------------
# Perform fft
from scipy.fft import fft, fftfreq | {
"domain": "dsp.stackexchange",
"id": 11305,
"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": "signal-analysis, filter-design, python, bandpass",
"url": null
} |
+ b^2 = c^2 formula, the Pythagorean theorem. FAQ. That will only happen in an equilateral triangle. To solve for the height of an equilateral triangle, we can divide the triangle into two right triangles. The equilateral triangle has equal sides and angles and the angle is 60° The perimeter of an equilateral triangle is equal to the sum of the sides. The special right triangle gives side ratios of , , and . If we were to create a triangle by drawing the height, the length of the side is , the base is , and the height is . To find the height we divide the triangle into two special 30 - 60 - 90 right triangles by drawing a line from one corner to the center of the opposite side. [3] 2017/10/15 12:35 Male / 30 years old level / Self-employed people / Useful / Purpose of use to get ged prepration Comment/Request to improve my education [4] … The altitude shown h is hb or, the altitude of b. An equilateral triangle also has three equal 60 degrees angles. What is its height, ? If Varsity Tutors takes action in response to In geometry, an equilateral triangle is a triangle where all three sides are the same length and all three angles are also the same and are each 60 °. Prove that the area of the equilateral triangle drawn on the hypotenuse of a right angled triangle is equal to the sum of the areas of the equilateral triangle drawn on the other two sides of the triangle. 4.1. as The side with length will be the height (opposite the 60 degree angle). Morehouse College, Bachelors, History. A triangle's height is the length of a perpendicular line segment originating on a side and intersecting the opposite angle. Case Western Reserve University, PHD, LAW. asked Feb 12, 2018 in Class X Maths by priya12 (-12,630 points) triangles –1 vote. Therefore, we can find the height of the altitude of this triangle by designating a value to . An equilateral triangle is a triangle with all three sides equal and all three angles equal to 60°. The altitude h of an equilateral triangle is h=asin60 … Please follow these steps to file a notice: A physical or electronic signature of the copyright | {
"domain": "mediatebc.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9532750466836961,
"lm_q1q2_score": 0.800497442969763,
"lm_q2_score": 0.8397339736884711,
"openwebmath_perplexity": 537.5316466795584,
"openwebmath_score": 0.544822096824646,
"tags": null,
"url": "https://www.mediatebc.com/ah2e9kez/e1d8af-height-of-an-equilateral-triangle"
} |
ros, multiple, turtlebot
Title: How to launch multiple turtlebots in real environment?
I want to launch multiple turtlebots in real environment. In this scenario, there are several turtlebots and a remote workstation connected with each other. I want the robots to be controlled independently. I know how to revise the navigation and amcl launch files. But I don't know how to revise the minimal.launch file in turtlebot_bringup package of each robot to accomplish this. The ROS version I use is Indigo.Thank you!
Originally posted by Minglong on ROS Answers with karma: 31 on 2016-03-07
Post score: 1
Original comments
Comment by gavran on 2016-05-05:
hi, @Minglong, I ran into same problem. What @Mehdi suggests is the way to go, however, I can't get it to work with navigation stack. Therefore, I added new, more detailed question.
Comment by gavran on 2016-05-05:
@Minglong, @Mehdi: I also added a github repository to try to reach a complete solution - try to see if it is useful for you, or if you can improve it.
I think this can be done by either having a roscore running on each Turtlebot laptop or by having one ROS core on your workstation and launching each Turtlebot on a different namespace such that all nodes and topics have a prefix like i.e turtlebot1/topic1 turtlebot1/node1
Originally posted by Mehdi. with karma: 3339 on 2016-03-07
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 24013,
"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, multiple, turtlebot",
"url": null
} |
condensed-matter, education, calculus
Title: Would condensed matter physicists need more than three dimensional calculus? The difference between "multivariable" and "vector" calculus, as stated on Yale's website, is that multivariable would only go through 2 or 3 dimensions, and so would rely heavily on geometric analysis. Vector calculus on the other hand generalizes to n dimensions, which requires linear algebra as a prerequisite.
I was wondering if n-dimensions would be necessary to conduct condensed matter physics research. In the long run I don't think it matters much which of the two you study now. If you truly understand calculus in 2-3 dimensions, you won't have too much trouble generalizing your understanding to $N$ dimensions. On the other hand, if you want to do research in condensed matter, you will need linear algebra anyway, so there's no harm in picking up that topic as well. Given that linear algebra and $N$-variable calculus are pretty much the bread and butter of physics, you can't possibly do yourself any disservice by trying to gain as deep an understanding of those topics as possible if physics research is your goal (provided you think you can keep up with the course material and workload).
As to whether you might encounter more than 3 dimensions (variables) in condensed matter research, the answer is a resounding 'yes'. For instance, if you're studying a lattice of particles, you're likely to have at least one variable (almost always more) for every particle on the lattice. Even a 10 particle system in 1 spatial dimension would have 20 variables (10 position, 10 velocity) coupled by 20 equations (well, 10 similar copies of 2 basic equations). If you want to get an idea of what sort of problems you might encounter in condensed matter, you might look up the Ising model. The basic 1D Ising model actually doesn't require calculus, only linear algebra, but one can easily think of similar systems with different interactions that would add calculus to the required toolbox. | {
"domain": "physics.stackexchange",
"id": 24435,
"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": "condensed-matter, education, calculus",
"url": null
} |
for successive values of `k`. How large must you make `k` in order to get an approximation that is accurate to 4 decimal places?
2. If your `cont-frac` procedure generates a recursive process, write one that generates an iterative process. If it generates an iterative process, write one that generates a recursive process.
Exercise 1.38: In 1737, the Swiss mathematician Leonhard Euler published a memoir De Fractionibus Continuis, which included a continued fraction expansion for $e-2$, where $e$ is the base of the natural logarithms. In this fraction, the ${N}_{i}$ are all 1, and the ${D}_{i}$ are successively 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, …. Write a program that uses your `cont-frac` procedure from Exercise 1.37 to approximate $e$, based on Euler’s expansion.
Exercise 1.39: A continued fraction representation of the tangent function was published in 1770 by the German mathematician J.H. Lambert: $\mathrm{tan}x\phantom{\rule{thinmathspace}{0ex}}=\phantom{\rule{thinmathspace}{0ex}}\frac{x}{1-\frac{{x}^{2}}{3-\frac{{x}^{2}}{5-\dots }}}\phantom{\rule{thinmathspace}{0ex}},$ where $x$ is in radians. Define a procedure `(tan-cf x k)` that computes an approximation to the tangent function based on Lambert’s formula. `k` specifies the number of terms to compute, as in Exercise 1.37.
#### 1.3.4Procedures as Returned Values
The above examples demonstrate how the ability to pass procedures as arguments significantly enhances the expressive power of our programming language. We can achieve even more expressive power by creating procedures whose returned values are themselves procedures. | {
"domain": "github.io",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9833429585263221,
"lm_q1q2_score": 0.8062363429407837,
"lm_q2_score": 0.8198933403143929,
"openwebmath_perplexity": 264.5375498636734,
"openwebmath_score": 0.8616983294487,
"tags": null,
"url": "http://sarabander.github.io/sicp/html/1_002e3.xhtml"
} |
algorithms, graphs, shortest-path, a-star-search
Title: D* Lite - can edge costs be asymmetric? I'm trying to modify the original D* Lite algorithm adding a margin constraint wrt to any nearby obstacle to be satisfied for each selected cell in the path. This causes the edge cost function between nodes to be asymmetric: let x and y be 2 adjacent nodes, with x being distant to an obstacle less than the given margin, while y is far enough and is perfectly traversable. The cost from x to y is then 1, but the cost from y to x will be infinite due to the closeness of x to an obstacle. I noticed that sometimes the algorithm get stuck in calculating the shortest path and I'm wondering if the asymmetry of the edge costs can be the cause. As for the heuristic, I'm using the euclidean distance which is admissible. Yes, D*-lite is a directed graph algorithm, so it works fine with asymmetric edge weights by definition.
However, note that the heuristic being admissible is not sufficient. According to the paper, it must be consistent. Based on what you described, I would guess Euclidean distance would be consistent for your graph, but we can't know for sure without seeing the graph. | {
"domain": "cs.stackexchange",
"id": 19528,
"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": "algorithms, graphs, shortest-path, a-star-search",
"url": null
} |
$C = \bigcap\limits_{i\in I} (A_i \cup T_i)$, where each $A_i$ is Euclidean-closed, and each $T_i \subseteq S$. Let $A = \bigcap\limits_{i\in I} A_i$; certainly $A$ is Euclidean-closed. Where must any point of $C \setminus A$ be?
Another approach is via local bases. For $n \in \omega$ and $x \in \mathbb{R}$ let $$B(x,n) = \begin{cases} \{y \in \mathbb{R}:\vert y-x\vert < 2^{-n}\},&\text{if }x \ne 0\\ \{y \in \mathbb{R}:\vert y-x\vert < 2^{-n}\}\setminus S,&\text{if }x = 0. \end{cases}$$
Show that $\mathscr{B} = \{B(x,n):n \in \omega \land x \in \mathbb{R}\}$ is a base for a topology, and that the topology that it generates is $\mathcal{T}$. (Thus, $\mathcal{T}$ differs from the Euclidean topology only at $0$.)
@Srivatsan: You’re right about the typo: I was originally going to define $B(x,n)$ in-line, separately for the two cases, and forgot to change the lead-in when I shifted to the case display. – Brian M. Scott Sep 19 '11 at 0:14 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.960361158630024,
"lm_q1q2_score": 0.8023659357419782,
"lm_q2_score": 0.8354835350552604,
"openwebmath_perplexity": 109.63917470738093,
"openwebmath_score": 0.938724160194397,
"tags": null,
"url": "http://math.stackexchange.com/questions/65530/verifying-that-these-sets-form-a-topology"
} |
ros, kinect, rviz, ros-kinetic, ssh
Title: Unable to run Rviz and RTABMAP using SSH
Hey everyone,
I am a student of Habib University and I am working on an Autonomous Rescue Robot.
The project aims to develop an Autonomous Robot that can make an entire Map of an unknown site 'Autonomously' and simultaneously send live Mapping and Localization data to a remote PC.
I am using a RaspberryPi 3 in which I've installed Lubuntu and ROS Kinetic. The problem I am currently facing is that I can connect to the Pi using SSH but when I run the Rviz and Rtabmap commands, it gives me an error.
rosrun rviz rviz
QXcbConnection: Could not connect to display
Aborted
Is there any other way I can run Rviz and Rtabmap on a remote PC and visualize the Mapping and Localization data?
Originally posted by Raza on ROS Answers with karma: 1 on 2018-03-17
Post score: 0
Original comments
Comment by cesarhcq on 2019-04-15:
Hello! Did you fix it? I am having the same problem. Could you explain if you fix it?
Thanks
Comment by Raza on 2019-04-17:
No, we weren't able to fix it. We had to install and Run the ROS on a laptop.
Hi
if i understand correctly your pi hasn't any display device for running rviz i suggest you to use ros network and run rviz in your pc
Originally posted by Hamid Didari with karma: 1769 on 2018-03-18
This answer was ACCEPTED on the original site
Post score: 0 | {
"domain": "robotics.stackexchange",
"id": 30348,
"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, kinect, rviz, ros-kinetic, ssh",
"url": null
} |
programming, classical-computing
Title: What concepts from classical computing are vital for quantum programmers? Many scientific programmers get by fine without having a computer science background, i.e. they don't need to know the machinery behind the prevailing paradigm of 0's and 1's (bits), let alone basic logic, to code.
Given this lack of awareness of classical computing's inner workings, what are stand-out concepts from classical computing that every aspiring quantum programmer should know? I take your statement that programmers "don't need to know the machinery behind the prevailing paradigm" to mean that most scientific programmers need not know how a $\mathsf{NAND}$ gate is realized, with, say, a set of $6$ or so transistors.
However, probably a concept that is fundamental in quantum computing, that can be understood by anyone familiar with logical operations like $\mathsf{AND}$, $\mathsf{OR}$, etc. is that of reversible computing. For example quantum computing logical gates must be reversible, and gates like $\mathsf{NAND}$ etc. are ruled out. Information is lost in such gates.
However, gates like $\mathsf{XNOR}$ are still allowed in quantum computing (because they are reversible, and the input could be recovered.)
Because information cannot be erased in quantum circuits, it becomes difficult, though not impossible, to program recursive subroutines with reversible gates. See e.g. this Quanta article on the problems of recursion in quantum computing, and the recent breakthrough of Gidney. | {
"domain": "quantumcomputing.stackexchange",
"id": 1170,
"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": "programming, classical-computing",
"url": null
} |
quantum-mechanics, homework-and-exercises, hamiltonian
How would $S_1^z$ act on this basis, for example? $S_1^z|\pm, \pm'\rangle = \pm \hbar/2 |\pm, \pm'\rangle$. It doesn't care about the second spin! so we can treat it as some product with $I_2$ the identity operating on the second spin.
If we would have like to write it in matrix, we would get
$$ S_1^z = \frac{\hbar}{2} \begin{pmatrix} 1 & & & \\ &1 & & \\ &&-1& \\ &&&-1\end{pmatrix} $$
which is the Kronecker product of $\hbar/2\sigma_z$ and the identity, which is written as $\hbar/2\sigma_z\otimes I$. Similarly, $S_2^z$ will be $I\otimes \hbar/2 \sigma_z$, which is
$$ S_2^z = \frac{\hbar}{2} \begin{pmatrix} 1 & & & \\ &-1 & & \\ &&1& \\ &&&-1\end{pmatrix} $$
and similarly for the other spin components. So for example
$$S_1^x = \frac{\hbar}{2} \begin{pmatrix} 0 & &1 & \\ &0 & &1 \\ 1&&0& \\ &1&&0\end{pmatrix}$$
etc. | {
"domain": "physics.stackexchange",
"id": 65492,
"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, homework-and-exercises, hamiltonian",
"url": null
} |
Peter
[This has also been posted on MHF]
Last edited:
#### Fernando Revilla
##### Well-known member
MHB Math Helper
However, I am still not completely sure how to formally show that RA is the smallest submodule of M that contains A i.e. how does the implication (1) demonstrate this - can someone help by showing this explicitly and formally?
Consider the set
$$\mathcal{N}=\{N\subseteq M:N\text{ submodule of }M\text{ and }A\subseteq N \}$$
Then, $\subseteq$ is an order relation on $\mathcal{N}$, $RA\in \mathcal{N}$ and $RA\subseteq N$ for all $N\in\mathcal{N}.$ This means that $RA$ is the smallest element related to $(\mathcal{N},\subseteq)$
Last edited:
#### Deveno
##### Well-known member
MHB Math Scholar
One can argue by contradiction, here.
Suppose we have a submodule $$\displaystyle N$$ with:
$$\displaystyle A \subseteq N \subsetneq RA$$.
By your previous argument, since $$\displaystyle N$$ is a submodule containing $$\displaystyle A$$, we have:
$$\displaystyle RA \subseteq N \subsetneq RA$$ that is:
$$\displaystyle RA \neq RA$$, a contradiction. So no such $$\displaystyle N$$ can exist. | {
"domain": "mathhelpboards.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9732407152622597,
"lm_q1q2_score": 0.8329491860107662,
"lm_q2_score": 0.8558511506439708,
"openwebmath_perplexity": 924.8997976305528,
"openwebmath_score": 0.985804557800293,
"tags": null,
"url": "https://mathhelpboards.com/threads/generation-of-submodules.5972/"
} |
pressure, fluid-statics
Which is inconsistent with reality.
I arrived at this problem by imagining what would happen if we put a very thin and long straw filled with fluid on top of a container, which would make the pressure $P2=\rho*g*H$ go really high by increasing $H$, which would mean that we could make any container fail by excessive stress if we put a long enough straw on top of it, which is absurd. In this case, the second analysis kinda makes more sense because if you don't increase the volume, you basically also don't increase the pressure, but I know this has to be wrong since pressure does depend on height of fluid column.
I guess this is kind of two questions in one, as I have one question that asks for correction on the concepts I used to calculate something and another one which is the question about how the absurd situation doesn't happen. If you prefer to focus on "one question", please focus on the second one, since it is the one that I feel less able to tackle myself.
FINAL ANSWER: I have been convinced. I thought the situation on the following video was absurd/impossible, and it isn't. My mind is settled. Thanks for your answers people!
https://www.youtube.com/watch?v=EJHrr21UvY8 "we could make any container fail by excessive stress if we put a long enough straw on top of it, which is absurd."
Absurd it might seem, but it's what happens. Barrels have been burst by putting tall thin pipes into their tops and filling with water.
You correctly diagnosed your mistake earlier on. When containers have sides that aren't vertical, these sides exert on the liquid forces that have a vertical component, either up or down according to whether the container is becoming broader or narrower as we go upwards. The thing to remember is that a liquid at rest exerts on a surface a force at right angles to the surface. The surface exerts an equal and opposite force on the liquid. | {
"domain": "physics.stackexchange",
"id": 47505,
"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": "pressure, fluid-statics",
"url": null
} |
built-in Maple or Matlab. 8, 2006 at 4:00 p. The extensive list of functions now available with LAPACK means that MATLAB's space saving general-purpose codes can be replaced by faster, more focused routines. We offer a dynamical perspective on the motion and interaction of the eigenvalues in the complex plane, derive their governing equations and discuss. MATLAB codes that accompany Spectral Methods in Chemistry and Physics. the initial vector x0has as its largest entry 1 (in magnitude). K= place(A,B,P) find a matrix K such that the eigenvalues of the matrix (A-B*K) are exactly in P. In the example code, the covariance matrix is called CovX and it is computed by the Matlab function cov. MATLAB is designed for this type. 1:1] and ky=[-1:0. Matlab #4: Eigenvalues and Diagonalization Exercise 4. > A = [8 11 2 8; 0 -7 2 -1; -3 -7 2 1; 1 1. The eigenvectors are displayed both graphically and numerically. About the Book Author. Lanczos algorithm for eigenvalues. Thefollowingisthe MATLAB codethatimplements the PowerMethod for a matrix Aand initial vector x0. Eigenvalue problems, more speci cally Sturm-Liouville problems, are exem-pli ed by y00 + y =0 with y(0) = 0, y(ˇ) = 0. Linear Algebra Application Example Stress Analysis As you have learned from CVE 220 and/or MCE 301, when an elastic body is are shown below along with the MATLAB code. , Adaptive Filtering Primer with MATLAB (with Matlab code). In general there will be as many eigenvalues as the rank of matrix A. Learn more about eigenvalues, matrix, positive eigenvalues MATLAB. Does Matlab eig always returns sorted values? Ask Question Asked 7 years, 6 months ago. Suppose that I put in P exactly the same eigenvalue of A. K= place(A,B,P) find a matrix K such that the eigenvalues of the matrix (A-B*K) are exactly in P. I am attempting to do | {
"domain": "umood.it",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.97112909472487,
"lm_q1q2_score": 0.800658955819999,
"lm_q2_score": 0.8244619177503205,
"openwebmath_perplexity": 1050.789163476664,
"openwebmath_score": 0.7538413405418396,
"tags": null,
"url": "http://lzxc.umood.it/eigenvalue-matlab-code.html"
} |
aerospace-engineering
Title: How hot does a rocket nose cone get during launch? More specifically, I'd like to know if unmanned rockets need to be specially designed to withstand the heat generated from air friction and shock waves during launch. I found the diagram below on the NASA website which shows some fairly high stagnation temperatures, but the problem is that I don't know how fast a typical rocket travels on its way to, say, low earth orbit. I also don't know what the velocity profile looks like, i.e. Mach number vs. altitude.
Most of the information I've found only talks about orbital velocity and reentry temperatures, neither of which is very useful. Judging from this profile of a Delta IV launch, it doesn't appear like it gets very warm at all, since it maintains a speed of less than 3.5 km/s until it is mostly out of the "thick" atmosphere (~90 km). A few calculations show stagnation temperatures as below. Though these temperatures are very high, they are not achieved until the higher altitudes, where the density is very low, so the surface temperature will not likely equal the temperature in the shock layer (or boundary layer)
$T_{0,11km} \approx 265 K$
$T_{0,45km} \approx 2470K $ (but massive error due to perfect gas/isentropic assumption due to Mach number of ~6)
$T_{0,90km} \approx 6300K$ (again, same argument as for 45 km) | {
"domain": "engineering.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": "aerospace-engineering",
"url": null
} |
It is clear that the map $f$ is one-to-one. If $\tau$ and $\gamma$ are two different strings of 0’s and 1’s, then they must differ at some coordinate, then from the way the induction is done, the strings would lead to two different points. It is also clear to see that the map $f$ is reversible. Pick any point $x \in C$. Then the point $x$ must belong to a nested sequence of sets $K$‘s. This maps to a unique infinite string of 0’s and 1’s. Thus the set $C$ has the same cardinality as the set $\left\{0,1 \right\}^N$, which has cardinality continuum.
To see the second point, pick $x \in C$. Suppose $x=f(\tau)$ where $\tau \in \left\{0,1 \right\}^N$. Consider the open sets $U_{\tau \upharpoonright n}$ for all positive integers $n$. Note that $x \in U_{\tau \upharpoonright n}$ for each $n$. Based on the induction process described earlier, observe these two facts. This sequence of open sets has diameters decreasing to zero. Each open set $U_{\tau \upharpoonright n}$ contains infinitely many other points of $C$ (this is because of all the open sets $U_{\tau \upharpoonright k}$ that are subsets of $U_{\tau \upharpoonright n}$ where $k \ge n$). Because the diameters are decreasing to zero, the sequence of $U_{\tau \upharpoonright n}$ is a local base at the point $x$. Thus, the point $x$ is a limit point of $C$. This completes the proof. $\blacksquare$
Theorem 4
Let $X$ be a compact metrizable space. It follows that $X$ is scattered if and only if $X$ is countable. | {
"domain": "wordpress.com",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9907319885346244,
"lm_q1q2_score": 0.8076769075174758,
"lm_q2_score": 0.8152324915965392,
"openwebmath_perplexity": 2702.333109678335,
"openwebmath_score": 1.0000100135803223,
"tags": null,
"url": "https://dantopology.wordpress.com/tag/metrizable-spaces/"
} |
quantum-mechanics, quantum-information, quantum-spin, quantum-entanglement, faster-than-light
the particle is deflected in the magnetic field due to the interaction of its magnetic dipole with the external field under the emission of EM radiation (the concept of spin is thereby invalid).
when polarised entangled particles are generated, their magnetic dipoles are entangled, up and down.
the up and down refers only to the fact that the particles are aligned antiparallel. Their common orientation in space is purely coincidental. Only such experimental results are accessible to us so far.
when the particles are detected, the polarisers, which are supposed to detect the particle orientation, are fixed in their rotational position, which leads to a random result in the detection. Only statistically can the correlation between the two particle orientations be detected, but a 100% result cannot be achieved. Our measuring device is therefore imperfect - naturally because of the random alignment when the particle entanglement is generated.
You are absolutely right when you interpret the results of the entanglement experiments as you describe above. However, science is based on consensus and so you get minus points here (and a plus from me). | {
"domain": "physics.stackexchange",
"id": 88515,
"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-information, quantum-spin, quantum-entanglement, faster-than-light",
"url": null
} |
- Origin at the center of the egg. Included is an example solving the heat equation on a bar of length L but instead on a thin circular ring. We are adding to the equation found in the 2-D heat equation in cylindrical coordinates, starting with the following definition::= (,) × (,) × (,). Semi-analytical solutions are obtained for transient and steady-state heat conduction. We Assume I) Eggs Are Perfectly Spherical With Radius R (ii)the 'material' Of An Egg Is Homogeneous, Meaning That The Shell, White, And Yolk Have The Same Thermal Conductivity. Rectangular Coordinates. A partial differential equation (or briefly a PDE) is a mathematical equation that involves two or more independent variables, an unknown function (dependent on those variables), and partial derivatives of the unknown function with respect to the independent variables. This dual theoretical-experimental method is applicable to rubber, various other polymeric materials. general heat conduction equation in spherical coordinates - Duration: 17:44. Our solution method, though, worked on first order differential equations. The functional for for large is given. Pennes' bioheat equation was used to model heat transfer in each region and the set of equations was coupled through boundary condi-tions at the interfaces. Conduction Heat Transfer: Conduction is the transfer of energy from a more energetic to the less energetic particles of substances due to interactions between the particles. 4, Myint-U & Debnath §2. The mathematical complexity behind such an equation can be intractable by analytical means. Based on the authors’ own research and classroom experience, this book contains two parts, in Part (I): the 1D cylindrical coordinates, non-linear partial differential equation of transient heat conduction through a temperature dependent thermal conductivity of a thermal insulation material is solved analytically using Kirchhoff’s. 2, 2017 DOI: 10. The heat transfer problems in the coupled conductive-radiative formulation are fundamentally nonlinear. 1: Heat conduction through a large plane wall. However, I want to solve the equations in spherical coordinates. 2 Numerical solution for 1D advection equation with initial conditions of a box pulse with a constant wave speed using the spectral method in (a) and nite di erence method in (b) 88. the course, we will study particular solutions to the spherical wave equation, when we solve the nonhomogeneous version of the | {
"domain": "ilovebet.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9835969636371975,
"lm_q1q2_score": 0.8041637701453398,
"lm_q2_score": 0.8175744739711883,
"openwebmath_perplexity": 746.7859159697898,
"openwebmath_score": 0.813318133354187,
"tags": null,
"url": "http://koyd.ilovebet.it/1d-heat-equation-in-spherical-coordinates.html"
} |
control
Title: difference between non-holonomic and linear control systems I already asked this question in the mathoverflow forum, but no one could answer. Probably it is not a question of mathematics but robotics.
I'm struggling with the definitions and differences between a non-holonomic and a linear control systems.
I'm working with a phase space $P\subset R^{m}$ and a control space $U\subset R^{l}$ and my control system
$\dot{p}=f(p,u)$
is of the form
$\dot{p}=\sum^{l}_{i=1}u_{i}P_{i}(p)$
where $P_{1},\dots,P_{l}$ are smooth vector fields on $P$.
In Frederic Jeans book Definition 1.1 a control system of this form is called non-holonomic. I already read that there is the adjective "linear" which would fit better in my opinion since whenever I use the form of the control system I use the fact that it depends linearly on the control.
Can someone advice me literature where it is stated like that?
When I read more about non-holonomicity I found that it is a question whether the vectorfields $P_{i}$ span the whole $TP$.
Can someone explain how linearity and non-holonomicity are connected? I have to admit, I have no experience with non-holomonic CONTROL System. I have dealt with non-holomonic MECHANICAL systems.
As defined here, a non-holominc mechanical system annot move in arbitrary directions inits configuration space. A mundane example is a car. It can occupy and X, Y position and Z rotation on a flat surface, but it cannot move laterally in the Y direction. It has to manuver to get there.
In mobile robotics, simplisticly this problem is dealt with at a higher level then the closed loop control system. It is considered a constraint for the path/trajectory planner (open loop). After the path/trajectory has been planned, the setpoints are given to the closed loop control system (cyclically), which can be a linear control system. | {
"domain": "robotics.stackexchange",
"id": 2212,
"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": "control",
"url": null
} |
c++, performance, hash-map
test.insertKey(1991);
test.insertKey(1992);
test.insertKey(1996);
test.insertKey(69);
test.insertKey(420);
cout << test << endl;
cout << "Number of items: " << test.getNumOfItems() << endl;
cout << "-------------------------------------------" << endl;
cout << "Searching and print: " << endl;
cout << "-------------------------------------------" << endl;
cout << "Find 14, does it exist? " << boolalpha << test.searchKey(14) << endl;
cout << "Find 400, does it exist? " << boolalpha << test.searchKey(400) << endl;
cout << "Find 21, does it exist? " << boolalpha << test.searchKey(21) << endl;
cout << "Find 1337, does it exist? " << boolalpha << test.searchKey(1337) << endl;
cout << "Find 69, does it exist? " << boolalpha << test.searchKey(69) << endl;
cout << "Find 420, does it exist? " << boolalpha << test.searchKey(420) << endl;
cout << "Find 7, does it exist? " << boolalpha << test.searchKey(7) << endl;
cout << "-------------------------------------------" << endl;
cout << "Deleting values in hashtable: " << endl; | {
"domain": "codereview.stackexchange",
"id": 32092,
"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, hash-map",
"url": null
} |
urdf, moveit, ros-melodic, ur5
Title: UR5 mounted on table collides with the table at runtime
Hi all,
I have a ur5 robotic arm that is mounted on a table surface. I have created a urdf of the workspace digi2.xacro given as follows:
<?xml version="1.0" ?>
<robot name="ur5" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:ur5_robot prefix="" joint_limited="true"/>
<link name="world"/>
<link name="table">
<visual>
<geometry>
<box size="2 1.5 0.05"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="2 1.5 0.05"/>
</geometry>
</collision>
</link>
<joint name="world_to_table" type="fixed">
<parent link="world"/>
<child link="table"/>
<origin xyz="0 0 1" rpy="0 0 0"/>
</joint>
<joint name="table_to_robot" type="fixed">
<parent link="table"/>
<child link="base_link"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
</robot>
I have created by moveit package by running through MoveIt Setup Assistant (MSA). The idea being that, the table surface was taken into account when generating the collision matrix. The screen shot when I run the demo.launch file is shown below. | {
"domain": "robotics.stackexchange",
"id": 37451,
"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": "urdf, moveit, ros-melodic, ur5",
"url": null
} |
Hence $$P\left(\bigcup_{k=1}^{\infty}\{(\xi-\eta)+k\xi\ge y\}\right)=1$$ Since the events in the union are increasing in $k$, we have $$\lim_{k\to \infty}P\{(\xi-\eta)+k\xi\ge y\}=1$$
-
Thanks, seems to be right. Do you think it is possible to find how $\mathsf P\{(\xi-\eta)+k\xi\geq y\}$ is close to $1$ for $k$ being large? – Ilya Nov 24 '11 at 11:56
$\{(\xi-\eta)+k\xi\ge y\}\uparrow \bigcup_{k=1}^{\infty}\{(\xi-\eta)+k\xi\ge y\}$ right? I hope I understood your doubt correctly. – Ashok Nov 24 '11 at 12:22
nope, I meant bounds on the difference $1-\mathsf P$ as I presented in my answer below. I would appreciate if you could take a look on it and tell me if there are any mistakes or there are better bounds - though I cannot ask you to do it because your answer is cool and clear, good job ;) – Ilya Nov 24 '11 at 14:35 | {
"domain": "stackexchange.com",
"id": null,
"lm_label": "1. YES\n2. YES",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9719924810166349,
"lm_q1q2_score": 0.8099852368660656,
"lm_q2_score": 0.8333245911726382,
"openwebmath_perplexity": 242.8963969156459,
"openwebmath_score": 0.967746376991272,
"tags": null,
"url": "http://math.stackexchange.com/questions/85193/probabilistic-inequality-with-two-random-variables"
} |
python, beginner, number-guessing-game
{
'name': 'David Beckham',
'follower_count': 82,
'description': 'Footballer',
'country': 'United Kingdom'
},
{
'name': 'Billie Eilish',
'follower_count': 61,
'description': 'Musician',
'country': 'United States'
},
{
'name': 'Justin Timberlake',
'follower_count': 59,
'description': 'Musician and actor',
'country': 'United States'
},
{
'name': 'UEFA Champions League',
'follower_count': 58,
'description': 'Club football competition',
'country': 'Europe'
},
{
'name': 'NASA',
'follower_count': 56,
'description': 'Space agency',
'country': 'United States'
},
{
'name': 'Emma Watson',
'follower_count': 56,
'description': 'Actress',
'country': 'United Kingdom'
},
{
'name': 'Shawn Mendes',
'follower_count': 57,
'description': 'Musician',
'country': 'Canada'
},
{
'name': 'Virat Kohli',
'follower_count': 55,
'description': 'Cricketer',
'country': 'India'
},
{
'name': 'Gigi Hadid',
'follower_count': 54,
'description': 'Model',
'country': 'United States'
},
{
'name': 'Priyanka Chopra Jonas',
'follower_count': 53,
'description': 'Actress and musician',
'country': 'India'
},
{
'name': '9GAG',
'follower_count': 52,
'description': 'Social media platform',
'country': 'China'
},
{
'name': 'Ronaldinho',
'follower_count': 51,
'description': 'Footballer',
'country': 'Brasil'
},
{
'name': 'Maluma',
'follower_count': 50,
'description': 'Musician',
'country': 'Colombia'
},
{
'name': 'Camila Cabello', | {
"domain": "codereview.stackexchange",
"id": 42466,
"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, number-guessing-game",
"url": null
} |
c, vectors
// Here there be tests ...
void vector_test_alloc_free()
{
printf("vector_test_alloc_free: ");
vector* v = vector_allocate(sizeof(int));
assert(v != NULL);
assert(v->capacity == 1);
assert(v->size == 0);
assert(v->data_size == sizeof(int));
assert(v->data != NULL);
printf("OK\n");
vector_free(v);
}
void vector_test_insert_read_int()
{
printf("vector_test_insert_read_int: ");
int val1 = 0xabcdabcd;
int val2 = 0xeffeeffe;
vector* v = vector_allocate(sizeof(int));
vector_push_back(v,&val1);
assert(v->size == 1);
assert(v->capacity == 1);
int* p = vector_get(v, 0);
assert(*p == val1);
vector_push_back(v, &val2);
assert(*p == val1);
assert(*(p + 1) == val2);
printf("OK\n");
vector_free(v);
}
void vector_test_insert_read_struct()
{
struct data {
double d;
int i;
}; | {
"domain": "codereview.stackexchange",
"id": 27800,
"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, vectors",
"url": null
} |
(2x −1)2 dx. Have a look!! Modulus and argument of complex numbers If you're looking for more in complex numbers, do check in: Addition and subtraction of complex numbers Multiplication and division of complex numbers Conjugates. The graph of modulo is not continuous. Certain accents and other diacritical marks are available in math. Chapter 4 5 / 35. Math Algebra How to find the modulus of a vector? Can someone please explain to me how to do question 4 b iii) Thanks heaps! Precalculus. It can be used as a worksheet function (WS) in Excel. Now here we are going to discuss a new type of addition, which is known as “addition modulo m” and written in the form , where and belong to an integer and is any fixed positive integer. More about Remainder. For K-12 kids, teachers and parents. Use the mod % operator. Usage of math operator Modulo in SQL Server x%y is defined as the remainder of the division x/y. Often a modulus is simply some numerical parameter on which the mathematical object under consideration depends. org are unblocked. Modulo n is usually written mod n. So, for example mod(x,2) will show you the remainder of x after dividing by 2. This website and its content is subject to our Terms and Conditions. Example, 13 Find the modulus and argument of the complex numbers: (i) (1 + 𝑖)/(1 − 𝑖) , First we solve (1 + 𝑖)/(1 − 𝑖) Let 𝑧 = (1 + 𝑖)/(1 − 𝑖) Rationalizing the same = (1 + 𝑖)/(1 − 𝑖) × (1 + 𝑖)/(1 + 𝑖) = (( 1 + 𝑖 ) ( 1 + 𝑖 ))/("(" 1 − 𝑖 ) (1 + 𝑖 )) Using (a – b) (a + b) = a2 − b2 = ( 1+ 𝑖 )2/( ( 1 )2 − ( 𝑖 )2. y=3x2+6x-2 has graph. In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. Modulo is a mathematical jargon that was introduced into mathematics in the book | {
"domain": "fnaarccuneo.it",
"id": null,
"lm_label": "1. YES\n2. YES\n\n",
"lm_name": "Qwen/Qwen-72B",
"lm_q1_score": 0.9863631635159684,
"lm_q1q2_score": 0.8282826528650059,
"lm_q2_score": 0.8397339676722393,
"openwebmath_perplexity": 778.9735825241737,
"openwebmath_score": 0.654097318649292,
"tags": null,
"url": "http://fnaarccuneo.it/ybbj/modulus-in-maths.html"
} |
python, pandas
df = df[~m]
df = df[~n]
df = df[~o]
df = df[df.home_score != '']
df = df[df.away_score != '']
df = df.dropna()
return df | {
"domain": "codereview.stackexchange",
"id": 42350,
"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, pandas",
"url": null
} |
javascript, beginner, jquery, ebay
// All the HTML markup that goes inside the template tags
var innerMarkup = '<div class="mblFadeWrapper"></div><header class="mblHdr"><img alt="" src="'+src+'">' +
'<nav class="mblNav"><div class="menu-trigger">' +
'<div class="bar"></div><div class="bar"></div>' +
'<div class="bar"></div></div><ul class="mblMainNav"><li><a href="javascript:;" class="one">' + menu1 +
'</a><div class="triangle"></div></li><li><a href="javascript:;" class="two">' + menu2 +
'</a><div class="triangle"></div></li><li><a href="javascript:;" class="three">' + menu3 +
'</a><div class="triangle"></div></li><li><a href="javascript:;" class="four">' + menu4 +
'</a><div class="triangle"></div></li><li><a href="javascript:;" class="five">' + menu5 +
'</a><div class="triangle"></div></li></ul></nav></header>' +
'<div id="mblMobile"><ul class="mblMM"><li><a href="javascript:;" class="one">'+menu1+'</a></li>' + | {
"domain": "codereview.stackexchange",
"id": 8243,
"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": "javascript, beginner, jquery, ebay",
"url": null
} |
css, sass
All of these functions are getting hold together with these variables:
$column-count: 12;
$row-max-width: 1024px;
$gutter-width-px: 15px !default;
$gutter-width-procent: percentage($gutter-width-px / $row-max-width);
The code works perfectly, but in my opinion it looks very messy. Warning: I am far from an expert with Sass!
I'll list a few things I think could use some re-factoring.
We can DRY out your code. In the main function, I see $each-column + $each-gutter three times. Create a variable and assign the variable the sum.
This line: if ($function == 'offset' and $first-child == false) and ($responsive == false) can all be in one pair of parentheses. Breaking it apart actually reduces clarity.
I find that this line:
if ($function == 'push' or $function == 'pull') and ($responsive == false) or ($function == 'offset' and $first-child == true)
is difficult to read. Note my changes in the code below.
A couple instances, things seem mistaken. For example, this line:
if ($function == 'offset' or 'push' or 'pull')
doesn't seem to be correct. I tried to copy this conditional, and I'm surprised you haven't noticed the error.
This statement says: If $function is equal to 'offset', or either 'push' is non-null or 'pull' is non-null. I believe it should be:
if ($function == 'offset' or $function == 'push' or $function == 'pull') and ($responsive == true) { | {
"domain": "codereview.stackexchange",
"id": 8136,
"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": "css, sass",
"url": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.