Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi everyone,
I am trying to extract the coefficients of e^ix from a polynomial. My attempts using the coeffs, e^ix command have been unsuccessfull and I am wondering if anyone has another solution.
So, i have a function like: y= (2+5k)e^ix + 7e^2ix + (2+9a)e^-ix
and want MathCAD to give me: coeffs(y) = ( 2+9a; 2+5k; 7).
Another example is in the attached file
Thanks for your replies!
Solved! Go to Solution.
There is a problem with your sheet as the three Vector functions at the top won't consider their argument. If you look at the coefficients at the end you will notice there is no "b0" or "b1" showing up as it should. You have to follow the definition of those functions immedeatly by a symbolic evaluation to make it work. You may then omit that symbolic eval at the definition of Phi, as it would not be necessary there anymore.
Haven't tried it, but couldn't you substitute e^i*theta for a variable X and search the coeefs of X? Even better replace the e^i*thata in BClefthand for X to do so.
I noticed that your functions a0vector() etc. are simply transposing its argument vector. Os ther a reason for doing it that elaborate way?
Hi Werner,
I did try to substitute for a variable X and search coefficients but MathCAD doesn't replace it. So, I think it is unable to recognise e^i*theta as a function, no idea. (my knowledg about MathCAD is minimal).
About the a0vector, etc... what do you mean with transposing the argument vector? The purpose of a0vector, a1vectore, b0vector etc... is that these are unknown coefficients to be determined in a next step by solving the system against some other function. Don't exactly know what you mean with this.
The question concerning the the coefficients seems to be answered thanks to Alan.
I was about to post a more compact way to create your various symbolic vetcors and to explain what i meant with the transposed vectors when i ran into what I think is a mathcad bug with symbolic stitute.
I attch the file nevertheles for whatever its worth. Maybe you can use parts of it anyway.
The bug is shown in the following screenshots. Don't think there would be a rational explanation for that behaviour and at the moment I see no convenient workaround.
As I found the easy way to avoid that Mathcad bug find attached a more streamlined way to deal with your symbolic vectors. Hope you find it useful.
OK, the last one. This shows how to get around the limitation of the last one of not being able to evaluate numerically.
I've had a go at simplifying the worksheet also (I need to get a life!) - see attached.
Alan
Hmmm. looks like part of my worksheet from another thread
http://communities.ptc.com/message/201711#201711
Think you have attached the wrong sheet
Werner Exinger wrote:
...
Think you have attached the wrong sheet
You are right! Correct worksheet attached here (I hope!).
Alan
There is a problem with your sheet as the three Vector functions at the top won't consider their argument. If you look at the coefficients at the end you will notice there is no "b0" or "b1" showing up as it should. You have to follow the definition of those functions immedeatly by a symbolic evaluation to make it work. You may then omit that symbolic eval at the definition of Phi, as it would not be necessary there anymore.
Werner Exinger wrote:
There is a problem with your sheet ...
Doesn't surprise me. It's what I get for doing things quickly late at night! Thanks for implementing the correction.
Alan
AlanStevens wrote:
... It's what I get for doing things quickly late at night!
I know exactly what you ar talking about 😉