Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
I have an issue plotting in Mathcad 15.
I am trying to plot a 3D surface, and I received a message that I have never seen before:
"Specified cast is not valid."
I do not know what that means and do not see the problem.
I could calculate the matrix that gets all the values for the surface calculation, but at the moment of plotting it, I receive that message.
Thank you in advance,
Rogelio
The error message looks like it doesn't stem from Mathcad but rather from the underlying programming language.
I guess to get help you would have to attach your worksheet here so we can see whats going on.
Hmm, this is what I see when I open your worksheet
No error message.
Here is the result when no lines were plotted but the contours filled and drawn
The error message you reported may be caused by some installation/software problem on your machine.
I have no idea if this could be of any help, but I resaved the sheet and attach it here. I also have removed the border around the plot because I remember that many people reported problems with 3D plots in MC15 when Windows 10 was brand new and one of the workaround suggested was to remove the border. Just a feeble attempt - if it does not help, then it should not hurt either 😉
Should have nothing to do with the plot failing, but I noticed that it looks like you are not aware that the default setting of ORIGIN is 0. This means that the first index in a vector or matrix is 0, not 1. Your ranges are defined to run from 1 up and the definition of your matrix ma uses these ranges. This means that the first row and first column (both have index number 0) never were assigned a value and so they default to zero. You can clearly see that in the display of Ma. I guess this wasn't done on purpose.
I was also surprised that in the defintion of x and y you are mixing meter and feet. Because the ranges start with one, the first value in x and y are -1meter+1feet = -0.605 m = -2.281 ft. Was this done on purpose?
That is interesting,
So, would it be something happening with my version of Mathcad 15? It was good until the last time I used it.
I opened a file in Prime 8, and the 3D plot is ok.
Any suggestions on what I should do?
Regards
Rogelio
Not sure if you saw that I had edited my reply and attached the resaved file with border around the plot removed. I guess that you encounter the same problem with that file, right.
I attach a new version of that file here. I changed the range definition and the definitions of x and y so they both run from 0 ft to 200 ft with a stepwidth of 1 ft.
You can see in the pic that this causes the vertical planes caused by the wrong zero values to go away
I also added another way to create that plot by using CreateMesh - it was necessary to define a unitless auxiliary function to do so.
But I have no idea if these change would affect the severe problem you encounter.
Usual questions would be like "what did you do, which setting in the program or OS did you change, which new software did you install since the last time the plotting worked" and the usual answers are "nothing" or "I don't know".
Its hard to track down a problem like this as its not even clear who/which program is throwing this error.
One of the usual (quite helpless) suggestions is "Try to de- and then reinstall the software" and I hate to admit that thats the only thing which I could think of at the moment as quite often following this advice is just wast of time.
Did you search this forum and/or the internet for this very specific error message? Maybe someone had a similar issue and found a solution ...
Hello Werner,
As you realize, I did not see your previous attachment.
But, I do know what I have new:
Yesterday, I had to do an update on Windows 11. The update should have been very serious because it took about an hour.
That is the only thing I have changed, but as you know, the program runs by itself. It could have been that the new version of Windows does not support something on Mathcad.
I will check the information you sent in the two last messages and see what happens then.
thank you very much for all your help,
regards,
Rogelio
And also, for some weird reason,
i did not read that second message from you completely, where you mentioned about the Windows 10 issue.
and that is what I think that the problem was when I updated it yesterday.
thanks again,
The Win 10 issue was reported quite a long time ago when Win 10 was new and was not yet an officially supported OS for Mathcad 15. BTW, which service release of MC15 are you using? The latest is M050.
I am not aware of seeing problems reported later and the issue was, as far as i remember, that the 3Dplots simply did not show but there was no error message. Suggested solution was amongst others removing the border around the plots. Other suggestions would involve to lower the colordepth of the whole windows installation and to tackle with the DirectX settings.
But your problem sounds differently, I just removed the border because I had no other ideas what to do 😉
A windows update might be a candidate for being a problem creator.
You may try a rollback (time consuming) or you may try to create a virtual machine with Win10 or Win 11 and install Mathcad there (you will have no license for the virtual NIC but it should run in 30 day trial mode) and test your file here. But if it would work there this still would not be a permanent solution for you as you still would not know what to change in your installation.
Its of no help at the moment but I am sure that here are others which already run Win11 (I am still on Win 10) and still use real Mathcad. If the Win11 update causes problems, I would expect further complaints and maybe someone is able to come up with a solution.
Thank you very much, Werner, for your thorough explanation. I will search on Google to see if someone else has the same problem already. Is it possible that if I create a case with PTC they will know what to do?
Thanks,
Rogelio
@rdelascasas wrote:
Thank you very much, Werner, for your thorough explanation. I will search on Google to see if someone else has the same problem already. Is it possible that if I create a case with PTC they will know what to do?
PTC isn't supporting Mathcad 15 anymore but it may be worth a try to contact them anyway.
But be prepared that their "solution" may be that you should downgrade to Prime 8 🙂
I searched PTCs Knowledge Base for the error message "Specified cast is not valid" but the only result was about a VB API application crash in Creo - nothing about Mathcad.
Good luck!
Prime 8 only plot 40000 points in 3D plot.
And I downloaded the two files you sent to me, and I am having the same issue.
Regarding your questions: I use ORIGIN=1 most of the time, but when I sent you the file, I had to cut a bunch of stuff from the original one, which is about 13 pages long, and I cut the definition of ORIGIN when I did that.
Also, I sometimes have to use mixed units because the potentials that I calculate will go infinite if the calculations of the bottom part of the equation are zero. If I mix the units, that will not happen.
thanks,
Rogelio
I just continue poking around like a blind ...
The problems with 3D plots in former times which I mentioned affected MC14 and MC13 and seemed to have been related to OpenGL in Mathcads 3D plot component in combination with hardware acceleration. The prpblem not only was that the plots would ne be dislayed but also Mathcad freezing and crashing.It was a problem of the pre-Win10 era but I remember it bubbles up again when Win10 came out.
https://www.eng-tips.com/viewthread.cfm?qid=190557
Instead of disabling hardware acceleration completely (not sure if this would work in Win10/11 anyway) here is a description of a registry entry to change to turn off hardware acceleration in Mathcad only:
https://community.ptc.com/t5/Mathcad/Crash-when-inserting-3D-plots/m-p/243094/highlight/true#M94779
Because of the error message you get which was never mentioned in the past its unlikely that your problem is related to that old problem, but nevertheless it might be worth a try to temporary change that registry entry and see what happens.
Guess you will have to create yourself the 16 bit DWord entry "ForceSoftwareRendering" in the "3-D Plot" key and then set it to 1. At least it wasn't present on my machine.
Thanks, Werner, for all your help and deep analysis. These resources are a little advanced for me, and I do not understand them quite well.
What I will do meanwhile a solution for this issue is found is that as soon as I have my Mathcad 15 file ready, I will convert it to Prime 8.0 and plot it in Prime. I wouldn't say I like this option because Prime versions are inferior in their possibilities for 3D plotting, but I do not see any other choice now, to keep up my projects delivered to my clients.
Thanks again,
Rogelio
Rogelio