Solve the system of nonlinear equations (with symbolic variables) with the command fsolve

1 次查看(过去 30 天)
C1 The output of the following program is a set of nonlinear equations. How to solve it with the fsolve command. For different N and M.
clc
close all
clear all
syms t f alpha
f1=2*t-t^4+(2/gamma(7/3))*t^(4/3);
alpha=1/3;
N=2;
M=2;
l=N*M;
for n=1:N
for m=0:M-1
kesy((n-1)M+m+1,1)=nchoosek(M-1,m)(N*t-n+1)^(m)*(n-N*t)^(M-1-m);
end
end
kesy;
for n=0: N-1
for m=0:M-1
for i=0:M-1
A(n*M+m+1,n*M+i+1)=N*M*int(kesy(n*M+m+1,1),(n*M+i)/(N*M),(n*M+i+1)/(N*M));
end
end
end
A;
B=inv(A);
if l==1 P=(1/l)^alpha*(1/gamma(alpha+2));
else
for k=1:l-1
f(k)=(k+1)^(alpha+1)-2*k^(alpha+1)+(k-1)^(alpha+1);
end
f;
for i=1:l
for j=1:l
if i==j F(i,j)=1;
elseif i>j F(i,j)=0;
elseif i<j F(i,j)=f(j-i);
end
end
end
P1=(1/l)^alpha*(1/gamma(alpha+2))*F;
end
F=P1;
P=A*F*B;
for n=1:l
coeff(n)=l*int(f1,(n-1)/l,n/l);
end
w=coeff;
fT=w*A;
C=sym('c%d',[1,l]);
FA=C*P*A;
C1=C*A+C*P*A-FA.^2-fT;
C1=transpose(C1)

回答(1 个)

Steven Lord
Steven Lord 2022-6-16
fsolve is intended to solve a system of equations numerically. Since your system of equations involves symbolic variables you will need to use solve or vpasolve from Symbolic Math Toolbox to solve them.
  1 个评论
iraj mohammadpour
iraj mohammadpour 2022-6-16
Hello
thanks for your response.
I want to solve the output of the above program C1, which is a system of nonlinear equations, with the fsolve command. For different N and M.

请先登录,再进行评论。

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by