Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Symbolic Math Integration

Subject: Symbolic Math Integration

From: David Egolf

Date: 28 Nov, 2010 23:09:03

Message: 1 of 2

I'm having a problem with the "igrand" statement in Matlab's Symbolic Math toolbox. For example, please refer to the following two programs that I copied and pasted from my "m" files. The only difference between these two programs is that, in the
integrand, the coefficients R1=c1, R2=c2/2, and R3=c3/3. I ran both programs, then made the substitutions indicated in the previous sentence by hand. But the two solutions are different by 1/2*log(6) = 0.896. Am I doing something wrong or is the Symbolic Math "igrand" statement screwed up? I hope somebody can set me straight. My direct e-mail address is <degolf@uidaho.edu>.
Thanks,
David Egolf

%
% LK_Integration_Using R_Coefficients_Nov_2_2010
clear all
syms F R1 R2 R3
igrand = 1./((R1).*(1-(F))+(R2).*(1-(F.^2))+(R3).*(1-(F.^3)))
y = int(igrand,F)
ys = simple(y)
%

%
% LK_Integration_Using_C_Coefficients_Nov_9_2010
clear all
syms F c1 c2 c3
igrand = 1./(c1+(c2./2)+(c3./3)-((c1).*(F))-((c2./2).*(F.^2))-((c3./3)...
    .*(F.^3)))
y = int(igrand,F)
ys = simple(y)
%

Subject: Symbolic Math Integration

From: Roger Stafford

Date: 29 Nov, 2010 00:11:03

Message: 2 of 2

"David Egolf" <degolf@uidaho.edu> wrote in message <icunef$svu$1@fred.mathworks.com>...
> I'm having a problem with the "igrand" statement in Matlab's Symbolic Math toolbox. For example, please refer to the following two programs that I copied and pasted from my "m" files. The only difference between these two programs is that, in the
> integrand, the coefficients R1=c1, R2=c2/2, and R3=c3/3. I ran both programs, then made the substitutions indicated in the previous sentence by hand. But the two solutions are different by 1/2*log(6) = 0.896. Am I doing something wrong or is the Symbolic Math "igrand" statement screwed up? I hope somebody can set me straight. My direct e-mail address is <degolf@uidaho.edu>.
> Thanks,
> David Egolf
>
> %
> % LK_Integration_Using R_Coefficients_Nov_2_2010
> clear all
> syms F R1 R2 R3
> igrand = 1./((R1).*(1-(F))+(R2).*(1-(F.^2))+(R3).*(1-(F.^3)))
> y = int(igrand,F)
> ys = simple(y)
> %
>
> %
> % LK_Integration_Using_C_Coefficients_Nov_9_2010
> clear all
> syms F c1 c2 c3
> igrand = 1./(c1+(c2./2)+(c3./3)-((c1).*(F))-((c2./2).*(F.^2))-((c3./3)...
> .*(F.^3)))
> y = int(igrand,F)
> ys = simple(y)
> %
- - - - - - -
  See my reply in your duplicate post.
Roger Stafford

Tags for this Thread

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.

Contact us