"vpasolve" problem?

1 次查看(过去 30 天)
onsagerian
onsagerian 2018-9-4

Hello,

The following code designed to collect particular solutions by solving an equation does not work. I've included the error message I had. Would you help me to address the problem?

format long e
theta=0.01; 
n=1:1:20;
m=1:1:10;
x=zeros(length(n),length(m));
gamma_REA=zeros(1,length(m));
equation1=zeros(length(n),length(m));
equation2=zeros(length(n),length(m));
equation=zeros(length(n),length(m));
gamma_REA(1)=10.0;
for i=1:1:length(n)
    for j=1:1:length(m)       
    equation1(i,j)=1+[x(i,j)/(1+x(i,j))]^n(i).*(gamma_REA(j)-1);
    equation2(i,j)=1+[x(i,j)/(theta+x(i,j))]^n(i).*(gamma_REA(j)-1);
    equation(i,j)=theta*equation1(i,j)./equation2(i,j)-[(theta+x(i,j))/(1+x(i,j))].^(n(i)+1)==0;
    sol=vpasolve(equation,x(i,j));
    fprintf('%d %.10e %.10e\n',i,gamma_REA(j), min(sol(sol>0.0)));   
    gamma_REA(j+1)=gamma_REA(j)*10.0;
    end   
    gamma_REA(1)=10.0;
end

The error message is as follows:

Undefined function 'vpasolve' for input arguments of type 'double'.

Error in Untitled (line 16) sol=vpasolve(equation,x(i,j));

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statics and Dynamics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by