When we define an isomorphism between a vector space and its dual, for instance with the metric tensor, or (as I've just learned) with the Killing form in the case of Lie algebras, are there any further constraints placed on which element of $V\otimes V\cong V^*\otimes V^*$ we use other than it be symmetric?
In other words, does every element of $V\otimes V$ induce an isomorphism between the vector space and its dual?
I am trying to create a copying program in C, and I want it to end after one input. My current code looks like this:
#include <stdio.h>
int main(void) { int c = getchar();
while(c != -1) { putchar(c); c = getchar(); }
return 0;
}
In the above code, I have used -1 instead of EOF (end of file).
(Both of which yield the same results, as I have confirmed it)
Now the problem is that the above code results in a program that never terminates and keeps on copying whatever (ASCII only) input you enter. How can I tell the program to end after just the first input?
I thought that return 0; might do the work, but it doesn't. Is there any reason why?
I don't understand that why Wikipedia inelastic collision take definition of bouncing ball. It could be wrong. Because in free fall acceleration due to gravity worked. So velocity kept changing continously
@Azmuth AFAIK, to use scanf, you need to specify the length of the data type of scanned input, which is char. Thus it limits the maximum length of your input. However, the more important reason for using getchar() is because I already know scanf(), but I am new to getchar().
1234
1234
...Program finished with exit code 0
Press ENTER to exit console.
@FakeMod the main function exits with 0 for me.
@FakeMod Can you be specific about the processor/OS/Compiler you are using? Datatypes change with change in system, so, I can guess if there is some short of problem here.
@FakeMod EOF stands for *End of File` is used to recognize the last byte of the file in POSIX or Windows System, not end of file or enter key (notice both are different), -1 is just another parameter that, it doesn't means EOF either. If you want to emulate enter key then use \n endline character.
@123 C is a lower level language than Py and JS, you can alter each processor instruction, this is pretty useful when coding low level stuff like Drivers, OS and some stuff like Reverse Engineering/
Yes, Windows, MSVC and MinGW Compilers offer that too, but you need to use pointers to copy whatever written in clipboard (of variable size) to a datatype
@FakeMod Honestly, I don't understand what are you doing? Do you have an example or some sample?
@FakeMod getchar blocks until the user enters something - unless the user manually types an EOF character into the terminal, this program will indeed never terminate. Why are you using a while-loop if you just want to do this once?
@ACuriousMind Not using while will just result in copying one character. I don't want that, I just want to copy one "input". FWIW, I did ask a question on SO.
@JohnRennie No, I wanted something different, but now I realize that there's no concrete way to define what I mean by "one input", thus the newline solution seems the most appropriate as of now :)
@FakeMod for future reference, we tend to take programming questions to a new room because they aren't physics. I'm always happy to answer programming questions in another room.
Quantum field theory is based around defining a vacuum state for a quantum field, then particles are created by adding energy to that vacuum state.
But the problem with curved spacetime is that the vacuum state ceases to be well defined. Different observers in a curved spacetime define the vacuum state differently.
Gravitons interact so weakly that it is impossible to detect them in a collider like the LHC.
In principle gravitons could be produced in collisions and carry away energy, and that could be detected. In fact this would be easily detected since they are the only spin 2 particle.
But in practice you could run the LHC for thousands of years without producing any gravitons.
Hmm! I some time feel that I am mixing gr with qm like I am talking about the deflection of single graviton even in future if we have theory which unify them what will be the most important thing it should have
Rotating molecules have an associated magnetic moment that can couple with both nuclear and electronic spin magnetic moments, thereby impacting the hyperfine energies of rotating molecules.
Can one compute such rotational magnetic moments from ab initio calculations?
@JohnRennie Yes The questions, which i always discussed in this forum.
Like i asked in the morning. Example of inelastic collision taken by wikipedia is bouncing ball. But bouncing is under gravity have changing K.E continuously. Is should be constant.
@123 The inelastic collision is at the moment when the ball is touching the ground where it has no potential energy. It doesn't matter for the collision what happens when the ball is up in the air.
@123 KE shouldn't be constant when something is going up or down and no energy is being added or taken away. The higher it is the less KE it has because it gains gravitational potential energy. The energy is only lost on the bounce (ignoring air resistance).
both "before collision" and "after collision" are states at the same height above the ground, namely 0
one is the instant where the ball is moving down hitting the ground, the other is the instant where the ball is moving up after hitting it (but has not yet moved)
I am asking about phenomenon fall under gravity is kept changing its KE. Work-done is in place. Means Work-Energy Theorem. KE means we don't allow speed change.
Sorry for the late reply. I mean, If something is falling under gravity means velocity is not kept constant it is changing continuously which is not allowed in inelastic collision, if velocity is changing $W = \frac{1}{2}m\vec{v_f}^2 - \frac{1}{2}m\vec{v_i}^2$
How it is possible take this situation for inelastic collision. If velocity changing how can possibly momentum conserved.
It is using just to give an idea what happened in elastic and inelastic collision
I am thinking about inelastic collision, Momentum (Before Collision) = Momentum (After Collision) and KE (Before Collision) = KE (After Collision) + Heat
For this we need to take an example when there is no acceleration.
@123 The situation leading up to the collision isn't the collision. Elastic and inelastic only describes what happens as an immediate result of the impact. The fact that the ball changes kinetic energy to potential and vice versa before and after the collision doesn't change the nature of the collision.
The change in height shows that kinetic energy is not conserved in the bounce, since the max height is where there is no KE and only PE, it gives a visual indicator of the kinetic energy after each bounce in height instead of velocity right after the bounce.
But, always thank you all for the support and sharing your experience.
@JMac So the take away what i come up. We only need to take immediate velocity just before and after collision for both elastic and inelastic not the velocity at which the ball released. And see the effect in terms height of the ball. Is that true?
I somewhat can wrap my head around virtual particles in terms of quantum field theory, (as much as possible), and I'm just curious how string theorists would describe them.
@123 Yeah, the height of the ball is a good indicator of the energy of the ball has immediately before and after each bounce, because neglecting air drag, the height varies based on the kinetic energy the ball had; since it converts all the kinetic energy to potential at the top of the arc. Collisions really only have to account for velocity right before and right after; though frictionless masses on a horizontal surface is usually an easier example than one that accelerates due to gravity
That's why i am not happy with the book. It always remain unanswered questions for each topic.
Also wikipedia have no words on this.
It means just before collision the at max velocity what is possible if just after collision velocity same it will be elastic collision and if it losses some of energy the velocity decreased (inelastic collision).
Does momentum conserved in this situation. also what about perfectly inelastic collision.