I need to to solve this coupled ODEs. I have written the code but not really getting any output. Any help would be appreciated!
1 回表示 (過去 30 日間)
古いコメントを表示
function [time, x, xdot, y] = bluff
meff = 0.0114; %Effective mass (kg)
ceff = 0.0212; %Effective damping (N/(m/s))
keff = 8.86; %Effective stiffnes (N/m)
thet = 0.000019758; %Electromechanical coefficient (N/V)
Cp = 0.0000000157; %Capacitance
rho = 1.225; %air density (kg/m3)
u = 10; %wind velocity(m/s)
stip = 0.0118; %exposed area of the bluff body(m2)
L = 0.15 ; %length of the beam
a1 = 2.3; %empirical coefficient for the aerodynamic force calculation
R = 1050000; %load resistance (ohm)
%values
x0 = 1; xdot0 = 0; y0 = 1;
t0 = 0; tf = 60;
%Time span
tspan = [t0, tf];
%initial conditions
IC = [x0, xdot0,y0];
% [sdot] = g(t,s)
sdot = @(t, s) [s(2);
(-ceff*s(2) - keff*s(1) - thet*s(3) + 0.5*rho*stip*(a1*((s(2)/u)+(1.5*s(1)/L))*u^2))/meff;
thet*s(2)/Cp - s(3)/(R*Cp)];
%Call ode45 solver
[time, state_values] = ode45(sdot,tspan,IC);
%Extract individual values
x = state_values(:,1);
xdot = state_values(:,2);
y = state_values(:,3);
%plot x(t) and y(t)
figure(1)
clf
plot(time,x), title('Displacement'), xlabel('time(s)'), ylabel('displacement(m)')
figure(2)
clf
plot(time,y), title ('Voltage generation'), xlabel('time(s)'), ylabel('Output voltage(V)')
end
9 件のコメント
Walter Roberson
2021 年 6 月 11 日
You divide by Cp but Cp is about Pi / 2e8 . When you divide by that, values are magnified a lot.
You might have better success if y0 were a lot smaller.
回答 (1 件)
Lewis Fer
2021 年 6 月 11 日
Hello, I am having troubles solving a system of second order nonlinear equations with boundary conditions using MATALB
Here is the equations:
f''(t)=3*f(t)*g(t) -g(t)+5*t;
g''(t)=-4f(t)*g(t)+f(t)-7*t;
the boundary conditions are: f'(0)=0 et h'(o)=5;
g(0)=3 et h'(2)=h(2)
3 件のコメント
Lewis Fer
2021 年 6 月 11 日
I have post my question in this pub, but there is no answer
https://www.mathworks.com/matlabcentral/answers/853120-how-to-solve-a-system-of-second-order-nonlinear-differential-equations-with-boundary-conditions?s_tid=srchtitle#add_answer
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!