Error using symengine Unable to prove '2*(c1 + c2 + 1)^(1/2) == 0 & 35 < 5*c1 + 5*c2 + 5' literally.

3 次查看(过去 30 天)
I run the code and it returns error "Error using symengine Unable to prove '2*(c1 + c2 + 1)^(1/2) == 0 & 35 < 5*c1 + 5*c2 + 5' literally."
Please help me.
clear all
clc
syms c1 c2
S=50;
r=15;
mu=5;
sigma=2;
L=3;
m=5;
mu_ccLm=(c1+c2+(2*L)-m)*mu
sigma_ccLm=((c1+c2+(2*L)-m)^0.5)*sigma
mm=normcdf(S-r,mu_ccLm,sigma_ccLm)

采纳的回答

Walter Roberson
Walter Roberson 2023-11-17
syms c1 c2
S=50;
r=15;
mu=5;
sigma=2;
L=3;
m=5;
mu_ccLm=(c1+c2+(2*L)-m)*mu
mu_ccLm = 
sigma_ccLm=((c1+c2+(2*L)-m)^0.5)*sigma
sigma_ccLm = 
mm=normcdf(S-r,mu_ccLm,sigma_ccLm)
Conversion to logical from sym is not possible.

Error in normcdf>localnormcdf (line 127)
if sigma > 0

Error in normcdf (line 50)
[varargout{1:max(1,nargout)}] = localnormcdf(uflag,x,varargin{:});
That is the error message I expect for this situation.
There is no special symbolic normcdf() call, so your parameters are being processed by the normal numeric normcdf() call. Several of the statistics-related functions test input parameters numerically in order, such as if they want to have logic similar to
if sigma > 0
do the normal calculation
else
output 0, or nan, or as appropriate
end
There is not much you can do about this, other than to copy the implementing code for normcdf and editing out the numeric tests.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by