Uneval

Uneval - Сообщения

#1 Опубликовано: 02.02.2018 03:38:26
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi.

An uneval ability, like 'x' and x::uneval in maple, or Mathematica's Hold .

Thanks for this wonderful tool that is SMath.

Best regards.
#2 Опубликовано: 02.02.2018 10:53:23
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

SMath doesn't have a discrete uneval function of which I am aware. However, you can replicate that functionality depending on when you define the variables. Look at my example below. uneval.sm (3 КиБ) скачан 63 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#3 Опубликовано: 02.02.2018 13:00:04
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi. Thanks for the tip. But isn't enough for somethings more or less basics tasks, like call NDiff with 2 args, and not 3. Also, there are something else wrong about diff and how it handle some cases.

Best regards.

Alvaro.

hold.gif

uneval.sm (8 КиБ) скачан 45 раз(а).
#4 Опубликовано: 02.02.2018 14:34:20
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

SMath doesn't have a discrete uneval function of which I am aware



Isn't what Clear(,) does ?

I Have an application example somewhere in Fourier compendium.
To imitate Mathcad/Maple: make the variables wild.

Clear.PNG
#5 Опубликовано: 02.02.2018 14:52:16
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Maths Symbolic Export wrt Parameters.sm (8 КиБ) скачан 46 раз(а).
#6 Опубликовано: 02.02.2018 15:08:46
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Цитата

Isn't what Clear(,) does ?



Clear is more permament. The uneval function allows you re-enable without redefining the variable.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#7 Опубликовано: 02.02.2018 15:47:34
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Wrote

Hi. Thanks for the tip. But isn't enough for somethings more or less basics tasks, like call NDiff with 2 args, and not 3. Also, there are something else wrong about diff and how it handle some cases.

Best regards.

Alvaro.





The problem with your two argument function is that you're using hold() and value() functions in function call and those functions aren't defined anywhere.

The method still works with your defined functions IFF you define a and b when you would normally call eval()

You could also use the method Jean suggests, by calling
clear(a,b)
. Only you would then have to redefine a and b when you want to evaluate.

uneval (3).sm (10 КиБ) скачан 44 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#8 Опубликовано: 02.02.2018 16:31:50
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Clear is more permament. The uneval function allows you re-enable without redefining the variable.



Just disable Clear(,) to reuse same parameters.
More generally if you "Clear" you want to redefine anyway, isn't ?

#9 Опубликовано: 02.02.2018 16:57:26
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote


The problem with your two argument function is that you're using hold() and value() functions in function call and those functions aren't defined anywhere.
uneval (3).sm (10 КиБ) скачан 44 раз(а).



Sure, I'm requesting them.

Wrote


You could also use the method Jean suggests, by calling ...



Jean's method is close, but not enough (actually it's equivalent to x='x' in the image). Can you replicate this Maple's code in SMath?

MyDiff.gif

Best regards.

Alvaro.
#10 Опубликовано: 02.02.2018 17:23:24
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Hi. Thanks for the tip. But isn't enough for somethings more or less basics tasks, like call NDiff with 2 args, and not 3.



Isn't this pretty much what you want? Magics of the line operator.

2018-02-02 21_16_04-SMath Studio - [uneval(1).sm_].png
uneval_Kr.sm (8 КиБ) скачан 54 раз(а).

I forgot this one:

2018-02-02 21_30_21-SMath Studio - [uneval_Kr.sm_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Arie 02.02.2018 17:27:00
#11 Опубликовано: 02.02.2018 17:57:16
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

Martin,

Are the lines even necessary? What are they doing in your example? I see no difference in not using lines.

Untitled.png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#12 Опубликовано: 02.02.2018 18:03:17
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Thanks Martin!

I learned something new today. Looking forward to trying some more of these tricks with line operators in my own applications.



I wish I could explain this.

The debugger doesn't seem to reveal the secret:

2018-02-02 21_54_32-SMath Studio - [uneval_Kr.sm_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
frapuano 02.02.2018 18:23:00, Alvaro Diaz Falconi 02.02.2018 21:07:00
#13 Опубликовано: 02.02.2018 21:10:15
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

I'm impressed! Excelent! Thanks, don't know what actues as hold but there are something there ... Now, my point is look if it can be done for external libraries, like coolprop or airy functions. And redefine diff for those cases where it fails.

Best regards.

Alvaro.

MyDiff.gif
#14 Опубликовано: 02.02.2018 22:07:02
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Oops. Integers vs rationals.

MyDiff.gif
#15 Опубликовано: 03.02.2018 00:08:01
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I wish I could explain this.



The line is a local definition operator.
Observe the red example: coefficients 'a' exist/defined/assigned
thus satisfy the Σ . On the other example |Σ 'c' result from calculations.
The summing operator must "steal" the 'c' via the isolating local line operator.
Differently but of same nature, DeBoor is redefined locally on the RHS.
More examples have been encountered [there was Legendre polynomials...]

Local.PNG
#16 Опубликовано: 04.02.2018 07:08:19
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi. The proposed method looks excellent, but only works for integers.
So, it's a bug or what else?

Best regards.

Alvaro

Clipboard02.jpg
#17 Опубликовано: 04.02.2018 08:47:22
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Hi. The proposed method looks excellent, but only works for integers.
So, it's a bug or what else?

Best regards.

Alvaro



The at() function used for applying the perturbation makes a search and replace without limiting the search expression to valid variable names. It can't, however, handle expressions as replacement targets.

The line function isn't at stake here.

2018-02-04 12_37_48-SMath Studio - [Page4_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Alvaro Diaz Falconi 05.02.2018 18:35:00
#18 Опубликовано: 04.02.2018 10:18:55
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I learned something new today. Looking forward to trying some more of these tricks with line operators in my own applications.


More generally, the line operator is the program operator.
It may be as short as one element. Attached are three typical
applications. DeBoor is just demo, here [attached separately].

Maths Local Definition.sm (28 КиБ) скачан 52 раз(а).
Spline De Boor [Colibri].sm (33 КиБ) скачан 51 раз(а).

#19 Опубликовано: 05.02.2018 03:05:18
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Maybe I don't understand what you are attempting,
if so => here is simple procedure that needs no
Uneval/re-eavl ... it just works on demand ,
wherever demanded in the work sheet.

Maths Uneval.sm (7 КиБ) скачан 46 раз(а).

Uneval.PNG
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений