Interdepending - multivariable problem

1 view (last 30 days)
Sergio Quesada
Sergio Quesada on 6 Oct 2018
Edited: Sergio Quesada on 6 Oct 2018
Good evening to everybody. My problem is the following:
I want to solve a sistem non-linear equations Int(r)-(t-texp)=0 in the variable r with the following complications:
- In "Int", r is in the upper limit of a definite integral of the integrand F(x). I call the solutions "r_teor".
-In the equations, "texp" is a 1x10 array experimental points, so each equation correspond to each valor of "texp".
- "t", which is the other variable in the equations, are the minimums of another function H, which depends itself on "rteor".
I have written down this:
F=@(x) FC.*exp(-(V.*a)./(30.*x.*log(x))); part=1e-3;
L=@(r) 1:part:r;
me=@(r) arrayfun(F,L(r));ue=@(r) F(max(L(r)));
Int=@(r) part.*(sum(me(r))-(ue(r)./2));
options = optimset('Display','iter','TolX',1e-4,'PlotFcns','@optimplotx'); syms r
for i=1:N
t=@(i) (1+(5.*((texp(i)-t0).^0.25)));
r_teor=@(i) fsolve(Int(r)-(t(i)-texp(i)), 1.5);
Ifar=@(i)(FD./FC).*(r_teor(i).*exp((V.*a)./(30.*r_teor(i).*log(r_teor(i)))));
Itrans=@(i) Io./((r_teor(i)).^4);
Itotal=@(i) Ifar(i)+Itrans(i);
SumError=@(i) sum((Itotal(i)-Iexp).^2);
t= fminbnd(SumError,6e-3,t1-5e-5,options);
end
, and I have the following error:
Undefined function 'functions' for input arguments of type 'inline'.
Any idea ? Thanks !!!
  2 Comments
Sergio Quesada
Sergio Quesada on 6 Oct 2018
Edited: Sergio Quesada on 6 Oct 2018
Hi, mdhan. They're constants that I define in the first line. I ommited them for clarity:
nombre='C2';t0=6.00E-3;FC=4.24E-1;a=6.05;FD=8.17E-4;Io=15.53;V=25;
fID=fopen('Para_Leer_C2_2219_ptos.txt','r');
Columnexpi=1;Columnexpf=10;
formatSpec='%f %f'; sizeSpec=[2,Inf];
datos=fscanf(fID,formatSpec,sizeSpec); close('all');N=Columnexpf-Columnexpi+1;
texp=datos(1, Columnexpi:Columnexpf);Iexp=datos(2, Columnexpi:Columnexpf); t1=texp(1);
Thanks!

Sign in to comment.

Answers (0)

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!