text
stringlengths
49
10.4k
source
dict
asked by amit on June 26, 2013 3. ### advance functions gr 12 use the asymptotes and intercepts to make a quick sketch of the function f(x)= x-2 (numerator) x+4(denominator) and its reciprocal f^r = x+4 (numerator) x-2 (denominator) on the same set of axes. b) describe the symmetry in the asked by james on April 1, 2013 4. ### advance functions gr 12 use the asymptotes and intercepts to make a quick sketch of the function f(x)= x-2 (numerator) x+4(denominator) and its reciprocal f^r = x+4 (numerator) x-2 (denominator) on the same set of axes. b) describe the symmetry in the asked by james on April 2, 2013 5. ### Math advance functions gr 12 use the asymptotes and intercepts to make a quick sketch of the function f(x)= x-2 (numerator) x+4(denominator) and its reciprocal f^r = x+4 (numerator) x-2 (denominator) on the same set of axes. b) describe the symmetry in the asked by james on April 1, 2013 6. ### Math If the numerator of a fractionis multiplied by 4 and the denominatoris reduced by 2,the result is 2.if the numerator of the fraction is increase by 15 and 2 subtracted from the double of the denominator the result is 9/7, find the asked by Abhi on July 1, 2016 use the asymptotes and intercepts to make a quick sketch of the function f(x)= x-2 (numerator) x+4(denominator) and its reciprocal f^r = x+4 (numerator) x-2 (denominator) on the same set of axes. b) describe the symmetry in the asked by james on April 2, 2013 8. ### advance functions gr12 HELP ASAP
{ "domain": "jiskha.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9637799482964023, "lm_q1q2_score": 0.8285266884839243, "lm_q2_score": 0.8596637541053281, "openwebmath_perplexity": 4332.829309088019, "openwebmath_score": 0.8611836433410645, "tags": null, "url": "https://www.jiskha.com/questions/143400/The-numerator-of-a-fractionis-5-less-than-twice-the-denominator-If-the-numerator" }
thermodynamics, soft-question, terminology Title: Proper name for a thermodynamic process with constant internal energy $U$ Back in the day I learned that a few special thermodynamical processes have special names. For example, if one keeps $P$ constant, the process is called isobaric, if one keeps $T, V$ or $S$ constant, one gets, correspondingly, isothermic, isochoric or isentropic processes. Similarly, if one keeps $\dfrac{\mathrm{d} \ln P}{\mathrm{d} \ln \rho}$ constant during the process, it is called polytropic, and if $\delta Q = 0$ at any time, the process is called adiabatic. Now, the question: what is the process called, if one keeps internal energy $U$ constant? A process where the energy is kept constant is called isoenergetic (or, if you prefer, iso-energetic). It also seems from the literature that a flow where the energy is constant when following a fluid particle is usually called an isoenergetic flow. Similarly, when the enthalpy is kept constant, the process (or the flow) is said to be isenthalpic (or isoenthalpic). And so on. Notice that if there is some subtlety and you keep a constant internal energy $U=\text{cte}$ but not a constant energy $E=U+E_{\text{m}}$, by modifying the mechanical energy $E_{\text{m}}$, you should refrain from using standard names like isoenergetic and explain precisely what happens.
{ "domain": "physics.stackexchange", "id": 38442, "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": "thermodynamics, soft-question, terminology", "url": null }
c++, lambda Title: Examples of lambda functions, std::for_each / max_element / remove_if etc I have written a cpp program which demonstrates the use of the following functionalities in modern cpp. Lambda Functions std::generate std::vector std::erase std::remove_if std::remove std::max_element std::for_each std::shuffle I want to understand the following (1) Have I written the code properly or there are somethings which needs to be improved. (2) Will it be helpful if I write it as a blog for others. If yes, do I need to add more comments etc to make it more consumable? /* * Copyright Rishi Agrawal <rishi.b.agrawal@gmail.com> * * The idea behind this program is to understand how to use the following. * Lambda Functions * std::generate * std::vector * std::erase * std::remove_if * std::remove * std::max_element * std::for_each * std::shuffle */ #include <iostream> #include <vector> #include <algorithm> #include <random> #include <cassert> void printInt(int n) { std::cout << " " << n; } /** * @brief Function to demonstrate lambda functions. * * @param v - the vector to use. */ void playingWithLambdaFunctions(std::vector<int> &v) { /* Generate the elements in the vector. The lambda function take a variable * and increments it everytime. Using mutable so that the value of the * variable is preserved accross invocations of lambda.*/ std::generate(v.begin(), v.end(), [n = 0]() mutable { n = n + 5; return n;}); /* Print the vector using a lambda function. Here the value at a particular * position is passed as n. This passing is by value. */
{ "domain": "codereview.stackexchange", "id": 30214, "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++, lambda", "url": null }
doppler-effect c = 331.06 + 0.61t, t = 23.8[C] ‘’ temperature of the lab’’ f'=f * c/(c+-Vz) f = 39023‘’stationary frequency’’ , Vz’’ speed of the source(train)’’ Theoretical Frequency [Hz] → 38996.7 Measured Frequency [Hz] → 39000.4 Theoretical Frequency[Hz] ← 39046.5 Measured Frequency[Hz] ← 39042.2 The error for both directions is very similar - approximately 4 Hz - and with a consistent sign (measured frequency is 4 Hz closer to the actual source frequency than the "theoretical value"). From this I infer that most likely your velocity measurement is very poor, or the alignment of velocity vector and sound vector is very bad. If your microphone is not "directly in front of" the train, then the Doppler shift observed will be smaller - and this effect gets worse if you average the signal over a longer time (so the train gets closer to the microphone, and the angle error gets bigger). Without seeing your setup, it is hard to know if that is the source of your problem but I certainly would not rule it out. You have an equation for the speed of sound $c$ which depends on $T$, the temperature (although you used $t$, I am pretty sure it's a function of temperature, not time). You give the temperature as 23.8 C. That implies an error of < 0.1 C in temperature, which would result in an error of < 0.06 m/s in the velocity; that is 0.02% of the value of ~331 m/s; and you can see that the size of the doppler shift directly relates to the error in the sound speed (there is a term $\frac{v}{c}$ which will scale with error in $v$ or $c$.) You didn't specify how accurately you know the velocity of your train, or how well the source is aligned with the receiver (if your velocity is not quite directed straight at your sensor, it will affect the Doppler shift).
{ "domain": "physics.stackexchange", "id": 30709, "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": "doppler-effect", "url": null }
python, algorithm, tree if len(stack) != 0: node_tuple = stack[-1] # This case catch the event for traversing down to the child elif node_tuple[0].node_list is not None: for child in node_tuple[0].node_list: stack.append((child, layer + 1)) node_tuple = (node_tuple[0].node_list[-1], layer + 1) layer += 1 # This case catch the event that we are at the termination node elif node_tuple[0].node_list is None: old_node = stack.pop() node_dict = {'value': old_node[0].value, 'children': []} node_tuple = stack[-1] # Two possible scenario # 1. The next node is in the same layer # 2. The next node is in the parent layer if node_tuple[1] == layer: if layer in level: level[layer].append(node_dict) else: level[layer] = [node_dict] else: if layer in level: level[layer].append(node_dict) else: level[layer] = [node_dict] parent_node = stack.pop() parent_node_dict = {'value': parent_node[0].value, 'children': level.pop(layer, None)} pre_layer = layer layer -= 1 if layer in level: level[layer].append(parent_node_dict) else: level[layer] = [parent_node_dict] if len(stack) != 0: node_tuple = stack[-1] return [parent_node_dict]
{ "domain": "codereview.stackexchange", "id": 13134, "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, algorithm, tree", "url": null }
ros-melodic, catkin-make And python -c 'import catkin_pkg; print(catkin_pkg.__file__)' got /usr/lib/python2.7/dist-packages/catkin_pkg/__init__.pyc And printenv | grep ROS ROS_ETC_DIR=/opt/ros/melodic/etc/ros ROS_ROOT=/opt/ros/melodic/share/ros ROS_MASTER_URI=http://localhost:11311 ROS_VERSION=1 ROS_PYTHON_VERSION=2 ROS_PACKAGE_PATH=/opt/ros/melodic/share ROSLISP_PACKAGE_DIRECTORIES= ROS_DISTRO=melodic
{ "domain": "robotics.stackexchange", "id": 31049, "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-melodic, catkin-make", "url": null }
ros, eigen, eigen3 Title: Eigen3 Error When Installing ROS on Raspi3 Jessie Hello, I keep running into this issue when trying to install ROS Kinetic on my Raspberry Pi 3. Followed a few forums with this as the problem but the CMakeLists.txt was already updated with the answers that I found and still I am running into this error. Any help would be greatly appreciated. Pretty new with ROS and coding in general so some detailed steps on how to solve this would be great! CMake Error at CMakeLists.txt:8 (find_package): By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Eigen3", but CMake did not find one. Could not find a package configuration file provided by "Eigen3" with any of the following names: Eigen3Config.cmake eigen3-config.cmake Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set "Eigen3_DIR" to a directory containing one of the above files. If "Eigen3" provides a separate development package or SDK, be sure it has been installed.
{ "domain": "robotics.stackexchange", "id": 26940, "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, eigen, eigen3", "url": null }
string-theory, standard-model However the hope is that: That string theory will lead to a specific model that incorporates gravity also, from which the structure of the Standard Model will come out naturally, with fewer constants than the descriptive ones needed now, If I read correctly, this means that Superstring theory can reproduce Standard Models and much more, if we specify the correct "boundary conditions", ie: a few other arbitrary parameters ( less than the number of arbitrary parameters we need to specify in Standard Model). Is my understanding correct?If yes, what are the theoretical puzzles and/or experimental results that superstring theory can explain, but Standard Models can't? To my knowledge, there are zero instances where any string theory has made a prediction, the approach using the standard model has made a different prediction or no prediction, and the string theory prediction has turned out to match the data. The closest to this that I'm aware of came about fifteen years ago, when string theorists realized that, if one or two of the proposed extra spatial dimensions were large, gravity would depart from the Newtonian $1/r^2$ behavior when the distance between two masses approached the compactification length scale of the extra dimensions. In response, experimentalists developed a program of torsion pendulum measurements sensitive to deviations from $1/r^2$ gravity all the way down to micrometer lengths. There aren't any: any "large" extra dimension in string theory is still microscopic. The experimental challenge in going to shorter distances is the mechanical challenge of separating the test masses, and I think the experimentalists have moved on to other, less glamorous fifth-force sorts of tests.
{ "domain": "physics.stackexchange", "id": 49807, "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": "string-theory, standard-model", "url": null }
ros, multithreading, rclpy This results in an Exception being thrown in the second thread: Exception in thread Thread-2: Help me body, you are my only hope Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/__init__.py", line 191, in spin executor.spin_once() File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 703, in spin_once handler, entity, node = self.wait_for_ready_callbacks(timeout_sec=timeout_sec) File "/opt/ros/foxy/lib/python3.8/site-packages/rclpy/executors.py", line 689, in wait_for_ready_callbacks return next(self._cb_iter) ValueError: generator already executing I realize there are other methods of composing multiple nodes but as I said, the nodes I'm building do a lot of other things in threads and are spun up dynamically by another process. Is there some method I'm missing to tell rclpy to spin all nodes? It seems the rclpy.spin() method requires the node argument. edit: Quick addition. The nodes I'm building inherit from rclpy.node.Node and I also attempted to rclpy.spin_once(self) from within those nodes in their main thread (thread that does other things) and I end up at the same ValueError: generator already executing error.
{ "domain": "robotics.stackexchange", "id": 36411, "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, multithreading, rclpy", "url": null }
c#, linq Title: Merging IEnumerable and removing duplicates I have a method that exacts data from an XML and returns an IEnumerable<Foo>. I am trying to create a method that will merge the results from 2 different XML's files into a single IEnumerable and remove any duplicate data that may be found A duplicate in this case is defined as 2 Foo objects that have the same Name property even if the other data is different. If there is a duplicate, I always want to keep the Foo from the first IEnumerable and discard the 2nd. Am I on the right track with this LINQ query, or is there a better way to accomplish what I am trying to do? public IEnumerable<Foo> MergeElements(XElement element1, XElement element2) { IEnumerable<Foo> firstFoos = GetXmlData(element1); // get and parse first set IEnumerable<Foo> secondFoos = GetXmlData(element2); // get and parse second set var result = firstFoos.Concat(secondFoos) .GroupBy(foo => foo.Name) .Select(grp => grp.First()); return result; } The biggest concern I have with this code is that I am not certain the duplicate filtering rules I want will be guaranteed. I know Concat will just append secondFoos to the end of firstFoos, but when calling GroupBy(), will the resulting IGrouping object always have elements in the same order as the source data? With things like this, it's usually best to look at the documentation. Is your approach with GroupBy() going to work? Yes: Elements in a grouping are yielded in the order they appear in source. Can you use Distinct() to do the same thing more concisely? No (at least you shouldn't depend on it): The Distinct method returns an unordered sequence that contains no duplicate values. Is there some other way? Yes, you can use Union(): When the object returned by this method is enumerated, Union enumerates first and second in that order and yields each element that has not already been yielded.
{ "domain": "codereview.stackexchange", "id": 1656, "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#, linq", "url": null }
solid-state-physics, crystals So $$U\approx\sum_{{\bf k} \, \in \, \text{BZ}}n_B(\epsilon_{\bf k},T) \epsilon_{\bf k}= \sum_{{\bf k} \, \in \, \text{BZ}}\frac{\epsilon_{\bf k}}{e^{\beta \epsilon_{\bf k}}-1}\longrightarrow \frac{V}{(2\pi)^3}\int_{\text{BZ}}\frac{1}{e^{\beta \epsilon_{\bf k}}-1}d^3{\bf k}\tag{2}$$ In the high-temperature limit $$k_B T \gg \epsilon_{\bf k}\implies\exp(\beta \epsilon_{\bf k})\approx 1+\beta \epsilon_{\bf k}\implies n_B(\epsilon_{\bf k},T)\approx\frac{k_B T}{\epsilon_{\bf k}}$$ Using the left hand side of $(2)$, $$U\approx\sum_{{\bf k} \, \in \, \text{BZ}}n_B(\epsilon_{\bf k},T) \epsilon_{\bf k}=k_B T\sum_{{\bf k} \, \in \, \text{BZ}}1=k_B T \times N_{\text{atoms}}$$ by virtue of $(1)$ So does this really mean that $$\sum_{{\bf k} \, \in \, \text{BZ}}1=N_{\text{atoms}}?$$ So let us look at some very simple real-space lattices and their corresponding reciprocal lattices to see if this is really true:
{ "domain": "physics.stackexchange", "id": 57942, "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": "solid-state-physics, crystals", "url": null }
python, python-2.x, portability, checksum I thank you ahead of time for reviewing my code, and thank you for your thoughts and suggestions. Prerequisite: Third-party module, exitstatus compute-file-hashes.py #!/usr/bin/env python import os import hashlib import argparse from exitstatus import ExitStatus # Customized exit handler, though we can't let it be called anywhere else. def _exit(error_occurred=False, err=None): if error_occurred: print "\r\nProcess ended in error, details:" print _get_exception_string(err) exit(ExitStatus.failure) else: exit(ExitStatus.success) # Custom built-in for formatting Exception output in a friendly-ish way. def _get_exception_string(exception=None): # errtype=type(e).__name__, errmsg=str(e) # print "[%s] %s" % (errtype, errmsg) return "[%s] %s" % (type(exception).__name__, str(e)) # Return the size of the file in bytes, necessary for chunking determination def _get_filesize(path): return os.path.getsize(path) # Handler for hash computations, so we don't have to repeat the same 'hash it' code # four times over # # noinspection PyUnusedLocal,PyShadowingNames def _compute_hash(filepath, digest): try: # Init the hashlib object if digest == 'md5': filehash = hashlib.md5() elif digest == 'sha1': filehash = hashlib.sha1() elif digest == 'sha256': filehash = hashlib.sha256() elif digest == 'sha512': filehash = hashlib.sha512() else: raise TypeError( "Invalid digest type specified, accepted are: md5 , sha1, sha256, sha512")
{ "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 }
quantum-mechanics, condensed-matter, wavefunction, schroedinger-equation, crystals PS: My descriptions are for a 1D case. The generalisation to higher dimensions is straightforward if necessary.
{ "domain": "physics.stackexchange", "id": 90873, "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, condensed-matter, wavefunction, schroedinger-equation, crystals", "url": null }
quantum-mechanics, operators, many-body, second-quantization Shouldn't the product in your definition of $\left|\Psi\right>$ go over $i,i'$? Is it restricted to $i>i'$? Is there any restriction that $\alpha\neq\beta$? Could you provide details of the solution you have tried so far?
{ "domain": "physics.stackexchange", "id": 6429, "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, many-body, second-quantization", "url": null }
vba, excel Multiple variables declared on one line. Dim i, iLastSource, iRowTarget, count As Long only count is declared as a Long type. The rest are Variant. Likewise for Dim wsSource, wsTarget As Worksheet only wsTarget has the type of Worksheet, wsSource if of type Variant. Fix this by declaring each variable on its own line. Also declare them just before you use them. This makes refactoring easier and avoids unused variables. Your Stig Jan worksheet isn't created in the click event which means it's available at design time. Reference that worksheet by using the Worksheet.CodeName property. In the VBIDE under View>Properties Window (Hotkey: F4). Rename the CodeName, shown in properties window as (Name) property, to a descriptive name. I've rename it to StigJan. Then you can reference that worksheet directly. This way if the name of the worksheet changes your code won't break. Hungarian notation isn't needed. Because you have your variables declared with a type As Worksheet you don't need the ws prefix. Place your cursor on a variable name and from the menu at the top Edit>Quick Info (Hotkey: Ctrl+I) you can display the variables type. Your For ... Next statement logic can be simplified. You're looping with the counter i but within that loop setting a cell variable. This is a candidate for a For Each ... Next statement. For i = 36 To iLastSource Dim cell As Worksheet Set cell = .Cells(i, 4) Becomes the code below. This clarifies the intent that you're looping through each cell in the area. Dim checkArea As Range Set checkArea = source.Range(source.Cells(36, 4), source.Cells(iLastSource, 4)) Dim checkCell As Range For Each checkCell In checkArea
{ "domain": "codereview.stackexchange", "id": 37252, "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": "vba, excel", "url": null }
testing whether or not you are a human visitor and to prevent automated spam submissions. 16 . It is a measure of how precise is our estimate of the mean.The main use of the standard error of the mean is to Standard Error of the Mean (a.k.a. , to account for the added precision gained by sampling close to a larger percentage of the population. In total, 5828 pregnant women were recruited. When conducting statistical analysis, especially during experimental design, one practical issue that one cannot avoid is to determine the sample size for … T What does standard error mean? The sampling distribution of a population mean is generated by repeated sampling and recording of the means obtained. Understanding ‘Standard Error of the mean’ isn’t h In this case, the observed values fall an average of 4.89 units from the regression line. In simple words, SD determines how the sample data represents the mean accurately. σ If the statistic is the sample mean, it is called the standard error of the mean (SEM). is a random variable whose variation adds to the variation of Q. We can describe this using STANDARD ERROR of the MEAN (SEM) -> mathematically, SEM = SD/√(sample size). Everybody with basic statistical knowledge should understand the differences between the standard deviation (SD) and the standard error of mean (SE or SEM). A t-test is a statistical method used to see if two sets of data are significantly different. x When the true underlying distribution is known to be Gaussian, although with unknown σ, then the resulting estimated distribution follows the Student t-distribution. We are an Essay Writing Company Get an essay written for you for as low as $13/page simply by clicking the Place Order button! It has a great role to play the testing of statistical hypothesis and interval estimation. Standard deviation tells you how spread out the data is. {\displaystyle n} If a number is added to a set that is far away from the mean, how does this affect standard deviation? How can you calculate the Confidence Interval (CI) for a mean? It gives an idea of the exactness and … such that. ), you need to compare it to your estimate of the population mean and your estimate of the population standard deviation (not the sample mean's standard deviation, also known as SEM). {\displaystyle \sigma _{\bar {x}}} Where: s =
{ "domain": "mecaartfair.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9546474181553805, "lm_q1q2_score": 0.8542084442330713, "lm_q2_score": 0.8947894562828415, "openwebmath_perplexity": 773.6649043747163, "openwebmath_score": 0.8511279225349426, "tags": null, "url": "https://mecaartfair.com/rick-stein-brkmyry/aa8fa1-what-is-standard-error-of-the-mean" }
lagrangian-formalism, interactions Title: Strong interaction and the Lagrangian for electromagnetic interaction The Lagrangian for electromagnetic field has the following expression: $$ L = -\frac{1}{c^{2}}A_{\alpha}j^{\alpha} - \frac{1}{8 \pi c}(\partial_{\alpha} A_{\beta})(\partial^{\alpha}A^{\beta}) $$ (I used Lorentz calibration $\partial_{\alpha} A^{\alpha} = 0 $). If I add the summand $\frac{\mu^{2}}{8 \pi c}A_{\alpha}A^{\alpha}$, I'll get an equations for field (which characterized by some 4-vector $A^{\alpha}$ (not electromagnetic (!!!))) of strong interaction and (for static case) the expression for Yukawa potential. So what is the physical meaning of summand written above? This term is somehow characteristic of the mass of the interaction carriers, but I don't understand the physical meaning of $A_{\alpha}A^{\alpha}$. If you take your Lagrangian, including the $A^\alpha A_\alpha$ and vary it with respect to $A^\alpha$, you will get the classical equation of motion: $\partial_\beta \partial^\beta A^\alpha + \mu^2 A^\alpha = 0 $. If you use a plane wave as a trial solution for this: $A^\alpha = e^{i p\cdot x} \epsilon^\alpha $ where the $\epsilon^\alpha$'s are polarization vectors that obey your gauge (calibration) condition, you will get: $(p^2 -\mu^2)e^{i p\cdot x} \epsilon^\alpha= 0 $. Which enforces: $(p^2 -\mu^2)= 0 $. Expanding out the four momentum we get: $E^2-|\vec{p}|^2-\mu^2 = 0 $. After rearranging we get:
{ "domain": "physics.stackexchange", "id": 6524, "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, interactions", "url": null }
nuclear-physics, standard-model, radiation, weak-interaction, carrier-particles Is it called a force only because it has some corresponding force particles? As detailed in the last few paragraphs, technically yes. You are correct with that perspective. Mind you, there are many perspectives and interpretations on what forces really are (and aren't). why do we call it a force? Since I've mentioned that a more modern interpretation of the the fundamental forces are to look at them as interactions, a more general question would be why are these interactions considered force-like? In basic kinematics, a force (according to my definition) is simply an exertion of energy, which, when unimpeded will result in kinetic acceleration. Therefore, these interactions are force-like because the energetic processes leave some residue kinetic energy left-over in the interacting particles. When a lot of these interactions happen, the kinetic energy accumulates, resulting in kinetic acceleration of a part of the system. But what exactly does the weak force do? As an example, one of the main areas of weak interactions is the ability for quarks to change flavors by emitting a $W$ boson, which is just one of the types of interactions that happen all the time (shown in red in the below gif). For the case of the neutron, under specific scenarios that emitted boson will split into a electron/antinuetrino pair (another type of weak-interaction). That scenario is beta decay. The neutron has decayed into a proton (because one of it's quarks changed flavors), and into an electron/antineutrino (from the $W$ boson emitted from the flavor-changing quark). As for why weak interactions often "expel" particles from a nucleus (taking into account your diagram), my best (uneducated) answer is that it's simply the favorable direction for the residue kinetic energy of the weak interactions to accumulate in. Most likely due to the the geometry and symmetry of the nucleus. Since the nucleus is roughly spherically symmetric, the only direction for decayed particles to really go in is "outward". As a final note, my background is in theoretical mathematics, so I cross my fingers that anything I've glossed over is corrected in the comments by those more physically-inclined.
{ "domain": "physics.stackexchange", "id": 68965, "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": "nuclear-physics, standard-model, radiation, weak-interaction, carrier-particles", "url": null }
cell-biology, neuroscience, physiology, neurotransmitter, cell-signaling Title: Is every neurotransmitter receptor an ion channel? This is a rudimentary question--perhaps the answer is well known to biologists, but is every neurotransmitter receptor also an ion channel? For example, NMDAR is a glutamate receptor and cation channel and GABA_A receptors are gated ion channels. Is this true generally? If not, is there a classification of neurotransmitter receptors according to abstract function (e.g. all gated ion channels would form one class, then perhaps there are others)? Thank you in advance! I am a mathematician just getting interested in some biology problems and trying to organize the basic knowledge in this area. I appreciate any insights here! is every neurotransmitter receptor also an ion channel? No. There are two general types of receptors for neurotransmitters, ligand gated ion channels and receptors that activate second messenger systems, for example, G protein coupled receptors. They are sometimes referred to as ionotropic and metabotropic receptors. This figure from Principles of Neural Science, Ch. 10 illustrates the difference nicely:
{ "domain": "biology.stackexchange", "id": 8958, "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": "cell-biology, neuroscience, physiology, neurotransmitter, cell-signaling", "url": null }
fluid-dynamics, differentiation, density, flow Title: Density of particles in the Lagrangian description of fluid flow I am trying to learn about the material (or particle) derivative in fluid dynamics. I was looking through this explanation, and they mention things at the beginning and the end that confuse me. Lagrangian description: Picture a fluid flow where each fluid particle caries its own properties such as density, momentum, etc. As the particle advances its properties may change in time. $ $ Example of incompressible flow where $\frac{D\rho}{Dt}=0$: Assume a flow where the density of each fluid particle is constant in time. Be careful not to confuse this with $\frac{\partial\rho}{\partial t}=0$, which means that the density at a particular point in the flow is constant and would allow particles to change density as they flow from point to point. Also, do not confuse this with $\rho=const$, which for example does not allow a flow of two incompressible fluids.
{ "domain": "physics.stackexchange", "id": 52112, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, differentiation, density, flow", "url": null }
organic-chemistry, inorganic-chemistry, physical-chemistry Title: What are the main axis of research in Chemistry? I would like to know what are the main problems currently studied in Chemistry. For some reason, it seems that there is far less vulgarisation in chemistry than the other fields, and it's hard to find an overview of the field accessible to a layman (compared to math or physics for instance). I only found this wikipedia page, but I have no idea how relevant it is. Even though I voted to close this question as not constructive, these are among the most important unsolved problems in chemistry:
{ "domain": "chemistry.stackexchange", "id": 450, "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, inorganic-chemistry, physical-chemistry", "url": null }
r, seurat Title: Seurat installation fails When I am trying to install Seurat in R markdown file: install.packages("Seurat") it fails with the following errors: Installing package into ‘/sfs/qumulo/qhome/nv4e/R/x86_64-pc-linux-gnu-library/3.3’ (as ‘lib’ is unspecified) Warning in install.packages : dependency ‘proxy’ is not available also installing the dependencies ‘igraph’, ‘dtw’, ‘diffusionMap’ trying URL 'https://cran.rstudio.com/src/contrib/igraph_1.2.1.tar.gz' Content type 'unknown' length 2703426 bytes (2.6 MB) downloaded 2.6 MB trying URL 'https://cran.rstudio.com/src/contrib/dtw_1.18-1.tar.gz' Content type 'unknown' length 849256 bytes (829 KB) downloaded 829 KB trying URL 'https://cran.rstudio.com/src/contrib/diffusionMap_1.1-0.tar.gz' Content type 'unknown' length 39130 bytes (38 KB) downloaded 38 KB trying URL 'https://cran.rstudio.com/src/contrib/Seurat_2.3.0.tar.gz' Content type 'unknown' length 846065 bytes (826 KB) downloaded 826 KB * installing *source* package ‘igraph’ ... ** package ‘igraph’ successfully unpacked and MD5 sums checked installing to /sfs/qumulo/qhome/nv4e/R/x86_64-pc-linux-gnu-library/3.3/igraph/libs ** R ** demo ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded
{ "domain": "bioinformatics.stackexchange", "id": 526, "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": "r, seurat", "url": null }
java, beginner, game, swing, minesweeper public Cell getCell(int id){ for(Cell[] a : cells){ for(Cell b : a){ if(b.getId() == id) return b; } } return null; } public void fail(){ for(Cell[] a : cells){ for(Cell b : a){ b.reveal(); } } } } Cell Clas: import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Cell implements ActionListener{ private JButton button; private Board board; private int value; private int id; private boolean notChecked; public Cell(Board board){ button = new JButton(); button.addActionListener(this); button.setPreferredSize(new Dimension(20,20)); button.setMargin(new Insets(0,0,0,0)); this.board = board; notChecked = true; } public JButton getButton() { return button; } public int getValue() { return value; } public int getId() { return id; } public void setId(int id) { this.id = id; } public void setValue(int value) { this.value = value; } public void displayValue(){ if(value==-1){ button.setText("\u2600"); button.setBackground(Color.RED); }else if(value!=0){ button.setText(String.valueOf(value)); } } public void checkCell(){ button.setEnabled(false); displayValue(); notChecked = false; if(value == 0) board.scanForEmptyCells(); if(value == -1) board.fail(); } public void incrementValue(){ value++; } public boolean isNotChecked(){ return notChecked; } public boolean isEmpty(){ return isNotChecked() && value==0; }
{ "domain": "codereview.stackexchange", "id": 13387, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, game, swing, minesweeper", "url": null }
planet, solar-system Title: How do we weigh a planet? How do we weigh a planet? My friend asked me how do scientists weigh a planet. He is not from science background so I need to make him understand with simple analogy. How can I explain to him? The other answer posted is correct, but let me try to explain it a bit more fully, and actually correct you on your terms. I did an interview on this topic for a podcast literally just two days ago, so it's fresh in my mind. The way we determine an astronomical object's mass is through Newton's form of Kepler's Third Law, which relates the distance another object orbits the object in question to the distance it orbits from that object, and some fundamental math and physics constants. Doing this requires that there be a smaller, "test" object in orbit of the object whose mass you want to measure. Conceptually, this means that we can only measure an object's mass via that mass's effect on another object.
{ "domain": "astronomy.stackexchange", "id": 4821, "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": "planet, solar-system", "url": null }
classification, data-mining, dataset, k-nn Title: Question about Knn and split validation I have a big database with 40k recors and 2 classification classes. In this big database the 76% of records belong to the first class. I've used a 70-30 split partition with stratified sampling, and the K-nn gives the best accuracy on k = 20. 1) Is it too big value for k ? 2) Is it possible that this big value for k is due to the disproportion of the 2 classes in the database , even if i used a stratified sampling ? There is generally a trade of in k-NN: k should be large enough to cancel out any noise. k shouldn't be too large to create big biased boundaries. One rule of thumb is to select an odd k value to avoid ties in binary class problems. Small and big value of k is subjective to the underlying structure of the data set itself, that's why we check over a range of k values. Both of the above gets settled if done a good job with cross validation. So the most important question you need to focus is: Have you chosen the right metric for model selection, keeping the imbalance of classes into consideration? I would recommend you to first identify the class that is more important for you to predict correctly. Then, look at the confusion matrix and ponder upon different metrics (eg. recall, precision etc.) before finalizing a model/ k value.
{ "domain": "datascience.stackexchange", "id": 3091, "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": "classification, data-mining, dataset, k-nn", "url": null }
laserscan, pointcloud Comment by RSA_kustar on 2014-07-20: what is the difference between the target frame and frame id ?? the frame id for the /scan topic in my case is laser0_frame. So should it be the target frame or not ? Comment by Mudassir Khan on 2014-07-31: for /opt/ros/groovy/include/laser_geometry/laser_geometry.h:46:22: fatal error: Eigen/Core: No such file or directory try http://answers.ros.org/question/185948/eigencore-on-ros-hydro/ Comment by Tooght on 2016-11-30: Hi .I followed the above steps but it didn't work. CMakeFiles/My_Filter.dir/src/My_Filter.cpp.o: In function My_Filter::My_Filter()': My_Filter.cpp:(.text+0x84): undefined reference to tf::Transformer::DEFAULT_CACHE_TIME' My_Filter.cpp:(.text+0x88): undefined reference to `tf::Transformer::DEFAULT Comment by lounis on 2018-02-21: Hi D. I came here as I want convert laserscans into pointcloud2. I've laserScans stored in a bag. I tried ur code. The error I get is with the difference in timestamps between laserscans, the bag (generated later on) and current time (tf's). I tried wth sim time but didnt work. Any help is wlcm.10x
{ "domain": "robotics.stackexchange", "id": 6707, "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": "laserscan, pointcloud", "url": null }
python, classification, neural-network, scikit-learn, image-classification Title: Image Segmentation with a challenging background I'm working on an animal classification problem, with the data extracted from a video feed. The recording was made in a pen, so the problem is quite challenging with a dark background and many shadows: Initially I tried scikit-image, but then someone helped me with an advanced tool called crf-rnn (http://crfasrnn.torr.vision/) that does a great job segmenting and labelling objects in an image. I did the following: import caffe net = caffe.Segmenter(MODEL_FILE, PRETRAINED) IMAGE_FILE = '0045_crop2.png' input_image = caffe.io.load_image(IMAGE_FILE) from PIL import Image as PILImage image = PILImage.fromarray(np.uint8(input_image)) image = np.array(image) mean_vec = [np.mean(image[:,:,vals]) for vals in range(image.shape[2])] im = image[:, :, ::-1] im = im - reshaped_mean_vec cur_h, cur_w, cur_c = im.shape pad_h = 750 - cur_h pad_w = 750 - cur_w print(pad_h, pad_w, "999") im = np.pad(im, pad_width=((0, max(pad_h,0)), (0, max(pad_w,0)), (0, 0)), mode = 'constant', constant_values = 255) segmentation = net.predict([im]) segmentation2 = segmentation[0:cur_h, 0:cur_w] The resulting image segmentation is rather poor (although two cows are recognized correctly): I use a trained crf-rnn (MODEL_FILE, PRETRAINED), which works well for other problems, but this one is harder. I would appreciate any suggestions on how to pre-process this sort of image to extract the shape of most cows. It would be appreciated if you could explain precisely what your goal is:
{ "domain": "datascience.stackexchange", "id": 727, "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, classification, neural-network, scikit-learn, image-classification", "url": null }
c++, c++14, serialization, portability /// \brief Writes a variable to the stream. /// \tparam T Type of the variable. /// \param[in] var Variable to write. /// \return Reference to this stream. /// \throw TODO /// \note No endianness conversion will be performed if a byte is not 8 bit /// wide. template <typename T> BinaryOutputStream& operator<<(T var) { static_assert(std::is_pod<T>::value, "Binary stream can only write POD types."); #if CHAR_BIT == 8 Endianness systemendianness = General::GetEndianness(); if ((systemendianness != Endianness::Unknown) && (systemendianness != this->GetEndianness())) { SwapBytes(var); } #endif char* buffer = reinterpret_cast<char*>(&var); std::size_t buffersize = sizeof(var); this->Write(buffer, buffersize); return *this; } /// \brief Swaps bytes of a given variable. /// \tparam T type of the variable. /// \param[in,out] var Input variable. template <typename T> void SwapBytes(T &var) { char* buffer = reinterpret_cast<char*>(&var); for (std::size_t i = 0, j = sizeof(var) - 1; i < j; ++i, --j) { std::swap(buffer[i], buffer[j]); } } Is this correct? Have I triggered undefined behavior? Are static_asserts correct? Maybe they are overly restrictive or not strict enough? Please quote the standard if possible. TODO throw documentation Throw documentation TODO? E. g. here: /// \throw TODO this pointer Usage of this as in here is unnecessary. this->Read(buffer, buffersize); Calling the method without it is more common. Read(buffer, buffersize);
{ "domain": "codereview.stackexchange", "id": 20709, "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++14, serialization, portability", "url": null }
cosmology, cosmic-microwave-background Title: Motivation for using $\sigma_{8}$? Press-Schechter formalism allows one to universally quantify the number of massive dark matter halos in a given volume -- The Halo Mass Function. The density contrast is given by the rms mass variance in Fourier space, which is the dependent on the linear power spectrum $P_{\rm lin}(k,z)$ in a smooth window $\widetilde{W}(R;k)$ \begin{align} \sigma^{2}(R,z) = \frac{1}{2\pi^{2}} \int_{0}^{\infty} dk\ k^{2} P_{\rm lin}(k,z) \left| \widetilde{W}(k;R)\right|^{2} \end{align} The halo count can be scaled via observations in a defined window region of $R = 8\ h^{-1}\rm Mpc$. We can solve for this analytical/numerically and measure it from CMB fluctuations, given by the parameter $\sigma_{8}$. The power spectrum, as well as the halo mass function, is then scaled through the normalization of the analytical variance and the observed variance. My question is then, why do we choose a smoothing radius of $R = 8\ h^{-1}\rm Mpc$? Is it arbitrarily chosen to compute the number variance in a cluster, or is their more too that? What prevents me from defining the window radius of $R = 6\ h^{-1}\rm Mpc$ (just ignore the fact that the WMAP and PLANCK results give $\sigma_{8}$ in the radius of $8$)? The specific radius of $8 h^{−1} \text{Mpc}$ is used because the value of $\sigma_8$ turned out to be close to unity. To quote e.g. from Amendola & Tsujikawa (2010), p. 39:
{ "domain": "astronomy.stackexchange", "id": 3565, "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": "cosmology, cosmic-microwave-background", "url": null }
Find the intervals in which the function f given by f (x) = x^2 – 4x + 6 is (a) strictly increasing (b) strictly decreasing Class 12 Chapter 6 Example 10 Solution: We have f (x) = x^2 – 4x + 6 or f ′(x) = 2x – 4 Therefore, f ′(x) = 0 gives x = 2. Now the point x = 2 divides the real line into two disjoint intervals namely, (– ∞, 2) and (2, ∞) (Fig 6.3). In the interval (– ∞, 2), f ′(x) = 2x – 4 < 0. Therefore, f is strictly decreasing in this interval. Also, in the interval (2,∞) , f ′(x) > 0 and so the function f is strictly increasing in this interval. "Note:" that the given function is continuous at 2 which is the point joining the two intervals. So, by Theorem 1, we conclude that the given function is decreasing in (– ∞, 2] and increasing in [2, ∞). Q 3135245162 Find the intervals in which the function f given by f (x) = 4x^3 – 6x^2 – 72x + 30 is (a) strictly increasing (b) strictly decreasing. Class 12 Chapter 6 Example 11 Solution: We have f (x) = 4x^3 – 6x^2 – 72x + 30 or f ′(x) = 12x^2 – 12x – 72 = 12(x^2 – x – 6)
{ "domain": "exxamm.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9787126506901791, "lm_q1q2_score": 0.8001704892575511, "lm_q2_score": 0.8175744828610095, "openwebmath_perplexity": 1707.8605712677172, "openwebmath_score": 0.8432305455207825, "tags": null, "url": "http://exxamm.com/blog/Blog/13864/zxcfghfgvbnm4?Class%2012" }
c#, winforms, mvp, pdf I really dislike this method. internal static List<string> PrepareFiles(List<string> fileNames) { for (int i = 0; i < fileNames.Count; i++) { fileNames[i] = CopyFileToProcessing(fileNames[i]); } return fileNames; } First and foremost, you're modifying the List that you passed in. That's a terribly surprising side effect. You could be creating yourself a nasty bug due to unexpected global state. Minimally, it will be harder to maintain due to that global state. Much better to build a new list. And if you're going to build a new list, you might as well use a foreach. internal static List<string> PrepareFiles(List<string> fileNames) { List<string> result; foreach (var fileName in fileNames) { result.Add( CopyFileToProcessing(fileName)); } return result; } Which could easily be rewritten as some Linq. internal static List<string> PrepareFiles(List<string> fileNames) { return fileNames.Select(CopyFileToProcessing).ToList(); } Although, I would probably return an IEnumerable<string> instead and omit the ToList() call so that it could be evaluated lazily.
{ "domain": "codereview.stackexchange", "id": 20357, "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#, winforms, mvp, pdf", "url": null }
quantum-mechanics, mass, charge, heisenberg-uncertainty-principle Title: Do uncertainty relations for charge or mass exist? Is there a uncertainty relation for charge $q$ of the form $\Delta q \Delta? \geq \hbar$ in quantum mechanics? From checking the units ($[q] = A\cdot s$) I guess that $?$ would have to be the magnetic flux $[\Phi] = V \cdot s$, so we would have $$ \Delta q \Delta \Phi \geq \hbar $$ If I play the same game with mass $m$ the units would suggest a uncertainty relation $$ \Delta m \Delta \Phi_g \geq \hbar $$ where $[\Phi_g] = \frac{m^2}{s}$ is the gravitomagnetic flux (which happens to have the same units as the kinematic viscosity, the specific angular momentum, the mass diffusivity and the thermal diffusivity). Do these two uncertainty relations exist in quantum mechanics? Regarding electrical charge the answer is definitely negative: In Quantum Mechanics there exists a so-called superselection rule of the charge which requires that the charge is always definite in every quantum state of any quantum physical system carrying electrical charge. So $\Delta q_\psi =0$ in every state $\psi$ and no Heisenberg relations are possible for whatever choice of a conjugated variable of $q$. Regarding mass, in non relativistic QM the situation is identical: There is an analogous superselection rule (Bargmann's superselection rule). In the quantum relativistic realm, for elementary systems the mass observable is actually a Casimir operator and thus, again it is always defined. For composed systems or non-elementary relativistic systems, the situation is more delicate, but I think the only possibility to define some notion of mass is just the Hamiltonian observable defined with respect to a preferred reference frame at rest with the system. This way one immediately faces the problem of time-energy uncertainty relations which do not have a well-defined status in QM, since there is no self-adjoint operator representing the time observable (this is the so called Pauli's theorem).
{ "domain": "physics.stackexchange", "id": 33030, "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, mass, charge, heisenberg-uncertainty-principle", "url": null }
gazebo, turtlebot, ros-hydro Title: gazebo 2.2.2 with ros hydro from source and TurtleBot I installed ROS-Hydro-Desktop-Full from source in April this year on Ubuntu 13.10 (Saucy Salamander). During the install, the script installed Gazebo 2.2.2 using APT-GET. The script also installed gazebo_ros_pkgs 2.3.5. Up until now, everything's been working great, including some simple Gazebo stuff I started playing with. But now I would like to get Gazebo running with ROS, and I understand that Hydro is intended to work with Gazebo 1.9, but I have 2.2.2, and I'm not sure what to do? I decided I would try working through the turtlebot/Tutorials/hydro/Installation page, but in step 4.3 "rosdep install --from-paths src -i -y" fails with the following errors: ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: yocs_virtual_sensor: No definition of [rospy_message_converter] for OS version [saucy] turtlebot_teleop: No definition of [joy] for OS version [saucy] kobuki_random_walker: No definition of [ecl_threads] for OS version [saucy] kobuki_node: No definition of [ecl_threads] for OS version [saucy] kobuki_safety_controller: No definition of [ecl_threads] for OS version [saucy] turtlebot_core_apps: No definition of [map_store] for OS version [saucy] kobuki_auto_docking: No definition of [ecl_linear_algebra] for OS version [saucy] kobuki_dock_drive: No definition of [ecl_linear_algebra] for OS version [saucy] kobuki_keyop: No definition of [ecl_time] for OS version [saucy] turtlebot_gazebo: No definition of [depthimage_to_laserscan] for OS version [saucy]
{ "domain": "robotics.stackexchange", "id": 19766, "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, turtlebot, ros-hydro", "url": null }
energy-conservation, space, renewable-energy, power Title: Would a thinner atmosphere (such as high altitude) yield better solar panel energy generation? I am curious. If you were to put a solar panel up in high altitude or on the surface of the moon, both of which have much less atmosphere to reflect/refract light, would that solar panel produce more energy? I am curious because an article comments discussion got me thinking about setting up a low Earth orbit solar collection platform as a power plant for a city or nation. Then I got thinking about how to bring it down to the surface (the energy that is). Which had me thinking about using really long cables stretched from the satellite to a high-altitude dirigible platform that would then allow it to more easily bring the energy to our planets surface. From there I started wondering if the high altitude dirigible platform would instead be up high enough to garner any added energy collection benefits. It would certainly help with space saving on the ground and could be rather quickly moved into a disaster area for emergency power purposes. Being a dirigible it would also be relatively easy to keep it aloft. With it far above the clouds it should be able to avoid many weather issues as well (as far as I am aware). So does anyone know if there would be any added benefits from solar collection in a thinner atmosphere environment from a power generation perspective? What pitfalls can you think of? The biggest one I can think of is the efficient transport of the energy. I would guess there is not much gain compared to solar power generation at the sea level in fair weather, when about 10-15% of solar energy is absorbed in the atmosphere (http://enso.larc.nasa.gov/arm/pub/journals/Valero.etal.JGR00.pdf ), but there can be significant gain compared to generation at sea level in cloudy weather. My bet would be against any exotic platforms that you describe - power delivery from the platform, even where feasible, would result in heavy losses and high costs, but I may be mistaken.
{ "domain": "physics.stackexchange", "id": 11848, "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": "energy-conservation, space, renewable-energy, power", "url": null }
In a general integer linear programming problem, we seek to minimize a linear cost function over all n-dimensional vectors x subject to a set of linear equality and inequality constraints as well as integrality restrictions on some or all of the variables in x. mincTxs.t.Ax=bx≥0x∈Zn 1. SCPSolver should enable a Java developer to use Linear Programming in 5 minutes. Let’s pretend you’re going on a hike and you’re planning which objects you can take with you. https://scip.zib.de/ | SCIP is currently one of the fastest non-commercial solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP). For instance, we might easily produce 1023 It contains full source, examples and manuals. A 1 will … thank you again for your work :), Click URL instructions: The problems most commonly solved by the Gurobi Parallel Mixed Integer Programming solver are of the form: The integrality constraints allow MIP models to capture the discrete nature of some decisions. Yes. Yes, they are legitimate - some of the time - but you have to be sure that you've done your research because typically online universities. OpenSolver 2.9.3 Beta Release version is now also available for download. For the solver-based approach, see Solve Sudoku Puzzles Via Integer Programming: Solver-Based. Its commercial quality Linear Programming solver combines with superior Integer Programming technology to set a new standard in optimization speed. Get project updates, sponsored content from our select partners, and more. The latest stable version, OpenSolver 2.9.0 (12 Jan 2018) is available for download; this adds the SolveEngine from Satalia as a solver. In elementary algebra, the quadratic formula is a formula that provides the solution(s) to a quadratic equation. You probably have seen Sudoku puzzles. Usually, you want to use the most powerful, This has motivated development of mixed integer conic solvers (BNB, CUTSDP), general global nonlinear nonconvex, If all of the variables $$x_i \in x$$ are restricted to take on binary values (0 or 1), then the problem is called a binary optimization problem, which is a special case of a pure, integer programming vs linear programming, CompTIA Network +
{ "domain": "iphoneart.com", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9828232909876816, "lm_q1q2_score": 0.8253101016617737, "lm_q2_score": 0.8397339676722393, "openwebmath_perplexity": 2385.1001196643306, "openwebmath_score": 0.1986657679080963, "tags": null, "url": "http://iphoneart.com/superman-iii-yikhxfk/integer-programming-solver-f08312" }
momentum, velocity Dividing one equation by the other gives us $u_A+v_A = v_B$ and using this equation to substitute for $v_B$ in the conservation of momentum equation gives us $m_Au_A = m_Av_A + m_B(u_A + v_A) \\ \Rightarrow v_A(m_A +m_B) = u_A(m_A-m_B)$ Rearranging this equation gives your textbook's Equation 1, and adding $u_A$ to both sides then gives your textbook's Equation 2.
{ "domain": "physics.stackexchange", "id": 90934, "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": "momentum, velocity", "url": null }
hash-tables, hashing It is important to see that no matter how clever the hash function is, there will always exist a data set (for example, the set $\{b,g,a\}$) whose elements hash to the same bucket (for example, bucket number $1$). Such a pathological data set will make your hash table degenerate to its worst-case linear-time performance.
{ "domain": "cs.stackexchange", "id": 7630, "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": "hash-tables, hashing", "url": null }
thermodynamics, temperature, thermal-radiation, equilibrium Note that although the emissivity does not affect the equilibrium temperature it does affect the speed that the object attains equilibrium. The higher the emissivity the faster the object will reach equilibrium. So while your two objects are warming up they will warm up at different rates and therefore will temporarily have different temperatures.
{ "domain": "physics.stackexchange", "id": 26745, "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": "thermodynamics, temperature, thermal-radiation, equilibrium", "url": null }
java, homework, sudoku /** * Write a method that traverses the 2D array, ords, and returns true if each and * every Ordinance requirement is met */ public boolean meetsOrdinances() { for(int i = 0; i < this.puzzle.length; i++) { /* Yet to be implemented */ } return false; //used to allow compile } /** * Write a method that returns true if the puzzle is a correctly solved Skyscraper puzzle */ public boolean isSolved() { /* Each row and column */ for(int i = 0; i < this.puzzle.length; i++) { if(!noDuplicates(this.puzzle[i]) || !noDuplicates(getColumn(i))) { return false; } if(!containsOneToN(this.puzzle[i]) || !containsOneToN(getColumn(i))) { return false; } if(!meetsOrdinances()) { return false; } } return true; } } Direction.java package Skyscraper; /** * Enumeration class Direction - write a description of the enum class here * * @author David White * @version (version number or date here) */ public enum Direction { NORTH, /* Above the 2D array */ SOUTH, /* Below the 2D array */ EAST, /* Right of the 2D array */ WEST /* Left of the 2D array */ } Ordinance.java package Skyscraper; /** * Write a description of class Ordinance here. * * @author David White * @version (a version number or a date) */ public class Ordinance { private int num; private Direction direction; public Ordinance(int num, Direction direction) { this.num = num; this.direction = direction; } public int getNum() { return this.num; } public Direction getDirection() { return this.direction; } } The PuzzleTest.java is used to make sure the methods I've written work in the way they're intended to. PuzzleTest.java package Skyscraper; /** * Write a description of class PuzzleTest here. * * @author David White * @version (a version number or a date) */ public class PuzzleTest {
{ "domain": "codereview.stackexchange", "id": 33705, "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, homework, sudoku", "url": null }
ros, planning-scene, arm-navigation gpik_req.ik_request.ik_seed_state.joint_state.position.resize(response.kinematic_solver_info.joint_names.size()); gpik_req.ik_request.ik_seed_state.joint_state.name = response.kinematic_solver_info.joint_names; for(unsigned int i=0; i< response.kinematic_solver_info.joint_names.size(); i++) { gpik_req.ik_request.ik_seed_state.joint_state.position[i] = (response.kinematic_solver_info.limits[i].min_position + response.kinematic_solver_info.limits[i].max_position)/2.0; } if(ik_with_collision_client.call(gpik_req, gpik_res)) { if(gpik_res.error_code.val == gpik_res.error_code.SUCCESS) { for(unsigned int i=0; i < gpik_res.solution.joint_state.name.size(); i ++) { ROS_INFO("Joint: %s %f",gpik_res.solution.joint_state.name[i].c_str(),gpik_res.solution.joint_state.position[i]); } } else { ROS_ERROR("Inverse kinematics failed"); } } else { ROS_ERROR("Inverse kinematics service call failed"); } ros::shutdown(); } Originally posted by egiljones with karma: 2031 on 2011-10-19 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 6958, "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, planning-scene, arm-navigation", "url": null }
Thus we need to find the sum of the first seven terms of the series. $$\sum _{ n=1 }^{ 7 }{ { (-1) }^{ n+1 }\left( \frac { n+2 }{ { n }^{ 5 } } \right) \approx 2.8914 }$$ Hence, $2.891$ is accurate to three decimal places. What I don't understand about this answer is if the estimate is $2.8914$ and the error bound is $0.000305$, I think the actual sum can be close to $2.8914+0.000305\approx 2.891705\approx 2.892$. Then the result above is not correct. Does this answer take into account the fact that the $(7+1)th$ term is negative? Or is there something about rounding and error bounds that I don't understand? Thank you.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.977022630759019, "lm_q1q2_score": 0.8523031334287373, "lm_q2_score": 0.8723473813156294, "openwebmath_perplexity": 223.32739009154525, "openwebmath_score": 0.8888874053955078, "tags": null, "url": "https://math.stackexchange.com/questions/1490376/find-sum-of-series-sum-n-1-infty-1-n1-left-frac-n2" }
java, object-oriented Title: Object to store attributes of a book I tested this code made by me in my past exam. The statement of the problem was: Write a program that allows the user to write the name of a book (string), the id (int), the price (float) and 'save' the information in a class of name Book. It turns out I made a mistake in this line:price=s.nextDouble(); it should be price=s.nextFloat();. My question is: Is it really bad my mistake like to mark my whole exercise as wrong just because one little mistake :)? import java.lang.*; import java.util.*; class Book{ private String name; private float price; private int id; Book(){} Book(String name,int id,float price){ this.name=name; this.id=id; this.price=price; } void setName(String nam){ name=nam; } void setId(int ide){ id=ide; } void setPrice(float pri){ price=pri; } } class one{ public static void main(String[] args){ Book x=new Book(); String name=null; int id=0; float price=0; Scanner s=new Scanner(System.in); System.out.println("Write the name of the book"); name=s.nextLine(); x.setName(name); System.out.println("Write the id"); id=s.nextInt(); x.setId(id); System.out.println("Write the price"); //price=s.nextDouble(); //^^^^^^^^^^^^^^^^^^---- my original solution price=s.nextFloat(); x.setPrice(price); }} Really, it is not easy to guess what exactly wrong for examiner. Here are my ideas for improvements.
{ "domain": "codereview.stackexchange", "id": 26986, "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, object-oriented", "url": null }
Clearly every row is part of the space of vectors $$(a_1,\ldots,a_6)$$ for which $$a_i$$ can be given by a polynomial expression in$$~i$$ of degree$${}<3$$ (i.e., with $$a_i=p+qi+ri^2$$ for some scalars $$p,q,r$$ and $$0). That subspace of $$\Bbb Q^6$$ being of dimension$$~3$$, any $$4$$ or more rows are linearly dependent, so the determinant of the matrix must be$$~0$$ (and the rank of the matrix at most$$~3$$). Let us give your matrix a name: $$A= \begin{pmatrix} 1&4&9&16&25&36\\4&9&16&25&36&49\\9&16&25&36&49&64\\16&25&36&49&64&81\\25&36&49&64&81&100\\36&49&64&81&100&121 \end{pmatrix}$$ The decomposition $$A = LU$$ (which you have found explicitly) is very helpful in this case. The upper right matrix ($$U$$) does not have full (row) rank, thus its determinant is $$0$$. Since the determinant is a multiplicative function, we get $$\det A = \det(L) \cdot \det(U) = \det(L) \cdot 0 = 0$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9773707973303964, "lm_q1q2_score": 0.8123349372489934, "lm_q2_score": 0.8311430415844384, "openwebmath_perplexity": 364.7386859285641, "openwebmath_score": 0.9485569000244141, "tags": null, "url": "https://math.stackexchange.com/questions/4358982/is-there-a-more-efficient-way-to-calculate-the-determinant-of-this-matrix/4359097" }
optimization, circuits, software-testing Title: Finding minimal and complete test sets for circuits I have been playing around with analysis of circuits and am trying to generate test vectors. In order to exercise the circuit in the manner I require, I need a vector that includes every change in the circuit's inputs where only 1 input toggles, but in order to be efficient, it must include each change only once and must not include any changes where more than one input toggles. Inputs can be only logic high (1) or low (0). If these sequences don't already have a name I would like to call them Majella tuples. I believe the length of these Majella tuples to be ((2^n) * n) + 1 where n is the width of the input in bits. for example (with all 0 starting patterns): n = 1: 0 1 0 n = 2: 00 10 11 01 11 10 00 01 00 n = 3: 000 100 110 010 110 111 011 001 101 001 011 111 101 111 110 100 101 100 000 010 011 010 000 001 000 I have written a bit of code to brute force generate these codes. However, it starts to struggle at n = 5 (actual code in a prev. revision of this question). FUNCTION gen IF height of stack == ((2^bit_width) * bit_width) PRINT ZERO_PATTERN RETURN TRUE IF the change between the value at the top of stack and value does occur between other values on the stack RETURN FALSE PUSH value to stack WHILE shift < bit_width IF RECURSE with value as (value XOR (1 << shift)) returns TRUE PRINT value RETURN TRUE shift = shift + 1 RETURN FALSE SET stack to an empty list SET bit_width to n CALL gen with value as 0
{ "domain": "cs.stackexchange", "id": 7195, "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": "optimization, circuits, software-testing", "url": null }
# Can an eigenvalue $\lambda_i=0$? I was doing some work with diagonalization of a matrix $A$ in order to find a matrix $P$ such that $\,P^{-1}AP\,$ was diagonal. In order to that I set $\;\lambda I_{n}=0\;$ and found the characteristic polynomial and its roots. When I factored my characteristic polynomial I obtained $\;\lambda^2(\lambda-2),\,$ so $\,\lambda=0,\,2$. I was taught that the eignenvalues$\,\lambda_{i}\,$ I found become the entries of the diagonal matrix $\,P^{-1}AP.\,$ If this is indeed true, then two of the diagonal entries would be $\,0.\,$ Is this allowed, or must a diagonal matrix strictly have non-zero diagonal entries? • Zero is allowed. You may be thinking of eigenvectors --- the zero vector can't be an eigenvector. But for eigenvalues, no problem. – Gerry Myerson Jun 21 '13 at 23:44 Absolutely yes: It is very possible $\lambda = 0$. Zero is allowed. You may be mixing up what you know about eigenvectors --- the zero vector cannot be an eigenvector. But for an eigenvalue $\lambda$, it is certainly possible and admissible that $\lambda = 0$. With respect to your last question: "($\lambda = 0$): Is this allowed, or does a diagonal matrix strictly have to have the diagonal entries as non-zero?" Yes, it is allowed for zero's to be on the diagonal. No, the diagonal entries need not be non-zero.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9752018362008348, "lm_q1q2_score": 0.8540690713101992, "lm_q2_score": 0.8757869803008765, "openwebmath_perplexity": 715.4836553235508, "openwebmath_score": 0.9197072386741638, "tags": null, "url": "https://math.stackexchange.com/questions/426579/can-an-eigenvalue-lambda-i-0" }
fourier-transform, fourier, fourier-series Title: E of a signal using Rayleigh I have to find The energy of a signal using Rayleigh th. the signal is $$ x(t) = A e^{-At } u(t) $$ assuming A>0 Using the classic definition of E , I found that it should be $$ \frac{A}{2} $$ Using Rayleigh I should do $$ \int_{-inf}^{inf} | \frac{A}{A+i2\pi f}|^2 df $$ This because I previously found X(f) From this I obtained $$\frac{A^2}{8 \pi^2 f} log (\sqrt (A^2 +4\pi^2f^2)) $$ with log from -infinite to infinite. $$ log \sqrt x = log \frac{x}{2} $$ but now I have no idea how to continue , and if this is correct.. thank you If I understand correctly, you want to verify the energy calculation in the frequency domain by computing the energy as $$E_x=\int_{-\infty}^{\infty}|X(f)|^2df\tag{1}$$ with $$X(f)=\mathcal{F}\big\{x(t)\big\}=\frac{A}{A+i2\pi f}\tag{2}$$ From $(2)$ we get $$|X(f)|^2=\frac{A^2}{A^2+(2\pi f)^2}=\frac{1}{1+\left(\frac{2\pi f}{A}\right)^2}\tag{3}$$ With $(3)$ and with the substitution $x=2\pi f/A$, the integral $(1)$ becomes
{ "domain": "dsp.stackexchange", "id": 8247, "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": "fourier-transform, fourier, fourier-series", "url": null }
machine-learning, training, neurons, java For the method, you can see this python tutorial and implement it in java. https://towardsdatascience.com/autoencoders-in-keras-c1f57b9a2fd7 For generating completely new image, you can try GAN(Generative Adverserial Network). This generates completely new images from a random noise image. The noise image is passed through a generator which is a CNN(convolutional neural network) and get a result image. The result image is then feed to a discriminator(CNN as well) to classify if that image is fake or real. The generator and discriminator compete and slowly gets better. For java implementation, see this: https://github.com/wmeddie/dl4j-gans Hope I can help you and have a nice day!
{ "domain": "ai.stackexchange", "id": 1459, "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, training, neurons, java", "url": null }
python, programming-challenge can be rewritten as: destination = [func(value) for value in source] The Python interpreter can (via the__length_hint__ from PEP424) tell that it will be allocating a new list of len(container) elements, and may pre-allocate that storage, and then start populating the elements of that list. (Note: CPython, IronPython, Anaconda, and other big snakes may implement things differently under the hood, possibly amortizing individual appends down to an \$O(1)\$ operation, and may or may not use __length_hint__, but the point still is using list comprehension will always be faster than allocating a list and repeatedly appending elements one at a time.) We can re-write your function as: def next_bigger(n): per = list(permutations(str(n))) result = [int("".join(j)) for j in per] for i in sorted(result): if i > n: return i Space complexity: \$O(d!)\$. Time complexity: \$O(d! \log {d!})\$. Removing the \$O(k \log k)\$ Sorting is an expensive operation. We don't want to do it if we don't have to. And we definitely don't have to here; we only want one value as a result. You are looking for the smallest value, from a list of values, that is larger than the input. We can filter out all values which aren't larger than the input: candidates = [value for value in result if value > n] And then return the minimum of all candidates: return min(candidates) No sorting. Space complexity: \$O(d!)\$. Time complexity: \$O({d!})\$. Removing the \$O(d!)\$ Space Complexity There is no reason to store any intermediate results. You could generate your list of permutations, and for each permutation, convert it back to a number, discard any value that isn't larger that the original, and remember the smallest value which passes. def next_bigger(n): per = permutations(str(n))
{ "domain": "codereview.stackexchange", "id": 39459, "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, programming-challenge", "url": null }
quantum-mechanics, quantum-field-theory, harmonic-oscillator, field-theory, second-quantization Please make sure that you can reproduce this equation by plugging in the Fourier transform formula in the Klein-Gordon equation of motion. This equation of motion is equivalent to an uncountably infinite set of harmonic oscillators labeled by a 3-vector ${\bf p} = (p_x, p_y, p_z)$, and the frequencies of these oscillators are given by $\omega_p$. This is because the equations above (for different ${\bf p}$) are precisely the oscillator equation. You can now recover the classical solution $\phi(t, {\bf x})$ for the Klein-Gordon field by substituting the solutions of oscillator equations in the Fourier transform integral. Note that different initial conditions for each of the oscillators become the field's initial condition. The same logic can be carried out for the two quantum theories: the Klein-Gordon QFT versus the quantum oscillator. In fact, this is how Klein-Gordon theory is usually quantized in all introductory QFT books. This is not essential to understand the correspondence outlined above, so I'm skipping it here.
{ "domain": "physics.stackexchange", "id": 47153, "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, harmonic-oscillator, field-theory, second-quantization", "url": null }
c#, x86, simd, .net-5 By the way, I chose the bias to minimize the difference with the original grayscale conversion. Normally I would use a bias of 0x80 to round evenly. The weights of the color channels are approximations of 65536 times their floating point weight, chosen so that they add up to 65536. MultiplyHigh implicitly divides by 65536, so effectively these scales work like their floating point counterparts. They don't have to add up to exactly 65536 by the way: thanks to the saturating additions (which are no extra cost compared to regular additions) nothing bad would happen if they added up to slightly more. You could use that property to tune them to more closely match the original conversion. Alternatively, it would be easy to adapt the scalar function to fixed-point arithmetic such that it gives the same results as this version of the SIMD grayscale converter. I tried using unaligned loads to replace the Avx2.AlignRight (aka vpalignr) instructions with, but the benchmark said that was marginally slower. It's possible to base a grayscale conversion on vpmaddubsw (Avx2.MultiplyAddAdjacent with vectors of byte and sbyte). For ARGB data that is very fast, though noticably less accurate. I have not worked that out for RGB data. Small things ExtractVector128-ing the low half of a vector If you write Avx2.ExtractVector128(gt0, 0), you get what you asked for, VEXTRACTI128 with an index of zero. However, that's not the best instruction to use, the best instruction to use is .. nothing. No instruction is necessary. What should happen is that the next operation only uses the 128bit version of the same vector register. The way to tell C# to do that is with Vector256.GetLower. This is a contrast with eg C++, where compilers normally do that substitution on their own. The performance difference from this, if any, was negligible. Saving an explicit extraction instruction can only help though. Unnecessary intptr.ToPointer()
{ "domain": "codereview.stackexchange", "id": 40331, "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#, x86, simd, .net-5", "url": null }
biochemistry, botany, plant-physiology, photosynthesis Title: Independence of Light independent reaction in photosynthesis? Inspired by a question asked to me by a classmate, I have the following question about Light-independent (dark phase) reactions in photosynthesis:- Let us suppose an algae sample was exposed to light for a considerable time so that maximum( if there is a limit) NADPH concentration was achieved. Now if the sample is placed in dark and radioactive ¹⁴CO₂ bubbled, will the cell be radiolabelled after some time of bubbling continuously?
{ "domain": "biology.stackexchange", "id": 1557, "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": "biochemistry, botany, plant-physiology, photosynthesis", "url": null }
electronic-configuration, atoms, ionization-energy Note that when comparing different atoms you also have to take into account that these have different nuclei with different charges so the comparison between atoms (in contrast to different shell within a single atom) can be a bit more complicated than this view alone and might require to crunch the actual numbers but I think conceptually this can help explaining the trends we are seeing throughout the PSE.
{ "domain": "chemistry.stackexchange", "id": 15841, "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": "electronic-configuration, atoms, ionization-energy", "url": null }
python, web-scraping, beautifulsoup links = [] # make folder to store photos and name using search term html_path = r"C:\Users\Dave\Desktop\2016Coding\AutomateBoring\11" + \ r"-WebScraping\flickrhtml.txt" path = \ r"C:\Users\Dave\Desktop\2016Coding\AutomateBoring\11-WebScraping" + \ r"\gimages\requests" folder_path = os.path.join(path, search_term) if os.path.exists(folder_path): shutil.rmtree(folder_path) os.makedirs(folder_path) print("Finding photos...") # get links to photos res = requests.get("https://www.flickr.com/search/?text=" + search_term) res.raise_for_status() soup = bs4.BeautifulSoup(res.text, "html.parser") found_elems = soup.select(".photo-list-photo-view") # incase number found images < requested number_save_images = min(number_images, len(found_elems)) print("Found {} images".format(number_save_images)) for found_elem in found_elems[:number_save_images]: link = find_link(found_elem) links.append(link) # write images to file print("Writing images to folder...") for image_link in links: basename = os.path.basename(image_link) save_file_name = os.path.join(folder_path, basename) res = requests.get(image_link) res.raise_for_status() with open(save_file_name, "wb") as f: for chunk in res.iter_content(100000): f.write(chunk) print("Images saved at: {}".format(folder_path)) print("*****Done*****")
{ "domain": "codereview.stackexchange", "id": 22908, "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, web-scraping, beautifulsoup", "url": null }
energy, rotational-dynamics, energy-conservation, harmonic-oscillator, rotational-kinematics The pure rolling means that bottom-most point of sphere or its point of contact with ground remains at rest with repect to ground. Two motions are going on simultaneosuly: Translational and rotational, which is summed up in the above image and leads us to: $$v_{cm}=\omega_{cm}r$$
{ "domain": "physics.stackexchange", "id": 91862, "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": "energy, rotational-dynamics, energy-conservation, harmonic-oscillator, rotational-kinematics", "url": null }
homework-and-exercises, electrostatics, electric-fields, potential-energy, dipole Title: Electric energy from dipole moment Conventionally one define electric energy as $$ U = \frac{1}{2} \int \vec{E}(r') \cdot \vec{E}(r') d^3 x' $$ where $\vec{E}$ is a Electric field. And from textbook like Griffith, we know that electric field generated by dipole is given as $$ \vec{E}_{dipole}(r) = \frac{1}{4\pi} \frac{1}{r^3}(3 (\vec{p} \cdot \hat{r}) \hat{r} - \vec{p} ) $$ I am trying to plug this and obtain explicit formula for electric energy $U$. I think the result should be on some textbook or papers but I couldn't find. Do you know the formula?
{ "domain": "physics.stackexchange", "id": 63375, "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, electrostatics, electric-fields, potential-energy, dipole", "url": null }
# Summing up the series $a_{3k}$ where $\log(1-x+x^2) = \sum a_k x^k$ If $\ln(1-x+x^2) = a_1x+a_2x^2 + \cdots \text{ then } a_3+a_6+a_9+a_{12} + \cdots =$ ? My approach is to write $1-x+x^2 = \frac{1+x^3}{1+x}$ then expanding the respective logarithms,I got a series (of coefficient) which is nothing but $\frac{2}{3}\ln 2$.But this approach took some time for me (I can't solved it during the test but after the test I solved it)... Any other quick method? - Lemma: Let $f(x) = \sum a_n x^n$ be a power series. Then $$\sum a_{3n} x^{3n} = \frac{f(x) + f(\omega x) + f(\omega^2 x)}{3}$$ where $\omega = e^{ \frac{2\pi i}{3} }$. Proof. Ignoring convergence it suffices to prove this for a single term, and then it boils down to the identity $$\frac{1 + \omega^n + \omega^{2n}}{3} = \begin{cases} 1 \text{ if } 3 | n \\\ 0 \text{ otherwise} \end{cases}.$$ This is a special case of the discrete Fourier transform. Applying the lemma, we readily obtain that the desired sum is $$\frac{\ln 1 + \ln (1 - \omega + \omega^2) + \ln (1 - \omega^2 + \omega)}{3} = \frac{1}{3} \ln (2 \omega^2 \cdot 2 \omega) = \frac{2}{3} \ln 2$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363499098283, "lm_q1q2_score": 0.8286395887822638, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 230.17908231900333, "openwebmath_score": 0.9679087400436401, "tags": null, "url": "http://math.stackexchange.com/questions/11739/summing-up-the-series-a-3k-where-log1-xx2-sum-a-k-xk" }
$$x^n - r^n = (x-r)(x^{n-1} + rx^{n-1} + \dots + r^{n-1})$$ and so $$f(x) = (x-r) (a_{n}(x^{n-1} + rx^{n-2} + \dots + r^{n-1}) + a_{n-1}(x^{n-2} + \dots +r^{n-1}) + \dots + a_1)$$ Once we know a root, we can also try using Polynomial Long Division to get the other factor. For cubics, the roots can be found without the need to guess. Check this out: Cardano's Method. Does that help? - en.wikipedia.org/wiki/Factor_theorem might also be useful. –  Hans Lundmark Sep 28 '10 at 20:12 @Hans: Right, I will edit that into the answer. Thanks. –  Aryabhata Sep 28 '10 at 20:13 Cardano is a bit of a sledgehammer here; the only other thing I'll note is that synthetic division may be more convenient than long division, depending on the user. –  J. M. Sep 28 '10 at 23:58 @J.M: Right, just wanted to mention Cardano though, not for this, but in general. –  Aryabhata Sep 29 '10 at 14:32
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9740426428022031, "lm_q1q2_score": 0.8219898159400629, "lm_q2_score": 0.8438951025545426, "openwebmath_perplexity": 495.8529818838554, "openwebmath_score": 0.9288300275802612, "tags": null, "url": "http://math.stackexchange.com/questions/5646/factoring-a-cubic-polynomial" }
molecular-biology, cell-biology, immunology I have not studied biology since last 8 years and now I am going through it because I need it for my research. So if someone can describe it in simple language it would be very helpful. First of all MHC stands for major histocompatibility complex. There are two types of MHC. MHC type one is present on all of our cells with a nucleus. The purpose of these protein complexes is called antigen presentation. T-cells cannot recognize free antigens on their own, it has to be presented to them in the proper way. This is what these proteins do. In every cell there are lots and lots of proteins, that get digested to small polypeptides (short aminoacid sequences) by proteases during the natural recycling process. The cell takes a small portion of these polypeptides and presents them on its surface through MHC I complexes, that the immune system can read. This is like the cell saying to the immune syytem that "hey I got these proteins in me". Now if the cell is infected (by a virus most likely) then the "attacker's" proteins get digested and presented as well and its like saying " hey I'm infected and the attacker has these proteins". MHC II serves similar function but it is only present on professional antigen presenting cells (APCs). These complexes present peptides derived from proteins consumed and digested through phagocytosis or receptor mediated endocytosis. It's like saying "hey we got a larger attacker and it has these proteins" So, long story short T-cells cannot recognise antigens on their own it needs to be presented to them on MHC complexes and then and only then can they be activated. Edit: A list of useful articles in the topic of antigen processing / presentation for further details: January 14, 1998 14:59 Annual Reviews AR052-12 Annu. Rev. Immunol. 1998. 16:323–58 MECHANISMS OF MHC CLASS I–RESTRICTED ANTIGEN PROCESSING Eric Pamer and Peter Cresswell Cell, Vol. 76, 287-299, January 28, 1994. MHC-Dependent Antigen Processing and Peptide Presentation: Providing Ligands for T Lymphocyte Activation Terry Y Nakagawa, Alexaiider Y Kudensky The role of lysosomal proteinases in MHC class Il-mediated antigen processing and presentation This one may require subscription.
{ "domain": "biology.stackexchange", "id": 3651, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "molecular-biology, cell-biology, immunology", "url": null }
quantum-algorithms, resource-request, clifford-group Title: Review paper on depth, qubits and $T$ gates number on Clifford+T decomposition for various "typical" algorithms My question I am looking for some review paper, or a list of different papers providing concrete numbers about the depth, number of qubits and number of $T$ gates required on the Clifford+T basis for usefull quantum algorithms (quantum Fourier transform, Grover, HHL, any other you can think of). I am not looking for asymptotic behaviors as I would like to have an idea of the concrete numbers for typical problem sizes. This question is "simple" but I haven't found any paper summarizing it nicely so far, and there are some papers providing only half of the numbers required (for instance the number of qubits but not the depth). I am in particular interested to find "powerfull algorithms" in the regime where: $Q_L N_L \leq 10^{11}$, where $Q_L$ and $D_L$ are the number of logical qubits, and the logical depth of the algorithm. Typically Shor algorithm applied for RSA 2048 is often given as an example of powerful quantum algorithm. But it requires quite a lot of resources, I am looking for usefull algorithms requiring less than Shor (more precisely in the regime I just provided). Further information As suggested in the comment, it may happen that for some algo, the answer will depend on some extra characteristics describing the problem. In such case, one specific example would be fine for me as long as it outperforms the best known classical algo dedicated to solve the same task. Again I just would like to have some rough idea of the number of $T$ gates, qubits and depth required for a quantum algorithm clearly outperforming the best known classical algorithm solving the same task.
{ "domain": "quantumcomputing.stackexchange", "id": 3428, "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-algorithms, resource-request, clifford-group", "url": null }
c#, networking if (n==0) break; fs.Write(buffer,0,n); BytesRead+=n; //TODO: Persist the bytesRead object somewhere, so that it can be taken back for resumes bytesToRead -= n; OnProgress(this,new System.EventArgs()); if (Status == DownloadStatusEnum.Paused) break; } Your summary complaint is that you're measuring short term xfer rate from system buffers to user space, rather than long term xfer rate from distant server to local network interface. After a few roundtrips, TCP opens the congestion window and can have many KiB of data in flight. I don't know what your buffer.length is, but you make it sound like it is short enough that you're not blocking on read. That is, ns.Read() finds quite a lot of data buffered at the OS level, and returns a buffer's worth of it at once, so that your timing represents local CPU / memory bandwidth rather than network bandwidth. The simplest remedy is to record initial starting time and don't touch it, report cumulative bytes read over cumulative elapsed time. If your residential ISP does traffic shaping, and you want the display to reflect the fact that the first 30 seconds goes at 3 Mbps but longer downloads go at 1 Mbps, then keep a circular buffer of the last dozen or so timestamps, and use that to report on recent progress. Old measurements will age out, so after a while they will no longer affect the display.
{ "domain": "codereview.stackexchange", "id": 3606, "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#, networking", "url": null }
# Pivot point of a beam and torque ## Homework Statement A beam is supported only at one point, called the pivot point, as shown in the diagram. A block with mass m1 sits at the left end of the beam, a distance L1 from the pivot point. A block with mass m2 sits at the right end of the beam, a distance L2 from the pivot point. L2 > L1. Calculate all torques about the pivot point, remembering that positive is anti-clockwise. Select Yes, No, Less than, Equal to, or Cannot tell. • Given particular values of L1, L2, and m1, is it always possible to choose m2 such that the masses have no angular acceleration? • If m1 * L2 = m2 * L1, is there a negative torque? • For m1 = m2, does the angular acceleration depend only on L1 / L2 ? (If it depends on the actual values of L1 and L2, put 'no'.) • If m1 * L1 = m2 * L2, will the masses have an angular acceleration? Torque = Force*L ## The Attempt at a Solution • For the first statement, since L2 is always greater than L1 by a certain ratio, if M2 is less than M1 by that same ratio, then there would be no torque, and thus no angular acceleration. However, I'm not certain my thought process is correct. • Since the two lengths are flipped, and no exact masses are given, there is no way to determine if this statement is true or false. • I'm really stuck on this one.... I put no, since the torque is calculated from the sum of the each individual torque, not the product nor the quotient. • If the two torques are the same, then the beam wouldn't move, and thus would have no angular acceleration. Please help me and thanks in advance. ehild Homework Helper ## Homework Statement A beam is supported only at one point, called the pivot point, as shown in the diagram. The diagram is not show, attach it, please! ehild here is the attached image that came with the problem.
{ "domain": "physicsforums.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9653811581728097, "lm_q1q2_score": 0.8166568898764233, "lm_q2_score": 0.8459424373085146, "openwebmath_perplexity": 695.9576538470984, "openwebmath_score": 0.819279134273529, "tags": null, "url": "https://www.physicsforums.com/threads/pivot-point-of-a-beam-and-torque.549639/" }
star-catalogues, fits 2512556873600",2512556873600,831324186,2016.0,45.07492471994457,33.54464,0.1108820420939314,24.830378,null,null,null,null,null,null,null,null,-0.1309745,null,null,null,null,null,null,null,null,null,47,0,47,0,35.859825,1964.6633,119.27316,184.45139,3,"False",null,null,null,null,null,null,null,null,7,6,120.0138,8,8,0,0.41287413,54.55582,0,0,null,0.4272169,0.21570276,0.5622911,0.8563249,-75.8122,-1.6494459,-50.740902,30.197552,"False",47,45.0438638293822,2.318626,19.426964,21.553278,5,296.537445766
{ "domain": "astronomy.stackexchange", "id": 6493, "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": "star-catalogues, fits", "url": null }
c++, interview-questions, mathematics, graph std::vector<dt> data((pairs), END(pairs)); Instead of putting all the code to process the nodes into main, I'd move most of it out to a process_node function object. I'd also note that this: for( v_it i = id.begin( ); i < id.end( ); i++ ) { if( *(i) == t ) { *(i) = *(start+q); } } ...is essentially the same as std::replace(id.begin(), id.end(), t, *(start+q));. Taking that into account, process_node comes out looking something like this: class process_node { graph &id; public: process_node(graph &id) : id(id) {} void operator()(dt const &pair) { int p = pair.first; int q = pair.second; int o = id[p]; int n = id[q]; if(o != n) std::replace(id.begin(), id.end(), o, n); display(p, q, id); } }; Since we now have a vector to iterate through, and a function object to process each item, we can switch from an explicit loop to a standard algorithm: std::for_each(data.begin(), data.end(), process_node(id)); [...and yes, for those find that unusual, this is a noteworthy day: I actually used std::for_each -- truly a rarity. ] That, however, brings up another point: there are still a few things about this code that don't excite me much. One, in particular, is that fact that it combines processing a node with displaying a row of results. We'd have to do a fair amount of extra work to avoid that, so I haven't bothered, but if we fixed that, std::for_each probably wouldn't be the right choice any more.
{ "domain": "codereview.stackexchange", "id": 598, "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++, interview-questions, mathematics, graph", "url": null }
> $\mathrm{diag}\left(B,1\right)$ $\left[\begin{array}{cccc}{0}& {4}& {0}& {0}\\ {0}& {0}& {5}& {0}\\ {0}& {0}& {0}& {6}\\ {0}& {0}& {0}& {0}\end{array}\right]$ (7) > $\mathrm{diag}\left(B,-1\right)$ $\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {4}& {0}& {0}& {0}\\ {0}& {5}& {0}& {0}\\ {0}& {0}& {6}& {0}\end{array}\right]$ (8)
{ "domain": "maplesoft.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429609670701, "lm_q1q2_score": 0.8318515334721394, "lm_q2_score": 0.8459424295406088, "openwebmath_perplexity": 895.8621380470324, "openwebmath_score": 0.9556233286857605, "tags": null, "url": "https://jp.maplesoft.com/support/help/Maple/view.aspx?path=MTM/diag" }
physical-chemistry, spectroscopy &= v_0 + J^2(B_1 - B_0) + J(3B_1 - B_0) + 2B_1 \end{align}$$ and the spacing between successive transitions is $$\begin{align} R(J + 1) - R(J) &= [(J+1)^2 - J^2](B_1 - B_0) + [(J+1) - J](3B_1 - B_0) \\ &= (2J + 1)(B_1 - B_0) + 3B_1 - B_0 \\ &= 2J(B_1 - B_0) + 4B_1 - 2B_0 \end{align}$$ Since $B_1 - B_0 < 0$, this separation decreases with increasing $J$ as observed. (Notice that if we let $B_1 = B_0 = B$ then we recover the "simple" behaviour where the spacing between lines is $2B$.) Naturally, exactly the opposite scenario is seen in the P-branch; I'll leave the maths to the reader. A very thorough book for spectroscopy is Hollas, Modern Spectroscopy (4th ed.), which explains all of this in detail.
{ "domain": "chemistry.stackexchange", "id": 16584, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "physical-chemistry, spectroscopy", "url": null }
to Modulo 11: Modulo is a high-end "boutique" language school. When properly ventilated, crawl spaces allow the elimination of rising damp and Radon Gas mitigation . int a = 5 % 4; // Sets 'a' to 1 int b = 125 % 100; // Sets 'b' to 25 float c = 285. Congruence Modulo n Calculator ≡ (mod )--- Enter a mod b statement mod )--- Enter a mod b statement an understanding of modulo arithmetic, people won’t appreciate the many things that come as a result of it, such as programs, calendars, time, and the many tricks and theorems found in Number Theory. isEqualTo(1); } MODULO is a disposable formwork for the construction of ventilated crawl spaces which physically separate the building from the ground. Orange Box Ceo 8,335,408 views About Modulo Calculator . Discover the Desjardins Modulo Visa credit card and get a low rate, BONUSDOLLAR rewards, mobile device insurance and more! Modular arithmetic studies the modulo operation and equivalence relation. For ex: a % b = c which means when a is divided by b it gives the remainder c, 7%2 = 1, 17%3 = 2. riempite il modulo in stampatello fill in the form in block letters. The modulo is the value of the remainder, so $123 \% 4 \equiv 3$. modulo (Preposition) Except for differences accounted for by. NET Framework op_Modulus operator, and the underlying rem IL instruction all perform a remainder operation. The modulo arithmetic lesson aims to teach students addition and multiplication modulo n. Modulo Programme Sign up to the Modulo Programme 2019-20! This is the way in which we count in modulo 12. Syntax As both the shift (>>) and AND (&) operations are extremely fast, the division/modulo operations can be tuned if the divider is a power of two and the code is accordingly (the current CPUs will not do this on the fly for you, you have to rewrite the code). ) If applied to arrays the result will be an array if this is sensible (for example it will not if the recycling rule has been invoked). Forexample,wemadeatable of
{ "domain": "growthpit.com", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9811668739644687, "lm_q1q2_score": 0.8154900281363526, "lm_q2_score": 0.8311430499496095, "openwebmath_perplexity": 1240.5699273404657, "openwebmath_score": 0.6144256591796875, "tags": null, "url": "http://growthpit.com/54qm4g8/what-is-modulo.html" }
p for which 10^p is a factor of m? (A) 7 (B) 8 (C) 9 (D) 10 (E) 11 1. Trailing zeros: Trailing zeros are a sequence of 0s in the decimal representation (or more generally, in any positional representation) of a number, after which no other digits follow. 125000 has 3 trailing zeros; The number of trailing zeros in the decimal representation of n!, the factorial of a non-negative integer n, can be determined with this formula: $$\frac{n}{5}+\frac{n}{5^2}+\frac{n}{5^3}+...+\frac{n}{5^k}$$, where k must be chosen such that 5^(k+1)>n It's more simple if you look at an example: How many zeros are in the end (after which no other digits follow) of 32!? $$\frac{32}{5}+\frac{32}{5^2}=6+1=7$$ (denominator must be less than 32, $$5^2=25$$ is less) So there are 7 zeros in the end of 32! The formula actually counts the number of factors 5 in n!, but since there are at least as many factors 2, this is equivalent to the number of factors 10, each of which gives one more trailing zero. Back to the original question: If m is the product of all integers from 1 to 40, inclusive, what is the greatest integer p for which 10^p is a factor of m? (A) 7 (B) 8 (C) 9 (D) 10 (E) 11 Given: $$m=40!$$. So we should find the # of trailing zeros in 40!, as it'll be the greatest value of p for which 40!/10^p will be an integer. 40! has $$\frac{40}{5}+\frac{40}{5^2}=8+1=9$$ trailing zeros, which means that 40! ends with 9 zeros so p=9 is the greatest integer for which 10^p (10^9) is a factor of
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9511422213778251, "lm_q1q2_score": 0.812192470937301, "lm_q2_score": 0.8539127510928476, "openwebmath_perplexity": 1201.6486192115208, "openwebmath_score": 0.7092899084091187, "tags": null, "url": "https://gmatclub.com/forum/if-m-is-the-product-of-all-integers-from-1-to-40-inclusive-108971.html" }
# Exercises for Chapter 1: Preliminaries Student-provided answers to the exercises found in Chapter 1: Preliminaries of Introduction to Real Analysis by Robert G. Bartle and Donald R. Sherbert, third edition (not to be handed in and thus not marked). The material covered in this chapter (along with the material covered in Appendix A) is assumed to be familiar to the student. It is recommended that you attempt these exercises on your own before viewing the proposed solutions below. The content on this page is solely intended to function as a study aid for students and should constitute fair dealing under Canadian copyright law. ## 1Section 1.1¶ ### 1.1Question 1¶ If $A$ and $B$ are sets, show that $A \subseteq B$ if and only if $A \cap B = A$. First, we show that if $A \subseteq B$, then $A \cap B = A$. Well, if $a \in A$, then $a \in B$ by virtue of the fact that $A$ is a subset of $B$. So every element in $A$ is also in $B$. Recall that the intersection of $A$ and $B$ contains all elements that are contained in both $A$ and $B$. An element $b \in B$ that is not an element of $A$ would also not be in their intersection. So the intersection $A \cap B$ would only contain elements in $A$, and so $A cap B \subseteq A$. Since every element in $A$ is also an element of $A \cap B$ (as $A \subseteq B$) then we also have that $A \subseteq A \cap B$ and so $A \cap B = A$.
{ "domain": "wikinotes.ca", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9780517462851323, "lm_q1q2_score": 0.8018981068056436, "lm_q2_score": 0.8198933337131076, "openwebmath_perplexity": 193.3838116767915, "openwebmath_score": 0.9994261264801025, "tags": null, "url": "http://wikinotes.ca/MATH_242/summary/fall-2012/exercises-for-chapter-1-preliminaries" }
fluid-dynamics, aerodynamics, shock-waves This is correct, in a sense. The effect of an adverse pressure gradient is to decelerate the flow near the body surface. This can be seen, for example, by examining the boundary layer equation in two dimensions. $$\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+v \frac{\partial u}{\partial y}=\nu\frac{\partial^2 u}{\partial y^2}-\frac{1}{\rho}\frac{\partial p}{\partial x}$$ If you consider steady flow and assume normal velocities to be small, then by inspection, we can see that an adverse pressure gradient causes $u$ to decrease in the streamwise ($x$) direction. As you suspected, separation requires that the flow near the boundary stagnates. Moreover, separation occurs when the flow actually reverses. $$ \frac{\partial u}{\partial y}_{y=0}=0; \quad \text{Flow Stagnation / Impending Reversal} $$ Additionally, it requires that the pressure gradient be simultaneously adverse, so that the the flow does not accelerate again. $$ \frac{\partial p}{\partial x}>0 \quad \text{Adverse Pressure Gradient}$$ So, in short, you're correct. However... This is a very different causal relationship from the first explanation, where the flow lacks a sufficient streamwise-normal pressure gradient to overcome the centrifugal forces of a curved streamline.
{ "domain": "physics.stackexchange", "id": 35828, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fluid-dynamics, aerodynamics, shock-waves", "url": null }
ros, ros2, ros-kinetic Title: Something like rosbag but it keeps a rolling buffer and saves a file only when you want to Is there any existing tool that will record a bag file but instead of continuing to record would instead discard any data past some set time threshold (so if the threshold is 1 hour, at any given point it has the data up to one hour before the current time). Ideally this would allow one to call a service to save this data into a proper bagfile which can be then used for deeper investigation. The usecase in mind is situations where some extraordinary event has happened to a robot (e.g. massive localization failure) and a bag file of data leading up to the event would be useful for fixing whatever bug may have caused the problem. I have thoughts about how something like this could be made but want to check if maybe something already exists. Originally posted by Jari on ROS Answers with karma: 112 on 2019-10-08 Post score: 2 For ROS 1, there is a pull request adding a rosbag snapshot command that sounds like it does what you'd like. Maybe it will take less time to pick it up than to start from scratch? https://github.com/ros/ros_comm/pull/1414 Originally posted by sloretz with karma: 3061 on 2019-10-08 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by Jari on 2019-10-08: Thank you! Comment by gvdhoorn on 2019-10-09: The snapshot command is good, but personally I've been eying something like strands-project/mongodb_store#245 (MongoDB with a "capped collection", which would essentially be a "rolling buffer"). Comment by jeremya on 2019-10-12: There is also the --split and --max-splits option for rosbag record. I usually set the split to 1m and the max splits to 2 or 3. This has the effect of saving the last 2-3 minutes of topics. Recording to a tmpfs partition removes the disk I/O performance hit. I also found record_ros to programmatically start and stop rosbag recordings. You can modify record_ros to provide more options such as split and max_splits.
{ "domain": "robotics.stackexchange", "id": 33864, "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, ros2, ros-kinetic", "url": null }
i. • Cubic spline interpolation is usually quite accurate and relatively cost effective. A curve is times differentiable at a point where duplicate knot values occur. Algorithms A tridiagonal linear system (possibly with several right-hand sides) is solved for the information needed to describe the coefficients of the various cubic polynomials that make up the interpolating spline. Cubic spline interpolation is a mathematical method commonly used to construct new points within the boundaries of a set of known points. , x and y can be arbitrary Note that it is just a guess (Note that all. (Note that the interpolant is produced by forcing a not-a-knot condition at the endpoints of the interval rather than forcing the second derivatives at the endpoints to be zero; in other words, it is not a natural spline interpolant). This lack of locality limits the usefulness of cubic spline interpolation in computer graphics. mgcv indeed is a good choice. Each function differs in how it computes the slopes of the interpolant, leading to different behaviors when the underlying data has flat areas or undulations. Section VI details the application for obtaining the best continuous approximation to a discrete contour, interpolating with cubic splines but first applying the FIR approximation and invariant to the translations of the least squares filter. SPLINE_BEZIER_VAL evaluates a cubic Bezier spline. -Means the result is still a cubic polynomial (verify!) • Cubic polynomials also compose a vector space -A 4D subspace of the full space of polynomials • The x and y coordinates of cubic Bézier curves belong to this subspace as functions of t. We introduce the -rational quadratic fractal interpolation functions (FIFs) through a suitable rational quadratic iterated function system (IFS). Flow chart of the direct computation of the CSI encoder for the 2-D image signal. Cubic Spline Interpolation Sky McKinley and Megan Levine Math 45: Linear Algebra Abstract. Spline Tutorial Notes 3 The Two Classes of Splines Interpolation splines are those which pass through their knots. Spline cubic with tridiagonal matrix. The next section discusses how the basis matrix is derived for Hermite curves. That is something I personally don't understand. A flexible strip is then bent across each of these weights, resulting in a pleasingly smooth curve. You can evaluate F at
{ "domain": "ddiy.pw", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.987946222968067, "lm_q1q2_score": 0.8337229869074494, "lm_q2_score": 0.8438951104066293, "openwebmath_perplexity": 977.2768941747456, "openwebmath_score": 0.4604955315589905, "tags": null, "url": "http://ecgv.ddiy.pw/cubic-spline-interpolation-matrix.html" }
print.rmean=TRUE ) factory-built one e.gh = Array.isArray ( e.gh ) Rupert G. Jr.! A clinically interpretable summary measure of the code ( e.tabw ) ; e.tabh = e.tabh===undefined load the mean survival time in r... Our baseline, or start of follow-up, time a clinically interpretable summary measure of the restricted mean survival in! Interest to generate estimates for those followed at least until landmark time, WANG EW time-to-event.! Of median survival time is uncensored, unless a restricted mean survival time, it a! Of my results, Reviewer 2 this, is, is Correct way typing! By default, this would lead to models underestimates the mean of survival restricted to the maximum survival,! For help mean survival time in r clarification, or responding to other answers Answer ” you! On how this works variable with which we quantify using the default package makes somewhat ugly,. Defines the survival package should n't be taken to mean the length of time survived an event.. Can ’ t know what happened after • Incompletely observed responses are censored • is always ≥.! Time-Dependent covariate were event-free at 10? to demonstrate methods today include let’s... Semi-Parametric model that can be formatted with broom::tidy ( ) the MASS package to illustrate these concepts of... Interest to generate estimates time distribution end point is random, values different! Risks data and competing risks baseline, or none at all are selected by the rmean.. How violations arise event of interest functions: this is a random representing! May. ; Christoph Scherber can I run 300 ft of cat6 cable, with male connectors each! This function issues a warning if the last censoring time is not random this mean survival time in r is occasionally of can! Covariate differs according to ulcer, the presence or absence of ulceration this assumes that the \ 1\... Lived up to time \ ( 1\ ) -year probability of survival restricted to the full function! To see what this mean survival time in r, let’s look at the definitions of 95 found in the survival time R... A global test of whether the effect of covariate the results of the mean survival time
{ "domain": "santafestereo.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9416541626630935, "lm_q1q2_score": 0.826279681641076, "lm_q2_score": 0.877476800298183, "openwebmath_perplexity": 2282.1390879140604, "openwebmath_score": 0.5358961820602417, "tags": null, "url": "http://www.santafestereo.com/anne-of-vffbrfd/d101b7-mean-survival-time-in-r" }
In summary, in all possible cases where $$\alpha = \tan^{-1} x$$ and $$\beta = \tan^{-1} y$$ we have $$-\frac12\pi < \alpha + \beta < \frac12\pi$$ if and only if $$xy < 1.$$ We can conclude that Equation $$(4)$$ is true if and only if $$xy < 1.$$ All of these cases are can be summarized as follows: $$\tan^{-1}x + \tan^{-1}y = \begin{cases} \tan^{-1}\left(\frac{x+y}{1-xy}\right) & xy < 1, \\ \pi + \tan^{-1}\left(\frac{x+y}{1-xy}\right) & xy > 1, x > 1, \\ -\pi + \tan^{-1}\left(\frac{x+y}{1-xy}\right) & xy > 1, x < 1, \\ \frac12\pi & xy = 1, x > 1, \\ -\frac12\pi & xy = 1, x < 1. \end{cases}$$ We need all these cases because $$\tan^{-1}x + \tan^{-1}y$$ takes every value in the interval $$(-\pi,\pi)$$ for some values of $$x$$ and $$y,$$ but $$\tan^{-1}\left(\frac{x+y}{1-xy}\right)$$ is only able to produce values in the interval $$\left(-\frac12\pi,\frac12\pi\right).$$
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9678992932829917, "lm_q1q2_score": 0.8107317744733921, "lm_q2_score": 0.8376199673867852, "openwebmath_perplexity": 105.84369404594536, "openwebmath_score": 0.9622615575790405, "tags": null, "url": "https://math.stackexchange.com/questions/1837410/inverse-trigonometric-function-identity-doubt-tan-1x-tan-1y-pi-tan?noredirect=1" }
ros, controller-manager, clion Title: ROS Debug Clion - Controller I have following problem. I am using clion and ROS (1). I use franka_ros to develop a controller. Hear I want to mention, that I followed all the steps provided by clion - documentation website, to set up ROS in clion. Everything works fine. I can debug simple executables. I could also attach to a simple running executable node. Now, I want to debug my written controller, based on franka_ros. I use a launch file and the "controller_manager"-package to launch the complete world. Everything works fine. But my problem is, that I cannot attach to the process and debug the controller. First thing I notice, that the executable of the controller spawner process is "python3" and available debuggers are "Python/Native". When I attach to the process with the debuggers I cannot stop at breakpoints or get any information of my controller at all. I think it might be a problem of having the "controller_manager"-package in between. Does anybody has some ideas or experiences with that ? Any hint or recommendation would be nice! Thanks! As a general resource you'll likely want to look at the documentation for IDE integration on the ROS wiki at: https://wiki.ros.org/IDEs#CLion What I think that you're running into however is that controllers are often run as injected components in a separate main loop and are loaded and unloaded dynamically. This means that if you want to debug them at runtime you need to attach your debugger to the main that the controller is going to run inside, and not the small launcher script which I speculate is what you're seeing as a python script, that's only sending a request to the controller manager. Without more details in the question I think that's about as complete an answer as can be provided.
{ "domain": "robotics.stackexchange", "id": 38898, "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, controller-manager, clion", "url": null }
turtlebot, create Originally posted by DGonz on ROS Answers with karma: 21 on 2012-09-22 Post score: 1 Original comments Comment by prasanna.kumar on 2012-09-22: And also can you please post the exact lines you added to your ~/.bashrc file to mention the IPs ? Comment by DGonz on 2012-09-23: Yes, the lines are : #source /etc/environment source /opt/ros/fuerte/setup.bash export ROS_MASTER_URI=http://myIP:11311 export ROS_HOSTNAME=myIP export ROS_MASTER_URI=http://myIP:11311 export ROS_HOSTNAME=myIP Comment by tfoote on 2012-09-24: Ca you see the ports in /dev using ls -l? Do you have permissions to access the port? Try plugging the Create cable to a different port on your laptop other than the one it is plugged into now. I had the same problem, I inserted it into another port and it worked for me. Sometimes problems come with the laptop ports as well. Originally posted by prasanna.kumar with karma: 1363 on 2012-09-22 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 11114, "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": "turtlebot, create", "url": null }
python, pandas, matplotlib, data-visualization Title: Create charts after querying database I'm at the end of the IBM Data Analyst course, and I wanted to ask for a rating of a piece of code I wrote as a solution to its exercises from the final chapter. I know I could write it on the forum of the course, but I will finish it very soon and have no access to the forum before anyone will answer. Exercises: Create a stacked chart of median WorkWeekHrs and CodeRevHrs for the age group 30 to 35. query = "SELECT WorkWeekHrs, CodeRevHrs FROM master WHERE Age BETWEEN 30 AND 35;" dejtafrejm = pd.read_sql_query(query, conn) newframe = pd.DataFrame() newframe['WorkWeekHrs'] = dejtafrejm[['WorkWeekHrs']].median() newframe['CodeRevHrs'] = dejtafrejm['CodeRevHrs'].median() ax = newframe.plot(kind='bar', color=['Blue', 'Yellow'], stacked=True, figsize=(5, 4)) for container in ax.containers: ax.bar_label(container, label_type='center') plt.xticks([]) Create a horizontal bar chart using column MainBranch. query = 'SELECT MainBranch FROM master' df = pd.read_sql_query(query, conn) df[['Total']] = 1 newdf = dief.groupby('MainBranch', axis=0).sum().transpose() ax = newdf.plot(kind='barh', figsize=(15, 6)) for container in ax.containers: ax.bar_label(container) You haven't indicated what kind of database you're connected to, but: the most important change here is for you to move your aggregation from Pandas into your SQL query. This applies to your median and group sum operations. This is needed for the queries to be scalable, otherwise you're carrying a potentially huge amount of data into application memory that you don't actually need.
{ "domain": "codereview.stackexchange", "id": 43677, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, pandas, matplotlib, data-visualization", "url": null }
general-relativity, stress-energy-momentum-tensor, geodesics Title: Some aspect of covariant derivative of point particle energy-momentum tensor My question is related to Derivation of the geodesic equation from the continuity equation for the energy momentum tensor I need to understand one step in derivation. Let's consider the Energy-momentum tensor of point particle: \begin{equation}\label{1} T^{\mu\nu}(x) = \frac{m}{\sqrt{-g(x)}}\int d\tau \frac{dX^{\mu}}{d\tau}\frac{dX^{\nu}}{d\tau}\delta^{(4)}(x - X(\tau)) \end{equation} We want to find a covariant derivative of $T^{\mu\nu}$. For arbitrary symmetric tensor, the covariant derivative is: \begin{equation}\label{2} \nabla_{\mu} T^{\mu\nu} = \frac{1}{\sqrt{-g}} \frac{\partial \left( \sqrt{-g} T^{\mu\nu}\right) }{\partial x^{\mu}} + \Gamma^{\nu}_{\mu\lambda}T^{\mu\lambda} \end{equation} And for our case, let's consider derivative $\frac{1}{\sqrt{-g(x)}} \frac{\partial \left( \sqrt{-g(x)} T^{\mu\nu}\right) }{\partial x^{\mu}}$: \begin{multline} \frac{1}{\sqrt{-g(x)}} \frac{\partial \left( \sqrt{-g(x)} T^{\mu\nu}\right) }{\partial x^{\mu}} = \\
{ "domain": "physics.stackexchange", "id": 58695, "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": "general-relativity, stress-energy-momentum-tensor, geodesics", "url": null }
performance, tree, scheme, sicp, compression How can I make this code better and faster? And are there better ways of doing this? Instead of using (= (length leaves) 1) to measure the list, consider just using (null? (cdr leaves)) instead, that way it's a constant operation. Otherwise, if you're not using destructive operations (to improve adjoin-set), this looks as good as it can get. Also make sure to have the correct indentation (if that wasn't caused by pasting), e.g.: (define (successive-merge leaves) (if (null? (cdr leaves)) (car leaves) (successive-merge (adjoin-set (make-code-tree (car leaves) (cadr leaves)) (cddr leaves))))) Also take a look at this post maybe, one of the posts regarding the same exercise.
{ "domain": "codereview.stackexchange", "id": 18152, "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": "performance, tree, scheme, sicp, compression", "url": null }
quantum-gate, textbook-and-exercises, nielsen-and-chuang, gate-synthesis, matrix-representation Title: How does a general rotation $R_\hat{n}(\theta)$ related to $U_3$ gate? From eqn. $(4.8)$ in Nielsen and Chuang, a general rotation by $\theta$ about the $\hat n$ axis is given by $$ R_\hat{n}(\theta)\equiv \exp(-i\theta\hat n\cdot\vec\sigma/2) = \cos(\theta/2)I-i\sin(\theta/2)(n_xX+n_yY+n_zZ). $$ From the qiskit textbook, a generic single-qubit gate is defined as $$ U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{i\lambda} \sin\left(\frac{\theta}{2}\right) \\ e^{i\phi} \sin\left(\frac{\theta}{2}\right) & e^{i(\lambda + \phi)} \cos\left(\frac{\theta}{2}\right) \end{pmatrix}. $$ I tried to work out the matrix representation of $R_\hat{n}(\theta)$ but it looks like the first entry of that should be $\cos(\theta/2)-i\sin(\theta/2)n_z$, which is different from that of $U(\theta,\phi,\lambda)$, i.e. $\cos(\theta/2)$.
{ "domain": "quantumcomputing.stackexchange", "id": 2483, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-gate, textbook-and-exercises, nielsen-and-chuang, gate-synthesis, matrix-representation", "url": null }
kinematics, acceleration, displacement Title: Displacement on a turn with constant speed with a pitfall A car is driving North-West on a highway. It has a speed of $20 $ m/s with the cruise control on. Ten seconds later, the car is heading North-East (still going $20 $ m/s). Determine the displacement of the car during the turn.
{ "domain": "physics.stackexchange", "id": 28790, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "kinematics, acceleration, displacement", "url": null }
javascript, html, css, simon-says Amend the gameplay Each round starts a brand new sequence. That's not necessarily an error, but the way the original worked was that it would add one to the sequence each time, so if the sequence for round 4 was "RGYB", the sequence for round 5 might be "RGYBG". Is the + operator needed here? There is this line in the code: var step = 2 * +i;
{ "domain": "codereview.stackexchange", "id": 18136, "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, html, css, simon-says", "url": null }
java, homework, random As you can see, I have no idea if my solution is right. It's such a low probability. What do you think about my solution? What should I do if this was an in-class test and had the same problem where the probability of getting the error is low? A few suggestions, and then I'll get to how to test it: Don't be afraid of whitespace -- your code is a little hard to read due to the lack of new lines. Also, it's fairly standard to indent method names inside of classes. Always use descriptive names: String[] a tells me nothing about what that parameter is. When x is a bool, x == true is equivalent to x. On an extremely picky note, contains seems like a more natural variable name for contain (grammatically anyway) It doesn't really matter when there's only 4 characters (so 4 * A.length runs), but when doing a linear comparison, you should typically bail out of it with break or continue Also, you might want to look into indexOf, contains and equalsIgnoreCase Obviously this is just a little homework assignment, so it would be a bit overkill, but I would put the license plate generation in its own class in a real application. I would also pass the banned words as a parameter to the constructor instead of to a method -- that allows your instance to carry around the words without any farther down consumers having to know what the words are Imagine that you make a machine that's used in the DMV. Imagine that this machine has a "generate license plate" button. When pressed, a screen simply shows the plate.
{ "domain": "codereview.stackexchange", "id": 2996, "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, homework, random", "url": null }
primes, f#, modules, mocks Title: Mocking an F# primality tester I would like to ask 2 questions about the modularization of an F# file. The code is just a working example of prime factorization, but that's not the main topic. I have a main file (PrimeFactors.fs), a different file for its mocked version (PrimeFactorsMock.fs), and a test file (PrimeFactorsTests.fs): PrimeFactors.fs namespace PrimeFactors module PrimeFactors = type IPrimeChecker = abstract member IsPrime : int64 -> int64 -> bool type PrimeFactors() = interface IPrimeChecker with member this.IsPrime number i = number % i = 0L member this.CheckPrimes number i acc = match i with | _ when i > (number |> float |> sqrt |> int64) -> number::acc | _ when (this :> IPrimeChecker).IsPrime number i -> this.CheckPrimes (number / i) i (i::acc) | _ -> this.CheckPrimes number (i + 1L) acc member this.Of number = if number = 1L then [||] else this.CheckPrimes number 2L [] |> List.toArray PrimeFactorsMock.fs namespace PrimeFactors open PrimeFactors module PrimeFactorsMock = type PrimeFactorsMock() = inherit PrimeFactors() let mutable stepCount = 0L interface IPrimeChecker with member this.IsPrime number i = stepCount <- stepCount + 1L number % i = 0L member this.StepCount number = stepCount <- 0L this.Of number |> ignore stepCount PrimeFactorsTests.fs namespace PrimeFactors open PrimeFactors open NUnit.Framework open FsUnit open PrimeFactorsMock [<TestFixture>] module PrimeFactorTests =
{ "domain": "codereview.stackexchange", "id": 29707, "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": "primes, f#, modules, mocks", "url": null }
everyday-life Title: Why is it that when a chalk board gets cleaned, the area that used to have chalk is the cleanest? Why is it that when you erase a chalk board, the area where the chalk used to be becomes the cleanest? By that I mean that when you erase a chalk drawing, the board gets smeared with chalk dust, but the area where the drawing used to be has less dust on it than the rest of the board. For example: In the first picture below I draw a simple chalk smiley face. Here the face is noticeable because it is the area with the most chalk. For the second picture, I erase it. You can still make out the picture, but notice that you recognize it because it is now the area with the least chalk. I would expect that if chalk was stuck to a certain region of a chalk board, then after erasing it, some chalk residue would remain, but instead it seems like the opposite happens. I don't have a good answer for this problem. Here's my opinion: If you notice, the same phenomenon happens with a marker and a whiteboard. So what I think the reason is, that due to adhesion forces among the chalk particles(or for that matter, between the particles/layers of the liquid ink), they tend to remain attached to each other and don't let go easily. So, when your duster removes the upper layers of the chalk particles, these particles exert an upward pulling force to the layer beneath them(The forces I've talked about a few lines above), because of which more chalk particles are removed from that area. I have an argument to support my answer: If you use a cheap and rough chalk, this phenomenon doesn't take place because there are not enough upward forces in the chalk particles due to the powdery and rough nature of the chalk.
{ "domain": "physics.stackexchange", "id": 64413, "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": "everyday-life", "url": null }
newtonian-mechanics, energy, work, inertial-frames, definition It makes sense to me that a force acting against an immovable object doesn't impart any change in kinetic energy- the fixed force of gravity can push the stones of Stonehenge into the ground for thousands of years, but if they don't move there's no energy changing hands. What makes no sense at all to me is that the change in kinetic energy is directly proportional to the distance the object moves. What if the object just coincidentally happens to be moving anyway? Say you have two objects; one is at rest, and the other is coasting through space at 1000km per second. You impart a tiny little 1 newton force on both objects for a second or so. The first object moves a meter so you've increased its kinetic energy by one joule. But just because the second object happens to be traveling at hypervelocity already, you've imparted the kinetic energy of a stick of dynamite? How do those definitions of work and kinetic energy make sense? Come to think of it, the Earth is moving around the Sun at 30 km/s so if I stand on one of the stones of Stonehenge around sunrise, is the weight of my body dumping 17 megawatts of energy into it? It seems that the definition of work contains some kind of caveat that the distance the object moves has to be related to the force somehow but that's completely unclear to me. Also, how does the object moving through space at a constant velocity even "know" that it's moving? There is no universal inertial frame of reference that everything moves relative to; who's to say that the fast-moving object isn't at rest and we are the ones moving at 1000 kilometers per second? You have noticed something very important about work, something that is almost never explicitly stated in introductory physics classes. Specifically: work is frame variant. Meaning that the amount of work done depends on the reference frame. So, the immediate reaction to this observation is usually something along the lines of “but if work depends on the reference frame then energy can only be conserved in certain reference frames”. The key to understanding is to remember that momentum is also conserved, and to work through the consequences of momentum conservation.
{ "domain": "physics.stackexchange", "id": 52297, "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, energy, work, inertial-frames, definition", "url": null }
telescope, space-telescope Space based telescopes still hold a significant edge in parts of the spectrum blocked by the atmosphere such as UV and IR (Webb), and for certain tasks involving long-term high accuracy photometry (Kepler) and astrometry (Gaia). But for general purpose use, the balance seems firmly on the ground's side for large telescopes. This will change if space flight becomes cheaper -- the SpaceX BFR, for example, with its 9 meter fairing and dramatically lower launch costs, offers great hope for space telescopes.
{ "domain": "astronomy.stackexchange", "id": 2970, "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": "telescope, space-telescope", "url": null }
quantum-mechanics, operators, momentum, commutator, lie-algebra \begin{aligned} \left( {x \cdot \frac{\hbar }{i}\frac{d}{{dx}}\left( \bullet \right) - \frac{\hbar }{i}\frac{d}{{dx}}\left( {x \cdot \bullet } \right)} \right)f\left( x \right) & = x \cdot \frac{\hbar }{i}\frac{d}{{dx}}f\left( x \right) - \frac{\hbar }{i}\frac{d}{{dx}}\left( {x \cdot f\left( x \right)} \right) \\ & = x \cdot \frac{\hbar }{i}\frac{d}{{dx}}f\left( x \right) - \frac{\hbar }{i}x\frac{d}{{dx}}f\left( x \right) - \frac{\hbar }{i}f\left( x \right) \\ & = i\hbar f\left( x \right) \\ \end{aligned} With other words, the muted product symbol between the operators are the $\circ$ composition symbol, just like when it comes to matrices, $$ABx = \left( {A \circ B} \right)x = A\left( {B\left( x \right)} \right).$$ What you missed is that in coordinate representation, there is a division with $i$ in the definition of $\hat p$ and $\frac{d}{{dx}}x$ means $$\frac{d}{{dx}}\left( {x \cdot \bullet } \right):f\left( x \right) \mapsto \frac{d}{{dx}}\left( {x \cdot f\left( x \right)} \right).$$
{ "domain": "physics.stackexchange", "id": 57358, "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, momentum, commutator, lie-algebra", "url": null }
No it's not a typo, it needs to be what I stated. If its not a typo, then you should have written $\displaystyle \max\{ \limsup a_n,\,\limsup b_n\}\geqslant \limsup a_n {\color{red}{\geqslant}} C-\varepsilon.$ In any case, there is a typo. 12. Originally Posted by bkarpuz If its not a typo, then you should have written $\displaystyle \max\{ \limsup a_n,\,\limsup b_n\}\geqslant \limsup a_n {\color{red}{\geqslant}} C-\varepsilon.$ In any case, there is a typo. 13. To bkarpuz, about your 1st post: I feel like you only prove $\displaystyle c_n\leq \max(a_n,b_n)$ in a complicated way, or maybe I missed something? Then you can deduce $\displaystyle \limsup_n c_n\leq \limsup_n \max(a_n,b_n)$. It is a true fact that $\displaystyle \limsup_n \max(a_n,b_n)=\max(\limsup_n a_n,\limsup_n b_n)$, but not a trivial one. Actually this is a particular case of the initial problem, and the answer Opalg gave to it gives also a proof of this fact (it proves the inequality "$\displaystyle \leq$", and "$\displaystyle \geq$" is almost trivial).
{ "domain": "mathhelpforum.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9626731105140616, "lm_q1q2_score": 0.8123951308827573, "lm_q2_score": 0.8438951104066293, "openwebmath_perplexity": 210.59323617765958, "openwebmath_score": 0.9663999676704407, "tags": null, "url": "http://mathhelpforum.com/differential-geometry/78160-limsup.html" }
gazebo-plugin { odom_.twist.twist.angular.z = rot_z_; } else { float last_yaw = last_odom_pose_.rot.GetYaw(); float current_yaw = pose.rot.GetYaw(); while (current_yaw < last_yaw - M_PI) current_yaw += 2 * M_PI; while (current_yaw > last_yaw + M_PI) current_yaw -= 2 * M_PI; float angular_diff_yaw = current_yaw - last_yaw; odom_.twist.twist.angular.z = angular_diff_yaw / step_time; } last_odom_pose_ = pose;
{ "domain": "robotics.stackexchange", "id": 3478, "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 }
frequency-spectrum Title: Do Spread Spectrum technologies combat time-selective fading of a channel? The Spread Spectrum technologies such as DSSS and FHSS are successful against frequency-selective fading because the original signal is spread to a larger bandwidth and different frequencies are used a different times. Do these technologies also mitigate the problems imposed by time-selective fading? I hadn't heard the term "time-selective fading" before, and after a bit of research it appears that it refers to the effects of doppler spreading. Given that, the answer is "not really". DSSS is typically extremely sensitive to carrier offset since the pseudo-random chipping sequence is usually quite long. The long time means that a little carrier offset can lead to destructive interference. This is dealt with by transmitting the data with a pilot. It is easy to search for the pilot across multiple carrier offsets by correlating using FFT techniques. FHSS does not really have any particular advantages or disadvantages that I am aware of when it comes to handling doppler.
{ "domain": "dsp.stackexchange", "id": 2013, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "frequency-spectrum", "url": null }
optimization, neural-network, nisq Title: Devising "structured initial guesses" for random parametrized quantum circuits to avoid getting stuck in a flat plateau The recent McClean et al. paper Barren plateaus in quantum neural network training landscapes shows that for a wide class of reasonable parameterized quantum circuits, the probability that the gradient along any reasonable direction is non-zero to some fixed precision is exponentially small as a function of the number of qubits. This seems to affect Noisy Intermediate-Scale Quantum (NISQ) programs (as proposed by e.g. John Preskill) since they involve hybrid quantum-classical algorithms, ie training a parameterized quantum circuit with a classical optimization loop. My question: How do you avoid getting stranded on those barren plateaus? Concretely, how would one go about building one's Ansatz Haar states to avoid getting stuck in those plateaus? The paper proposes but does not elaborate: One approach to avoid these landscapes in the quantum setting is to use structured initial guesses, such as those adopted in quantum simulation. I am not an expert but I read a few papers and here is what I have found. Similarly to NN, people found strategies to avoid this issue with the gradients. Basically, for some problems, you can use ansatzes that are inspired by the physics of the problem itself. For example, in quantum chemistry, people use something called unitary coupled clusters. See Quantum computational chemistry and The theory of variational hybrid quantum-classical algorithms. However, for many problems, you don't have physical insights. Then, the solution I found in the literature are the following:
{ "domain": "quantumcomputing.stackexchange", "id": 1422, "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": "optimization, neural-network, nisq", "url": null }
side of the cliff' angle = int ( raw_input ( "What is the angle to launch the projectile: " ) ) # check to see if valid angle. Before posting questions, please make sure that it makes sense. Thanks to everyone who posted comments/answers to my query yesterday (Implementing a Kalman filter for position, velocity, acceleration). Projectile Motion Simulation. Problem 1 (Projectile motion with air resistance) We have seen in lecture that when an object is dropped from rest in the presence of both gravity and air resistance, Newton's second law of motion takes the following form where y is the height of the object above the ground, g is the local acceleration due to gravity near the earth's surface, c is a constant, and m is the object's mass. 4 Getting started To run the examples and work on the exercises in this book, you have to:. Projectile motion basics pdf Physics 131: Tutorial 3 Projectile Motion. A simple Python wrapper that makes it easier to mount virtual machine disk images to a local machine. For permissions beyond the scope of this license, please contact us. The case of uniform gravity , disregarding drag and wind, yields a projectile motion trajectory which is a parabola. This path is the result of a constant downward acceleration due to gravity with no horizontal acceleration (neglecting air resistance). zProjectiles follow a curved path near the earth's surface because of gravity's effect on them. The nonparabolic curve includes air re-sistance. Since there is no acceleration in the horizontal direction KINEMATICS IN 2-D (AND 3-D). Description This is a simulation of a charged particle being shot into a magnetic field. This is a web app I wrote as an attempt to teach myself math. The number specifies the order in which the code got evaluated. Next, I have three examples including a demo. In this module we will investigate projectile motion, with and without air resistance. trajectory. However my problem is way simpler than that. This diagram is basic to what follows. Being able to transform a theory into an algorithm requires significant theoretical insight, detailed physical and mathematical understanding, and a working level of competency in programming. Problem 1 (Projectile motion with air resistance) We have seen in lecture that when an object is dropped from rest in the presence of both gravity and air resistance, Newton's second law of motion takes the following form where y is the height of
{ "domain": "popolariliberieforti.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9525741268224331, "lm_q1q2_score": 0.8019013346475256, "lm_q2_score": 0.8418256512199033, "openwebmath_perplexity": 949.0239320175493, "openwebmath_score": 0.34371331334114075, "tags": null, "url": "http://popolariliberieforti.it/projectile-motion-python.html" }
security, authentication, powershell [Parameter(Mandatory=$true)] [ValidateScript({$_ | Test-ValidFilePath})] [string] $FilePath ) That will catch problematic parameters early. [string] ensures that the parameter is a string (or is coerced to one). ValidateScript() allows you to use custom validation functions. You'd have to write Test-ValidCertificateSubject yourself. Test-ValidFilePath already exists. This will Fail in Some Conditions $Certificate = (Get-ChildItem Cert:\CurrentUser\My\ ` -DocumentEncryptionCert | Where-Object {$_.Subject -match $CertificateSubject} ) Export-Certificate -Cert $Certificate -FilePath $filePath $Certificate could contain an array of certificates. The call to Export-Certificate will fail if that is the case. How best to fix this is a design decision that requires some judgment. I find that arriving at a good solution is best achieved by setting up unit tests that include the problem case and trying a few different behaviors until you find the one that works best for your situation. I doubt, though, that the best behavior is the current form which produces this cryptic error (pun intended): Export-Certificate : Cannot convert 'System.Object[]' to the type 'Microsoft.CertificateServices.Commands.Certificate' required by parameter 'Cert'. Specified method is not supported.
{ "domain": "codereview.stackexchange", "id": 18238, "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": "security, authentication, powershell", "url": null }
units Title: apparent size of an astronomical body What's the name of the measure of apparent (visible) size of a body? e.g. the Sun and the Moon appear to be roughly the same size, despite the Sun being vastly bigger - because the Moon is much closer. What's this apparent size called? Angular size. That is, the vieving angle that the body spans on sky.
{ "domain": "astronomy.stackexchange", "id": 204, "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": "units", "url": null }
quantum-mechanics, condensed-matter, perturbation-theory, many-body Title: Higher-order perturbation in Kondo problem In chapter 6 of the book about condensed matter physics written by Gerald Mahan, the self-energy of the conduction electron is calculated to the third order in $J$ (the Kondo coupling) to show that the imaginary part of the self-energy diverges logarithmically as the energy scale (or temperature) decreases. What I am wondering is whether this 'the third order expansion in $J$' can be derived from the Anderson's impurity model. Kondo problem, modelled by a Hamiltonian $$ H_{K}= \sum_k \varepsilon_k {c^\dagger _k} {c_k}+J\boldsymbol{S}\cdot\boldsymbol{s}(0), $$ where $\boldsymbol{s}(0)$ is the spin-1/2 operator of the conduction electron at the origin and $\boldsymbol{S}$ is the spin of the localized electron $f$, is derivable from the Andersons's impurity model: $$ H_{A}=\sum_k \varepsilon_k {c^\dagger _k} {c_k}+ V\sum_k ({f^\dagger} c_k+{c^\dagger_k} f)+Un_{f,\uparrow} n_{f,\downarrow} $$ through Schrieffer-Wolff transformation. In this derivation, $J$ in $H_K$ is related to $V$ and $U$ in $H_A$ by $J \propto V^2/U$. However, in the transformation, higher-order corrections proportional to, for example, $V^{6}/U^3$ are neglected and only the first order correction (proportional to $J \propto V^2/U$) from the high energy excitaion is kept. Therefore, it seems to me that if $V^{6}/U^3$ correction in Schrieffer-Wolff transformation is kept, the result of the third order expansion (derived in the book by Mahan) will look different.
{ "domain": "physics.stackexchange", "id": 93316, "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, condensed-matter, perturbation-theory, many-body", "url": null }
c#, array, .net, generics, lambda public static T? Find<T>(T[,,,,,] array, Predicate<T> match) { if (array is null) { throw new ArgumentNullException(nameof(array)); } if (match is null) { throw new ArgumentNullException(nameof(match)); } for (long dim1 = 0; dim1 < array.GetLongLength(0); dim1++) { for (long dim2 = 0; dim2 < array.GetLongLength(1); dim2++) { for (long dim3 = 0; dim3 < array.GetLongLength(2); dim3++) { for (long dim4 = 0; dim4 < array.GetLongLength(3); dim4++) { for (long dim5 = 0; dim5 < array.GetLongLength(4); dim5++) { for(long dim6 = 0; dim6 < array.GetLongLength(5); dim6++) { if (match(array[dim1, dim2, dim3, dim4, dim5, dim6])) { return array[dim1, dim2, dim3, dim4, dim5, dim6]; } } } } } } } return default; } } Test cases The test cases listed here include two dimensional case, three dimensional case and four dimensional case. Console.WriteLine("Two dimensional find method test:"); Point[,] Points2D = { { new Point(100, 200), new Point(300, 400) }, { new Point(100, 400), new Point(200, 400) } }; var first2D = Infrastructures.Find(Points2D, x => x.X == 100); // Display the first structure found. Console.WriteLine("Found: X = {0}, Y = {1}", first2D.X, first2D.Y);
{ "domain": "codereview.stackexchange", "id": 45497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, array, .net, generics, lambda", "url": null }
ros, exploration Title: How can i get infomation of the subscription of a node I have to write code to get the simulation of a robot that explores certains worlds with the stage simulator. The point is that i want to get information of the laser scanner and i don't know how to do it... I have the subscription... // Create a subscriber object ros::Subscriber sub = nh.subscribe("/base_scan", 1000, processScanCallback); where processScanCallback is: void processScanCallback(const sensor_msgs::LaserScan::ConstPtr& msg) { int n_ranges = msg->ranges.size(); double nearest = *(std::min_element(msg->ranges.begin(),msg->ranges.end())); ROS_INFO_STREAM("I've a total of " << n_ranges << " measurements to process! Are you ready? Nearest=" nearest ); } and i call ros::SpinOnce(); inside a while-loop (where the robot is constantly doing measures and moving randomly), but those measurements are inside the function processScanCallback in the varible nearest. So, i have messages in the rosout node every time that the robot do a measure, but i can't do something with that value because is not returned... How can i receive the value nearest from the processScanCallback function? Originally posted by egr on ROS Answers with karma: 16 on 2016-02-05 Post score: 0 Original comments Comment by F.Brosseau on 2016-02-08: Is it possible to change the processScanCallback signature ? (void processScanCallback(const sensor_msgs::LaserScan::ConstPtr& msg, double& nearest) and you declare the variable "nearest" in your main) Comment by egr on 2016-02-12: No, the only thing that i can do is declare nearest as a global variable.. I declare nearest as a global variable and after that i can use this variable in the main function.
{ "domain": "robotics.stackexchange", "id": 23657, "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, exploration", "url": null }
general-relativity, metric-tensor, computational-physics, simulations Call the spatial coordinates $(x^1,x^2,x^3) = (r, \theta, \phi)$. As our coordinate gauge conditions choose $\alpha = f(r)^{1/2}$ and $\beta^i=0$ (the $\beta^i$ are "shift vectors", which I left out earlier for simplicity). For spatial boundary conditions, $h_{ij}$ is periodic in $\theta$ and $\phi$ in the usual spherical way, and $h_{ij}$ is equal to the initial value at $r = 2M$ and $r \to \infty$. The initial data is $h_{ij} = \textrm{diag}(f(r)^{-1},r^2,r^2 \sin^2 \theta)$ and $K_{ij}=0$. The initial data already automatically obey all other constraints, since we initally got them by slicing a spacetime. From [1], the equations of motion with the above setup are $$ \partial_t h_{ij} = -2 \alpha K_{ij},$$ $$ \partial_t K_{ij} = \alpha [ R_{ij} - 2 K_{il} {K^{l}}_{j} + K K_{ij}] - D_i D_j \alpha, $$ where $K = {K^i}_i$, and $D_{i}$ and $R_{ij}$ are the spatial covariant derivative and intrinsic Ricci curvature on the slice. At the first timestep, the right hand side of both equations of motion are zero (it's a bit tedious and you need to calculate the Christoffel symbols for the spatial metric on the slice, but the two nonzero terms in the bottom equation eventually cancel out). Since nothing changes, at each subsequent timestep the right hand sides remain zero, and the metric and extrinsic curvature remain constant. We can do this for all $t$.
{ "domain": "physics.stackexchange", "id": 54705, "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": "general-relativity, metric-tensor, computational-physics, simulations", "url": null }
python, logging, meta-programming, color # https://stackoverflow.com/questions/60031216/how-to-change-the-key-color-when-printing-a-python-dictionary def dprint(d,key_format = "\033[1;32m",value_format = "\033[1;34m"): for key in d.keys() : print (f" {key_format}{key}: {value_format}{repr(d[key])[:500]}") locs = {key:value for key, value in locals_.items() if not key.startswith('__')} out = OrderedDict() def identity(x): return x for key, value in sorted(locs.items()): for func in [identity] + funcs: try: out[key+("_"+func.__name__ if func.__name__ != "identity" else "")] = func(value) except (TypeError, ValueError, AttributeError): pass print(("\n\033[1;33m" if color else "\n")+label) dprint(out, key_format = "\033[1;32m" if color else "", value_format = "\033[1;34m" if color else "") And here is an example usage: import numpy as np from scipy import stats
{ "domain": "codereview.stackexchange", "id": 44363, "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, logging, meta-programming, color", "url": null }
drag, navier-stokes Title: How does the mathematical definition of drag reduce to Stokes or form drag? I know that for the flow of flow of a Navier-Stokes fluid in a domain, once the velocity $\mathbf{v}$ and pressure p are known, the drag over a solid object with boundary $\partial R$ is given by taking the component along the flow of the integral $$ Drag = \int_{\partial R} (-p\hat{n} + \mu (\nabla \mathbf{v} + \nabla \mathbf{v}^T)\hat{n} ) da$$ However, I also read that for creeping or slow flow, $$Drag = -b\mathbf{v}$$ This can be derived for drag on a sphere from the general formula. Hwever, the form drag is $$Drag = 0.5 \; \rho\; A \; C_D ||\mathbf{v}||^2$$ Is it possible to show that the general mathematical equation for the drag reduces to the square of the velocity as stated above ? EDIT: Thanks for pointing out the missing factor of area. Corrected now. short version: No, there is no way to show that the general integral equation for the drag reduces directly to the square of the velocity because for different flow regimes, different velocity and pressure distributions exist. long version: The quadratic drag equation is actually given by: $$F_d=C_d\frac{1}{2}\rho||\mathbf{v}||^2A$$ where $A$ is usually the orthographic projected area (so a circle in case of a sphere, a square in case of a cube, etc.). This equation can be viewed as a dimensional analysis relating the drag force to the dynamic pressure ($0.5\rho||\mathbf{v}||^2$) and the area $A$ (since $p=\frac{F}{A}$) and to allow the relation to function in a wide range of flow regimes (from laminar to turbulent), a drag coefficient $C_d$ is introduced. Note: that the form may also be loosely derived from a momentum balance as suggested in the comments.
{ "domain": "physics.stackexchange", "id": 23764, "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": "drag, navier-stokes", "url": null }