HP Forums
(CAS) Symbolic vs Numeric Solver (Non CAS) - 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: (CAS) Symbolic vs Numeric Solver (Non CAS) (/thread-18456.html)



(CAS) Symbolic vs Numeric Solver (Non CAS) - tim_crouse - 06-09-2022 12:22 AM

How do I know when to use which solverf?

-Tim C.


RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - rawi - 06-09-2022 09:16 AM

Use CAS if the outcome is an expression. Use non-CAS if the outcome is a figure.


RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - tim_crouse - 06-09-2022 10:56 AM

Thanks for the response.

Would you happen to be able to point me to a good example of when to use CAS.

My understanding of your answer is that CAS is helpful to work through the steps of an equation but at the last step you may have to switch to the non-cas solver to get a numeric solution to the entire equation set , Or maybe this is just one use case.

Not really a calculator question but when would a solution to an equation be an expression ( say in Algebra 1 or Algebra 2)?

Thanks For Your Help
-Tim C.


RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - C.Ret - 06-09-2022 05:37 PM

Here are two example problems (see the tiny diffrence between the two equation to solve !) resolve with the HP Prime CAS mode using symbolic or numeric resolution :

[attachment=10776]

Of course, the real advantage of the CAS mode is its ability to make the resolution step by step and by yourself:

[attachment=10775]

Teachers will praise me for discouraging you from using your calculator as a "black box" when it can be used to help you learn more and build skills.


RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - rawi - 06-09-2022 06:11 PM

Hi Tim,

a very simple example:
In CAS solve(a*x^2+b*x+c=0,x) will deliver you the well known formulas:
{(-b+SQRT(-4*a*c+b))/(2*a), (-b-SQRT(-4*a*c+b^2))/(2*a)}.

But be aware that CAS is rather limited. If I type in solve(a*x^3+b*x^2+c*x+d=0,x) no solution is given despite a formula for the solution exists.


RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - parisse - 06-10-2022 05:57 AM

(06-09-2022 06:11 PM)rawi Wrote:  But be aware that CAS is rather limited. If I type in solve(a*x^3+b*x^2+c*x+d=0,x) no solution is given despite a formula for the solution exists.
This is not a limitation, but intended, because the Cardan formula for a general 3rd order equation would raise expressions that could not be simplified afterwards. I mean that there are 3 complex solutions, that can be expressed with 1/3 powers of arguments themselves containing square roots. Now it's a well known result that the sum of the roots is -b/a, but trying to simplify the sum of the 3 expressions to -b/a would just be too hard.
Therefore real-life CAS handle these kind of polynomials with algebraic extensions.

Of course you are entirely free to write a small program yourself, you can inspire yourself from this Xcas code:
Code:

cardan(P,x):={
  local b,p,q,d,V,u,v,x1,x2,x3,n,j;
  j:=exp(2*i*pi/3);
  V:=symb2poly(P,x);
  n:=size(V);
  if (n!=4){
    throw(print(P)+" n'est pas de degre 3");
  }
  // Reduction 
  V:=V/V[0];
  b:=V[1];
  V:=ptayl(V,-b/3);
  p:=V[2];
  q:=V[3];
  // now x^3+p*x+q=0
  // x=u+v -> u^3+v^3+(3uv+p)(u+v)+q=0
  // Let uv=-p/3 then u^3+v^3=-q and u^3 and v^3 are solutions
  // of u^3 v^3 = -p^3/27 et u^3+v^3=-q
  // hence of x^2+q*x-p^3/27=0
  d:=q^2/4+p^3/27;
  if (d==0){
    // root of multiplicity 2
    return solve(P,x); 
  }
  d:=sqrt(d);
  u:=(-q/2+d)^(1/3);
  v:=-p/3/u;
  x1:=u+v-b/3;
  x2:=u*j+v*conj(j)-b/3;
  x3:=u*conj(j)+v*j-b/3;
  return [x1,x2,x3];
}:;



RE: (CAS) Symbolic vs Numeric Solver (Non CAS) - tim_crouse - 06-10-2022 06:12 PM

Thank You all for your help

Best Regards
-Tim C.