legsn.m

来自「计算方法 大学 求根 牛顿求根公式D:matlab mm ootfind.rar」· M 代码 · 共 17 行

M
17
字号
function [f,dfdt] = legsn(theta)
% legsn  Evaluate f(theta) and fprime(theta) for the picnic leg problem.
%        Used with the Newton's method.
%
% Synopsis:  [f,dfdt] = legsn(theta)
%
% Input:     theta = angle of table leg in radians
%            WLENGTH HLENGTH and BLENGTH are global variables giving
%                    table dimensions
%
% Output:    f    = value of function that, when theta is a root, is equal to zero
%            dfdt = fprime(theta), ie. df/dtheta
global  WLENGTH  HLENGTH  BLENGTH

f    = WLENGTH*sin(theta) - HLENGTH*cos(theta) - BLENGTH;
dfdt = WLENGTH*cos(theta) + HLENGTH*sin(theta);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?