求解具有两个未知系数 a 和 b 的非线性方程组(标量或向量解?)

you*_*t13 5 matlab equation linear-algebra solver equation-solving

我有非线性方程组,我正在寻找问题的两个未知“ a”和“ b”(目前,我不知道“ a”和“ b”是否可能只是向量或矩阵解决方案,或者也许只有标量)。

困难在于我的方程是矩阵形式的(我的意思是我在理论上只有标量“ a”和“ b”来乘以矩阵)。

我想用 Matlab 来解决这个由两个非线性方程组(ab是未知数)组成的系统。

这是两个独立的方程:小心!: " FISH_sp", " FISH_xc", " eigenv_sp" 和 " eigenv_xc" 是已知矩阵。

eigen_speigen_xc并且FISH_eigen_sum也是标量已知的。

我已经对以下函数中实现的 2 个非线性方程组进行了编码(使用ab查找):

myfun=@(a,b) [
% First equation
a^2*eye(7) + a*b*FISH_sp*FISH_xc'+a*b*FISH_xc*FISH_sp'+b^2*eye(7);
% Second equation
a*FISH_sp*eigenv_sp + b*FISH_eigen_sp*eigenv_xc + a*FISH_xc*eigenv_sp +...
b*FISH_xc*eigenv_xc - (eigenv_sp + eigenv_xc)*FISH_eigenv_sum];

% Solution of system of non linear equations
a0 = 0.5;
b0 = 0.5;
x0 = [ a0 b0 ];
y = fsolve(@(x)myfun(x(1),x(2)), x0)
Run Code Online (Sandbox Code Playgroud)

但这给了我以下错误:

Error using vertcat
Dimensions of matrices being concatenated are not consistent.

Error in
compute_solving_Matricial_Equations>@(a,b)[a^2*eye(7)+a*b*FISH_sp*FISH_xc'+a*b*FISH_xc*FISH_sp'+b^2*eye(7);a*FISH_sp*eigenv_sp+b*FISH_eigen_sp*eigenv_xc+a*FISH_xc*eigenv_sp,+b*FISH_xc*eigenv_xc-(eigenv_sp+eigenv_xc)*FISH_eigenv_sum]

Error in compute_solving_Matricial_Equations>@(x)myfun(x(1),x(2))

Error in fsolve (line 230)
            fuser = feval(funfcn{3},x,varargin{:});

Error in compute_solving_Matricial_Equations (line 55)
y = fsolve(@(x)myfun(x(1),x(2)), x0)

Caused by:
    Failure in initial objective function evaluation. FSOLVE cannot continue.
Run Code Online (Sandbox Code Playgroud)

任何人都可以看到解决函数中描述的 2 个非线性函数的系统有什么问题myfun