Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Solving a DAE system: Error using decic function. index greater than 1 despite isLowIndexDAE = TRUE

Solving a DAE system: Error using decic function. index greater than 1 despite isLowIndexDAE = TRUE

PuTI / 2025-01-13
Solving a DAE system: Error using decic function. index greater than 1 despite isLowIndexDAE = TRUE
Matlab News

I am trying to solve a system of DAEs that emerge in a constrained optimal control problem. I cannot find the consistent initial conditions. The error I get when looking for them using decic is that the index may be larger than 1, even though the isLowIndexDAE indicates that index is low. The error message is:

Error using decic>sls (line 170)
Index may be greater than one.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);|

The variables psi1 and psi2 are the lagrange multipliers on two constraints: XB(t)>=0 and HW(t)=<1. Equations 6 and 7 are conseqiuently the complementary slackness conditions. I want to find the initial conditions in which both of these constraints bind, hence my guesses XB0=0 and HW0=1. Guesses for a few other variables follow. I tried relaxing the fixed guesses (and fix the relaxed ones) in the decic function in many different ways, but if I do that, then the only result is that I get a different error, for example:

Error using decic>sls (line 168)
Try freeing 7 fixed components.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);

Error in ode_mathtoolbox (line 64)
[y0, yp0] = decic(F, 0, y0est, [0,1,1,1,0,1,1], yp0est, [0,0,1,1,0,0,0], opt)

My code is:

clear all

syms XB(t) HW(t) A(t) N(t) mu(t) psi1(t) psi2(t) …
rho nu n alpha alphahat chi lam phi delta s

eqn1 = N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)) == (1-HW(t))*(1-nu)*(XB(t))^(-nu)+psi1(t);
eqn2 = (N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)))*(A(t)*(1-s)*N(t)*alphahat) == XB(t)^(1-nu) – mu(t)*delta*lam*(A(t)^(phi))*((s*N(t))^lam)*(HW(t)^(lam-1)) + psi2(t);
eqn3 = diff(A(t), 1) == delta*(A(t)^phi)*(s*N(t)*HW(t))^lam;
eqn4 = diff(N(t), 1) == n*N(t);
eqn5 = diff(mu(t),1) == -(1-HW(t))*(1-nu)*(XB(t)^(-nu))*(1-s)*HW(t)*N(t)*alphahat + mu(t)*delta*phi*((A(t))^(phi-1))*(s*HW(t)*N)^lam + rho*mu(t);
eqn6 = XB(t)*psi1(t) == 0;
eqn7 = (1-HW(t))*psi2(t) == 0;

eqns = [eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7];

vars = [XB(t), HW(t), A(t), N(t), mu(t), psi1(t), psi2(t)];
origVars = length(vars)

M = incidenceMatrix(eqns, vars)

isLowIndexDAE(eqns,vars)

[DAEs,DAEvars] = reduceDAEIndex(eqns,vars);
[DAEs,DAEvars] = reduceRedundancies(DAEs,DAEvars);

isLowIndexDAE(DAEs,DAEvars)

pDAEs = symvar(DAEs);
pDAEvars = symvar(DAEvars);
extraParams = setdiff(pDAEs, pDAEvars);

f = daeFunction(DAEs, DAEvars, alphahat, delta, lam, n, nu, phi, rho, s);

rho = 0.02;
nu = 0.9;
n = 0.01;
alpha = 0.33;
chi = 0.05;
lam = 0.65;
phi = 0.65;
delta = 0.057;
s = 0.2;
alphahat = alpha^(alpha/(1-alpha))-alpha^(1/(1-alpha));

F = @(t,Y,YP) f(t, Y, YP, alphahat, delta, lam, n, nu, phi, rho, s);

DAEvars

XB0 = 0;
HW0 = 1;
A0 = 1;
N0 = 1;
mu0 = 0;

y0est = [XB0; HW0; A0; N0; mu0; 1/(A0*(1-s)*N0*alphahat); 1+mu0*delta*lam*s*((A0)^phi)*(N0^lam)];
yp0est = [0,0,delta*(s^lam),n,0,0,0];

opt = odeset(‘RelTol’, 10.0^(-7), ‘AbsTol’ , 10.0^(-7));

[y0, yp0] = decic(F, 0, y0est, [0,0,0,1,0,0,0], yp0est, [0,0,0,0,0,0,0], opt)I am trying to solve a system of DAEs that emerge in a constrained optimal control problem. I cannot find the consistent initial conditions. The error I get when looking for them using decic is that the index may be larger than 1, even though the isLowIndexDAE indicates that index is low. The error message is:

Error using decic>sls (line 170)
Index may be greater than one.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);|

The variables psi1 and psi2 are the lagrange multipliers on two constraints: XB(t)>=0 and HW(t)=<1. Equations 6 and 7 are conseqiuently the complementary slackness conditions. I want to find the initial conditions in which both of these constraints bind, hence my guesses XB0=0 and HW0=1. Guesses for a few other variables follow. I tried relaxing the fixed guesses (and fix the relaxed ones) in the decic function in many different ways, but if I do that, then the only result is that I get a different error, for example:

Error using decic>sls (line 168)
Try freeing 7 fixed components.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);

Error in ode_mathtoolbox (line 64)
[y0, yp0] = decic(F, 0, y0est, [0,1,1,1,0,1,1], yp0est, [0,0,1,1,0,0,0], opt)

My code is:

clear all

syms XB(t) HW(t) A(t) N(t) mu(t) psi1(t) psi2(t) …
rho nu n alpha alphahat chi lam phi delta s

eqn1 = N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)) == (1-HW(t))*(1-nu)*(XB(t))^(-nu)+psi1(t);
eqn2 = (N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)))*(A(t)*(1-s)*N(t)*alphahat) == XB(t)^(1-nu) – mu(t)*delta*lam*(A(t)^(phi))*((s*N(t))^lam)*(HW(t)^(lam-1)) + psi2(t);
eqn3 = diff(A(t), 1) == delta*(A(t)^phi)*(s*N(t)*HW(t))^lam;
eqn4 = diff(N(t), 1) == n*N(t);
eqn5 = diff(mu(t),1) == -(1-HW(t))*(1-nu)*(XB(t)^(-nu))*(1-s)*HW(t)*N(t)*alphahat + mu(t)*delta*phi*((A(t))^(phi-1))*(s*HW(t)*N)^lam + rho*mu(t);
eqn6 = XB(t)*psi1(t) == 0;
eqn7 = (1-HW(t))*psi2(t) == 0;

eqns = [eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7];

vars = [XB(t), HW(t), A(t), N(t), mu(t), psi1(t), psi2(t)];
origVars = length(vars)

M = incidenceMatrix(eqns, vars)

isLowIndexDAE(eqns,vars)

[DAEs,DAEvars] = reduceDAEIndex(eqns,vars);
[DAEs,DAEvars] = reduceRedundancies(DAEs,DAEvars);

isLowIndexDAE(DAEs,DAEvars)

pDAEs = symvar(DAEs);
pDAEvars = symvar(DAEvars);
extraParams = setdiff(pDAEs, pDAEvars);

f = daeFunction(DAEs, DAEvars, alphahat, delta, lam, n, nu, phi, rho, s);

rho = 0.02;
nu = 0.9;
n = 0.01;
alpha = 0.33;
chi = 0.05;
lam = 0.65;
phi = 0.65;
delta = 0.057;
s = 0.2;
alphahat = alpha^(alpha/(1-alpha))-alpha^(1/(1-alpha));

F = @(t,Y,YP) f(t, Y, YP, alphahat, delta, lam, n, nu, phi, rho, s);

DAEvars

XB0 = 0;
HW0 = 1;
A0 = 1;
N0 = 1;
mu0 = 0;

y0est = [XB0; HW0; A0; N0; mu0; 1/(A0*(1-s)*N0*alphahat); 1+mu0*delta*lam*s*((A0)^phi)*(N0^lam)];
yp0est = [0,0,delta*(s^lam),n,0,0,0];

opt = odeset(‘RelTol’, 10.0^(-7), ‘AbsTol’ , 10.0^(-7));

[y0, yp0] = decic(F, 0, y0est, [0,0,0,1,0,0,0], yp0est, [0,0,0,0,0,0,0], opt) I am trying to solve a system of DAEs that emerge in a constrained optimal control problem. I cannot find the consistent initial conditions. The error I get when looking for them using decic is that the index may be larger than 1, even though the isLowIndexDAE indicates that index is low. The error message is:

Error using decic>sls (line 170)
Index may be greater than one.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);|

The variables psi1 and psi2 are the lagrange multipliers on two constraints: XB(t)>=0 and HW(t)=<1. Equations 6 and 7 are conseqiuently the complementary slackness conditions. I want to find the initial conditions in which both of these constraints bind, hence my guesses XB0=0 and HW0=1. Guesses for a few other variables follow. I tried relaxing the fixed guesses (and fix the relaxed ones) in the decic function in many different ways, but if I do that, then the only result is that I get a different error, for example:

Error using decic>sls (line 168)
Try freeing 7 fixed components.

Error in decic (line 77)
[dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);

Error in ode_mathtoolbox (line 64)
[y0, yp0] = decic(F, 0, y0est, [0,1,1,1,0,1,1], yp0est, [0,0,1,1,0,0,0], opt)

My code is:

clear all

syms XB(t) HW(t) A(t) N(t) mu(t) psi1(t) psi2(t) …
rho nu n alpha alphahat chi lam phi delta s

eqn1 = N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)) == (1-HW(t))*(1-nu)*(XB(t))^(-nu)+psi1(t);
eqn2 = (N(t)/(A(t)*(1-s)*HW(t)*N(t)*alphahat – XB(t)))*(A(t)*(1-s)*N(t)*alphahat) == XB(t)^(1-nu) – mu(t)*delta*lam*(A(t)^(phi))*((s*N(t))^lam)*(HW(t)^(lam-1)) + psi2(t);
eqn3 = diff(A(t), 1) == delta*(A(t)^phi)*(s*N(t)*HW(t))^lam;
eqn4 = diff(N(t), 1) == n*N(t);
eqn5 = diff(mu(t),1) == -(1-HW(t))*(1-nu)*(XB(t)^(-nu))*(1-s)*HW(t)*N(t)*alphahat + mu(t)*delta*phi*((A(t))^(phi-1))*(s*HW(t)*N)^lam + rho*mu(t);
eqn6 = XB(t)*psi1(t) == 0;
eqn7 = (1-HW(t))*psi2(t) == 0;

eqns = [eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7];

vars = [XB(t), HW(t), A(t), N(t), mu(t), psi1(t), psi2(t)];
origVars = length(vars)

M = incidenceMatrix(eqns, vars)

isLowIndexDAE(eqns,vars)

[DAEs,DAEvars] = reduceDAEIndex(eqns,vars);
[DAEs,DAEvars] = reduceRedundancies(DAEs,DAEvars);

isLowIndexDAE(DAEs,DAEvars)

pDAEs = symvar(DAEs);
pDAEvars = symvar(DAEvars);
extraParams = setdiff(pDAEs, pDAEvars);

f = daeFunction(DAEs, DAEvars, alphahat, delta, lam, n, nu, phi, rho, s);

rho = 0.02;
nu = 0.9;
n = 0.01;
alpha = 0.33;
chi = 0.05;
lam = 0.65;
phi = 0.65;
delta = 0.057;
s = 0.2;
alphahat = alpha^(alpha/(1-alpha))-alpha^(1/(1-alpha));

F = @(t,Y,YP) f(t, Y, YP, alphahat, delta, lam, n, nu, phi, rho, s);

DAEvars

XB0 = 0;
HW0 = 1;
A0 = 1;
N0 = 1;
mu0 = 0;

y0est = [XB0; HW0; A0; N0; mu0; 1/(A0*(1-s)*N0*alphahat); 1+mu0*delta*lam*s*((A0)^phi)*(N0^lam)];
yp0est = [0,0,delta*(s^lam),n,0,0,0];

opt = odeset(‘RelTol’, 10.0^(-7), ‘AbsTol’ , 10.0^(-7));

[y0, yp0] = decic(F, 0, y0est, [0,0,0,1,0,0,0], yp0est, [0,0,0,0,0,0,0], opt) decic MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

How to debug C# .NET assembly called from MATLAB?
2025-05-15

How to debug C# .NET assembly called from MATLAB?

How do I set the size of a tile from tiledlayout?
2025-05-15

How do I set the size of a tile from tiledlayout?

Communicate with worker through client
2025-05-15

Communicate with worker through client

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss