I am currently running Mathcad 15 on Windows XP SP3 which is a 32 bit operating system. A Mathcad 15 worksheet I am running has to do a LOT of number crunching. Mathcad 15.exe is running my CPU usage at 99% and a RAM usage of about 480,000 kB, as well as locking up once in a while requiring a reboot. I already broke the worksheet down into a number of smaller worksheets, got rid of unecessary XY plots, and got a summation of a summation to work the fastest way possible. Also tried decimation to reduce the load on the system, but found I can't use it, since I lose some of the input data when I do that.
My company's MIS department wants to give me a new Windows 7 64 bit machine. But I notice in the Mathcad 15 specifications that it will only run as a 32 bit application on a 64 bit operating system.
So will running a newer PC with Windows 7 64 bit help me any?
Also I notice under system requirements none of the newer CPUs are listed. With what newer CPUs is Mathcad 15 compatible?
Bill
Solved! Go to Solution.
No, 64 bit will not help with any 32 bit application. But if you are only using 480Mb RAM then it doesn't look like 64bit would help you even if Mathcad did have a 64bit version. Going to 64 bit doesn't make the CPU any faster, it just increases the memory address space.
A newer PC might have a faster processor though
Thanks for the response, Richard.
Would a multicore CPU help any with processing speed?
Will Mathcad 15 work with multicore CPUs?
(I notice they are up to 6 cores now in the newer CPUs.)
Bill
Would a multicore CPU help any with processing speed? Will Mathcad 15 work with multicore CPUs?
I'm sure it will work, but I'm not sure if you will get a speed increase. I believe that depends on whether the compute engine was written in such a way that it can take advantage of multiple cores. The current compute engine was mostly written back when version 12 was develloped, back in the era of single core CPUs and dinosaurs. Since we haven't even got a 64 bit version yet, I wouldn't hold out too much hope that they have done anything that would make it utilize multiple CPUs.
Is Prime any more powerful than Mathcad 15 or is that the same old compute engine?
Bill
It's a new compute engine, .but I don't know how much of the code was simply ported from MC12-15 without the changes that would make it utilize multicore CPUs. I have not compared the speed to MC15. It's something I have been meaning to do for a long time, but real work keeps getting in the way If I'm honest though, I am not optimistic.
I suppose the worksheet is proprietary, and can't be posted? Perhaps there are some things that you didn't think of that could speed it up.
Well, the sheets have a lot of my models in them, but basically the problem when the CPU stays at 99% is with the summation of the summation in the IM example 5.mcd written by Lou Poulo of the "Passband Intermodulation" discussion in the Engineering section. That example is really simple and works fine, but in my case I have to look at discrete frequencies with a resolution of 5 kHz from DC to about 2700 MHz to include all of the 3rd order intermod terms which include the 3rd harmonics of frequencies near 900 MHz. So to meet the Nyquist criteria I ended up using 8192 MHz (x200 for 5 kHz resolution) which coresponds to 1,638,400 data points to simplify the CFFT which works faster at binary. (Although really that is not a problem anyway for CPU usage. It zips right through the CFFT.) The lowest input frequencies are near 150 MHz. Several models use 10 or 11 discrete frequencies or more to simulate broadband rectangular passbands. Using 5 kHz resolution at least splits some of the narrow band stuff into separate frequencies, so I can see where the 3rd order IM products fall. But it would be better if the resolution was even narrower, which is impossible to do now. Also it would be nice to be able to do 5th, 7th and 9th order IM as well which would of course raise the required sampling frequency even higher.
BTW, to get higher speed out of the summation of the summation I already had to swap the two summations.
Lou did a nice job of documenting his worksheet. Anyway, I will appreciate any ideas you may have.
Bill
Have a look at the link below, Richard and Wayne looked at different ways of speeding up worksheets.
http://communities.ptc.com/message/154849#154849
Mike
I forgot to mention, you can also look at number 2 in the document found at the link below.
http://communities.ptc.com/docs/DOC-1743
Mike
Thanks Mike,
Getting rid of the vectorization of the summation of cosines did help in speed on one of my worksheets, but the CPU usage is still 99% while it is running the summation. The other worksheets I had forgotten to vectorize the summation of cosines anyway. They are still slow.
Is it OK to run at 99% CPU or not? Is that normal for Mathcad anyway?
I haven't looked at the other recommendations as yet, but will.
Bill
Without going back to look at Lou's worksheet, as I understand it you have frequencies close to 900, and close to multiples of that, with huge blank regions in-between. So what you should do is deliberatly alias the high frequencies. As an example, set the Nyquist limit at 1200MHz. Then the 1800MHz harmonic will appear at 1200-(1800-1200)=600MHz. The 2700MHz will alias about the second folding point at 2400MHz to 2400-(2700-2400)=2100MHz, which will alias again to finally appear at 1200-(2100-1200)=300MHz. In practice, if you choose the Nyquist frequency carefully you could alias all the harmonics down into a much smaller frequency range, with none of them overlapping. How small that range could be depends on the range of frequencies around 900MHz (i.e. 900MHz plus or minus what?). If you can get a much smaller range then you could both increase the resolution and see the higher harmonics.
Thanks for the suggestion. I could try that, but Lou said in his worksheet that to meet the Nyquist criteria you need to use a sampling frequency at least twice that of the "highest order intermod products". For third order intermodulation, modeled with x^3, this has to include the worst case 3rd harmonics of the fundamental frequencies you are using. And the passbands I am working with can also be very large or very narrow, at many different frequencies. I don't know how that would work with aliasing. The gap between the fundamentals and the harmonics can be large, but many times it is filled with other stuff. One sheet I did recently had very wide bandwidth intermodulation products close to our operating passband but not in it, but I was surprised to find a bunch of little narrowband carriers inside my passband from much lower frequencies, and I didn't think that would even happen when I set up the problem.
BTW intermodulation does not just deal with harmonics. Simple 2 carrier 3rd order intermod, for example, is given as 2A-B and 2B-A where A and B are the carrier frequencies. But it can also be A-B+C and all possible combinations like that. But in both cases 3rd harmonics are generated as well. Also for passband intermodulation, the bandwidth of each 3rd order intermod product is 3 times that of the original passbands.
Lou's worksheet has some good graphics showing what happens.
Bill
The gap between the fundamentals and the harmonics can be large, but many times it is filled with other stuff.
Oh Well. Another great idea goes down in flames.
If you meet the Nyquist criterion, then you don't need to worry about aliasing. However, Richard's thought to allow aliasing may not yet be ablaze.
As an engineering problem, it may be possible to glean some useful info even with aliasing, if the aliased level can be bounded. The levels of the various harmonic or IM terms typically decreases significantly with the order of the term (if the nonlinearity is relatively smooth and well-behaved), so that it may be possible to allow the aliasing, even with band overlap, and still get some results.
For example, if the total power in terms above the 7th are at least -60 dBC, then you could investigate the levels of the 2-5th order terms using fs ~ 10(+) x fcarrier, at least down to the -50db Level. Depending on the analysis you need to do, this may or may not help. At least it's an avenue that may be worth exploring. Presumably, you know where all of the frequency terms are located, since they are an input to the model.
Lou
Thanks for the idea, Lou. Let me make sure I understand you correctly. If I know the highest frequency carrier, which I do, then I might be able to use aliasing. Is this correct? Does it matter what is below that in frequency? I would think it would.
I also know one situation where that would not work. I have a worksheet in which I worked out the distances to the potential interferers, and then I used the Friis equation to get an estimated power level at the receiver. If the potential interferer was a long distance away, then the signal would be very small. So I doubt the aliasing method would work at all with this particular situation. Am I saying this correctly?
But most other situations I don't bother doing that.
Bill
I 'm not familiar with the Friis equation. Regardless, what I am saying is that the model has two possible cases: a) no aliasing, in which case everything is straightforward, and b) aliasing, in which case further work is necessary to sort things out.
I assume you are interested in analyzing particular frequency bands. I am assuming that for most of the signal power is in relative few bands. If these can be placed so that they don't overlap - i.e., alias - then the total remaining power is bounded and becomes the effective resolution of any other measurement. For example, suppose that at a frequency of interest (with aliasing), the model shows that the magnitude of that component is -30dBC. If the all of the power except for -40dBC is accounted for by signals in non-overlapping frequency bands, then the -30dBC level is known good to approximately 1dB, since the potential interfering alias power is at most 10dB lower than the signal of interest.
Whether this technique can be used practically depends on the complexity of the model and the actual numbers. It's only a possible idea to allow the aliasing if the alias overlaps can be bounded in magnitude. If the signals you are looking for are smaller than the bound you can put on the possible aliasing, then this scheme won't work.
Hope this is a bit clearer than the first brief description.
Lou
Lou,
The Friis equation gives the path loss in free space for a given distance.
Thanks for the extra detail on aliasing. I can see where it might work in certain situations, but not in general.
I have been trying different things with the way I have this problem now in Mathcad 15, and learned a bit more.
One additional problem I found in running a high number of data points is the XY plots. They take a very long time to print on our networked Canon C5051 printer. Mathcad 11 does not have this problem since it only allows 150k or 500k (I forget) data points to be printed. (This reminds me of the "good old days" when we had a networked HP color laserjet printer, and it would take hours to print a large pdf file.) I had to print at night. Of course with 11, I can't print what I need either.
So I have broken down the problem into different Mathcad 15 sheets up to the summation of the summation with no graphics, and then reference those sheets in a Mathcad 15 sheet with the rest of the method including all the graphics. I was able to get the total processing time down to about 90 seconds that way, with CPU usage still at 99%. But it looks like in general I will have to capture the XY plot screen images and save as gif files and then print those. Also plotting the entire 1.6 million points in a single graph will usually not work, and can cause Mathcad 15 to lock up sometimes requiring a reboot. But plotting small portions of the frequency range in an XY plot seems work fine, although I have to be careful to not have any other application running at the same time, as it will still lock up requiring a reboot.
Lou, I also noticed another problem with speeding up the CFFT. I understand if I use 2^N data points it will run faster. So I tried using 8192 MHz for the sampling frequency, but I forgot about the 5 kHz resolution (Tmax = 200) which results in 1,638,400 data points for which there is no 2^N. Now I understand why you chose to use the CFFT instead of the FFT. I was also hoping using the FFT would reduce the number of output points by half, which would help with plotting the full frequency range. Since in my case, I am using all real numbers, the upper half of the CFFT results are the complex conjugate of the lower half. So I could throw away the upper half. The FFT does that already.
BTW I sent a link to this post to our lead MIS guy, and he agreed with everything you said, Richard. But he still thinks Windows 7 may help. He is giving me a 4 core CPU for Windows 7 Enterprise Edition. He said if Mathcad 15 only uses 1 core, everything else could use other cores in the CPU. This could help with stability.
I have another PC savvy friend I know who suggested that my problem with stability running Mathcad 15 on Windows XP may be due to all the Microsoft junk that accumulates in the Windows XP services with time, with all the updates. And sometimes even the Microsoft updates themselves can corrupt things. I think he could be right (I have seen this before). I have always had stability problems running Mathcad 15 on XP, which is the reason I usually run Mathcad 11 except when I need to run Mathcad 15 for the new features or speed. And that includes my older XP SP3 machine at home. (I own a license for my own use as well as the company owned one I use at work.) At least Mathcad 11 is very stable.
Stability is more important than speed. If I have to wait a while I can live with that. But crashes locking up the PC requiring a reboot are the biggest problem.
Maybe Mathcad 15 just grabs all the resources it can find which results in this kind of problem, whereas Mathcad 11 is limited in what resources it uses?
I might try using Mathcad 11 for the individual worksheets with the summations of the summations and then reference those documents in a Mathcad 15 worksheet with the rest of the method including all of the graphics. Maybe that would help with stability.
Bill
CFFT works faster if the number of points has many factors. So your number is not so bad, because 1638400=2^16*5^2.
You should be aware that in MC11 CFFT has a memory leak, so calling it repeatedly without closing and restarting Mathcad will probably cause problems.
For plotting, see the attached function. You can use it to reduce the number of points to something manageable.
Mathcad Prime 2.0 will take advantage of 64-bit machines.
Mona
Mathcad Prime 2.0 will take advantage of 64-bit machines.
Yes, I knew that wa sin the pipeline. Will it be able to take full advantage of multicore processors though?
I tried my idea of using Mathcad 11 for the summation of the summation worksheets, AND IT WORKED.
During the summation of the summation operation I never see over 50% CPU usage with Mathcad 11. But I always see 99% CPU usage with Mathcad 15. I still run the CFFT and the graphics in Mathcad 15 referencing the other Mathcad 11 worksheets. The total calculation time for 3 Mathcad 11 documents and the single Mathcad 15 worksheet is 77 seconds. (I think it was a little faster since I eliminated one of the 1 1/2 million point graphics in the Mathcad 15 document.)
And it never crashed, although moving around some of the graphics in Mathcad 15 was a little awkward. I had to be very patient and let Mathcad 15 complete what it was doing each time I moved a graphic with the mouse.
Richard, thanks for the decimate program, but I tried that earlier and I found that the narrowband (which I modeled as a single frequency each) stuff got dropped from the sheet.
Mona, is there a way to prevent Mathcad 15 using 99% of CPU?
Another bug I noticed was in printing any of the Mathcad worksheets on the networked Canon printer. I would print and see the document sent to the printer message my workstation. But it would not appear in the print queue on the printer. But it would eventually print about 79 minutes to 2 hours later as seen in the time difference between the worksheet and the print log in the printer for the Mathcad 11 worksheets. The Mathcad 15 worksheet did not even appear in the printer log. Today is the first time I have seen anything like that. It happened multiple times. I will get a trouble ticket in on the printer.
Bill
Richard, thanks for the decimate program, but I tried that earlier and I found that the narrowband (which I modeled as a single frequency each) stuff got dropped from the sheet.
I only intended you to use it for the plotting, nothing else. You never need over 1,000,000 points for a plot.
Richard, I tried decimation on all of the XY plots I use in Mathcad 15. I decimated by 10 and then also tried 2. It doesn't bother the broadband stuff too much, but it still drops narrow band carriers in the plots. Thanks for the suggestion, though.
Bill
it still drops narrow band carriers in the plots.
If you are plotting the entire frequency range I don't see how that's possible. You cannot possibly resolve >1,000,000 points on a plot.
The reason why it drops narrowband frequencies, is that they only occupy one discrete frequency. For example 463.075 MHz. Because I am only able to see in 5 kHz steps, I round to the nearest 5 kHz increment, which in this case remains 463.075 But that is still only 1 point out of half of 1,638,400. If I decimate by 2, that one will disappear becuase it is not on a multiple of 10 kHz frequency.
And if I round to a higher number like 10 kHz, then I won't see any intermodulation between 2 frequencies that are very close together, because they will be on the same frequency. These days the FCC is putting 2-way stuff on frequencies like 464.6875 MHz. So I should really be using even tighter resolution if I could.
Two other possibilities to reduce the data:
1) Change the decimate-by-N routine to give the largest of the N samples in a group, rather than the mean or a particular element. This has the effect of peak detecting, so you won't miss values. If something is large, you can then look at the details in the original data.
2). Augment the freq's and corresponding amplitudes into a 2-col array, and then sort on the aplitude column. You can then select that subset - presumably small - of rows that have amplitudes larger than some threshold. Then just plot/analyze those.
Lou
Lou,
Thanks for the input, but I don't quite understand what you are suggesting. Could you please show it on the example I just presented for Richard, Example 5 061911.mcd (modified from the 3rd order Intermod discussion we had previously in the Electrical Engineering section)?
Thanks, Bill
I added the select-by-amplitude method to Richard's sheet.
Lou
Lou,
I compared your results to the original, and it appears the amplitudes are not right. They look like they are compressed. See attached.
Bill