Skip to main content
1-Visitor
September 23, 2020
Solved

Summing a series of complex function and evaluate its magnitude

  • September 23, 2020
  • 2 replies
  • 2988 views

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?

Best answer by LucMeekes

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

2 replies

21-Topaz II
September 23, 2020

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

rdliquid1-VisitorAuthor
1-Visitor
September 23, 2020

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

 

LucMeekes23-Emerald IVAnswer
23-Emerald IV
September 23, 2020

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

23-Emerald IV
September 23, 2020

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

 

rdliquid1-VisitorAuthor
1-Visitor
September 23, 2020

Hi Luc,

 

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

 

Rdliquid