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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Symbolic polynomial

ptc-1218903
1-Newbie

Symbolic polynomial

Hi,
In the attached Mtahcad sheet,I have an equation for Vc_se(A_dB).
I have evaluated this equation symbolically.
How to express Vc_se(A_dB) as 5 th or 6 th degree polynomial with A_dB as independent variable?
Thanks
14 REPLIES 14
RichardJ
19-Tanzanite
(To:ptc-1218903)

Use the series keyword:

series,A_dB,5-->

I'm not sure you are going to like the answer though (it looks slightly less horrible if you disable the numeric assignments for A and K at the top of the sheet, and change R_Min to 5/2).

Richard

The function is NOT of polynomial format, that excludes pure polynomials like series. This function is only fittable (immediately) by a rational fraction. Which rational fraction is given in reduced from as CF [Continued Fraction].

Is that formula an Engineering formula or an invention ?

jmG

What version of Mathcad are you using? It does make a difference. You are clearly not using MC11 (even if you post some of your files in that format) as you use constructs not supported in MC11.

This seems to be related to the preceding PIN diode thread. Perhaps an attempt at a symboic solution to the problem posed there. But I'm not sure about the correctness, or perhaps the identity, of the proposed solution. The results differ from those I obtained numerically in the other thread.

What sort of polynomial are you looking for? And to what end? Truncated Taylor series have very limited applicability. They can provide a very good description of a function, but only within a very limited range around the point of expansion. They are not generally useful as approximations over any appreciable interval.

Here you have the additional consideration that your function is only defined (as a real function) over a limited range. That range does not include zero, you cannot get a true Taylor series expansion around zero. Using MC11 you can get an expansion around a point within the range, such as 20. But plotting show clearly how the fit is limited to the immediate neighborhood of the expansion point. And MC14 can't do the series expansion at all.
__________________
� � � � Tom Gutman

Hi,
Thanks for the response.

I use MC14.

Would like to have this function as part of firmware. Depending on the independent variable A-dB (This ranges from 1 to 50), need to calculate the corresponding Vc-Sh.

Embedded system, eh? What are the parameters? What are the relative speeds of addition, multiplication, and division? What sort of accuracy do you need?

Your function is just not well fit by polynomials. You can get a good approximation using truncated Chebyshev series. But you need about 60 terms. With such high orders you have to use a representation in terms of Chebyshev polynomials -- a representation in terms of powers is simply numerically unstable.

A rational polynomial of reasonable degree might work, but that involves division.

Also, which are the correct equations? The ones given in this tread or the ones from the PIN diode thread? Or are the two not intended to be quite the same system?
__________________
� � � � Tom Gutman

Added comparison between Cheby 50 and rational 3/2.

jmG

On 9/7/2009 6:20:49 PM, leyo123 wrote:
...
>I use MC14.
>
>Would like to have this
>function as part of firmware.
>Depending on the independent
>variable 'x' (This ranges
>from 1 to 50), need to
>calculate the corresponding
>Vc-Sh.
____________________________

Which function ? the one yellow ? you had an equivalent rational fraction. The way you let understand is that the firmware couldn't run the Power function X^Y, but could run simpler arithmetic. That, I don't understand the limitation of the firmware because the Pentium does have X^Y. If you have that limitation today, I bet you will have more tomorrow ! Another route is to design an equivalent Power function X^Y, that option is @ risk because numerical approximation are deigned on their specific numerical range . A single shot designed on that long range, I can have a look to my old babies.
Talking for talking, It would be a very simple task to design also around Cheby poly approximation, They are very immune to error propagation, but 2� times slower and would require a bit of manoverability in the firmware. If your function is frozen, please let collabs know. In advance, the rational fit is apparently the best, but there may be some variantes of it.

jmG

The 3/3 rational is only slightly better than 3/2. A very good candidate for the given function. I noticed the function has same characteristics that the cryogenic sensor. The cryogenic sensor is approximated [from my source] by Cheby which approximates very nicely the switch from the steep to the flat region. Having said that, the switching region is @ 2. This justifies then the 6/6 rational with an accuracy better than � 0.01 in the range 2...50.

jmG

The 3/3 rational is only slightly better than 3/2. A very good candidate for the given function. I noticed the function has same characteristics that the cryogenic sensor. The cryogenic sensor is approximated [from my source] by Cheby which approximates very nicely the switch from the steep to the flat region. Having said that, the switching region is @ 2. This justifies then the 6/6 rational with an accuracy better than � 0.01 in the range 2...50.

jmG

PS: last minute addition, a 5/4 rational, 2...50

Does this help?

Success!
Luc

You haven't said anything about the accuracy and precision required. 10%, 1%, 0.01%? Also, what are the resource limitiations (memory for LUT"s, multipliers, etc.). Both will generally affect the method of implementation.

Without any more info, I would recommend the implementation realize the desired overall I-O function. There's no essential engineering reason to divide it up because the math steps are cascaded.

As Luc notes, a piecewise combo of lookup table (LUT) and interpolation (with interp. coef's being part of LUT can bev very effiicent.

Lou

>As Luc notes, a piecewise combo of lookup table (LUT) and interpolation (with interp. coef's being part of LUT can be very efficient.<<br> _________________________

In my times, low level firmware (no so low level BTW !) LUT was disaster about the time of computation. The last offer in two 5/4 rational is in green, below Marlett. Too many unknowns about the "firmware". At least the collab can do some shopping. It remains that unless the I(x) is exposed, this function is "band aid".

Jean is departing for the day.

On 9/7/2009 1:18:32 PM, leyo123 wrote:
>Hi,
>In the attached Mtahcad
>sheet,I have an equation for
>Vc_se(A_dB).
>I have evaluated this
>equation symbolically.
>How to express Vc_se(A_dB) as
>5 th or 6 th degree polynomial
>with A_dB as independent
>variable?
>Thanks
_______________________________

You can replace Se(x) by any order poly. That does not help yet as you have to expand X^Y. The function is "NOT of polynomial format", thus excluding the simple polynomial. The "polynomial" must be a rational fraction or of a different form "Cheby". "Cheby", you have ... try an order 9 to make it equivalent to the 5/4 rational given. Now, Cheby will be 2� times slower than the rational.

Apparently, the 3 responders have interpreted same: you have a function, out of the blue, that you want to plug in a firmware. I have assumed the firmware can +, -, *, / ,,, thus proposed the hyperfast very accurate rational. It could be that the function is ExpDecay3, but can't tell has you have not provided the original data set, neither the design of this function. What I mean here is that at the point of I(x), the project may still be "band aid".
Taking your I(x) function, R� of ExpDecay3 = 0.99999. The series expansion of the ExpDecay3 is dramatic with an error of 10^14 at 50 !!! A firmware that won't +, -, *, / is back to the dark age before Pascal, and what about: fixed /floating point arithmetic, accuracy like 1.123456789*1 = 1.23 or 1.23456789 ???

All for you to cogitate.

jmG

I apologize for having screwed XX(1513).
Should have named XX(1513)_
Thus appending XX(1513)_(1), XX(1513)_(2),,,

jmG
Top Tags