I must solve ode equation system but dsolve gives me error

5 views (last 30 days)
%Geometric and Inertial Parameters
E = 70000; %Young's Modulus [MPa]
h = 6; %Section Height [mm]
b = 25; %Section Width [mm]
A = b*h; %Section Area [mm^2]
I = [(b*h^3)/12] ; %Inertial Momentum [mm^4]
L = 200; %Beam Lenght [mm]
ni = 0.33; %Poisson's Ratio
G = E/(2*(1 + ni)); %Shear Modulus [MPa]
k = 0.5; %Shear Factor
A_t = k*A; %Shear Section Area [mm^2]
q = 0; %Distributed Load along the beam [N/mm]
c = 0; %Distributed Bending Moment along the beam [N]
P = -50; %Concentrated Load at the free wedge of the beam [N]
%Equations' Definition
syms v(s) psi(s)
T = G*A_t*[diff(v,s) + psi(s)];
M = E*I*diff(psi,s);
ode1 = diff(T,s) == q;
ode2 = diff(M,s) + c == T;
ode = [ode1; ode2]
ode(s) = 
%Boundary Condition Definition
c1 = v(0) == 0;
c2 = psi(0) == 0;
c3 = psi(L) == (P/(G*A_t))-diff(v,s);
psi1 = diff(psi,s);
c4 = psi1(L) == 0;
cond = [c1; c2; c3; c4]
cond(s) = 
[v_sol,psi_sol] = dsolve(ode,cond);
Warning: Number of equations greater than number of indeterminates. Trying heuristics to reduce to square system.
Error using mupadengine/evalin2sym
Unable to reduce to square system because the number of equations differs from the number of indeterminates.

Error in mupadengine/feval2sym_NaNsingularity

Error in dsolve>mupadDsolve (line 334)
T = feval2sym_NaNsingularity(symengine,'symobj::dsolve',sys,x,options);

Error in dsolve (line 203)
sol = mupadDsolve(args, options);
There is the message and the error it gives me:
Warning: symbolic:ode:MoreEquationsThanUnknownsNumber of equations greater than number of indeterminates. Trying
heuristics to reduce to square system.∦
> In mupadengine/evalin2sym
In mupadengine/feval2sym_NaNsingularity
In dsolve>mupadDsolve (line 334)
In dsolve (line 203)
In Timoshenko_Beam_Model (line 40)
Error using mupadengine/evalin2sym
Unable to reduce to square system because the number of equations differs from the number of indeterminates.
Error in mupadengine/feval2sym_NaNsingularity
Error in dsolve>mupadDsolve (line 334)
T = feval2sym_NaNsingularity(symengine,'symobj::dsolve',sys,x,options);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in dsolve (line 203)
sol = mupadDsolve(args, options);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in Timoshenko_Beam_Model (line 40)
[v_sol,psi_sol] = dsolve(ode,cond);
^^^^^^^^^^^^^^^^

Accepted Answer

Torsten
Torsten on 6 Mar 2025
Moved: Torsten on 6 Mar 2025
The third boundary condition is wrong as stated. You must use dv/ds at some position s (e.g. 200).
%Geometric and Inertial Parameters
E = 70000; %Young's Modulus [MPa]
h = 6; %Section Height [mm]
b = 25; %Section Width [mm]
A = b*h; %Section Area [mm^2]
I = [(b*h^3)/12] ; %Inertial Momentum [mm^4]
L = 200; %Beam Lenght [mm]
ni = 0.33; %Poisson's Ratio
G = E/(2*(1 + ni)); %Shear Modulus [MPa]
k = 0.5; %Shear Factor
A_t = k*A; %Shear Section Area [mm^2]
q = 0; %Distributed Load along the beam [N/mm]
c = 0; %Distributed Bending Moment along the beam [N]
P = -50; %Concentrated Load at the free wedge of the beam [N]
%Equations' Definition
syms v(s) psi(s)
T = G*A_t*[diff(v,s) + psi(s)];
M = E*I*diff(psi,s);
ode1 = diff(T,s) == q;
ode2 = diff(M,s) + c == T;
ode = [ode1; ode2];
%Boundary Condition Definition
c1 = v(0) == 0;
c2 = psi(0) == 0;
dv = diff(v,s);
c3 = psi(L) == (P/(G*A_t))-dv(L);
psi1 = diff(psi,s);
c4 = psi1(L) == 0;
cond = [c1; c2; c3; c4];
[v_sol,psi_sol] = dsolve(ode,cond);
figure(1)
fplot(v_sol,[0 L])
figure(2)
fplot(psi_sol,[0 L])
  1 Comment
EDOARDO GELMI
EDOARDO GELMI on 6 Mar 2025
Thank you so much, i did the right thing for psi but i didn't modify the variable diff(v,s). Now it works fine, you saved me.

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!