0

I'm having trouble with a problem from school. I need to solve a set of nonlinear equations and I have been unable to produce results.

First I would like to say that I have read this: MATLAB: Why does solve return an empty sym object? and it appears to be a different error. Mine does not return any warning messages.

I am trying to solve for the chemical composition of a reaction which involves the solution of a system of equations. I have tried using the solve function but it has been unable to find a solution quickly enough. I stumbled across the vpasolve function this afternoon and am trying to get it to work.

Currently it runs in almost 30 seconds, but returns an empty matrix. I am inclined to believe that this result, combined with the solve function's failure to find a solution, are because of an error in my equations. However, I have not yet found one and I can not be sure if this is the case or not, perhaps I am using this function incorrectly. Any advice is appreciated. Here is a code snippets:

Sys = [HoverO,HoverN,Sum,formH2O,formOH,formNO,formO,formH];
S = vpasolve(Sys, [xlh2,xlo2,xln2,xlh2o,xloh,xlo,xlh,xlno]);

Sys is a collection of all the equations. S should be the solution, in which the "[xlh2,...]" are the variables of interest. Can someone tell me why this function might return an empty symbolic matrix without any warning messages or other output?

The equations themselves would be difficult to put here, but if there is a need I can supply them.

Community
  • 1
  • 1
Kyle Wright
  • 520
  • 2
  • 9
  • 23
  • One reason would be that no solution is found (at least within a given time) anther is that you have a bug. I don't see how we can say anything without runnable code that replicates the issue. And, what `version` of Matlab are you using? Is there a reason you're trying to solve this symbolically instead of numerically? – horchler Feb 23 '15 at 20:21
  • It would help if we knew the equations listed in `Sys`, so we could see the system and try to reproduce the empty output. – TroyHaskin Feb 23 '15 at 23:45

0 Answers0