From: Walter Roberson on
Chris Sorrento wrote:
> when I run
> the commands that you suggested I get the following:
> EDU>> which -all maple
> C:\Program Files (x86)\MATLAB\R2007a Student\toolbox\symbolic\maple.m
> C:\Program Files (x86)\MATLAB\R2007a
> Student\toolbox\symbolic\@sym\maple.m % sym method

Those look valid.

> EDU>> which -all indets
> 'indets' not found.

I'm not so surprised, as indets is a maple command that would not
necessarily have matlab source.


> And lines 127-130 in maple.m are:
>
> % Handle any error messages from Maple.
> if status ~= 0 && nargout < 2
> error('symbolic:maple:errmsg2',result)
> end

Hmmm, I don't see any semi-colon in there at all, let alone at offset 10
on the error line.

I suggest you give the command

dbstop on error

and re-run, and when it kicks you into the debug prompt, look at the
line it thinks it is on and print out the values of variables.

Oh, and just in case,

which -all error

in case it happens to be a bad error() function lying around.
From: Chris Sorrento on
So, when I do which -all error, I get the following:
EDU>> which -all error
built-in (C:\Program Files (x86)\MATLAB\R2007a Student\toolbox\matlab\lang\error)
C:\Program Files (x86)\MATLAB\R2007a Student\toolbox\shared\dastudio\@DAStudio\error.m % DAStudio method
EDU>>

when I run the program in debug mode, then it again takes me to line 129. You are right that lack of ; is kind of strange but during the debug mode, I added a ; to that line, then I got the following (of course I did not save any changes to the maple.m):
??? Error using ==> maple at 129
at offset 10, `;` unexpected

??? The 'maple' function is restricted in the Student Version.

Error in ==> maple at 113
[result,status] = maplemex(statement);

K>>

Then I just got out of the debug mode. Any suggestions?
Chris


Walter Roberson <roberson(a)hushmail.com> wrote in message <nVGLn.28498$rU6.27162(a)newsfe10.iad>...
> Chris Sorrento wrote:
> > when I run
> > the commands that you suggested I get the following:
> > EDU>> which -all maple
> > C:\Program Files (x86)\MATLAB\R2007a Student\toolbox\symbolic\maple.m
> > C:\Program Files (x86)\MATLAB\R2007a
> > Student\toolbox\symbolic\@sym\maple.m % sym method
>
> Those look valid.
>
> > EDU>> which -all indets
> > 'indets' not found.
>
> I'm not so surprised, as indets is a maple command that would not
> necessarily have matlab source.
>
>
> > And lines 127-130 in maple.m are:
> >
> > % Handle any error messages from Maple.
> > if status ~= 0 && nargout < 2
> > error('symbolic:maple:errmsg2',result)
> > end
>
> Hmmm, I don't see any semi-colon in there at all, let alone at offset 10
> on the error line.
>
> I suggest you give the command
>
> dbstop on error
>
> and re-run, and when it kicks you into the debug prompt, look at the
> line it thinks it is on and print out the values of variables.
>
> Oh, and just in case,
>
> which -all error
>
> in case it happens to be a bad error() function lying around.
From: Steven Lord on

"Chris Sorrento" <remove.this.string.agairan(a)hotmail.com> wrote in message
news:htn8cg$rrf$1(a)fred.mathworks.com...
> Hello,
> I wrote the following code to estimate cell (x) and substrate (s)
> concentrations: Ks = 0.05; % (g/L) Saturation Constant
> Yxs = 1; % (g/g) Yield Coefficient
> MuMax = 2.3; % (hr-1) Max Specific Growth Rate
> So = 1; % Initial Substrate Concentration
> c = 2; % Cell Concentration Factor
> alpha = 0.6; % Recycle Ratio based on volumetric flow rates
> d = 0:0.1:6; D = d'; % (hr-1) Rate of Dilution
> A = 1 + alpha - (alpha .* c);
> Mu = D .* A; % Specific Growth Rate
> %
> % Equations:
> syms s x
> [s,x] = solve(s - ((Mu .* Ks) ./ (MuMax - Mu)), ...
> x - ((Yxs .* (So-s)) ./ A)); % Substrate Conc and Cell Mass Conc
>
> However, when I run this code, it gives me the following error:
> ??? Error using ==> maple at 129
> at offset 10, `;` unexpected
>
> Error in ==> sym.findsym at 33
> v = maple('indets', sc ,'symbol');
>
> Error in ==> solve at 99
> vars = ['[' findsym(sym(eqns),neqns) ']'];
>
> Error in ==> sym.solve at 49
> [varargout{1:max(1,nargout)}] = solve(S{:});
>
> Error in ==> AGACellRecycle at 13
> [s,x] = solve(s - ((Mu .* Ks) ./ (MuMax - Mu)), ...
>
> Could you please help? I have checked all the syntax many times and tried
> different variations of using the "solve" command. But still get the same
> error.

Can you set a breakpoint on line 33 of the findsym method for sym objects,
run the code, and show what sc contains? If sc is very long, then showing
just the first 20 or 30 characters (with sc(1:30)) will probably be
sufficient.

dbstop in sym/findsym at 33
% run your code

My _guess_ is that the fact that Mu is a matrix (and therefore your first
"equation" is in fact not 1 equation but 61 equations) is not something that
SOLVE expected. In fact, looking at that first equation, I see that each
entry is of the form s-constant for what looks to be 61 distinct constants,
and so this system of 62 equations in 2 unknowns has no solution.

If you can remedy that situation, I recommend two changes to your SOLVE
call. The first is to return only one output, which will be a struct array
whose fields are the variables for which SOLVE solved. That avoids the
problem where you may specify that SOLVE should return variables in a
certain order but it returns them in a different order. From the reference
page:

http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/solve.html

"For a system of equations and an equal number of outputs, the results are
sorted alphabetically and assigned to the outputs."

You may also want to explicitly specify in your SOLVE call the names of the
variables for which you want to solve.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Walter Roberson on
Chris Sorrento wrote:

> ??? The 'maple' function is restricted in the Student Version.

As you are using 2007a, please check the following bug report

http://www.mathworks.com/support/solutions/en/data/1-6NNCGP/?solution=1-6NNCGP
From: Chris Sorrento on
Thanks again Walter. I just read through the bug report and the MapleSoft website. You have pinpointed the correct issue. I'll try it out when I get home today and will keep you posted.

Many thanks,
Chris


Walter Roberson <roberson(a)hushmail.com> wrote in message <V0RLn.42326$wV.31251(a)newsfe11.iad>...
> Chris Sorrento wrote:
>
> > ??? The 'maple' function is restricted in the Student Version.
>
> As you are using 2007a, please check the following bug report
>
> http://www.mathworks.com/support/solutions/en/data/1-6NNCGP/?solution=1-6NNCGP