Azzera filtri
Azzera filtri

help with solver

2 visualizzazioni (ultimi 30 giorni)
Doug Hates Squirrels
Doug Hates Squirrels il 7 Giu 2011
I'm trying to solve an equation in Matlab and for some reason I can't get Matlab to solve it. The problem is a little on the nasty side, and trying to solve it by hand has thrown me a little bit. The code is below. Any help is appreciated!
solve('x^0.295*[0.465*(-2.269*(x^0.381)-x)^0.195 + 0.222]^(-5.128) * [-2.269*(x^0.381) - x]^(-0.805) - 328.957')

Risposte (1)

Walter Roberson
Walter Roberson il 7 Giu 2011
solve() does not know square brackets as being grouping brackets: square brackets are subscript indexing inside a quoted string.
Negative numbers to a floating point power have ambiguous meaning, and will be transformed in to complex logs, probably leading to a complex result even when there might be a real root. If you are trying to solve() an equation symbolically you are best off using rational coefficients and perhaps even explicit formulation to ensure you get real results.
  2 Commenti
Doug Hates Squirrels
Doug Hates Squirrels il 7 Giu 2011
So a solution would be to write the problem as below?
solve('k^0.295*(1/(0.465*(-2.269*(k^0.381)-k)^0.195 + 0.222)^(5.128)) * (1/(-2.269*(k^0.381) - k)^(0.805)) - 328.957')
Walter Roberson
Walter Roberson il 7 Giu 2011
The term in the denominator, -2.269*(x^0.381)-x, is negative for all positive x, so one gets in to a tricky complex multiplication hoping that the two parts are complex conjugates. That turns out not to happen: the denominator is complex for all non-negative x.
Using the complex log interpretation of a negative number to a floating power, the only point at which the denominator becomes real is at approximately x = -1.1004865, at which point the overall value of the expression becomes approximately -331.21000 which is not even close to 0.
As x approaches negative infinity, the complex part of the expression reaches a limit of 0 from above, and the overall value of the expression reaches -328.957.
Thus, the expression has no roots, not unless one assigns a different meaning to a negative number raised to a non-integral power.

Accedi per commentare.

Categorie

Scopri di più su Numerical Integration and Differential Equations in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by