How to construct a symbolic pde that contains symbolic functions of certain variables (x & t)
Ältere Kommentare anzeigen
In the code seen below is an euler lagrange equation derivation for a cantilever beam, in the end solving for acceleration (typical system modelling stuff).
So far i have added actual functions for EIx(x) and mu(x), such as; EIx = ax+b where a and b are doubles/numbers.
Instead i would like to print the full symbolic equation, as seen below.
If i rewrite the first line as shown:
syms dw(x,t) w(x,t) w_xx(x,t) q(x,t) EIx(x,t) mu(x,t)
then the script will run. But when I write the EIx and mu as functions of x only, then errors that i do not understand occurs.
It is important in this context that matlab knows that EIx and mu is only functions of x, so that they will not be partially derived wrt. time.
Any ideas how to achieve this will be much appriciated.
%Blade params functions of x and t
syms dw(x,t) w(x,t) w_xx(x,t) q(x,t) EIx(x) mu(x)
%Lagrangian K - P + input*w
L = mu/2 * dw^2 - EIx/2 * w_xx^2 + q*w;
% img = imread('Eul_Lagr.PNG'); % Euler lagrange equation to be solved
% figure(1)
% image(img)
dL_dw = functionalDerivative(L,w); %term 1
dL_ddw = functionalDerivative(L,dw);
d_dL_ddw_dt = diff(dL_ddw,t); %term 2
dL_dw_xx = functionalDerivative(L,w_xx);
dL_dw_xx_dx1 = diff(dL_dw_xx,x);
dL_dw_xx_dx2 = diff(dL_dw_xx_dx1,x); %term 3
Eul_lagr = 0 == dL_dw - d_dL_ddw_dt + dL_dw_xx_dx2; %
w_xx1 = diff(w,x);
w_xx = diff(w_xx1,x);
Eul_lagr = subs(Eul_lagr); % Substituting wxx back
Eul_lagr = isolate(Eul_lagr, 'diff(dw(x, t), t)'); % Isolating acceleration
pretty(Eul_lagr)
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu General PDEs finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!