请教:解非线性方程组(fsolve)。

8 Ansichten (letzte 30 Tage)
mixig
mixig am 23 Nov. 2022
Beantwortet: tidot am 23 Nov. 2022
%% 控制算法确定控制参数tao
clear all
clc
alpha0=0;
rou0=20/180*pi;
syms thetax tao;
options=optimset('TolFun',1e-8);
F=@(thetaA,thetaB)[sin(rou)*cos(tao)+0.5*sin(thetaA)*(1-cos(thetaB))-(sqrt(2)/2)*cos(thetaA)*sin(thetaB);
cos(alpha0)*sin(rou)*sin(tao)+sin(alpha0)*cos(rou)-0.5*cos(thetaA)*(1-cos(thetaB))-(sqrt(2)/2)*sin(thetaA)*sin(thetaB)];
for tao0=0:4*pi/360:pi
theta0=[0;0];
[theta,fval]=fsolve(@myfun,theta0,options);
end
%%%请教各位大侠,我想用fsolve解一个非线性方程组(或者各位有更好的函数解法),其中thetaA和thetaB为要求的量。其他如alpha0,rou为已知量。tao为一个循环的变量。这样求不出来,请问各位有没有知道怎么用的。

Akzeptierte Antwort

tidot
tidot am 23 Nov. 2022
可以求解
首先你的函数需要用m文件定义
其次fsolve传递参数的时候,常量放在fsolve末尾
基于此,我重写了一下你的问题求解程序,见附件
[attach]128480[/attach][attach]128481[/attach]

Weitere Antworten (0)

Kategorien

Mehr zu 数学 finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!