float - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


solve/float

expressions involving floating-point numbers

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

solve(eqns, vars)

Parameters

eqns

-

equations (as for solve), but with floating-point values

vars

-

variables (as for solve)

Description

• 

The solve function with floating-point numbers works by converting the floating-point numbers to approximate rationals, calling solve with these converted arguments, and converting the results back to floating-point numbers using evalf.

• 

This can be convenient for solving equations with a combination of floating-point numbers and parameters (since fsolve will not solve equations with unassigned parameters).  In most cases, it is a better idea to convert the input into exact values manually since this will generally give more meaningful answers.

Examples

> 

eq≔x2−3⁢x+0.01:

> 

solve⁡eq,x

2.996662955,0.00333704529

(1)

This is equivalent to the following:

> 

eqe≔convert⁡eq,rational,exact

eqe≔x2−3⁢x+1100

(2)
> 

sol≔solve⁡eqe,x

sol≔32+2⁢145,32−2⁢145

(3)
> 

evalf⁡sol

2.996662955,0.003337045

(4)

The variable x is a parameter in the following example

> 

solve⁡3.7⁢y+z=sin⁡x,x2−y=z,y,z

y=−0.3703703704⁢x2+0.3703703704⁢sin⁡x,z=1.370370370⁢x2−0.3703703704⁢sin⁡x

(5)
> 

fsolve⁡3.7⁢y+z=sin⁡x,x2−y=z,y,z

Error, (in fsolve) x is in the equation, and is not solved for

See Also

evalf

fsolve

realroot