Pentacles

General FreeBASIC programming questions.
Post Reply
Richard
Posts: 3096
Joined: Jan 15, 2007 20:44
Location: Australia

Re: Pentacles

Post by Richard »

We have it easy here in Tasmania, the rock at the far end, of the far end, of the Earth. The best defence for a castle is a moat. We have the Torres Strait to the North of Australia, then the Bass Strait between the mainland and Tasmania. New Zealand has the Tasman Sea. I feel sorry for countries on continents with porous internal borders, or stupid leaders.

Everything here got locked down and funded by the Australian federal government, working from home got going, and little bubbles of functionality were formed for essential services.

14 days in quarantine for returning passengers now seems to work OK. Unused mining camps make for excellent quarantine centres as they have separate cabins with individual air conditioning. That's bubbles inside bubbles, and those who test positive are moved to treatment isolation. There is a 3 to 7 day local lockdown when needed on the Australian mainland, to give the testers and trackers time to catch up and outrun the spread, usually when it escapes from a quarantine hotel bubble.

In Tasmania we originally had returning cruise ship passengers bring Covid into the state where it spread locally until the hard lockdown. Then the army took over running a hospital and two old peoples homes in the NW corner of the state, for a month. In Tasmania, where the population is about half a million, it is now over 365 days since there was a person-to-person Covid infection. We have it easy.

Flights between Australian cities have been functioning cautiously for a couple of months. Direct flights across the Tasman Sea to New Zealand started again last week. So the Australian and NZ bubbles have now merged into one big business and tourist bubble, with face masks in transit, and precautionary testing and tracking at the old boundaries.

Due to quarantine and isolation capacity, Australia has just cut flights from India for the less than 10 thousand Australians wanting to return. Meanwhile the army is air freighting the spare ventilator stock to India where it will be used.

The death toll for the last month in Australia has been minimised. There was one death from vaccine complications and a sick VIP flown in from PNG died. There are now more deaths in custody of indigenous people than there are deaths from Covid in the whole country, which is an interesting political problem to see again.

It is both sad and humbling to watch the international news, to appreciate how good we have it in Australia.
dodicat
Posts: 8168
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Pentacles

Post by dodicat »

I suppose indigenous people is a whole huge debate in your islands, we are too far away, although we are a guilty nation historically.
I have had two jabs, but in no way bullet proof.
Some of the Scottish Islands held out well, although they cannot make their own laws.
The Isle of Man has it's own laws and held out well until recently.
But things are easing up, whether due to the vaccinations or the lockdowns nobody can say for sure, not even the boffins.
These plagues and lurgies have been going on for centuries of course, but we are spreading around so much pollution/poison the whole biosphere is sick and probably dying.
My own 72 years has seen the biggest plunge (mass extinction e.t.c.) , an asteroid couldn't do a better job.
Here are some old clickable bubbles.

Code: Select all


Type Pt
    As Single x,y
End Type

Type Circle
    As pt p(Any)
    As pt ctr
    As Single dx,dy
    As Long rad
    Declare Sub init(As Single,As Single,As Long,As Single,As Single)
End Type

Sub circle.init(xp As Single,yp As Single,r As Long,ddx As Single,ddy As Single)
    ctr.x=xp
    ctr.y=yp
    rad=r
    dx=ddx
    dy=ddy
End Sub

Sub arraydelete(a() As circle,index As Long)
    If index>=Lbound(a) And index<=Ubound(a) Then
        For x As Integer=index To Ubound(a)-1
            a(x)=a(x+1)
        Next x
        Redim Preserve a(Lbound(a) To Ubound(a)-1)
    End If
End Sub

#define incircle(cx,cy,radius,x,y) (cx-x)*(cx-x) +(cy-y)*(cy-y)<= radius*radius

Sub create(xm As Single, ym As Single, r As long,p As Circle)
    #define CIRC(r)  ( ( Int( (r)*(1 + Sqr(2)) ) - (r) ) Shl 2 )
    Dim As Long x = -r, y = 0, e = 2 - r Shl 1
    Dim As Long count=-1
    Redim p.p(CIRC(r)+4-1)
    Do
        count+=1:p.p(count)=Type<pt>(xm-x, ym+y)
        count+=1:p.p(count)=Type<pt>(xm-y, ym-x)
        count+=1:p.p(count)=Type<pt>(xm+x, ym-y)
        count+=1:p.p(count)=Type<pt>(xm+y, ym+x)
        r = e
        If r<=y Then
            y+=1
            e+=y Shl 1+1
        End If
        If r>x Or e>y Then
            x+=1
            e+=x Shl 1+1
        End If
    Loop While x<0
    Redim Preserve p.p(count)
    p.ctr=Type(xm,ym)
End Sub

Sub show Overload(p() As pt,c As Ulong)
    For n As Long=Lbound(p) To Ubound(p)
        Pset(p(n).x,p(n).y),c
    Next
End Sub

Sub show Overload(p As Circle,c As Ulong)
    For n As Long=Lbound(p.p) To Ubound(p.p)
        Pset(p.p(n).x,p.p(n).y),c
    Next
End Sub

Function rim(c() As Circle,ret() As pt) As Long
    Redim ret(0)
    For n1 As Long=Lbound(c) To Ubound(c)-1
        For n2 As Long=n1+1 To Ubound(c)
            For n As Long=Lbound(c(n1).p) To Ubound(c(n1).p)
                If incircle(c(n2).ctr.x,c(n2).ctr.y,c(n2).rad,c(n1).p(n).x,c(n1).p(n).y) Then
                    Redim Preserve ret(1 To Ubound(ret)+1)
                    ret(Ubound(ret))=c(n1).p(n)
                End If
            Next n
            For n As Long=Lbound(c(n2).p) To Ubound(c(n2).p)
                If incircle(c(n1).ctr.x,c(n1).ctr.y,c(n1).rad,c(n2).p(n).x,c(n2).p(n).y) Then
                    Redim Preserve ret(1 To Ubound(ret)+1)
                    ret(Ubound(ret))=c(n2).p(n)
                End If
            Next n
        Next n2
    Next n1
    Return 0
End Function

Sub advance(c As Circle)
    c.ctr.x+=c.dx
    c.ctr.y+=c.dy
    create(c.ctr.x,c.ctr.y,c.rad,c)
    If c.ctr.x<c.rad Or c.ctr.x>1024-c.rad Then c.dx=-c.dx
    If c.ctr.y<c.rad Or c.ctr.y>768-c.rad Then c.dy=-c.dy
End Sub

Function Regulate(Byval MyFps As long,Byref fps As long) As long
    Static As Double timervalue,lastsleeptime,t3,frames
    frames+=1
    If (Timer-t3)>=1 Then t3=Timer:fps=frames:frames=0
    Var sleeptime=lastsleeptime+((1/myfps)-Timer+timervalue)*1000
    If sleeptime<1 Then sleeptime=1
    lastsleeptime=sleeptime
    timervalue=Timer
    Return sleeptime
End Function


Screen 20,32
Color ,Rgb(0,0,100)
'setup
reDim As Circle c1(1 To 25)
dim as long fps
For n As Long=Lbound(c1) To Ubound(c1)
    Randomize
    Dim As Single dx,dy
    Do
        dx=Rnd*2-Rnd*2
    Loop Until Abs(dx)>1
    Do
        dy=Rnd*2-Rnd*2
    Loop Until Abs(dy)>1 
    c1(n).init(1024\2,768\2,15+Rnd*50,dx,dy)
Next n
Redim As pt r()
dim as long mx,my,btn,flag
Do
      getmouse mx,my,,btn
    For n As Long=Lbound(c1) To Ubound(c1)
        advance(c1(n))
      
        if btn and flag=0 then
              if incircle(c1(n).ctr.x,c1(n).ctr.y,c1(n).rad,mx,my) then arraydelete(c1(),n):exit for
              end if 
    Next
    flag=1
    rim(c1(),r())
    Screenlock
    Cls
    draw string(20,20),"FPS = " &fps
    For n As Long=Lbound(c1) To Ubound(c1)
        show(c1(n),Rgb(255,255,255))
    Next
    show(r(),Rgb(0,0,100))
    Screenunlock
    Sleep regulate(60,fps),1
    flag=btn
Loop Until Len(Inkey)
Sleep


 
Richard
Posts: 3096
Joined: Jan 15, 2007 20:44
Location: Australia

Re: Pentacles

Post by Richard »

@dodicat. Those bubbles are infectious.
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Pentacles

Post by albert »

Hello Guys!!

I'm working on an air-foil simulator..

How do you calculate the drag-coefficient of curved and angled surfaces??
I need to know ; how many pounds of force , the curved or angled surface develops , at wind speed "x"

For a curved surface , you'd need to dissect the curve into smaller bits and add them all up...
So , a six inch thick wing , might have a 2 inch flat surface at the leading edge , below and above the curve.
Then you'd take the curves into 1 inch sections and calculate the force on that inch of slope..
And add them all up , to get the total pound force , developed by the curve or slope.

So to calculate the force on a 22 degree section..
i think you'd take the weight of air and speed of the air , and use Newtons E = MV^2.. But how would you turn E into pounds of force??

If you take a 4x8 sheet of plywood and blow a 5 mph wind on it , it develops x pounds of force..
If you angle it , a 22 degrees that makes it less than 4 foot of frontage.. each degree of slope lowers the frontal area , and decreases the total wind force..

Once the wind has gone over the max slope of the upper slice of the wing..
Then there's a down slope or curve , that generates lift , by the Bernulli effect ( vaccume ).. on the back slope of the wing..
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Pentacles

Post by jj2007 »

albert wrote:How do you calculate the drag-coefficient of curved and angled surfaces??
Google is your friend.
Then there's a down slope or curve , that generates lift , by the Bernulli effect ( vaccume ).. on the back slope of the wing..
The spelling is Bernoulli. See https://physics.stackexchange.com/quest ... -on-bernou for the latest state of the art.
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Pentacles

Post by albert »

With commercial jets:

They have a fixed wing that's set to provide x pounds of lift at speed ( 640 MPH )

To take off at a lower speed they need to deploy flaps , to get the necessary lifting power..
Likewise , when they come in for a landing , and have to slow down to touchdown , they need to deploy flaps to stay in the air at the lower speeds.

The flaps do two things..

1) They increase the Bernoulli effect of the upper half of the wing
2) They provide a kite-like lifting effect , on the lower side of the wing..

With my ideas , you'd have adjustable wings!! That could lift a jet at any speed you'd want to travel at.. Without flaps...

A lot of plane crashes happen that way...
The manual says the plane has a stall speed of 80 MPH.
And then they add 500 pounds of cargo , and the stall speed goes up to 100 MPH , and they think its safe to go 90 MPH , and crash...
Every pound of weight you add to the plane , increases the stall speed..
They calculate the stall speed , as to how fast you need to go to lift off with an empty plane , with full fuel tanks . and a single 200 pound pilot..
Every other amount of weight you add increases the stall speed.. ( minimum lift off speed. )
Last edited by albert on May 02, 2021 23:43, edited 4 times in total.
dodicat
Posts: 8168
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Pentacles

Post by dodicat »

This was not long after the Wright brothers.
viewtopic.php?f=3&t=16207&p=149527&hili ... 2A#p149527
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Pentacles

Post by albert »

@Dodicat
@Richard

How do you turn E = MV^2 into pounds of force???

If i have air that weighs x and travels at speed y , E = weight * speed ^ 2

How do you turn E into pounds of force?

Is E = ( ( weight * speed ) ^2 ) or is E = ( weight ) * ( speed ^ 2 ) ???
Richard
Posts: 3096
Joined: Jan 15, 2007 20:44
Location: Australia

Re: Pentacles

Post by Richard »

albert wrote: @Richard
How do you turn E = MV^2 into pounds of force???
You don't.
For the wing at a particular angle of attack you find the lift coefficient Cl, and the drag coefficient Cd.
Where the density of air is d, and the speed is v, the forces of lift and drag are;
Flift = Cl * d * v²
Fdrag = Cd * d * v²
caseih
Posts: 2169
Joined: Feb 26, 2007 5:32

Re: Pentacles

Post by caseih »

albert wrote:With my ideas , you'd have adjustable wings!! That could lift a jet at any speed you'd want to travel at.. Without flaps...
Adjustable wings are good ideas. In fact that's exactly what flaps and slats do. They modify the airfoil shape to be more effective at lower speeds and altitudes by increasing the camber which dramatically increases lift. Some aircraft adjust their wing shape by swinging the wings back to change their drag and lift, for example the F-14 tomcat. There is currently research being done into wings that can change their shape by warping (which kind of hearkens back to how the Wright brothers controlled their airplanes), or using memory metals to deform with electricity. The advantage of wing warping over traditional control surfaces and flaps, spoilers, and slats, is less drag because there's no discontinuity of the surface of the wing.

At one time my hobby was flying model aircraft, some of which I built myself. You might enjoy that hobby, although the gov't seems quite determined to destroy the hobby because terrorists or something.
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Pentacles

Post by albert »

@caseih

My idea is to have a perfect air-foil.. with a flexible plastic leading edge..

Then you can have pistons adjust the curvature of the upper and lower half's to provide the necessary stall speed...

Then you can adjust the height of the wing.. to provide more lift at higher weights or make the wing thinner for lower weights..

So at altitude , the wings can thin out for higher speeds , and at lower alidtudes the wing can beef up for slower speeds.
caseih
Posts: 2169
Joined: Feb 26, 2007 5:32

Re: Pentacles

Post by caseih »

Yes. Of course the main issue is keeping the wing strong but light weight. Hence the research into using memory metals that change shape with electricity.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Pentacles

Post by jj2007 »

caseih wrote:Yes. Of course the main issue is keeping the wing strong but light weight. Hence the research into using memory metals that change shape with electricity.
Interesting, I always thought memory metals were too weak for that. Do you have a link to such research? Here is one to the NASA SAW project.
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Pentacles

Post by albert »

So in your wing , you would have your main beam , with pistons built into it.

The pistons can rise up and increase the height of the wing.
Then you have another piston on the front leading edge to warp the leading edge into a different curves shapes..

The the plane can get on a scale at the start of the runway and get weighed and the pilots can dial in the weight..
And the wings would adjust \ warp , so that the plane can take off , at whatever speed they want to..

A longer runway , they can set the wings thinner.. For a faster takeoff
A shorter runway they can set the wings thicker.. For a slower take off

It would give you an adjustable stall speed..
Might come in handy in the event of a power failure , they can set the wings to the max height and leading edge camber to glide in for a slow landing...
No more deaths in a plane crash..
caseih
Posts: 2169
Joined: Feb 26, 2007 5:32

Re: Pentacles

Post by caseih »

jj2007 wrote:
caseih wrote:Yes. Of course the main issue is keeping the wing strong but light weight. Hence the research into using memory metals that change shape with electricity.
Interesting, I always thought memory metals were too weak for that. Do you have a link to such research? Here is one to the NASA SAW project.
Could be that one that I remember reading about. some years back.
Post Reply