How to build a bilinear model in simulink, using in the simscape model

3 Ansichten (letzte 30 Tage)
The attachment is my Hydralic actuator system model, I want to change the specimen to the bilinear model.
I have already have the bilinear model in matlab.m file.
  2 Kommentare
Benjamin Thompson
Benjamin Thompson am 15 Feb. 2022
If the matlab.m file represents the model you want to use, can you post this file? Have you tried using this file in a MATLAB Function block in your Simulink model?
HUANG ZI YOU
HUANG ZI YOU am 16 Feb. 2022
TaiwanTechSpringModel.m, this file is the bilinear model.
The code below is modified model so that the input is displacement(disp) and the output is force(F).
directory = pwd;
addpath(genpath(directory));
node0 = [0 0;
0 0;
0 1]; % Coordinates (m)
k1 = 1800000; % Initial Stiffness (Nm/rad)2334000
k2 = 600000; % Secondary Stiffness (Nm/rad)
dy = 0.0053; % Yielding Angle (rad)
dp = 0.012; % Peak Angle (rad)0.00825
du = 1; % Ultimate Angle (rad)
ft = 5500; % Residual Moment (Nm/rad)
% Mz = trilinearPinching(k1,k2,dy,dp,du,ft);
Mz = bilinearHysteretic(k1,k2,dy);
Elem = rotationalSpring2D(node0,Mz);
Node0 = node0;
Node0(3,1) = Node0(3,1) + 0.001*disp; % Adding Node3 x direction in m
[Elem,f1] = dispLoad(Elem,Node0);
F = f1(5)
Because the matlab function can not connect the Simscape block(Double-Acting
Hydraulic Cylinder), I am wondering if I could change Translational Spring block's sorce code to get the bilinear model.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

sai charan sampara
sai charan sampara am 28 Feb. 2024
Hello HUANG,
I understand that you want to connect the output of a MATLAB function to a Simscape block. It can be done as follows:
  • From the Library Browser under Simulink -> User-Defined Functions select the MATLAB function block and add it to your model.
  • Double click the MATLAB function block to open the MATLAB function and place the code of your choice in it. In this case place the bilinear model code and configure the input parameters (“disp”) and output parameters (“F”).
  • Then from the Library Browser under Simscape -> Utilities choose the “Simulink-PS Converter” block. Connect the output of the function block to this block.
  • From Library Browser under Simscape -> Foundation Library -> Mechanical -> Mechanical Sources select the “Ideal Force Source” block and place it in the model.
  • The output of “Simulink-PS Converter” can be connected to the “S-port” of the “Ideal Force Source” block. The “Ideal Force Source” block represents an ideal source of force that generates force proportional to the input physical signal. Block connections R and C are mechanical translational conserving ports. Port S is the physical signal port, through which control signal that drives the source is applied. Positive signal at port S generates force acting from C to R.
  • The output of this block can be connected to “Double-Acting Hydraulic Cylinder” as per requirement.
It can be done like the image below:
You can also use the “Connection port” block under Simscape -> Utilities to transfer a signal across systems. You can refer to this link for more information:

Kategorien

Mehr zu Simscape finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by