Solving fully implicit DAE on Simulink

I have a fully implicit problem that I can solve using MATLAB function ode15i, but I want to solve it in Simulink and I can't model the system without Algebraic loops that always give me an error any help? You can find the Problem and the solution on MATLAB below The main problem is that I can't Separate the first derivative of H which is Hp on one side of the equation
I understand that there are some solvers in Simulink like ode15s for implicit DEAs, but I don't know how to define such an implicit function in Simulink!
clear,clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dt1 = 10/100;
d01 = 1/100;
f1 = 0.0001;
cd1 = 0.5;
Qp = 0.01;
g = 9.81;
At1 = (pi/4)*dt1^2;
A01 = (pi/4)*d01^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t0 = 0;
y0 = 0.000000000001;
yp0 = 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
odefun = @(t,H, Hp) Hp*At1 - Qp + sqrt((Hp^2*+2*g*H)/((sqrt(At1^2-A01^2)/(At1*A01*cd1))+(0.8*f1*H/(g*dt1^5))));
[t,y] = ode15i(odefun,[0 10],y0,yp0);
plot(t,y)
grid on

Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Products

Release

R2018a

Asked:

on 29 Sep 2018

Edited:

on 30 Sep 2018

Community Treasure Hunt

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

Start Hunting!