Maybe I'm remembering that the way I stumbled onto that was For, LoopBody] instead of n++ or n=n+constant. Tracking down exactly what the root problem really really was might teach something and avoid that problem in the future.Ī brain cell somewhere is making me think that years and years ago I stumbled across "unexpected behavior" with For. Most things should be just as happy or even happier with 3*Pi/10 than with 0.942478. Then, if you absolutely can't resist the compulsion, you can stick in an N where you really really need a decimal approximation and that isn't being handled automatically by Mathematica hiding in the backgrount. That will avoid 20*ReallyReall圜loseToPiOverTen being either being slightly less than or slightly greater than ReallyReall圜loseToTwoPi and thus having 19 or 20 or 21 iterations and you can't figure out where the extra one is or the one that is missing went. Or get rid of all the approximations and do it exactly For[rPos = 0, MAXRPOS <= 2 Pi, radiusInc += Pi/10, In languages such as C++ and C#, the type of object or variable determine how comparison operators (such as =, =) are interpreted. Are opFreq and relPermittivity numeric types or objects? Is there a way to use strong typing in Mathematica? If I write: H := Module Īnd call this with H. This begs the question: what type of variable is a function argument where the default value is used? If arguments with numeric default values are seen by Mathematica as objects instead of numeric values, comparison operators will probably not work as expected and arithmetic operations may be returning a type of object instead of numeric value. I am also noticing that some parameters being passed into functions with default values do not show up in the variables debug window as numeric values. I have multiple copies of Mathematica on desktops and laptops - so I will try this on different machines. Thank again to Bill and all who took a look at this. Finance, Statistics & Business Analysis.Wolfram Knowledgebase Curated computable knowledge powering Wolfram|Alpha. Wolfram Universal Deployment System Instant deployment across cloud, desktop, mobile, and more. Wolfram Data Framework Semantic framework for real-world data.
0 Comments
Leave a Reply. |