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

extracting coefficients of e^ix from polynomial

SOLVED
Newbie

extracting coefficients of e^ix from polynomial

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: extracting coefficients of e^ix from polynomial

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.

13 REPLIES 13

Re: extracting coefficients of e^ix from polynomial

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?

Re: extracting coefficients of e^ix from polynomial

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.

Re: extracting coefficients of e^ix from polynomial

How about the attached?

Alan

Re: extracting coefficients of e^ix from polynomial

Don't know if this helps or even if it's right.

Re: extracting coefficients of e^ix from polynomial

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.

Subst_Bug.png

Re: extracting coefficients of e^ix from polynomial

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.

extracting.png

Re: extracting coefficients of e^ix from polynomial

OK, the last one. This shows how to get around the limitation of the last one of not being able to evaluate numerically.

Re: extracting coefficients of e^ix from polynomial

I've had a go at simplifying the worksheet also (I need to get a life!) - see attached.

Alan

Re: extracting coefficients of e^ix from polynomial

Hmmm. looks like part of my worksheet from another thread

http://communities.ptc.com/message/201711#201711

Think you have attached the wrong sheet