Which matrix to use to transform children local coordinates to global? Setup
I have an object Plane with 6 vertices. To each vertex I assign another object as child.
Then I apply two keyframes on location to object Plane:

In frame 0 it goes to Z = 5
In frame 81 it goes to Z = 0

I want to know correct global x,y,z coordinates of each Sphere during frames 0 to 81.


Problem
I do not understand which matrix or matrix combination to use to achieve coordinates in this case.
For example for frame 81 I know that Z = 0 for Plane. It is also Z = 0 for all spheres.
I would like to know object Sphere global coordinates. If I code in Blender console:
&gt;&gt;&gt; sp0.matrix_world.to_translation()
Vector((-1.0, -1.0, 0.0))

&gt;&gt;&gt; sp0.location
Vector((-1.0, -1.0, 5.0))

If I write python script and run it I have:
obj = bpy.data.objects['Sphere']
x,y,z = obj.matrix_world.to_translation()
print(&quot;x,y,z &quot;, [x,y,z])
print(&quot;setpoint_location &quot;, obj.location)

&gt;&gt;&gt;x,y,z  [-1.0, -1.0, 5.0]
&gt;&gt;&gt;setpoint_location  &lt;Vector (-1.0000, -1.0000, 5.0000)&gt;

Additional info
Code I use to create Spheres and attach it to Plane as child objects on each vertex.
import bpy

def create_objects():
    for i in range(6):
        bpy.ops.mesh.primitive_uv_sphere_add(radius=0.25, enter_editmode=False,location=(i*2., 0, 0))
def allocate_objs(plane, objects):
    bpy.ops.object.select_all(action='DESELECT')
    for i, vert in enumerate(plane.data.vertices):
        world_matrix = plane.matrix_world
        vertice_coords = world_matrix @ vert.co
        objects[i].location = vertice_coords
        objects[i].select_set(True)

    plane.select_set(True)
    bpy.context.view_layer.objects.active = plane
    bpy.ops.object.parent_set(type='VERTEX')

#create_objects()
objects = [obj for obj in bpy.data.objects if &quot;Plane&quot; not in obj.name]
plane = bpy.data.objects[&quot;Plane&quot;]
#allocate_objs(plane, objects)
obj = bpy.data.objects['Sphere']

for frame in range(0,100):
    bpy.context.scene.frame_current = frame
    if frame in [0, 81]:
        x,y,z = obj.matrix_world.to_translation()
        print(bpy.context.scene.frame_current)
        print(&quot;world matrix \n&quot;, obj.matrix_world)
        print(&quot;matrix_basis \n&quot;, obj.matrix_basis)
        print(&quot;matrix_local \n&quot;, obj.matrix_local)
        print(&quot;matrix_parent_inverse \n&quot;, obj.matrix_parent_inverse)
        print(&quot;frame &quot;, frame)
        print(&quot;x,y,z &quot;, [x,y,z])
        print(&quot;setpoint_location &quot;, obj.location)
        print(&quot;======================&quot;)
Parent with Identity inverse.
The relationship between the matrices.
Does a child object inherit the matrix from the parent?
and if you have used the parenting operator (yick) how to reset parent inverse to identity, to avoid the hassle.  (The location can be garnered from the vert location anyway_)
how to clear parent inverse without actually moving the object
Here is an alternative way to parent your spheres to the verts of the plane, code from https://blender.stackexchange.com/a/200719/15543  Each object has an identity parent inverse.  (It uses empties, for 6 could use add mesh operator, location=(0, 0, 0), directly after each run the new object is context.object)
Run with plane as context object
import bpy
from bpy import context

ob = context.object
coll = context.collection

for v in ob.data.vertices:
    mt = bpy.data.objects.new(
        f&quot;Vert{v.index}&quot;,
        None,
        )
    mt.empty_display_type = 'CIRCLE'
    mt.empty_display_size = 0.2
    mt.parent = ob
    mt.parent_type = 'VERTEX'
    mt.parent_vertices = [v.index] * 3
    coll.objects.link(mt)

Testing.
Am going to use these vert parented empties  as a test case for above, for simple numbers have simply moved the plane to (0, 0, 2).  Still the context object.

&gt;&gt;&gt; C.object
bpy.data.objects['Plane']

Local and global vert locations.
&gt;&gt;&gt; for v in C.object.data.vertices:
...     v.index, v.co[:], (mw @ v.co)[:]
...     
(0, (-1.0, -1.0, 0.0), (-1.0, -1.0, 2.0))
(1, (1.0, -1.0, 0.0), (1.0, -1.0, 2.0))
(2, (-1.0, 1.0, 0.0), (-1.0, 1.0, 2.0))
(3, (1.0, 1.0, 0.0), (1.0, 1.0, 2.0))
(4, (0.00918059702962637, -1.0, 0.0), (0.00918059702962637, -1.0, 2.0))
(5, (0.00918059702962637, 1.0, 0.0), (0.00918059702962637, 1.0, 2.0))

Missed the middle with a loop cut, nevermind
Global, and local object locations
&gt;&gt;&gt; mw = C.object.matrix_world
&gt;&gt;&gt; mwi = mw.inverted()
&gt;&gt;&gt; for o in C.scene.objects:
...     o.name, o.matrix_world.translation[:], (mwi @ o.matrix_world.translation)[:]
...     
('Plane', (0.0, 0.0, 2.0), (0.0, 0.0, 0.0))
('Vert0', (-1.0, -1.0, 2.0), (-1.0, -1.0, 0.0))
('Vert1', (1.0, -1.0, 2.0), (1.0, -1.0, 0.0))
('Vert2', (-1.0, 1.0, 2.0), (-1.0, 1.0, 0.0))
('Vert3', (1.0, 1.0, 2.0), (1.0, 1.0, 0.0))
('Vert4', (0.00918059702962637, -1.0, 2.0), (0.00918059702962637, -1.0, 0.0))
('Vert5', (0.00918059702962637, 1.0, 2.0), (0.00918059702962637, 1.0, 0.0))

or alternatively instead of multiplying by mwi use matrix_local eg
&gt;&gt;&gt; C.object
bpy.data.objects['Vert1']

&gt;&gt;&gt; C.object.matrix_local.translation
Vector((1.0, -1.0, 0.0))

So I contend, assuming the empties (spheres) do not move from their parented vert,  the local coordinates  can be taken from the vertex coordinates, and the global coordinates also by multiplying by the objects matrix world.
Or conversely the global coordinates of the verts from the empties global locations, and the locals by multiplying by the parent objects inverse matrix world.
Note if the plane is to be deformed, can get the mesh coordinates with Object.to_mesh or Bmesh.from_object.
Note: It is recommended to change frame with scene.frame_set(f) rather than setting scene.frame_current = f.