How to create a custom component in Simscape, with input as variable parameter ?
Show older comments
Hello,
I am trying to create a custom component in Simscape, based on the "Tire (Friction Parameterized)" component.
Basically, I want some of its parameters, lets say the "rolling radius", to be an input of the component, so that I can change its value during the simulation, just as I can change the value of a "variable inertia" with a PS input.
I tried to create some new inputs in the source code, but it seems that I can't use these inputs in the equations, as they are not defined as parameters. I also tried to define new equations, to impose the value as the parameter to be the same as the input, but then I have more equations than parameters.
Any idea on how to solve this issue ? Maybe the method consisting of using those parameters as input is not the best one, I am open to other solutions.

2 Comments
If you are trying to modify the "Tire (Friction Parameterized)" component to allow parameters like the rolling radius to be changed dynamically during the simulation you can consider the following approach:
- Instead of defining "r_tire" as a parameter, you can define it as a variable so it can change over time:
variables
r_tire = {0.3, 'm'}; % Rolling radius (Now a variable instead of a parameter)
end
- Now link "r_tire" to the input "Radius" using an equation:
equations
r_tire == Radius; % Assign the input value dynamically
end
- Now, just replace "r_tire" wherever you were using it as a parameter in the model equations.
These modifications might help you to update the rolling radius dynamically based on the input signal during simulation.
Neil
on 24 Feb 2025
Answers (0)
Categories
Find more on Simscape Driveline in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!