The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

New Blog Up: Projectile Motion
Message #1 Posted by Eddie W. Shore on 15 Mar 2012, 9:12 a.m.

Projectiles - A Realistic Point of View (Linear Drag)

Eddie's Math and Calculator Blog

A challenge for the programmers here perhaps, make an RPN/RPL version. (I used a Casio Prizm for this blog)

      
Re: New Blog Up: Projectile Motion
Message #2 Posted by Gilles Carpentier on 15 Mar 2012, 7:00 p.m.,
in response to message #1 by Eddie W. Shore

On HP50G/RPL, Simple Projectile Motion to begin :


 '(v0*t*COS(a),v0*t*SIN(a)-g/2*t^2)' 'EQ' STO
 { (0,0) (430, 80) { t 0 20 } 0 { (0,0) {10 10} } PARAMETRIC Y } 'PPAR' STO
 ERASE
 DO
  {'v0','a','g'}  
  "Choose parameters or CANCEL" 
    OVER S~N
    {1 3}
    {67, 35, 9.80665} DUP
  INFORM 
  NOT { DROP KILL } IFT
  SWAP STO
  DRAX DRAW {} PVIEW
 UNTIL 0 END 

'a' for 'theta' symbol.

Screen shot :

Note that, like with the Prizsm program, Hscale is different of Vscale. You may change the PPAR parameters to avoid distortion (to match the screen resolution)

Edited: 15 Mar 2012, 8:00 p.m.

            
Re: New Blog Up: Projectile Motion
Message #3 Posted by Pal G. on 16 Mar 2012, 4:41 p.m.,
in response to message #2 by Gilles Carpentier

Nice post. Thanks..

      
Re: New Blog Up: Projectile Motion
Message #4 Posted by hpnut on 15 Mar 2012, 9:19 p.m.,
in response to message #1 by Eddie W. Shore

Thanks, Eddie. nice blog :-)

      
Re: New Blog Up: Projectile Motion
Message #5 Posted by Gilles Carpentier on 16 Mar 2012, 5:01 a.m.,
in response to message #1 by Eddie W. Shore

Hi,

I don't understand what are the values that follows the LBL here :

Menu "Temperature","104F/40C",A,"95F/35C",B, "86F/30C",C,"77F/25C",D, "68F/20C",E,"59F/15C",F, "50F/10C",G,"41F/5C",H, "32F/0C",I Lbl A : 1.1839 → P : Goto Z Lbl B : 1.2041 → P : Goto Z Lbl C : 1.2250 → P : Goto Z Lbl D : 1.2466 → P : Goto Z Lbl E : 1.2690 → P : Goto Z Lbl F : 1.2920 → P : Goto Z Lbl G : 1.3163 → P : Goto Z Lbl H : 1.3413 → P : Goto Z Lbl I : 1.3943 → P : Goto Z

Are they the result of : ρ = P / (R T) ≈ 352.9774471/T ?

I don't found the same values but 1.1922 for 0C for example...

Edited: 16 Mar 2012, 5:42 a.m.

      
Re: New Blog Up: Projectile Motion
Message #6 Posted by Gilles Carpentier on 16 Mar 2012, 7:15 p.m.,
in response to message #1 by Eddie W. Shore

HP50 : A More Realisitc View of Projectile Motion :

Reference :
Eddie's Blog
Balistique - trajectoire d'un projectile - Universit de Clermont Ferrand .DOC

 
 '
  (
   COS(a)*m*v0*(EXP(k*t/m)-1)*EXP(-k*t/m)/k ,
   -m*(((g*k*t-SIN(a)*k*v0-g*m)*EXP(k*t/m)+SIN(a)*k*v0+g*m)*EXP(-(k*t)/m))/k^2
  )
 ' 
 'EQ' STO
 { (0,0) (180, 50) { t 0 20 } 0 { (0,0) {10 10} } PARAMETRIC Y } 'PPAR' STO
 ERASE 

DO

"Choose object" { { "Baseball" { .3 .145 .041043 }} { "Tennis ball" { .6 .057 .003381 }} { "Golf Ball" { .4 .045 .001385 }} } 1 CHOOSE NOT { KILL } IFT { 'c' 'm' 's' } STO

{'v0','a','g'} "Choose parameters or CANCEL" OVER S~N {1 3} {67, 35, 9.80665} DUP INFORM NOT { KILL } IFT SWAP STO

"Temprature" { { "40" 1.1839 } { "35" 1.2041 } { "30" 1.2250 } { "25" 1.2466 } { "20" 1.2690 } { "15" 1.2920 } { "10" 1.3163 } { "5" 1.3413 } { "0" 1.3943 } } 4 CHOOSE NOT { KILL } IFT 'p' STO

'm*g/(√((2*m*g)/(c*p*s))' EVAL 'k' STO

DRAX DRAW {} PVIEW

UNTIL 0 END

            
Re: New Blog Up: Projectile Motion
Message #7 Posted by bill platt on 16 Mar 2012, 11:19 p.m.,
in response to message #6 by Gilles Carpentier

Very nice--especially with l'accent aigu :-) (how do you do that on 48G anyway?)

                  
Re: New Blog Up: Projectile Motion
Message #8 Posted by Gilles Carpentier on 17 Mar 2012, 9:02 a.m.,
in response to message #7 by bill platt

You mean 'how to produce "accent aigu" and so on ' ?

I don't own a 48G but this works on my old 48SX :

Alpha Leftshift E Alpha Leftshift 7 :
Alpha Leftshift E Alpha Rightshift 7 :
Alpha Leftshift E Alpha Leftshift 8 :
Alpha Leftshift EAlpha Leftshift 9 :

(or just the necessary keys if you are Alpha locked. Ex : E Sihft 7

Since 49/50, you can, use CHARS

In the previous exemple,i used the excellent HPUserEdit to write the program (and its capacity to produce easily CHOOSE and INFORM structure)

Edited: 17 Mar 2012, 9:18 a.m.

                        
Re: New Blog Up: Projectile Motion
Message #9 Posted by bill platt on 17 Mar 2012, 9:36 a.m.,
in response to message #8 by Gilles Carpentier

That is very cool--i just tried it.

Glad I asked--thanks!

                        
Re: New Blog Up: Projectile Motion
Message #10 Posted by bill platt on 17 Mar 2012, 4:35 p.m.,
in response to message #8 by Gilles Carpentier

Speaking of coolness, I guess if I want to try running your routine on my 48G I should simply grab the text file and upload it through my good old-fashioned serial cable.....I admit that I haven't actually moved a program to/from my 48G(x) machines in about 4 months...

                              
Re: New Blog Up: Projectile Motion
Message #11 Posted by Gilles Carpentier on 18 Mar 2012, 4:43 a.m.,
in response to message #10 by bill platt

To drag and drop the text file use this :

%%HP: T(3)A(D)F(.); \<< '(COS(a)*m*v0*(EXP(k*t/m)-1)*EXP(-k*t/m)/k,-m*(((g*k*t-SIN(a)*k*v0-g*m)*EXP(k*t/m)+SIN(a)*k*v0+g*m)*EXP(-(k*t)/m))/k^2)' 'EQ' STO { (0.,0.) (130.,80.) { t 0. 20. } 0. { (0.,0.) { 10. 10. } } PARAMETRIC Y } 'PPAR' STO ERASE DEG DO "Choose object" { { "Baseball" { .3 .145 .041043 } } { "Tennis ball" { .6 .057 .003381 } } { "Golf Ball" { .4 .045 .001385 } } } 1 CHOOSE NOT { KILL } IFT { c m s } STO "Choose parameters or CANCEL" { "v0" "a" "g" } { 1 3 } { 55 45 9.80665 } DUP INFORM NOT { KILL } IFT { v0 a g } STO "Temp\233rature" { { "40\^o" 1.1839 } { "35\^o" 1.2041 } { "30\^o" 1.225 } { "25\^o" 1.2466 } { "20\^o" 1.269 } { "15\^o" 1.292 } { "10\^o" 1.3163 } { "5\^o" 1.3413 } { "0\^o" 1.3943 } } 4 CHOOSE NOT { KILL } IFT 'p' STO 'm*g/\v/(2*m*g/(c*p*s))' EVAL 'k' STO DRAX DRAW { } PVIEW UNTIL 0 END \>>

PS: I don't use here the S~N command :i m not sure it works on a 48G and I change the H and V scale to do 45 is really 45 on the screen (for a 50G resolution)

I notice that a 45 throw, is not the longer at all. 30/35 are better (for golf). For baseball seem 15/20

Edited: 18 Mar 2012, 6:19 a.m.

                                    
Re: New Blog Up: Projectile Motion
Message #12 Posted by Alexander Oestert on 18 Mar 2012, 8:33 a.m.,
in response to message #11 by Gilles Carpentier

I assume the fastest and easiest way to transfer a program from HPUserEdit 6 to a 50G would be via the SD card. In what format should I save it from HPUserEdit to the SD card to accomplish this and what would I have to do with the file on the 50G to be able to run the program?

Thanks in advance!

                                          
Re: New Blog Up: Projectile Motion
Message #13 Posted by Gilles Carpentier on 18 Mar 2012, 5:45 p.m.,
in response to message #12 by Alexander Oestert

To transfer on a real 50G I use an USB cable and the Conn4x software ( it is on the CD with the 50G)

Just save the HPUserEdit file without any extension. Then connect Conn4x with you HP50 and drag and drop the saved file in the Conn4x windows.

I must say that Conn4X is a very old and awfull program but i don't know a more recent program. I never used a SD card to transfer from PC to HP but i think it s possible.

                                    
Re: New Blog Up: Projectile Motion
Message #14 Posted by Marcus von Cube, Germany on 18 Mar 2012, 9:55 a.m.,
in response to message #11 by Gilles Carpentier

Looks better if enclosed in PRE tags and wrapped a little:

%%HP: T(3)A(D)F(.);
\<< '(COS(a)*m*v0*(EXP(k*t/m)-1)*EXP(-k*t/m)/k,-m*(((g*k*t-SIN(a)*k*v0-g*m)*EXP(k*t/m)+SIN(a)*k*v0+g*m)*EXP(-(k*t)/m))/k^2)'
  'EQ' STO
  { (0.,0.) (130.,80.) { t 0. 20. } 0. { (0.,0.) { 10. 10. } } PARAMETRIC Y }
  'PPAR' STO
  ERASE DEG
  DO "Choose object" 
    { { "Baseball" { .3 .145 .041043 } } 
      { "Tennis ball" { .6 .057 .003381 } }
      { "Golf Ball" { .4 .045 .001385 } } 
    } 1 CHOOSE NOT { KILL } IFT
    { c m s } STO
    "Choose parameters or CANCEL" 
    { "v0" "a" "g" } 
    { 1 3 }
    { 55 45 9.80665 }
    DUP INFORM NOT { KILL } IFT
    { v0 a g } STO
    "Temp\233rature" 
    { { "40\^o" 1.1839 } 
      { "35\^o" 1.2041 }
      { "30\^o" 1.225 } 
      { "25\^o" 1.2466 }
      { "20\^o" 1.269 }
      { "15\^o" 1.292 }
      { "10\^o" 1.3163 }
      { "5\^o" 1.3413 }
      { "0\^o" 1.3943 } 
    } 4 CHOOSE NOT { KILL } IFT
    'p' STO 
    'm*g/\v/(2*m*g/(c*p*s))' EVAL
    'k' STO
    DRAX DRAW { } PVIEW
  UNTIL 0
  END
\>>
                                          
Re: New Blog Up: Projectile Motion
Message #15 Posted by Gilles Carpentier on 18 Mar 2012, 5:45 p.m.,
in response to message #14 by Marcus von Cube, Germany

Thanks Marcus ;) It's better like this !

            
Re: New Blog Up: Projectile Motion
Message #16 Posted by Crawl on 18 Mar 2012, 9:00 a.m.,
in response to message #6 by Gilles Carpentier

Cool. Next consider lift due to spinning.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall