Post Reply 
[SOLVED] Issue with cZeros
02-05-2017, 11:06 AM (This post was last modified: 02-05-2017 12:06 PM by tiamattia.)
Post: #1
[SOLVED] Issue with cZeros
Hello,

I'm developing a program to design filters using Butterworth and Chebyshev type I. To do this i defined some cas function to solve equations or denormalize things. Some of these functions are:
Code:

BP_Denorm_TF(n_filter_gain, n_filter_poles, w_central, filter_q_factor) :=
BEGIN
 cFactor(normal(n_filter_gain/ poly2symb(pcoeff(n_filter_poles), filter_q_factor * (x ^ 2 + w_central ^ 2) / (w_central * x)))); // BP transfer function
END;

BP_Denorm_Zeros(n_filter_gain, n_filter_poles, w_central, filter_q_factor) :=
BEGIN
 cZeros(BP_Denorm_TF(n_filter_gain, n_filter_poles, w_central, filter_q_factor));
END;
Use this as argument (1.002377293,{−0.707946782251-0.707946782251*i,−0.707946782251+0.707946782251*i},30781195.9239,2.44948974278)

BP_Denorm_TF works right also inside of a program.
Instead, BP_Denorm_Zeros is not working as it should inside of a program.
If i call this function directly from cas, everything works, the result is two zeros in the origin.
If i call this function inside of a program, no solutions are returned.

What's the problem?
Find all posts by this user
Quote this message in a reply
02-05-2017, 11:31 AM
Post: #2
RE: Issue with cZeros
Problem solved, when using CAS commands in program mode, you have to provide the variable to solve. I think it's because in program mode the default var is X while in CAS is x. (I'm usign x)
Find all posts by this user
Quote this message in a reply
Post Reply 




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