cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are working to address an issue with subscription email notifications. In the meantime, be sure to check your favorite boards for new topics.

How to define a function with constants

CS_11
3-Visitor

How to define a function with constants

I'm trying to define a function where a,b and R are constants. I set the labels to constant but I get an error. constant lable.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:CS_11)

The error message stems from Primes numeric engine as it can't do calculation with variables not assigned a value.

As you have seen you still can do symbolic operations without any problem so it does no harm but just is bad looking.

 

To avoid the error you have two options:

1) Define the function as P(v,T,a,b):=.... or as P(a,b,v,T):=...

2) assign a and b values before defining. The type clear.sym(a,b) and then do your symbolic calculations
To clear the variables after that completely also for numeric use, you may type clear(a,b)

 

Werner_E_0-1601495358541.png

 

View solution in original post

1 REPLY 1
Werner_E
24-Ruby V
(To:CS_11)

The error message stems from Primes numeric engine as it can't do calculation with variables not assigned a value.

As you have seen you still can do symbolic operations without any problem so it does no harm but just is bad looking.

 

To avoid the error you have two options:

1) Define the function as P(v,T,a,b):=.... or as P(a,b,v,T):=...

2) assign a and b values before defining. The type clear.sym(a,b) and then do your symbolic calculations
To clear the variables after that completely also for numeric use, you may type clear(a,b)

 

Werner_E_0-1601495358541.png

 

Top Tags