How can I set up the lookup table for a 2-way directional valve?

I need help with why I am getting this error "Dimensions of arrays being concatenated are not consistent. "
I am trying to model a 2-Way Driectional Valve using lookup tables.

4 Comments

This error happens when you try to concatenate arrays that can't be concatenated. For instance, trying to vertically concatenate arrays with different numbers of columns, or trying to horizontally concatenate arrays with different numbers of rows.
x = [1 2 3];
y = [4 5 6];
% vertically concatenate x and y -> works
% because x and y have the same number of columns
z = [x; y]
z = 2×3
1 2 3 4 5 6
x = [1 2 3];
y = [4 5 6; ...
7 8 9];
% vertically concatenate x and y -> works
% because x and y have the same number of columns
z = [x; y]
z = 3×3
1 2 3 4 5 6 7 8 9
x = [1 2 3];
y = [4 5 6 7];
% vertically concatenate x and y -> does not work
% because x and y do not have the same number of columns
z = [x; y]
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
For more specific help, please post the relevant code.
Thank you. I fixed that and now I have this:
Caused by:
  • ['Trial/2-Way Directional Valve (IL)']: Size of Volumetric flow rate table, q(s,dp) must be equal to length of Spool travel vector, s by length of Pressure drop vector, dp. In fluids.isothermal_liquid.valves_orifices.directional_control_valves.directional_valve_2_way
Any help with how to go about this one?
No idea, sorry. Apparently that's some stuff from Simscape, which I've never used.

Sign in to comment.

Answers (1)

Regarding the error message in you comment:
  • ['Trial/2-Way Directional Valve (IL)']: Size of Volumetric flow rate table, q(s,dp) must be equal to length of Spool travel vector, s by length of Pressure drop vector, dp. In fluids.isothermal_liquid.valves_orifices.directional_control_valves.directional_valve_2_way
It's complaining about size(q) is not the save as [length(s),length(dp)]. q is what you have put in the volumetric flow rate table, and s is the spool travel vector, and dp is the pressure drop vector. The dimensions have to be right, or Simscape doesn't know how to do the look up.

Categories

Products

Release

R2021a

Asked:

on 13 Apr 2022

Answered:

on 24 Jun 2022

Community Treasure Hunt

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

Start Hunting!