Solving 4th order nonlinear Differential Equation using bvp4c

I am new to matlab and I want to solve above equation using matlab bvp4c.
The boundary conditions are - , , , .
I want to plot the following graph( only the bottom cure and not all the curves) -
But my code gives a different graph.
Can anyone please help me?
The matlav code i am trying is as follows-
function dxdy = mat4ode(~,y)
E=169e9; % YMod
w=10e-6; % Width of beam
t=2e-6; % Thickness of beam
I=(w*(t^3))/12; % Moment of intertia
V=2.3; % Voltage
e0=8.854187817e-12; % VPerm
e1 = 7.5*e0;
d1 = 20e-9;
h0=2e-6;
qx = (V^2*w/(2*E*I))*(1 + 0.65*(h0+y(1))/w)/(e0*( d1/e1 + (h0+y(1))/e0 )^2);
dxdy=[y(2)
y(3)
y(4)
qx]; %4th order equation
end
function res = mat4bc(ya,yb)
res=[ya(1) % u=0 at x=0
ya(2) % du/dx=0 at x=0
yb(3) % d2a/dx2=0 at x=L
yb(4)]; % d3a/dx3=0 at x=L
end
function mat4bvp
options = bvpset('RelTol', 1e-8, 'AbsTol', 1e-8);
i =0;
solinit = bvpinit(linspace(0,450e-6,100),[i i i i]); % Range of x and the Initial guess
sol = bvp4c(@mat4ode,@mat4bc,solinit,options);
x = linspace(0,450e-6);
y = deval(sol,x);
h = 2e-6 - y(1,:);
plot(1e6*sol.x,1e6*h);
xlim([0,450])
ylim([0,2])
end

1 件のコメント

Sumit Yelpale
Sumit Yelpale 2021 年 4 月 26 日
I tried to solve the equation again by modifying the code and i got the graph whih is colse to the top curve in the above graph. Can anyone help me please.
Thank you

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOptimization についてさらに検索

質問済み:

2021 年 4 月 12 日

コメント済み:

2021 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by