Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline ElSid  
#1 Posted : 13 April 2016 21:13:53(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Doing something wrong ...
Trying to solve empirical formula with matrix input using either solve or maple(solve) Solve Block.sm (13kb) downloaded 47 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 14 April 2016 01:10:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Before applying some suite, you must have something to process.
With only two temp. BTU means nothing. Two values are missing.
With the two you provide: who knows to what BTU rate they apply ?

Jean

Forum BTU.gif
Offline ElSid  
#3 Posted : 18 April 2016 21:05:15(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Before applying some suite, you must have something to process.
I do. Based on empirical formula, I want to solve for the "flow" based on the total energy. Delta T is constant, so I don't understand your comment.

Here is a revised file, hopefully clearer as to what I am looking for...
Solve Block.sm (8kb) downloaded 36 time(s).

Edited by user 18 April 2016 21:47:39(UTC)  | Reason: Not specified

Offline Jean Giraud  
#4 Posted : 18 April 2016 23:22:30(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Maybe like this ?

Forum BTU Solved.gif
Offline ElSid  
#5 Posted : 18 April 2016 23:44:16(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Jean,
The first descriptor shows ME doing the algebraic manipulation and getting the correct answer. I am trying to use "solve" to solve the equation with no success. As always, thank you for looking and responding
Offline mikekaganski  
#6 Posted : 19 April 2016 00:19:49(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
I'm not sure why would you need the solve() when you may directly calculate the result as you did,
but here it goes Good Solve Block.sm (8kb) downloaded 33 time(s).
solve() cannot find units, so you need to "help" it allowing it to search for unitless values and adding required units by hands. Also, it cannot search matrices - so iterate it (I used vectorize() Crazy ).
Third - you need to pay attention when you use assignments, and when - comparisons. You happened to use := in solve() instead of ≡.
Fourth - solve(#,#) searches inside the range that is set in program's settings - use solve(#,#,#,#) to define custom range Good

Edited by user 19 April 2016 00:21:40(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 19/04/2016(UTC)
Offline ElSid  
#7 Posted : 19 April 2016 00:37:29(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Thank you!
See attached.Solve.PNG
I like documenting and showing the empirical equations for others to "see", whenever possible. Yes, easy for me to re-arrange, put I wanted to keep the look of the empirical equations when possible. This is one for Jean and his units argument.
Why do we need to put the range? (solve(4)) I thought Solve two went only on the positive side so range was not needed. I guess I should de-fault to more instead of less. I had something similar without the units corrected as you did it...at one point

Edited by user 19 April 2016 00:44:46(UTC)  | Reason: Not specified

Offline Davide Carpi  
#8 Posted : 19 April 2016 01:20:15(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: ElSid Go to Quoted Post
Why do we need to put the range? (solve(4))I thought Solve two went only on the positive side so range was not needed.I guess I should de-fault to more instead of less.I had something similar without the units corrected as you did it...at one point

solve(2) is perfect for calculations "on the fly"; if you need consistent and reproducible calculations I strongly reccomend solve(4); this because solve(2) it depends on settings that may change from computer to computer or in the same computer they may changes on the time (since the range you need in some application may not be the same of another, and someone - even you - may have changed these settings since last time you have executed the worksheet). However if you still want to use solve(2), I suggest you to document somewhere near the function the range to use.

Edited by user 19 April 2016 02:52:40(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 19/04/2016(UTC)
Offline mikekaganski  
#9 Posted : 19 April 2016 02:34:44(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
I want to add to Davide's excellent explanation.

It's not always good to set solve range (in settings, or in solve(4) ) to very large size, because it may lead to inability to find roots, or poor precision.
solve() first splits the range to 100 even pieces and evaluates the expression for each point (excluding high edge, btw). You may see this if you try solve(x≡x;x) for default range, or similar with solve(4). After that, slove analyzes the data, using limited number of iterations. So, for very large range, no points may help it to find roots, or too many iterations may be required, so no results may be returned.
Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 19/04/2016(UTC)
Offline Jean Giraud  
#10 Posted : 19 April 2016 05:02:28(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Elsid,

Revisit "Samples" the solve stuff I posted within last 2 weeks.
"solve", "Solve" are brute force of unpredictable inaccuracy.
In one of the examples, the acuracy is e-9, that is enough to
shoot Jupiter instead of Mars. OK, HVAC is empirical. Further
temperature controlled, not to avail so much "pain & prestige".

My Smath 5346 does not have the vectorise operator, survive w/o.
BTW, such huge numbers with so many decimals, make it integer,
and maybe set the last integer value to 0 , to meet empirical.

Cheers, Jean
thanks 1 user thanked Jean Giraud for this useful post.
on 19/04/2016(UTC)
Offline ElSid  
#11 Posted : 19 April 2016 06:24:48(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Agree about truncating and rounding ... another reason I am not high precision. Looking up that "brute force" discussion
Offline ElSid  
#12 Posted : 03 August 2017 21:39:08(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Follow up on this post. On 0.98.6398, I am now seeing a problem where assigning the solve block to a variable fails. solve block 2.smz (3kb) downloaded 15 time(s).
Offline mkraska  
#13 Posted : 03 August 2017 22:19:33(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Solve() from the Maxima plugin
2017-08-03 21_14_16-SMath Studio 0.98.6398 - [solve%20block%202.smz_].png
solve%20block%202.sm (5kb) downloaded 18 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline ElSid  
#14 Posted : 03 August 2017 23:04:27(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
mkraska - Thank you, but not what I was looking for. I have the power already calculated/known ... I am looking to solve for a rate of time. As you can see in my example, the program will solve as long as I do NOT define the solve block with a variable. It also looks like you are using the Maple plugin.

Update, I thought that Vectorize eliminated the nesting issue. I think that is what is going on as my solution may be a nested item and not a matrix. Definitely a nesting issue. How do I "un-nest" a Vectorized equation? Solve Block 2.smz (3kb) downloaded 17 time(s).without jMG Matrix manipulation. I was hoping Vectorize would simplify the issue.

Edited by user 04 August 2017 00:10:38(UTC)  | Reason: Nesting comment

Offline Jean Giraud  
#15 Posted : 04 August 2017 16:55:57(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
The solve block is not compatible for assigning objects that are vectorized.
This was first noticed solving Gamma(x), that solves un-assigned.
erf(x), Gamma(x) are two reported, that solve from vectorising, not assignable.
Nothing to do => copy/pate ... Does not spool to file either

Jean
thanks 1 user thanked Jean Giraud for this useful post.
on 04/08/2017(UTC)
Offline ElSid  
#16 Posted : 04 August 2017 20:52:58(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
The solve block is not compatible for assigning objects that are vectorized....

Any recommendations? For now, I will do copy and paste, but I would like to "automate" the solution since these numbers are used downstream. I'm not seeing a programmed solve program, unless there is an example I missed in the forum.

Offline mkraska  
#17 Posted : 04 August 2017 21:00:40(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: ElSid Go to Quoted Post
Any recommendations? For now, I will do copy and paste, but I would like to "automate" the solution since these numbers are used downstream. I'm not seeing a programmed solve program, unless there is an example I missed in the forum.



Maybe, I don't understand the question. To me, it looks like you try to repeatedly solve an equation for various values of the constants in the equation. And you have vectors of these constants.

So what I did was to generate a symbolic solution and use vectorize to apply the various input values. But you didn't seem to like it.

Also, I am a bit helpless faced with your use of units. I'd use units only in values of quantities, never as free parts of equations, otherwise these equations become dependent on the units used. My approach shown above is completely consistent in terms of units.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#18 Posted : 05 August 2017 03:29:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ElSid Go to Quoted Post
Any recommendations?For now, I will do copy and paste, but I would like to "automate" the solution since these numbers are used downstream.I'm not seeing a programmed solve program, unless there is an example I missed in the forum.

==========================================

You have missed nothing from the forum, has never bee exemplified.
I don't work with units, sorry for your work sheet.
As explained before => Gamma(x) is one that needs be vectorised locally
That does not exclude global vectorising for further use, downstream the document.

Cheers Esild ... Jean

SolveVectorise.PNG
Offline Jean Giraud  
#19 Posted : 05 August 2017 04:29:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
That' the best I can do.
1. Subscript should not exist [complicate matters].
2. What are "Units" doing in Engineering works ?

Jean

solve block 2 Examine Solutions.sm (8kb) downloaded 18 time(s).
Offline ElSid  
#20 Posted : 05 August 2017 06:41:32(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
mkrask,
maybe it's my misunderstanding and lack of familiarity with the Maple plugin

Jean,
Finally, an example that shows WHY we need units Good the items in the array are in kW and need to be in BTU/hr for the empiracle equation to be valid. If I split the array like you did, it does what i need ... wondering why I cannot do it with vectorize Solve Block 2a.smz (5kb) downloaded 16 time(s).
Users browsing this topic
Guest
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.