Thread Subject: Faster symbolic computations

Subject: Faster symbolic computations

From: Thiago

Date: 3 Feb, 2009 05:57:01

Message: 1 of 4

Folks,

I have a couple of general questions. I'm performing symbolic computations in MATLAB, and I noticed I can avoid memory errors by manually executing blocks of code at a time.

1) Is there a way to orchestrate the execution of my code blocks so that I don't run into those memory errors, while keeping the operation in "auto mode"?

2) Do you have a few other tips to speed up symbolical computations? Maybe the I should do this: digits( n ) with n = 6 at most.

Thanks!

Subject: Faster symbolic computations

From: Alan Weiss

Date: 3 Feb, 2009 13:38:32

Message: 2 of 4

Hi, I am confused about what you are asking. If the value of "digits"
affects your results, then I suppose you are actually doing numerical
computations, not symbolic. In that case, I recommend you employ
matlabFunction to turn your symbolic expressions into function handles
or M-files that will evaluate quickly. For more information, see
http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/brt7nuv.html#brt7nyh

Alan Weiss
MATLAB mathematical toolbox documentation

Thiago wrote:
> Folks,
>
> I have a couple of general questions. I'm performing symbolic computations in MATLAB, and I noticed I can avoid memory errors by manually executing blocks of code at a time.
>
> 1) Is there a way to orchestrate the execution of my code blocks so that I don't run into those memory errors, while keeping the operation in "auto mode"?
>
> 2) Do you have a few other tips to speed up symbolical computations? Maybe the I should do this: digits( n ) with n = 6 at most.
>
> Thanks!

Subject: Faster symbolic computations

From: Thiago

Date: 3 Feb, 2009 16:43:02

Message: 3 of 4

Hi Alan,

Thanks for your response. We'll I'm actually using a mix of numerical inputs with symbolic values. When those meet in my code, the output is symbolic. That's exactly what I wish, namely, a symbolic function having a few variables I specify. It would be easier if I knew the ultimate expression beforehand, because I would be able to simply numerically evaluate it. Because of the complexity and generality in my routine, that's not the case. An alternative would be to have absolutely everything as symbolic, and then evaluate only the variables I want in the very end. That sounds like a better idea; I'm going to try it.

I did take a look at the link you suggested, but it seems that matlabFunction is only useful for the case of numerical evaluation of all variables. In my case, I want to keep a select few as symbolic.

The reason why I suggested changing the value of digits is that I imagined my code would be processed faster if the huge fractional expressions, which crop up in symbolic mode, can be replaced by an approximate "symbolic floating-point" representation having less significant digits. That's all.

Regards,

Thiago

Subject: Faster symbolic computations

From: Thiago

Date: 3 Feb, 2009 16:53:01

Message: 4 of 4

By the way, I'm sorry for the typo. I meant to say Well, not We'll. You'll probably understand it anyway.

-Thiago

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com