topic Re: Summing a series of complex function and evaluate its magnitude in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689000#M192059
<P>Hi,</P>
<P>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.</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="answer to rdliquid 2.jpg" style="width: 999px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31720i8E4039CE0F5CCDEF/image-size/large?v=v2&px=999" role="button" title="answer to rdliquid 2.jpg" alt="answer to rdliquid 2.jpg" /></span></P>Wed, 23 Sep 2020 08:09:30 GMT-MFra-2020-09-23T08:09:30ZSumming a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/688958#M192058
<P>Hi</P>
<P> </P>
<P>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:</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable_undefined.PNG" style="width: 981px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31716i8C4023213970C9D1/image-size/large?v=v2&px=999" role="button" title="Variable_undefined.PNG" alt="Variable_undefined.PNG" /></span></P>
<P>Any idea why it is giving this error?</P>Wed, 23 Sep 2020 03:28:09 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/688958#M192058rdliquid2020-09-23T03:28:09ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689000#M192059
<P>Hi,</P>
<P>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.</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="answer to rdliquid 2.jpg" style="width: 999px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31720i8E4039CE0F5CCDEF/image-size/large?v=v2&px=999" role="button" title="answer to rdliquid 2.jpg" alt="answer to rdliquid 2.jpg" /></span></P>Wed, 23 Sep 2020 08:09:30 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689000#M192059-MFra-2020-09-23T08:09:30ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689016#M192062
<P>I recommend this approach.</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_0-1600852812327.png" style="width: 400px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31721iC16EFF6B69E728EC/image-size/medium?v=v2&px=400" role="button" title="LucMeekes_0-1600852812327.png" alt="LucMeekes_0-1600852812327.png" /></span></P>
<P>You can build up your Linear Second atc. expressions symbolically or numerically whatever you like.</P>
<P>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.</P>
<P>You can fill the component vectors with numerical values like I did, or define them in terms of the actual component numbers like this:</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_1-1600853135688.png" style="width: 400px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31722i9191071454429E4D/image-size/medium?v=v2&px=400" role="button" title="LucMeekes_1-1600853135688.png" alt="LucMeekes_1-1600853135688.png" /></span></P>
<P>etcetera.</P>
<P> </P>
<P>Success!<BR />Luc</P>
<P> </P>Wed, 23 Sep 2020 14:36:00 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689016#M192062LucMeekes2020-09-23T14:36:00ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689121#M192076
<P>Hi MFra,</P>
<P> </P>
<P>Thanks but I though I already defined them. Please see my original attachment. Here is part of it:<span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="R_L_C_values.PNG" style="width: 999px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31743i812D94E6B5214D93/image-size/large?v=v2&px=999" role="button" title="R_L_C_values.PNG" alt="R_L_C_values.PNG" /></span></P>
<P> </P>
<P>That is the correct way to assign a value to a constant right?</P>
<P> </P>
<P>Thanks</P>
<P>Rdliquid</P>
<P> </P>Wed, 23 Sep 2020 14:22:01 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689121#M192076rdliquid2020-09-23T14:22:01ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689124#M192077
<P>Hi Luc,</P>
<P> </P>
<P>Thanks. That makes very good sense. I will give it a try and get back to you</P>
<P> </P>
<P>Rdliquid</P>Wed, 23 Sep 2020 14:25:38 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689124#M192077rdliquid2020-09-23T14:25:38ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689131#M192078
<P>That IS the right way to assign a value to a constant.</P>
<P>Now the question is whether it is defined in the right place....</P>
<P>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.</P>
<P>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().</P>
<P>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.</P>
<P>It might just work without that, if you only define N(s) as</P>
<P>N(s, c1, c2,....) := 1 + Linear(s) + Second(s) +... -></P>
<P>(so by adding a symbolic evaluation parameter in the end.)</P>
<P> </P>
<P>Success!<BR />Luc</P>Wed, 23 Sep 2020 14:39:08 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689131#M192078LucMeekes2020-09-23T14:39:08ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689165#M192083
<P>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.</P>
<P>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</P>
<P>s ^ 2 + sR / L + 1 / LC = s ^ 2 + s * omega1 + omega2 ^ 2). For example as in the network illustrated here:</P>
<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="answer to rdliquid 3.jpg" style="width: 763px;"><img src="https://community.ptc.com/t5/image/serverpage/image-id/31754iBFE876A15DD7B503/image-size/large?v=v2&px=999" role="button" title="answer to rdliquid 3.jpg" alt="answer to rdliquid 3.jpg" /></span></P>Wed, 23 Sep 2020 16:32:42 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689165#M192083-MFra-2020-09-23T16:32:42ZRe: Summing a series of complex function and evaluate its magnitude
https://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689238#M192086
<P>Hi Luc and Mfra,</P>
<P> </P>
<P>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.</P>
<P>No needs to put the numerical values in a matrix </P>
<P> </P>
<P>Unfortunately I have to manually simplified the expressions so it is easy on the eyes and make sure the expressions are dimensionless.</P>
<P>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?</P>
<P> </P>
<P>To Mfra point, I do not think Mathcad Prime 6 has a feature such that if you define: </P>
<P>tau:= R*C and whenever it sees expression: T(s):=1/(1+s*R*C) it can simplify to: <SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; cursor: text; font-family: 'Tex Gyre Adventor','Lato','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 27.42px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">T(s):=1/(1+s*tau)</SPAN></P>
<P> </P>
<P><SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; cursor: text; font-family: 'Tex Gyre Adventor','Lato','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 27.42px; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">Thanks a lot for all your helps</SPAN></P>
<P> </P>
<P>See attached</P>
<P> </P>
<P>Thanks!</P>
<P>Rdliquid</P>
<P> </P>
<P> </P>
<P> </P>Wed, 23 Sep 2020 22:32:03 GMThttps://community.ptc.com/t5/PTC-Mathcad/Summing-a-series-of-complex-function-and-evaluate-its-magnitude/m-p/689238#M192086rdliquid2020-09-23T22:32:03Z