24小时热门版块排行榜    

查看: 254  |  回复: 2
当前主题已经存档。
【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 dxyhn1979 的 2 个金币
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

dxyhn1979

银虫 (小有名气)

[交流] 【求助】非线性方程的求多根的数值方法?

请问各位大虾:
牛顿法,牛顿弦截法能求非线性方程的多根么?求非线性方程的多根应用什么数值方法?
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dxyhn1979

银虫 (小有名气)

看不懂啊。能解释一下么?
3楼2010-03-17 14:31:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 3 个回答

hitzhang

木虫 (正式写手)


dxyhn1979(金币+4):先谢了哥们,先给几个币币,我试试 2010-03-17 14:01
adu886886(金币+1):谢谢提供意见 2010-03-17 14:27
引用回帖:
Originally posted by dxyhn1979 at 2010-03-17 10:39:14:
请问各位大虾:
牛顿法,牛顿弦截法能求非线性方程的多根么?求非线性方程的多根应用什么数值方法?

给你个函数
function P = InterX(L1,varargin)
%INTERX Intersection of curves
%   P = INTERX(L1,L2) returns the intersection points of two curves L1
%   and L2. The curves L1,L2 can be either closed or open and are described
%   by two-row-matrices, where each row contains its x- and y- coordinates.
%   The intersection of groups of curves (e.g. contour lines, multiply
%   connected regions etc) can also be computed by separating them with a
%   column of NaNs as for example
%
%         L  = [x11 x12 x13 ... NaN x21 x22 x23 ...;
%               y11 y12 y13 ... NaN y21 y22 y23 ...]
%
%   P has the same structure as L1 and L2, and its rows correspond to the
%   x- and y- coordinates of the intersection points of L1 and L2. If no
%   intersections are found, the returned P is empty.
%
%   P = INTERX(L1) returns the self-intersection points of L1. To keep
%   the code simple, the points at which the curve is tangent to itself are
%   not included. P = INTERX(L1,L1) returns all the points of the curve
%   together with any self-intersection points.
%   
%   Example:
%       t = linspace(0,2*pi);
%       r1 = sin(4*t)+2;  x1 = r1.*cos(t); y1 = r1.*sin(t);
%       r2 = sin(8*t)+2;  x2 = r2.*cos(t); y2 = r2.*sin(t);
%       P = InterX([x1;y1],[x2;y2]);
%       plot(x1,y1,x2,y2,P(1,,P(2,,'ro')

%   Author : NS
%   Version: 2.0, 26/11/09

%   Two words about the algorithm: Most of the code is self-explanatory.
%   The only trick lies in the calculation of C1 and C2. To be brief, this
%   is essentially the two-dimensional analog of the condition that needs
%   to be satisfied by a function F(x) that has a zero in the interval
%   [a,b], namely
%           F(a)*F(b) <= 0
%   C1 and C2 exactly do this for each segment of curves 1 and 2
%   respectively. If this condition is satisfied simultaneously for two
%   segments then we know that they will cross at some point.
%   Each factor of the 'C' arrays is essentially a matrix containing
%   the numerators of the signed distances between points of one curve
%   and line segments of the other.

    %...Argument checks and assignment of L2
    error(nargchk(1,2,nargin));
    if nargin == 1,
        L2 = L1;    hF = @lt;   %...Avoid the inclusion of common points
    else
        L2 = varargin{1}; hF = @le;
    end
      
    %...Preliminary stuff
    x1  = L1(1,';  x2 = L2(1,;
    y1  = L1(2,';  y2 = L2(2,;
    dx1 = diff(x1); dy1 = diff(y1);
    dx2 = diff(x2); dy2 = diff(y2);
   
    %...Determine 'signed distances'
    S1 = dx1.*y1(1:end-1) - dy1.*x1(1:end-1);
    S2 = dx2.*y2(1:end-1) - dy2.*x2(1:end-1);
            
    C1 = feval(hF,D(bsxfun(@times,dx1,y2)-bsxfun(@times,dy1,x2),S1),0);
    C2 = feval(hF,D((bsxfun(@times,y1,dx2)-bsxfun(@times,x1,dy2))',S2'),0)';
     
    %...Obtain the points where an intersection is expected
    [i,j] = find(C1 & C2);
    dx2=dx2'; dy2=dy2';  
    L = dy2(j).*dx1(i) - dy1(i).*dx2(j);
    i = i(L~=0); j=j(L~=0); L=L(L~=0);  %...Avoid divisions by 0
        
    %...Solve system of eqs to get the common points
    P = unique([dx2(j).*S1(i) - dx1(i).*S2(j)', ...
                dy2(j).*S1(i) - dy1(i).*S2(j)']./[L L],'rows')';
              
    function u = D(x,y)
        u = bsxfun(@minus,x(:,1:end-1),y).*bsxfun(@minus,x(:,2:end),y);
    end
end
2楼2010-03-17 11:41:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[硕博家园] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 G6APbkg8SA6w 2026-08-29 3/150 2026-08-30 02:18 by ZPa0EcMwuECS
[考博] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 gy1nBQXYQJqL 2026-08-29 4/200 2026-08-30 01:58 by ZPa0EcMwuECS
[找工作] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +4 gy1nBQXYQJqL 2026-08-29 6/300 2026-08-30 01:47 by ZPa0EcMwuECS
[论文投稿] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +4 gy1nBQXYQJqL 2026-08-29 6/300 2026-08-30 01:25 by ZPa0EcMwuECS
[论文投稿] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +4 ASdOkHsho7FD 2026-08-28 5/250 2026-08-30 01:03 by ZPa0EcMwuECS
[考研] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +5 ASdOkHsho7FD 2026-08-28 7/350 2026-08-30 01:03 by ZPa0EcMwuECS
[考研] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +7 ASdOkHsho7FD 2026-08-28 10/500 2026-08-30 00:41 by ZPa0EcMwuECS
[硕博家园] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +6 ASdOkHsho7FD 2026-08-28 12/600 2026-08-30 00:31 by ZPa0EcMwuECS
[基金申请] 中青基了要发朋友圈吗? +4 349506619 2026-08-28 4/200 2026-08-29 22:41 by alongwaytogo
[考研] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 G6APbkg8SA6w 2026-08-29 4/200 2026-08-29 22:27 by ZPa0EcMwuECS
[基金申请] 有没有仍没收到信息的 +5 德尚中行 2026-08-27 6/300 2026-08-29 18:10 by manplx
[教师之家] 导师吐槽:我怎么摊上了这么个极品研究生! +9 苏东坡二世 2026-08-23 9/450 2026-08-29 14:41 by hustersqt
[基金申请] 基金不中,共勉 +11 eulota 2026-08-26 11/550 2026-08-28 14:22 by 火星超人xi
[基金申请] 基金未中,这种答复是模板吗? +5 zhaosm1982 2026-08-27 6/300 2026-08-27 16:00 by lfy8008
[文学芳草园] 梦想 +3 myrtle 2026-08-26 3/150 2026-08-27 10:01 by angelyueyi
[基金申请] 为什么 国际(地区)合作与交流项目 没有放榜? 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by 北京莱茵编辑
[基金申请] 能否退出参与的面上项目解除限项 +23 koalala 2026-08-24 26/1300 2026-08-26 14:29 by 宝贝虫子
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 系统进不去 +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[基金申请] 没有任何消息-是不是就凉了 +9 图啦图啦 2026-08-24 10/500 2026-08-25 11:59 by 南海小哥
信息提示
请填处理意见