Symbolic "solve" function with pi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Symbolic "solve" function with pi

akim80
Octave: version 4.2.1
Ubuntu 16.04.2 LTS xenial

Hi all,

I am using the symbolic package in Octave, and the function "solve"
encountered an error when working with pi.

error: Python exception: NotAlgebraic: pi doesn't seem to be an algebraic
element
    occurred at line 21 of the Python code block:
    d = sp.solve(eqs, *symbols, dict=True)

These are the commands that caused this error:

>> for i = 1:size(points,1)

  if pointcount(i,1) ==1

    norm = points(i,:) + t*NORM;

    normfunc = subs(planefunction, P, norm);

    t0 = solve(normfunc);

    projP(i,:) = double(vpa(subs(norm,t,t0)));

  end

end


... where the variables take the following values:

>> disp (norm);

  ⎡  295717⋅t                       120954⋅t      7764        170591⋅π⋅t      
15292⋅π ⎤
  ⎢- ──────── + √82214  - ──────── + ────  - ────────── + ───────⎥
  ⎣       39                              29            25              32              
9515   ⎦
>> disp (normfunc);

                                  2
     95796258025285⋅t         29101289281⋅π ⋅t        295717⋅√82214    
23854353463
  ──────────────── + ──────────────── - ───────────── + ───────────
      1279161                            1024                         39                  
11310
>> disp (NORM);

  -7.5825e+03  -4.1708e+03  -1.6748e+04
>> disp(planefunction)
                                                        ⎛     15292⋅π  ⎞
                                           170591⋅π⋅⎜z - ───────⎟
      295717⋅x      120954⋅y                    ⎝        9515   ⎠      
192520542083
  - ──────── - ──────── - ────────────────────── + ────────────
       39                 29                          32                            
56550

and t is a sym, and points and pointcount are double matrices.

My main confusion is, why does the pi symbol appear in norm, when norm is a
sum of a double and a symbolic that doesn't include pi? This is really
annoying, since I don't need the pi symbol to solve my equations, and the pi
symbol appears for seemingly no reason, causing errors.

Thanks!



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave