mathematica-7

Weird behaviour with GroebnerBasis in v7

只愿长相守 提交于 2019-12-22 06:36:51
问题 I came across some weird behaviour when using GroebnerBasis . In m1 below, I used a Greek letter as my variable and in m2 , I used a Latin letter. Both of them have no rules associated with them. Why do I get vastly different answers depending on what variable I choose? Image: Copyable code: Clear["Global`*"] g = Module[{x}, x /. Solve[ z - x (1 - b - b x ( (a (3 - 2 a (1 + x)))/(1 - 3 a x + 2 a^2 x^2))) == 0, x]][[3]]; m1 = First@GroebnerBasis[\[Kappa] - g, z] m2 = First@GroebnerBasis[k - g,

Concatenate two integers in Mathematica 7

女生的网名这么多〃 提交于 2019-12-22 04:00:50
问题 What is the most efficient way to concatenate two positive integers in Mathematica 7? cc[123, 4567] >> 1234567 What about more than two? cc[123, 4, 567, 89] >> 123456789 回答1: This will be slightly faster for many integers, than your last solution: ToExpression[StringJoin @@ Map[IntegerString, {##}]] & A more concise alternative is to accept a single argument, assuming it to be a list, rather than a sequence, of numbers to concatenate: ToExpression@StringJoin@IntegerString@#& which is based on

Weird behaviour with GroebnerBasis in v7

痞子三分冷 提交于 2019-12-05 10:09:47
I came across some weird behaviour when using GroebnerBasis . In m1 below, I used a Greek letter as my variable and in m2 , I used a Latin letter. Both of them have no rules associated with them. Why do I get vastly different answers depending on what variable I choose? Image: Copyable code: Clear["Global`*"] g = Module[{x}, x /. Solve[ z - x (1 - b - b x ( (a (3 - 2 a (1 + x)))/(1 - 3 a x + 2 a^2 x^2))) == 0, x]][[3]]; m1 = First@GroebnerBasis[\[Kappa] - g, z] m2 = First@GroebnerBasis[k - g, z] EDIT: As pointed out by belisarius, my usage of GroebnerBasis is not entirely correct as it

Concatenate two integers in Mathematica 7

坚强是说给别人听的谎言 提交于 2019-12-05 03:30:58
What is the most efficient way to concatenate two positive integers in Mathematica 7? cc[123, 4567] >> 1234567 What about more than two? cc[123, 4, 567, 89] >> 123456789 This will be slightly faster for many integers, than your last solution: ToExpression[StringJoin @@ Map[IntegerString, {##}]] & A more concise alternative is to accept a single argument, assuming it to be a list, rather than a sequence, of numbers to concatenate: ToExpression@StringJoin@IntegerString@#& which is based on IntegerString being Listable . This only works properly for short integers because the output must be

Context unique to each group at a specified level

血红的双手。 提交于 2019-11-30 15:25:34
问题 Recent versions of Mathematica provide the option of having a unique $Context for each cell group, via: Evaluation > Notebook's Default Context > Unique to Each Cell Group This is an appealing concept, but I find it unusable, as my code spans multiple cell groups. I would like a way to specify a unique context for cell groups of a certain level such as every Section , but not a separate context for every Subsection or Subsubsection . A solution will need to affect new cell groups as they are

Context unique to each group at a specified level

戏子无情 提交于 2019-11-30 14:33:00
Recent versions of Mathematica provide the option of having a unique $Context for each cell group, via: Evaluation > Notebook's Default Context > Unique to Each Cell Group This is an appealing concept, but I find it unusable, as my code spans multiple cell groups. I would like a way to specify a unique context for cell groups of a certain level such as every Section , but not a separate context for every Subsection or Subsubsection . A solution will need to affect new cell groups as they are created. You should be able to do this by modifying your notebook's stylesheet. You can use the option