Smath Examples Blue Variables

Smath Examples Blue Variables - What are the blue variables - Messages

#1 Posted: 3/26/2014 8:54:50 AM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

I see in the smath examples, specifically I'm looking at the portable version reference book (very helpful by the way), the variables are in blue color and are not "normal" variables. What is the difference and how do you use these?

Thanks!
#2 Posted: 3/26/2014 2:53:39 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

The blue variables are units, see the handbook page "Units of Measurement"> "Units in Results Display".
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 3/28/2014 2:53:45 PM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

Thanks for the response. I think I am referring to something different though.

In the handbook if you go to Examples-> Bending of a beam. l.0 and q.0 are blue. They are not "normal" variables because if I type l.0= It returns nothing. However if I copy and set this variable equal to something then I receive a result.
#4 Posted: 3/28/2014 3:31:47 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

Those are "units like" variables - starting with apostrophe.
Here is a simple example

Regards,
Radovan

nutsbolts.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Posted: 3/28/2014 3:37:28 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Thanks for the response. I think I am referring to something different though.

In the handbook if you go to Examples-> Bending of a beam. l.0 and q.0 are blue. They are not "normal" variables because if I type l.0= It returns nothing. However if I copy and set this variable equal to something then I receive a result.


Not really different. The blue variables are just custom units. This was my standard way to parametrize my sheets before I could use Maxima for symbolics. The benefit is that you can do plots and numerical simplification with such variables.

In Maxima, these variables should be assumed to be positive. This, however, does not work currently. Thus, I have to add the command Maxima(assume('l.0>0))=
Then the sheet works fine.

example maxima beam.sm (35 KiB) downloaded 77 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Posted: 3/28/2014 6:15:34 PM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

Some day the thanks button will work for me... but thank you.

Quote

The benefit is that you can do plots and numerical simplification with such variables.



Can you possibly elaborate on this? Why is it possible with only these variables? You had other variables, well I take that back I suppose the only other variable that was "normal" was x however all your equations were functions of x. Which is acceptable to smath, I suppose? Using Maxima though none of that would matter, you could use "normal" variables?

Thanks again!
#7 Posted: 3/28/2014 7:15:59 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Some day the thanks button will work for me... but thank you.

Quote

The benefit is that you can do plots and numerical simplification with such variables.



Can you possibly elaborate on this? Why is it possible with only these variables? You had other variables, well I take that back I suppose the only other variable that was "normal" was x however all your equations were functions of x. Which is acceptable to smath, I suppose? Using Maxima though none of that would matter, you could use "normal" variables?

Thanks again!



OK, I try to describe what I understand so far. In SMath, expressions containing undefined variables, cannot evaluated numerically, nor can they be plotted (except for x in plots). For plotting and numerical evaluation, any unit is converted to the base unit of the corresponding quantity and this base unit is replaced by 1. Custom units are base units of their own as long as they are undefined.

In Maxima, this difference does not matter. In evaluation, always symbolic results are generated, which eventually can be evaluated numerically by SMath. You always see the original Maxima result if you set Optimization> None. Some symbolic operations in Maxima depend on assumptions if a variable is positive or real. You can declare such properties, but not all operations and in particular not the simplifier care about these assumptions.

Sometimes, Maxima asks the user for added information, which in most cases is plainly annoying. E.g. Maxima allows you to have the upper integration limit being less than the lower limit, thereby reversing the domain. That might be funny for the math people, most engineers do not see any benefit in such flexiblity. In order to mitigate that, the plugin automatically responds to such questions with "pos" and issues a message that such an assumption has been made. That allows the user to suppress the question by an explicit assumption. See the Maxima test suite in the interactive handbook (Plugins> Maxima> Maxima Test (the link is at the end of the page).

The plugin tells Maxima to handle units just like other variables, but always assumed to be positive, that seems a little broken at the moment. Sometimes bug fixes and new features in the plugin have side effects which are not immediately recognized, because of the limited variety of test examples in the test suite. We would need a fully blown regression test over all existing SMath sheets with Maxima commands in them, but we don't have, unfortunately. The closest approximation to such a test is the test suite mentioned above, which contains screenshots for comparison with the expected result.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Posted: 3/31/2014 10:46:19 AM
Ryan Freund

Ryan Freund

19 likes in 339 posts.

Group: User

Thank you!
  • New Posts New Posts
  • No New Posts No New Posts