Determine Input and Output in variables

1 次查看(过去 30 天)
Hello.
I will make a regression model with the regression equation I made.
The variables of the regression equation include rpm, flow rate, angle, etc., and I want to know how to define these as simulink functions.
For example, the regression equation is as follows.
->Inlet Pressure [pa]=
{305.867498900404
+(1.40321530174638 *cooling water temp.)
+(0.17272037497876 * Rotating speed[rpm])
-(75.5187884669542 * Volume flow rate[LPM])
+(0.000932202284942232* cooling water temp. * Rotating speed[rpm])
+(0.0103317103698982 * cooling water temp. *Volume flow rate[LPM])
+(0.224463102906147 * LE angle * TE angle)
-(0.0148198328059957 * Rotating speed[rpm] * Volume flow rate[LPM])
-(0.0000028726711479103 * cooling water temp. * Rotating speed[rpm]* Volume flow rate[LPM])}
If I put a number in a variable written in English, the result is derived.
It's so hard. Can you help me??
Thank you.

回答(1 个)

Chetan
Chetan 2024-3-15
It looks like you want to use Simulink to make a model based on a special formula you came up with.
You can follow the following steps
  • Input Variable Setup: Initiate by generating input blocks for each variable involved (for instance, cooling water temperature, rotation speed [rpm], flow rate [LPM], LE angle, TE angle). For static inputs, the "Constant" block might be suitable, whereas "Signal Generator" or "From Workspace" blocks could serve dynamic inputs well.
  • Regression Equation Integration: Utilize the "MATLAB Function" block for embedding your regression formula. By double-clicking this block, you can access an editor where your regression equation can be inputted in the form of MATLAB code. For instance:
  • Linking Inputs with the MATLAB Function Block: Make sure to connect each input block's output to the appropriate inputs on the "MATLAB Function" block. This configuration allows for the seamless transfer of variable values into your regression formula.
function InletPressure = f(coolingWaterTemp, rotatingSpeed, volumeFlowRate, LEangle, TEangle)
InletPressure = 305.867498900404 ...
+ (1.40321530174638 * coolingWaterTemp) ...
+ (0.17272037497876 * rotatingSpeed) ...
- (75.5187884669542 * volumeFlowRate) ...
+ (0.000932202284942232 * coolingWaterTemp * rotatingSpeed) ...
+ (0.0103317103698982 * coolingWaterTemp * volumeFlowRate) ...
+ (0.224463102906147 * LEangle * TEangle) ...
- (0.0148198328059957 * rotatingSpeed * volumeFlowRate) ...
- (0.0000028726711479103 * coolingWaterTemp * rotatingSpeed * volumeFlowRate);
end
  • Results Visualization or Exportation: For result observation, a "Display" block can be employed, or alternative output blocks can be used depending on your preference for utilizing the computed inlet pressure.
  • Simulation Execution: With your model setup complete, executing the simulation will illustrate the impact of variations in input variables on the inlet pressure as determined by your regression equation.
Refer to the following MathWorks Documentation for more details:
Thanks
Chetan

类别

Help CenterFile Exchange 中查找有关 Choose and Parameterize Blocks 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by