Code Mathcad to Smath

Code Mathcad to Smath - Сообщения

#1 Опубликовано: 20.12.2021 14:38:00
Lelar

Lelar

0 сообщений из 7 понравились пользователям.

Группа: User

I need to pass these codes that are in Mathcad Prime to Smath, does anyone know how I can do it?
Файл не найден.Файл не найден.
#2 Опубликовано: 20.12.2021 15:19:50
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

There is currently no converter from .mcdx format to .sm. And there is no one to do it, although it is possible.
Russia ☭ forever, Viacheslav N. Mezentsev
#3 Опубликовано: 20.12.2021 15:45:33
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

I need to pass these codes that are in Mathcad Prime to Smath, does anyone know how I can do it ?


Make your MCDX compact/readable not a scratch sheet.
If not too long, make an image, some will inspect.

#4 Опубликовано: 20.12.2021 15:49:00
Lelar

Lelar

0 сообщений из 7 понравились пользователям.

Группа: User

Wrote

I need to pass these codes that are in Mathcad Prime to Smath, does anyone know how I can do it?
Файл не найден.Файл не найден.



Wrote

Wrote

I need to pass these codes that are in Mathcad Prime to Smath, does anyone know how I can do it ?


Make your MCDX compact/readable not a scratch sheet.
If not too long, make an image, some will inspect.


I don't have the MCDX, I only have the pdf.
#5 Опубликовано: 20.12.2021 15:53:14
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Wrote

I don't have the MCDX, I only have the pdf.


In this case, only manually.
Russia ☭ forever, Viacheslav N. Mezentsev
#6 Опубликовано: 20.12.2021 15:55:52
Lelar

Lelar

0 сообщений из 7 понравились пользователям.

Группа: User

Wrote

Wrote

I don't have the MCDX, I only have the pdf.


In this case, only manually.


But the programming is the same in Smath? I mean, for example the FYN or root function still works?
#7 Опубликовано: 20.12.2021 16:08:32
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Not same, but very similar.

Regards

calculo.sm (22 КиБ) скачан 33 раз(а).

2021-12-20_22-06.png
2 пользователям понравился этот пост
Вячеслав Мезенцев 20.12.2021 16:16:00, Lelar 20.12.2021 22:31:00
#8 Опубликовано: 21.12.2021 12:05:20
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

But the programming is the same in Smath ?
I mean, for example the FYN or root function still works ?


Smath has many solvers. FYN from implicit roots(,,,).
roots will solve on the canvas [MACH number]

calculo Direct Code.sm (20 КиБ) скачан 40 раз(а).
#9 Опубликовано: 21.12.2021 12:20:43
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

Smath has many solvers. FYN from implicit roots(,,,).
roots will solve on the canvas [MACH number]

calculo Direct Code.sm (20 КиБ) скачан 40 раз(а).


So you simply reposted my answer?
1 пользователям понравился этот пост
fedeghi 21.12.2021 16:36:00
#10 Опубликовано: 21.12.2021 13:17:40
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

So you simply reposted my answer ?


Not exactly, not case of transit via local definition.
Take care ... Jean.

Spline De Boor [Colibri].sm (34 КиБ) скачан 30 раз(а).
Bessel J0,Y0.sm (22 КиБ) скачан 28 раз(а).
#11 Опубликовано: 21.12.2021 14:55:46
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Yes, they are same.
You just rename y# to y.
And deleted line()'s.
What a cheap act.

Side by side comparison:

Показать спойлер


1 пользователям понравился этот пост
fedeghi 21.12.2021 16:36:00
#12 Опубликовано: 21.12.2021 15:58:25
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Yes, they are same.
You just rename y# to y.
And deleted line()'s.
What a cheap act.


# not needed, crowds document
Not a case of local definition, crowds/confuses new Smath user
As you offered, Smath looks weird.
End of it.
#13 Опубликовано: 21.12.2021 16:17:57
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

Not a case of local definition, crowds/confuses new Smath user


I have deliberately put to show as it will be calculated.
Variable can be named whatever user wants by the way.
I am sure Lelar is not confused, as he is a new user.
Variable names doesn't crowd/confuse smath users.

Your "silent unit" crap confuses new users, crowds topics.
Your "non related" replies confuses new users, crowds topics.
Your "posting same reply for 4 times" confuses new users, crowds topics.
Your "color racket worksheets" confuses new users, crowds topics.
2 пользователям понравился этот пост
fedeghi 21.12.2021 16:36:00, Oscar Campo 23.12.2021 09:47:00
#14 Опубликовано: 22.12.2021 06:59:40
Chito

Chito

1 сообщений из 6 понравились пользователям.

Группа: User

Hi,

Maybe off topic between overlord and Jean Giraud's conversation, but what's the difference between a function definition with line() and a definition with line() removed? Will there be a difference on how SMath calculates it?

Cheers.
#15 Опубликовано: 22.12.2021 09:01:39
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

In short line | is a descending dependent collection.
Welcome to Smath Community ... Jean.

chito.sm (51 КиБ) скачан 29 раз(а).
#16 Опубликовано: 22.12.2021 16:16:39
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

...but what's the difference between a function definition with line() and a definition with line() removed? Will there be a difference on how SMath calculates it?


There will be a difference, a huge one actually.
When a variable is defined before function,
and that variable is used inside the function,
if line is used, variable redefine shall effect result.
if not used, variable redefine won't effect the result of function.
Which mostly we don't want not effecting, so using line() is better.

2021-12-22_22-16.png

I mostly define function variables with unique naming. (# after variable for example)
So common used variable names won't effect function results.
This is my habit and I think it is a useful one.
This naming doesn't crowd pages or confuses people.
It is minimizing calculation errors caused by author.

f(x#;y#):=x#^2+2*y#

Best regards
1 пользователям понравился этот пост
Oscar Campo 23.12.2021 09:49:00
#17 Опубликовано: 22.12.2021 23:31:41
Chito

Chito

1 сообщений из 6 понравились пользователям.

Группа: User

Wrote

In short line | is a descending dependent collection.
Welcome to Smath Community ... Jean.



Thank you for the very warm welcome, Jean.

Is there a reason why Dy is within in eval()? I tried removing it in the function and the result looks the same.

Wrote


if line is used, variable redefine shall effect result.
if not used, variable redefine won't effect the result of function.
Which mostly we don't want not effecting, so using line() is better.



I think this is a very important point that I need to keep in mind. Using unique names in functions is also a great suggestion. Thank you overlord.

Cheers.
#18 Опубликовано: 23.12.2021 11:45:18
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Thank you for the very warm welcome, Jean.
Is there a reason why Dy is within in eval()?
I tried removing it in the function and the result looks the same.


Two typos in your 'chito' document: Manilla, Kota Kinabalu in Sabah.
You are right, no need to Dy:=eval(,) is so fast.
eval(,) applies to parse result as a numeric entity.
It breaks the chain calculation. Per application experimental.
The rule eval(,) is crucifying ... watch the demo attached.
from 65 s down to 0.015 s !!!
Take care ... Jean

Maths eval(,) TEST.sm (19 КиБ) скачан 26 раз(а).
#19 Опубликовано: 23.12.2021 20:21:23
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

eval(,) applies to parse result as a numeric entity.


In simple words, the kernel is a vector of calculated from what to calculate.
In this example, the last that will be calculated is eval([R G B])
It gains 1 min [3/4].
Cheers ... Jean.

Pattern Etoile Magic [Short].sm (81 КиБ) скачан 30 раз(а).
#20 Опубликовано: 23.12.2021 21:13:04
overlord

overlord

551 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

Is there a reason why Dy is within in eval()?


eval() makes computations faster most of time.
Very minor times, may have no effect or slows the calculation.
It would be wise to choose where and when to use it.

2021-12-23_17-53.png

Wrote

I think this is a very important point that I need to keep in mind. Using unique names in functions is also a great suggestion. Thank you overlord.


Well thank you, glad if I could help.
There are some other tricks to remember as well.
Here is list of which come to my mind at this instant;
  • symbolic/numeric optimization
    most errors can be parsed with selecting the right one
  • Δ temperatures (Δ°C, Δ°F, Δ°Re)
  • not using units for some solvers {solve(), roots()}
    or using multiplications at right place to trick solver as value is unitless
  • using maple() or maxima() for most symbolic results (better support)
  • smath vectors/matrices starts with 1, mathcad starts with 0
    some new users troubles with converting mathcad functions to smath
  • recursive functions shall give an error after 50 steps
    better not to use it, try to wrtie algorithms conventional way
  • eval() for faster calculations
  • line() for functions (not needed always)
  • to be careful for variable names
  • choosing right plot for the right job
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений