I need help for plane physics

I have the basic 4 force properties for an aerocraft sorted (lift, gravity, thrust, drag), but I’m not sure how to perform turns and how to calculate lift properly.

Every frame, the plane’s LinearVelocity object, which is at the centre of the aerocraft, is accelerated to the forward / look vector by [(thrust - drag) / mass * deltaTime] and is accelerated along the Y axis by [(lift - gravity) / mass * deltaTime]. Once the fuel of the aerocraft runs dry, the acceleration from the thrust force goes down to 0.

I’ve used ChatGPT to calculate drag and lift, but I don’t know how accurate it would be.

Here are the list of functions I use for my current system:

Getting air density from altitude:
function air_density(altitude:number)
	local pressure = 101325 * (1 - 2.25577e-5 * altitude) ^ 5.25588
	local temperature = 288.15 - 0.0065 * altitude

	return pressure / (287.05 * temperature)
end
Getting lift force from lift co-effiecent, altitude, wing area and velocity:
function lift(lift_coE, altitude, wingArea, velocity)
	return (lift_coE * air_density(altitude) * wingArea * velocity ^ 2) * 0.5
end
Getting drag from drag co-effiecent, air density and velocity:
function drag(cD,rho, V)
	return 0.5 * 15 * rho * (V ^ 2)
end

However I haven’t found an effective method to get a lift and drag co-effiecents from angle of attack of the wings of the aerocraft, which means that the co-effiecents are fixed values, making a lot of the plane’s movements limited.

I’ve tried to use ChatGPT to get calculations for the co-effiecents, but I never got a straight-forward answer.

If anyone got a method for how to get them, and how to improve my existing system, please help!

I suggest you checking out the biplane made by @sleitnick, he uses the same forces you do in his model.

Using a formula for lift_coeffiecent from a video by Vazgriz on YouTube I have found a function to convert the angle of attack to a co-effiecent.

function co_lift(attack:number)
	local a, b = 1, 0
	if math.abs(attack) > 30 then
		a = .5; b = 45 * math.sign(attack)
	end
	return math.sin(math.rad(attack * 3 * a + b))
end

if attack is 0, lift_co is 0.
if attack is 30, lift_co is 1,
if attack is 90, lift_co is 0.

mirrored in the negative axis aswell