Dealing with long line formulas

Dealing with long line formulas - Searching for a matrix equivalent represetation tool - Messages

#1 Posted: 4/4/2026 10:11:11 AM
ioan92

ioan92

179 likes in 120 posts.

Group: User

Hello Everybody,

Sometimes, I deal with formulas laying out in a very long line, as shown in the appended file examples.
Long Lines Formulas - Width Reduction.sm (72.77 KiB) downloaded 41 time(s).
To improve the use of such structures, I consider using a matrix presentation.
The sum of the matrix terms is equivalent to the input formula; see the checks in my examples.
Seeing the complex imbrication of the input formula’s terms, the “by hand organization” treatment is often fastidious and hard to prevent errors.
I imagine that many people had to face this problem of handling results from symbolic integration, for instance.
I noticed useful tools like “simplify,” “expand,” and “convert,” available with MAPLE. They are available also with Maxima.
I wonder if there is a way or a tool to deal with the problem in a more specific way?
Thanks for your attention and for your solutions.

Regards,
Ioan


Edited 4/5/2026 7:30:38 PM
Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#2 Posted: 4/5/2026 10:34:21 AM
Martin Kraska

Martin Kraska

1,341 likes in 2,256 posts.

Group: Moderator

Here is a version with the Mathcad block.

Unfortunatly not without something strange happening in the background.

grafik.png
grafik.png


Long Lines Formulas - Width Reduction_Kr.sm (128.68 KiB) downloaded 29 time(s).
Edited 4/5/2026 10:38:50 AM
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 users liked this post
ioan92 4/5/2026 3:22:49 PM
#3 Posted: 4/5/2026 5:33:47 PM
ioan92

ioan92

179 likes in 120 posts.

Group: User

Thanks for the attempt.

I tried to use some features available for manipulating formulas as wel in MAPLE as in MAXIMA, namely: expand() and simplify().
My idea is applied in the appended file. Long Lines Formulas - Width Reduction bis .sm (33.2 KiB) downloaded 25 time(s).
This helped me to organize better (?) by hand the input sausage formula but it is not my hope.
My optimistic expectation would be a tool that handle this organization in enough simple way.

Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#4 Posted: 4/5/2026 9:01:04 PM
overlord

overlord

590 likes in 1,365 posts.

Group: Moderator

I did proposed a better solution several years ago.

https://smath.com/en-US/forum/topic/vTrsUs/Equation-Wrapping#msg128281
1 users liked this post
ioan92 4/6/2026 7:27:33 AM
#5 Posted: 4/6/2026 7:39:29 AM
ioan92

ioan92

179 likes in 120 posts.

Group: User

Wrote

I did proposed a better solution several years ago.

https://smath.com/en-US/forum/topic/vTrsUs/Equation-Wrapping#msg128281



It is a nice solution but this belongs to "by hand making" field; I hoped something more...

Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#6 Posted: 4/6/2026 7:58:39 AM
Martin Kraska

Martin Kraska

1,341 likes in 2,256 posts.

Group: Moderator

How about this one... use optimization/none

grafik.png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 users liked this post
ioan92 4/6/2026 11:27:54 AM
#7 Posted: 4/6/2026 12:56:35 PM
ioan92

ioan92

179 likes in 120 posts.

Group: User

Thanks a lot !!!
That's it what I need to build a "constructor" for the final result vector - split the line in simple terms.
I still need a tool to count the number of charaters of a line of the final vector. Maibe is there something in the Davide's tresaury ?

Ioan 06042026.png
Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#8 Posted: 4/6/2026 4:59:17 PM
Martin Kraska

Martin Kraska

1,341 likes in 2,256 posts.

Group: Moderator

This is just native Maxima.

grafik.png
Edited 4/6/2026 5:00:14 PM
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 users liked this post
ioan92 4/7/2026 8:57:51 AM
#9 Posted: 4/6/2026 6:11:02 PM
Alvaro

Alvaro

1,083 likes in 1,756 posts.

Group: User

Hi. This could be another approach. For a long formula, where even separating terms can be tricky, simply take its string and add some carriage returns anywhere in the description (with shift+Enter) so it doesn't overflow the page. This works to show the formula being used, assuming whoever reviews it is a very meticulous and patient person.

image.png

Long Lines Formulas - Width Reduction.sm (76.19 KiB) downloaded 24 time(s).

Best regards.
Alvaro.
1 users liked this post
ioan92 4/7/2026 1:34:05 PM
#10 Posted: 4/6/2026 7:53:13 PM
ioan92

ioan92

179 likes in 120 posts.

Group: User

I applied Martin's solution, based on Maxima, on a very long equation.
I obtained a matrix of matrices, equivalent to the initial one very long line equation .
As an example, I put the case in the appended file.
Split and Recoposition of a Line Equation.sm (320.98 KiB) downloaded 17 time(s).
The procedure could be general. I have not yet a definitive presentation of all necessary transformations
If somebody is interested in the subject, please send a sign,
Ioan
Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#11 Posted: 4/6/2026 8:34:56 PM
ioan92

ioan92

179 likes in 120 posts.

Group: User

Wrote

Hi. This could be another approach. For a long formula, where even separating terms can be tricky, simply take its string and add some carriage returns anywhere in the description (with shift+Enter) so it doesn't overflow the page. This works to show the formula being used, assuming whoever reviews it is a very meticulous and patient person.

Best regards.
Alvaro.


Hi Alvaro,

I’m, once again, impressed with the condensed formalism you deployed.
Your solution is very compact, but I hadn’t announced yet my “hidden” objective.
In fact, as long as I rest in the SMath environment, the equation length does not disturb me excessively. Also, as long as I’m into the SMath environment, the symbolic solution of integration is nice, compact and “efficient” (?). But, when I step out into a different programming environment, I feel it necessary to have an explicit solution! (???).
That’s why I enjoy Martin’s way – as fitting more my expectations.
All my thanks for your brilliant solution. I save it in my treasury.

Best regards,
Ioan

Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
#12 Posted: 4/10/2026 5:20:44 PM
ioan92

ioan92

179 likes in 120 posts.

Group: User

[i]Hello Everybody,

Some time ago, I opened this Topic in the SMath Forum.
I received some very useful help and suggestions.
I thank all the contributors a lot.
As a recognition to helpers and as well for any good use, I post here my final results:
### FIN EQ 08042026 FIN.sm (597.06 KiB) downloaded 3 time(s).
I keep all my attention, and I thank in advance for any critics and improvement suggestions.

Best Regards,
Ioan


Edited 4/10/2026 5:21:34 PM
Do to others as you would like them to do to you! Knowledge is of no value unless you put it into practice - Chekhov
1 users liked this post
sergio 4/10/2026 7:16:34 PM
  • New Posts
  • No New Posts