matlabFunction on symbolic experssion and the Error using symengine
이전 댓글 표시
Hello
I have a mix double integral and partial differential expression and I want to solve it by symbolic math in matlab.
My code below written to solve the equation. But matlabFunction() does not work on it and gives me an error.
I would be appreciated if anybody could help me. I tried the numerical way to solve this expression but I could not find the right result. The only way that I think work is using symbolic math. Any idea and help is appreciated.
Here is my code:
syms t z
w=1.11;
T=1.2;
zita=0.5;
a=1;
b=1;
d=0;
%%
teta=exp(-((1-t/T)*(t/T))^(-w));
phi=int(teta)/int(teta,0,T);
Y1=[1;1]+[1;2]*phi;
Y2=[2;1]+[1;1]*phi;
eta0=Y1+(z-zita)*Y2;
F=[(1/a)*(diff(eta0(1,1),t)-eta0(2,1)*eta0(1,1)); ...
(1/b)*(diff(eta0(2,1),t)-d*eta0(2,1))];
int1=int(F,z)-int(F,z,0,zita);
etaAux=int(int1,z)-int(int1,z,0,zita);
eta=eta0+etaAux;
etaD=diff(eta,z);
fun=matlabFunction(etaD);
After running the code, I got this error:
Error using symengine
Unable to evaluate to Boolean.
Error in sym/matlabFunction>mup2mat (line 404)
res = mupadmex('symobj::generateMATLAB',r.s,ano,spa,0);
Error in sym/matlabFunction>mup2matcell (line 374)
r = mup2mat(c{1},true,sparseMat);
Error in sym/matlabFunction (line 188)
body = mup2matcell(funs, opts.Sparse);
Could you please help me with this issue?
etaD is 2by1 and matlabFunction() works on etaD(2,1) but does not work on etaD(1,1) and gives me the same error as above.
댓글 수: 1
Walter Roberson
2020년 3월 30일
It has something to do with the square of an integral. It doesn't matter if it is numerator or denominator but it does matter that it is squared
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!