作者zupo (外派越南工作者)
标题Re: [问题] 数值方法求解
时间Fri Jul 24 21:43:38 2015
※ 引述《qrewasd (shu)》之铭言:
: beta=-2 % 2,0,-2
: a=(omega-(beta^2))^0.5
: b=(omega+(beta^2))^0.5
: a*b*(1-cosh(b)*cos(a))+(beta^2)*sinh(b)*sin(a)=0
: 求解 a b omega
: 我自己试过
: 结果如下
: Warning: Explicit solution could not be found.
: > In solve at 81
: ans =
: [ empty sym ]
: 请问该如何改写呢?
: 3Q
本题涉及非线性跟根号问题
我是用fsolve 解的
带入的值影响解是有范围的
------------------------------------------
function pttex144(t)
global beta
format long e
beta = t;
% beta=-2 % -2, 0, 2
omega = fsolve(@yourfun,1)
a=(omega-(beta.^2)).^0.5
b=(omega+(beta.^2)).^0.5
function f = yourfun(x)
global beta
a=(x-(beta.^2)).^0.5; % d1
b=(x+(beta.^2)).^0.5; % d2
f = a.*b.*(1-cosh(b).*cos(a))+(beta.^2).*sinh(b).*sin(a);
------------------------------------------------------------
执行结果:
>> pttex144(-2)
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
omega =
3.724123341394964e-03 + 1.772674751964346e-13i
a =
4.451065079099797e-14 + 1.999068752359109e+00i
b =
2.000930814231565e+00 + 4.429625300775632e-14i
--
1.MATLAB programming 2.ASPEN process simulation package
3.FORTRN programming 4.Advance Engineering Mathematics
5.Process Control Theory
6.Chemical Engineering Basic Theory(Kinetic.thermodynamics.transport)
7.Numerical Method and Analysis
8.MATLAB Toolbox.Simulink system basic design
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 118.233.114.68
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1437745423.A.756.html