I did this, using Fortran 90 for the math and Tcl/Tk for the plotting.
There is no single equation; instead there are several cycles of calculation nested inside each other like a Russian matryoshka.
The innermost loop calculates all forces and moments at the point in time at which the calculation stands.
The next layer iteratively trims the airplane so control deflections fit the desired rotation rates.
The outer layer integrates the parameters, moves one timestep ahead and applies new boundary conditions.
For the initial climb there is another iteration to adjust acceleration and climb angle such that the airplane is at 1.3 v$_\text{min}$ when it climbs through 50 ft.
Initially, the airplane is on the ground and drag is smaller than thrust, so a forward acceleration remains. When the preselected rotation speed is reached, the elevator is trimmed for an also predetermined rotation rate and time steps are shortened to minimize the error in finding the liftoff time. The whole process is divided in three parts: Ground roll, rotation and initial climb.
For airplanes with a constant speed propeller I even added another loop inside the force calculation to find the proper propeller beta for the current engine torque and airspeed, but that made the code very slow (it ran initially on a Mac SE/30). For most cases I pre-calculated lookup tables and interpolated a lot.
We used this software to determine the tables in the flight manual of a jet trainer and checked correctness with a few points from flight test. It is easy to set a wind speed in software, it is much harder to precisely find out what the average wind speed was when the test ran. Since my software included all effects like trim drag, gear rolling resistance over speed and ground effect, the results were easily confirmed.
Calculating landing distances wasn't much different, only that the calculation started at 1.3 v$_\text{min}$ and 50 ft.
If you want good results, no single force is constant over speed. If you don't mind such niceties, you can average rsp. linearize the forces and use the integrals in this text.
For a very rough estimation, average thrust and drag and calculate how long the engine needs to add energy to the system until kinetic and potential energy have changed from standstill to 1.3 v$_\text{min}$ and 50 ft and back again. This should be sufficient already to find the effect of wind and air temperature on takeoff and landing performance.