Why is MATLAB "solve" not finding a solution?

Hello,
I have a system of equations:
-id = 0
qd/(C*L) - (Vs - R*id)/L = 0
I'm trying to solve this system of equations for id and Vs using the MATLAB solve function. After defining all variables as syms, I'm using the below code
Equations = [-id ; qd/(C*L) - (Vs - R*id)/L]
Solution = solve(Equations==0,id,Vs)
However, this is producing a warning, "Explicit solution could not be found." Why isn't MATLAB able to find a solution here?
There is a solution (id = 0, Vs = qd/C) which can be easily solved by hand.
Thank you,
Kevin

4 Kommentare

Jie
Jie am 9 Dez. 2013
Not all equations have explicit solutions. Try numerical solution by fsolve or fzero. To be honest, I don't understand the way you write your equation much. I wish I could help..
Kevin Bachovchin
Kevin Bachovchin am 9 Dez. 2013
I'm aware that not all system of equations have explicit solutions, but it seems like this one does (and can be easily solved by hand).
What specifically don't you understand about my equations? My system of two equations and two unknowns is:
-id = 0
qd/(C*L) - (Vs - R*id)/L = 0
The other variables besides id and Vs are known parameters.
Kevin Bachovchin
Kevin Bachovchin am 9 Dez. 2013
Also I'm not looking for a numerical solution, I'm looking for a symbolic solution. I've used the "solve" command successfully before. I'm not sure why it is failing on this system.
Kevin Bachovchin
Kevin Bachovchin am 9 Dez. 2013
I've been trying to debug this problem and I found that
solve(-xd == 0, xd) yields xd = 0 like it is supposed to
while solve(-id == 0, id) yields no solution can be found. I don't understand what is causing the difference. Can someone please help me?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Dez. 2013

0 Stimmen

Potentially it is a clash with a MuPAD name. See http://www.mathworks.com/help/symbolic/mupad_ref/id.html

2 Kommentare

Kevin Bachovchin
Kevin Bachovchin am 9 Dez. 2013
Ok, thanks. Any idea how to get around this issue (other than using a new variable name)?
Walter Roberson
Walter Roberson am 9 Dez. 2013
Sorry, I do not have that toolbox to test with.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by