Repository navigation
Winch model in Matlab: examples, tests and documentation - #88
Merged
Merged
Conversation
examples/matlab/async_machine_step.m implements the AsyncMachine of WinchModels.jl in Matlab, used by the MatlabMachine (winch_model: "MatlabMachine"). It updates the brake and the rate limited set speed and returns the acceleration and its partial derivatives. test_async_machine_step.jl compares it with the Julia AsyncMachine and measures the time per call; the folder has its own environment with MATLAB.jl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bench_engine.jl measures the time of one call of Matlab from Julia for different ways of calling it (step 0 of PlanMatlab.md), including the unchecked eval_string used by the MatlabMachine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b winch model compare_full_cycle.jl flies the power cycles of autopilot.jl, without viewer and turbulence, with the AsyncMachine and with the MatlabMachine, and compares energy, tether force, reel-out speed and time per step. The environment gets KiteControllers (from this repository), KiteModels and Printf; the machine-specific path of WinchModels is removed from its [sources]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…winch model autopilot_matlab.jl runs autopilot.jl in the environment examples/matlab, with the MatlabMachine instead of the winch model of the selected project; from another environment, e.g. the menu, it starts a new Julia process without system image. autopilot.jl uses WINCH_MODEL, if defined, as winch model. The environment examples/matlab gets the packages autopilot.jl needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The projects are passed as arguments, or as the global PROJECTS when the script is included; system.yaml is the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Requirements, setup, usage, how the Matlab winch model is called, accuracy, speed, how to write an own Matlab winch model and limitations. The examples page links to it from a new section for autopilot_matlab.jl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…time step Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The winch model can now run in Matlab inside the Julia simulation, driven by
SystemStateControlfor the full power cycle, as planned in PlanMatlab.md.examples/matlab/async_machine_step.m: theAsyncMachineof WinchModels.jl in Matlab. It updates the brake and the rate limited set speed and returns the acceleration with its analytic partial derivatives. It is called by theMatlabMachine(Add the MatlabMachine, a winch model implemented in Matlab aenarete/WinchModels.jl#32) once per time step.examples/autopilot_matlab.jl, in the example menu: runs autopilot.jl with the Matlab winch for the selected project. From another environment (e.g. the menu) it starts a new Julia process inexamples/matlabwithout system image.autopilot.jlusesWINCH_MODEL, if defined, as winch model.examples/matlab/: own environment with MATLAB.jl (it cannot be installed without Matlab), plustest_async_machine_step.jl: Matlab vs. Julia model, 20740 of 20740 checks passedcompare_full_cycle.jl: full power cycles with both winch models, for any projectbench_engine.jl: cost of different ways of calling Matlab from JuliaResults (Matlab R2021a, Linux)
About 1.5 ms per time step (2.2 ms p99) with the Matlab winch, real-time capable up to a time-lapse factor of about 18.
autopilot_matlab.jlwith the 3D viewer missed the deadline in 0.14 % of the time steps.Depends on
MatlabMachine)winch_model: "MatlabMachine")The Matlab examples need these versions; until they are released, develop them in
examples/matlab. Nothing outsideexamples/matlabandautopilot_matlab.jluses them, so the normal examples, tests and docs work with the released versions.🤖 Generated with Claude Code