Using solve or maple.solve for Array

Using solve or maple.solve for Array - Messages

#1 Posted: 11/17/2020 4:57:44 AM
usamakhan

usamakhan

3 likes in 75 posts.

Group: 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 KiB) downloaded 19 time(s).
#2 Posted: 11/17/2020 5:31:26 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

maple_solve.png
Russia ☭ forever, Viacheslav N. Mezentsev
#3 Posted: 11/17/2020 7:14:29 AM
usamakhan

usamakhan

3 likes in 75 posts.

Group: 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 Posted: 11/17/2020 7:20:34 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: 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 Posted: 11/17/2020 8:23:15 AM
usamakhan

usamakhan

3 likes in 75 posts.

Group: 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 KiB) downloaded 21 time(s).
#6 Posted: 11/17/2020 8:29:19 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: 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 KiB) downloaded 24 time(s).
Page1 (uni).pdf (380 KiB) downloaded 30 time(s).
Russia ☭ forever, Viacheslav N. Mezentsev
#7 Posted: 11/17/2020 9:51:32 AM
usamakhan

usamakhan

3 likes in 75 posts.

Group: User

Wrote

maple_solve.png



Show Spoiler



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

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 32 time(s).
#9 Posted: 11/18/2020 12:47:29 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 KiB) downloaded 26 time(s).
Page1 (uni).sm (177 KiB) downloaded 29 time(s).

Best regards.
Alvaro.
1 users liked this post
Вячеслав Мезенцев 11/18/2020 2:16:00 AM
#10 Posted: 11/18/2020 9:17:56 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

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

Pakistan.PNG

Ioncube Otherwise.sm (28 KiB) downloaded 19 time(s).
  • New Posts New Posts
  • No New Posts No New Posts