How can I solve this nested symbolic function ?
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Raúl Rivera
 el 16 de Oct. de 2023
  
    
    
    
    
    Respondida: Star Strider
      
      
 el 16 de Oct. de 2023
            Hello, Im doing a metallurgical problem ,to do so I need to make the following code but returns an error when i call the following nested function, by the way I am doing so because I want to export it as an excel add-in .
valor=molienda(10,6,6,6.1,1.02,0.45,0.7,10)
function a=molienda(F_min,Diametro,Largo,Wi,F80,Vp,fVc,t)
p80=mP80(t);
%Potencia para moler el mineral
W_mineral=Wi*((10/(p80^0.5))-(10/(F80))^(0.5));
P_mineral=W_mineral*F_min*1.341;
%Potencia para mover el medio moledor
Kwb = 4.879*(D^0.3)*(3.2-3*Vp)*fVc*(1-0.1/((2^9)-10*fVc))
W_bolas=80*(Diametro^2)*Largo;
P_bolas=Kwb*W_bolas;
P_total=P_bolas+P_mineral;
a(1)=P_total;
a(2)=P80;
function P_80=mP80(tiempo)
syms Q(x) z
Q(x) = (16.4831*x^(-0.7510)+1.665)*exp(-0.9451*tiempo^0.296);
fun= 80-(100-Q(z))==0;
P_80 = double(solve(fun,z));
end
end
I can´t find the solution ,please if you know how to i would very pleased . Thanks in advance for your help.
0 comentarios
Respuesta aceptada
  Star Strider
      
      
 el 16 de Oct. de 2023
        It would be best to abandon the idea of using the Symbolic Math  Toolbox here, since it is not necessary.  You  can do everything necessary with anonymous functions.  
Also, there are discrepancies between the function arguments and the code.  I substituted ‘p80’ for ‘F80’ and ‘P80’ in order to make it work.  You need to edit ‘molienda’ to resolve all these discrepancies, since I am not certain that the changes I made to it get it to work are correct.  
Try this — 
valor=molienda(10,6,6,6.1,1.02,0.45,0.7,10)
function a=molienda(F_min,Diametro,Largo,Wi,p80,Vp,fVc,t)
p80=mP80(t);
%Potencia para moler el mineral
W_mineral=Wi*((10/(p80^0.5))-(10/(p80))^(0.5));
P_mineral=W_mineral*F_min*1.341;
%Potencia para mover el medio moledor
Kwb = 4.879*(Diametro^0.3)*(3.2-3*Vp)*fVc*(1-0.1/((2^9)-10*fVc))
W_bolas=80*(Diametro^2)*Largo;
P_bolas=Kwb*W_bolas;
P_total=P_bolas+P_mineral;
a(1)=P_total;
a(2)=p80;
function P_80=mP80(tiempo)
% syms Q(x) z
Q = @(x) (16.4831*x.^(-0.7510)+1.665)*exp(-0.9451*tiempo.^0.296);
fun = @(z) 80-(100-Q(z));
P_80 = fsolve(fun,10);
end
end
.
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

