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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How can I tell symbolic expression solver to output the result as a function or a particular set of variables?

ptc-5782298
1-Newbie

How can I tell symbolic expression solver to output the result as a function or a particular set of variables?

Hi all,

I am new to Mathcan and I am trying to solve a matrix equation A = B*C symbolically. I would like to have the output written using only a set of primary variables.

I attached the equation. The output Et1 and Et2 contains Et2. What I would like to have is Et1 in terms on alpha, theta, k and t only.

Can anybody suggest something?

Many thanks in advance!

Newin

41 REPLIES 41

... (please see Fig. 2 of the attached paper).

You really must remember to include your attachments!!!

Alan

Hi Alan,

I am sorry; I was always too fast and click submit button before I attach anything.

But I posted another message immediately after clicking the submit button and realized I had forgotten the attachments. Can you see those attachments? The paper I mentioned is called hybrid.pdf. The Mathcad worksheet is hybrid.xmcd. I am attaching them here again just in case.

Bests,

Newin

new jap wrote:

Hi Alan,

I am sorry; I was always too fast and click submit button before I attach anything.

But I posted another message immediately after clicking the submit button and realized I had forgotten the attachments. Can you see those attachments? The paper I mentioned is called hybrid.pdf. The Mathcad worksheet is hybrid.xmcd. I am attaching them here again just in case.

Bests,

Newin

Yes, I've got them (we must have posted within seconds of each other - the displayed times of posting are the same!). I'm reading through the paper, but it's way outside my knowledge area, so I might not be much help!

Alan

Thanks Alan, any help or suggestion would be very useful. I am new to this myself and also to programming, so it's a double hurdle I also tried to work out these equations on paper a while ago, but the equations seem to be all connected and I can get to Eq. 8 and Eq.9. So, I thought Mathcad might help me on this.

Newin

The attached might help a little, though something is still not right as I don't get exactly the same result for equation (8). Because of that I haven't taken it any further - I'll leave you to figure out why!

Alan

Hi Alan,

I really do appreciate your help! Thank you very much!

I attached here the latest version, along with some questions. Please ignore it if you do not have the time. I am working it and hopefully will get to where I want to be; but just in case you are interested and if the questions will not take too much of your time.

I could now get an expression very similar to Eq. 8 in the paper. The reason yours was a little more different was due to the definition of the matrix P, which should be conj(P) for the first matrix equation to the right of ab:= This is because the reverse in the propagation direction of the wave.

I am not entirely sure if Eq. 8 in the manuscript is fully correct as there an an extra term in our calculation that is not shown in Eq. 8. One thing for sure, the authors missed 'j' in exp(betaL).

So, to prove this I am trying now to plot what the authors show in Fig.4. I got some similar curve and I am quite positive it is correct; at least it is equally spaced in frequency domain, which is to be expected from a resonator. But I would be more content if I could really plot the actual (bow)^2 and (biw)^2. In the worksheet I plot Re(bowsq) and Abs(bowsq). The Re(bowsq) is similar to Fig. 4 in the paper. The Abs(bowsq) is like the opposite.

My problems are:

1. why do I get complex value for the equation bowsq(lamda,r_p,t_p) when I am taking the square of abs(bow/aow)? Absolute should yield real number.

and all the substitutions I make later on are all real numbers too.

2. for biwsq(lamda,r_p,t_p) I get recursive definition and Mathcad refuses to calculate.

Bests,

Newin

PS. I remember to send the attachment now

I'm still puzzling over equation (8). I don't see how the authors can get exp(-beta.L) or exp(beta.L) when beta is multiplied by i to begin with. Is the i in the right place in the P matrix? If it were to appear in front of the exponential terms, rather than in front of the betas, then beta and alpha would be on a similar footing, and one could understand how they might appear in a similar form, as they do, in equation (8).

Alan

Hi Alan,

the i is in the right place as this will imply that it is of a harmonic nature, i.e. in cosine and sine terms. Without i, we get just a loss factor, which is why there is no i infront of alpha (the authors call this the loss decay constant). Also, the exponential terms with alpha always get a minus sign in the front to imply that it is a decaying exponential, i.e. loss. Beta, on the other hand, represents the propagation constant which can travel in opposite direction (hence plus and minus signs are possible) and for which i is necessary.

I think there must be something missing in Eq. 8. I have been trying to figure out the difference between our calculation and Eq.8, but to no avail. So I though if I could reproduce the plot in Fig. 4 the way we calculate, we can then be sure Eq. 8 is not correctly written. Otherwise, we have a problem somewhere in the calculation, so there are some mistakes in the definition of M2. I am pretty sure P is correct, but not so sure about M1. There might be a minus sign in front of jk (the lower left term).

Bests,

Newin

new jap wrote:

Hi Alan,

the i is in the right place as this will imply that it is of a harmonic nature, i.e. in cosine and sine terms. Without i, we get just a loss factor, which is why there is no i infront of alpha (the authors call this the loss decay constant). Also, the exponential terms with alpha always get a minus sign in the front to imply that it is a decaying exponential, i.e. loss. Beta, on the other hand, represents the propagation constant which can travel in opposite direction (hence plus and minus signs are possible) and for which i is necessary.

Yes, I was afraid you were going to say that! Oh well!

I've just noticed that your calculation of k has a numerical value of 4.xxxx. This means that sqrt(1-k^2) will be imaginary, so this will introduce imaginary components into the bowsq function. Also, since phi hasn't been eliminated, a non-zero value will also keep imaginary components in bowsq.

Alanm

Thanks Alan, there was a missing R in the definition of k. All is fine now

new jap wrote:

Thanks Alan, there was a missing R in the definition of k. All is fine now

Good; though I notice you have set phi to be 80. Mathcad will interpret this as 80 radians. Is that what you intended?

Alan

Thanks Alan for the note. It was only to test, so the actual value is irrelevant at the moment, but I will keep that in mind. Many thanks again for all your helps, without which it would have taken me much much longer.

Newin

Top Tags