text
stringlengths
49
10.4k
source
dict
navigation, move-base, amcl Title: move_base problem Hello @all, I am still having a problem with our custom 4-wheel robot. I can move it with keyboard or ArbotixGUI an create a map, that's fine. With move_base started with launchfile and after click on 2D Nav Goal in RVIZ nothing happened. With additional started amcl node in rviz I see the computed route (blue and red) but the movement goes in wrong direction backwards. Here my files. Maybe somebody can look over and may see an error. If you need more information or other files, please let me know. Thank yo for your help Michael The robot: fh_base_control.py #!/usr/bin/env python # Stand 27.05.2013 mha import roslib; roslib.load_manifest('fh_basecontroller') import rospy import tf import math from math import sin, cos, pi import sys import os import time from geometry_msgs.msg import Quaternion, Twist, Point, Pose, Pose2D, PoseWithCovariance, TwistWithCovariance, Vector3 from nav_msgs.msg import Odometry from std_msgs.msg import String from sensor_msgs.msg import JointState from EposManager.msg import MotorInfo from EposManager.msg import EPOSControl import dynamic_reconfigure.server
{ "domain": "robotics.stackexchange", "id": 14400, "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": "navigation, move-base, amcl", "url": null }
local nonlinear Neumann boundary condition: The normal derivative @[email protected] = uq on. You may also want to take a look at my_delsqdemo. Then u(x,t) satisfies in Ω × [0,∞) the heat equation ut = k4u, where 4u = ux1x1 +ux2x2 +ux3x3 and k is a positive constant. We illustrate this in the case of Neumann conditions for the wave and heat equations on the finite interval. Boundary conditions can be set the usual way. FEM2D_HEAT, a MATLAB program which solves the 2D time dependent heat equation on the unit square. Given, for example, the Laplace equation, the boundary. Mixed boundary conditions: These are the conditions resulting from a combination of boundary conditions of the kind of Neumann and Dirichlet. The application mode boundary conditions include those given in Equation 6-23, Equation 6-24, Equation 6-26, Equation 6-27, Equation 6-28 and Equation 6-29,. Multigrid(2D) for nested and solution adapted grids Uses of the Enthalpy method to handle phase change for simulation of melting/freezing Can handle unsteady heat conduction problems with nonlinear material properties High speed, automatic,. Also HPM provides continuous solution in contrast to finite. For the Neumann boundary condition with zero flux, all the. it is assumed that the ow it is only driven by gravity (gravity boundary condition), i. 3 Implementation. Luis Silvestre. The Dirichlet boundary condition is relatively easy and the Neumann boundary condition requires the ghost points. This way I should be able to define a neumann condition at the boundary. More general boundary. 7 Solve the 1-D heat partial differential equation (PDE) 4. 32 and the use of the boundary conditions lead to the following system of linear equations for C i,. 4 Stability analysis with von Neumann's method The von Neumann analysis is commonly used to determine stability criteria as it is generally easy to apply in a straightforward manner. perturbation method in non linear heat transfer equation, International communication in heat and mass transfer, 35(2008)93-102.
{ "domain": "ionoale.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429599907709, "lm_q1q2_score": 0.8062363333225964, "lm_q2_score": 0.8198933293122506, "openwebmath_perplexity": 605.967414960971, "openwebmath_score": 0.8164872527122498, "tags": null, "url": "http://fxhr.ionoale.it/2d-heat-equation-neumann-boundary-conditions.html" }
information-theory, entropy, min-entropy = \sup_x \sup\{-y: \,\, y\in\mathbb{R},\,\, y\in g(x)\} \\ = \sup_x \sup\{z\in\mathbb{R}: \,\, -z\in g(x)\}.$$ In words, we first minimise over the possible values of a function $f$ (restricting the possible inputs $x$ in a specific subset, and taking the opposite of the result), where $f(x)$ is defined as the smallest element of a subset of real numbers that depends on $x$. You can then just replace $\sup\to\max$ and $\inf\to\min$ whenever you know that a min/max exists.
{ "domain": "quantumcomputing.stackexchange", "id": 4658, "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": "information-theory, entropy, min-entropy", "url": null }
classical-mechanics, homework-and-exercises Title: Lagrange's equations: What is $\dot{q}_j$? I'm looking at the solutions to a problem about a uniform thin disk. For the sake of this question, I start with $$L=\frac{1}{2}m\left( r\omega \right)^2$$ Then we plug it into Lagrange's equations: $$\begin{align*} \frac{d}{dt} \frac{\partial L}{\partial \dot{q}_j} - \frac{\partial L}{\partial q_j} &= Q\\ \frac{d}{dt} \frac{\partial \frac{1}{2}m\left( r\omega \right)^2}{\partial \left( r\omega \right)} - \frac{\partial \frac{1}{2}m\left( r\omega \right)^2}{\partial q_j} &= Q \end{align*}$$ How is it that $\dot{q}_j = r\omega$? What is $q_j$ then, as well? I'm thinking along the lines of $$\begin{align*} \dot{q}_j &= r\omega\\ \dot{q}_j &= r\frac{d\theta}{dt}\\ q_j &= r\theta
{ "domain": "physics.stackexchange", "id": 1296, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, homework-and-exercises", "url": null }
astronomy, orbital-motion So instead, what I'd try is to take the first terms from the above, i.e. put $E_0 = M$ or $M/(1-\epsilon)$, and use Newton's method to iterate. That is, iterate with: $E_{n+1} = E_n - \frac{M - E +\epsilon \sin E}{-1+\epsilon\cos(E)}$. To test the method, run a bunch of random data through it, and make sure you test the fence posts (boundary conditions).
{ "domain": "physics.stackexchange", "id": 651, "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": "astronomy, orbital-motion", "url": null }
logistic-regression, numpy 0.48347238 0.50522932 0.50002565 0.5014608 0.48388768 0.50198932 0.51327221 0.49578972 0.50092019 0.49620128 0.47115001 0.50590969 0.50760259 0.48411204 0.46197999 0.48279333 0.4782797 0.48779083 0.46966179 0.48573305 0.46395983 0.46106193 0.5057963 0.51033122 0.49279237 0.48013628 0.48364231 0.50247322 0.49134037 0.48425685 0.50899532 0.50062554 0.47800942 0.48996655 0.49660268 0.49682692 0.49750832 0.47504562 0.50530131 0.47859195 0.50100877 0.49156904 0.48764916 0.47024235 0.48825982 0.50302496 0.48502133 0.49061618 0.51203632 0.45967757 0.49603118 0.49524914 0.49122699 0.48930961 0.47503292 0.47560051 0.50264077 0.47731474 0.50620783 0.4932195 0.50212852 0.48365791 0.48770583 0.50707675 0.49119961 0.50541567 0.48634422 0.46518872 0.49555082 0.48875876 0.47792453 0.49558934
{ "domain": "datascience.stackexchange", "id": 8854, "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": "logistic-regression, numpy", "url": null }
newtonian-mechanics, forces, mass, acceleration, free-fall $$ where $F$ is just some function. (More generally we could write $(\vec{x}_1, \ldots, \vec{x}_N)$ for the position of $N$ particles.) Gallilean invariance implies that, if $\vec{x}(t)$ is some solution to the path of a particle, then $\vec{x}'(t)$ MUST also be a solution, where $\vec{x}'(t) = \vec{x}(t) + \vec{v} t$. So Gallilean invariance says that we must have a symmetry of our laws of motion. Now that we know what Gallilean relativity is, what does it imply? Well, it certainly doesn't mean that everything has a constant acceleration. As has been pointed out, Newtonian $1/r^2$ gravity has Gallilean invariance, but things do not accelerate uniformly. Now, the original quote that you linked to specifically reads
{ "domain": "physics.stackexchange", "id": 76624, "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, mass, acceleration, free-fall", "url": null }
quantum-mechanics, homework-and-exercises, wavefunction For reference, regarding what I understand, my maths is pretty low-level, I took a course in undergrad calculus over 10 years ago and only just passed that at the time, and my physics knowledge is not much further than that of an enthusiastic lay person. The strategy you got from @RobJohn is not correct - specifically, $\begin{align} \int\limits_{-\infty}^{+\infty}{ \left( \Psi^* \left[ \frac{\partial}{\partial x} \right] \Psi \right) }\,\mathrm{d}x \neq \frac{1}{2}|\Psi|^2 \Big|_{-\infty}^{+\infty}, \end{align}$ Since you just asked for hints, here are a couple useful things to know to solve this problem: (1) Since the variables $t$ and $x$ are independent, you can bring the time derivative into the integral. You can also use the derivative product rule to get two terms in the integral. (2) Do you know how to evaluate the time derivative of the wavefunction? Hint: Shrodinger equation The problem involves a bit of algebra, but that should be a start.
{ "domain": "physics.stackexchange", "id": 78031, "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, wavefunction", "url": null }
statistical-mechanics, soft-question, renormalization $$\mathbf{H}'=\mathbf{R}_b(\mathbf{H})$$ In condensed matter physics one focuses on some specific form of $\mathcal{H}$, e.g., the Ising model with just two couplings, (reduced) temperature $t$ and external magnetic field $h$. (Page 665 column two of the article:) An important feature of Wilson’s approach, however, is to regard any such ‘‘physical Hamiltonian’’ as merely specifying a subspace (spanned, say, by ‘‘coordinates’’ t and h) in a very large space of possible (reduced) Hamiltonians, $\mathcal{H}$. The subspace, e.g., physical manifold $\mathbb{H}_0$, will flow in $\mathbb{H}$ under successful renormalization transformation, in which the critical point of $\mathbb{H}_0$ will transform in to a fixed point $\mathcal{H}^*$. We may, however, start with a different initial physical manifold $\mathbb{H}_1$ such that under renormalization transformation, the critical point of $\mathbb{H}_1$ transform into the same fixed point $\mathcal{H}^*$. This is the idea of universality.
{ "domain": "physics.stackexchange", "id": 50662, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, soft-question, renormalization", "url": null }
&=\frac{\left( \sqrt{2}-\sqrt{2}\cdot \sqrt{3}\right) \cdot \mathrm{atan}\left( \frac{{{3}^{\frac{1}{4}}}-\sqrt{2}}{{{3}^{\frac{1}{4}}}}\right) +\left( \sqrt{2}\cdot \sqrt{3}-\sqrt{2}\right) \cdot \mathrm{atan}\left( \frac{\sqrt{2}+{{3}^{\frac{1}{4}}}}{{{3}^{\frac{1}{4}}}}\right) +\left( \sqrt{2}\cdot \sqrt{3}-\sqrt{2}\right) \cdot \mathrm{atan}\left( \sqrt{2}\cdot {{3}^{\frac{1}{4}}}-1\right) +\left( \sqrt{2}\cdot \sqrt{3}-\sqrt{2}\right) \cdot \mathrm{atan}\left( \sqrt{2}\cdot {{3}^{\frac{1}{4}}}+1\right) }{4\cdot {{3}^{\frac{1}{4}}}}\\ &=\dfrac{\left(\sqrt{6}-\sqrt{2}\right)\left(\arctan\left(\sqrt{3+2\sqrt{3}}\right)+\pi-\arctan\left(\sqrt{3+2\sqrt{3}}\right)\right)}{4\times 3^{\tfrac{1}{4}}}\\ &=\boxed{\dfrac{\pi
{ "domain": "brilliant.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9518632302488963, "lm_q1q2_score": 0.8383983443917405, "lm_q2_score": 0.8807970701552505, "openwebmath_perplexity": 4471.129323603746, "openwebmath_score": 0.9999955892562866, "tags": null, "url": "https://brilliant.org/discussions/thread/brilliant-integration-contest-season-3-part-2/" }
evolution, botany, development, fruit, flowers Title: Why does a coconut have exactly three "holes"? Why do coconuts have exactly three "holes", as seen in this picture? A theory says: As coconut is a sibling of palm, somehow long time ago, three palms were in a same husk. Based on evolution theory, it's how the coconut was born in the world with three holes. Reference: "Why does a coconut have exactly three eyes?", Quora The three "holes" are the result of the 3 carpels in coconut flowers, and three carpels is typical of the family Arecaceae (Palms). The "holes" are actually germination pores, where one is usually functional and the other two are plugged. The new coconunt shoot will emerge from the functional, open, germination pore. For further info and pictures, see this webpage or the paper Morphological and anatomical studies of the coconut (Smit 1970, link to pdf), which holds a wealth of information.
{ "domain": "biology.stackexchange", "id": 4466, "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": "evolution, botany, development, fruit, flowers", "url": null }
ros, catkin, library, rosrun Title: error while loading shared libraries I want to use shared objects as libraries. The .so files of them are at my disposal. I created a catkin_package. That package contains a source, include and lib folder (where I put the .so files) My CMakeLists.txt of the package is the following: cmake_minimum_required(VERSION 2.8.3) project(yocto3d) find_package(catkin REQUIRED COMPONENTS) catkin_package() include_directories(include ${catkin_INCLUDE_DIRS}) add_executable(yocto3d src/main.cpp) target_link_libraries(yocto3d ${catkin_LIBRARIES} ${PROJECT_SOURCE_DIR}/lib/libyapi.so.1.0.1 ${PROJECT_SOURCE_DIR}/lib/libyocto.so.1.0.1) Everything compiles without warnings and errors, but when I run rosrun yocto3d yocto3d I get the following error (can't find the libraries) /home/dh/catkin_ws/devel/lib/yocto3d/yocto3d: error while loading shared libraries: libyocto.so.1.0.1: cannot open shared object file: No such file or directory What am I missing? Originally posted by Chrizzl on ROS Answers with karma: 48 on 2017-10-03 Post score: 0 I copied the two libraries (.so files) to /usr/lib. When running the program the files in this folder will be used, when compiling with catkin_make the files in catkin_ws/src/yocto3d/lib will be used. In conclusion: the paths to the libraries are different when compiling and when running the program. Originally posted by Chrizzl with karma: 48 on 2017-10-04 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 28989, "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, catkin, library, rosrun", "url": null }
ros, ros-melodic, gazebo-ros-control Title: Do I need PID gains for velocity_controllers? I would like to use velocity_controllers/JointGroupVelocityController. In ros_controllers, the controllers velocity_controllers/JointVelocityController and velocity_controllers/JointGroupVelocityController are forward command controller. My understanding is that the controller doesn't need pid gains; but if I compile my code, I get these errors [ERROR] [1653642231.819643360, 0.195000000]: No p gain specified for pid. Namespace: /rrbot/gazebo_ros_control/pid_gains/joint1 [ERROR] [1653642231.820926527, 0.195000000]: No p gain specified for pid. Namespace: /rrbot/gazebo_ros_control/pid_gains/joint2 I'm using Gazebo 9 and melodic. Originally posted by CroCo on ROS Answers with karma: 155 on 2022-05-27 Post score: 0 I have not used a velocity_controller, but I think the answer to your title question is "No". As far as I know, that situation is not really an ERROR, and the log level should be more like INFO. #q293830 has more discussion of this. Originally posted by Mike Scheutzow with karma: 4903 on 2022-05-27 This answer was ACCEPTED on the original site Post score: 1 Original comments Comment by CroCo on 2022-05-28: When I add gazebo_ros_control/pid_gains, the arms falls down but removing them, the arm doesn't fall down. Interesting. I'm not sure what Gazebo is doing with the pid gains so that velocity controller is not able to maintain the zero setpoint. But again, forward command controller doesn't need any internal controller to map its input.
{ "domain": "robotics.stackexchange", "id": 37715, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-melodic, gazebo-ros-control", "url": null }
game, f#, dependency-injection, checkers-draughts anyHopIsValid hopCoords let internal hasValidCheckerJump startCoord (board :Board) = let jumpCoords = [ offset startCoord {Row = -2; Column = 2}; offset startCoord {Row = -2; Column = -2}; offset startCoord {Row = 2; Column = 2}; offset startCoord {Row = 2; Column = -2} ] let rec anyJumpIsValid jumps = let coord::tail = jumps match coordExists coord && isValidJump startCoord coord board, tail with | true, _ -> true | false, [] -> false | false, _ -> anyJumpIsValid tail anyJumpIsValid jumpCoords let internal hasValidKingJump startCoord (board :Board) = let jumpCoordOffsets = [ {Row = -1; Column = 1}; {Row = -1; Column = -1}; {Row = 1; Column = 1}; {Row = 1; Column = -1} ] let currentPlayer = (square startCoord board).Value.Player let rec getJumps acc jumpOffsets = let rec checkBetweenCoords currentCoord rowSign colSign = let nextCoord = offset currentCoord {Row = rowSign; Column = colSign} match currentCoord, nextCoord with | _, c when not <| coordExists c -> None | cc, cn when ((square cc board).IsSome && (square cc board).Value.Player = currentPlayer) || (square cn board).IsSome -> None | cc, cn when (square cc board).IsSome && (square cc board).Value.Player <> currentPlayer && (square cn board).IsNone -> Some (offset currentCoord {Row = rowSign; Column = colSign}) | _ -> checkBetweenCoords nextCoord rowSign colSign
{ "domain": "codereview.stackexchange", "id": 25914, "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": "game, f#, dependency-injection, checkers-draughts", "url": null }
computer-vision, opencv, 3d-reconstruction, monocular, 3d-model For the least squares problem it will be assumed that for each camera its parameters $R_i$, $\vec{t}_i$, $\alpha_i$, $\beta_i$, $\gamma_i$ and $\delta_i$ are known and that the pixel coordinates $u_i$ and $v_i$ of the point that has to be triangulated are known as well. In this case the least squares problem can be formulated as follows $$ (x,y,z) = \arg\min_{x,y,z} \sum_{i\in\mathcal{I}} (\hat{u}_i - u_i)^2 + (\hat{v}_i - v_i)^2 \\ \text{s.t.} \begin{bmatrix} \hat{x}'_i \\ \hat{y}'_i \\ \hat{z}'_i \end{bmatrix} = R_i \, \begin{bmatrix} x \\ y \\ z \end{bmatrix} + \vec{t}_i, \\ \hat{u}_i = \alpha_i\,\frac{\hat{x}'_i}{\hat{z}'_i} + \gamma_i, \\ \hat{v}_i = \beta_i\,\frac{\hat{y}'_i}{\hat{z}'_i} + \delta_i, $$ where $\mathcal{I}$ is the set of all indices of the cameras which see the considered point. You could also add weights to each quadratic term in the summation, for example to reduce the influence of bad or low resolution cameras. The error terms in the summation are also known as the reprojection errors.
{ "domain": "robotics.stackexchange", "id": 1718, "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": "computer-vision, opencv, 3d-reconstruction, monocular, 3d-model", "url": null }
javascript, jquery, html, html5, form <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
{ "domain": "codereview.stackexchange", "id": 19396, "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, html, html5, form", "url": null }
quantum-field-theory, special-relativity, poincare-symmetry Title: Trying to rhyme Peskin and Schroeder with Weinberg This is a follow up question of this one. In the Vol 1, Weinberg derives how a unitary operator $U(\Lambda)$ acts on one-particle states, which is given by equation (2.5.2): \begin{equation} U(\Lambda)|p,\sigma\rangle = \sum_{\sigma'} C_{\sigma' \sigma}(\Lambda,p)|\Lambda p, \sigma'\rangle \end{equation} Am I correct in thinking that Peskin and Schroeder use this result to derive the Lorentz transformation on a annihilation operator of the quantized Dirac field (given by equation (3.106)): \begin{equation} U(\Lambda) a^s_{\mathbf{p}}U^{-1}(\Lambda) = \sqrt{\frac{E_{\Lambda\mathbf{p}}}{E_{\mathbf{p}}}} a_{\Lambda \mathbf{p}}^s \end{equation} However, Peskin and Schroeder are only considering Lorentz transformations that do not mix states with different spin indices! In other words, the first equation I wrote becomes: \begin{equation} U(\Lambda)|p,\sigma\rangle = C|\Lambda p, \sigma\rangle \end{equation} where $C$ is normalization constant which can be determined to be $C=1$. If this is not correct, can you please let me know how they (Peskin and Schroeder) have derived equation (3.109)? I hope this question is not too confusing. Edit: for you to see my reasoning. We can now write (for $C=1$): \begin{equation}
{ "domain": "physics.stackexchange", "id": 10499, "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, special-relativity, poincare-symmetry", "url": null }
isotope On top of the previous 254, another 34 isotopes have half-lives which have actually been measured in laboratory, but are still large enough (>50 million years) so that a small fraction of the isotope could conceivably have survived since the creation of the Earth 4.6 billion years ago, and may be of interest in geological timescales. There are also isotopes with smaller half-lives, but which are continuously replenished by the decay of heavier atoms or by the action of cosmic rays, so they can still be found on Earth today. In all, about 339 different isotopes can be found naturally on our planet. However, as many as 3100-3300 different isotopes of the first 118 elements are claimed to have been detected in laboratories, most of them with very small half-lives (seconds or less). Nobody knows for sure how many elements and how many isotopes can exist, though the number is finite.
{ "domain": "chemistry.stackexchange", "id": 2872, "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": "isotope", "url": null }
c#, .net, extension-methods public static bool IsNullOrEmpty(this ICollection value) { return (!value.NotNullAndNotEmpty()); } } It is comfortable (habit) for me to use this helper, but I am not sure that it is correctly (worth it). How about performance? Are there any other reasons to not use it? This gets to be a sticky point. There are those who will argue fervently that an extension method should never work on a null reference, and there are those who are fine with that. Personally, I don't mind extension methods on null if the name is a clear indicator that null is a possibility (like IsNullOrEmpty) but as I said, that's my opinion and may not match others. Don't worry about the performance, method calls are not a serious impact and check methods like this eliminate some of the readability concerns over compound expressions when maintaining the code. After all, that's what string.IsNullOrEmpty() does, but it does it through a static method instead of an extension method. So the only concern, really, you may get push back that these are extension methods as opposed to ordinary static methods, but you'll get differing opinions on whether calling an extension method on null is bad/okay. One could argue Microsoft disallows LINQ extension methods on null sequences, but then again Microsoft also doesn't disallow extension method calls on a null source in general. So, the choice is yours, I don't have an issue with them since the names clearly indicate null is an accepted possibility, but I can see both sides of the argument. On a side note, I'd keep your naming consistent: NotNull -> IsNotNull NotNullAndNotEmpty -> IsNotNullAndNotEmpty
{ "domain": "codereview.stackexchange", "id": 955, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, extension-methods", "url": null }
To be clear, I am working to solve for $\Phi(r)$ in terms of $r$, and want to know how to implement the boundary conditions described by the jump conditions. f[r_] = 1 - R/r; DSolve[D[f[r] D[Φ[r], r], r] - ((l (l + 1))/r^2) Φ[r] == 0, Φ[r], r] The code works fine as is, and gives a hypergeometric function which is expected, but the function isn't of the right form since I haven't included any boundary conditions, which I have no idea how to implement. • Please translate your equations into Mathematica syntax and provide at least your initial attempts at using DSolve etc. Feb 21 '17 at 22:49 – Karl Feb 22 '17 at 2:31 • You need to solve this symbolically? Feb 22 '17 at 3:55 • What are the other boundary conditions, say, at rmin and rmax? Is l an integer? Feb 22 '17 at 18:57 • Yes, it needs to be solved symbolically, numerically isn't useful. r_min is zero and r_max is infinity. $l$ is an integer. I've edited the original post for this. – Karl Feb 22 '17 at 20:30 I am unable to solve this system for arbitrary positive integer l, perhaps because there is a bug in DSolve. (See question 138440.) However, it can be solved for any particular l. For instance, with l == 1,
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877692486438, "lm_q1q2_score": 0.8002951018648664, "lm_q2_score": 0.8244619199068831, "openwebmath_perplexity": 1407.9544450381832, "openwebmath_score": 0.6461604237556458, "tags": null, "url": "https://mathematica.stackexchange.com/questions/138321/dsolve-around-a-jump-condition" }
gravity Title: At what velocity would an object have to fall in order to become weightless? Assume an object is falling toward the earth then at what velocity would the object be weightless? Taking the air resistance into account might be a factor here so lets assume no air resistance to simplify matters. There's no speed at which you experience weightlessness; to stay weightless, you need to keep getting faster and faster all the time. From our perspective on Earth, everything accelerates downward at about 9.8$\frac{m}{s^2}$ ($32\frac{ft}{s^2}$). Weightlessness is what happens when you're accelerating at exactly that rate, whether it's because you jumped off a rock or you're in orbit (which is just falling while moving forward fast enough to keep missing the planet). As long as you're accelerating downward as fast as gravity will let you, you're in freefall and experience weightlessness. That's pretty difficult, though. A skydiver starts out in freefall, and they feel weightless for a few seconds, but the wind resistance (or "drag") on their body quickly grows, reducing their acceleration and increasing their apparent weight until they're eventually not accelerating at all. We call that "terminal velocity", and it's usually around 53 meters per second (120 miles per hour) in the spread-eagle position. At that point they're not weightless anymore; their body is experiencing the same weight as if they were laying face-down on a bed, just with a lot more wind. There are ways to make it work, though. The famous "Vomit Comet" aircraft are designed to fly in an arc that lets them maintain that perfect acceleration for a short period despite the drag trying to slow them down, and inside the cabin, the passengers can float around as if they're weightless. (The name comes from the fact that weightlessness often makes people feel sick at first, as their body isn't used to that feeling lasting for an extended time.) If there were no air and you were to bring yourself to a perfect stop many miles above the surface, you'd be weightless all the way down, getting faster and faster without limit until you hit the ground at some incredible speed and left quite a crater behind.
{ "domain": "astronomy.stackexchange", "id": 7190, "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", "url": null }
rigid-body-dynamics where $m$ is the mass of the wheel, $I_C$ is the mass moment of inertia of the wheel about the center of mass, $N$ is the contact normal force, and $F$ is the traction required to keep the wheel from slipping. The solution of the above is $$ \boxed{ \ddot{\phi} = - \frac{m\,c\left(g+R\dot{\phi}^{2}\right)\sin\phi+\tau_{O}}{I_{C}+m\left(R^{2}+c^{2}-2Rc\cos\phi\right)}} \tag{5}$$ and to confirm, if the eccentricity is zero, $c=0$, then $\ddot{\phi} = - \frac{\tau_O}{I_C + m R^2}$ which matches what is expected. Analytical solution to (5) does not exist, because it is inhomogeneous and it depends on $\phi$ and $\dot{\phi}$ at the same time. But it is just a 1D ODE in terms of the angle of the wheel $\phi$, which means it is well suited for a numerical simulation. There are some interesting situations that you need to check. For example, if at any point $N \leq 0$ it means the wheel is no longer in contact with the ground. And when $|F| > \mu |N|$ it means the wheel is slipping. For both of those situations, the equations of motion change and a new set needs to be implemented in a simulation environment to get good results. Appendix I Calculation of moment arm of contact forces about the center of mass
{ "domain": "physics.stackexchange", "id": 92805, "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": "rigid-body-dynamics", "url": null }
ListDensityPlot[lst, MaxPlotPoints -> 1000] Memory consumption using MaxMemoryUsed: miu0 = MaxMemoryUsed[] lst = Table[Sin[x^2 + y^2], {x, 2^7}, {y, 2^13}]; usg0 = MaxMemoryUsed[] - miu0 miu1 = MaxMemoryUsed[] ListDensityPlot[lst, MaxPlotPoints -> 1000]; usg1 = MaxMemoryUsed[] - miu1 miu2 = MaxMemoryUsed[] ListDensityPlot[lst]; usg2 = MaxMemoryUsed[] - miu2 Incremental memory consumption: {usg0, usg1, usg2} (* ==> {96 881 240, 447 831 576, 3 243 923 016} *) That is, the input data and plotting with MaxPlotPoints->1000 should not trigger Out Of Memory issues, while without the explicit MaxPlotPoints producing the plot consumes more than 3G of additional memory beyond what is needed for holding the input data. - I think this is just I want! – yulinlinyu Jun 28 '12 at 3:13 @yulinlinyu, thank you for the accept. – kguler Jun 28 '12 at 3:45 @yulinlinyu, you can change your mind about which answer to accept any time; and if this were my question i would choose Jens's answer. Try, for example, lst = Table[Sin[x^2 + y^2], {x, 2^10}, {y, 2^10}]; Image[lst]//Colorize to see why. – kguler Jun 28 '12 at 10:33 Thank you for your kindness. The code in your advice is so amazing that I cannot imagine it before. – yulinlinyu Jun 28 '12 at 11:56 You can use a Span to only use some of the points. E.g. lst[[;; ;; 10, ;; ;; 10]] will take every 10th point (in each dimension). This is of course a rather crude way of down sampling.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9161096158798118, "lm_q1q2_score": 0.8069066828073215, "lm_q2_score": 0.8807970889295664, "openwebmath_perplexity": 2071.7848937983986, "openwebmath_score": 0.4771089553833008, "tags": null, "url": "http://mathematica.stackexchange.com/questions/7552/plotting-large-datasets/7556" }
This proof says we can now just let $$s=m$$, which sets us up to use Pascal's Identity, but I find this strange to do, since we just had $$m=s-1$$ in the previous line. Is this okay or is there another way to go about this? • I suppose that, when you wrote $\binom n{s-1}$, what you meant was $\binom n{m-1}$. – José Carlos Santos May 20 at 17:03 The main thing in the proof is that: $$\sum_{m=0}^n\binom{n}{m}x^{m+1}y^{n-m}=\sum_{m=1}^{n+1}\binom{n}{m-1}x^{m}y^{n+1-m}\tag1$$ This can also be observed without interference of any $$s$$. If you agree that $$(1)$$ is correct then just go on ignoring the artificial $$s$$ and apply the equality $$\binom{n}{m-1}+\binom{n}{m}=\binom{n+1}{m}$$ This leads to:$$(x+y)^{n+1}=\cdots=\sum_{m=0}^{n+1}\binom{n+1}{m}x^my^{n+1-m}$$q.e.d. This is OK because you're setting $$m=s$$ only in the second sum, which is a trivial change of variable since the index is free, or a dummy. Thus, in the first sum, we still have $$s=m+1.$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9643214460461697, "lm_q1q2_score": 0.8097734720659208, "lm_q2_score": 0.8397339656668287, "openwebmath_perplexity": 150.83683387493105, "openwebmath_score": 0.8710566163063049, "tags": null, "url": "https://math.stackexchange.com/questions/3233329/binomial-theorem-inductive-proof-a-reindexing-moment" }
javascript, python, html // and so on... } // ... (You could also load the JSON object with an Ajax request and avoid templating in your JavaScript entirely, but that might be overkill.) Already that looks a lot cleaner but you still have a lot of repetition. Basically the only thing different between your four if blocks is one word: certification, recertification, study_pdf and study_book. So why not put those four words in an array and then reuse the same code four times? var tests = {{ json.dumps( tests ) }}, // this is the only template insertion // here's your four words: types = [ 'certification', 'recertification', 'study_pdf', 'study_book' ] total = 0, numTests = 0, test, testIdPfx, type, price ; for ( var testIdx; testIdx < tests.length; testIdx++ ) { test = tests[ testIdx ] testIdPfx = '#buy-' + test.acronym + '-'; // repeat for each of the four words in `types` for ( var typeIdx; typeIdx < types.length; typeIdx++ ) { type = types[ typeIdx ]; // exploit the fact that `test.foo` and `test['foo']` are equivalent in JavaScript price = test[ type + '_price' ]; if ( price && $( testIdPfx + type ).is( ':checked' ) ) { total += price; numTests++; } } } // ... (Note: You'll have to adjust your markup to have #buy-{{ test.acronym }}-study_pdf insteady of just -pdf and #buy-{{ test.acronym }}-study_book instead of -book to match the types values, or vice versa.) A nice side-effect of doing the main for loop in JavaScript instead of the templating system is that you're sending proportionally less JavaScript code to the client, which saves on bandwidth. If you wanted you could perform a similar reduction in your markup. Hope that helps!
{ "domain": "codereview.stackexchange", "id": 1313, "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, python, html", "url": null }
c++, memory-management I don't see a good reason for storage_t or entry_t to be public types. I share your concern that casting a T* to obtain the corresponding entry_t can't be guaranteed - but I can't see a good O(1) replacement right now. Perhaps using std::aligned_union instead of std::aligned_storage+entry_t is the right way to go? The assert in getId_() is (pedantically) unsafe if called with an entry that's not contained in storage_, because the comparison operators for pointers are defined only if they point into the same object. And misuse of the public interface could get us there, by asking us to destroy a T* that was not allocated by this. The interface provides a full() test, but no empty(). The latter would be useful - perhaps at the end of a program if I want to ensure I released everything I allocated. It's a shame you didn't provide a selection of tests, or a small application to exercise the interface (some of us like to run the code we're reviewing, to confirm the "feel" of it).
{ "domain": "codereview.stackexchange", "id": 27310, "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++, memory-management", "url": null }
matrix is a real number. The solution has applications in computer vision, molecular modeling. 2 Tensor Transformation Rule. There is a bijective correspondence between subgroups of G' and subgroups of G that contain K: {subgroups of G that contain K} <--> {subgroups of G'}. If A is an orthogonal matrix then why is it's inverse also orthogonal and what does this mean in terms of rotation? Asked by Wiki User. Orthogonal Matrix Properties: VIEW MORE. Vectors A and B are given by and. To check for its orthogonality steps are: Find the determinant of A. Set the matrix. Applied first property of orthogonal matrices. To perform operations on Python Matrix, we need to import Python NumPy Module. There may be an arbitrary number of unit vectors a i in the above sum. It decomposes matrix using LU and Cholesky decomposition. The trace of a square matrix is the sum of its diagonal elements. A unitary matrix of order n is an n × n matrix [u ik] with complex entries such that the product of [u ik] and its conjugate transpose [ū ki] is the identity matrix E. Latin Squares (An Interactive Gizmo). (9) If Ais symmetric, then for any x;y 2Rn, (Ax) y = x(Ay). A subrepresentation of a representation is defined as the restriction of the action of π to a subspace U ⊂ V = Cn such that U is invariant under all repre-. Then, the angle between Au and u(u=[1,0]^') is. Let X be a n × n Hermitian matrix with rank(X) =r and let Qk be an n × k matrix, k ≤ r, withkorthonormal columns. com is the most convenient free online Matrix Calculator. For an orthogonal matrix M 1 = MT. Orthogonal matrices are important because they have interesting properties. are implemented. Thus, the goal is to find a matrix F that complies with the power. Suppose that \(V$$ is a vector space with a subspace $$U\text{. unitarily equivalent matrices are similar, and trace, determinant and eigenvalues of similar matrices coincide. 'auto' (default) - see if the matrix entries are ordered (i.
{ "domain": "loscoprisport.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.979354072876341, "lm_q1q2_score": 0.8182342109010522, "lm_q2_score": 0.8354835432479661, "openwebmath_perplexity": 616.5236194341313, "openwebmath_score": 0.8378595113754272, "tags": null, "url": "http://aqw.loscoprisport.it/trace-of-orthogonal-matrix.html" }
ros, ros-kinetic, use-sim-time, clock Title: How use_sim_time works? I am currently working on VIORB SLAM which using both camera and imu. I have to make the system work without ROS, but currently I successfully run the recorded datasets using use_sim_time only. This link and link doesn't provide me any detail in depth about how it work. Can anyone explain me how use_sim_time works? Originally posted by Rasp on ROS Answers with karma: 3 on 2018-04-14 Post score: 0 The documentation you link to does describe how it works. As stated in section 2, when the parameter use_sim_time is true, the ROS API used to get times (e.g. ros::Time time = ros::Time::now()) will retrieve time data from the /clock topic rather than using the system clock. If you have something publishing time values to that topic (such as rosbag or Gazebo) then this means any nodes using the ROS time APIs will act as though the time is what /clock says it is. If you turn use_sim_time off then any time values published to /clock will be ignored, meaning that any data published by rosbag will have time stamps that are different (probably massively different) from the current system time, and so data processing nodes may ignore that data as being out of date. The /clock topic is useful for more than just playing back older data. If you write your nodes to process data based on times from the ros::Time API and not from its own loop, then you can effectively slow down and even stop the functioning of your system by controlling the /clock topic. This is particularly useful when working with simulations. Originally posted by Geoff with karma: 4203 on 2018-04-15 This answer was ACCEPTED on the original site Post score: 6 Original comments Comment by Rasp on 2018-04-25: thank you so much, I finally understand it. Comment by Kansai on 2021-09-07: does using use_sim_time have any effect on the values of /clock that are published by rosbag play --clock?
{ "domain": "robotics.stackexchange", "id": 30636, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, use-sim-time, clock", "url": null }
gnuradio, synchronization, pll Why don't the recommended values in control_loop take N into account? How can the loop bandwidth in GNU Radio synchronization be configured as a percentage of the symbol rate? I can only answer your second question: "How can the loop bandwidth in GNU Radio synchronization be configured as a percentage of the symbol rate?" The tracking loop in the symbol synchronizer block operates at the symbol rate, estimating timing error and making a correction once per symbol. So the sample rate of the error signal from the TED is at approximately 1 sample/symbol. (I say approximately, because technically the block is continually estimating symbol clock error and adjusting its estimate of the symbol clock period, but its objective, nominal operating rate is 1 error sample/symbol.) This means that in terms of normalized digital radian frequency, $\omega T_s$, for the loop filter, the symbol frequency corresponds to $2\pi$ radians/symbol. The loop bandwidth parameter of the symbol synchronizer block is expected in units of the normalized digital radian frequency. So when one specifies $\dfrac{2\pi}{200}$ for $\omega_n T_s$, one is specifying an approximate one-sided loop filter bandwidth of $2\pi \cdot 0.5\%$ radians/symbol, a one-sided filter bandwidth that is $0.5\%$ of the symbol frequency. To express the loop bandwidth input of the symbol synchronizer block as a percentage of the symbol frequency, just use $$\mbox{(one-sided) loop bandwidth} = \omega_n T_s = 2\pi \cdot n\%$$
{ "domain": "dsp.stackexchange", "id": 7007, "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": "gnuradio, synchronization, pll", "url": null }
java, strings, android, error-handling, kotlin var colorError: Int = Color.RED set(colorError: Int) { field = colorError error!!.setTextColor(colorError) } private var input: EditText = view.findViewById(R.id.input)!! private var error: TextView = view.findViewById(R.id.error_text)!! init { error!!.setTextColor(colorError) } } also We can make the code above a bit simpler by using also: also is a function which is called upon a variable (called the receiver). also will return the receiver and accepts a lambda as parameter. Inside that lambda, it gives one parameter: the receiver. Therefor the following code: class InputTextAlertDialog(context: Context) : BaseAlertDialog(context) { private var error: TextView = view.findViewById(R.id.error_text)!! init { error!!.setTextColor(colorError) } } can be reduced to: class InputTextAlertDialog(context: Context) : BaseAlertDialog(context) { private var error: TextView = view.findViewById(R.id.error_text)!! .also{ v: TextView -> v.setTextColor(colorError) } } And if there is only one param, it can be accessed using it: class InputTextAlertDialog(context: Context) : BaseAlertDialog(context) { private var error: TextView = view.findViewById(R.id.error_text)!! .also{ it.setTextColor(colorError) } }
{ "domain": "codereview.stackexchange", "id": 38161, "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, strings, android, error-handling, kotlin", "url": null }
python, interview-questions elif direction == "vert": wordRange = seek(tile.x, tile.y, "horiz", squares) y = tile.y wordBonus = 1 for x in range(wordRange[0], wordRange[1] + 1): # Find the word word = word + squares[(x, y)].letter # Score the word letterBonus = 1 letterValue = letters.score[squares[(x, y)].letter] if squares[(x, y)].age == 0: bonus = squares[(x, y)].multiplier if bonus == "DW": wordBonus = 2*wordBonus elif bonus == "TW": wordBonus = 3*wordBonus elif bonus == "DL": letterBonus = 2*letterBonus elif bonus == "TL": letterBonus = 3*letterBonus else: pass wordScore = wordScore + letterValue*letterBonus wordScore = wordScore*wordBonus else: raise NameError('Wrong direction') if wordRange[0] != wordRange[1]: wordList.append(word) # Add perpendicular word to word list score = score + wordScore # Bingos if len(newTiles) == 7: score = score + 50 # Now we have counted all the tiles and found all the words! return [wordList, score]
{ "domain": "codereview.stackexchange", "id": 2237, "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, interview-questions", "url": null }
slam, navigation, rosmake, ros-electric meanwhile I download a libQtOpenGL.so file,and put it into /lib/i386-linux-gnu/ but now,Error are different: Linking CXX executable ../bin/rgbdslam CMakeFiles/rgbdslam.dir/src/graph_manager.o: In function `LinearSolverCholmod': /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:75: undefined reference to `cholmod_start' /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:75: undefined reference to `cholmod_start' CMakeFiles/rgbdslam.dir/src/graph_manager.o: In function `g2o::LinearSolverCholmod<Eigen::Matrix<double, 6, 6, 0, 6, 6> >::init()': /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:98: undefined reference to `cholmod_free_factor' CMakeFiles/rgbdslam.dir/src/graph_manager.o: In function `~LinearSolverCholmod': /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:89: undefined reference to `cholmod_free_factor' /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:92: undefined reference to `cholmod_finish' /home/zhutou/ros/g2o/include/g2o/solvers/cholmod/linear_solver_cholmod.h:89: undefined reference to `cholmod_free_factor'
{ "domain": "robotics.stackexchange", "id": 10393, "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": "slam, navigation, rosmake, ros-electric", "url": null }
quantum-mechanics, electromagnetic-radiation, approximations Title: Light Rays that are Perfectly Parallel I just heard this simple reasoning in a documentary film: Light rays from distant stars are perfectly parallel. This is pretty interesting thought. In nature, it is hard to find something really perfect. For example, there are no isolated systems -- only quasi-isolated. But here it looks like indeed the light rays are perfectly parallel. Maybe this can be confirmed by calculations? -- e.g. that angle between two light rays cannot be infinitely small (Planck constant will be probably involved?). In this case "perfectly parallel" means "more closely parallel than can be detected". How parallel is that? Consider the geometry. The biggest angular deviation possible is between a photon originating from the left side of the star impinging on the right side of the detector and vice versa. By the small angle approximation we can write this difference as $$ \Delta \theta = 2\frac{(r_{star} + r_{scope})}{d_{star}} $$ where the $r$'s are the radii of the objects and the $d$ is the distance from the star to the Earth. A nearby star is Alpha Centari A. Distance: 4.93 light years $\approx 4.67 \times 10^{16}\text{ m}$ Diameter: 440,000 miles $\approx 7.08 \times 10^8\text{ m}$ A big telescope is either of the 10 meter jobs at the Keck observatory. Which gives us a maximum angular deviation of $$\Delta \theta_{max} \approx 2\frac{7.1 \times 10^8}{4.7 \times 10^{16}} \approx 1.5 \times 10^{-8} \text{ radians} \approx 2.7 \times 10^{-6} \text{degrees}$$ That's pretty parallel.
{ "domain": "physics.stackexchange", "id": 2419, "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, electromagnetic-radiation, approximations", "url": null }
quantum-mechanics, hilbert-space, superposition, thought-experiment, schroedingers-cat Title: Schrödinger's cat; why was it necessary? Could someone please explain to me the idea that Schrödinger was trying to illustrate by the cat in his box? I understand that he was trying to introduce the notion of the cat being both alive and dead at the same time. But why was it necessary to introduce this thought experiment and what did it achieve? First, a historical subtlety: Schrödinger has actually stolen the idea of the cat from Einstein. Second, both men – Einstein and Schrödinger – used the thought experiment to "explain" a point that was wrong. They thought it was absurd for quantum mechanics to say that the state $a|{\rm alive}\rangle+b|{\rm dead}\rangle$ was possible in Nature (it was claimed to be possible in quantum mechanics) because it allowed the both "incompatible" types of the cat to exist simultaneously. Third, they were wrong because quantum mechanics does imply that such superpositions are totally allowed and must be allowed and this fact can be experimentally verified – not really with cats but with objects of a characteristic size that has been increasing. Macroscopic objects have already been put to similar "general superposition states". The men introduced it to fight against the conventional, Copenhagen-like interpretations of quantum mechanics, and that's how most people are using the meme today, too. But the men were wrong, so from a scientifically valid viewpoint, the thought experiment shows that superpositions are indeed always allowed – it is a postulate of quantum mechanics – even if such states are counterintuitive. Similar superpositions of common-sense states are measured so that only $|a|^2$ and $|b|^2$ from the coefficients matter and may be interpreted as (more or less classical) probabilities. Due to decoherence, the relative phase is virtually unmeasurable for large, chaotic systems like cats, but in principle, even the relative phase matters.
{ "domain": "physics.stackexchange", "id": 14924, "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, hilbert-space, superposition, thought-experiment, schroedingers-cat", "url": null }
quantum-mechanics, homework-and-exercises, hydrogen Title: Technical detail in the solution of the hydrogen atom I'm trying to do an exercise in which you solve the Schrödinger equation for the hydrogen atom. Through the exercise, I've already shown that the wavefunction is: $$ \psi_{n\ell m}(r,\theta,\varphi) = R_{n\ell}(r)Y^m_\ell (\theta,\varphi)$$ and that $Y^m_\ell (\theta,\varphi)$ are the spherical harmonics. Then, when solving for the radial part, the exercise tells me we need to study the asymptotic behaviour of $R(r)$ for large and small $r$. I had no problem showing that $R(r) \overset{\underset{+\infty}{}}{\sim} e^{-kr}$ but then the exercise gets completely bananas for the asymptotic part for small $r$. It tells me to introduce $u(r) \doteqdot rR(r)$, and then I managed to show the Schrödinger equation becomes: $$-\frac{\hbar^2}{2m}{\mathrm{d}^2 u(r) \over \mathrm{d}r^2} - \frac{e^2}{4\pi\epsilon_0r}u(r)+\frac{\hbar^2}{2m}\frac{\ell(\ell+1)}{r^2}u(r) = E_n u(r)$$
{ "domain": "physics.stackexchange", "id": 6470, "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, hydrogen", "url": null }
classical-mechanics, potential, vectors, differentiation \end{align*} Note that $(1, 1, 1, 0, 0, 0)$ points along $\mathbf{r}_1$. The last line is just Newton's law of gravity $\mathbf{F}_G = \frac{1}{r^2}\mathbf{e}_r$. So your comment is correct.
{ "domain": "physics.stackexchange", "id": 77500, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "classical-mechanics, potential, vectors, differentiation", "url": null }
and quantity demanded are some many other such variables. Quiz 1. Let’s start things out with a couple of optimization problems. To check the temperature variation. Let’s take a quick look at an example of using these. = x .p (x), The profit is calculated by subtracting the total cost from the total revenue obtained by selling x units of a product. Variable Cost : The variable cost is the sum of all costs that are dependent on the level of production. To ensure that the derivative is zero at the profit maximising level of the decision variable (i.e. Share Your Word File Translate the English statement of the problem line by line into a picture (if that applies) and into math. The process of optimisation often requires us to determine the maximum or minimum value of a function. Look back at the question to make sure you answered what was asked. The “Starch Derivatives Market by Type (Glucose Syrup, Modified Starch, Maltodextrin, Hydrolysates, Cyclodextrin), Raw Material (Corn, Cassava, Potato, Wheat), Application (Food & Beverages, Industrial, and Feed), Form, and Region - Global Forecast to 2025” report has been added to ResearchAndMarkets.com’s offering.
{ "domain": "mintong.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9693241991754918, "lm_q1q2_score": 0.8077616939978648, "lm_q2_score": 0.8333245932423308, "openwebmath_perplexity": 673.9267682321221, "openwebmath_score": 0.5393214225769043, "tags": null, "url": "http://blog2.mintong.org/category/9c3fdf-application-of-derivatives-in-business" }
quantum-mechanics, quantum-field-theory, electromagnetism, quantum-electrodynamics, field-theory \end{align}$$ These supplementary conditions imply that each component of $G$ satisfies the Klein-Gordon equation. (The only exception is the scalar case where there are no supplementary conditions because there's no indices. In this case there's just the KG equation $\Box G = 0$.) It is also shown that these conditions imply that the field has a definite helicity of $(A-B)/2$ and there is only one degree of freedom in such a field. Physical fields are made of the sum of two such fields of opposite helicity This is clearly the case for the EM field strength $F_{\mu\nu}$ when written in the form $F_{\alpha\beta\dot\alpha\dot\beta}=(\sigma^\mu)_{\alpha\dot\alpha}(\sigma^\nu)_{\beta\dot\beta}F_{\mu\nu}=2\varepsilon_{\alpha\beta}\bar{F}_{\dot\alpha\dot\beta} + 2\varepsilon_{\dot\alpha\dot\beta}F_{\alpha\beta}$, so the field strength decomposes into the sum of two massless fields carrying helicity $\pm1$. There's a good description of the field representations of the Poincare group in section 1.8 of Ideas and Methods in Superspace and Supergravity. Section 1.8.3 deals with the massless representations applicable in the two cases raised in your question. Section 1.8.4 has the examples of massless scalar, spin-1/2, EM (spin-1), spin-3/2 and linearized gravity (spin-2).
{ "domain": "physics.stackexchange", "id": 1080, "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-field-theory, electromagnetism, quantum-electrodynamics, field-theory", "url": null }
organic-chemistry, alcohols, organophosphorus-compounds Animal studies are consistent in reporting a decrease in the body weight of rats receiving ethanol solutions as the only source of liquids. Concentrations of ethanol as low as 5% (v/v), which are similar to the ethanol content of a Brazilian beer, or as high as 40% (v/v), solution similar to spirit drinks, are related to decreased body weight gain (9). Similar results have been reported for 20% (v/v) ethanol solution (10). Different results have been obtained for malnourished animals. Da-Silva et al. (11), studying rats which had been treated with ethanol for 90 days, reported a significant weight gain by malnourished rats (50% food restriction) drinking a 20% (v/v) ethanol solution when compared to malnourished rats drinking water. A more recent study (12) reported improvement in somatic and motor development and a decrease in the mortality rate of the offspring of malnourished rats drinking low doses of ethanol (5%, v/v). These data suggest that malnourished rats can benefit from ethanol calories. In summary, in spite of the large number of studies on the effects of ethanol in well-nourished animals and humans, there is still controversy about how well ethanol-derived calories can be utilized. Fewer studies are available about special physiological conditions such as malnutrition. Over the last few years, scientific research has mainly focused on obesity, an increasing problem in developed countries, which led us to the false belief that malnutrition was no longer a problem worth investigating. However, there are still 800 million malnourished people in the world (13). The decreasing interest of the scientific community in problems related to malnutrition has left many questions without an answer. Ethanol consumption and its consequences on the malnourished organism are among them. In view of the importance of malnutrition in Brazil - 22% of the population or 40 million people are malnourished (14), as well as ethanol consumption and alcoholism - 11% of Brazilian population are alcoholics (15), the aim of the present study was to assess the use of ethanol calories in a dose/effect model by evaluating body weight before and after the installation of malnutrition.
{ "domain": "chemistry.stackexchange", "id": 13401, "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, alcohols, organophosphorus-compounds", "url": null }
pcl from /home/sam/code/ros/pcl/pcl_3d_recognition/src/correspondence_grouping.cpp:4: /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/point_types.h:56:0: 警告: ignoring #pragma warning [-Wunknown-pragmas] In file included from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/point_representation.h:42:0, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/kdtree/kdtree.h:46, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/search/kdtree.h:43, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/search/pcl_search.h:44, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/features/impl/feature.hpp:43, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/features/feature.h:502, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d.h:43, from /home/sam/code/ros/pcl/perception_pcl_unstable/pcl16/include/pcl-1.6/pcl16/features/normal_3d_omp.h:43,
{ "domain": "robotics.stackexchange", "id": 11072, "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": "pcl", "url": null }
java, algorithm, queue, circular-list Title: Implementation of a Resizing Array Queue Below is a problem from Sedgewick's Algorithms and my solution. Any thoughts or suggestions for improvement would be much appreciated. Develop a class that implements the queue abstraction with a fixed-sized array, and then extend your implementation to use array resizing. package chapter_1_3_bagsQueuesStacks; import java.util.Arrays; import java.util.Iterator; // Exercise 1.3.14 | pg. 163 public class ArrayQueue<E> implements Iterable<E> { private E[] a = (E[]) new Object[1]; private int head; private int tail; private int N; public boolean isEmpty() { return N == 0; } private boolean isFull() { return N == a.length; } public int size() { return N; } private void resize(int cap) { E[] temp = (E[]) new Object[cap]; int curr = head; for (int i = 0; i < N; i++) { temp[i] = a[curr]; if (curr == a.length-1) { curr = 0; } else { curr++; } } a = temp; } public void enqueue(E element) { if (isFull()) { resize(a.length*2); head = 0; tail = N-1; } if (isEmpty()) { head = tail = 0; } else if (tail == a.length-1) { tail = 0; } else { tail++; } a[tail] = element; N++; } public E dequeue() { if (isEmpty()) throw new RuntimeException(); E element = a[head]; a[head] = null; N--; if (head == a.length-1) { head = 0; } else { head++; } if (N == a.length/4) { resize(a.length/2); head = 0; tail = N-1; } return element; }
{ "domain": "codereview.stackexchange", "id": 27469, "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, algorithm, queue, circular-list", "url": null }
quantum-mechanics, solid-state-physics, perturbation-theory, singularities c_n^\alpha \end{pmatrix} = 0. \end{equation} where $c^{\alpha}_k$ are the coefficients of the zero-order eigenstates $|\alpha\rangle = c^\alpha_m|\psi^{(0)}_m\rangle + c^\alpha_n|\psi_n^{(0)}\rangle$ with the first-order corrected energies $\epsilon_\alpha$. The rearrangement is performed as follows. Consider a Hamiltonian $H = H_0 + V$, where \begin{equation} H_0 = \sum_i E_i^{(0)}|\psi_i^{(0)}\rangle\langle \psi_i^{(0)}|, \end{equation} \begin{equation} V = \sum_{ij} V_{ij}|\psi_i^{(0)}\rangle\langle \psi_j^{(0)}|, \end{equation} where $E_n^{(0)} \approx E_m^{(0)}$ for some $m$,$n$. Now, let me write \begin{equation} H = H_0' + V', \end{equation} where \begin{equation} H_0' = H_0 - \frac{E_m^{(0)} - E_n^{(0)}}{2}(|\psi_m^{(0)}\rangle\langle \psi_m^{(0)}| - |\psi_n^{(0)}\rangle\langle \psi_n^{(0)}|), \end{equation} \begin{equation}
{ "domain": "physics.stackexchange", "id": 94614, "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, solid-state-physics, perturbation-theory, singularities", "url": null }
lagrangian-formalism, hamiltonian-formalism, constrained-dynamics Title: How is a Hamiltonian constructed from a Lagrangian with a Legendre transform many textbooks tell me that Hamiltonians are constructed from Lagrangians like $$L=L(q,\dot{q})$$ with a Legendre transformation to obtain the Hamiltonian as $$H=\dot{q}\frac{\partial L}{\partial \dot{q}}-L$$ but none of the textbooks explain how this is done. My specific problem is that I have Lagrangians that do not depend on $\dot{q}$ and therefore should have $\frac{\partial L}{\partial \dot{q}}=0$, hence $H=-L$. But my impression from the clues I have is that it is not that simple. Let's say the Lagrangian is $$L(q)=\ln(q)-(2q-10)\lambda$$ Now as far as I know the Legendre transformation should give a function $f^*(p)=\sup(pq-L(q))$ (this implies $p=\frac{\partial L}{\partial q}$) which is obtained by substituting the stationary point $q_s$ of $\sup(pq-L(q))$ into $pq-L(q)$ thus getting $f^*(p)=pq_s-L(q_s)$ (for instance wikipedia's Legendre Transformation page explains this). Doing this for the example above: $$\frac{\partial (pq-L(q))}{\partial q}=\frac{\partial (pq-\ln(q)+(2q-10)\lambda)}{\partial q}=p-\frac{1}{q}+2\lambda$$ must be 0 for a stationary point, thus $q_s=1/(p+2\lambda)$.
{ "domain": "physics.stackexchange", "id": 8183, "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": "lagrangian-formalism, hamiltonian-formalism, constrained-dynamics", "url": null }
special-relativity, speed-of-light, one-way-speed-of-light Title: Measuring one-way speed of light Veritasium's video explains why we can't measure the one-way speed of light: https://youtu.be/pTn6Ewhb27k?si=60Q0AffVdt09lJSb However, I still don't completely get why this is the case. Let's say that we have two clocks at point A (starting point) and point B. Let's say that these points are reasonably separated to allow for proper measurements. We know the distance between points A and B. Both clocks initially read the value of 0 and are not counting. The moment that we send a laser from clock A, clock A will start ticking. Now, the moment that the laser reaches clock B, clock B will start ticking. Clock B will be slightly behind since it takes time for light to go from A to B. But the time delay ($\Delta t = t_a - t_b$) should be exactly equal to the time it takes for light to travel that distance. Perhaps as a stricter requirement, let's assume that there is no relative motion between clocks A and B, so that we don't have to worry about time dilation. So now, why can't we simply say that $v_{light} = \frac{d}{\Delta t}$? What is wrong with this argument? Doesn't this allow for the measurement of the one-way speed of light, without the usage of a mirror? The problem with that scheme is that you must then compare clock B's time with clock A's. How do you do that without sending a signal B->A and correcting for the delay? But the whole discussion ignores the fact that the very first measurement of the speed of light by Ole Rømer was a one-way measurement. He used a remote clock, the orbit of Jupiter's moon Io, whose distance from his local clock varied periodically (because of Earth's orbit). He observed a periodic variation in the apparent timing of Io's orbit, which he attributed to the varying delay of the light signal between Earth and Jupiter due to the varying distance. No return signal was required.
{ "domain": "physics.stackexchange", "id": 97320, "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, speed-of-light, one-way-speed-of-light", "url": null }
reinforcement-learning, math, policy-gradients, calculus People shouldn't call this a trick. There's no trick here. It's just basic calculus. Why do you need identity \ref{1}? Because that identity tells you that the derivative of the probability of the trajectory given the parameter $\theta$ with respect to $\theta$ is $P(\tau \mid \theta)$ times the gradient of the logarithm of that same probability. How is this useful? Because the logarithm will turn your product into a sum (and the derivative of a sum is the sum of the derivatives of the elements of the sum), Essentially, the identity \ref{1} will help you to compute the gradient is an easier way (at least, conceptually).
{ "domain": "ai.stackexchange", "id": 1914, "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, math, policy-gradients, calculus", "url": null }
quantum-mechanics, greens-functions, propagator $$ c_i(t)=\left\{\begin{array}{ll}0,&t<t_0,\\ -i\langle\varphi_i|\psi_0\rangle e^{-iE_i(t-t_0)},&t>t_0.\end{array}\right. $$ The same solution (except the phase factor) can be obtained from the following equation for $c_i(t)$ without the source term, but with nontrivial initial condition: $$ \left\{\begin{array}{l}i\frac{dc_i}{dt}=E_ic_i,\\ c_i(t_0)=\langle\varphi_i|\psi_0\rangle.\end{array}\right.\quad\Rightarrow\qquad c_i(t)=\langle\varphi_i|\psi_0\rangle e^{-iE_i(t-t_0)}. $$ Thus the Schrodinger equation (2) with the source term $\delta(t-t_0)|\psi_0\rangle$ is equivalent to that without source term, but with initial condition $|\psi(t_0)\rangle=-i|\psi_0\rangle$. In particular, Eq. (1) describes wave function propagation beginning from the state $\psi(x_0,t_0)=-i\delta(x-x_0)$, i.e. it is the Green function (up to a phase). Now about oscillating source term in Eq. (3). Unfortunately, it cannot be interpreted as an initial condition for $\psi$, but we can consider the system if two coupled equations $$
{ "domain": "physics.stackexchange", "id": 35491, "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, greens-functions, propagator", "url": null }
programming-challenge, lisp, common-lisp Title: Project Euler #35 in Common Lisp To start with Common Lisp I am doing Project Euler using this language. Usually I manage to solve problems but I am quite sure that my code is not as efficient as it could be in Common Lisp. That is why I need a review from experienced lispers. This is my code for problem 35. Please offer any improvements. (defun prime-p (n) (cond ((= n 1) nil) ((= n 2) t) ((evenp n) nil) (t (loop for i from 3 to (isqrt n) by 2 never (zerop (mod n i)))))) (defun list->num (lst) (loop for i in lst for p = (- (length lst) 1) then (- p 1) sum (* i (expt 10 p)))) (defun num->list (n) (loop for c across (write-to-string n) collect (parse-integer (string c)))) (defun rotate (lst) (append (last lst) (butlast lst))) (defun number-rotations (n) (let* ((digits (num->list n)) (digits-count (length digits))) (loop repeat digits-count for rotated = digits then (rotate rotated) collect (list->num rotated)))) (defun problem-35 (limit) (let ((hash-primes (make-hash-table))) (loop for n from 1 to limit if (prime-p n) do (setf (gethash n hash-primes) t)) (loop for p being the hash-keys in hash-primes if (loop for n in (number-rotations p) always (gethash n hash-primes)) collect p))) In list->num you can count down with something like for i downfrom n. (defun num->list (n) (loop for c across (write-to-string n) collect (parse-integer (string c))))
{ "domain": "codereview.stackexchange", "id": 31350, "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-challenge, lisp, common-lisp", "url": null }
c++, recursion, tic-tac-toe if (check_for_overlap(x, y, previousPlayerPiece) == true){ x--;y--;print_board(previousPlayer2Piece, x, y); std::cout << "\nThe board has been re-set. Try again!" << std::endl; } else if (check_for_overlap(x, y, previousPlayer2Piece) == true){ x--;y--;print_board(previousPlayerPiece, x, y); std::cout << "\nThe board has been re-set. Try again." << std::endl; } else { x--;y--;print_board(playerPiece, x, y); } } /* This is probably the best way to write the update board function as it works, though it would be nice to have parts of it be more recursive... */
{ "domain": "codereview.stackexchange", "id": 8152, "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++, recursion, tic-tac-toe", "url": null }
javascript, react.js, to-do-list A <form> is overkill here, as your handler doesn't use anything about the form aside from hooking to the onSubmit event. You can remove the <form>, replace the input button input with a <button> and put an onClick on it that calls handleSubmit. var buttonStyle = { marginTop: "10px" } Another reason to use BEM convention is that inline styles are higher in specificity than IDs, and the only way to override them is to replace the inline style or use !important in a stylesheet. Again, you don't want your CSS to be a battle of overrides.
{ "domain": "codereview.stackexchange", "id": 17793, "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, react.js, to-do-list", "url": null }
inorganic-chemistry Title: Usage of platinum in flame test Why should we use platinum wire or loop in flame test, can we use any other material ? Why can't we use glass it something? Platinum is chemically inert ("noble") meaning it resists forming oxides or other compounds. This stability is desirable when doing a flame test because it ensures that we only see the spectrum of what we are burning. (Think how much noise we would have in our spectrum if we used a Magnesium wire to hold our sample) Of the chemically inert metals (e.g. Au, Ag, Pd, Pt), Platinum has the highest melting point (2041º C), so it's the most useful for holding in a flame. Glass, on the other hand, melts at a temperatures ~500º C lower than Platinum.
{ "domain": "chemistry.stackexchange", "id": 10803, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "inorganic-chemistry", "url": null }
standard-model, radioactivity Title: Predicting Decay Rates via the Standard Model Question 7584 illustrated a procedure to forecast the decay rates of isotopes with known long average lifetimes. Lifetimes of the many U isotopes vary from micoseconds to gigayears. F has only one stable isotope while Sn has 10. Can Standard Model principles be used to predict the stability of isotopes and the average lifetimes for unstable isotopes, or can this only be done by measurement? The nuclear forces are a complex amalgam of primarily Quantum Chromodynamics forces and electromagnetic ones, but to deal with the diagramatic way of calculating in Quantum Field Theory, is not possible. The weak force responsible for beta decays should also be in the calculations.Too many diagrams and too convoluted. Quantum mechanical models with a potential well to estimate the collective forces are used for this. Nuclear physics has been using various models successfully, like the shell model. to predict energy levels in nuclei. Ways of estimating lifetimes are taught in nuclear engineering, for example: Course Outcomes: Students must be able to... calculate the consequences of radioactive growth and decay and nuclear reactions. calculate estimates of nuclear masses and energetics based on empirical data and nuclear models. calculate estimates of the lifetimes of nuclear states that are unstable to alpha-,beta- and gamma decay and internal conversion based on the theory of simple nuclear models. use nuclear models to predict low-energy level structure and level energies.
{ "domain": "physics.stackexchange", "id": 751, "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": "standard-model, radioactivity", "url": null }
c#, .net, formatting, io, ip-address if (Convert.ToInt32(tx_queue, 16) > 0 && st == TcpStates.ESTABLISHED)//Indicates this is the current active transmissiting connection { tcpResultMessage += " <= Active transmitting connection"; } else if (Convert.ToInt32(rx_queue, 16) > 0 && st == TcpStates.ESTABLISHED)//Indicates this is the current active receiving connection { tcpResultMessage += " <= Active receiving connection"; } } internal string GetMessage() { return tcpResultMessage; } } Running the following batch script: @echo off echo %time% adb.exe shell cat /proc/net/tcp The program works. But I'm interested to learn if i'm using any bad practises, or doing other things wrong. Especially the TCPResults class/constructor could be implemented a lot better I think, but unable to come up with how myself. Regular expressions You might consider compiling your regular expressions. ipRegex = new Regex(@"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" , RegexOptions.Compiled); Path normalization Console.WriteLine("Please specify file path"); filePath = Console.ReadLine(); -> append the following method to have some leverage on user input. filePath = System.IO.Path.GetFullPath(filePath ) New lines rawResult.Trim().Split('\n'); Are you sure to use \n? Perhaps this is fine. Maybe consider using Environment.NewLine instead. It depends how this tool encodes new lines. Seperation of concerns Method ReplaceHexNotation performs both tokenizing and outputting to the console. You should extract algorithms from output for better usability and maintainability.
{ "domain": "codereview.stackexchange", "id": 36269, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, .net, formatting, io, ip-address", "url": null }
• ### Show the steps to calculate the Compton wavelength of the electron (i.e. 2.4*10^-12) from equation 1.9... Show the steps to calculate the Compton wavelength of the electron (i.e. 2.4*10^-12) from equation 1.9 in the text. Use this equation if necessary: The Compton Eedl One of the characteristics of particles is that they can scatter off of each other, conserving both energy and momentum in the scattering process. If light truly does behave like a particle, it should be possible to observe such sc and to predict the change in the energy and momentum of the light... • ### Gamma Rays also exhibit compton scattering. Suppose that a 0.511MeV photon arising from pair-anihilation scatters from... Gamma Rays also exhibit compton scattering. Suppose that a 0.511MeV photon arising from pair-anihilation scatters from a single electron at an angle of 110 degrees. Find the the final energy of the scattered photon. Free Homework App
{ "domain": "homeworklib.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9553191348157373, "lm_q1q2_score": 0.8061891448735801, "lm_q2_score": 0.8438951084436077, "openwebmath_perplexity": 543.8824874945262, "openwebmath_score": 0.8567330837249756, "tags": null, "url": "https://www.homeworklib.com/qaa/1584801/in-compton-scattering-a-photon-collides-with-an" }
python, beginner, game, functional-programming, adventure-game You can now use something like print(change_relation(relationships, "civilians", "---")) to adapt the game state and tell the user about the consequences of his/her decision. (Note: The code above builds upon a change to relationships that will be explained in the following section.) Make it harder to be wrong Ah, that damn army ... where was their score in relationships again? Was it the first or the second position? Maybe the third? To avoid situations like this, I would recommend to use a dictionary. This leaves you with something like relationships = {"army": 0, "civil": 0} or even relationships = {Factions.ARMY: 0, Factions.CIVILIANS: 0}. Using relationships[Factions.ARMY] leaves absolutely no doubt what you're trying to do. It will also make it waaaay easier to spot copy and paste errors. Avoid globals Global variables are best avoided, since it's harder to see which parts of the code modify them, which leads to all kind of problems. The core object of your game would be relationships and it would be easy to transform all your game functions to accept it as an argument instead of relying on it to be present on a global scope. The most common approach would be to somehow define a main function which does all the needed initialization stuff, like displaying the synopsis or initializing relationships. relationships is then passed to story which again passes it onwards depending on how the player chooses his actions. All the game text should wrightfully stay in global variables. For them I would recommend to CAPITALIZE_THEIR_NAMES to make it clear that they are supposed to be used/seen as constant values. User input handling At the moment the user input handling is not very robust. Once you enter an invalid command, e.g. by smashing the enter key to long, the program bails out and you have to start all over. This can be very annoying. A better approach would be to ask for invalid input several times and only bail out if a termination character like q/Q is entered or the user did not provide a valid input six times in a row. An implementation of this approach might look like: def prompt_for_input(prompt, valid_inputs, max_tries=6): print(prompt) for _ in range(max_tries):
{ "domain": "codereview.stackexchange", "id": 34976, "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, game, functional-programming, adventure-game", "url": null }
c++, c++11 // If that fails in any way, no problem. temp is in an indeterminate // state... but who cares? It will be destroyed, and this object // hasn't been touched yet. // Next we move temp into *this (or we swap(temp, *this) - same thing) // Because we made the move operations noexcept, this cannot fail. *this = std::move(temp); // And we're done! return *this; } This technique prevents all problems that assignment can possibly have: it handles exceptions, it handles self-assignment, it handles everything. There is an efficiency cost, but it's often unavoidable, unfortunately. So your copy assignment operator should almost always look like this: Type& operator=(Type const& other) { auto temp = other; *this = std::move(temp); // OR: // using std::swap; // swap(*this, temp); return *this; } And that means you should almost always write the move operations and swap, and make them noexcept. std::vector<int> cal_waiting_time(std::vector<int>& burst_time) { waiting_time.push_back(0); for (int i = 0; i < burst_time.size() - 1; i++) { waiting_time.push_back(waiting_time[i] + burst_time[i]); } return waiting_time; }
{ "domain": "codereview.stackexchange", "id": 30834, "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", "url": null }
ros and copy result to sdf-file. I used this method in Groovy. Originally posted by Alexandr Buyval with karma: 641 on 2013-01-30 This answer was ACCEPTED on the original site Post score: 2 Original comments Comment by ChickenSoup on 2013-04-25: which sdf version please? because it is not working for sdf 1.4 :( Comment by Alexandr Buyval on 2013-04-26: It seems I have used the version 1.3. But I don't sure that it is important. Which version of ROS have you used? What is your error? Comment by ChickenSoup on 2013-04-30: @Alexandr Buyval I tried in both fuerte and groovy. The errors were: XML Element[turnGravityOff], child of element[link] not defined in SDF; Error reading element ,,. But, after modifying the tags according to the new sdf format manually I could convert the urdf to sdf. thanks Comment by Adam Allevato on 2017-10-12: In newer versions of gazebo, the correct tool is now a flag on the gz executable: gz sdf -p my_urdf.urdf > my_sdf.sdf
{ "domain": "robotics.stackexchange", "id": 12646, "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", "url": null }
c++, beginner, game, sfml How this helps you: It lets you separate functions more easily and lets you be able to tell wether a chunk of code is inside or outside a function. Classes (MOST IMPORTANT) You have too many game objects that are hard-coded in. Make a class for each: (in separate files of course) Paddle Wall Ball How this helps you: Classes add code reusability. Say you wanted to reuse your current code to make a four-player pong game (yes that exists). At the moment, you’d need to hard-code every paddle one by one. With classes, you could just add two paddles and that’s about it. Vector C++ programmers tend to prefer using std::vectors over c style arrays. In the Menu class, use std::vector<sf::Text> menu; instead of sf::text menu[MAX_NUMBER_ITEMS]; so you can push menu items to it instead of putting the index of each one. Make its constructor use an std::vector<sf::Text> so you can customize it within main. Put the settings of the menu items (Font, FillColor, and Position) in a for loop and then set the first item’s special color. How this helps you: Say you wanted to make another menu that is used like your first menu. You could copy & paste the original menu to create a new SubMenu1 class, but that’s a big no-no in programming. Instead, you could make menu and subMenus[0] both instances of the Menu class. Empty conditional blocks In your code I’ve seen many statement like: if (!font.loadFromFile("pong.ttf")) { } They serve no purpose. Just write: font.loadFromFile("pong.ttf"); (Unless you’re going to do something like throw an error or exit.) How this helps you: It literally just removes bloat. Things I congratulate you for getting right: Constants There aren’t too many magic numbers (unnamed constants), which really helps people who want to jump in the middle of your code and still be able to understand what it does.
{ "domain": "codereview.stackexchange", "id": 28455, "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, game, sfml", "url": null }
python, python-2.x, portability, checksum This script is designed to process files for hashing in chunks. If the provided file size is greater than one million bytes (~1MB), it will process the file in one-million-byte chunks. If the provided file is less than one-million-bytes in size, it just processes the file directly and takes the whole file into memory. I have a concern though, about files still taking a huge amount of memory, for larger files - if this is not actually a concern given how I'm chunking files on read, then please tell me, so I'm not worried about writing memory-inefficient things. I have a horrible approach to handling output and formatting, in which I use a lot of conditional checks. I know this, and would love to have any types of improvement to processing (I currently have a lot of if statements and such, which I know is inefficient). Any suggestions to minimizing the amount of conditional functions here are appreciated. I tend to prepare for the worst, and very likely overdo the amount of error catching, and probably need to reduce how much of this I do. Any suggestions are welcome here, because I know i need to stop trying to wrap everything in try/excepts, and reduce the amount of these I'm executing. I love the argparse library's ArgumentParser for handling arguments, but I know that I abuse some protected properties here for one of my needs. Any method to bypass the need to alter a protected property of the argparse ArgumentParser functions for this is appreciated to get it to have Title Case for "optional arguments" header in help output, because altering protected properties instinctively makes me hate myself for possibly introducing library changes that will break in the future down the road in undefined and unforseen ways. A note regarding PEP8: I know my lines are over 80 characters in length for code and comments. I should probably apply PEP8 restrictions on comments, but I have accepted a line length maximum of 100 characters, as I am the only person who's been working on this. I thank you ahead of time for reviewing my code, and thank you for your thoughts and suggestions. Prerequisite: Third-party module, exitstatus
{ "domain": "codereview.stackexchange", "id": 21441, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-2.x, portability, checksum", "url": null }
# Does the function $\frac{x}{\sqrt{1+x}}$ have an oblique asymptote? Does the function $$\frac{x}{\sqrt{1+x}}$$ have an oblique asymptote? If so, how do we find it? I thought about long dividing, but that wouldn't work, because You can't divide square roots. • why not? $\frac{\sqrt{4}}{\sqrt{5}}$ exists.. – MonK Sep 30 '14 at 9:20 You are not going to have an "oblique" asymptote like you are used to--it's not going to be a straight line. Instead the "oblique asymptote" is going to be a sideways parabola. This is because you have (essentially) $\frac{x}{\sqrt{x}} = \sqrt{x}$--so the asymtptote is going to be a square root--or quadratic: $$f(x) = \frac{x}{\sqrt{x + 1}} = x\frac{\sqrt{x + 1}}{x + 1}$$ Put another way what you have is: $\sqrt{x + 1} = y \rightarrow y^2 = x+1 \rightarrow x = y^2 - 1$: $$\left(y^2 - 1\left)\frac{y}{y^2}\right.\right. = \frac{y^2 - 1}{y} = y - \frac{1}{y} = \sqrt{x + 1} - \frac{1}{\sqrt{x + 1}}$$ This means that the "oblique" asymptote is $y = \sqrt{x + 1}$.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9825575188391108, "lm_q1q2_score": 0.8331771023898595, "lm_q2_score": 0.847967764140929, "openwebmath_perplexity": 369.75495133434436, "openwebmath_score": 0.9491041898727417, "tags": null, "url": "https://math.stackexchange.com/questions/952304/does-the-function-fracx-sqrt1x-have-an-oblique-asymptote" }
electromagnetism, general-relativity, metric-tensor, tensor-calculus $$\Gamma_{\alpha\gamma}^\alpha=\frac{1}{2}g^{\alpha\delta}\partial_\gamma g_{\alpha\delta}\,.$$ This is of the form $\text{tr}\left(M^{-1}\partial M\right)$ for the matrix $g$. Using the identity $$\ln \det M=\text{tr}\ln M$$ (see e.g. https://math.stackexchange.com/questions/1487773/the-identity-deta-exptrlna-for-a-general), we can rewrite this as $$\frac{1}{2}g^{\alpha\delta}\partial_\gamma g_{\alpha\delta} = \frac{1}{\sqrt{-g}}\partial_\gamma \sqrt{-g}\,,$$ and your second formula follows from the Leibniz rule. (I may or may not have misse a minus sign somewhere.)
{ "domain": "physics.stackexchange", "id": 45152, "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, general-relativity, metric-tensor, tensor-calculus", "url": null }
photons, mass, quantum-electrodynamics, gauge-invariance \begin{equation} \begin{array}{c} \left({\partial{}}_1-{i\partial{}}_2\right)\left(F^1+iF^2\right) = i \ \bar{\lambda{}} \ \left(P^0+P^3\right) \\ \\ \left({\partial{}}_0-{\partial{}}_3\right)\left(F^1-iF^2\right) = 0 \\ \\ \left({\partial{}}_0+{\partial{}}_3\right)\left(F^1+iF^2\right) = 0 \\ \\ \left({\partial{}}_1+i{\partial{}}_2\right)\left(F^1-iF^2\right) = i \ \bar{\lambda{}} \ \left(P^0-P^3\right) \end{array} \end{equation} At the same time, the Maxwell equations for transverse plane waves are as follows: \begin{equation} \begin{array}{ c} \left({\partial{}}_1-{i\partial{}}_2\right)\left(F^1+iF^2\right)=J^0+J^3 \\ \\ \left({\partial{}}_0-{\partial{}}_3\right)\left(F^1-iF^2\right)=0 \\ \\ \left({\partial{}}_0+{\partial{}}_3\right)\left(F^1+iF^2\right)=0 \\ \\ \left({\partial{}}_1+i{\partial{}}_2\right)\left(F^1-iF^2\right)=J^0-J^3 \end{array} \end{equation}
{ "domain": "physics.stackexchange", "id": 34341, "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": "photons, mass, quantum-electrodynamics, gauge-invariance", "url": null }
python, python-3.x, integer, numbers-to-words Title: Create the English word for a number I cobbled together a function from various sources that takes an integer and returns it as its respective English word formatted as a string. The function is as follows: def int2word(num, separator="-"): """Transforms integers =< 999 into English words Parameters ---------- num : int separator : str Returns ------- words : str """ ones_and_teens = {0: "Zero", 1: 'One', 2: 'Two', 3: 'Three', 4: 'Four', 5: 'Five', 6: 'Six', 7: 'Seven', 8: 'Eight', 9: 'Nine', 10: 'Ten', 11: 'Eleven', 12: 'Twelve', 13: 'Thirteen', 14: 'Fourteen', 15: 'Fifteen', 16: 'Sixteen', 17: 'Seventeen', 18: 'Eighteen', 19: 'Nineteen'} twenty2ninety = {2: 'Twenty', 3: 'Thirty', 4: 'Forty', 5: 'Fifty', 6: 'Sixty', 7: 'Seventy', 8: 'Eighty', 9: 'Ninety', 0: ""} if 0 <= num < 19: return ones_and_teens[num] elif 20 <= num <= 99: tens, below_ten = divmod(num, 10) if below_ten > 0: words = twenty2ninety[tens] + separator + \ ones_and_teens[below_ten].lower() else: words = twenty2ninety[tens] return words
{ "domain": "codereview.stackexchange", "id": 24502, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, integer, numbers-to-words", "url": null }
electromagnetism, electrostatics, gauss-law Title: Confusion concerning the application of Gauss's law using symmetry arguments Suppose we want to prove Coulomb's law from Gauss's law. The thing to do is to invoke a spherical Gaussian surface centered at a point charge, notice that there's symmetry and use that to calculate $\int \boldsymbol{E}\cdot d\boldsymbol{A}$. My concern is that while it's clear that the field must point in the radial direction, how is it that we know (using a rigorous argument) that it points radially outward for a positive charge and radially inward for a negative charge? I don't believe there is a rigorous argument involved. I believe it is purely by convention that the direction of the field is the direction of the force that a positive test charge would experience of it were placed in the field. It's really quite arbitrary. Just like the convention (in electrical engineering) that current is the flow of positive charge, even though in general current is the flow of negatively charged electrons. I suppose it doesn't matter as long as one is consistent with whatever convention is chosen. Hope this helps.
{ "domain": "physics.stackexchange", "id": 52925, "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, electrostatics, gauss-law", "url": null }
jupiter, stellarium, analemma I believe that the answer is related to lengths of solar days on planets. Imagine we set 1 solar day as one step for an analemma (= 24 hours). Thus, the Sun shows on its mean solar noon and shows correct analemma. Let's now move to Mars. When you set 1 solar day on Mars, it correctly shows you the analemma. Mars' day is around 37 minutes longer than ours, thus the analemma should not be correct, but still it is. I believe that the developers of Stellarium also coded the solar day for Mars in Stellarium, so when you setup 1 solar day on Mars, it is actually same as 24 hours and 37 minutes. My assertion is that they didn't set the lengths of days on the other planets. On the newest version of Stellarium, one can set custom step. Try to change step of 1 solar day to 1.001 solar days. The analemma changes a lot, from this ... ... to this: I think that Stellarium doesn't use same length of Jupiter's day as Wikipedia (it is made from gas), so such analemma (with even slight deviation) is incorrect. You have to use so called "Stellarium Jupiter's day". The multiple of such days is around 300.0201 solar days on Earth. I get a correct analemma with such step: Try to reproduce it: Place: anywhere on Jupiter From: 2021.06.16 12:00, To: 2033.03.09 12:00 ✓ line ✓ markers □ dates □ magnitude ✓ H.C. Time step: custom interval: 300.020100 solar days (around 725 Stellarium Jupiter's days) Additional note: after I updated the Stellarium, the answer changed a lot (but it is still related to the wrong step), so don't get confused with comments bellow (they are referring to the previous version of an answer).
{ "domain": "astronomy.stackexchange", "id": 5601, "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": "jupiter, stellarium, analemma", "url": null }
# 10th grade algebra 1 answer below » Name the property used for the following: 16+(14+a)=(16+14)+a A. Associative Property of Addition B. Commutative Property of Addition C. Additive Inverse Property D. Multiplicative Identity Property In the following example of "Simplifying an Expression", what reason would be used for step B? Simplify the expression 3k + 7 + 2k and justify each step 3k + 7 + 2k = 3k + 2k + 7 A = (3k + 2k) + 7 B = (3 + 2)k + 7 C = 5k + 7 D A. Addition B. Commutative Property C. Associative Property D. Distributive Property ½(2) + (-1) can be simplified to 1+ (-1). Name the property that was used to reach this step. A. Multiplicative Inverse Property B. Associative Property of Multiplication C. Multiplicative Identity Property D. Distributive Property In the following example of "Simplifying an Expression", what reason would be used for step D? Simplify the expression 3k + 7 + 2k and justify each step 3k + 7 + 2k = 3k + 2k + 7 A = (3k + 2k) + 7 B = (3 + 2)k + 7 C = 5k + 7 D A. Addition B. Commutative Property C. Associative Property D. Distributive Property ## 1 Approved Answer
{ "domain": "transtutors.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9585377320263431, "lm_q1q2_score": 0.8185075971262663, "lm_q2_score": 0.8539127566694178, "openwebmath_perplexity": 799.654474145076, "openwebmath_score": 0.45836108922958374, "tags": null, "url": "https://www.transtutors.com/questions/10th-grade-algebra-63639.htm" }
matlab, filters, real-time, eeg, finite-impulse-response %%Filtro señal delta [n,Wn]=buttord(Fdpp2, Fdss2,0.005,60); [bd,ad]=butter(n,Wn); [n1,Wn]=buttord(Fdss1,Fdpp1,0.005,60); [b1d,a1d]=butter(n1,Wn,'high'); bd=conv(bd,b1d); ad=conv(ad,a1d); Nd=length(bd);Nd1=length(ad); This part is only the pre-processing part but the coefficients are very small. the Fs is 250Hz and the delay group will be 0.5320 seconds. If I change IIR filter to FIR the order is near 200 and the delay group will be major (I tried that using only the band-pass filter without the convolution but the order was major than the actual orders). my questions are: Are there methods for reduce order of the filter without lose quality as the ripple or attenuation? If I change FIR by IIR, could I lose or distort information? Is normal that the coefficients be very small or how could I convert them in bigger numbers (near to order of 0.01 or 0.001 as minimum)?
{ "domain": "dsp.stackexchange", "id": 2812, "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, filters, real-time, eeg, finite-impulse-response", "url": null }
c++, linked-list And it outputs result which seems ok: 0: Width: 10 1: Width: 20 <-- This one is children of first one 1: Width: 30 <-- This one is on same level as one top, children of first one Is this a good approach at all? Did I miss a point of C++ doing it this way? Is there better solution? T* get(void) { Using (void) for an empty parameter list is, to quote Stroustrup, “an abomination”. C++ has had declared argument types from the beginning and has no need for a backward compatibility hack to distinguish an empty parameter list from an absent parameter list. I don’t see why you need a trivial get_next when next is already public. //Default constructor LinkedListRoot() { first = nullptr; last = nullptr; count = 0; } You should put all of those as default initializers inline in the class definition, and you don’t need to write this constructor at all. If you were to need a constructor, use initialization of members, not assignment in the body of the function. No copy constructor or destructor or assignment operator? See “Rule of 5” if (first == nullptr || last == nullptr) { Don’t write explicit tests against nullptr. Use the contextual bool supplied by that type or class (of smart pointer). Two out of three lines in your two blocks are the same. So only make the difference conditional. auto& successor= (!first || !last) ? first : last->next; node->prev = last; successor = node; last = node; class Widget: public LinkedListNode<Widget> { So you are deriving from the linked list stuff; the payload is part of the same object, as I would have thought from your description initially. So then why do you have: template <typename T> class LinkedListNode { public: ⋮ T* entry;
{ "domain": "codereview.stackexchange", "id": 31205, "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++, linked-list", "url": null }
newtonian-mechanics The above diagram shows the change in momentum of $8.25kg$ of water in the hose, which occurs ever second, from $p_1=206.25Ns$ horizontally to $p_2=206.25Ns$ at $55^{\circ}$ to the horizontal. The force on the water is in the direction of $\Delta p$, and the reaction force on the hose is in the opposite direction. The vertical change in momentum per second $\Delta p_y$ is $169N$ as calculated using the thrust equation. But this is not because the water is leaving the hose at $55^{\circ}$ to the horizontal, it is because the water has been re-directed through an angle of $55^{\circ}$. If the initial momentum of the water $p_1$ had been say $25^{\circ}$ below the horizontal while the nozzle remained at $55^{\circ}$ above it, the vertical change in momentum would be greater. Note that the horizontal change in momentum of the water $\Delta p_x$ is backwards (ie to the right) so the reaction force on the hose is forward (to the left). This is the opposite direction to that predicted by the incorrect use of the thrust equation. Another force which has been omitted from the calculation in part (ii) is the weight of the hose and the water in it which the fireman is supporting. The weight of the water could be obtained by estimating the length of hose which is not supported by the ground (we already know the diameter, assuming this is the same as the nozzle). No information is given about the weight of the hose and nozzle.
{ "domain": "physics.stackexchange", "id": 49283, "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 }
ros, ros-melodic, universal-robot Title: move-group not working because "Cylinder dimensions must be non-negative." I am simulation a UR3e robot in gazebo together with rviz moveit. I get the following error upon launching: [ WARN] [1591114719.159732243]: Link 'Load' is not known to URDF. Cannot disable collisons. [ INFO] [1591114719.161109044]: Loading robot model 'Rokubi'... [ WARN] [1591114719.161164691]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world' [ INFO] [1591114719.161183782]: No root/virtual joint specified in SRDF. Assuming fixed joint terminate called after throwing an instance of 'std::runtime_error' what(): Cylinder dimensions must be non-negative. [ INFO] [1591114719.513265950]: rviz version 1.13.12 [ INFO] [1591114719.513324036]: compiled against Qt version 5.9.5 [ INFO] [1591114719.513338308]: compiled against OGRE version 1.9.0 (Ghadamon) [ INFO] [1591114719.535686766]: Forcing OpenGl version 0. [move_group-9] process has died [pid 4230, exit code -6, cmd /opt/ros/melodic/lib/moveit_ros_move_group/move_group roku/roku/IMU:=roku/IMU /follow_joint_trajectory:=/arm_controller/follow_joint_trajectory __name:=move_group __log:=/home/dimitri/.ros/log/b6eaa3ce-a4ec-11ea-9134-c0b6f9fd3f63/move_group-9.log].
{ "domain": "robotics.stackexchange", "id": 35041, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-melodic, universal-robot", "url": null }
python, performance, pandas Title: Pandas add calculated row for every row in a dataframe I have a dataframe like so: id variable value 1 x 5 1 y 5 2 x 7 2 y 7 Now for every row, I want to add a calculated row. This is what I am doing as of now: a = 2 b = 5 c = 1 d = 3 df2 = pd.DataFrame(columns = ["id", "variable", "value"]) for index, row in df.iterrows(): if row['variable'] == 'x': df2 = df2.append({'id':row['id'], 'variable':'x1', 'value':a*row['value']+b}, ignore_index=True) else: df2 = df2.append({'id':row['id'], 'variable':'y1', 'value':c*row['value']+d}, ignore_index=True) df = pd.concat([df, df2]) df = df.sort_values(['id', 'variable']) And so finally I get: id variable value 1 x 5 1 x1 15 1 y 5 1 y1 8 2 x 7 2 x1 19 2 y 7 2 y1 10
{ "domain": "codereview.stackexchange", "id": 38629, "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, performance, pandas", "url": null }
dirac-equation, spinors, chirality, helicity Still, although the mass basis particles are now mixtures of chiral components, this has not changed their interaction with the W boson. It is still only the electron-1 components that interact with W bosons, the electron-2 components do not. Hence, only the left-handed part of a mass basis electron (what we usually call "electron") and the right-handed part of a mass basis positron participate in the weak interaction.
{ "domain": "physics.stackexchange", "id": 29612, "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": "dirac-equation, spinors, chirality, helicity", "url": null }
Let $x$ be a real number in the interval $[0,1/2)$. Then we have the following known inequality: $$1+x \le \exp x\ .$$ (Which holds for any real $x$.) This can be used to give an upper bound for the product, while also giving the chance to convert in the formula for the bound to a sum, which can be easily computed. We want a similar argument for a lower bound. For this, note that $$\frac 1{1+x}\le 1-x+x^2\le \exp(-x+x^2) = \frac 1{\exp(x-x^2)}\ .$$ (We have applied the same inequality above for an other argument.) From the double inequality: $$\exp(x-x^2)\le 1+x\le \exp(x)$$ we get \begin{align} \exp\sum_{0<k<n}\left(\frac k{n^2}-\frac {k^2}{n^4}\right) &= \prod_{0<k<n}\exp\left(\frac k{n^2}-\frac {k^2}{n^4}\right) \\\\ &\le \prod_{0<k<n}\left( 1+\frac k{n^2}\right) \\\\ &\le \prod_{0<k<n}\exp\frac k{n^2} \\\\ &= \exp\sum_{0<k<n}\frac k{n^2} \ . \end{align} The expressions at the beginning and at the end enclose the given sequence and converge each to $\exp\frac 12$, which is thus also the limit of the given sequence. Edit: Computer check using sage:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.975576912076157, "lm_q1q2_score": 0.8108439681231824, "lm_q2_score": 0.8311430478583168, "openwebmath_perplexity": 854.4244194163715, "openwebmath_score": 0.9980521202087402, "tags": null, "url": "https://math.stackexchange.com/questions/2753914/limits-of-a-product" }
gazebo-plugin Thanks Originally posted by peshala on Gazebo Answers with karma: 197 on 2013-05-09 Post score: 1 A test .world can be found at /simulator_gazebo/gazebo_plugins/test/test_worlds/gazebo_ros_block_laser.world <sensor name="sensor_ray" type="ray"> <pose>0.0 0.0 0.0 0.0 0.0 0.0</pose> <ray> <scan display="true"> <horizontal> <samples>300</samples> <resolution>1.0</resolution> <min_angle>-0.5236</min_angle> <max_angle>0.5236</max_angle> </horizontal> <vertical> <samples>100</samples> <resolution>1.0</resolution> <min_angle>-0.5236</min_angle> <max_angle>0.5236</max_angle> </vertical> </scan> <range> <min>0.05</min> <max>50.0</max> </range> </ray> <!-- test plugin --> <plugin name="plugin_1" filename="libgazebo_ros_block_laser.so"> <gaussianNoise>0.00</gaussianNoise> <alwaysOn>true</alwaysOn> <updateRate>20</updateRate> <topicName>test_block_laser</topicName> <frameName>base_link</frameName> </plugin> <always_on>true</always_on> <update_rate>10.0</update_rate> </sensor> Originally posted by peshala with karma: 197 on 2013-05-09 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 3273, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo-plugin", "url": null }
c++, algorithm struct { std::bitset<16> subset; std::size_t lastGarage; double value; } currentBest;
{ "domain": "codereview.stackexchange", "id": 42769, "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++, algorithm", "url": null }
8 Ilmari Karonen gets it right in the other answer. But it gets even worse than that: arithmetic operations involving floating-point numbers don't necessarily behave the same as operators we're used to from mathematics. For instance, we're used to addition being associative, so that $a + (b + c) = (a + b) + c$. This doesn't generally hold using floating-point ... 8 There actually is some research on improving the numerical stability of floating point expressions, the Herbie project. Herbie is a tool to automatically improve the accuracy of floating point expressions. It's not quite comprehensive, but it will find a lot of accuracy improving transformations automatically. Cheers, Alex Sanchez-Stern 8 Assuming multiplication between two numbers use one FLOP, the number of operations for $x^n$ will be $n-1$. However, is there a faster way to do this ... There most certainly is a faster way to do this for non-negative integer powers. For example, $x^{14}=x^{8}x^{4}x^{2}$. It takes one multiplication to compute $x^2$, one more to compute $x^4$, one more to ... 7 Your idea does not work because a number represented in base $b$ with mantissa $m$ and exponent $e$ is the rational number $b \cdot m^{-e}$, thus your representation works precisely for rational numbers and no others. You cannot represent $\sqrt{2}$ for instance. There is a whole branch of computable mathematics which deals with exact real arithmetic. Many ... 7 There are many effective Rational Number implementations but one that has been proposed many times and can even handle some irrationals quite well is Continued Fractions. Quote from Continued Fractions by Darren C. Collins: Theorem 5-1. - The continued fraction expression of a real number is finite if and only if the real number is rational. Quote ... 7
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9773707999669627, "lm_q1q2_score": 0.840210252809552, "lm_q2_score": 0.8596637559030338, "openwebmath_perplexity": 489.56811951662644, "openwebmath_score": 0.8095335364341736, "tags": null, "url": "https://cs.stackexchange.com/tags/floating-point/hot" }
electromagnetism, electrostatics, charge The electric field at $\vec{r}_P$ due to the charge q at $\vec{r}_q$ is the following: $$ d\vec{E} = \frac{1}{4\pi \epsilon_0}\frac{\rho dx}{|\vec{r}_P - \vec{r}_q|^2}\hat{u}$$ One possible source of confusion here can be the the expression $|\vec{r}_P - \vec{r}_q|^2$. This expression in fact first gives us the displacement vector pointing from q to P and then we find its magnitude and square it. This will give us exactly the squared distance between q and P. If you're unsure about why this works consider the following diagram showing vector addition:
{ "domain": "physics.stackexchange", "id": 76964, "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, electrostatics, charge", "url": null }
ros, navigation, costmap, ros-indigo ==1806== by 0x4F9A7A9: boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf1<void, costmap_2d::Costmap2DROS, double>, boost::_bi::list2<boost::_bi::value<costmap_2d::Costmap2DROS*>, boost::_bi::value<double> > > >::run() (thread.hpp:117) ==1806== by 0x66D5A49: ??? (in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.54.0) ==1806== by 0x68E8183: start_thread (pthread_create.c:312) ==1806== by 0x61E8FFC: clone (clone.S:111) ==1806== Address 0x16e0b7a0 is 0 bytes after a block of size 135,168 alloc'd ==1806== at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1806== by 0x4F3D071: costmap_2d::Costmap2D::initMaps(unsigned int, unsigned int) (costmap_2d.cpp:71) ==1806== by 0x4F3D915: costmap_2d::Costmap2D::resizeMap(unsigned int, unsigned int, double, double, double) (costmap_2d.cpp:91) ==1806== by 0x4F51996: costmap_2d::LayeredCostmap::resizeMap(unsigned int, unsigned int, double, double, double, bool) (layered_costmap.cpp:71)
{ "domain": "robotics.stackexchange", "id": 29999, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, navigation, costmap, ros-indigo", "url": null }
c#, object-oriented, validation, linq-expressions Title: Method for validating properties based on passed conditions I wrote a method for validating properties based on passed conditions. It works well, but declaration takes more space than the actual condition. Is there any way to make it shorter? public virtual string Validate(string propertyName, params Tuple<Expression<Func<bool>>, string>[] predicates) { if (!ValidationProperties.ContainsKey(propertyName)) throw new ArgumentException($"No property found with name '{propertyName}'. Make sure you register it first."); foreach (var predicate in predicates) { if (predicate.Item1.Compile().Invoke()) { ValidationProperties[propertyName] = false; ValidationChangedEvent?.Invoke(this, false); return predicate.Item2; } } ValidationProperties[propertyName] = true; if (ValidationProperties.All(pair => pair.Value)) ValidationChangedEvent?.Invoke(this, true); return null; } And here's example of call which I want to be shorter: var result = Validate(nameof(FilePath), new Tuple<Expression<Func<bool>>, string>(() => string.IsNullOrEmpty(FilePath), "Select a file to load")); Basically I want to get rid of: new Tuple<Expression<Func<bool>>, string> The class encapsulating the two properties suggested by @eurotrash is definitely a good idea. I think name ValidationRule should be ok. class ValidationRule { public ValidationRule(Func<bool> predicate, string message) { Predicate = predicate; Message = message; } public Func<bool> Predicate { get; } public string Message { get; } } I'd go further and create a collection so that I can use the collection initializer to specify the rules. This means collection class must implement the IEnumerable<T> interface and some Add(..) method. Then we can use the syntax: new SomeCollection { Item1, Item2 }
{ "domain": "codereview.stackexchange", "id": 23540, "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#, object-oriented, validation, linq-expressions", "url": null }
MAT334-2018F > Quiz-6 Q6 TUT 0202 (1/1) Victor Ivrii: Find the Laurent series for the given function $f(z)$ about the indicated point. Also, give the residue of the function at the point. $$f(z)=\frac{1}{e^z-1};\qquad z_0=0\quad \text{(four terms of the Laurent series)} .$$
{ "domain": "toronto.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138183570425, "lm_q1q2_score": 0.8230645699051675, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 1049.7858761154616, "openwebmath_score": 0.9786049723625183, "tags": null, "url": "https://forum.math.toronto.edu/index.php?PHPSESSID=uhh3jkujkml63s5fp7fo4g89i4&topic=1514.0;wap2" }
homework-and-exercises, newtonian-mechanics, spring, statics Title: A mass is hung from the centre of an unstretched, horizontal wire. How do I work out the depression of the centre of the wire? A wire of unstretched length $l$ is extended by a distance $10^{-3}l$ when a certain mass is hung from its bottom end. If this same wire is connected between two points that are a distance $l$ apart on the same horizontal level, and the same mass is hung from the midpoint, what is the depression $y$ of the midpoint? I have been struggling with this question for too long, and I am totally stuck. My textbook states that the answer is $l/20$, but doesn't explain how or why. I would greatly appreciate any help you could give, and have described my own attempt below. My attempt so far: I have attempted to balance forces on the mass (balancing the vertical component of the tension in each string with the weight of the mass) and then to solve for tension, and equate tension with $kx$, with $k$ being given by $1000mg/l$ (as is easily deducible from the given information) and $x$ being given by $2\sqrt{y^2+l^2/4}-l$, as is easily obtainably by simply trigonometry. For tension I found, by geometry, that $T=mg\sqrt{y^2+l^2/4}/2y$. Equating all of this gives the below equation: $$\frac{mg\sqrt{y^2+l^2/4}}{2y}=\frac{1000mg}{l}(2\sqrt{y^2+l^2/4}-l)$$ This expression is hideous and practically impossible to solve by hand, and I can't believe that this is the only way to do it. My guess is that your textbook is wrong because I get the same result as you. $$k=1000\frac{mg}{l}$$
{ "domain": "physics.stackexchange", "id": 56800, "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, spring, statics", "url": null }
newtonian-gravity, potential, potential-energy Title: Is gravitational potential always defined for a system? I have studied about Gravitational potential energy ($GPE$) and Gravitational potential ($GP$). ..while everywhere it is said that $GPE$ is always of a system as it depends on the configuration of the particles with respect to each other ...but nothing as such is said about it in my books..so my question is... 1)is $GP$ also defined for a system like say two particles...?? A)I think it is true because ..$GP$ and $GPE$ are very much related.. B)But then I also think it is not true because of the definition I have that Gravitational potential at a point is also defined as..The work done per unit mass by an external agent in bringing a particle slowly from the reference point to the given point. 2)But nothing is being said about another particle(system) in this definition.. 3)I am also really confused..with these terms $GP$ and $GPE$ because there are different definition of these in different places..{I took The standard definition of $GPE$ from (Resnick,Halliday) but the book doesn't talk about $GP$}... Can someone please clarify these??it will be of great help. What is gravitational potential? Usually a potential is defined as the potential energy per mass or per charge or similar. This is most often seen in relation to electricity or chemistry and less often to gravity. $GPE$ is gravitational potential energy. $GP$ is gravitational potential energy per mass: $$GP =\frac{GPE}{m} $$ Is it defined for the system or the object? $GPE$ is the amount of energy that can potentially be used as work for pulling an object towards the source. It depends on both the source's mass $m$, on the mass of the other ("target") object $m_0$ as well as on the distance $r$ between them ($G$ being a universal constant): $$GPE=-G\frac{m m_0}{r}$$
{ "domain": "physics.stackexchange", "id": 26268, "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-gravity, potential, potential-energy", "url": null }
navigation, ros-melodic, local-costmap, global-planner, move-base Originally posted by ymag on ROS Answers with karma: 3 on 2022-01-20 Post score: 0 The standard ros move_base navigation stack already supports what you want to do if you create the proper configuration. First, in move_base, the global_costmap and the local_costmap are completely independent. Second, the global planner never looks at the local_costmap, so changes you make to local_costmap will not affect global planning. Third, you need to research more about costmap_2d and its layered costmap design. Start here: http://wiki.ros.org/costmap_2d You can add your own layer and intelligently merge it with the other layers (Obstacle Cost Layer), or you can update the base layer (Static Map Layer). I generally find the former works better. Originally posted by Mike Scheutzow with karma: 4903 on 2022-01-22 This answer was ACCEPTED on the original site Post score: 1
{ "domain": "robotics.stackexchange", "id": 37370, "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": "navigation, ros-melodic, local-costmap, global-planner, move-base", "url": null }
regression, linear-regression, supervised-learning, linear-algebra \end{align} Taking the first derivative of SSE with respect to c and equating to zero. \begin{align} \frac{\partial SSE}{\partial b} &= \sum_{i=1}^{n}-2*(y_{i}-m*x_{i}-b)\\ 0 &= \sum_{i=1}^{n}-2*(y_{i}-m*x_{i}-b) \end{align} Therefore we get c as $$ b = \bar{y} - m*\bar{x}$$ Similarly in order to find m we take the partial derivative of SSE with respect to m and equate it to zero. \begin{align} \frac{\partial SSE}{\partial m} &= \sum_{i=1}^{n}-2x_{i}*(y_{i}-m*x_{i}-b)\\ 0 &= \sum_{i=1}^{n}-2x_{i}*(y_{i}-m*x_{i}-b)\\ 0 &= \sum_{i=1}^{n}x_{i}*(y_{i}-m*x_{i}-b)\\ 0 &= \sum_{i=1}^{n}x_{i}*y_{i} - \sum_{i=1}^{n}m*x_{i}^2 - \sum_{i=1}^{n}b*x_{i} \end{align} Substituting b and solving for m we get $$m = \frac{n\sum xy - \sum x\sum y}{n\sum x^2 - (\sum x)^2}$$
{ "domain": "datascience.stackexchange", "id": 8105, "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": "regression, linear-regression, supervised-learning, linear-algebra", "url": null }
beginner, common-lisp, compression ((a a) (b) (c c c) (b b) (a) (b) (a a a))NIL Algorithm Your algorith is quadratic for no good reason because last and length are linear in list length. I suggest that you add new elements to the beginning instead of the end of the return value in compress-reduce and nreverse it in compress. Style Avoid nth 0 in favor of car. (= (char-int last-char) (char-int curr)) is better written as (char= last-char curr). Avoid mixing and and push: keep conditions in and and side-effects (like push) in progn. Repeated reduce and map Each map (and mapcar et al) allocates a fresh list, so doing a repeated map can waste memory (and garbage collection cycles), so either using map-into or an explicit function composition is a good idea: instead of (mapcar #'foo (mapcar #'bar my-list))
{ "domain": "codereview.stackexchange", "id": 11479, "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, common-lisp, compression", "url": null }
reinforcement-learning, gradient-descent num_episodes = 2000 eps = 0 SARSA(env, function_approximator, num_episodes=num_episodes, eps=eps, logging=True) I want to be more clear about this. Say action 2 is the one which is the action which gets selected always after say 1000 episodes. Action 0 and action 1 have somehow, for all states, have their Q-values reduced to a level which is never reached by action 2. So for a particular state, action 0 and action 1 may have Q-values of -69 and -69.2. The Q-value of action 2 will never drop below -65, even after running the 5000 episodes. On doing some research on why this problem might be occurring, I delved into some statistics of the environment. Interestingly, after a small number of episodes (~20), the agent always chooses to take only one action (this has been mentioned in the question too). Also, the Q values of the state-action pairs do not change a lot after just about 20 episodes. Same is the case for policy of environment, as may be expected. The problem is that, although all the individual updates are being done correctly, the following scenario occurs. The update equation used is the following :- Q(s1, a1) <- r1 + gamma * Q(s2, a2) Now, any update to function approximator means that the Q value changes not just for the updated (state, action) pair, but for all (state, action) pairs. How much it changes for any specific (state, action) pairs is another issue. Now, since our function approximator is altered, next time we use the previous equation for updating any other state, we use the following equation :- Q(s3, a3) <- r3 + gamma * Q(s4, a4) But since Q has itself been changed, the target value of the record 3 changes. This is not desirable. Over time, all the changes cancel each other and Q value remains roughly the same. By using something known as the target function approximator(target network), we can maintain an older version of function approximator, which is used to get the Q-value of next state-action pair while the time of update. This helps avoid the problem and can be used to solve the environment.
{ "domain": "ai.stackexchange", "id": 871, "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, gradient-descent", "url": null }
machine-learning, statistics Title: How to test hypothesis? I have a table named app_satisfaction which has user_id, satisfaction, # of people they've invited. I've grouped by satisfaction and found that on averge. people in satisfaction ="BAD" group invted 2.25 people, "GOOD" group invited 2.09 people, and "EXECELLENT" group invited 1.89 people. So my hypothesis is people who dislike the app are more likely to invite people since inviting people gives them free coupon and they do not like to spend their own money on app they dislike. I have a problem, just by looking at average invite in each group it seems unreasonable to draw conclusion. Also there are more people in "GOOD", "EXCELLENT" group compared to "BAD" group. How can I test my hypothesis? what are the approaches one might take in real world problems? As far as I understand, you have factors ("bad, "good" etc) and continuous "invitations". If you want to compare two groups you could use a t-test (e.g. Wilcoxon). If you want to compare all of the groups, you could use a simple linear regression of form: $$ invitations = \beta_0 satisfaction_1 + \beta_1 satisfaction_2 + ... + u.$$ R example: library("e1071") iris = iris table(iris$Species) #iris = iris[!(iris$Species=="versicolor"),] library(dplyr) iris %>% group_by(Species) %>% summarise_at(vars(Sepal.Length), funs(mean(., na.rm=TRUE))) Result (means): # A tibble: 3 x 2 Species Sepal.Length <fct> <dbl> 1 setosa 5.01 2 versicolor 5.94 3 virginica 6.59 Compare two groups: # Two-samples Wilcoxon test wilcox.test(iris$Sepal.Length[iris$Species=="setosa"], iris$Sepal.Length[iris$Species=="virginica"]) # The p-value is less than the significance level alpha = 0.05. We can conclude that Sepal Length is significantly different
{ "domain": "datascience.stackexchange", "id": 6066, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, statistics", "url": null }
quantum-mechanics, operators, hilbert-space, linear-algebra, density-operator $$A^i\:_{j} = e^{*i}(Ae_j)$$ where $\{e^{*i}\}$ is the basis in the dual space $\cal H'$ associated with the basis $\{e_k\}$ initial one $\cal H$, completely defined by the requirements: $$e^{*i}(e_k) = \delta^i_{k}\:.$$ In this case: $$A = A^i\:_{j} $$ The notion of trace of a linear operator $A:\cal H \to \cal H$ (not a quadratic form!) does not need the existence of a scalar product to be defined. It is consequence of the notion of contraction of tensors. In components, you easily see that $tr(A) := \sum_i A^i\:_i$ does not depend on the choice of the basis. In the presence of a scalar product, using orthonormal bases, all general formalism I have briefly introduced specializes to the standard one as you correctly wrote.
{ "domain": "physics.stackexchange", "id": 12514, "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, operators, hilbert-space, linear-algebra, density-operator", "url": null }
turing-machines, notation Title: Short notation for Turing machine configurations I'm writing about Turing machines and often need to denote the tape. I'm using exponential tapes, i.e. a repetition count for each symbol. I usually use something similar to $(x_k^{e_k})_{1 \leq k \leq m} \text{ Q } (x_k^{e_k})_{m+1 \leq k \leq n}$ (latex: $(x_k^{e_k})_{1 \leq k \leq m} \text{ Q } (x_k^{e_k})_{m+1 \leq k \leq n}$) with $x_k$ the symbols and $e_k$ their exponents. The head in state $Q$ is at position $m$. What (very slightly) annoys me about this is the need to include $Q$. Without it, it would just be $(x_k^{e_k})_{1 \leq k \leq n}$ (latex: $(x_k^{e_k})_{1 \leq k \leq n}$) , which is must easier to read. The transitions may change various symbols and exponents at the same time, while $Q$ almost always stays in the same spot. How should I note this down? Is there an easy to understand (and parse) notation which is shorter but still carries the same information? I could not find a solution in the papers I read. Or maybe I should just carry on, because this isn't an issue at all? This is just a convention. You can write a configuration as the tuple that has the same information. Eg, a possible way to write a configuration is as the tuple $$Config= (tape,state,pos)$$ where $tape$ is the non empty tape content, $state$ is the current state, and $pos$ is the position of the head.
{ "domain": "cs.stackexchange", "id": 5158, "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": "turing-machines, notation", "url": null }
algorithm-analysis, runtime-analysis, multiplication We can upper bound this by increasing the powers of 3 to just 3^2, since that can only increase the value in both cases: $\sum_{i=0}^{\lg(\lg(N))} 9 \cdot N \cdot \lg(N^{2^{-i}} 9)$ Which is asymptotically the same as: $\sum_{i=0}^{\lg(\lg(N))} N \cdot \lg(N^{2^{-i}})$ Moving the power out of the logarithm: $\sum_{i=0}^{\lg(\lg(N))} N \cdot \lg(N) \cdot 2^{-i}$ Moving variables not dependent on $i$ out: $N \cdot \lg(N) \sum_{i=0}^{\lg(\lg(N))} 2^{-i}$ The series is upper bounded by 2, so we're upper bounded by: $N \cdot \lg(N)$ Not sure where the $\lg(\lg(N))$ went. All the twiddly factors and offsets (because many recurrence relations "solutions" are broken by those) I throw in seem to get killed off by the $\lg$ creating that exponentially decreasing term, or they end up not multiplied by $N$ and are asymptotically insignificant. The sticking point is the size of the integers in the recursive step, which is not quite $\sqrt{n}$, but rather twice as large, since the product of two $t$-bit integers has size $2t$. Assuming that we break the original $n$-bit integer into $\sqrt{n}$ parts of length $\sqrt{n}$, the running time recursion is $$ T(n) = n\log n + \sqrt{n}T(2\sqrt{n}), $$ and by expanding it, we get $$ \begin{align*}
{ "domain": "cs.stackexchange", "id": 3089, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm-analysis, runtime-analysis, multiplication", "url": null }
statistical-mechanics, temperature, approximations My question is: How did they do this expansion? (My attempt:) Clearly there has been an expansion of the exponential in the numerator in terms of $\beta$, $$ \sum_i \langle i| \hat{O} e^{-\beta \hat{H}} |i\rangle = \sum_m \frac{(-\beta)^m}{m!} \sum_i \langle i| \hat{O} \hat{H}^m |i\rangle \tag{1} $$ but I'm not sure 1) how or where $\Theta$ comes from, and also 2) why there is a split of the traced terms: $\mathrm{Tr}(\hat{O}\hat{H})$, $\mathrm{Tr}(\hat{O})\mathrm{Tr}(\hat{H})$ in $\beta^1$ for example. And also 3) how to formally divide out the denominator $\sum_i \langle i| e^{-\beta \hat{H}} |i\rangle$, like after substituting (1) back into the original equation: $$ \frac{\sum_i \langle i| \hat{O} \hat{H}^m |i\rangle}{\sum_i \langle i| e^{-\beta \hat{H}} |i\rangle} = \text{terms for each $\beta^m$} $$ Can someone enlighten me on this? To first order in $\beta$, the numerator reads $$\eqalign{ \sum_i<i|Oe^{-\beta H}|i> &=\sum_i <i|O|i>-\beta\sum_i<i|OH|i>\cr &={\rm Tr}\ \!O-\beta\ \!{\rm Tr}\ \!OH\cr }$$ while the denominator is $$\eqalign{ \sum_i<i|e^{-\beta H}|i>
{ "domain": "physics.stackexchange", "id": 53097, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "statistical-mechanics, temperature, approximations", "url": null }
homework-and-exercises, electromagnetism, electric-circuits, inductance, electromagnetic-induction Title: Will there be any current induced in a purely capacitive circuit? Will current be induced in a purely capacitive circuit if a magnetic field B is present perpendicular to it and a movable conducting wire completing the circuit is moving with a velocity v. Just want to know if any current will get induced if there is no resistance or impedance. Thanks. In a conductor loop that includes a capacitor the changing magnetic flux will induce the same voltage as in the loop without capacitor or the same loop in free space without the conductor and capacitor.
{ "domain": "physics.stackexchange", "id": 33782, "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, electromagnetism, electric-circuits, inductance, electromagnetic-induction", "url": null }
sequence-analysis, motifs, pssm Title: How to deal with wildcards (N) in sequence logos This is an open question that came to my mind recently, though it might be that it is not a common use case. The purpose is to find common patterns in a collection of sequences by representing the patterns as PSSMs. However, some of the bases have sequencing errors and are thus missing. Is there a way of integrating these missing bases in the PSSM calculation? For a collection of sequences, deriving a sequence logo is relatively straightforward. For the case: ACTAGCGT ACGTACTC ACGATCTC ACGTCAGT Taking the frequencies of each letter at each position would yield the following (pseudocount-corrected) Position Frequency Matrix: A G T C 0 0.85 0.0375 0.05 0.0625 1 0.05 0.0375 0.05 0.8625 2 0.05 0.6375 0.25 0.0625 3 0.45 0.0375 0.45 0.0625 4 0.25 0.2375 0.25 0.2625 5 0.25 0.0375 0.05 0.6625 6 0.05 0.4375 0.45 0.0625 7 0.05 0.0375 0.45 0.4625 And by including background frequencies, we can derive the total Infomation Content for each position, and sum them up to compute the total Infomation Content of the matrix. But what would happen if the analyzed sequences had experimented errors in the sequencing and some of the letters were missing? ACNNGCGT ACGTACTC ACGATNTC ACNTCAGT Would you consider N a new letter of the alphabet and follow the same procedure? (counting ocurrences per position, calculating background frequencies, include it in the sequence logo...) Would you ignore them and normalize each column's frequencies to the number of non-N bases? Would you penalize positions/sequences bearing N's when calculating the IC? Other?
{ "domain": "bioinformatics.stackexchange", "id": 1855, "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": "sequence-analysis, motifs, pssm", "url": null }
python, search, numpy Since you are working with binary data, you should tell NumPy that your dtype is bool everywhere that you can. That will lower memory requirements and speed up certain operations. For example, data = np.zeros(1000) in getFixedTestData() should become data = np.zeros(1000, dtype=bool). The default NumPy dtype is float which is not what you want. The python convention for naming functions is snake_case i.e. all lowercase with underscores, not camelCase. So findPulseSlow should be find_pulse_slow etc. The right approach for optimizing your currently too-slow function is to use line profiling. I really like the line_profiler module. If you use IPython you can use it very easily as an inline magic function. Doing #3 will mean unpacking that formidable iterator comprehension you wrote! Instead of squeezing it all on one line, I'd define a generator function for the iterator, and try to be extremely explicit so that every line has only one function call, like this: def yield_convolve(arr_1, arr_2): """Yields indices of arr_1 where arr_2 nearly matches.""" MAX_ERR = 3 len_1, len_2 = len(arr_1), len(arr_2) # I assume arr_2 is always shorter than arr_1 min_matches = len_2 - MAX_ERR num_windows = len_1 - len_2 for idx in xrange(num_windows): arr_1_window = arr_1[idx:(idx+len_2)] summand = np.equal(arr_1_window, arr_2) sum_ = np.count_nonzero(summand) condition = sum_ >= min_matches if condition: yield idx def find_pulse_slow_revised(arr_1, arr_2): return np.fromiter(yield_convolve(arr_1, arr_2), dtype=int)
{ "domain": "codereview.stackexchange", "id": 15030, "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, search, numpy", "url": null }
materials Title: (At what temperature) can salt evaporate? Related to my previous question, can sodium chloride evaporate, and if so, at what temperature? Since salt is a solid, and apparently all substances can at various temperatures exist as liquids and vapors as well as solids, salt should also have a melting and a vaporization points. At what temperatures are these points if they occur, and if they don't occur, why? (This is assuming the pressure is 1000 mb) All substances may have a melting and boiling point. I say "may" because in some instances there can be decomposition, for example, before reaching either temperature. Sodium chloride has a melting and boiling point. Check Wikipedia: https://en.wikipedia.org/wiki/Sodium_chloride The sidebar lists the melting point at 801 °C (1,474 °F; 1,074 K) and the boiling point at 1,413 °C (2,575 °F; 1,686 K). The values are relatively high being consistent with the ionic nature of NaCl.
{ "domain": "chemistry.stackexchange", "id": 12688, "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": "materials", "url": null }
console, tic-tac-toe, kotlin fun playAgain() { println("Play again? (y/n)") val scanner = Scanner(System.`in`) while (true) { val input = scanner.nextLine() if (input == "n") { println("Quitting the game.") System.exit(0) } else if (input == "y") { board.resetBoardMap() return } else { println("Invalid input. Play again? (y/n)") } } } } WinningConditions.kt package main.com.github.me.tictactoe class WinningConditions(val board: Board) { private val winningCombinations = listOf( listOf("1", "2", "3"), listOf("4", "5", "6"), listOf("7", "8", "9"), listOf("1", "4", "7"), listOf("2", "5", "8"), listOf("3", "6", "9"), listOf("1", "5", "9"), listOf("3", "5", "7") ) fun win(player: Int, symbol: String): Boolean { val boardMap = board.getBoardMap() for (combination in winningCombinations) { if (combination.all { position -> boardMap[position] == symbol }) { board.drawBoard() println("Player $player WINS!") return true } } return false } } main.kt import main.com.github.me.tictactoe.Board import main.com.github.me.tictactoe.Turns import main.com.github.me.tictactoe.WinningConditions fun main() { println("Welcome to TicTacToe!") val ticTacToeBoard = Board() val turns = Turns(ticTacToeBoard) val win = WinningConditions(ticTacToeBoard)
{ "domain": "codereview.stackexchange", "id": 44934, "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": "console, tic-tac-toe, kotlin", "url": null }
complexity-theory, p-vs-np There is an alternative definition of $\mathrm{NP}$: $A \subseteq \Sigma^\star$ is in $NP$, if there is an language $L_0 \in \mathrm{P}$ and an polynom $p(x)$, such that $A = \left\{ x \mid \exists y \text{ with } |y| \leq p(|x|) \text{ and } x\#y \in L_0 \right\}$ That $y$ is called proof (or witness) that $x$ is in $A$. For example, the satisfiability problem is to check whether a given boolean formula is satisfiable or not. $\mathrm{SAT}$ is the language of all satisfiable boolean formula. Given a boolean formula $\phi$ (a instance of the satisfiability problem), we want to check whether $\phi$ is satisfiable (if $\phi \in \mathrm{SAT}$). A witness for $\phi$ is an interpretation. We can determine in polynomial time, whether the interpretation of that formula is true or false.
{ "domain": "cs.stackexchange", "id": 2569, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "complexity-theory, p-vs-np", "url": null }
c, strings, serialization, c99 va_end(args); va_end(args_dupe); return ret; } In fairness, this does require a little more code, and the v*printf functions (and argument-list macros) are a bit less known, so some may find it a bit more difficult to understand. On the other hand, in exchange for that bit of extra investment, we get something that's more general, and works much more as I think most people would expect--for example, something like this: char *s = to_string("%d, %d", 1, 2); Using this, stringify_state should turn out something like this: char* stringify_state(State* state) { Pet* p = state->pet; Settings* s = state->settings; return to_string("%lld %f %f %f %f %f %f %f %f %f %f", state->last_update_time, p->health, p->max_health, p->satiation, p->max_satiation, s->milliseconds_per_tick, s->hunger_pain_per_tick, s->hunger_per_tick, s->satiated_heal_per_tick, s->pain_per_wrong_answer, s->satiation_per_right_answer); } Levels of abstraction It may just be a pet peeve of mine, but I think this divides into cleaner layers of abstraction. With your original code, we have a single function that mixes a fairly high level of abstraction (format a State into a string) with lower levels of abstraction (e.g., memory management). @vnp's code sort of inverts the layers of abstraction, so we have the higher level of abstraction at the bottom, and the lower level of abstraction above it. This one gets the layers of abstraction closer to how I'd like to see them: the memory management and general purpose stringifying is at the bottom of the stack, and the more specific higher level concern of Stringifying a State is at an upper layer. So, something like a call graph accurately reflects the levels of abstraction being dealt with in the code. Other Points
{ "domain": "codereview.stackexchange", "id": 35090, "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, strings, serialization, c99", "url": null }
Now, from $(4)$ and $(5)$ and the variable change $\alpha=x,\, \beta=2y-1$, with $-1<x<1,\,0\le y<1$, we have: $$L_{+}(y,x,1)=-L_{+}(y,-x,1)-2\pi i\dfrac{\sin(2\pi x(y-\frac{1}{2})}{\sin(x)} \tag{8}$$ where we recognise the trigonometric term as the Dirichlet Kernel (with $x\rightarrow2x$ and for $y$ generalised to non-integer). If we then use differentiation with respect to $x$ as a raising operator we obtain the reflection formula in the $x$ variable: $$L_{+}(y,x,k)=\left( -1 \right) ^{k-1}L_{+}(y,-x,k) -2\pi i \dfrac{ \left( -1 \right) ^{k-1}}{(k-1)!}{\frac {\partial ^{k-1}}{\partial {x}^{k-1}}} {\frac {\sin \left( 2\pi x \left( y-\frac{1}{2} \right) \right) } {\sin \left( \pi x \right) }} \tag{9}$$ where the order becomes $k$ from simple differentiation of the function definition, and it also follows from reversing summation order in the function definition that: $$L_{+}(y,x,k)=\sum_{n=-\infty (n\ne0)}^{\infty}\dfrac{e^{2\pi in y}}{(n+x)^k}=(-1)^k L_{+}(-y,-x,k)\tag{10}$$ and so $(9)$ can also be viewed as a reflection formula in $y$:
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9799765569561563, "lm_q1q2_score": 0.8269974208809936, "lm_q2_score": 0.8438951064805861, "openwebmath_perplexity": 983.3417609269127, "openwebmath_score": 0.9992042183876038, "tags": null, "url": "https://math.stackexchange.com/questions/268789/symmetry-of-function-defined-by-integral/268960" }
human-biology, physiology, bacteriology, microbiome Title: Where do the bacteria within the vagina originate from? I understand that it's feasible the bacteria within the gastrointestinal tract originate from the food we eat and air we breath, but where does this population of microbes originate from? Most of the initial colonisation is said to be coincidental ('happenstance' as the textbook puts it!) exposure. It's then fairly predictable depending on: type of delivery (as Larry commented); feeding; and receipt of antibiotics. In terms of feeding, there are differences in flora between babies fed human milk and those that are given cow's milk. There's a section called 'Establishment and Composition of Normal Flora' in chapter 187 of Principles and Practice of Pediatric Infectious Diseases (3rd ed) by Long which discusses the above. It's also said that hormones may influence indigenous flora. For example, premenarcheal and postmenopausal vaginal flora are very different to those present during the childbearing period.[1]. Mandell, Douglas, and Bennett's Principles and Practice of Infectious Diseases. 7th ed. 2009. Churchill Livingstone.
{ "domain": "biology.stackexchange", "id": 255, "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": "human-biology, physiology, bacteriology, microbiome", "url": null }
algorithms, optimization, polynomial-time, bipartite-matching Title: How to optimally seperate a student body? Students will identify certain students they want to work with. I have therefore decided to split them into two groups where I want to minimize the number of people in Group 1 who want to work with students from Group 2. I was thinking about creating a source node s, and creating a node for each person ($p_i$) - followed by hooking up the s to each $p_i$. Then I would create, another series of nodes for each person ($q_i$) and hook up each $p_i$ to each $q_i$ if $p_i$ doesn't want to work with $q_i$. Then, I would hook up each $q_i$ to a terminal node t. Each of the edges would have weight 1. I was thinking about running Edmonds–Karp on it. Now, the solution would yield the maximum bipartite matching of the group (see e.g. here). For each active arc from $p_i$ to $q_i$ in the final diagram, I would separate those two students. However, I have a bad taste in my mouth after running this algorithm; the bad taste stems from modeling the instance with respect to my intention: If I maximize the complement (the desire not to work with someone), do I really minimize the desire of students to work with each other across the two groups? If my hunch is correct (in that I'm wrong), please point me in the right direction. It sounds like you have properly reduced the maximum bipartite matching problem to the maximum flow problem, all you need is the reasoning to convince yourself why it is true. You are worried about the complement, so let's consider that. Remember that there is a duality among the minimum cut problem and the maximum flow problem so in finding the minimum cut you will equivalently find the maximum flow. For the definition of minimum cut: a partition of the vertices of a graph into two disjoint subsets that are joined by at least one edge whose cut set has the smallest number of edges (unweighted case) or smallest sum of weights possible. Several algorithms exist to find minimum cuts.
{ "domain": "cs.stackexchange", "id": 2666, "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, optimization, polynomial-time, bipartite-matching", "url": null }