Timeline for Saving solutions of equations with indexed variables to a table
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 4 at 12:55 | vote | accept | QFTheorist | ||
Feb 3 at 19:53 | comment | added | QFTheorist | Thanks so much! Only those were present, yes. | |
Feb 3 at 19:13 | comment | added | Domen |
Only for those that were actually present or for any of them? In the second case, you can simply add cc[__] = 0 .
|
|
Feb 3 at 18:53 | comment | added | QFTheorist | Thanks. @Domen would it be possible to keep the values of the terms that I have set to 0 too? i.e. something like cc[a,b,c] = 0. | |
Feb 3 at 17:34 | comment | added | Domen |
Sure! If you simply write cc@@c[2,0,0] = ... which is equivalent to Apply[cc, c[2, 0, 0]] = ... , Mathematica will complain that you are trying to assign some value to the Apply ! This is because Set has the attribute HoldFirst . To overcome this, we use Evaluate such that cc@@c[2,0,0] is evaluated first to cc[2,0,0] , and only then Set is called to set the value.
|
|
Feb 3 at 16:16 | comment | added | QFTheorist |
Hi @Domen , thanks for the solution. It works as I would like it to. Can you explain what the Evaluate[cc@@#1]... bit is doing exactly? I have seen apply and map before but this is new. Thanks.
|
|
Feb 3 at 14:46 | history | answered | Domen | CC BY-SA 4.0 |