Why does solve(1 == 1, t) return 0 as an answer?
Afficher commentaires plus anciens
I understand that the solution of the equation 1=1 in terms of t is all t. Now, when I ask MATLAB to solve(1 == 1, t) it returns 0. This problem arose from a vector valued function who's derivative imposed to equal 1 had more than one solution and MATLAB wasn't giving them.
3 commentaires
Walter Roberson
le 28 Fév 2022
In terms of t, you would have

But 1 = 1 is true in any logic system in which = represents equality and the symbol 1 exists, so
is always false, and the set of t such that false is true is empty. So the second part is the empty set, and so the solution is the set of all t . There is no t such that 1=1 is false so all t are included in the solution.
is always false, and the set of t such that false is true is empty. So the second part is the empty set, and so the solution is the set of all t . There is no t such that 1=1 is false so all t are included in the solution.
Walter Roberson
le 28 Fév 2022
Tips
If the solution contains parameters and ReturnConditions is true, solve returns the parameters in the solution and the conditions under which the solutions are true. If ReturnConditions is false, the solve function either chooses values of the parameters and returns the corresponding results, or returns parameterized solutions without choosing particular values. In the latter case, solve also issues a warning indicating the values of parameters in the returned solutions
So, solve() sometimes chooses values for the parameters, so choosing 0 in this case is not contrary to the documentation.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Solver Outputs and Iterative Display 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!

