Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
MapleEvalhf - evaluate an object using hardware floats in external code
EvalhfMapleProc - evaluate a procedure using hardware floats in external code
Calling Sequence
MapleEvalhf(kv, s)
EvalhfMapleProc(kv, fn, n, args)
Parameters
kv
-
kernel handle returned by StartMaple
s
Maple object object
fn
Maple FUNCTION object
n
number of arguments
args
array of n hardware floats
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
The MapleEvalhf function evaluates an expression to a numerical value using the hardware floating-point of the underlying system. This command is equivalent to the Maple function, evalhf.
The EvalhfMapleProc function evaluates the function, f(args), to a numerical value using evalhf. The n arguments provided are all 64-bit hardware floating-point numbers. The first argument must be inserted at args[1]. For example, to call f(3.14,2.718), set args[1] = 3.14, and args[2] = 2.718. The value at args[0] is not used.
Examples
Function MyNewton(ByVal kv As Long) As Double
Dim i As Long
Dim guess(2) As Double
Dim tolerance As Double
Dim f, fprime, x, initguess As Long
' define a function in x to solve, and find it's derivative
f = EvalMapleStatement(kv, "(x) -> x^3+2*x^2-9*x+2;")
MapleAssign kv, ToMapleName(kv, "f", True), f
fprime = EvalMapleStatement(kv, "unapply(diff(f(x),x),x);")
x = ToMapleName(kv, "x", True)
guess(1) = 1.1
tolerance = 0.0001
' find a root (abort after 500 iterations)
For i = 0 To 500
'test current guess
If Abs(EvalhfMapleProc(kv, f, 1, guess(0))) <= tolerance Then
i = 501 'break
Else
'refine guess
guess(1) = guess(1) - EvalhfMapleProc(kv, f, 1, guess(0)) / _
EvalhfMapleProc(kv, fprime, 1, guess(0))
End If
Next i
If i = 500 Then
MyNewton = -999999 'couldn't find root
MyNewton = guess(1)
End Function
See Also
evalhf, OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples
Download Help Document