Solving System Algebraic and Differential Equation

1 回表示 (過去 30 日間)
Gabriella MCO
Gabriella MCO 2018 年 5 月 28 日
編集済み: Gabriella MCO 2019 年 4 月 3 日
Hello all,
I have a problem fitting the best values for parameters b(1), b(2), b(3) to the experimental data. For my problem I have a system of algebraic equations that are inserted on the differential equation.
I addition to obtaining the best parameters to fit the data, I also want to see the predicted x of each time point)
I was wondering if anyone could help me with this task? I can also provide more details and my code, and I would appreciate a more specific/detailed answer by an experienced user.
Thanks so much!

採用された回答

Abraham Boayue
Abraham Boayue 2018 年 5 月 28 日
編集済み: Abraham Boayue 2018 年 5 月 28 日
Here is a code that may help you get started.
function First_oder_ode
% Verify that your equations are implemented correctly.
% Run these functions as a single m-file.
N = 1000;
T = 120;
t = 0 :T/(N-1):T;
ic = 1e-7; % Initial conditions Must be 4 numbers, try different values
[t,x]= ode45(@RHS, t,ic );
figure
plot(t ,real(x),'linewidth',2,'color','b')
a = title('x(t)');
set(a,'fontsize',14);
a = ylabel('y');
set(a,'Fontsize',14);
a = xlabel('t [0 120]');
set(a,'Fontsize',14);
grid
function dxdt= RHS(t,x)
% parameters
b = [0.0025 3600 1.5];
C1 = 2;
C2 = 4;
Ct = ( t / (C1+C2 *t ) );
% Algebraic and ODE functions
A = log10(1 + exp ( b(1)* (Ct -b(2))));
dxdt = - A * b(3)* (-x / A).^ (1 - 1 / b(3));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLeast Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by