Failure in initial objective function evaluation. FSOLVE cannot continue.

6 ビュー (過去 30 日間)
nilesh patel
nilesh patel 2018 年 10 月 16 日
コメント済み: nilesh patel 2018 年 10 月 16 日
Function File
function [G]=SteadyStateMillFUN(X)
%These are the algebraic equations for solving the steady-state mill
%balance
global S1 S2 S3 DB21 DB31 DB32 DB41 DB42 DB43 F X0 V rho
XF1=X(1);
XP1=X(2);
XP2=X(3);
XP3=X(4);
XP4=X(5);
P=X(6);
R1=X(7);
R2=X(8);
R3=X(9);
R4=X(10);
XF2=0;
XF3=0;
XF4=0;
G=[1-(XF1+XF2+XF3+XF4);
1-(XP1+XP2+XP3+XP4);
F*XF1-P*XP1 + R1;
F*XF2-P*XP2 + R2;
F*XF3-P*XP3 + R3;
F*XF4-P*XP4 + R4;
-S2*XP2+XP1*S1*DB21-R2/rho/V;
-S3*XP3+XP1*S1*DB31+XP2*S2*DB32-R3/rho/V;
XP1*S1*DB41+XP2*S2*DB42+XP3*S3*DB43-R4/rho/V;
R1+R2+R3+R4];
end
CODE TO RUN FUNCTION FILE
clear all;close all;clc
global S1 S2 S3 DB21 DB31 DB32 DB41 DB42 DB43 F X0 V rho
S1=.03;
S2=.02;
S3=.01;
DB21=1/3;
DB31=1/3;
DB32=.5;
DB41=1/3;
DB42=.5;
DB43=1;
V=20;
F=1;
rho=1500;
%tf=200;
%X0=[0.80 0.1 0.1 0];
Xguess=[1, 0, 0, 0, 0, 1, 0, 0, 0, 0];
Xguess=Xguess';
%OPTIONS = odeset('AbsTol',1e-8,'RelTol',1e-8); %Sets tolerences
%[t,X] = ode15s(@MillModelFUN,[0:.03:tf],X0,OPTIONS); %Solves diff e for the milling
[X,FVAL]=fsolve(@SteadyStateMillFUN,Xguess)
FVAL
X
%sprintf('Feed in Bin 1=%8.5f\nProduct in Bin 1=%8.5f\nproduct in Bin 2=%8.5f\nproduct in Bin 3=
  3 件のコメント
nilesh patel
nilesh patel 2018 年 10 月 16 日
what could be causing the problem on my laptop?
nilesh patel
nilesh patel 2018 年 10 月 16 日
got it to run. thanks

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by