matlabFunction on symbolic experssion and the Error using symengine
Ältere Kommentare anzeigen
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 Kommentar
Walter Roberson
am 30 Mär. 2020
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!