Timeline for Assign the results from a Solve to variable(s)
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:35 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Apr 13, 2017 at 12:55 | history | edited | CommunityBot | replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ | |
| Mar 8, 2016 at 12:45 | comment | added | Mr.Wizard | @Travis the canonical Q&A here is (15567), and I suggest you also look at the links in my answer to (29750). If these do not answer all your questions please let me know. | |
| Mar 8, 2016 at 6:27 | comment | added | Travis Bemrose | @Mr.Wizard Your comments have been very helpful, and I keep coming back here to relearn "what function was that, that showed me the structure?" I've been searching levelspec, but I only find references to it, and to tutorials on it directly. I have questions such as "Does the index start counting at 0 or 1? Does it count up or down? Is it relative or absolute?" --- Do you know a good tutorial or reference you can point me and others to? | |
| Feb 22, 2016 at 16:45 | comment | added | Mr.Wizard | @Travis Okay. You need to become familiar with the long form of all these "shorthand" operators. You can see the long form by wrapping code in HoldForm[FullForm[ code ]] -- for example HoldForm[FullForm[ {x -> val1, y = val2} ]] will reveal List[Rule[x, val1], Set[y, val2]]. This "FullForm" expression is what you need to visualize when you think about Mathematica manipulating code. Virtually all Replace, Map, Apply, Part, etc. operations effectively "see" this structure, not the short form you type in. See e.g. HoldForm[FullForm[ a - b ]] | |
| Feb 22, 2016 at 11:05 | comment | added | Travis Bemrose | I understand that Set and = are equivalent, but it's the Set[x, val] that the help file wouldn't tell me. I'm not sure what levelspec is, but I see that @@@ is grabbing stuff from either side of ->. I'm guessing there's some Func[x, val] equivalent to x -> val so that @@@ replaces Func with Set? | |
| Feb 22, 2016 at 4:38 | comment | added | Mr.Wizard | @Travis Assuming you want this in my own words please reference (46248). @@@ is shorthand for Apply at levelspec {1}. So foo @@@ {x -> val1, y -> val2} becomes {foo[x, val1], foo[y, val2]}, or in the code in the question {Set[x, val1], Set[y, val2]}, which then assigns the values with Set. (= is the shorthand for Set.) | |
| Feb 21, 2016 at 22:39 | comment | added | Travis Bemrose | I agree that often you just want to use rules, but in my case I'm trying to set a global variable before going on to solve for other things (where Solve will work better if it has this global value instead of trying to remain general for all possible values). I tried the equivalent of Set[sols[[1]]], and when that didn't work. Of course the "help" file is no help because it insists on explaining the symbol = and not the function Set, so I ended up here. What is Set @@@ sols[[1]] doing? | |
| Dec 15, 2012 at 20:47 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 313 characters in body |
| Jun 11, 2012 at 14:05 | comment | added | Leonid Shifrin | +1.Something related to your last comment and the injector pattern. | |
| Jun 11, 2012 at 13:48 | history | edited | Mr.Wizard | CC BY-SA 3.0 | added 426 characters in body |
| Jun 11, 2012 at 13:39 | history | answered | Mr.Wizard | CC BY-SA 3.0 |