側面重心計算       側面重心.mwx
 垂直尾翼の無い鳥の形をした飛行機の安定性を計算してみよう。

 
計算する側面の形をえらびます。
を左クリックすると計算します。

<なぜ、このプログラムをつくったの?> 

垂直尾翼の無い鳥の形をしたラジコングライダーは、世界に例が無い。
だから、その安定性を考えるためのソフトも存在しない。

ならば、自分でつくるしかない。

 <どんなことがわかったか>

側面重心が30近い数字になるようにすると、垂直尾翼がなくても、安定して飛行することができることがわかった。

このていどのプログラミングで、役立つソフトができた。


 
<プログラミング>側面重心のもと.mwxを左クリックしてはじめる
   オブジェクト
 
 手順
to startup
set "Project  "showcc? "false
end

to chgrod
clean
make "bak pos
setpos [-31 -135]
setshape shape + 1 stamp
setshape shape - 1
setpos :bak
・TOP、 setpos[-512 -120]
前縁、 setpos[-512 -120]
後縁、 setpos[473 -120]
・END、 setpos[473 -120]
setChord 260
setCenterG 120
縮尺
end

to chgALBATROSS2
clean
make "bak pos
setpos [-31 -135]
setshape shape + 1 stamp
setshape shape - 1
setpos :bak
・TOP、 setpos[-581 -220]
前縁、 setpos[-259 -90]
後縁、 setpos[43 -85]
・END、 setpos[509 -122]
setChord 210
setCenterG 80
縮尺
end
to chgALBATROSS3
clean
make "bak pos
setpos [-31 -135]
setshape shape + 1 stamp
setshape shape - 1
setpos :bak
・TOP、 setpos[-550 -205]
前縁、 setpos[-255 -81]
後縁、 setpos[51 -82]
・END、 setpos[508 -137]
setChord 210
setCenterG 70
縮尺
end
to setsuperfalcon
clean
make "bak pos
setpos [-31 -135]
setshape shape + 1 stamp
setshape shape - 1
setpos :bak
・TOP、 setpos[-537 -155]
前縁、 setpos[-370 -82]
後縁、 setpos[-9 -87]
・END、 setpos[448 -131]
setChord 210
setCenterG 78
縮尺
end
to setgull
clean
make "bak pos
setpos [-31 -155]
setshape shape + 1 stamp
setshape shape - 1
setpos :bak
・TOP、 setpos[-545 -155]
前縁、 setpos[-275 -82]
後縁、 setpos[50 -87]
・END、 setpos[460 -110]
setChord 220
setCenterG 75
縮尺
end

to -SET-
縮尺
end
to setG
setCenterG round Chord * (difference (ask "重心 「xcor」) (ask "前縁 「xcor」)) / (difference (ask "後縁 「xcor」) (ask "前縁 「xcor」))
end
to 縮尺
set縮尺率 ((ask "後縁 「xcor」) - (ask "前縁 「xcor」)) / Chord
重心、 setx (ask "前縁 「xcor」) + CenterG * 縮尺率
end

to -RUN-
・TOP、 set壁の色 colorunder
開始pos
縮尺
set前モーメント 0
set後モーメント 0
測定1
測定2
setCenterSide (round 10000 * 前モーメント / (前モーメント + 後モーメント)) / 100
終了
end
to 測定1
measure、
setpos ask "・TOP [pos]
repeat (ask "重心 「xcor」) - (ask "・TOP 「xcor」) + 1

sety Y1
高さは 0
repeat Y2 - Y1 - 1

forward 1 if not colorunder = 壁の色 「pd setcolor 25 fd 0 pu set前モーメント 前モーメント + (ask "重心 「xcor」) - xcor」

setx xcor + 1

end
to 測定2
measure、
setx ask "重心 「xcor」
sety Y1
repeat  (ask "・END 「xcor」) - (ask "重心 「xcor」) + 1

sety Y1
set高さ 0
repeat Y2 - Y1 - 1

forward 1 if not colorunder = 壁の色 「pd setcolor 85 fd 0 pu set後モーメント 後モーメント + xcor - (ask "重心 「xcor」)」

setx xcor + 1

end


to 開始pos
measure、 setpos ask "・TOP 「pos」 setx xcor - 10 青高さ測定1
measure、 setpos ask "・TOP 「pos」 setx xcor - 10 青高さ測定2
end
to 青高さ測定1
forward 1 if not colorunder = 壁の色 「setY2 ycor stop」
青高さ測定1
end
to 青高さ測定2
back 1 if not colorunder = 壁の色 「setY1 ycor stop」
青高さ測定2
end

to 完了
メロディー1
stopall
end