The tradeoff will then be between number of terms and complexity in the range reduction. But you may choose a larger interval, just accepting a few more terms in the series. For example, if you do range reduction to +/-pi/4, the series will converge much faster yet. In fact, there are some simple tricks to further reduce the domain of interest. You just need to take a few more terms for the larger domain. For example, if you look at the series for sin(x). You will first need to decide if you can get satisfactory convergence over that interval, with a reasonable number of terms. That suggests you can do this: Xhat = mod(x,2*pi) - pi Ĭan you do better? Well, yes. You can pretty easily deal with that, since you would have this identity: sin(x - pi) = -sin(x) The Taylor series for the sine function will converge better if Xhat lives in the range [-pi,pi), instead of [0,2*pi). Where does Xhat live, as compared to x? What do you know about sin(Xhat), as compared to sin(x)? If you are not sure, try some values! Play around. What does this do for you? Xhat = mod(x,2*pi) But that would be wild overkill for basic homework.) (Note: you might decide to read how I coded trig functions in my HPF toolbox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |