Phun - 2D physics sandbox - forum

Official Forum

You are not logged in.

#1 2009-08-29 10:30:01

Torpedo
Respected Member
Registered: 2009-04-07
Posts: 103

Does anyone do math before phun?

I'm curious, has anyone managed to apply real life maths to a problem in phun before, or are all your solutions trial and error?

I'm just thinking spring or power equations, but the problem is they work related to mass, so if you want them to work relative to the actual figures they display, what should the mass of the parts be?


http://i11.photobucket.com/albums/a180/manmuppet/PHUNLANDSIG.jpg

Offline

 

#2 2009-08-29 10:59:27

KarateBrot
Seasoned Member
From: Germany
Registered: 2009-07-20
Posts: 86

Re: Does anyone do math before phun?

Oh yeah I sometimes try to do maths before scripting in Phun because otherwise I wouldn't know how things have to be set. For me personally it's important if I want to script things dynamical. For constant things I just try different settings and choose the best - no need of maths.

This is an example of doing maths before Phun

http://www.phunland.com/phunbox/upload/image/th/28272_Targeting_angle_test.png
Author: KarateBrot
Title: Pointer (works with torque)
File Size: 46.25 kB
Rating: http://www.phunland.com/phunbox/rating/28272
http://www.phunland.com/phunbox/theme/img/download_bar_red_part.pnghttp://www.phunland.com/phunbox/theme/img/download_bar_blue_part.png

You can see the formula for the acceleration of the motor (and i mean acceleration and not velocity of the motor). So depending on how much the angle of the pointer deviates from the angle to the block the acceleration of the motor is bigger and the pointer will be affected by a stronger force that pulls it's direction towards the block.


[Edit]
btw... look at scenes from Kilinich or someone else who uses scripting very often and is 1337 at it. You will often recognize formulas.

Last edited by KarateBrot (2009-08-29 11:02:42)


I'm not very active for a few days now because I'm making a banner and a video for a band.
http://img21.imageshack.us/img21/2531/javelinbanner1.gif

Offline

 

#3 2009-08-30 01:54:08

arinlares
Power Member
From: A place.
Registered: 2008-03-17
Posts: 3162
Website

Re: Does anyone do math before phun?

I usually do everything by eye, as this is a construction-based physics simulator, not a Thyme interpreter.  I occasionally do simple arithmetic to figure out what I need to balance a pole-arm or something, but nothing complicated.  If I want to program, I fire up IDLE.

Last edited by arinlares (2009-08-30 01:55:28)


http://i251.photobucket.com/albums/gg290/arinlares/phunsig.png
PhunBox

Will be out of town for two weeks to a month from Aug. 2nd, with possibly limited access.

Offline

 

#4 2009-08-30 08:18:18

cdh473
Respected Member
From: My house.DUHH....
Registered: 2008-10-09
Posts: 150

Re: Does anyone do math before phun?

Lol. Phun is a Thyme interpreter. This(SS-P) will be the second time I ever had to use math in Phun tongue


@arinlares: big_smile IDLE big_smile

Last edited by cdh473 (2009-08-30 08:18:33)


http://i540.photobucket.com/albums/gg327/ioncann0ns/ubd9085-1.png
Phun Snake
Well, New Egg sounds like some kind of steam-rolled hot-dino-shit-pile.

Offline

 

#5 2009-08-30 18:15:56

Conundrumer
Posting Lord
Registered: 2008-03-22
Posts: 1584

Re: Does anyone do math before phun?

I had to do quite a bit of math in Phun, to the extent where I essentially had a review in what I learned in mathematics during the last school year, while learning new concepts, such as differentiation and integration while working on the differential analyzer.
I had to review trigonometry and geometry to figure out the teeth sizes for the C-gears
Physics, a bit of trig, and lots of ratios for the mechanical ballistic computer
trig for trigonometric function modules for analog computers
Geometry for the multiplier Paradigm29 released
Lots of digital logic and binary for logic gates I've been working on
Some polar coordinate equations for stuff like my "squaring the circle" scene
thinking about making stuff for functions and parametric equations

Oh yea, lots of measuring/statistics too
Unfortunately, I don't see anyone else using Phun to demonstrate not-so-basic concepts in math and physics (and maybe other subjects)

Last edited by Conundrumer (2009-08-30 18:19:22)

Offline

 

#6 2009-08-30 20:11:10

RA2lover
Post Addict
From: Brazil
Registered: 2009-02-08
Posts: 681

Re: Does anyone do math before phun?

Some scenes where precision is seriously necessary.

Offline

 

#7 2009-08-31 14:41:09

Torpedo
Respected Member
Registered: 2009-04-07
Posts: 103

Re: Does anyone do math before phun?

KarateBrot wrote:

Oh yeah I sometimes try to do maths before scripting in Phun because otherwise I wouldn't know how things have to be set. For me personally it's important if I want to script things dynamical. For constant things I just try different settings and choose the best - no need of maths.

This is an example of doing maths before Phun

http://www.phunland.com/phunbox/upload/ … e_test.png
Author: KarateBrot
Title: Pointer (works with torque)
File Size: 46.25 kB
Rating: http://www.phunland.com/phunbox/rating/28272
http://www.phunland.com/phunbox/theme/i … d_part.pnghttp://www.phunland.com/phunbox/theme/i … e_part.png

You can see the formula for the acceleration of the motor (and i mean acceleration and not velocity of the motor). So depending on how much the angle of the pointer deviates from the angle to the block the acceleration of the motor is bigger and the pointer will be affected by a stronger force that pulls it's direction towards the block.


[Edit]
btw... look at scenes from Kilinich or someone else who uses scripting very often and is 1337 at it. You will often recognize formulas.

Thats quite neat, where did you hide half the scripting, i like taking scenes like that appart and trying to find them, but i cant find what makes scene.my.v, or scene.my.alpha lol. its a mystery!


http://i11.photobucket.com/albums/a180/manmuppet/PHUNLANDSIG.jpg

Offline

 

#8 2009-08-31 19:30:49

KarateBrot
Seasoned Member
From: Germany
Registered: 2009-07-20
Posts: 86

Re: Does anyone do math before phun?

Torpedo wrote:

Thats quite neat, where did you hide half the scripting, i like taking scenes like that appart and trying to find them, but i cant find what makes scene.my.v, or scene.my.alpha lol. its a mystery!

there are three oncollides. the first one in the center of the pointer, the second one in the center of the box and the third one behind the black rectangle that says "angular deviation". most of the scripting was done in the third one. the other two are only to get the positions and the angle of the pointer.

i named the variables like the physical variables so "scene.my.v" would be velocity (it's the velocity for the motor), "scene.my.a" is the acceleration of the motor, "scene.my.k" is only a constant so that i can change the strength /speed the pointer does its turns so if i attach the pointer to a very big mass you have to set a very small constant so that the force is strong enough to let the big mass point towards the box fast.
"scene.my.hJavelin" is the height of the pointer, "scene.my.hTarget" is the height of the box. "scene.my.sJavelin" and "scene.my.sTarget" are the widths of the two objects from the origin. (i know i could have put 2 values into one variable so there are only two position variables but at this point in time i wans't good enough at scripting to know that.
"scene.my.alpha" is the direct angle between the pointer and the box (you also could say it's the angle between the two points). There's an image in the scene (the upper one). there you can see what i mean.
"scene.my.beta" is the angle of the pointer. i need this two angles to calculate how much beta is different from alpha so that the motor can make a correction until alpha = beta. (btw: the acceleration is the difference between the two angles divided by the constant) so if the angles are the same the acceleration is 0 and the motor speed will stay the same so there is no force that pulls the pointer into a direction.

you can fell this effect in real life by turning on/off an angle grinder. as long as the disc accelerates you will notice a force in the opposite direction of the spinning circle.


I'm not very active for a few days now because I'm making a banner and a video for a band.
http://img21.imageshack.us/img21/2531/javelinbanner1.gif

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

Phun and Phunland.com is copyright of Algoryx