Problem with ports widths and dimensions when using XY graph
显示 更早的评论
I am getting the following error in my model.
Error in port widths or dimensions. Input port 1 of 'untitled/XY Graph/sfunxy' is a one dimensional vector with 2 elements.
回答(1 个)
Mathieu NOE
2020-11-6
0 个投票
hi
I assume your x input is supposed to be a linear ramp, but this is not what you created in the first bloc (constant vector instead of a ramping scalar)
your first block must be replaced by the "ramp" block in the simulink source library
4 个评论
Tanmay Sandbhor
2020-11-7
Mathieu NOE
2020-11-7
hello
Normally the ode function is to be used to solve a time dependant problem, and for each time step, the x, y and their derivatives are scalars, not vectors as you are trying to do;
it seems to me that time is not your variable, it's x (distance) as you explained
so it's not a time dependant problem but you can still use ode to solve it, just that using t is quite confusing in first lecture
so I did it simply in a script , no need to do it with Simulink
L = 1;
x0 = [0 0];
xspan = [0 L];
[x,y] = ode45(@MyFunctionL,xspan, x0);
plot(x,y);
legend('defection (y)','slope (dy/dx)');
function dy = MyFunctionL(x,y)
L = 1;
F = 1;
EI = 1;
FL = F*L;
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = (FL/EI)*(L - x);
end
Tanmay Sandbhor
2020-11-8
Mathieu NOE
2020-11-8
hello
the result of the beam will depend how fast you force is changing
if the frequency is much lower than the first eigenmode of the beam, the problem can still be considered as "static" or "quasi-static"; in this case , the deflection curve can be plotted gainst time simply by using the static deflection curve points multiplied by the time dependant function of the force
if the force would change very fast , or if it's a step or impulse function, the quasi static approach is no more valid and you have to take into account the mass distribution of the beam; the beam can be discretized by small elements , and you end up with a Finite Element Solver;
类别
在 帮助中心 和 File Exchange 中查找有关 Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!