Fourth order nonlinear DE solution where forcing function interpolation is known
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Mohammad Ansari
il 21 Mag 2023
Commentato: John D'Errico
il 22 Mag 2023
I want to solve the differential equation:
, with BCs:
(constant).
The function is not explicitly known, but I know its interpolation. I tried fitting a polynomial/exponential, but it I do not get a satisfactory fit. Please help!
3 Commenti
John D'Errico
il 22 Mag 2023
Sorry. My approach does not apply to a nonlinear forcing term that is a function of the dependednt variable.
Risposta accettata
Torsten
il 21 Mag 2023
Modificato: Torsten
il 21 Mag 2023
You will have to use bvp4c, not ode45.
And interpolation in the function where you define the derivative function can be done via
fw_inter = interp1(w,fw,y(1))
where w and fw are your data vectors (w ordered) and y(1) is the value of w from bvp4c:
function dydx = bvpfcn(x,y,w,fw)
fw_inter = interp1(w,fw,y(1));
dydx = [y(2);y(3);y(4);fw_inter];
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!