It would help if you could include a complete block of code to reproduce your expression. Just showing the final expression isn't helpful because we don't know how the various variables are defined.
Aaron Meurer On Wed, Feb 9, 2022 at 10:31 AM gu...@uwosh.edu <gu...@uwosh.edu> wrote: > > So you are not worried about the ordering of the symbols, but the fact that > you are not getting the symbol for the basis vector outside of the outer > brackets. I agree that is not standard convention, but as everything else in > the expression is a scalar, I would consider the expression correct no matter > where the basis vector appears. Can you find an example where it is really > wrong, such as a matrix operation on the basis vector or the formal > calculation of the dot product between two vectors? That would probably help > isolate the problem. I suggest you file a bug report > (https://github.com/sympy/sympy/issues) or if you can figure out how to fix > it a pull request. > > regards, > Jonathan > On Wednesday, February 9, 2022 at 9:21:10 AM UTC-6 Rajeev wrote: >> >> Thanks Jonathan for the explanation. But I am not pointing out this behavior >> here. Part of the (multi-line) bracket goes to the right of the unit vector >> k_C in the last expression, which is a display bug specific to pretty print >> in the terminal. >> >> Unfortunately the entire expression gets jumbled on the mobile. To see this >> problem please view the mail in a browser so that proper formatting is >> visible. >> >> Best wishes, >> Rajeev >> >> >> On Wed, 9 Feb 2022, 7:30 p.m. gu...@uwosh.edu, <gu...@uwosh.edu> wrote: >>> >>> Rajeev, >>> If I understand correctly, you are worried about the way functions, factors >>> and symbols are ordered in an evaluated expression. Your example is the >>> expected behavior. When an expression is evaluated, sympy has to decide how >>> to order the symbols. The default ordering is alphabetical. With capital >>> letters first. For example if I set p = n*R*T/V (ideal gas law) the display >>> of the value of p will return: RTn/V as the sorting is done within the >>> parts of the expression (numerator and denominator). I believe there are >>> some options for adjusting this, but others will have to speak to that. >>> >>> Jonathan >>> >>> On Tuesday, February 8, 2022 at 11:01:23 PM UTC-6 Rajeev wrote: >>>> >>>> Dear group, >>>> >>>> One more point in this context. Things work fine for unevaluated >>>> expressions - >>>> >>>> vecE = (1/eps) * Integral(delop.cross(vecH), t) >>>> >>>> \vec{E} = ⎛ ⌠ ⎞ >>>> ⎜ ⎮ ⎛x_C⎞ ⎛ 4 ⎞ ⎟ k_C >>>> ⎜ ⎮ 4⋅cos⎜───⎟⋅cos⎝10 ⋅t⎠ ⎟ >>>> ⎜ ⎮ ⎜ 2⎟ ⎟ >>>> ⎜ 11 ⎮ ⎝10 ⎠ ⎟ >>>> ⎜10 ⋅⎮ ───────────────────── dt⎟ >>>> ⎜ ⎮ 10 ⎟ >>>> ⎝ ⌡ ⎠ >>>> >>>> >>>> >>>> vecE.doit() >>>> >>>> \vec{E} = ⎛ 6 ⎛ 4 ⎞ ⎛x_C⎞⎞ >>>> ⎜4⋅10 ⋅sin⎝10 ⋅t⎠⋅cos⎜───⎟ k_C⎟ >>>> ⎜ ⎜ 2⎟⎟ >>>> ⎝ ⎝10 ⎠⎠ >>>> >>>> >>>> I hope this would help to find the issue. >>>> >>>> Best wishes, >>>> Rajeev >>>> >>>> >>>> On Wed, 9 Feb 2022 at 09:34, Rajeev Singh <rajs...@gmail.com> wrote: >>>>> >>>>> Thanks Alan and Aaron, >>>>> >>>>> I will go through galgebra and latex options carefully to get nicer >>>>> looking output. Thanks again for the suggestions. >>>>> >>>>> Best wishes, >>>>> Rajeev >>>>> >>>>> >>>>> On Wed, 9 Feb 2022, 5:53 a.m. Aaron Meurer, <asme...@gmail.com> wrote: >>>>>> >>>>>> The min and max parameters to latex() control when a float is printed >>>>>> in scientific format. The sstr printer also has the same options, but >>>>>> it looks like the pretty printer does not (it should not be hard to >>>>>> add them, though). >>>>>> >>>>>> Aaron Meurer >>>>>> >>>>>> On Mon, Feb 7, 2022 at 3:55 AM Rajeev Singh <rajs...@gmail.com> wrote: >>>>>> > >>>>>> > Dear group, >>>>>> > >>>>>> > What would be the best way to get numbers in the form 10^{...} while >>>>>> > using pretty print or latex? The following hack works - >>>>>> > >>>>>> > ten = symbols("10", positive=True) >>>>>> > eps, mu = 4*pi*ten**(-11), ten**(-5) >>>>>> > >>>>>> > but is messing up pretty print when used with sympy.vector objects. >>>>>> > Couldn't find anything on this in the mail archives. >>>>>> > >>>>>> > Best wishes, >>>>>> > Rajeev >>>>>> > >>>>>> > -- >>>>>> > You received this message because you are subscribed to the Google >>>>>> > Groups "sympy" group. >>>>>> > To unsubscribe from this group and stop receiving emails from it, send >>>>>> > an email to sympy+un...@googlegroups.com. >>>>>> > To view this discussion on the web visit >>>>>> > https://groups.google.com/d/msgid/sympy/CAABz-z-jD3GPB3jw0q%3D4xuG0VCmcw4NO8154H3CRYJz4Ws2Tpw%40mail.gmail.com. >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "sympy" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>>> an email to sympy+un...@googlegroups.com. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LVuxsPwieY1y_%3D4ymQcZ%2B4fYN6vqrWCQGNsfB%3Duk9_4w%40mail.gmail.com. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sympy" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to sympy+un...@googlegroups.com. >>> >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/sympy/9d6ac046-d219-4e22-84be-b996d6b497c4n%40googlegroups.com. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/44a85189-29f6-465e-889e-6b1a9109bc87n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KeWN%3DUZ8vGhxhgmk36%2BAMB11NJ3psoij0ZUHyi0RHYJw%40mail.gmail.com.