How to use equation solver with conditions
Afficher commentaires plus anciens
syms x a r
x = isolate(-((2*(90 - x)^r - (2*x + 90)^r)*(a + 4)*(r - 1)==0,a)
Is it possible to ask matlab to solve the above equation setting as a condition that "a" is a positive number?
Ideally, I want matlab to return an equation rather than -4 as the solution.
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 16 Jan 2019
No. Your equation has three terms multiplied together
-2*(90 - x)^r + (2*x + 90)^r
a + 4
r - 1
in order for the result to equal zero, one of the terms must equal 0. The only term that involves a is a+4 . In order for that to equal 0, a must be -4.
There are two solutions in r: r = 1 or r = -ln(2)/(ln(90 - x) - ln(2*x + 90)) neither of which involve a and so under the positivity constraint would be valid for all positive a other than x = 0 (as 0 gives a division by 0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!