Dot Vector Rules

Dot Vector Rules - Dot Vector Rules - Messages

#1 Posted: 2/8/2016 2:57:15 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Ioan,

Here are some rules in Smath to avoid pitfall.
"Syntax error" ... no more.

Jean

Utilities Matrix Vector Dot.sm (10 KiB) downloaded 120 time(s).
2 users liked this post
Davide Carpi 2/8/2016 2:54:00 PM, ioan92 2/8/2016 5:31:00 AM
#2 Posted: 2/8/2016 8:43:05 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Caribou steak [renne] is not common in Canada, wolves have the preference.
Read few more Smath bugs in the attached.

Besides the native Pentium bug, there are the silent bug.
At least two software were known to freak the floating point.
It happened to me from downloading something named "Source Forge"
Since, I grew wiser !
Another type of bug is caused by the granularity of the system.
Numerical calculations do not necessarily repeat. If in the range
of granularity, same calculation in two different times may look
different. One way to notice that is by timing calculations that
take some time ... they never exactly agree because of cycling
may have different granular length.

At the beginning of the X-Box, most games would freak the FPU.
Solution: give the PC to the kids, purchase a new one.

Engineering work must be presented simple/neat/... for sanity check.

jean

Utilities Matrix Vector Dot.sm (41 KiB) downloaded 66 time(s).
1 users liked this post
ioan92 2/9/2016 2:50:00 AM
#3 Posted: 2/10/2016 1:46:27 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Thank you very much for your patience and for your wise lights.
All you said is right but this do not doctor my sickness.
[C'est comme une cataplasme sur une jambe de bois.]
Now I'm cleverer but all this do not exempt me to loose again my limited time, by fighting [les moulins au vent]...
Today, I stumbled again on the same kind of trouble: a piece o code is working well when is layered region after region and stops working when is behind a line or a function name.
In my mind both this operation should be neutral, while the same information is supplied. I feel as facing a capricious device.
It's possible that there are some "mystic": "to do and not to do".
Finally, with a lot of effort, I overpass this but it is [fatigant]. For me, the programming is nothing else then a tool; my objectives are something else.
I see spending more time with the tool then with my engineering problems, is as when you climb a mountain with very tight trousers.
I'm simply disgusted.
Now, I promise to stop complain.



________________________________________

Salut Ioan,

Smath: comme l'aveugle qui demande au "cul-de-jatte"
comment ça marche, comme tu vois !

Blind man asking the legless "comment ça marche" ... like you see.

Please, report all what you encounter. Very few visitors attach project.
Up until now, Smath does my "Mesures & Régulation" projects very well.
Other advanced projects make me sick and tired. There are bugs never
reported because not enough users working true projects. Here is the
last one. I defined a function upstream a program, then copied the
program in a blank sheet but not transporting the depending function.
It should have turned red in the blank sheet. Guess what: it did work
w/o the depending function ... like you mentionned before "encapsulation".
Smath is however very gorgeous for sanity check by steps.

Reading my mind about some projects Smath does perfect, no flaw:

1rst/2nd order DE Laplace solver [does more than these two]
Bézier svg [Made work by Davide]
Partially filled thank/sphere [segment with random compressor]
Modeling discrete PID and Laplace modeling.
2D interpolate in data table [linterp] ... everyday Engineer task.
"Genfit", they all work well and fit nicely.

No shame to admit that I crucified myself attempting to rotate an image
like rotating a photo, grayscale. I have this program from Paul W.
in Mathcad 11. It works perfect, much better than the Mathsoft "rotate".
Smath gives me hard time. Sometimes "some God" tells me:
Jean, you are not pregnant enough of Smath, thank you Sir !

Alternately to Smath for Engineers: PTC Mathcad, but their forum
is about void of projects, except from Russian Users.

One of the most precious function Smath is missing "on error"
It's this function that enables the "RotateImage" work, where
there is not pixel match, it fills with a user background.

Remeber: ducks dine bottom up [les canards dìnent le cul en l'air].
Your observations have been most precious to me [hopefully to more].

Cheers, Jean



1 users liked this post
ioan92 2/10/2016 10:51:00 AM
#4 Posted: 2/10/2016 9:09:29 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Ioan,

Thank you for sharing your thoughts on SMath and engineering and software in general. Many users in this forum have explored the chances and risks of using SMath. They drive their experiments to the edge and at some point find out that further advance in mastering the software is increasingly hard work. For practical applications, it is important to reliably tell the minefields from safe ground, otherwise the results become unreliable.

For me, SMath is a software which supports you in performing and documenting engineering calculations, which you otherwise would perform with paper and pencil and pocket calculator. The greatest advantage over command line oriented tools like Maxima or Matlab is that up to a certain level of complexity, SMath sheets can be understood by people not familiar with SMath. This is also a big advantage over excel. Spreadsheets are useful for performing engineering calculations but definitely not for documenting them.

Once you start to write programs and complex functions in SMath, there is no advantage any more. In contrary, you start to suffer from failing to comprehend the variable name scoping, delayed evaluation rules. Or may be from lack of consistency of the implementation, who really know?

Thus I decided to focus on the paper and pencil replacement level in the application of SMath studio. This should save me from solving problems which I would not have without SMath studio.

Many contributions have been made by uni, Davide and recently Alex which really improve the user experience within the limits of what is possible with the current API.

I also follow the discussions in other forums, CalculiX was already mentioned, Maxima is another one. The maxima forum is special in that the process of software development, agreeing of procedures, rules and priorities is discussed openly in the public in a very competent and well moderated way. In the SMath forum, I see near to no moderation in such basic discussions, that might be the reason, why the same topics are discussed again and again and no real common understanding of what are the background rules under the hood is achieved. My handbooks, be it the german pdf version or the interactive bilingual one, are entirely based on sort of reverse engineering. Doing experiments and trying to summarize the observations.

Upon writing this, it occures to me that an individual reason for overstretching the use of Smath is in the considerable effort that it takes to get up and running with the software. Remember, how long it took you to find out how to input the iterator double dot? How did you find out about the range function? Some of the maxima guys say: we don't care the beginners. Every user is a beginner just once and why should we waste our time in attracting people with limited committment instead of doing the really interesting stuff.

Usually, the more time we spend with SMath, the more intense is our desire for useful application, for benefitting from SMath usage. We want our effort to pay. We try to use SMath for as much of our tasks as possible and sometimes cross the border from safe ground to minefield. And sometimes the mines explode.

If I recall correctly, Andrey has never claimed to replace programming languages, Computer algebra systems, spreadsheets or numerical labs and plotting software by SMath. His original statement was "pencil and paper replacement". I decided to keep that in mind. That's why I like the writer region and the editable image region and the function extensions with my favourite at() operator. An intuitive plotting region is yet to come. Mathcad 8 is the benchmark for this.

In the calculix forum, some structural engineers complained about how useless solid elements are for civil engineering and requested real beam and shell elements to be implemented. Nevertheless, calculix is basically a finite element program for solid structures typical for mechanical engineering. If you go beyond what the author had in mind, you are on your own and need to find out if that is worth the effort. Seems to be always the same game.

Best regards, Martin


Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 users liked this post
Davide Carpi 2/11/2016 5:37:00 AM, ioan92 2/11/2016 4:04:00 AM, Radovan Omorjan 2/11/2016 4:57:00 AM
#5 Posted: 2/10/2016 11:29:03 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Reading Martin's words I wonder if it could be possible a number of commands to change the internal behaviour of SMath. I mean a number of plugins to permit alternative keywords to patch the unreliable (for the moment) zones of SMath. For example:
- if variables scope is not well understood in functions, create a command called 'Sub' which tries to bypass the known issues
- if you want to use the -> operator from the first days, maybe it is possible to create such an operator (even the gui button) to force different optimizations at will
- a line command with special cas and scope behaviour
- a number of automatic checks upon the entire sheet to launch warnings to the user based on the famous survival rules
- maybe there is some way to colorize parts of your sheets depending on which optimization is going to be applied upon them
- what about an alternative keyword for Eval which deals with its oddities
- an option to overwrite the default functions in Smath which are known to fail in certain situations
- an option to automatically assign optimizations based on survival rules
2 users liked this post
Radovan Omorjan 2/11/2016 4:57:00 AM, ioan92 2/11/2016 4:04:00 AM
#6 Posted: 2/11/2016 2:41:11 PM
kilele

kilele

133 likes in 397 posts.

Group: User

@ioan92
Thanks for the kind words and the book references.
Maybe I was too bold when saying the words patch and overwrite. It sounded like a mild rev against Andrey! I rather meant a sub-SMath version through what it is only permitted by Andrey meaning the plugin interface Instead I should have referred to overloading not only of functions but also of internal Smath behaviour if this is possible, for example an Eval with more parameters, an alternative line() where scope and optimizations are tamed by the user, keywords to disable/enable symbolic optimization, a set of checks to warn the user about possible issues as it is done in compilers and antivirus programs, a set of checks to detect discrepancies of the default functions with the ones calculated by the alternative plugins,etc
1 users liked this post
ioan92 2/11/2016 2:54:00 PM
#7 Posted: 2/11/2016 11:48:07 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

I can make it short, guess my trick ?
I saved in Smath work sheet for my "bed time reading"

You [Ioan, Martin, Kilele] are very objective. In different words, I join.
Talk is talk from the mouth, picture speak with the eye. So, I'm collecting
the unsolved projects and bugs. In the mean time, please read the attached.

It resumes Smath power and weakness, i.e: many of our discussions.

1. Bug in Smath matrix rank.
2. Inconvenience not nesting (a b):= (something something)
.... add few more nesting. By not nesting, it excludes piecewise sanity
.... and transport to pocket calculator.
3. Glorious matrix rank rescued by Maple.
4. Compacted program version: piece of gold [Martin's mine didn't explode].

Smath for ever !

Cheers to all. Jean

Matrix PseudoInverse.sm (109 KiB) downloaded 59 time(s).
1 users liked this post
Radovan Omorjan 2/12/2016 5:46:00 AM
#8 Posted: 2/12/2016 6:09:38 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Jean and all

Similar comments were periodically posted here on the Forum. My respect to all the people who expressed their thoughts and their frustrations regarding the SMath's peculiarities (or "minefields" as Martin pointed out).

By the way, thank you Jean for another nice example. Here I tried your example by declaring rank(A) as Symbolic, not Numeric optimization and replacing r:=maple(rank(A)) just with r:=rank(A) in defining x variable and it worked fine. See the live file please

http://smath.info/cloud/worksheet/ByDdVndk

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 users liked this post
ioan92 2/12/2016 6:14:00 AM
#9 Posted: 2/12/2016 9:54:36 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

I’m scared by the sod’s law, saying that: "at the beginning,
the troubles start by addition and continue by multiplying".


_________________________________

Can't be more right, Ioan.

Numerical arithmetic of large numbers might drift. Steven Finch from Mathsoft
made an extraordinary demo about the Mathcad Odesolve drifting to non sense.
On that, Smath is not so convivial but lot more secure because it is based on
RK discrete solver only [Homo Smath-icus].

Read what lady La Touche wrote:

"I do hate sums. There is no greater mistake than to call arithmetic an
exact sience. There are ... hidden laws of number which it requires a mind
like mine to perceive. For instance, if you add a sum from the bottom up,
and then again from the top down, the result is always different".
Mrs> La Touche [19th Century].

Visit the "mines fields" I will attach for Radovan
Enough to drop dead "Matrix solve" !

You are right, Engineers are always cautious of verdicting results.
Team work is more comfortable than working in solo. The man alone has
nobody to cross check. A small errors might end disaster.
Matrix look innocent, not so much when it comes to copy/paste. It must be
serialised [Unwrapped], then packed back. From recollection, my Mathcad
[speed light] would take minutes to copy/paste 1 millions elements.
How big is your matrix ?
To make it worst, reading image [as many other type of caculations] the
time to compute goes ~ exponential. Very soon, Cramer will not have stopped
and the planet Earth will be gone, while Gauss elimination will give you many
more lifes to enjoy... still too slow: Cholesky method, is hyperfast.
I hope Andrey will come back safe from hunting bear, like this Russian hunter.
He had special permit to hunt bear, so he went but forgot his lunch box.
Bad encounter, a 3½ meter bear appears, Oh ! the man moved back, stopped by
a tree ... God, I promise in my next life I will never hunt bear again.
The bear dropped down on foot, and both went hunting in replacement of the
lunch box. Morale: go nowhere without toilet paper and lunch box.

Sometimes it happens to me, Smath work sheet turns all white, chasing flies.

A+ Ioan and all Collabs

Jean


2 users liked this post
Radovan Omorjan 2/13/2016 4:18:00 AM, ioan92 2/13/2016 3:43:00 AM
#10 Posted: 2/12/2016 10:16:48 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Thanks Radovan,

Works fine. For your distraction, here is a "Martin's mine fields"

Jean

Utilities Matrix Solve.sm (48 KiB) downloaded 64 time(s).
1 users liked this post
Radovan Omorjan 2/13/2016 4:17:00 AM
#11 Posted: 2/13/2016 11:15:28 AM
kilele

kilele

133 likes in 397 posts.

Group: User

I won't bother you any further with my suggestion to make a minefield detection plugin. Hopefully all these worksheets pointing out landmines will be useful if I ever dare to give visualstudio a try.
Let's see the landmine commented by Ioan, AFAIK there is a 'checked' keyword in C# to catch Overflowexception in your operations. In such cases you could cast the numbers involved, for example upcasting them from int to long. This approach of throwing a number of custom blocks of try/catch exceptions could be used for a more general Acme minefield detection system
2 users liked this post
ioan92 2/13/2016 11:21:00 AM, Davide Carpi 2/13/2016 11:39:00 AM
#12 Posted: 2/13/2016 5:05:59 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Could these paper and software be of help for Andrey?
http://blog.freearrow.com/software/craft
Anyway it sounded good to me: "automated floating-point precision analysis"
1 users liked this post
ioan92 2/13/2016 5:27:00 PM
#13 Posted: 2/13/2016 11:02:01 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Could these paper and software be of help for Andrey?
http://blog.freearrow.com/software/craft
Anyway it sounded good to me: "automated floating-point precision analysis"



... Very interesting, thanks.
That will not apply to Smath as long as it will not implement
the 64 extended floating point. Mathcad/MathSoft, Mathematica ...
implement all that [Mathcad/MathSoft does not explode to the
user, unlike Mathematica that gives more than needed]. That
deep analysis does not relieve numerical inexactitude from
various solvers.

There is more under the hood, tell us what !
Read slow: in one way or another, the Pentium implements some
version of Cody Junior numerical approximations for many
primary/secondary functions [trig fncts, exp, ln ...]. In short,
those functions are those from Hart et al. They are protected
from FPU instabilty at their extreme range ... why so ?
Because: those functions are rational fractions of high order.
Wonderful to allow parallel computing on big mainframes [Cray ...]
but numerically unstable because of the high order num/denom
polynomials. ChebyShev approximations are much more stable but
required 3 times higher computation load and do not allow
parallel computaion.

All that said, Pentium computes on floating digits equivalent
to 21 decimals. For ultimate user protection, only 15 decimals
are conserved to meet published tables [Abramowitz ...].
Smath resources those functions from Windows, nothing else is
needed because there is nothing more to check.
Why tuncate from 21 down to 15 ? Not only to meet reference table
but to meet X^Y. That one is double based on exp & ln. Their
combined truncation goes from 21 to 18 then 3 more down 18 to 15.
My old wonderful "Kalkulator 2.27" outputs 18 decimals.
In Mathcad/MathSoft, you can force any result to more than 15 decimals
by evaluating symbolic to max 21 decimals... no matter 21 decimals
unless pure demand [sqrt(2) ...] only 15 are true on usual computation.
What that means is that a numerical integration in between degrades
result to unknown [5 to 7 decimals are generally not arguable].

Jean



  • New Posts New Posts
  • No New Posts No New Posts