Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: Summing a series of complex function and evalu...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-22-2020
11:28 PM

09-22-2020
11:28 PM

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:

Any idea why it is giving this error?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:34 AM

09-23-2020
10:34 AM

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

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
04:09 AM

09-23-2020
04:09 AM

Re: Summing a series of complex function and evaluate its magnitude

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:22 AM

09-23-2020
10:22 AM

Re: Summing a series of complex function and evaluate its magnitude

Hi MFra,

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

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

Thanks

Rdliquid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:34 AM

09-23-2020
10:34 AM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
06:32 PM

09-23-2020
06:32 PM

Re: Summing a series of complex function and evaluate its magnitude

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
11:58 AM

09-23-2020
11:58 AM

Re: Summing a series of complex function and evaluate its magnitude

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:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
05:26 AM

09-23-2020
05:26 AM

Re: Summing a series of complex function and evaluate its magnitude

I recommend this approach.

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:

etcetera.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-23-2020
10:25 AM

09-23-2020
10:25 AM

Re: Summing a series of complex function and evaluate its magnitude

Hi Luc,

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

Rdliquid