Questions converting Mathcad to SMath Studio/Solver

Questions converting Mathcad to SMath Studio/Solver - Сообщения

#1 Опубликовано: 15.09.2021 20:48:49
GerardLardner

GerardLardner

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

Группа: User

I have a Mathcad worksheet I developed a few years ago for calculating the adiabatic flame temperature of an arbitrary gas mixture; in this case the products of combustion of municipal solid waste. I need to share it with others who do not have access to Mathcad; it seems to me that converting it into SMath would be a useful way of sharing it. SMath opens the Mathcad worksheet but fails to interpret the Mathcad Given: Find block. Also, the 'Given' section is very long and is split over several lines.
  1. How do I convert a Given: Find block from Mathcad into an Smath solve block?
  2. How can I split the 'Given' part over multiple lines - in Mathcad it takes 5 lines of a page even in landscape format?

The main troublesome part of the worksheet is shown below.

Untitled1.png

The definitions of the functions for calculating the heat capacities and latent heat are mostly omitted, but I include a few at the bottom - they read correctly into SMath and work correctly. Here is a sample:

Untitled2.png

A related question is how can I test a function in SMath using an array of variables? For example, in the case above, in Mathcad I can quickly check an array of temperature points against published tables by entering the following:

Untitled3.png

Is there anything similar in SMath?
#2 Опубликовано: 15.09.2021 21:16:54
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote


1. How do I convert a Given: Find block from Mathcad into an Smath solve block?



You have one equation in one variable. You can try al_nleqsol.

Wrote


2. How can I split the 'Given' part over multiple lines - in Mathcad it takes 5 lines of a page even in landscape format?



You can store pieces in variables, and then combine them. I.e. A:=expr1, B:=expr2, ... , final_expr:=A+B+C+...

Wrote


A related question is how can I test a function in SMath using an array of variables?


You have vectorize() in SMath.

Best regards.
Alvaro.
#3 Опубликовано: 15.09.2021 21:37:31
Oscar Campo

Oscar Campo

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

Группа: Moderator

Wrote



....

A related question is how can I test a function in SMath using an array of variables? For example, in the case above, in Mathcad I can quickly check an array of temperature points against published tables by entering the following:

Untitled3.png

Is there anything similar in SMath?



You must use the vectorize operator:

Vectorize.png

You can check the attached file:

vectorize.sm (5 КиБ) скачан 30 раз(а).
#4 Опубликовано: 16.09.2021 09:31:56
GerardLardner

GerardLardner

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

Группа: User

Great. Thank you very much.

I should have thought of that myself but I've been doing this nights, often at midnight or later, and obviously wasn't thinking clearly enough.
1 пользователям понравился этот пост
Oscar Campo 16.09.2021 09:41:00
#5 Опубликовано: 16.09.2021 09:42:20
GerardLardner

GerardLardner

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

Группа: User

Hi Alvaro,

Thank you for all the advice and suggestions.

Wrote

Wrote


1. How do I convert a Given: Find block from Mathcad into an Smath solve block?



You have one equation in one variable. You can try al_nleqsol.



Ta. I'll try that.

Wrote

Wrote


2. How can I split the 'Given' part over multiple lines - in Mathcad it takes 5 lines of a page even in landscape format?



You can store pieces in variables, and then combine them. I.e. A:=expr1, B:=expr2, ... , final_expr:=A+B+C+...



Yes, I was thinking along those lines myself but hoping that someone could suggest a 'cleaner' solution that I might have been overlooking. I do that.


Wrote

Wrote


A related question is how can I test a function in SMath using an array of variables?


You have vectorize() in SMath.



Thanks again. As I commented in my reply to oscapmo, I should have remembered that myself. Too many late nights.

Best regards,

Gerard
1 пользователям понравился этот пост
Alvaro Diaz Falconi 16.09.2021 15:00:00
#6 Опубликовано: 16.09.2021 15:10:56
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote


Yes, I was thinking along those lines myself but hoping that someone could suggest a 'cleaner' solution that I might have been overlooking. I do that.



Hi Gerard. Two workarounds:

Clipboard04.jpg

Best regards.
Alvaro.
#7 Опубликовано: 16.09.2021 19:39:39
GerardLardner

GerardLardner

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

Группа: User

Those are clever.

Clearly, having written this originally in Mathcad, I am too old and fossilised to jump out of Mathcad mode and exploit SMath thinking properly. I really appreciate those suggestions.

Again, thank you very much.
1 пользователям понравился этот пост
Oscar Campo 16.09.2021 19:44:00
#8 Опубликовано: 16.09.2021 19:57:40
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

1. How do I convert a Given: Find block from Mathcad into an Smath solve block?


Gerard,
No CAS has equivalent. It is original property Mathsoft.
Given ► maximize/minimze/minerr/Odesolve
Often will report symbolic.
The closest to Minerr is Smath Conjugate Gradient.
Some easy to initialize, some difficult.
All my MCD have been converted, work fine.
I'm willing to try some for you.
Cheers ... Jean
#9 Опубликовано: 16.09.2021 21:22:46
overlord

overlord

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

Группа: Moderator

Wrote

Gerard,
No CAS has equivalent. It is original property Mathsoft.
Given ► maximize/minimze/minerr/Odesolve
Often will report symbolic.
The closest to Minerr is Smath Conjugate Gradient.
Some easy to initialize, some difficult.
All my MCD have been converted, work fine.
I'm willing to try some for you.
Cheers ... Jean


Already answered. Useless post.
There are function equivalents in SMath.
2 пользователям понравился этот пост
Oscar Campo 16.09.2021 21:31:00, fedeghi 17.09.2021 03:33:00
#10 Опубликовано: 16.09.2021 21:27:36
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

There are function equivalents in SMath.


Please, guide Gerard Minerr Smath
#11 Опубликовано: 16.09.2021 22:00:08
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

How do I convert a Given: Find block from Mathcad into an Smath solve block?


Given/Find for solving is too general w/o an example.
Here is an example of Given/Mineer.

Page16 Frechet.sm (47 КиБ) скачан 47 раз(а).
#12 Опубликовано: 16.09.2021 22:24:29
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Given/Find for solving is too general w/o an example.


In Smath, there are so many equivalent, even superior
to MCD Given/Find i.e: solve
Smath can't do multiple conditional solve.
Toke days Mathsoft Collaboratory to solve a multiple conditional.
In some instances, Mathcad can solve only recursive.
On similar: Smath is champion.
Please give a simple example ... Jean.
#13 Опубликовано: 16.09.2021 22:25:43
overlord

overlord

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

Группа: Moderator

Wrote

Please, guide Gerard Minerr Smath


Why someone including me still try to explain you something?
Obviously you are just a nuisance of this forum.

2021-09-17_04-23_1.png

2021-09-17_04-23.png
1 пользователям понравился этот пост
fedeghi 17.09.2021 03:32:00
#14 Опубликовано: 17.09.2021 09:19:52
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

How do I convert a Given: Find block from Mathcad into an Smath solve block?


Here is an example.

Maths Goat Radius QUICK.sm (9 КиБ) скачан 67 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений