
Physics-informed neural network in TensorFlow predicting the seismic response of steel braced frames.
- My role
- ML intern
- Links
- GitHub (planned) ↗
- Stack
- PythonTensorFlowNumPy
- Python · TensorFlow · NumPy
92%
Prediction accuracy on test data

Source · Illustrative simulation of a single-storey response (Newmark-β), not the internship dataset
01 — Problem
Finite-element simulation is accurate but slow, while purely data-driven models can violate physical laws.
02 — Approach
- 01
Data loss + physics residual from the equation of motion.
- 02
Evaluated on unseen ground motions.
03 — Architecture
System architecture
S01
Ground motion
S02
Network
S03
Physics residual
S04
Loss
S05
Response
04 — Engineering notes
Physics inside the loss
The network is penalised both for missing the data and for violating the equation of motion m·ü + c·u̇ + k·u = −m·a_g at collocation points.
# Simplified sketch of the training loss (TensorFlow)
with tf.GradientTape(persistent=True) as g2:
g2.watch(t)
with tf.GradientTape() as g1:
g1.watch(t)
u = model(t)
u_t = g1.gradient(u, t)
u_tt = g2.gradient(u_t, t)
residual = m * u_tt + c * u_t + k * u + m * a_g(t)
loss = mse(u_obs, model(t_obs)) + lam * tf.reduce_mean(tf.square(residual))Result: 92% prediction accuracy on held-out ground motions.
Outcome
92% prediction accuracy with physically consistent outputs.
Next project
Safira AI Chatbot
