Error using Integral - IntegralCalc - Syms

7 ビュー (過去 30 日間)
Muthu Ram Prabhu Elenchezhian
Muthu Ram Prabhu Elenchezhian 2017 年 4 月 27 日
Hi, This is my Code
clc
clear all
syms Th
th1=5*pi/12 ;
th2=7*pi/12;
A11= @(Th) (10279222485063723*cos(Th).^2)/2684354560000 + (9*((7138348947960919*cos(Th).^2)/8589934592 + 1142135831673747/4294967296))/(625*cos(Th).^2)
A11Bar=integral(A11,th1,th2)
Acap =(10279222485063723*cos(Th).^2)/2684354560000 + (9*((7138348947960919*cos(Th).^2)/8589934592 + 1142135831673747/4294967296))/(625*cos(Th).^2)
Acap11 = @(Th) Acap
Acap11Bar=integral(Acap11,th1,th2)
I am trying to Integrate the Equation in A11 with limits th1 and th2. Using the Integral command, If I am using the equation directly it gives me the answer. But if Define the equation as Acap, Acap becomes symbolic and I dont get answer and the error comes as follows. My Question is , Th is a sym, but I get the answer for A11Bar, when using Th in A11, But why not the same in the other case.
A11 =
@(Th)(10279222485063723*cos(Th).^2)/2684354560000+(9*((7138348947960919*cos(Th).^2)/8589934592+1142135831673747/4294967296))/(625*cos(Th).^2)
A11Bar =
4.090565444758960e+04
Acap =
(2569805621265931*cos(Th)^2)/671088640000 + ((64245140531648271*cos(Th)^2)/8589934592 + 10279222485063723/4294967296)/(625*cos(Th)^2)
Acap11 =
@(Th)Acap
Error using integralCalc/finalInputChecks (line 511) Input function must return 'double' or 'single' values. Found 'sym'.
Error in integralCalc/iterateScalarValued (line 315) finalInputChecks(x,fx);
Error in integralCalc/vadapt (line 132) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75) [q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88) Q = integralCalc(fun,a,b,opstruct);
Error in Untitled (line 13) Acap11Bar=integral(Acap11,th1,th2)

採用された回答

Torsten
Torsten 2017 年 4 月 27 日
Use
Acap11 = matlabFunction(Acap)
Best wishes
Torsten.
  5 件のコメント
Torsten
Torsten 2017 年 4 月 27 日
編集済み: Torsten 2017 年 4 月 27 日
90° is in between 75° and 105°, and you integrate over the entire interval.
Note that x=1.5708 is approximately pi/2.
Best wishes
Torsten.
Muthu Ram Prabhu Elenchezhian
Muthu Ram Prabhu Elenchezhian 2017 年 4 月 27 日
Hi, Thanks. I understood it now

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDesign and Simulate SerDes Systems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by