Questions converting Mathcad to SMath Studio/Solver

Questions converting Mathcad to SMath Studio/Solver - Messages

#1 Posted: 9/15/2021 8:48:49 PM
GerardLardner

GerardLardner

4 likes in 34 posts.

Group: 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 Posted: 9/15/2021 9:16:54 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 Posted: 9/15/2021 9:37:31 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: 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 KiB) downloaded 29 time(s).
#4 Posted: 9/16/2021 9:31:56 AM
GerardLardner

GerardLardner

4 likes in 34 posts.

Group: 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 users liked this post
Oscar Campo 9/16/2021 9:41:00 AM
#5 Posted: 9/16/2021 9:42:20 AM
GerardLardner

GerardLardner

4 likes in 34 posts.

Group: 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 users liked this post
Alvaro Diaz Falconi 9/16/2021 3:00:00 PM
#6 Posted: 9/16/2021 3:10:56 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 Posted: 9/16/2021 7:39:39 PM
GerardLardner

GerardLardner

4 likes in 34 posts.

Group: 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 users liked this post
Oscar Campo 9/16/2021 7:44:00 PM
#8 Posted: 9/16/2021 7:57:40 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 9/16/2021 9:22:46 PM
overlord

overlord

551 likes in 1332 posts.

Group: 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 users liked this post
Oscar Campo 9/16/2021 9:31:00 PM, fedeghi 9/17/2021 3:33:00 AM
#10 Posted: 9/16/2021 9:27:36 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

There are function equivalents in SMath.


Please, guide Gerard Minerr Smath
#11 Posted: 9/16/2021 10:00:08 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 46 time(s).
#12 Posted: 9/16/2021 10:24:29 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 9/16/2021 10:25:43 PM
overlord

overlord

551 likes in 1332 posts.

Group: 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 users liked this post
fedeghi 9/17/2021 3:32:00 AM
#14 Posted: 9/17/2021 9:19:52 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 66 time(s).
  • New Posts New Posts
  • No New Posts No New Posts