Long line formula

Long line formula - Splitting a long line formula - Messages

#1 Posted: 9/24/2023 1:45:23 PM
ioan92

ioan92

171 likes in 102 posts.

Group: User

Hello Everybody,

I have a small practical question:
How to split a long line (formula) on two or more lines.

I think that the subject was explained somewhere but I’m not sure about.

I know the primary solution of allocation variable names for the parts of the formula, but…

Thanks for your help.
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
#2 Posted: 9/24/2023 2:20:16 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

How to split a long line (formula) on two or more lines.


If your formula is piecewise composed of ± pieces, stack those pieces.

#3 Posted: 9/24/2023 7:13:40 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

How to split a long line (formula) on two or more lines.


Composite of [+,-,/] may be reduced built-in Smath numden

1 users liked this post
ioan92 9/25/2023 5:46:00 AM
#4 Posted: 9/24/2023 8:48:46 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Write an expression, put the cursor to where you want a line break and press Ctrl-Enter.
This works only once in a formula, not inside results and not inside brackets.

2023-09-25 01_45_02-SMath Solver - [Worksheet2_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 users liked this post
Oscar Campo 9/24/2023 8:54:00 PM, ioan92 9/25/2023 4:20:00 AM
#5 Posted: 9/27/2023 11:16:56 AM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

You could also word-wrap your formula:


__________________________ *
SMATH_wordWrap_Math.jpg

where the 'string' uses newline characters to force on the next line (\000A\ is the special code SMath uses, just copy/paste this and it will word-wrap the string). You can copy and paste the following into your worksheet:
"a+b+\000A\0+c+d+\000A\0+e+f"

  • write your math expression as a 'string'
  • pass that value through the str2num() function; it will be evaluated





*There is an issue:

Show Spoiler




May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1 users liked this post
ioan92 9/27/2023 2:12:00 PM
#6 Posted: 9/27/2023 1:22:56 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

How to split a long line (formula) on two or more lines.


I have yet to see such long formula from native Engineering.
If your formula results from symbolic expansion... try maple.
For curiosity and help, show an image of that formula.
I have a 25 pages long formula ... Nothing can be done !

1 users liked this post
ioan92 9/27/2023 2:12:00 PM
#7 Posted: 9/27/2023 2:30:18 PM
ioan92

ioan92

171 likes in 102 posts.

Group: User

Thank you all for your kind answers.
In fact, I looked more to something like in Mathcad:
(without limitations as mentioned by Martin - only one shot)
https://www.mathcad.com/en/blogs/mathcad-4-equation-wrapping#:~:text=Here%20are%20two%20quick%20keyboard,get%20PTC%20Mathcad%20Prime%204.0.&text=To%20toggle%20breaking%20on%20the,instantly%20moves%20down%20a%20line.
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
#8 Posted: 9/27/2023 2:33:47 PM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

I have used Mathcad's split feature as well and I can understand your plight. Keep in mind some other alternatives to present your data. For instance, you can use the a cases() function to organize your criteria/responses in a compact manner:
cases(#,#,#,#,#,#,#,#,#,#,#,#,#)

SMath_alternativesToWrap.jpg


You can also explore sum() function with a matrix in it:
sum(mat(#,#,#,#,#,#,#,#,#,9,1))

or just the system of equations feature:
sys(#,#,#,#,#,#,#,#,8,1)

Finally, you can just select your math statement and decrease the font size such that your equation will fit on the page. I have resorted to decreasing the font down to font size [2] in order for my matrix/tabulated data to fit on one page width; it served my purposes. [2023-09-28]


Also: Jean, Thank you for the good laugh! I always enjoy your litany of responses.

Show Spoiler



May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1 users liked this post
ioan92 9/27/2023 2:48:00 PM
#9 Posted: 9/27/2023 6:38:19 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

- even better! you can post an image of YOUR 25 pages long formula; You are correct that I am curious of this formula.


I won't show that f(x,y) symbolic expansion.
Always nice to read you Kenny ... Jean.
#10 Posted: 9/27/2023 8:10:54 PM
overlord

overlord

547 likes in 1330 posts.

Group: Moderator

Ioan, can I ask why did you delete all your posts?
#11 Posted: 9/28/2023 2:52:22 AM
ioan92

ioan92

171 likes in 102 posts.

Group: User

Hi Overlord,
Of course you can ask...
Have a nice day,
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: 12/20/2023 10:27:41 AM
Basoier

Basoier

0 likes in 1 posts.

Group: User

Wrote

Hi Overlord,
Of course you can ask...

Have a nice day,
Ioan



I think you understand
  • New Posts New Posts
  • No New Posts No New Posts