[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #58456] symbolic package is not loading the fu
From: |
michael peters |
Subject: |
[Octave-bug-tracker] [bug #58456] symbolic package is not loading the function exp_polar |
Date: |
Wed, 27 May 2020 13:53:21 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0 |
Follow-up Comment #2, bug #58456 (project octave):
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
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58456>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/