@shellex说: 对对,他们上辈子都是折翼的新奥尔良鸡翅

Pages

Topics

随便看看

路边社评论员

  • Keith:
    还能用不. »
  • deepblue:
    测试一下浏览器和系统 »
  • abettor:
    “就和CPU特权级别一样”——这的哥难道是Linus的表弟?! »
  • 董英男:
    为什么总提示确认是相册首页呢 到底哪个才是相册首页啊 »
  • kendisk:
    作为一个轻度Linuxer,刚分手后,感觉木有鸭梨。 »
  • MS IE:
    THIS SITE REALLY SUCK! »
  • Alex:
    gnome-women... »
  • liangsuilong:
    GNOME 自己也有鼓励女性参与项目的计划啊.. »
  • infinte:
    对不起,你的“解ban”版本算得有点问题,可以下(9)pp4 测试。ACID3可有95分啊……另外同... »
  • Alex:
    »
  • Randee Saadat:
    Glad you solved your problem, but what is your que... »
  • LinuxRock:
    没想到你也有一台和我一样的破机子......还好现在高三没怎么用,受不了它的发热量.. »

Octave笔记 之 数值积分与解方程

Octave是GNU的一个项目,作为最好的Matlab免费替代品之一(另一个是Scilab),我们可以用它做很多事情…

函数积分:
Octave supports three different algorithms for computing the integral of a function f over the interval from a to b. These are

quad
Numerical integration based on Gaussian quadrature.
quadl
Numerical integration using an adaptive Lobatto rule.
trapz
Numerical integration using the trapezodial method.

Sample:
对函数
f(x) = x * sin (1/x) * sqrt (abs (1 – x))

function y = f (x)
y = x .* sin (1 ./ x) .* sqrt (abs (1 – x));
endfunction
[v, ier, nfun, err] = quad (“f”, 0, 3)
=> 1.9819
=> 1
=> 5061
=> 1.1522e-07
使用fplot(“f”, [0, 3])可以看到图形

解非线性方程:
-2x^2 + 3xy   + 4 sin(y) = 6
3x^2 – 2xy^2 + 3 cos(x) = -4

function y = f (x)
y(1) = -2*x(1)^2 + 3*x(1)*x(2)   + 4*sin(x(2)) – 6;
y(2) =  3*x(1)^2 – 2*x(1)*x(2)^2 + 3*cos(x(1)) + 4;
endfunction

[x, info] = fsolve (“f”, [1; 2])
x =

0.57983
2.54621

info = 1

  1. On May 9, 2008 at 1:24 pm
    shellex: Mozilla Firefox 2.0.0.14 / Linux

    这比赛,真黑啊

Leave a Reply