Using solve or maple.solve for Array

Using solve or maple.solve for Array - 消息

#1 已发布: 2020/11/17 04:57:44
usamakhan

usamakhan

7个赞,共98个帖子。

组: User

I want to using solve function for a simple arithmetic equation. But one of the value is an array so I must have array of answers. I am unable to achieve this using solve & maple.solve


As the last resort I had to solve the equation separately which is both boring & not dynamic. The equation has units...


Page1.sm (184.19 KiB)已下载 1432 次。
#2 已发布: 2020/11/17 05:31:26
Вячеслав Мезенцев

Вячеслав Мезенцев

1,558个赞,共1,868个帖子。

组: Moderator

maple_solve.png
Russia ☭ forever, Viacheslav N. Mezentsev
#3 已发布: 2020/11/17 07:14:29
usamakhan

usamakhan

7个赞,共98个帖子。

组: User

Thanks for the solution. Can you please explain why we need to vectorize (above arrow) the last statement?
Secondly I cannot add units to x in the function developed st_mass? My version is 0.99 (6671)
#4 已发布: 2020/11/17 07:20:34
Вячеслав Мезенцев

Вячеслав Мезенцев

1,558个赞,共1,868个帖子。

组: Moderator

Wrote

Thanks for the solution. Can you please explain why we need to vectorize (above arrow) the last statement?


If the function uses a scalar and you substitute a vector of values, then you need to either use a loop over the elements of the vector, or the vectorization operator.

Wrote

Secondly I cannot add units to x in the function developed st_mass? My version is 0.99 (6671)


Try to multiply x by 1 and replace 1 with units.

And I think that the maple() function is not needed here, an ordinary solve() should handle it.
Russia ☭ forever, Viacheslav N. Mezentsev
#5 已发布: 2020/11/17 08:23:15
usamakhan

usamakhan

7个赞,共98个帖子。

组: User

Per my experience maple.solve handles units far better... However still I am not able to reproduce your results.
Sheet is attached, may be my version is old?
Page1.sm (174.42 KiB)已下载 1468 次。
#6 已发布: 2020/11/17 08:29:19
Вячеслав Мезенцев

Вячеслав Мезенцев

1,558个赞,共1,868个帖子。

组: Moderator

Wrote

Per my experience maple.solve handles units far better.


Keep in mind that the function maple() doesn't know anything about units at all. The function uses a special trick to ignore them in its work.

Try now

Page1 (uni).sm (175.19 KiB)已下载 1405 次。
Page1 (uni).pdf (380.33 KiB)已下载 921 次。
Russia ☭ forever, Viacheslav N. Mezentsev
#7 已发布: 2020/11/17 09:51:32
usamakhan

usamakhan

7个赞,共98个帖子。

组: User

Wrote

maple_solve.png



显示剧透



Ok I made a typo fault. Everything OK now THNX
#8 已发布: 2020/11/17 12:31:50
Jean Giraud

Jean Giraud

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

组: User

Wrote

I want to using solve function for a simple arithmetic equation. But one of the value is an array so I must have array of answers. I am unable to achieve this using solve


Here is Engineer style ... no need for Maple, just native Smath
Attached SS 6179 ... some volunteer to make it unit kg/s

Ioncube Otherwise.sm (20.16 KiB)已下载 1227 次。
#9 已发布: 2020/11/18 00:47:29
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

....
Try to multiply x by 1 and replace 1 with units.
And I think that the maple() function is not needed here, an ordinary solve() should handle it.



Hi. I guess that the problem is that kw just like "kw" both in lowercase isn't an unit, but it is kW. To know the name of an unit you have the coup icon for insert one in the toolbar.

In the attached using kW instead kw, maple don't needs units manipulation, but SMath's roots needs.

Page1 (uni).pdf (413.26 KiB)已下载 890 次。
Page1 (uni).sm (177.25 KiB)已下载 1446 次。

Best regards.
Alvaro.
1位用户喜欢此帖子
#10 已发布: 2020/11/18 09:17:56
Jean Giraud

Jean Giraud

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

组: User

... forget units, reconciliate as you wish in the solve bloc & Table

Pakistan.PNG

Ioncube Otherwise.sm (28.65 KiB)已下载 1194 次。
  • 有新帖
  • 无新帖