Long line formula

Long line formula - Splitting a long line formula - 消息

#1 已发布: 2023/9/24 13:45:23
ioan92

ioan92

181个赞,共124个帖子。

组: 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 已发布: 2023/9/24 14:20:16
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: 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 已发布: 2023/9/24 19:13:40
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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


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

1位用户喜欢此帖子
ioan92 2023/9/25 05:46:00
#4 已发布: 2023/9/24 20:48:46
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2位用户喜欢此帖子
Oscar Campo 2023/9/24 20:54:00, ioan92 2023/9/25 04:20:00
#5 已发布: 2023/9/27 11:16:56
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: 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:

显示剧透




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位用户喜欢此帖子
ioan92 2023/9/27 14:12:00
#6 已发布: 2023/9/27 13:22:56
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: 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位用户喜欢此帖子
ioan92 2023/9/27 14:12:00
#7 已发布: 2023/9/27 14:30:18
ioan92

ioan92

181个赞,共124个帖子。

组: 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 已发布: 2023/9/27 14:33:47
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: 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.

显示剧透



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位用户喜欢此帖子
ioan92 2023/9/27 14:48:00
#9 已发布: 2023/9/27 18:38:19
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: 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 已发布: 2023/9/27 20:10:54
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Ioan, can I ask why did you delete all your posts?
#11 已发布: 2023/9/28 02:52:22
ioan92

ioan92

181个赞,共124个帖子。

组: 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 已发布: 2023/12/20 10:27:41
Basoier

Basoier

0个赞,共1个帖子。

组: User

Wrote

Hi Overlord,
Of course you can ask...

Have a nice day,
Ioan



I think you understand
  • 有新帖
  • 无新帖