Post Reply 
Dealing with functions
02-01-2014, 05:45 PM
Post: #3
RE: Dealing with functions
(02-01-2014 11:00 AM)Mickpc Wrote:  What I am trying to do is store the equation in a program and then solve it and plot it, as well. Is there any trick to this?

Hi Mick,

Here is a simple example of how you can use an equation within a program and either plot it or solve it:

Code:

// Before running this program:
// -->  Create a copy of the Solve App
// (1) Start Apps
// (2) Select the "Solve" app
// (3) Tap on "Save"
// (4) Enter the name for the new app: "Solve_VelAcc"

EXPORT velacc()
BEGIN
 LOCAL var;

 // Assign equation to variable E1
 Solve_VelAcc.E1 := "V^2=U^2+2*A*D";

 // Start the "Solve_ValAcc" App with the symbolic view
 STARTAPP("Solve_VelAcc");
 STARTVIEW(0);

 // Selection of the view
 CHOOSE(var, "Select View","Equation","Plot","Solve","Program Catalogue");

 CASE 
  IF var == 1 THEN
   STARTVIEW(0); // Show equation E1
  END; 
  IF var == 2 THEN
   STARTVIEW(1); // Plot equation E1
  END;
  IF var == 3 THEN
   STARTVIEW(2); // Solve equation E1
  END;
  IF var == 4 THEN
   STARTVIEW(-7); // Back to the Program Catalogue
  END;
 END; // END CASE

END;


This is just a standalone program. It is much more elegant to implement this code within the created App and to define specific views to choose from.

Dominik
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Dealing with functions - Mickpc - 02-01-2014, 11:00 AM
RE: Dealing with functions - Helge Gabert - 02-01-2014, 04:36 PM
RE: Dealing with functions - Mickpc - 02-02-2014, 12:08 AM
RE: Dealing with functions - Dominik Holenstein - 02-01-2014 05:45 PM



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