initial condition ODE45?

4 views (last 30 days)
silos ab
silos ab on 26 Jan 2021
Commented: silos ab on 26 Jan 2021
Can anyone tell me how to implement these initial condition in ODE45?
i have this differentiel equation to resolve:
thanks

Answers (1)

John D'Errico
John D'Errico on 26 Jan 2021
You cannot. That is to say, not directly. I suppose you could formulate it as a shooting method, in which case it becomes a nonlinear problem for fsolve.
But ODE45 is an initial value solver. You have conditions at THREE distinct locations. That makes this more of a boundary value problem.
I see some additional issues. What is S? Is S a known function?
Depending on what is S, I might suggest using some other general scheme to solve ODE problems, perhaps collocation.
  1 Comment
silos ab
silos ab on 26 Jan 2021
thank you for your answers, I will be very grateful if you can help me to correct the code below
this is my equation:
"S" is a function call "SS" in code
clc; clear all; close all;clf;
%% les données:
vs=0.25;
p=0.5;
Zp= 2000;
h=18000;
R=5100;
Dp=500;
E=210;
A=196350;
G=81;
v=0.3;
Es=96.14;
Ks=2;
I=3.06796E9;
EI=E*I;
Gp=Es*h/6*(1+vs);
Kp=(1-vs)*Es/((1+vs)*(1-2*vs)*h);
%% calcul coefficient:
a =-(((Dp*Kp*EI)+(Dp*Gp*G*A*Ks))/(EI*(G*A*Ks+Gp*Dp)));
b =(Dp*Kp*G*A*Ks)/(EI*(G*A*Ks+Gp*Dp));
c =Dp*Gp/(G*A*Ks+Gp*Dp);
%% calcul de s(x)
syms x f(x) X Y
i=0.175*Zp+0.325*(Zp-h);
smax=0.313*p*Dp^2/i;
ss= smax*exp(-0.5*x.^2/i^2);
%% dériver de s(x): f(x)= c*S""-a*s"+b*s
syms x f(x) X Y
D2ss = diff(ss,x,2);
D4ss = diff(ss,x,4);
ssdiv=vpa(simplify(c*D4ss+a*D2ss+b*ss),3);
D2f = diff(f,x,2);
D4f = diff(f,x,4);
fdiv=D4f+a*D2f+b*f;
ode =fdiv==ssdiv;
[VF,Sbs] = odeToVectorField(ode);
odefcn = matlabFunction(VF, 'Vars',{x,Y});
[X,Y] = ode45(odefcn, [-15 15], [0 0 0 0]);
figure
plot(X,Y)
grid
legend(string(Sbs))

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!