In Tire (Magic Formula) simscape block, I want to give (vary) the Rolling Resistance constant coefficient value as an external input. How to do it?
Show older comments
In Tire (Magic Formula) simscape block,
I want to give Rolling Resistance constant coefficient value as an external input from lookup table to vary it with the simulation time.
I tried it by modifying source code and gave it as an external input but the result of the newly created custom block not matching with the original one.
How can I achieve it?
Answers (1)
Aditya Srikar
on 26 May 2023
0 votes
To vary the rolling resistance constant coefficient value with simulation time, rather than modifying the source code of the Tire (Magic Formula) Simscape block, you can use the existing Lookup Table block in Simulink. Here are the steps to achieve this:
1. Create a Lookup Table block and define the x-axis values as the simulation time and the y-axis values as the rolling resistance coefficient. You can also use the Time Source block in Simulink to provide the time input to the lookup table.
2. Connect the output of the Lookup Table block to the Rolling Resistance constant input of the Tire (Magic Formula) Simscape block.
3. To match the original block results, ensure that the Lookup Table block is using the same interpolation method as the original block for the rolling resistance coefficient.
7 Comments
Ankush Aher
on 26 May 2023
Aditya Srikar
on 26 May 2023
You can connect the output of the Lookup Table block to a Simulink Signal Builder block and customize the input signal to control the variations of Rolling Resistance constant. Then, you can use the Simulink-PS Converter block to convert the signal to a physical signal and connect its output to the Rolling Resistance constant port of the Tire (Magic Formula) Simscape block. Note that the range of the Lookup Table output signal should match the limitations of the Rolling Resistance constant inputs.
Ankush Aher
on 26 May 2023
Aditya Srikar
on 27 May 2023
1. You can connect the output of the Lookup Table to a Simulink Signal Builder block by connecting the output port of the Lookup Table block to the input port of the Signal Builder block.
2. You can connect the output of the Signal Builder block to the Tire (Magic Formula) Simscape block's Rolling Resistance constant port by using a PS-Simulink Converter block in between. Connect the output port of the Signal Builder block to the input port of the PS-Simulink Converter, and connect the output port of the PS-Simulink Converter block to the Rolling Resistance constant port of the Tire (Magic Formula) Simscape block.
Ankush Aher
on 29 May 2023
Aditya Srikar
on 29 May 2023
1. To add an input port to the Signal Builder block, right-click on the block and select "Block Parameters". In the "Block Parameters" window, navigate to the "Input" tab and then change the number of "Number" input ports to the desired number.
2. To connect the output port of the PS-Simulink Converter block to the Rolling Resistance constant port of the Tire (Magic Formula) Simscape block, pass the output signal to the value input terminal of a Physical Signal Converter block, and then use a signal line to connect the output port of the Physical Signal Converter block to the Rolling Resistance constant port of the Tire (Magic Formula) Simscape block. You may also need to adjust the output signal range to ensure that it falls within the valid range for the Rolling Resistance constant input.
Ankush Aher
on 29 May 2023
Categories
Find more on Troubleshooting 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!

