The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
help with hpppl
05-07-2016, 12:30 PM
Post: #1
help with hpppl
hi there!

I was inspired by some threads in the forums and being really excited about the patch nots (cas now loves hpppl) I decided to dig out my prime and start over.

Well, it seems that local variables do not interact with cas like I expected, so I do really need advice.

I tried to make this program. It would make me use the prime at work for the first time :-)
Code:

ZIN_F:=4000000;
ZIN_REAL:=400;
ZIN_IMA:=400;

EXPORT ZIN()
BEGIN
LOCAL REAL,IMA,N,W,R,C;
INPUT({{ZIN_F,[0]},{ZIN_REAL,[0]},{ZIN_IMA,[0]}},"IMPEDANCE",{"freq","real","imag"});

W:=2*π*ZIN_F;
N:=1+W^2*'R'^2*'C'^2;
REAL:='R'/'N';
IMA:=W*'C'*'R'^2/'N';
CAS.solve({REAL=ZIN_REAL,IMA=ZIN_IMA},{R,C});

RETURN {R,C};
END;

I always get {0,0} as a result. What am I doing wrong to pass local variables and data to the cas?
Help is very much appreciated.

A simpler version that solves R+C=var would be

Code:

EXPORT CASTEST(N)
BEGIN
LOCAL R,C;
CAS.solve('R'+'C'=N,'R')
END;

Maybe the simplest approach shows my error most easily.

Thanks guys!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
help with hpppl - leprechaun - 05-07-2016 12:30 PM
RE: help with hpppl - roadrunner - 05-07-2016, 04:55 PM
RE: help with hpppl - roadrunner - 05-07-2016, 05:00 PM
RE: help with hpppl - salvomic - 05-07-2016, 05:15 PM
RE: help with hpppl - roadrunner - 05-08-2016, 01:52 AM
RE: help with hpppl - leprechaun - 05-08-2016, 06:41 PM
RE: help with hpppl - leprechaun - 05-08-2016, 06:46 PM
RE: help with hpppl - roadrunner - 05-09-2016, 12:14 AM
RE: help with hpppl - roadrunner - 05-09-2016, 12:55 PM
RE: help with hpppl - CH3791 - 05-28-2016, 01:17 AM
RE: help with hpppl - leprechaun - 05-09-2016, 05:14 AM
RE: help with hpppl - leprechaun - 05-09-2016, 06:48 AM
RE: help with hpppl - Han - 05-09-2016, 01:25 PM
RE: help with hpppl - leprechaun - 05-09-2016, 05:35 PM
RE: help with hpppl - Tim Wessman - 05-09-2016, 05:53 PM



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