HP Forums
error with Solve App - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: error with Solve App (/thread-2306.html)



error with Solve App - resolved - 10-17-2014 03:12 AM

I have a very simple set of equations in SolveApp, which when solve is pushed, the result is a red x “Solver error”. What am I doing wrong here??? the two equations are below:

0=F + G*4/5
0=-6000 + G*3/5

I put in a seed value of 10000 for G, and still get the error, then put in a seed value for F, -8000 and still get the error.


RE: error with Solve App - Tim Wessman - 10-17-2014 03:25 AM

You are not doing anything wrong. Rather, the "digit grouping" separators are causing the problem.

What is actually happening is that the value you put in is *not* actually getting stored in the variable. You can see this by typing 10000 in for G, and then go to the home screen and type G. The value will be the old one.

Only workaround unfortunately for the moment is either a) manually store something in for G in the command line (G:=10000) or else b) turn of the digit grouping.


RE: error with Solve App - resolved - 10-17-2014 03:39 AM

Thanks for the quick reply. I checked G in HomeMode and got 10000. Checked the Solve App, still the same error message. I entered G:=10000 in HomeMode, confirmed G, returned to Solve App, still got the same error. I then checked what was being stored in F, got 7.2****E-12, replace that value to -5000. Checked the Solver App and got the correct answer -8000.

I looked at the setting in HomeMode and found "digit grouping" but there was no way to turn it off. Is there another way to turn off "digit grouping" ???


RE: error with Solve App - Tim Wessman - 10-17-2014 04:06 AM

Apologies, I was not clear there. What I meant was select one of the non-comma separated display options like 123456.789 or 123456,789


RE: error with Solve App - mcjtom - 10-26-2014 06:25 AM

Tim,

Could you elaborate on what Solve Eq. actually does with the variables, when values are provided?

The part I don't understand is storing a value of a named constant in the equation in a variable (e.g. G:=1000) vs. storing it (somewhere) by using the Solve Eg. app page (in which case, how does Solve Eq. app treat the second value actually stored under the variable name, say G)?

Cheers


RE: error with Solve App - jebem - 10-26-2014 07:22 AM

(10-17-2014 03:12 AM)resolved Wrote:  I have a very simple set of equations in SolveApp, which when solve is pushed, the result is a red x “Solver error”. What am I doing wrong here??? the two equations are below:

0=F + G*4/5
0=-6000 + G*3/5

I put in a seed value of 10000 for G, and still get the error, then put in a seed value for F, -8000 and still get the error.

It worked for me at first try.
I didn't need to specify any guess values (F and G are automatic declared global
system variables, and in my case it had the default value of 0).

Result:
F:-8000
G:10000

What I did:
1. Press the "Home" key;

2. Press Shift+Home to go into Settings. My current option values are:
- Angle Measure: Radians;
- Number Format: Standard;
- Digit Grouping: 123,456.789;
- Entry: Textbook
- Integers: Hex 32
- Complex: a+b*1
- Language: English

3. Press Apps key, select Solve and type:
On E1: 0=F+G*4/5
On E2: 0=-6,000+G*3/5

4. Press Num key and select Solve.


RE: error with Solve App - YEDERF - 10-26-2014 01:08 PM

fence SHIFT HOME (home settings) at 123456.789 select grouping of digits
so no temdra these problems !!!


RE: error with Solve App - DrD - 10-26-2014 02:55 PM

Another approach, using the solve() function:

solve({0=F+G*4/5,0=-6000+G*3/5},{F,G}) => {[-8000.,10000.]}

An {equation list} containing the two equations, and a {variable list} containing the two unknowns, returns a {list} of the solutions.

-Dale-


RE: error with Solve App - rprosperi - 10-26-2014 04:08 PM

(10-26-2014 02:55 PM)DrD Wrote:  Another approach, using the solve() function:

solve({0=F+G*4/5,0=-6000+G*3/5},{F,G}) => {[-8000.,10000.]}

An {equation list} containing the two equations, and a {variable list} containing the two unknowns, returns a {list} of the solutions.

-Dale-

I continue to struggle with understanding the different results when using the same equations in Home and CAS modes; this is a good example.

In CAS mode, the above equation indeed produces {[-8000 10000]}

In Home mode however, I get {[0 255]}, obviously incorrect.

I used Copy / Paste to ensure identical input.

Display mode is set to 123456.789; in Algebraic entry mode

Can someone explain? Is this due to pre-exisitng values in F and G in Home mode?


RE: error with Solve App - jebem - 10-26-2014 05:29 PM

(10-26-2014 04:08 PM)rprosperi Wrote:  In Home mode however, I get {[0 255]}, obviously incorrect.
Display mode is set to 123456.789; in Algebraic entry mode

Strange, indeed.

Works with me, on both the physical and virtual calculators.
See my post #6 for my settings.

Interestingly, it works with digit grouping using commas as thousands separators or just without them. Algebraic or textbook is ok too.

The F and G variables are global and I never had to assign a value to them. Zero is ok.
However, changing F and G contents in the Solve app (press Num key, then Edit), makes no difference in the result.
There is one exception, though: when typing very small negative numbers like -99E-410 (using the EEX key to enter the exponent) in both Variables, I get an "Solver error" message.
But I guess this is not what you are doing, so the issue must be something else.


RE: error with Solve App - DrD - 10-26-2014 05:47 PM

linsolve([0 = (F+(G*4/5)),-6000+G*3/5],[F,G]) Also works.

One helpful hint: The Toolbox key reveals that 'solve' is a CAS function. I try to stay within the associated HOME or CAS framework when working with functions and commands.

Whether it is a general truism or not, I don't fully know, but after reading many posts Parisse (and others) have resolved for us, I gather the distinction between the two "modes" doesn't mix well.

-Dale-


RE: error with Solve App - Helge Gabert - 10-26-2014 07:53 PM

It is a good idea to work with CAS functions in the CAS environment, and with Home functions in the Home environment (this also goes for programs, naturally).

However, if you are really bent on using a CAS function in Home, here is one way to do it:

CAS("solve({0=6000...,0=F+...},{F,G})") works fine.


RE: error with Solve App - rprosperi - 10-27-2014 12:02 AM

Jose, Dale & Helge:

Thanks for your comments. I agree it's best (likely essential) to use CAS features in CAS mode, Home features in Home mode, etc. to get expected results, as this minimizes most mode issues.

Jose - I am using the command line in Home, not the Solve application, which explains our different results.

What concerns me is when I get invalid results, like in this case as I noted above, with no hint that the requested features, mode, etc. aren't valid. The command I entered in Home mode was accepted, and a seemingly valid answer provided, however it is completely wrong.

Things like this erode my confidence in using Prime, as I can't trust the answers it gives me. I'd much prefer in such case I get an error or warning, so at least I have a chance to notice I may be in the wrong mode, used lower case instead of UPPER CASE, etc.

The reason I asked for an explanation is not to understand why it gave me an invalid answer, but rather why it gave this answer at all, which I presume actually is valid for some non-obvious conditions which CAS used to evaluate the solve() call.

Hope thats more clear.