Getting an error in symengine when integrating [SOLVED]

3 ビュー (過去 30 日間)
Karen Adler
Karen Adler 2019 年 6 月 18 日
編集済み: Karen Adler 2019 年 6 月 18 日
EDIT - Apologies, apparently my log2stat variable was empty because I mistakenly limited it to 10 and not 24, sorry!!!
Hello all,
I'm getting a weird error in symengine when I run the following code. What's weird is that it worked before and I can't think of anything I changed when it suddenly stopped working...
Essentially it's taking a curve fitting, copying the formula into a symbolic function, then integrating it from zero to a certain point (log2stat) and from that point to 48.
cfctrl = fit(time,control,'gauss5');
formulactrl=formula(cfctrl);
parameters = coeffnames(cfctrl); %All the parameter names
values = coeffvalues(cfctrl); %All the parameter values
for idx = 1:numel(parameters)
param = parameters{idx};
l = length(param);
loc = regexp(formulactrl, param); %Location of the parameter within the string
while ~isempty(loc)
%Substitute parameter value
formulactrl = [formulactrl(1:loc-1) num2str(values(idx)) formulactrl(loc+l:end)];
loc = regexp(formulactrl, param);
end
end
fxnctrl = str2sym(formulactrl);
df = diff(fxnctrl);
syms x
fxn = df == 0;
log2stat = vpasolve(fxn,x,[0,10]);
ctrl1 = int(fxnctrl,x,0,log2stat)
ctrl2 = int(fxnctrl,x,log2stat,48)
The errors I'm getting are:
Error using symengine
Invalid argument.
Error in sym/int (line 162)
rSym = mupadmex('symobj::intdef',f.s,x.s,a.s,b.s,options);
Error in copycsvsplitthenanalyze (line 64)
ctrl1 = int(fxnctrl,x,0,log2stat)
Thanks in advance!!
Karen
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 6 月 18 日
It appears we would need time and control to test this ourselves.
Karen Adler
Karen Adler 2019 年 6 月 18 日
Sure, apologies for not thinking of that!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by