• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
hp prime

The two rows have the same equation, why I cannot get the second answer of the first row in the second row?solve functions bug

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
HP Recommended

Degrees in CAS isn't a good idea. CAS only works correctly with radians!

 

best regards

 

Wolfgang 

View solution in original post

6 REPLIES 6
HP Recommended

Hi!, mrlin:

 

Welcome, to Forum!.

 

See, this images ...

Screenshot_2016-02-01-23-03-12.png

 

Screenshot_2016-02-01-22-59-36.png

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

can't see your images

HP Recommended

Hi!, mrlim:

 

Note: The images are created in .png format.

 

You needed, configure in CAS, mode aprroximate.

Now, write ...

 

solve(-4.905*t^2+2185.67*t+60=0,t) --> {-2.7449845633E-2, 445.627857593}

 

solve(-9.81/2*t^2+3091/Square Root of 2 *t+60=0,t) --> {-2.7449845633E-2, 445.627857593}

Kind Regards !.
Have a nice day !.
@Maké (Technical Advisor Premium - HP Program Top Contributor).
Provost in HP Spanish Public Forum ... https://h30467.www3.hp.com/
HP Recommended

Hello,

 

The Prime CAS behaves like all modern advanced mathematics software. Namely, it does not make assumptions about what the user has typed and silently switch modes or change behavior when asked to do something. Why is this important? I shall explain.

 

*There is not a single math software in the world that can be certain absolutely when using approximate numbers that you have returned all possible results in all cases*. Unfortunately, humans have not figured out a method to do this yet. As people, our brains can look at something and say "there should be another result there", but a computer can't do that quite yet. 🙂

 

When you use the "solve" command in the CAS, you are asking it to solve *symbolically* (or exactly, with no possible numerical inaccuracy) the given equation. If you type approximate numbers (numbers that have a decimal in them), you are telling it to drop down into the numerical solving algorithmns. This means that it cannot use its much more capable/advanced techniques to find an isolate roots and be near certain that all results have been found. Its like the difference between solving a quadratic equation exactly using the quadratic formula, and putting in numbers to approximate it and getting "close enough".

 

To solve equations numerically, you should use do one of two things:

 

First, use the fsolve command (in the menu as "Numerical Solve" rather then just "Solve"). This allows you to specific specific ranges to search for results. For example:

 

fsolve(x^3+3*x^2-1,x,-1..1) returns [-.65, .53] - It does not returns the other result at -2.88. The -1..1 is the range in which to numerically search for an answer. You could specify -4..-2 and you'd see that one other result and not the two already given.

 

Why am explaining this? Because by using . in your numbers, you actually told it to drop into the "fsolve" mode? Since there isn't any range specified, it uses a "default" range for the search. In this case, it would probably be something like -pi to pi since there is a trig involved.

 

Since you know that you are looking for a positive result in this projectile physics problem, you could have tried fsolve(... ,t, 200..600) or something like that to give yourself a "better guess".

 

"Well" you say, "I have decimals already. Is there anything to be done?" This brings us to our second thing:

 

When you are trying to solve problems in the CAS, it is generally a really good idea to make sure you have exact numers with no decimals involved. If you want, you can tell the CAS "go ahead an try to convert my decimals into an exact ratio". This can be accomplished using the "exact()" command.

 

So if you do your original problem and typed solve( ((-1/2)*981/100)*t^2+3091*sin(45)*t+60= 0,t), you'd actually get back the exact solutions for both results. Note how I just subbed the 981/100 for the gravity acceleration to keep it exact.

 

Alternatively, you could have written solve(exact( (-1/2)*9.81*t^2+3091*sin(45)*t+60) = 0,t). The "exact(...)" in there would convert any decimals to an exact fraction as close as possible. Then your solve will spit out both results as well. Pressing the shift ENTER function will run the "approx" command and you'll see your two numeric results come out.

 

 

Summing up: when working with the CAS, try to always have your numbers be exact to get the best possible results. Use "exact" to conver when doing it manually is annoying, and the "approx" function at the last step only right before you want a numerical result.

 

 

 

Also, did you know you could enter in your projectile equations in the SOLVE app, save a copy of it, and then later just plug in some numbers for your variables? It makes it very quick to solve this type of problem doing it that way.

 

 

 

Side note: I highly recommend you don't change any of the CAS settings. It generally will not be helpful and will work best when left alone. To put them back, go the the CAS screen and do the "Clear" function which is the Shift-Esc button.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
HP Recommended

Thanks for your reply! It does not work!

 

However, if i change the "degrees" mode into "radian" mode and keep value 9.81 and changed the sin(45) to sin(pi/4), it showed up both answers successfully.

 

If I use sin(45) in the degrees mode with the methods u guys said, it only showed one answer. I tried all the method u guys said, it doesn't work...... Only work in "radian" mode

HP Recommended

Degrees in CAS isn't a good idea. CAS only works correctly with radians!

 

best regards

 

Wolfgang 

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.