I must solve ode equation system but dsolve gives me error

2 ビュー (過去 30 日間)
EDOARDO GELMI
EDOARDO GELMI 2025 年 3 月 6 日
編集済み: Walter Roberson 2025 年 3 月 6 日
%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);
^^^^^^^^^^^^^^^^

採用された回答

Torsten
Torsten 2025 年 3 月 6 日
移動済み: Torsten 2025 年 3 月 6 日
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 件のコメント
EDOARDO GELMI
EDOARDO GELMI 2025 年 3 月 6 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEquation Solving についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by