Problem using integral in a nonlinear system

3 views (last 30 days)
Hello, I'm trying to solve a 4x4 nonlinear system of equations (using fsolve and lsqnonlin). Two of these equations have integrals, so at first use "int" in them, however, they do not have explicit solutions. So after try to solve using "integral" instead of "int", but not work either. I think the problem is with the integrals, because attempts to calculate it separately I get no results. The integral is:
integral((18000000*(1740853180245066011576893440000000*lambda10 + 518109338505567084173161632431603712*exp(t/10) - 51810602260580064227258209148465058700*t^2*exp(t/10) - 263671875*7452311944676252099^(1/2)*exp(t/20)*(12952650565145016056814552287116264675*t^2*exp(t/10) - 129527334626391771043290408107900928*exp(t/10) - 435213295061266502894223360000000*lambda10)^(1/2) + 5273437500*7452311944676252099^(1/2)*t*exp(t/20)*(12952650565145016056814552287116264675*t^2*exp(t/10) - 129527334626391771043290408107900928*exp(t/10) - 435213295061266502894223360000000*lambda10)^(1/2)))/(435213295061266502894223360000000*lambda10 + 129527334626391771043290408107900928*exp(t/10) - 12952650565145016056814552287116264675*t^2*exp(t/10)),tau,T1)
where even after giving values to the constants that I want to find (lambda10, tau, T1), gives me the following error: "Error using integralCalc / finalInputChecks (line 515) Output of the function must be the same size as the input. If FUN is an array-valued integrand, Set the 'ArrayValued' option to true.
Error in integralCalc / iterateScalarValued (line 315)                  finalInputChecks (x, fx);
Error in integralCalc / vadapt (line 133)              [q, errbnd] = iterateScalarValued (u, TInterval, pathlen);
Error in integralCalc (line 76)          [q, errbnd] = vadapt (@ AtoBInvTransform, interval);
Error in integral (line 89) IntegralCalc Q = (fun, a, b, opstruct); "
Please help!!
  1 Comment
Jurgen
Jurgen on 16 Sep 2014
I forgot to mention that before having the error I posted in the previous comment, first had an error saying: "Error using ^ Inputs must be a scalar and a square matrix. To compute elementwise POWER, use POWER (^.) Instead. "And" Error using * Inner matrix dimensions must agree. ".
Fix it by changing ^. ^ Y * by. *, But not really understand porqu telling me this because all the unknowns are scalar.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 16 Sep 2014
Do as the error message instructs and call integral() with the 'ArrayValued' option set to true.

More Answers (0)

Categories

Find more on Matrix Computations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!