Problem with fsolve function in my equation systems
1 view (last 30 days)
Show older comments
I'm a beginner in Matlab and I try to calculate this system:
equagenral1.m:
function F = equageneral1(x,lambda,mu,B,c,b,a,n,e,z,R,y)
F=[
x(3)+(lambda*(mu*x(2)-x(1)-B)+c)/(b+lambda)
x(2)+((a*n*(e+z*((1/((2*pi)^(1/2)))*y)))+lambda*mu*(x(3)-x(1)-B)-c)/(a+lambda*(mu^2))
-a*z*((1/((2*pi)^2))*(exp((-(-1.2-(R+x(1)))^2)/2)))*(x(2)+n*(e+z*((1/((2*pi)^(1/2)))*y)))+lambda*(mu*x(2)+x(3)-x(1)-B)+z*((1/((2*pi)^2))*(exp((-(-1.2-(R+x(1)))^2)/2)))
];
This is how I try to do this:
calcul.m:
R=16.09;
syms x
y=int(exp(((-1.2-(R+x(1))).^2)/2),0,+inf);
lambda = 1.7723;
mu = 0.50;
B = 21.6;
c = 1;
b = 9.0759;
a = 0.9657;
n = 1;
e = 0;
z = 0;
R=16.09;
Rss=0;
options=optimset('MaxFunEvals',1000);
[ex,fval]=fsolve(@(x)equageneral1(x,lambda,mu,B,c,b,a,n,e,z,R,y),[0 0 0],options);
But the answer tell me that FSOLVE requires all values returned by user functions to be of data type double.
How can I fix that?
Thank you!
Paul-André
3 Comments
Answers (0)
See Also
Categories
Find more on Numbers and Precision 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!