Im using the integral2 function and getting an error as shown below. i tried all possible ways to solve it but again the same error is coming. Kindy provide me with an answer
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sandhya Pai
le 12 Mai 2016
Commenté : Sandhya Pai
le 12 Mai 2016
Code:
clear;
clc;
L=90e-6;
B=4.5e-6;
H=2e-6;
alpha=2.51e-6;
C=711;
T0=300;
K=170;
rho=2300;
nu=0.2;
E=165.81e9;
G=E/(2*(1+nu));
% considering the entire length of the section
syms x y
N1=(1/(1*L*H))*(x-L)*(y-H);
N2=(1/(1*L*H))*(x)*(y-H);
N3=(1/(1*L*H))*(x)*(y);
N4=(1/(1*L*H))*(x-L)*(y);
N=[N1 N2 N3 N4];
f=(K*((diff(N,x,1)*diff(N',x,1))+(diff(N,y,1)*diff(N',y,1))));
fun1= @(x,y)(f);
Ke=integral2(fun1,0,L,0,H);
My error:
Error using integral2Calc>integral2t/tensor (line 231)
Input function must return 'double' or 'single' values. Found 'sym'.
Error in integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Error in integral2Calc (line 9)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
Error in integral2 (line 106)
Q = integral2Calc(fun,xmin,xmax,yminfun,ymaxfun,opstruct);
Error in paulfem (line 23)
Ke=integral2(fun1,0,L,0,H);
0 commentaires
Réponse acceptée
Plus de réponses (1)
Steven Lord
le 12 Mai 2016
The integral2 function performs numeric integration. To integrate a symbolic expression with integral2 you would need to create a function handle from it using matlabFunction as Walter showed. Alternately call the int function twice to perform symbolic integration.
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!