Post Reply 
UserRPL HP 50G
06-30-2014, 04:00 PM (This post was last modified: 06-30-2014 04:01 PM by Mikkiz.)
Post: #3
RE: UserRPL HP 50G
hey and thanks for your fast reply. the \\ are only comments for the forum, that people understand what it does if they want to. i thought the ? belongs to the code, its at least how i learned it.


Quote:%%HP: T(0)A(D)F(.);
@ Argumentos:
@ Author:
@ E-mail:
@ Version:
@ Created using HPUserEdit 5 [www.unparche.com]

@ %NAME%=
@ %DIR%=

«

// Input box, T = Sum


{ {"xf" "Lower Limit"}

{"xd" "Upper Limit"}

{"v" "Reflux Ratio"}

{"a" "Segregation Factor"}

{"n" "Partitions"} }

1 { } { } INFORM

IF 0 == THEN KILL END

OBJ-> DROP


// Calculate h and store 0 in T, s1, and s2


4 PICK 6 PICK ? 2 PICK /

0 DUP DUP


// Store local variables


-> xf xd v ? n h T s1 s2


«


// Subroutines


« v xi * xd + v 1 + / » ?y? STO

« ? xi * 1 ? 1 ? xi * + / » ?ys? STO

« ys -> NUM y -> NUM ? INV » ?F? STO


// Endpoints

xf ?xi? STO F ?T? STO+

xd ?xi? STO F ?T? STO+


// Inner terms of the Simpson Rule

0 n 2 / 1 ? FOR K

2 K * 1 + h * xf + ?xi? STO

F ?s1? STO+ NEXT


0 n 2 / 1 ? FOR K

2 K * h * xf + ?xi? STO

F ?s2? STO+ NEXT

// Calculating the integral

s1 4 * ?T? STO+

s2 2 * ?T? STO+

T h 3 / *

// Finalizing


v DUP 1 + / * ?T? STO

// Display T and purge outstanding variables


T ?Result? ->TAG { xi, F, ys, y} PURGE »
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
UserRPL HP 50G - Mikkiz - 06-29-2014, 07:01 PM
RE: UserRPL HP 50G - DavidM - 06-29-2014, 09:20 PM
RE: UserRPL HP 50G - Mikkiz - 06-30-2014 04:00 PM
RE: UserRPL HP 50G - HP67 - 06-30-2014, 04:23 PM
RE: UserRPL HP 50G - DavidM - 06-30-2014, 05:55 PM
RE: UserRPL HP 50G - HP67 - 06-30-2014, 06:31 PM
RE: UserRPL HP 50G - DavidM - 06-30-2014, 06:59 PM
RE: UserRPL HP 50G - HP67 - 07-01-2014, 06:27 AM
RE: UserRPL HP 50G - CosmicTruth - 07-01-2014, 12:26 AM
RE: UserRPL HP 50G - Mikkiz - 07-01-2014, 05:25 PM
RE: UserRPL HP 50G - HP67 - 07-01-2014, 05:35 PM
RE: UserRPL HP 50G - DavidM - 07-01-2014, 08:02 PM
RE: UserRPL HP 50G - Mikkiz - 07-02-2014, 07:44 PM
RE: UserRPL HP 50G - HP67 - 07-03-2014, 06:29 AM
RE: UserRPL HP 50G - Joe Horn - 07-03-2014, 08:13 AM
RE: UserRPL HP 50G - Voldemar - 07-03-2014, 11:07 AM
RE: UserRPL HP 50G - HP67 - 07-03-2014, 11:18 AM
RE: UserRPL HP 50G - HP67 - 07-03-2014, 11:15 AM
RE: UserRPL HP 50G - CosmicTruth - 07-04-2014, 12:32 AM
RE: UserRPL HP 50G - Brad Barton - 07-03-2014, 01:57 AM



User(s) browsing this thread: 1 Guest(s)