I'm new to matlab and to coding in general…
I don't get the errors, I have them both in 'odefun' and in 'ode45'
how should I solve them?
function:
%odefun
function dudz = odefun(z, u)%constants
P=1000;% carico agente
R=20;%raggio medio
L=1000;%lunghezza tubo
s=0.5;%spessore di parete
ni=0.3;%coeff poisson
E=250000;%modulo young
w=3; %pressione interna/esterna
E1=E/(1-ni^2);%modulo young dilataz laterale impedita
I=2*pi*R*s^3/(12);%momento di inerzia cilindro
k=2*pi*(E*s/R);%rigidezza molla fondazione
%linear sistem for diff eq 4th order
dudz(1) = u(2);dudz(2) = u(3);dudz(3) = u(4);dudz(4)=(-1/(E1*I))*((P*u(3))+(k*u(1)));end
error:
odefunNot enough input arguments.Error in odefun (line 13)dudz(1) = u(2);
ODE :
%range:
zRange = [0,1000];%INItIAL conditions:
u0=[0,0,0,0];%ODE:
[zsol,usol] = ode45(@odefun,zRange,u0)
errors:
Error using odearguments (line 93)ODEFUN must return a column vector.Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);Error in ODE_buckling_cilindro (line 17)[zsol,usol] = ode45(@odefun,zRange,u0)
Best Answer