Post Reply 
android free app anomaly
06-07-2017, 05:30 PM (This post was last modified: 06-07-2017 05:32 PM by compsystems.)
Post: #7
RE: android free app anomaly
In the input line, it is not yet fully compatible with the function definition, please use the HPconnKit program editor or write directly to the program editor.

HOME MODE VERSUS MODE CAS

A significant difference is that in HOME mode, expressions on the right side of a variable can not contain symbols that do not contain a predefined value, or use system variables as F1 X L1 M1, another way is define subfunctions to transfer values.

Example
PHP Code:
// file euler1.hppprgm
// CAS MODE
#cas
  
euler1():=
  
begin
    local g
,c,m,t;
    
local vi,ti,vf,tf,iteration;
    
local v;
    
purge(g,c,m,t,vi,ti,vf,tf);
    
v(t):= vi+(g-(c/m)*vi)*(t-ti);
    
g:=9.81c:=12.5m:=68.1;
    
vi:=0;
    
ti:=0;
    
iteration:=1;
    PRINT(); 
// clear terminal view (output)
    
print("euler1");
    print(
"press [↓] for next iteration" );
    print(
"press [on] for exit" );
    
wait(1);      
    for 
tf from 0 to 10 step 2 do
      PRINT(); 
// clear terminal view (output)
      
print("iteration = "+iteration);
      
vf:=v(tf);
      print(
"vi = "+vi+" m/s");
      print(
"ti = "+ti+" s");
      print(
"tf = "+tf+" s");
      print(
"vf("+tf+") = "+vf+" m/s");
      print(
"");
      
vi:=vf;
      
ti:=tf;
      
iteration:=iteration+1
      
wait();
    
end;
    print(
"iterations finished" );
    return(
"done");
  
end;
#end 

PHP Code:
// file euler2.hppprgm 
// HOME MODE
local g;c;m;t;
local vi;ti;vf;tf;iteration;
local v(t)
begin
    
return vi+(g-(c/m)*vi)*(t-ti);
end;

export euler2()
begin
  purge
(g,c,m,t,vi,ti,vf,tf);
  
g:=9.81c:=12.5m:=68.1;
  
vi:=0;
  
ti:=0;
  
iteration:=1;
  print; 
// clear terminal view (output)
  
print("press [↓] for next iteration" );
  print(
"euler2");
  print(
"press [on] for exit" );
  
wait(1);   
  for 
tf from 0 to 10 step 2 do
    print; 
// clear terminal view (output)
    
print("iteration = "+iteration);
    
vf:=v(tf);
    print(
"vi = "+vi+" m/s");
    print(
"ti = "+ti+" s");
    print(
"tf = "+tf+" s");
    print(
"vf("+tf+") = "+vf+" m/s");
    print(
"");
    
vi:=vf;
    
ti:=tf;
    
iteration:=iteration+1
    
wait();
  
end;
  print(
"iterations finished" );
  return(
"done");
end
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
android free app anomaly - roadrunner - 06-06-2017, 01:44 PM
RE: android free app anomaly - compsystems - 06-06-2017, 07:47 PM
RE: android free app anomaly - roadrunner - 06-06-2017, 08:48 PM
RE: android free app anomaly - compsystems - 06-07-2017, 02:10 PM
RE: android free app anomaly - roadrunner - 06-07-2017, 04:39 PM
RE: android free app anomaly - compsystems - 06-07-2017 05:30 PM
RE: android free app anomaly - roadrunner - 06-07-2017, 06:45 PM
RE: android free app anomaly - Tim Wessman - 06-07-2017, 07:19 PM
RE: android free app anomaly - roadrunner - 06-09-2017, 01:01 PM
RE: android free app anomaly - Jan_D - 06-14-2017, 03:38 PM



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