フィルターのクリア

have an array of inputs instead of constants

3 ビュー (過去 30 日間)
sourena
sourena 2023 年 6 月 6 日
コメント済み: Matt J 2023 年 6 月 7 日
Hello,
I want to "have an array of inputs instead of constants" with the help of the "from_workspace block" to extend these models;
- Slope angle
- Wind speed
- Grip coefficient
m = 1400; %vehicle weight
alp_ang = 0.03; %inclined plane angle in radians
g = 9.81; %gravitational force
c = 0.013; %homogeneous pavement
b = 0.00000648; %tabular
v_wind = 1; %wind speed in m/s
cy = 0.28; %vehicle aero coefficient
sy = 2.2; %vehicle frontal surface
rho = 1.225; %air density in kg/m^3
m_eff = m*1.2; %effective vehicle weight, 1 + alpha=~0.2
grip_coeff = 0.8; %grip coefficient
P = 80000; %maximum vehicle power in watts
Trq = 475; %maximum vehicle torque
r_w = 0.25; %wheel radius
G = 3.35; %gear/torque multiplication factor
MaxBrk = 10000; %maximum braking force
  2 件のコメント
Matt J
Matt J 2023 年 6 月 6 日
What is the problem you are encountering in doing so? There is no restriction I can see in the Simulink documenation that says the variable read from the workspace needs tob e a scalar.
sourena
sourena 2023 年 6 月 6 日
well, I want to change the constant form of it to have an array

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2023 年 6 月 6 日
Just concatenate all the constants into a vector and bring that into Simulink,
constants=[m,alp_ang,...,MaxBrk]
  2 件のコメント
sourena
sourena 2023 年 6 月 7 日
thank you so much @Matt J
Matt J
Matt J 2023 年 6 月 7 日
You are quite welcome, but if this resolved your issue, please Accept-clik the answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBlock and Blockset Authoring についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by