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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Summing a series of complex function and evaluate its magnitude

rdliquid
9-Granite

Summing a series of complex function and evaluate its magnitude

Hi

 

I have Linear(s), Second(s), ..., Eight(s) defined but when I tried to evaluate its coefficients and sum them, I am seeing this error:

Variable_undefined.PNG

Any idea why it is giving this error?

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:rdliquid)

That IS the right way to assign a value to a constant.

Now the question is whether it is defined in the right place....

Mathcad reads a sheet file left to right, top to bottom. Any variable you use MUST be numerically defined before it is used, otherwise the numeric processor complains (what it does now for your definition of N(s). Only the symbolic processor can handle symbols without a value assigned to them.

You define, through a symbolic definition Linear(s) to be some expression. In that expression c1, c2 and a lot more are used. At THAT moment these c1, c2 are NOT defined. And there is NO indication in the parameter list of Linear() that they should be supplied later. SO...they MUST be defined at that moment; or else, you can only do symbolic calculations with Linear().

The neat and clear way is to supply all (necessary) parameters with each of the functions Linear() Second() etc. See my post from this morning, below.

It might just work without that, if you only define N(s)  as

N(s, c1, c2,....) := 1 + Linear(s) + Second(s) +... ->

(so by adding a symbolic evaluation parameter in the end.)

 

Success!
Luc

View solution in original post

7 REPLIES 7
-MFra-
21-Topaz II
(To:rdliquid)

Hi,

You should define all the constants (see example in the photo). Impedances are functions of the complex variable s. If the functions have no argument, the s is considered by the system as the unit of measurement of time and colored blue.

answer to rdliquid 2.jpg

rdliquid
9-Granite
(To:-MFra-)

Hi MFra,

 

Thanks but I though I already defined them. Please see my original attachment. Here is part of it:R_L_C_values.PNG

 

That is the correct way to assign a value to a constant right?

 

Thanks

Rdliquid

 

LucMeekes
23-Emerald III
(To:rdliquid)

That IS the right way to assign a value to a constant.

Now the question is whether it is defined in the right place....

Mathcad reads a sheet file left to right, top to bottom. Any variable you use MUST be numerically defined before it is used, otherwise the numeric processor complains (what it does now for your definition of N(s). Only the symbolic processor can handle symbols without a value assigned to them.

You define, through a symbolic definition Linear(s) to be some expression. In that expression c1, c2 and a lot more are used. At THAT moment these c1, c2 are NOT defined. And there is NO indication in the parameter list of Linear() that they should be supplied later. SO...they MUST be defined at that moment; or else, you can only do symbolic calculations with Linear().

The neat and clear way is to supply all (necessary) parameters with each of the functions Linear() Second() etc. See my post from this morning, below.

It might just work without that, if you only define N(s)  as

N(s, c1, c2,....) := 1 + Linear(s) + Second(s) +... ->

(so by adding a symbolic evaluation parameter in the end.)

 

Success!
Luc

Hi Luc and Mfra,

 

Thanks a lot for your helps. I followed Luc's recommendation and moved the numerical assignments for all variables before I defined C(s) and it seems to work after that.

No needs to put the numerical values in a matrix 

 

Unfortunately I have to manually simplified the expressions so it is easy on the eyes and make sure the expressions are dimensionless.

One question, I see you are using 1j*2*pi*freq when evaluating at a specific frequency. For me, I just use "s" and it seems to work as well. Do oyu know why or because I got lucky there?

 

To Mfra point, I do not think Mathcad Prime 6 has a feature such that if you define: 

tau:= R*C and whenever it sees expression: T(s):=1/(1+s*R*C) it can simplify to: T(s):=1/(1+s*tau)

 

Thanks a lot for all your helps

 

See attached

 

Thanks!

Rdliquid

 

 

 

-MFra-
21-Topaz II
(To:rdliquid)

I downloaded the file again, just now, but the constant definitions are missing. However, you should use the micro-nano and picoFarad submultiples, micro-nanohenry, and also MHz or GHz which I think are implemented in Prime. You should also define units of measurement such as rad / s, krad / s, Mrad / s, and Grad / s.

To speed up the calculations it is not advisable to use expressions containing constants in the formulas but it is advisable to replace them with constants defined separately (for example the simple product RC should be replaced with tau, indeed the reciprocal 1 / tau can be set equal to omega ). the important thing is that the units of measurement are correct (for example in the expression s ^ 2 + sR / L + 1 / LC) it is advisable to define the constants separately: omega1 = R / L (which are radians per second), omega2 = 1 / sqrt (LC) (rad / s) for which

s ^ 2 + sR / L + 1 / LC = s ^ 2 + s * omega1 + omega2 ^ 2). For example as in the network illustrated here:

answer to rdliquid 3.jpg

LucMeekes
23-Emerald III
(To:rdliquid)

I recommend this approach.

LucMeekes_0-1600852812327.png

You can build up your Linear Second atc. expressions symbolically or numerically whatever you like.

Make sure that you use a vector for each type of component, you could even put all components in a single matrix, but that would make the expressions less understandable.

You can fill the component vectors with numerical values like I did, or define them in terms of the actual component numbers like this:

LucMeekes_1-1600853135688.png

etcetera.

 

Success!
Luc

 

Hi Luc,

 

Thanks. That makes very good sense. I will give it a try and get back to you

 

Rdliquid

Top Tags