微剋多資訊

 找回密碼
 註冊

Sign in with google

Google帳號登入

搜索

該用戶從未簽到

升級   0%

跳轉到指定樓層
主題
發表於 2012-11-1 20:54 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
本帖最後由 rictirse 於 2014-12-24 08:25 編輯
  1. Dim $h
  2. Dim $x
  3. Dim $derivatives ; 微分結果

  4. $x = 2.0
  5. $h = 1E-1
  6.         ;
  7.         ;求 func'(x) , x = 2.0 之值, 正解 = 6x = 12.0
  8.         ;

  9. While True
  10.         If $h < 1E-10 Then ExitLoop
  11.         $h *= 0.1

  12.         ;
  13.         ;微分定義 :
  14.         ;
  15.         ; f ' (x) = lim    f(x+h) - f(x)

  16.         ;---------------------
  17.         ; h->0         h

  18.         $derivatives = ( _dc($x+$h) - _dc($x)) / $h
  19.         ConsoleWrite ( StringFormat (" h = %e , f'(2.0) = %lf\n", $h, $derivatives))
  20. WEnd

  21. Func _dc($x)
  22.         $x = 3.0*$x*$x ; 3x^2
  23.         Return $x
  24. EndFunc
複製代碼

本帖子中包含更多資源

您需要 登入 才可以下載或查看,沒有帳號?註冊

x
樓主熱門主題
您需要登入後才可以回帖 登入 | 註冊

本版積分規則

小黑屋|Archiver|微剋多資訊(MicroDuo)

GMT+8, 2024-4-20 03:39

Discuz! X

© 2009-2023 Microduo

快速回覆 返回頂部 返回列表