MTs, WM2D, and WM Basic Language Script Code
Moderator: scott
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
A while back Gregory posted some code to create an arc: viewtopic.php?p=166604#166604
At the time I thought it wasn't too useful, but I finally realized Gregory's arc tool could be used as both an inside or an outside ramp, so I modified my ramp code to create an arc and initiate it from a dialog box.
If the start angle and end angles span 360 degrees, the ramp code can be used to create a ring.
By adjusting the resolution, you can also use it to draw a hollow polygon.
The start radius and end radius can have different values to create an inward or outward spiraling ramp.
Thanks Gregory!
At the time I thought it wasn't too useful, but I finally realized Gregory's arc tool could be used as both an inside or an outside ramp, so I modified my ramp code to create an arc and initiate it from a dialog box.
If the start angle and end angles span 360 degrees, the ramp code can be used to create a ring.
By adjusting the resolution, you can also use it to draw a hollow polygon.
The start radius and end radius can have different values to create an inward or outward spiraling ramp.
Thanks Gregory!
- Attachments
-
- Draw_Ramp_V1.txt
- Draw_Ramp_V1 - A WM2D script to create a ramp, an arc, a ring, or a hollow polygon
- (18.49 KiB) Downloaded 86 times
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
A mass M is in a rotating wheel at a radius of R.
The centrifugal force vector CF always points radially outward. This causes the CF vector to have an x-component and a y-component as the wheel rotates. The direction of the CF vector is flipped when the mass is on the other side of the wheel.
The gravitational force vector GF always points straight down. It has no x-component. The y-component is always negative.
If you add the centrifugal force vector and the gravitational force vector you get a summation vector: CF + GF.
At 90 degrees (TDC) the CF vector is positive and the GF vector is negative so the sum is: ( +CF - GF) making the mass 'lighter'.
At 270 degrees (BDC) both the CF and GF vectors are negative, so the sum is: ( -CF - GF) making the mass 'heavier'.
The centrifugal force vector CF always points radially outward. This causes the CF vector to have an x-component and a y-component as the wheel rotates. The direction of the CF vector is flipped when the mass is on the other side of the wheel.
The gravitational force vector GF always points straight down. It has no x-component. The y-component is always negative.
If you add the centrifugal force vector and the gravitational force vector you get a summation vector: CF + GF.
At 90 degrees (TDC) the CF vector is positive and the GF vector is negative so the sum is: ( +CF - GF) making the mass 'lighter'.
At 270 degrees (BDC) both the CF and GF vectors are negative, so the sum is: ( -CF - GF) making the mass 'heavier'.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Here are some pictures of the CF + GF vector for Bessler's wheels for a 1 kg mass. (pictures in the collage are not scaled with each other)
The circles are the masses.
The outward pointing triangles are the end of the CF vector.
The downward pointing triangles are the end of the gravity vector.
The squares are the end of the summation vector of CF + GF.
If the square is above the circle at the 90 degree mark, the mass is weightless at TDC, otherwise it is not.
Attached is a WM2D script that draws the endpoints of the CF+GF vectors. The script does nothing other than to draw a picture based on user inputs of mass, radius, and angular velocity.
The circles are the masses.
The outward pointing triangles are the end of the CF vector.
The downward pointing triangles are the end of the gravity vector.
The squares are the end of the summation vector of CF + GF.
If the square is above the circle at the 90 degree mark, the mass is weightless at TDC, otherwise it is not.
Attached is a WM2D script that draws the endpoints of the CF+GF vectors. The script does nothing other than to draw a picture based on user inputs of mass, radius, and angular velocity.
- Attachments
-
- CF_Plus_GF_Vector_Calcs.TXT
- WM2D script that draws the CF+GF vector for Bessler's wheels.
- (11.36 KiB) Downloaded 77 times
Last edited by Wubbly on Tue Dec 03, 2019 2:26 pm, edited 1 time in total.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
CF + GF The two mass problem.
So the question becomes: Can a lighter mass lift a heavier mass, raising the GPE of the two mass system?
And the answer is: Of course.
It's very easy to do this.
It's very easy to show it mathematically.
It's very easy to understand.
It uses the CF + GF vector and that fact that the sign of the CF vector flips on the other side of the wheel while the sign of the GF vector stays the same.
At the top of the wheel CF is positive and GF is negative so the sum is (CF - GF), making the mass lighter.
At the bottom of the wheel CF is negative and GF is negative so the sum is (-CF -GF), making the mass heavier.
If you have a larger, heavier mass at 90 degrees (TDC) and a smaller, lighter mass at 270 degrees (BDC), at some angular velocity the 'weight' of the lighter mass will be equal to the 'weight' of the heavier mass. Above that angular velocity, the lighter mass will be 'heavier' than the heavy mass. If each mass moves the same radial distance away from the center (top mass moves up, bottom mass moves down), this will create a positive GPE differential, raising the COM of the system.
It's easy enough to calculate the breakeven angular velocity where the magnitude of the CF+GF vector of the light mass and the heavy mass are equal. (see attached figure).
Above that angular velocity the lighter mass should be able to 'lift' the heavier mass.
However, to accelerate the heavy mass upward would require an angular velocity somewhat greater than the breakeven angular velocity.
So the question becomes: Can a lighter mass lift a heavier mass, raising the GPE of the two mass system?
And the answer is: Of course.
It's very easy to do this.
It's very easy to show it mathematically.
It's very easy to understand.
It uses the CF + GF vector and that fact that the sign of the CF vector flips on the other side of the wheel while the sign of the GF vector stays the same.
At the top of the wheel CF is positive and GF is negative so the sum is (CF - GF), making the mass lighter.
At the bottom of the wheel CF is negative and GF is negative so the sum is (-CF -GF), making the mass heavier.
If you have a larger, heavier mass at 90 degrees (TDC) and a smaller, lighter mass at 270 degrees (BDC), at some angular velocity the 'weight' of the lighter mass will be equal to the 'weight' of the heavier mass. Above that angular velocity, the lighter mass will be 'heavier' than the heavy mass. If each mass moves the same radial distance away from the center (top mass moves up, bottom mass moves down), this will create a positive GPE differential, raising the COM of the system.
It's easy enough to calculate the breakeven angular velocity where the magnitude of the CF+GF vector of the light mass and the heavy mass are equal. (see attached figure).
Above that angular velocity the lighter mass should be able to 'lift' the heavier mass.
However, to accelerate the heavy mass upward would require an angular velocity somewhat greater than the breakeven angular velocity.
re: MTs, WM2D, and WM Basic Language Script Code
Good Analysis Wubbly
Now what about using the GF+CF to adjust mass distribution around the rim as <Silent> is studying?
All the Best
Now what about using the GF+CF to adjust mass distribution around the rim as <Silent> is studying?
All the Best
[MP] Mobiles that perpetuate - external energy allowed
Re: re: MTs, WM2D, and WM Basic Language Script Code
Hi Wubbly,Wubbly wrote:A while back Gregory posted some code to create an arc: viewtopic.php?p=166604#166604
At the time I thought it wasn't too useful, but I finally realized Gregory's arc tool could be used as both an inside or an outside ramp, so I modified my ramp code to create an arc and initiate it from a dialog box.
If the start angle and end angles span 360 degrees, the ramp code can be used to create a ring.
By adjusting the resolution, you can also use it to draw a hollow polygon.
The start radius and end radius can have different values to create an inward or outward spiraling ramp.
Thanks Gregory!
My pleasure! It's good that you found a use for that little code. At the time I used it to draw different cam segments, geneva wheel parts and stuff.
I tried to run your script, but it's saying there is an error at line 329.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Line 329 is the middle line here:
gEndAngleDeg = CDbl(MyDialog.TB_EndAngleDeg)
gStartRadius = CDbl(MyDialog.TB_StartRadius)
gEndRadius = CDbl(MyDialog.TB_EndRadius)
Seems odd that it only had a problem there. If it's the CDbl statement, then it would have had a problem with the line before also.
TB_StartRadius is defined in the dialog box here:
TextBox 168, 41, 36, 12, .TB_StartRadius
and gStartRadius is defined up top:
Dim gStartRadius As Double
I wouldn't think gStartRadius is any kind of reserved word.
I downloaded the version from BW that got uploaded and reran it on my machine. Seems to run fine.
Does it run with the defaults or did the error occur after you changed inputs?
Are you in the US and use decimal points in numbers instead of the commas some countries use?
Textbox inputs are all strings. If the error is in the CDbl command, it can't convert the string into a double. If that's the case, try it with numbers with no decimal points (or commas if you're in Europe) and see if it runs. The start radius default for the dialog box is the string "1" that it converts into a double precision 1.
Did you accidentally edit the file?
Are you sure it's line 329 because if it's the CDbl command, then lines 328 and 327 should have given you problems as well.
gEndAngleDeg = CDbl(MyDialog.TB_EndAngleDeg)
gStartRadius = CDbl(MyDialog.TB_StartRadius)
gEndRadius = CDbl(MyDialog.TB_EndRadius)
Seems odd that it only had a problem there. If it's the CDbl statement, then it would have had a problem with the line before also.
TB_StartRadius is defined in the dialog box here:
TextBox 168, 41, 36, 12, .TB_StartRadius
and gStartRadius is defined up top:
Dim gStartRadius As Double
I wouldn't think gStartRadius is any kind of reserved word.
I downloaded the version from BW that got uploaded and reran it on my machine. Seems to run fine.
Does it run with the defaults or did the error occur after you changed inputs?
Are you in the US and use decimal points in numbers instead of the commas some countries use?
Textbox inputs are all strings. If the error is in the CDbl command, it can't convert the string into a double. If that's the case, try it with numbers with no decimal points (or commas if you're in Europe) and see if it runs. The start radius default for the dialog box is the string "1" that it converts into a double precision 1.
Did you accidentally edit the file?
Are you sure it's line 329 because if it's the CDbl command, then lines 328 and 327 should have given you problems as well.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Attached is a spreadsheet that calculates the breakeven angular velocity for a given set of inputs:
Top mass: M1, R1
Bottom Mass: M2, R2
Distance lifted or dropped: D
It calculates the breakeven angular velocity where m1's CF+GF is equal to m2's CF+GF, and the maximum potential energy gain.
It also produces a graph plotting the CF + GF for m1 and m2 based on an increasing angular velocity. Where the two lines cross is the angular velocity at which m2 is now 'heavier' than m1 and it can start to lift m1.
The blue line is M1 (or the Cart). It starts out heavier than m2 and gets lighter as the wheel increases speed.
The red line is M2 (or the Horse). It starts out lighter than m1 and gets heavier as the wheel increases speed.
For example, set
m1 = 2 kg and r1 = 0.5 meters
m2 = 1 kg and r2 = 1 meter
d = 0.1 meter
In this configuration, the system center of mass is at the center of rotation.
If the heavy mass moves up 0.1 meters, and the lighter mass moves down 0.1 meters, this creates a GPE gain of 1 Joule.
Top mass: M1, R1
Bottom Mass: M2, R2
Distance lifted or dropped: D
It calculates the breakeven angular velocity where m1's CF+GF is equal to m2's CF+GF, and the maximum potential energy gain.
It also produces a graph plotting the CF + GF for m1 and m2 based on an increasing angular velocity. Where the two lines cross is the angular velocity at which m2 is now 'heavier' than m1 and it can start to lift m1.
The blue line is M1 (or the Cart). It starts out heavier than m2 and gets lighter as the wheel increases speed.
The red line is M2 (or the Horse). It starts out lighter than m1 and gets heavier as the wheel increases speed.
For example, set
m1 = 2 kg and r1 = 0.5 meters
m2 = 1 kg and r2 = 1 meter
d = 0.1 meter
In this configuration, the system center of mass is at the center of rotation.
If the heavy mass moves up 0.1 meters, and the lighter mass moves down 0.1 meters, this creates a GPE gain of 1 Joule.
- Attachments
-
- CF_Plus_GF Calcs_Part2.xls
- CF + GF calcs Part 2. Breakeven angular velocity calculator for m1 (cart) and m2 (horse)
- (164.5 KiB) Downloaded 113 times
Last edited by Wubbly on Thu Dec 05, 2019 12:56 am, edited 1 time in total.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
The MT005, MT011, and MT141 simulations all had the capability to connect opposing weights and give them different mass values. What the sims did not have was a control mechanism to control when the masses moved.
If you add ramps to control when the masses are allowed to extend and retract, you can run the simulations and see what happens.
Attached is MT005 simulation with ramps.
If you build the simulation with more than 1 mass pair, before you run it you will need to anchor the background wheel and manually reposition the weights so they are not overlapping the ramps. You can also turn on system COM if desired.
Mass M1 will do a kiiking maneuver where it lifts at around the top of the wheel. But it needs energy to do this maneuver, so mass M2 will be on the opposite side of the wheel and will do a ‘reverse kiiking’ maneuver. As the lighter m2 reverse kiikes downward, it will (hopefully) lift the heavier m1 upward using the additional kick from centrifugal force that helps both masses.
If you add ramps to control when the masses are allowed to extend and retract, you can run the simulations and see what happens.
Attached is MT005 simulation with ramps.
If you build the simulation with more than 1 mass pair, before you run it you will need to anchor the background wheel and manually reposition the weights so they are not overlapping the ramps. You can also turn on system COM if desired.
Mass M1 will do a kiiking maneuver where it lifts at around the top of the wheel. But it needs energy to do this maneuver, so mass M2 will be on the opposite side of the wheel and will do a ‘reverse kiiking’ maneuver. As the lighter m2 reverse kiikes downward, it will (hopefully) lift the heavier m1 upward using the additional kick from centrifugal force that helps both masses.
- Attachments
-
- MT005_V2_Simulation Ramps.TXT
- MT005 V2 Simulation - A WM2D script to build an MT005 with ramps.
- (42.91 KiB) Downloaded 81 times
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Attached is MT011 simulation with ramps.
I had high hopes for MT011. This one ran much differently in my head where it accelerated and was a runner. When I asked Mr. Simulator his opinion, he did not agree with the fantasy in my head.
If you use more than one mass pair, you will have to manually adjust the weights so they don’t overlap the ramps before running.
I had high hopes for MT011. This one ran much differently in my head where it accelerated and was a runner. When I asked Mr. Simulator his opinion, he did not agree with the fantasy in my head.
If you use more than one mass pair, you will have to manually adjust the weights so they don’t overlap the ramps before running.
- Attachments
-
- MT011_V3 Simulation Ramps.TXT
- MT-11 Simulation V3 - WM2D script that builds an MT-11 simulation with ramps.
- (47.81 KiB) Downloaded 84 times
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Attached is MT141 simulation with ramps for extend/retract control of the masses.
The ramps on this one were a little easier since the masses are connected mechanically and you only need one set of ramps to control both masses.
This one was another disappointment, but after MT005 and MT011 failed to produce, this one wasn’t expected to do much better, even though I had high hopes for it initially.
One day it was making WM2D go 'poof' and disappear. Another day it would lock up at a certain point. This was was finnicky. With the geometry you have to add a spacer to the bottom ramp so it can rotate all the way around.
The ramps on this one were a little easier since the masses are connected mechanically and you only need one set of ramps to control both masses.
This one was another disappointment, but after MT005 and MT011 failed to produce, this one wasn’t expected to do much better, even though I had high hopes for it initially.
One day it was making WM2D go 'poof' and disappear. Another day it would lock up at a certain point. This was was finnicky. With the geometry you have to add a spacer to the bottom ramp so it can rotate all the way around.
- Attachments
-
- MT141_ModelB V2 Simulation Ramps.TXT
- MT-141 Model B V2 simulation with ramps. WM2D script to create the simulation.
- (43.36 KiB) Downloaded 94 times
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Some of my last posts might have been a little confusing.
If M1 is the Cart mass, and M2 is the Horse mass, the CF+GF vector for the Cart mass at 90, has to be greater than the CF+GF vector of the Horse mass at 270.
If you take the actual value, the Cart mass is greater (because it's a less negative number).
But if you take the magnitude of the vector (which is the absolute value of the vector), the Horse mass has a larger magnitude.
example:
cart > horse
-5 > -10
but
absolute value(cart) < absolute value(horse)
absolute value(-5) < absolute value(-10)
I might have said it backwards in some of the previous posts.
If M1 is the Cart mass, and M2 is the Horse mass, the CF+GF vector for the Cart mass at 90, has to be greater than the CF+GF vector of the Horse mass at 270.
If you take the actual value, the Cart mass is greater (because it's a less negative number).
But if you take the magnitude of the vector (which is the absolute value of the vector), the Horse mass has a larger magnitude.
example:
cart > horse
-5 > -10
but
absolute value(cart) < absolute value(horse)
absolute value(-5) < absolute value(-10)
I might have said it backwards in some of the previous posts.
- Wubbly
- Aficionado
- Posts: 727
- Joined: Sat Jun 06, 2009 2:15 am
- Location: A small corner of the Milky Way Galaxy
- Contact:
re: MTs, WM2D, and WM Basic Language Script Code
Conclusions:
So why didn't the CF + GF hypothesis work?
If you can use a small mass to lift a heavier mass to create a gravitational potential energy gain, why didn't the sims keep accelerating?
On the way out, CF was your friend and was making the PE gain possible.
On the way back, CF is your enemy and fights you as you try to retract the masses.
The faster the wheel is spinning, the harder it is to reset the system, but you only get a fixed amount of PE energy gain.
If you look at the last tab of the CF_Plus_GF_Part2 spreadsheet, it calculates a rough estimate of the reset energy required to pull the masses back into position.
This is an estimate of reset energy in a horizontal plane. In reality, the reset energy will be greater than the estimate because gravity is adding to the 'weight' of the larger mass (from 180 to 270), making that mass harder to reset, but is subtracting from the 'weight' of the lighter mass (from 0 to 90) making that mass easier to reset. The larger mass would dominate the fight.
The last tab of the spreadsheet plots the energy gain as zero up until the breakeven angular velocity, then it kicks up to the max GPE gain and stays there. If you compare the two graphs of energy gain and reset energy, you can see that the reset energy is always more than the energy gain.
The ramps seem to drain energy out of the system. Maybe this is where the reset energy is going? When the masses hit the ramps during parts of the rotation you could see the angular velocity of the wheel take a hit to the downside.
So to cheer myself up after that failure, I'll have to listen some music.
Dan + Shay and Bieber "Ten Thousand Hours" (not that I'm a bieber fan)
https://www.youtube.com/watch?v=LnHZ7_1_LVE
So why didn't the CF + GF hypothesis work?
If you can use a small mass to lift a heavier mass to create a gravitational potential energy gain, why didn't the sims keep accelerating?
On the way out, CF was your friend and was making the PE gain possible.
On the way back, CF is your enemy and fights you as you try to retract the masses.
The faster the wheel is spinning, the harder it is to reset the system, but you only get a fixed amount of PE energy gain.
If you look at the last tab of the CF_Plus_GF_Part2 spreadsheet, it calculates a rough estimate of the reset energy required to pull the masses back into position.
This is an estimate of reset energy in a horizontal plane. In reality, the reset energy will be greater than the estimate because gravity is adding to the 'weight' of the larger mass (from 180 to 270), making that mass harder to reset, but is subtracting from the 'weight' of the lighter mass (from 0 to 90) making that mass easier to reset. The larger mass would dominate the fight.
The last tab of the spreadsheet plots the energy gain as zero up until the breakeven angular velocity, then it kicks up to the max GPE gain and stays there. If you compare the two graphs of energy gain and reset energy, you can see that the reset energy is always more than the energy gain.
The ramps seem to drain energy out of the system. Maybe this is where the reset energy is going? When the masses hit the ramps during parts of the rotation you could see the angular velocity of the wheel take a hit to the downside.
So to cheer myself up after that failure, I'll have to listen some music.
Dan + Shay and Bieber "Ten Thousand Hours" (not that I'm a bieber fan)
https://www.youtube.com/watch?v=LnHZ7_1_LVE
re: MTs, WM2D, and WM Basic Language Script Code
Thank you for your extensive CF + GF analysis, Wubbly.
........................¯\_(ツ)_/¯
¯\_(ツ)_/¯ the future is here ¯\_(ツ)_/¯
Advocate of God Almighty, maker of heaven and earth and redeemer of my soul.
Walter Clarkson
© 2023 Walter W. Clarkson, LLC
All rights reserved. Do not even quote me w/o my expressed written consent.
¯\_(ツ)_/¯ the future is here ¯\_(ツ)_/¯
Advocate of God Almighty, maker of heaven and earth and redeemer of my soul.
Walter Clarkson
© 2023 Walter W. Clarkson, LLC
All rights reserved. Do not even quote me w/o my expressed written consent.