bugGNU Octave - Bugs: bug #58456, [octave forge] (symbolic) vpasolve...

 
 

bug #58456: [octave forge] (symbolic) vpasolve error: NameError: name 'exp_polar' is not defined

Submitted by:  michael peters <michaelpetersubc>
Submitted on:  Wed 27 May 2020 04:50:16 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 27 May 2020 06:14:09 PM UTC, comment #3: 

Thanks for the full example, confirmed and reopened.

Mike Miller <mtmiller>
Project Administrator
Wed 27 May 2020 05:53:21 PM UTC, comment #2: 

Live an learn, thanks.  Here is the original code block, exp_polar is called by some thing.  Sorry, I was trying not to send this - but if you do this, you can run it to see the error.
Also tried on later versions of octave.
thanks

Throws the error
Python exception: NameError: name 'exp_polar' is not defined
    occurred at line 8 of the Python code block:

pkg install -forge symbolic
pkg load symbolic
syms r v_min v_max t
syms s v p F f;

%---------------INPUT WINDOW-------------------%
n = 2            % should > 1
alpha = 4/5     % should in (0,1)
z=200
F(v) = ((1/2)*(sqrt(z*v^4 + 1) - 1)/v^2)/((1/2)*(sqrt(z*1^4 + 1) - 1))
%---------------INPUT WINDOW-------------------%

f(v) = diff(F(v));
eq1 = alpha * (t*(1-F(t))-(v_max - (1-F(v_max))/f(v_max))) == ...
(1-alpha)*...
(...
(v_min-t)*...
((v_max - (1-F(v_max))/f(v_max))-(v_min - (1-F(v_min))/f(v_min)))*...
f(v_min)+...
(F(v_max)-F(v_min))*...
((v_max - (1-F(v_max))/f(v_max))...
-((1-F(v_min))*v_min-(1-F(v_max))*v_max))...
);

eq2 = (-alpha*f(t*(1-F(t))) == ...
(1-alpha)*((v_max - (1-F(v_max))/f(v_max))-(v_min - (1-F(v_min))/f(v_min)))*f(v_min));
eq3 = (-(r - (1-F(r))/f(r)))*f(r) ==...
((v_max - (1-F(v_max))/f(v_max))-(v_min - (1-F(v_min))/f(v_min))*f(v_min));
eq4 = ((1-alpha)^(n-1) * int(F(s)^(n-1),s,r,v_min) == ...
(((1-alpha)*F(v_max)+alpha)^n-((1-alpha)*F(v_min))^n) /...
(n*(1-alpha)*(F(v_max)-F(v_min))+alpha)*(v_min-t));

%[r_s, t_s, v_min_s, v_max_s] = vpasolve([eq1 eq2 eq3 eq4],[r t v_min v_max],[[0,1]; [0,1]; [0,1]; [0,1]]);
out = vpasolve([eq1 eq2 eq3 eq4],[r t v_min v_max],[0.3; 0.4; 0.6; 0.75]);
#out = fsolve([eq1 eq2 eq3 eq4],[r t v_min v_max],[1/2; 1/2; 1/2; 1/2]);
r_s = double(out(1));
t_s = double(out(2));
v_min_s = double(out(3));
v_max_s = double(out(4));
disp([r_s, t_s, v_min_s, v_max_s]);

if (v_max_s >= v_min_s && v_min_s >= t_s && t_s >= r_s)
    fprintf('Inequality condition is met\n');
else
    fprintf('WARNING: Inequality condition is not met\n');
end

michael peters <michaelpetersubc>
Wed 27 May 2020 05:37:58 PM UTC, comment #1: 

No, the 'exp_polar' function is not a part of the symbolic package. This is the name of a SymPy function, but is not part of the Octave symbolic function set.

Closing as invalid since the example you show is just calling 'exp_polar' directly. If you have an example that shows this function being called as a side effect of some other operation, please share.

Mike Miller <mtmiller>
Project Administrator
Wed 27 May 2020 04:50:16 PM UTC, original submission:  

This originally came up trying to solve a system of non-linear equations using the symbolic package.  Some routine in vpasolve tried to use polar coordinates.  To reproduce the problem

pkg install -forge symbolic
pkg load symbolic
syms x
ezplot(erf(x), [-pi, pi])+ezplot(exp_polar(x),[-1,1])

The erf function  plots, the exp_polar function throws this error
error: 'exp_polar' undefined near line 1 column 32

As I understand both functions are part of the symbolic package.

michael peters <michaelpetersubc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by michaelpetersubc (Submitted the item)
  • -email is unavailable- added by michaelpetersubc (octave bug report)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-27 mtmiller CategoryLibraries => Octave Forge Package
        StatusInvalid => Confirmed
        Open/ClosedClosed => Open
        Release4.2.2 => dev
        Summarysymbolic package is not loading the function exp_polar => [octave forge] (symbolic) vpasolve error: NameError: name 'exp_polar' is not defined
    2020-05-27 mtmiller StatusNone => Invalid
        Open/ClosedOpen => Closed
    2020-05-27 michaelpetersubc Carbon-Copy- => Added hongkaiyu1999@gmail.com

    Back to the top


    Powered by Savane 3.5