Message Boards Message Boards

5
|
27588 Views
|
28 Replies
|
30 Total Likes
View groups...
Share
Share this post:

Modeling a Trebuchet

Posted 9 years ago
POSTED BY: Varun Kulkarni
28 Replies
Posted 8 years ago
POSTED BY: Erik Mahieu
Posted 8 years ago

Hello Erik,

Only for your information, our small competition is just finished this week. It's an very exciting game. Totally, 11 teams participated this competition and make 11 wood toys. Nobody make a further development for Mathematica model and code beyond your demo.

Although it is simple device, only 140 g weight and 200mm dimension (main beam length), We improved the actually efficiency from 10% to 60%, and shootting range from 1 meter to 6 meters.

I attached a few images and introduce PDF for your information. Thank you very much for your kindly model guide and share your work on Demostrations.

enter image description here

enter image description here

Attachments:
POSTED BY: Frederick Wu
POSTED BY: Vitaliy Kaurov
Posted 8 years ago
Attachments:
POSTED BY: Frederick Wu
Posted 8 years ago

Indeed, this would avoid the constrained phase when the projectile is sliding on the floor. But this is not how the real trebuchets worked. One can prove, as Siano did, that the range and efficiency is much higher when you have this initial sliding phase. By the way yr idea of a pit to avoid the constrained sliding is the intermediary solution mentioned in Siano's paper (page 12)

enter image description here

POSTED BY: Erik Mahieu
Posted 8 years ago

@Erik, Anthor finding, after careful looking at both on your horse image and my da Leonard's drawing. It can be those ancestors, open a groove and use a slot underneath the ground, so that sling at projectile side can have more bigger effective angle.That's a simple way to break that geometry constrain limited by ground.

So that l3 neglect should be acceptable, only if the man cut a slot on ground.

POSTED BY: Frederick Wu
Posted 8 years ago
POSTED BY: Frederick Wu
Posted 8 years ago

I found another article by Mr. Siano: A Mathematical Model for a Trebuchet

And here is a picture of a well known application of the trebuchet. Do not try this at home!! enter image description here

POSTED BY: Erik Mahieu
Posted 8 years ago
POSTED BY: Frederick Wu
Posted 8 years ago

@Sam Carrettie

Thank for the SystemModeler Example. However, Catapult is a little bit different design from trebuchet. Catapult is a kind of device allow elastic element, like spring, inside the system to reserve energy, then release a projectile. Trebuchet is actually anther stone projectile machine, which convert energy purely from potential energy to kinematic energy. We stay with trebuchet for our competition this time. becasure, the stiffness of spring is hard to measure and compare. Anyway, If SystemModeler can predict catapult, it should be able to predict trebuchet as well. The problem is I don't know how to best use SystemModeler and lack of know-how of trebuchet, either.

POSTED BY: Frederick Wu
Posted 8 years ago
POSTED BY: Erik Mahieu
Posted 8 years ago
POSTED BY: Frederick Wu
POSTED BY: Sam Carrettie
Posted 8 years ago
Attachments:
POSTED BY: Erik Mahieu
Posted 8 years ago

Hello Erik,

Excellent job for developing two trebuchet demos ! I have two questions.

  1. Inside you notebook (Trebuchet revisited-9.nb), It state Lagrangian 3 equations, the first equation is like below. notebook equation However, in demo code, you use anther equation, code equation Which one is correctlly? Is code equations better or solvable? How you get three equations from Lagrangian?

  2. I make some approximate calucation based on your demo, see attachment notebook. Input energy ( potential energy from countermass) = mgh ; Output energy ( kinematic energy of projectile weight with released velocity) = 1/2 m v^2 ; I found, Input energy is almost same as output energy. That means the effiency of device is always 100%. Usually, a practical trebuchet effiency is about 10% - 85% (maximum) based on Donald B. Siano's paper. Is that means this demo is a perfect theoretical simulation so far, without consider energy loss (like conflict and friction)? Am I understanding right ?

If I want to add a coefficient for effiencency as engineering way, where I should put a coefficient inside the 3 Lagrangian equations? What do you suggest ?

BTW, One of your fans found you changed your logo. ^_^

Attachments:
POSTED BY: Frederick Wu
Posted 9 years ago

Hello Erik,

Apologies for the delayed response.

Many thanks for explaining all the concepts clearly and providing suggestions.

The simulation done above is a great help in understanding dynamics and how Mathematica works.

Thanks,

Varun

POSTED BY: Varun Kulkarni
Posted 9 years ago

This is a better version with some loose ends fixed.

One can experiment and see that the most critical parameter to obtain a long shooting range is the moment the projectile is released from the poach. In this Manipulate, this is set by the angle between the vertical and the sling {rlsAngle) at the moment of release. This was the most critical job of the trebuchet operator: pull a string to open the poach at the right moment to obtain the desired range. Good luck!

enter image description here

Attachments:
POSTED BY: Erik Mahieu
Posted 9 years ago

The demo is beautiful, Erik. Thank you. I love Lagrangian mechanics, and here we have additional interest in knowing these things brought the age of castles to an end!

POSTED BY: David Keith
Posted 9 years ago

This is exactly what I suggested David. here is an attempt to "glue" the two together using the trebuchet NDSolve output as the initial conditions of the projectile equations. I attach a preliminary notebook based on my previous demonstration. Still needs some refining! And here is a GIF:

Attachments:
POSTED BY: Erik Mahieu
Posted 9 years ago
Attachments:
POSTED BY: Varun Kulkarni
Posted 9 years ago
POSTED BY: David Keith
Posted 9 years ago

Hello David,

Apologies for the delayed response.

Thank you for explaining all the concepts in detail and providing a well defined approach for problem solving and modelling.

It really helped in the understanding of different aspects and the way equations are used and solved in Mathematica.

Thanks,

Varun

POSTED BY: Varun Kulkarni
Anonymous User
Anonymous User
Posted 8 years ago

David said >

It is easier to find your way through a problem if you put each calculation in its own cell, and you evaluate and look at the result as you go along.

I had thought Mathematica 11.0 has a feature that debugs functions step by step, it has breakpoints i cannot get it to work yet. Documentation is very thin - despite setting breakpoints it never stops :)

I made the below for an earlier Mathematica (4.0). I'm unsure if it works "for complicated functions" in Mathematica 11.0 or not. It is in jutilspkg part of fNBookForm2 (orig. part of PeriodicTable` pkg). It is supposed to do what you said without all the ; editing. This allows being able to freeform work a cell at a time, then have a function made auto. It works but needs tender care, and has a help page.

Attachments:
POSTED BY: Anonymous User
Posted 9 years ago

Hi Varun,

I agree with Erik on this. The trebuchet part of the problem determines the coordinates and velocity at the point where the projectile leaves the pouch. These are the initial conditions for a second set of differential equations which describe ballistic flight. There are two ways to string these together: You can do so manually by executing them in sequence, either in separate cells or in the same cell; or they can be placed in a module, with local variables connecting them, and both solutions used for building the plot. To animate them together, they would need to be all encapsulated in the animation.

Using the impact point as an input is another matter. It is really part of the solution. The likely method here is to build the full simulation into a function which can return the impact point. A solver like FindRoot can then be used to solve for some selected input parameter being used to adjust the impact. In a simple projectile problem that might be the launch angle. This gets you to a way to specify the impact point as an input, and retrieve the parameter setting needed, as well as the full trajectory.

Before version 10, this would require that NDSolve be enclosed in the FindRoot process, which means solving the set of diffeqs many times. However, with V10 we have ParametricNDSolve, which allows us to specify an input parameter and returns a function for a solution to the diffeqs, given a value of the input parameter. This output from ParametricNDSolve can be used as an alternative to wrapping the solution process in the solve.

Best regards, David

POSTED BY: David Keith
Posted 9 years ago

I would not combine the equations but use the output (speed and direction) as the input of the projectile equations. Two separate computations.

POSTED BY: Erik Mahieu
Posted 9 years ago

Hello,

I tried solving both equations separately, but I face an error everytime saying that the limiting value is not a machine sized number and a certain replacement rule is invalid. I cannot quite figure it where that error exists.

I used the below mentioned Projectile equations as suggested for the Trebuchet, but, cannot get the projectile to leave the Trebuchet.

Manipulate[
 ParametricPlot[{{V Cos[\[Theta]] t, 
    V Sin[\[Theta]] t - 
     9.8 t^2/2}, {V vt Cos[\[Theta]]/9.8 (1 - Exp[-9.8 t/vt]), 
    vt/9.8  (V Sin[\[Theta]] + vt) (1 - Exp[-9.8 t/vt]) - vt t}}, {t, 
   0, tf}, PlotStyle -> {{Thick, Blue}, {Thick, Red}}, 
  AxesOrigin -> {0, 0}, AxesLabel -> {x, z}, 
  PlotRange -> {{0, 400}, {0, 300}}, ImageSize -> 500, 
  Epilog -> {Green, PointSize[.02], 
    Point[{{V Cos[\[Theta]] tf, 
       V Sin[\[Theta]] tf - 
        9.8 tf^2/2}, {V vt Cos[\[Theta]]/9.8 (1 - Exp[-9.8 tf/vt]), 
       vt/9.8  (V Sin[\[Theta]] + vt) (1 - Exp[-9.8 tf/vt]) - 
        vt tf}}]}], {{V, 48.8, "initial velocity"}, 1, 100, 
  Appearance -> "Labeled"}, {{\[Theta], 1.09, "angle"}, .1, \[Pi]/2, 
  Appearance -> "Labeled"}, {{vt, 100, "terminal velocity"}, .01, 300,
   Appearance -> "Labeled"}, {{tf, 8.75, "time"}, .1, 17, 
  Appearance -> "Labeled"}]

How do I separately solve for the Trebuchet and the Projectile, so that I can get an animation where the projectile actually leaves the trebuchet?

Thanks.

POSTED BY: Varun Kulkarni
Posted 9 years ago

Hi, Thanks

I was able to generate the equations of motions for the Trebuchet and calculate the Lagrangian.

I tried using the equations of Projectile motion as well. But I am not quite sure as to how to combine the equations from Projectile with Air Drag into the Trebuchet equations to animate the projectile to actually leave the Trebuchet and make an impact against something like a wall at a distance say x='constant'.

Is there any specific way to do that?

The equations I got were:

cn = {L1, L2, L3, L4, m1, m2, mb, rg, rc};


(*Coordinates of the short end of the beam*)     (*Defined 'a'*)
x1[?_] := L1 *Sin[?];
y1[?_] := -L1 *Cos[?];
(*Coordinates of the long end of the beam:*)    (*Defined 'b'*)
x2[?_] := -L2* Sin[?];
y2[?_] := L2 *Cos[?];
(*Coordinates of the center of mass of the Counterweight*)     \
(*Defined 'c'*)
x4[?_, ?_] := 
  L1* Sin[?] - L4 *Sin[? + ?];
y4[?_, ?_] := -L1 *Cos[?] + 
   L4* Cos[? + ?];
(*Coordinates of the Projectile end of the Sling *)    (*Defined 'd'*)


x3[?_, ?_] := -(L3 *Sin[? - ?] + 
     L2* Sin[?]);
y3[?_, ?_] := -(L3 *Cos[? - ?] - 
     L2* Cos[?]);


(* potential energy of the three parts:*)
PE[?_, ?_, ?_] := 
  m1 *g* y4[?, ?] + m2 *g* y3[?, ?] - 
   mb* g* rc *Cos[?];

(* kinetic energy of the three parts:*)
KE[?_, ?_, ?_] := 
  0.5*m1*((Dt[x4[?, ?], t, Constants -> cn])^2 + (Dt[
         y4[?, ?], t, Constants -> cn])^2
     ) + 0.5*
    m2 *((Dt[x3[?, ?], t, Constants -> cn])^2 + (Dt[
         y3[?, ?, Constants -> cn], t])^2) + 
   (mb/2) *(rg^2)* Dt[?, t, Constants -> cn]^2;
(* the lagrangian*)
Lag = KE - PE;
L[?_, ?_, ?_] := 
  KE[?, ?, ?] - PE[?, ?, ?];


(* define what is constant, and the derivatives of the angles, \
denoted by the "d" suffix:*)
EL = L[?, ?, ?] /. {Dt[?, t, 
      Constants -> {L1, L2, L3, L4, m1, m2, mb, rg, rc}] -> ?d,
        Dt[?, t, 
      Constants -> {L1, L2, L3, L4, m1, m2, mb, rg, rc}] -> ?d,
           Dt[?, t, 
      Constants -> {L1, L2, L3, L4, m1, m2, mb, rg, rc}] -> ?d, 
    Dt[?, t] -> ?d, Dt[?, t] -> ?d, 
    Dt[?, t] -> ?d};



eq? = 
  Simplify[ 
   Dt[D[EL, ?d], t] - D[EL, ?] == 0 /. {Dt[L1, t] -> 0, 
     Dt[L2, t] -> 0, Dt[L3, t] -> 0, Dt[L4, t] -> 0, Dt[mb, t] -> 0, 
     Dt[m1, t] -> 0, Dt[m2, t] -> 0, Dt[g, t] -> 0, Dt[rg, t] -> 0, 
     Dt[rc, t] -> 0,
          Dt[?, t] -> ?d, Dt[?, t] -> ?d, 
     Dt[?, t] -> ?d, Dt[?d, t] -> ?dd, 
     Dt[?d, t] -> ?dd, Dt[?d, t] -> ?dd}];

eq? = 
  Simplify[Dt[D[EL, ?d], t] - D[EL, ?] == 
     0 /. {Dt[L1, t] -> 0, Dt[L2, t] -> 0, Dt[L3, t] -> 0, 
     Dt[L4, t] -> 0, Dt[mb, t] -> 0, Dt[m1, t] -> 0, Dt[m2, t] -> 0, 
     Dt[g, t] -> 0, Dt[rg, t] -> 0, Dt[rc, t] -> 0,
          Dt[?, t] -> ?d, Dt[?, t] -> ?d, 
     Dt[?, t] -> ?d, Dt[?d, t] -> ?dd, 
     Dt[?d, t] -> ?dd, Dt[?d, t] -> ?dd}];

eq? = 
  Simplify[Dt[D[EL, ?d], t] - D[EL, ?] == 
     0 /. {Dt[L1, t] -> 0, Dt[L2, t] -> 0, Dt[L3, t] -> 0, 
     Dt[L4, t] -> 0, Dt[mb, t] -> 0, Dt[m1, t] -> 0, Dt[m2, t] -> 0, 
     Dt[g, t] -> 0, Dt[rg, t] -> 0, Dt[rc, t] -> 0,
          Dt[?, t] -> ?d, Dt[?, t] -> ?d, 
     Dt[?, t] -> ?d, Dt[?d, t] -> ?dd, 
     Dt[?d, t] -> ?dd, Dt[?, t] -> ?dd}];


sol = Solve[{eq?, eq?, eq?}, {?dd, ?dd, ?dd}];

Thanks

POSTED BY: Varun Kulkarni
Posted 9 years ago

Once the projectile leaves the pouch, the trebuchet is no longer in the game. We then have a gravity (and air friction damping) only situation that can be solved by another differential equation. Have a look at another demonstration that handles this problem very well: Projectile with Air Drag It is possible to combine these two demonstrations and use the trebuchet output (speed, angular position,...) as input to the ballistic motion of the second demonstration. If you are interested, a very good article is: Trebuchet mechanics by D B Siano

POSTED BY: Erik Mahieu
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract