-
Posts
7922 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Events
Everything posted by Sensei
-
Not quite. Any alpha decaying isotope is source of Helium-4. Alpha particle is Helium-4 nucleus. http://en.wikipedia.org/wiki/Alpha_particle
-
It's kinda like saying that you will know positions, momentum, energies and charges of the all particles in entire universe.. Influence of charged particle that's at short distance can be to some level of precision measured. If electrons are f.e. at one capacitor plate, and absence of them on another plate, we can calculate what is charge on them and what is voltage between them. But if we take electron that's f.e. billion light years from here, it's influence is billion (or billion^2) times less powerful (any inverse-square law equation doesn't have limits for 'r' parameter, either in Newton's equation, nor in Coulomb's law). Physicists ignore it as regular practice. It's influence is negligible, ultra small, but higher than 0.
-
Why is the speed of light constant towards all observers?
Sensei replied to PokePat321's topic in Physics
Indeed. But human made devices never fly with v>30,000 m/s (or so). That's 0.1% of c. Voyager-1 has v=17,000 m/s relative to Sun. -
Rajnish Kaushik, read about Gold Foil Experiment http://en.wikipedia.org/wiki/Geiger%E2%80%93Marsden_experiment
-
15+6 =21 21!=51090942171709440000 5! = 120 6! = 720 5!+6!=840 51090942171709440000/840=60822550204416000 No fraction, so it's natural number. ps. I see you wrote "5", instead of "15". Which was later reedited and fixed to "15".
-
If you will try dividing any number by 0 on computer in f.e. C/C++ language, you will get NaN result (Not A Number). http://en.wikipedia.org/wiki/NaN Some computer languages might even throw exception (halting of application, crashing of application). (.NET Framework C#/Embedded C++ is example of such language if I recall correctly) Therefor depending on context we can use f.e. if( value == 0 ) { // treating 0 as very very small. Division input by very small gives very big result (except 0/0). if( input > 0 ) { result = INFINITY; } else if( input < 0 ) { result = -INFINITY; } else if( input == 0 ) { result = 0; } } else { result = input / value; } Any dividing by variable might cause result to be NaN and serious problems in other parts of algorithms later (in the worst scenario lost of data, and crashing of application), if you don't catch it! You have to think about it writing ANY computer program which is dividing.
-
But you're doing slightly different algorithm than me in post #4. Any example value that is causing it? I scanned the all first 1,000,000 numbers using two different algorithms and found 78,498 primes. Exactly the number we should get.
-
It's the simplest possible code for range between 2 and 4 billions primes. You could degrade range to 2...65536 by replacing "unsigned long long" by "int". And degrading speed by removing sqrt() line. But I see no sense in this action. bool IsPrime1( int value ) { if( value < 2 ) return( false ); for( int i = 2; i < value; i++ ) { if( ( value % i ) == 0 ) { return( false ); } } return( true ); }
-
If we will be writing code for you, you won't learn anything.. The simplest prime search code (copy'n'pasted from mine own application): bool IsPrime1( unsigned long long value ) { if( value < 2 ) return( false ); unsigned long long max = (unsigned long long) sqrt( (double) value ); for( unsigned long long i = 2; i <= max; i++ ) { if( ( value % i ) == 0 ) { return( false ); } } return( true ); } It will work with primes smaller than 4,294,967,296
-
You are in one place dividing by variable. If it'll be 0, you will end up with error as well. You have to check whether it's equal 0.0 to prevent that. If sqrt() from negative is really needed you can try using following function instead: double negative_sqrt( double value ) { if( value >= 0 ) return( sqrt( value ) ); return( -sqrt( -value ) ); } It will make sure that you're not taking square from negative, and preserving sign of value. f.e. negative_sqrt( -100 ) will return -10 But it's not general purpose equivalent. It depends on context in which you might need sqrt(). -10 * -10 = +100 after all.
-
Physics Beyond the Standard Model?
Sensei replied to Alan McDougall's topic in Modern and Theoretical Physics
The more important is lack of GR at quantum level.. -
Take sqrt() only from positive numbers.. So use fabs()/abs() or equivalent code, to get rid of negatives... BTW, y[] is defined as float, so complex class sqrt() is never executed, only regular one.
-
sqrt() the most likely is returning NaN (Not A Number) for negative input. The same happens with regular hand calculators (E letter appears etc.) http://en.wikipedia.org/wiki/NaN It's mentioned on wiki page "There are three kinds of operations that can return NaN: [...] The square root of a negative number."
-
value ^ power is not working in C/C++ the way as in math. It's bitwise xor operator.. http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
-
It's better described on Electronvolt wiki page, than I can express it.. http://en.wikipedia.org/wiki/Electronvolt eV is simply alternative unit of energy, instead of Joules. eV/c^2 is alternative unit of mass.
-
I found in shop such accumulator http://sklep.avt.pl/akumulator-zelowy-6v-4-5ah.html "pojemność (25 stopni C) 20 godzinna: 4.50Ah 10 godzinna: 4.28Ah 5 godzinna: 3.78Ah 1 godzinna: 2.70Ah" It means that capacitance is variable, and depends on how fast or slow, you will be utilizing accumulator. If you will be utilizing it for 20 hours, you will have capacitance 4.5 Ah = 16200 C. And you need I=0.225 A to last it that long. The faster you will use accumulator, the smaller capacitance. There is also showed dependency of capacitance on temperature in page that I linked. There is also showed spontaneous discharge of accumulator in 3,6,9 months..
-
It won't affect functionality of your code, but better place prototype declaration outside of main() function (before it). In large sources, prototypes are usually put to separate files with .h extension (h = header). Then you can include them in multiple source files.
-
calculate_area() doesn't mean cal_area()... They have to have the same name for both. You should have functions declared ABOVE main() where they're used. Otherwise you have to make prototype. Prototype for your function would be line int cal_area(int); Get rid of this "int" where is cursor, it's causing error.
-
If that's all what you really have, the most visible error is lack of bracket. It should be int area(int m) { And error is obvious - you have uninitialized variable i Shouldn't you multiply by m? int calculate_area(int m) { return(m*m) } Better don't use the same name for variables and function name! Difference between uninitialized variable: int a; and initialized: int a = 0; or int a = b; Initialization means assigning some value to it. Uninitialized variable has random data so using it might result in crashing computer in the worst scenario.
-
Because molar mass was earlier. The idea came from Amedeo Avogadro in 1811 http://en.wikipedia.org/wiki/Avogadro_constant He didn't calculate Avogadro const, he just came up with idea. Scientists calculate it hundred years later. f.e. take 18 grams of water, and 58-59 grams of NaCl, then pass current through it, and you will produce equal volumes of Hydrogen and Chlorine gases on electrodes, and 40 grams of NaOH will remain in container. You don't even have to know what is Avogadro const. Doing electrolysis of various materials/metals, you can calculate how much they lost mass. Electrodes are dissolved in solution, joining with oxygen and/or hydrogen. Containers which are normally collecting hydrogen and oxygen, will have different volumes of gases than in pure water electrolysis. f.e. electrolysis of iron made electrodes gives no oxygen on positive electrode - it's entirely immediately reacting with iron, and it's visible as yellow-reddish water. Electrode is literally disappearing. 1 hour is enough for me to wipe it out entirely. And water is totally opaque, yellow-reddish not transparent. But hydrogen container will be filled by gas - so we can easily calculate how much of oxygen reacted with iron. After heating such solution, to get rid of entire water, there will remain small amount of powder. We can also calculate its mass.
-
In high energy physics electronvolt unit is simply useful and convenient. You can say "electron at 2 GeV" and everybody know what you had in mind. You can see example of usefulness of using eV in this thread http://www.scienceforums.net/topic/81036-nuclear-properties-of-isotopes/?p=788316 I don't want to hijack your threads. We would have to speak off-forum.
-
I showed you how to calculate stuff in #3 post..
-
P = I * U so in units you have 1 W = 1 A * 1 V but 1 W is also 1 J /s so E/t = I*U 1 J/1s = 1 A * 1 V which gives E = I*t*U 1 J = 1 A * 1s * 1 V (I am using 300 kWh of energy per month - so it's like saying: 300,000 W*h = 300,000 J/s*3600s = 1,080,000,000 J of energy) 1A*1s = 1 C so again 1 J = 1 C * 1 V But 1 C is quantized by e const 1.6*10^-19 C 1 C / e = 6.25*10^18 charges/electrons. so 1.6*10^-19 J = e*U (U=1 V) And this is exactly 1 eV energy unit http://en.wikipedia.org/wiki/Electronvolt If you divide 1.6*10^-19 J by Planck const 6.626*10^-34 J*s you will get the same if you would divide 1 eV / 4.135667*10^-15 eV*s 1.6*10^-19 J / 6.626*10^-34 J*s = 2.414*10^14 Hz 1 eV / 4.135667*10^-15 eV*s = 2.414*10^14 Hz You can go back and forth from eV to J, dividing by Planck const in one unit, and then multiplying by Planck const in other unit. f.e. Electron has 510999 eV energy 510999 / 4.135667*10^-15 = 1.23559*10^20 Hz (it's Compton frequency BTW) 1.23559*10^20 * 6.62607*10^-34 = 8.187*10^-14 J m=E/c^2 so m=8.187*10^-14 J / 299792458^2 = 9.11*10^-31 kg and we have our mass of particle in kilograms matching data..
-
Psi http://en.wikipedia.org/wiki/Psi_%28letter%29