When a ray box is placed on one side of a converging (convex) lens and a screen is placed on the other side, a real image of the object (slit at front of ray box) can be formed on the screen. The ray box is moved and the image located on the screen. The object distance (u) and image distance (v) are measured. The focal length (f) can then be calculated using the formula: 1/f = 1/u + 1/v.
Note 1: In this simulation a focal length (between 15 and 35 cm) is set initially and you need to calculate its value. Note 2: If the ray box is inside the focal point you do not get a real image. It is virtual and in front of the lens.
It is also possible to draw a graph, on graph paper, of 1/v (y-axis) against 1/u. The equation of the line can be compared to the standard form of linear equation, y = mx + c. In this case it is: 1/v = -1/u + 1/f. This cuts (intercepts) the y-axis (1/v axis) when x (1/u) is zero i.e. 1/v = 0 + 1/f. Similarly the line intercepts the 1/u axis when 1/v is zero, giving us 1/u = 1/f. From your graph get the average of the two intercepts, find the reciprocal to get the value of f.