solve & roots with units

solve & roots with units - Messages

#1 Posted: 6/3/2023 8:48:30 AM
Valery Ochkov

Valery Ochkov

55 likes in 633 posts.

Group: User

I can it solve in Mathcad - see please mcdx and pdf files
I try solve it (heat transfer) in SMath - see sm file
Help please
File not found.File not found.File not found.
Kerimov-Cvetkov-Velichko-1-7.png
#2 Posted: 6/3/2023 3:37:44 PM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

Wrote

I can it solve in Mathcad - see please mcdx and pdf files
I try solve it (heat transfer) in SMath - see sm file
Help please


SMath symbolic solving of integration is not capable as Mathcad.
Thus integrals can't be used with numeric solvers.
However, you can use a little trick to solve them.
Using maple or maxima plugins is the key.
Here is your problem solved with various ways, roots() and Findroot().

Regards

solvewithunits.sm (23 KiB) downloaded 46 time(s).
3 users liked this post
Valery Ochkov 6/3/2023 3:53:00 PM, sergio 6/4/2023 1:03:00 PM, NDTM Amarasekera 6/4/2023 3:15:00 AM
#3 Posted: 6/4/2023 2:18:41 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. The attached have an al_nleqsol wrapper for a Mathcad block with units, that can accept SMath's integrals too.

Click to enlarge

Kerimov-Cvetkov-Velichko-1-7 - nSol.sm (17 KiB) downloaded 52 time(s).

Best regards.
Alvaro.
2 users liked this post
sergio 6/4/2023 1:03:00 PM, Valery Ochkov 6/4/2023 2:22:00 AM
#4 Posted: 6/4/2023 10:00:56 AM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

Actually, you don't need to find Tc2 first hand.
Findroot() can solve with all three equations at once.
All important is the order of unknowns.

Regards

2023-06-04_15-58.png
2 users liked this post
Valery Ochkov 6/4/2023 12:03:00 PM, sergio 6/4/2023 1:48:00 PM
#5 Posted: 6/5/2023 12:08:21 AM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

Here is a paper-friendly version.
Also check how variable guess points are assigned.

Regards

2023-06-05_06-05.png
1 users liked this post
Valery Ochkov 6/5/2023 2:23:00 AM
#6 Posted: 6/5/2023 2:24:02 AM
Valery Ochkov

Valery Ochkov

55 likes in 633 posts.

Group: User

Wrote

Here is a paper-friendly version.
Also check how variable guess points are assigned.

Regards

2023-06-05_06-05.png


Thanks!
Send please the sm file.

#7 Posted: 6/5/2023 11:08:24 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello Valery,
In some application(s), you can associate FindRoot with epsilon.

Solve Diophantine Chemical Balance epsilon.sm (106 KiB) downloaded 37 time(s).
1 users liked this post
Valery Ochkov 6/5/2023 11:26:00 AM
#8 Posted: 6/5/2023 5:39:04 PM
overlord

overlord

552 likes in 1332 posts.

Group: Moderator

Wrote

Thanks!
Send please the sm file.


solvewithunits.sm (14 KiB) downloaded 41 time(s).
#9 Posted: 6/26/2023 2:33:01 AM
netsonicyxf

netsonicyxf

2 likes in 79 posts.

Group: User

Please help, why can't find root for this simple equation?
File not found.File not found.
root.sm (20 KiB) downloaded 30 time(s).
#10 Posted: 6/26/2023 5:54:06 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

why can't find root for this simple equation?



Because there aren't unknows

2023-06-26 10_49_28-SMath Solver - [root.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#11 Posted: 6/26/2023 8:45:01 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Please help,
why can't find root for this simple equation ?


roots solves wrt scalar function(s)
In this example, both functions are scalar wrt 'x'.
Try ... roots[(sin(x)-Gamma(x),x,1]
'x not defined' ... Gamma(x) is not scalar wrt 'x'
Few more numerical functions are not scalar
erf(x), erf(x,n) ... erfc(x), erfc(x,n) ...

NLroots.PNG
#12 Posted: 6/26/2023 8:55:02 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Try ... roots[(sin(x)-Gamma(x),x,1]


In that case and similar ones,
RootSecant algorithm will spits out 15 decimals, instantaneous.
Cheers ... Jean.

#13 Posted: 6/26/2023 10:06:59 AM
netsonicyxf

netsonicyxf

2 likes in 79 posts.

Group: User

Wrote

Wrote

why can't find root for this simple equation?



Because there aren't unknows

2023-06-26 10_49_28-SMath Solver - [root.sm_].png



Thanks Davide.
Now I put "N" as unknown in the Eq. But it can't be solved either.
1.png

root.sm (19 KiB) downloaded 25 time(s).
#14 Posted: 6/26/2023 10:58:58 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

You have to play a little with the precision, especially if there are units involved; in this case, seems that 10^-3 mm is a stable target (10^-2 works too, but in some case it returns the guess value, meaning that is "close enough" for the algorithm - you can see in the plot that 0kN to 200kN is in +0.02/-0.02mm range)

2023-06-26 15_55_45-SMath Solver - [root_r1.sm].png

root_r1.sm (24 KiB) downloaded 29 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
netsonicyxf 6/26/2023 12:18:00 PM
  • New Posts New Posts
  • No New Posts No New Posts