Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 277 Was thanked: 91 time(s) in 57 post(s)
|
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 (4kb) downloaded 40 time(s). |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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. uneval.sm (9kb) downloaded 25 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: alyles 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 277 Was thanked: 91 time(s) in 57 post(s)
|
Quote:Isn't what Clear(,) does ? Clear is more permament. The uneval function allows you re-enable without redefining the variable. |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 277 Was thanked: 91 time(s) in 57 post(s)
|
Originally Posted by: Razonar 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 . Only you would then have to redefine a and b when you want to evaluate. uneval (3).sm (11kb) downloaded 25 time(s).Edited by user 02 February 2018 21:49:22(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: alyles 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 ?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: alyles 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 (11kb) downloaded 25 time(s). Sure, I'm requesting them. Originally Posted by: alyles 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? Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
Originally Posted by: Razonar 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. uneval_Kr.sm (9kb) downloaded 35 time(s).I forgot this one: Edited by user 02 February 2018 23:31:37(UTC)
| Reason: Not specified |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 277 Was thanked: 91 time(s) in 57 post(s)
|
Martin, Are the lines even necessary? What are they doing in your example? I see no difference in not using lines. |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
Originally Posted by: alyles 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: |
|
2 users thanked mkraska for this useful post.
|
on 03/02/2018(UTC), on 03/02/2018(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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. Edited by user 03 February 2018 03:11:52(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Oops. Integers vs rationals.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: mkraska 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...]
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi. The proposed method looks excellent, but only works for integers. So, it's a bug or what else? Best regards. Alvaro
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
Originally Posted by: Razonar 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. |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: mkraska 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 (29kb) downloaded 34 time(s). Spline De Boor [Colibri].sm (34kb) downloaded 32 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
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 (8kb) downloaded 28 time(s).
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.