SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1902.08705 · 2019

A General Framework for Structured Learning of Mechanical Systems

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1902.08705.json · badge: /api/ran/1902.08705.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
sisl/mechamodlearn canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
bfill_diagonal Ran
ran on a synthesized input
sisl/mechamodlearn/mechamodlearn/utils.py
code served (permissive licence) · get_code("4b6a9d1b12dd682b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct arguments for bfill_diagonal
# A: torch.Tensor - a 2D or batched tensor where diagonal will be filled
# vec: torch.Tensor - a 1D vector of values to fill the diagonal with

# Create a batch of 2x4x3 matrices (batch size 2, 4 rows, 3 cols)
# This will fill the min(4, 3)=3 diagonal elements
A = torch.randn(2, 4, 3)

# Create a vector with 3 elements (matching the diagonal length)
vec = torch.tensor([1.0, 2.0, 3.0])

ARGS = {
    "A": A,
    "vec": vec,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bfill_lowertriangle Ran
ran on a synthesized input
sisl/mechamodlearn/mechamodlearn/utils.py
code served (permissive licence) · get_code("9f6aeb9840d537e1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - A: torch.Tensor, used with .size(-2), .size(-1), and indexing [..., ii, jj]
# - vec: torch.Tensor, assigned to A[..., ii, jj]
# 
# The function fills lower triangle indices of a matrix with values from vec.
# np.tril_indices(A.size(-2), k=-1, m=A.size(-1)) gets indices of lower triangle
# (excluding diagonal, k=-1).
#
# For a 4x5 matrix, tril_indices would give us the lower triangle indices.
# We need vec to have length equal to the number of lower triangle elements.

# Create a matrix A with shape (batch, 4, 5)
# For 4x5 matrix with k=-1 (strict lower triangle):
# Row 1: 1 element (col 0)
# Row 2: 2 elements (cols 0,1)
# Row 3: 3 elements (cols 0,1,2)
# Total: 6 elements

A = torch.randn(2, 4, 5)  # batch of 2, matrices are 4x5

# Calculate the number of lower triangle elements
ii, jj = np.tril_indices(4, k=-1, m=5)
num_elements = len(ii)  # Should be 6

# Create vec with matching length
vec = torch.randn(2, num_elements)  # batch of 2, 6 elements each

ARGS = {
    "A": A,
    "vec": vec,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
odeint Ran
ran on a synthesized input
sisl/mechamodlearn/mechamodlearn/odesolver.py
code served (permissive licence) · get_code("1815067555f382f6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define a simple dynamics function as nn.Module
class SimpleDynamics(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, q, v, u=None):
        # q: position (batch, 4)
        # v: velocity (batch, 4)
        # u: control input (optional)
        # returns: acceleration (batch, 4)
        return self.linear(v)

# Create the dynamics module
dynamics = SimpleDynamics()

# Create initial conditions as a tuple of tensors
# q0: position (batch=2, dim=4)
# v0: velocity (batch=2, dim=4)
q0 = torch.randn(2, 4, dtype=torch.float32)
v0 = torch.randn(2, 4, dtype=torch.float32)
y0 = (q0, v0)

# Create time steps to integrate over
t = torch.linspace(0, 1, 5, dtype=torch.float32)

# Define transforms (identity transforms)
transforms = [lambda x: x, lambda x: x]

ARGS = {
    'func': dynamics,
    'y0': y0,
    't': t,
    'method': 'euler',
    'transforms': transforms,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
plot_traj Ran
ran on a synthesized input
sisl/mechamodlearn/mechamodlearn/viz_utils.py
code served (permissive licence) · get_code("60e18749fc6d6b5c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Figure. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import matplotlib.pyplot as plt

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# T=5 timesteps, B=2 batch size (trajectories), D=4 dimensions
T = 5
B = 2
D = 4

# system_x_T_B: ground truth trajectories [T, B, D]
system_x_T_B = torch.randn(T, B, D)

# model_x_T_B: predicted trajectories [T, B, D]
model_x_T_B = torch.randn(T, B, D) + 0.1 * torch.randn(T, B, D)

# tstar: time values [T]
tstar = np.linspace(0, 1, T)

ARGS = {
    'system_x_T_B': system_x_T_B,
    'model_x_T_B': model_x_T_B,
    'tstar': tstar
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
wrap_to_pi Ran
ran on a synthesized input
sisl/mechamodlearn/mechamodlearn/utils.py
code served (permissive licence) · get_code("ab3a6fcc0ae587bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small input tensor with shape (batch=2, dim=4)
inp = torch.randn(2, 4)

# Create a mask tensor with shape (1, 4) - optional parameter
mask = torch.ones(1, 4)

ARGS = {
    "inp": inp,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
filter_ Not yet run
unverified (harvested, no recorded run)
sisl/mechamodlearn/mechamodlearn/nested.py
code served (permissive licence) · get_code("333bf105fcfc9f91")
How it ran

no invocation recorded.

rk4_alt_step_func Not yet run
unverified (harvested, no recorded run)
sisl/mechamodlearn/mechamodlearn/odesolver.py
code served (permissive licence) · get_code("5a92e97beb204564")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
bfill_diagonal 1 other paper
1 later
2202.11217 (2022-02)
Differentiable and Learnable Robot Models
bfill_lowertriangle 1 other paper
1 later
2202.11217 (2022-02)
Differentiable and Learnable Robot Models
filter_ 1 other paper
1 later
2006.11615 (2020-06)
Scalable Identification of Partially Observed Systems with Certainty-Equivalent EM
rk4_alt_step_func 1 other paper
1 later
2006.11615 (2020-06)
Scalable Identification of Partially Observed Systems with Certainty-Equivalent EM

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Learning accurate dynamics models is necessary for optimal, compliant control of robotic systems. Current approaches to white-box modeling using analytic parameterizations, or black-box modeling using neural networks, can suffer from high bias or high variance. We address the need for a flexible, gray-box model of mechanical systems that can seamlessly incorporate prior knowledge where it is available, and train expressive function approximators where it is not. We propose to parameterize a mechanical system using neural networks to model its Lagrangian and the generalized forces that act on it. We test our method on a simulated, actuated double pendulum. We show that our method outperforms a naive, black-box model in terms of data-efficiency, as well as performance in model-based reinforcement learning. We also conduct a systematic study of our method's ability to incorporate available prior knowledge about the system to improve data efficiency.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1902.08705")
get_code_for_paper("1902.08705")
have("1902.08705")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1902.08705.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1902.08705.svg)](https://syntology.ai/paper/1902.08705)

Connect an agent — have() is free.