JorgeLLH / Resources4Videos

This repositoy was created as a way to share the material from the Youtube channel content.
GNU General Public License v3.0
0 stars 0 forks source link

ParametricBlade doesn't have connector for RotatingBlades #1

Open eapuertoc opened 5 months ago

eapuertoc commented 5 months ago

Hi Jorge. Apoligies for using this space for a question, but didn't find other way. I'm starting in modelica and found your channel to start learning, in the video about Parametric Bodies and couldn't found the way to connect the ParametricBlade model in the RotatingBlades. I pressume that there's an inner connector missed, or to create ParametricBlade you have to use other option different than "Model", hope you could help me or if you could upload your models to this repository.

Regards.

ParametricModel.zip

JorgeLLH commented 2 months ago

Hi @eapuertoc ! My apologies I had some personal issues and have not being able to keep an eye on the notifications. I will come back to you with a proper answer! :)

JorgeLLH commented 2 months ago

Hi @eapuertoc ! In your model for the parametric blade, notice the line 6: Modelica.Mechanics.MultiBody.Interfaces.Frame frame_a

It should say: Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a

The difference is small but still relevant. I will copy my current code here: model ParametricBlade parameter Modelica.Units.SI.Position length_total =1; parameter Integer segments(min=1)=3; parameter Modelica.Units.SI.Position heights[:]=linspace(0.1,0.05,segments);//height = {0.1-(i-1)*(0.1/segments) for i in 1:segments Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a annotation( Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-16, -16}, {16, 16}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-16, -16}, {16, 16}}, rotation = 0))); Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox[segments]( height=heights, each r = {length_total/segments, 0, 0},each width = 0.01) annotation( Placement(visible = true, transformation(origin = {-50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Modelica.Mechanics.MultiBody.Parts.BodyBox bodyBox1(height = 0.1, r = {0.2, 0, 0}, width = 0.01) annotation( //Placement(visible = true, transformation(origin = {10, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation connect(frame_a, bodyBox[1].frame_a) annotation( Line(points = {{-100, 0}, {-60, 0}}));

for i in 1:segments - 1 loop connect(bodyBox[i].frame_b, bodyBox[i+1].frame_a); end for;

annotation( uses(Modelica(version = "4.0.0")), Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}})})); end ParametricBlade;

I hope this helps. Check the rest and feel free to come back again if you need to. I apologize in advance if it takes me a bit to answer. :)