# 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 view (last 30 days)
Jayanth Palat on 10 Jun 2021
Commented: Jayanth Palat on 12 Jun 2021  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
Jayanth Palat on 12 Jun 2021
y0?
Walter, y0 = 0. Thats the initial condition.

Lewis Fer on 11 Jun 2021
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)