Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

nonlinear system of equations

3 visualizaciones (últimos 30 días)
Nikhil
Nikhil el 5 de Oct. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello all, I want to solve for three variables: epsilon=m(1), Jr(epsilon)=m(2), dr=m(3); The equations are quite complicated, as follows: Pd=0.015, Fr=8900, Z=9, Kn=3.5893e+005; Equation 1: epsilon= 0.5*(1-0.5*Pd/dr) Equation 2: dr=Pd/2 + (Fr/(Z*Kn*Jr(epsilon))^(1/1.5) Equation 3: Jr(epsilon)=(1/2pi)*{integration(-th1 to th1)[1-(0.5/epsilon)*(1-cos(theta))]^(1.5)]*cos(theta)}; where th1=cosine inverse (Pd/(2dr)) Actually theta is not the variable, its limit just depend on dr the third variable in question.
To solve for this system, I have written following code: function [ n ] = loaddistr( m ) Fr=8900; Pd=0.015; Z=9; Kn=3.5893e+005; n=[m(1)-0.5*(1-0.5*Pd/m(3)); m(3)-Pd/2+(Fr/(Z*Kn*m(2)))^(1/1.5); m(2)-(0.5/pi)*int((1-(1/(2*m(1)))*(1-cos(theta)))^(1.5)*cos(theta), theta, -acosd(0.5*Pd/m(3)), acosd(0.5*Pd/m(3)))]; %UNTITLED Summary of this function goes here % Detailed explanation goes here
end
when I try to run this as m0=[0.42, 0.21512, 0.062283] p=fsolve(@loaddistr, m0)
I am getting following error: ??? Undefined function or variable 'theta'.
Error in ==> loaddistr at 6 n=[m(1)-0.5*(1-0.5*Pd/m(3)); m(3)-Pd/2+(Fr/(Z*Kn*m(2)))^(1/1.5);
Error in ==> fsolve at 248 fuser = feval(funfcn{3},x,varargin{:});
Caused by: Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
Can someone please tell me where I am going wrong. Is my approach is correct?
Thanks in advance,
Nikhil
  4 comentarios
Nikhil
Nikhil el 5 de Oct. de 2013
I want to solve for three variables:
epsilon=m(1), Jr(epsilon)=m(2), dr=m(3);
The equations are quite complicated, as follows:
Pd=0.015, Fr=8900, Z=9, Kn=3.5893e+005;
Equation 1: epsilon= 0.5*(1-0.5*Pd/dr)
Equation 2: dr=Pd/2 + (Fr/(Z*Kn*Jr(epsilon))^(1/1.5)
Equation 3: Jr(epsilon)=(1/2pi)*{integration(-th1 to th1)[1-(0.5/epsilon)*(1-cos(theta))]^(1.5)]*cos(theta)};
where th1=cosine inverse (Pd/(2dr))
Actually theta is not the variable, its limit just depend on dr the third variable in question.
To solve for this system, I have written above code. Can someone please tell me where I am going wrong. Is my approach is correct? Thanks in advance,
Mohammad Monfared
Mohammad Monfared el 6 de Oct. de 2013
I think you can define an anonymous function earlier in your main function, hence fun became like:
function [ n ] = loaddistr( m )
Fr=8900; Pd=0.015; Z=9; Kn=3.5893e+005;
FUN=@(theta)(1-(1/(2*m(1)))*(1-cos(theta)))^(1.5)*cos(theta);
n=[m(1)-0.5*(1-0.5*Pd/m(3));
m(3)-Pd/2+(Fr/(Z*Kn*m(2)))^(1/1.5);
m(2)-(0.5/pi)*integral(FUN, -acosd(0.5*Pd/m(3)), acosd(0.5*Pd/m(3)))];

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by