How to use the magicformula as a MATLAB function in simulink
Show older comments
I have been trying to create a MATLAB function in simulink to use the magicformula built in function where i can just put in camber, slip angle etc... and get Fy and Mz. I saw that there is the built in simulink block, but Mz isn't there and i really need it as an output for my model. I knw that there is also the blocksets for vehicle dynamics but they don't do exactly what I want. Where I try to run my function, it says that the object oriented code in MagicFormulaTyre isn't supported by simulink. Is there any way to make it work? Thank you!!
Answers (1)
Sam Chak
on 24 Feb 2025
0 votes
There are two versions of the 'Magic' formulas. Can you mathematically derive
from their outputs? If so, you can write the derivation steps to the MATLAB Function block.


2 Comments
Alice
on 24 Feb 2025
Sam Chak
on 25 Feb 2025
Hi @Alice
Are you referring to the Magic Formula Tire Force and Torque block? If you are writing a custom function within the MATLAB Function block, it is likely that your Magic Formula model contains unsupported functions, as Simulink does not support certain functions.

If you receive the message, 'Simulink does not have enough information to determine output sizes for this block,' it may indicate that the types for the block inputs and sizes for the block outputs are not specified correctly. I recommend taking a screenshot of your Simulink model so that other experts can assist you.
Categories
Find more on Simulink 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!