Mathematica: Transistor Harmonic Derivations

Click For Summary

Discussion Overview

The discussion revolves around deriving the harmonic content of a signal passing through a transistor's transfer function using Mathematica. Participants explore methods for reducing terms involving sine functions to a desired form, focusing on technical aspects of the software's capabilities and limitations.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks assistance in reducing the term (A Sin(wt))^3 to a specific form using Mathematica, expressing uncertainty about the appropriate function to use.
  • Another participant suggests using integration to find coefficients and mentions the use of FullSimplify to verify the equivalence of expressions.
  • A later reply introduces TrigReduce as a solution for the reduction, noting potential complications if the variable "A" is complex.
  • One participant expresses frustration over common syntax errors in Mathematica, advocating for improved error messaging to help identify such issues more easily.

Areas of Agreement / Disagreement

Participants generally agree on the utility of TrigReduce for the problem at hand, but there is no consensus on the need for improved error handling in Mathematica, as it reflects a subjective experience of frustration.

Contextual Notes

Participants mention limitations related to Mathematica's handling of complex expressions and the potential for syntax errors to go unnoticed, impacting the derivation process.

vadar
Messages
16
Reaction score
0
Hello,

I am trying to derive the harmonic content of a signal passing through a transistor's transfer function. After a Taylor expansion in Mathematica 7, I have the expanded equation and the next step is to reduce everything to first order Sine/Cosine functions.

In Mathematica, if I have a term like

(A Sin (wt) )^3

What function can I use to reduce this down? Doing it by hand it should look something like

a Sin(wt) - b Sin(3wt) + c Sin(wt)

where a,b,c are the collections of constants.
Any idea how I can do this reduction in Mathematica? I can't seem to get/find a function like TrigReduce to do what I want.

Thanks for any help.
 
Physics news on Phys.org
Mathematica often has its own idea about the form it wants things in and trying to force it to put it in the form you want can often be a frustrating experience.

This can show you the coefficients without having to do it by hand, and without what I think might be a typo in what you said the result should be.

In[1]:= Table[Integrate[Sin[n w t]A Sin[w t]^3,{t,0,2Pi/w}]/(Pi/w),{n,0,3}]

Out[1]= {0, (3*A)/4, 0, -A/4}

In[2]:= FullSimplify[3A/4Sin[w t]-A/4Sin[3 w t]==A Sin[w t]^3]

Out[2]= True

Only after I finished that did I grope around and discover this

In[3]:= TrigReduce[A Sin[w t]^3]

Out[3]= (3*A*Sin[t*w] - A*Sin[3*t*w])/4

Note: You may find if your "A" is a large complicated collection of other things then this might confuse TrigReduce to the point where it will not do the transformation that you desire. If that is the case you may be able to use pattern matching and substitution to temporarily remove the large complicated collection, do the TrigReduce, and then put back the large complicated collection.
 
Last edited:
Gah... I was using Sin() instead of Sin[]...

I have TrigReduce working now, Thank you very much! Its always the little things haha

Cheers
 
vadar said:
Gah... I was using Sin() instead of Sin[]...

I have been recommending for a long time that there be a new feature in Mathematica.

This would make things
like sin(x), sin[x], e^x, etc, etc, etc
and many or most of the other simple errors like this

BIG RED BLINKING TEXT!

Now if I could just make that blink I would be done.

Just yesterday I spent twenty minutes trying to figure out why in the world someone's if-then-else code was actually executing BOTH the then and the else... Finally in two pages of tiny printed code I stumbled onto it was if[condition,then,else]. Did you notice that i in if wasn't capitalized? In two pages of dense code? And without a peep of an error message? And it wasn't RED BLINKING TEXT! To find that I had to put Print statements all over in the code until I was able to even see both then and else were being executed and then moving the Prints around until I finally stumbled onto the reason. He had wasted a day trying to figure this out. There is no excuse for the software not pointing this out.
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 6 ·
Replies
6
Views
12K
  • · Replies 3 ·
Replies
3
Views
7K
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
10K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
10K