Evaluate expression for a variable(s) set to a number

Evaluate expression for a variable(s) set to a number - Mensajes

#1 Publicado: 10/4/2014 16:26:17
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: Moderator

Hi All,

So I am using Smath Studio for personal projects (I am converting from Mathematica that I no longer have access to).

Here is a very simple task i need to do and yet after 30 minutes of search I still do not know how to achieve it:

Say I have g=h+j-k+100

How do I evaluate g for h = 1, j=2, k=3?

I have found that if g=j+2, setting g(j)=g will do the trick for one variable only: g(1)=3, while g=j+2.

In mathematica it would be as simple as g/.{h->1,j->2,k->3}

This would come in very useful if you would want to evaluate function that has more than one variable.

Many thanks!
#2 Publicado: 10/4/2014 17:46:56
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: Moderator

Thank you ioan92! That is really what I needed.

Also what would be the best tutorial you can recommend on SMATH? Either English or Russian.

Thanks!
#3 Publicado: 10/4/2014 17:49:40
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

The FunctionsExtensions plugin provides the at() substitution function with special operator formatting. This exploits the symbolic storage of the expression in the variable g.
at2.PNG
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#4 Publicado: 10/4/2014 17:54:11
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: Moderator

That looks very interesting as well, will experiment. Thanks!
#5 Publicado: 17/4/2014 10:36:20
Alexander O. Melnik

Alexander O. Melnik

127 me gusta en 498 mensajes.

Grupo: Moderator

Hi everyone!,

Not sure if this would be a bug but at() function does not seem to work while evaluating fuctions that include Min() or Max().

See workbook and photo attached.

Thanks!
sm1.png
A 2 usuarios les gustó este mensaje
Martin Kraska 17/4/2014 18:08:00, Davide Carpi 19/4/2014 3:42:00
#6 Publicado: 17/4/2014 11:10:56
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

Confirmed. This is bug of Min() and Max(). Apparently they always try to return a numeric result, regardles of what the optimization setting is. If they would return themselves with evaluated/preprocessed arguments, at() would work, as the example with max() shows.

max.PNG
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
A 1 usuarios les gustó este mensaje
Davide Carpi 17/4/2014 13:49:00
#7 Publicado: 17/4/2014 13:49:34
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: Moderator

Thanks, added in BTS: SS-114.


Best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
A 1 usuarios les gustó este mensaje
Martin Kraska 17/4/2014 18:08:00
#8 Publicado: 2/12/2014 7:49:20
Davide Carpi

Davide Carpi

1.443 me gusta en 2.936 mensajes.

Grupo: Moderator

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • Nuevos mensajes
  • Sin mensajes nuevos