phx-simulink

Connect PHX rigid-body scenes to Simulink for property-driven co-simulation.

7|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/Humusoft/phx --skill phx-simulink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phx-simulink
Source: https://github.com/Humusoft/phx/tree/main/.claude/skills/phx-simulink
Command: npx skills add https://github.com/Humusoft/phx --skill phx-simulink

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you connect PHX rigid-body physics scenes to Simulink so you can exchange control inputs and simulation outputs without manually managing the underlying simulation engine.

Core Features & Use Cases

  • Property-Driven Ports: Bind Simulink signals to readable and settable properties of named PHX objects, including positions, orientations, velocities, forces, energy, springs, and joints.
  • Co-Simulation Configuration: Configure the PHX scene source, sample time, substeps, viewer, camera, rendered-image output, and port references for closed-loop models.
  • Validation and Debugging: Validate object names and property references, avoid unsupported method ports, prevent algebraic loops, and diagnose kinematic-body timing and substep issues.
  • Event-Based Actions: Use the PHX Action block for runtime spawning, removal, reparenting, force application, and other occasional imperative operations.
  • Use Case: Build a fixed-step Simulink controller that tilts a PHX plate, reads the positions of simulated balls, and feeds the controller output back through a Memory block.

Quick Start

Use the phx-simulink skill to configure a PHX physical simulation block with a scene source, named-object input and output references, a fixed-step sample time, and a safe feedback-loop design.

Frequently Asked Questions about phx-simulink

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect Simulink signals to a rigid-body physics scene for closed-loop control?

Co-simulation between Simulink and a rigid-body physics scene involves mapping named object properties like positions, velocities, and forces to Simulink signals. This allows you to exchange control inputs and simulation outputs for closed-loop feedback.

How do I map physical object properties like velocity and force to Simulink input and output ports?

Mapping physical object properties to Simulink ports requires configuring PhxModel blocks with unique object names and valid sizeable numeric property references. You can bind positions, orientations, velocities, forces, springs, and joints directly to Simulink signals for property-driven exchange.

Do I need a fixed-step solver to run PHX co-simulation in Simulink?

Yes, you need a fixed-step simulation setting to run PHX co-simulation in Simulink. Configuring the sample time and substeps correctly is essential for safe feedback-loop design, preventing algebraic loops, and diagnosing kinematic-body timing issues.

What is the best way to apply runtime actions like spawning or force application in a Simulink physics model?

The best way to apply runtime actions in a Simulink physics model is using the PHX Action block. It handles occasional imperative operations like runtime spawning, object removal, reparenting, and force application during the co-simulation.

Why does my Simulink and physics co-simulation fail validation or hit algebraic loop errors?

Simulink and physics co-simulation validation fails when object names or property references are invalid, or when unsupported method ports are used. Algebraic loop errors and kinematic-body timing issues are typically resolved by using Memory blocks and configuring proper substeps.

Can I render synthetic camera outputs from a physics scene directly into my Simulink model?

Yes, you can render synthetic camera outputs from a physics scene into your Simulink model. During co-simulation configuration, you can set up the viewer, camera, and rendered-image output alongside your scene source and sample time settings.