I was coding a gyroscope simulation and came up with some equations that I used for it. So firstly,
torque = (change in angular momentum)/(change in time) = (vertical moment of inertia)(vertical angular acceleration) + (gyroscopic angular momentum)(perpendicular angular velocity)
Where vertical MoI = MoI about axis of falling and vertical AngAccel = AngAccel about axis of falling (so like, ignoring its precession) and gyroscopic AM is the AM of the spinning part of the gyroscope and perpendicular AngVel is the AngVel perpendicular to the falling AngVel (so in the direction of the cross product of gyroscopic AM and torque) and then
(Gyroscopic angular momentum)(vertical angular velocity) = (vertical moment of inertia)(perpendicular angular acceleration)
And so my thinking is that since perpendicular AngVel starts out at zero, it leads to the gyroscope accelerating in the falling direction. Then, in order to counteract the change in gyroscopic angular momentum (since it's changing direction in the falling direction), the gyroscope starts accelerating perpendicularly to the direction its falling, which then causes the vertical angular acceleration to decrease and eventually become negative and it sort of goes on like that correcting itself.
The problem is that when I coded it it didn't seem to behave very realistically, and I'm unsure if that's because my thinking is wrong or if a theoretically ideal gyroscope would behave in the way my code did but most just aren't? (I also could've messed up my code cause it's a bit messy but I'm just wondering if someone can tell me if what I said above is right).
And to explain my coded one it sort of would just dip catch and go back up and slow down and repeat (basically make a bunch of wide U's in a circle the number, rate, and size of which depended on some variables) whereas real ones sort of just go straight around in a circle for the most part.
Anyways thanks if anyone can help explain this for me!