Adding input for valid parameter in Simscape block
이전 댓글 표시
Hi all,
I have a question about Simscape blocks. Specifically, this question concerns the “The SI Combustion Cylinder” block.
I have already managed to create my own block that contains the same source code as the original block.
In the block, the gas constant R_air is entered as a “parameter”.
Now I want to define R_air as an “input”, as is done with the “Air-Fuel-Ratio” (AFR), for example. This way, I want to be able to read R_air via the Matlab workspace, as I do with other input values such as the speed or the intake manifold pressure.
When I adapt the program code in the same way as for the AFR, I have the problem that the following error appears when creating my own Simulink library:
“Error using ssc_build
Failed to generate 'UserBib_lib'
Caused by:
Invalid use of value 'R_air'. All entities referenced in this expression must be valid parameters.
• In UserBib.EngineSICombustionCylinderModified2 (line 297)”
In line 297, R_air is used for another formula.
How can I ensure that I can add values like “R_air” to the model via an input port?
I would be very happy to receive a reply.
Kind regards,
Florian
댓글 수: 2
Walter Roberson
2025년 2월 17일
Getting R_air via From Workspace means that R_air would be a signal
But I am getting the hint from "In the block, the gas constant R_air is entered as a “parameter”. " that you are trying to use R_air as a parameter . Parameters are pure numeric objects, with no time components, and so are incompatible with signals
Florian
2025년 2월 18일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Engines & Motors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!