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 个评论

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 Exchange 中查找有关 Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by