How do i use boundary conditions to find variables in an equation

조회 수: 5 (최근 30일)
Hi all. I am trying to find 4 variables which are c1, c2, c3, c4 in my equation using 4 boundary conditions. The value of lambda is known. But i donot know how to proceed. Any help is much appreciated.
My code is as follows:
lambda = 0.0275;
%Solution of the governing equation for beam-on-elastic-foundation is:
syms x c1 c2 c3 c4
u(x) = exp(lambda*x)*(c1*cos(lambda*x) + c2*sin(lambda*x)) +exp(-lambda*x)*(c3*cos(lambda*x) + c4*sin(lambda*x));
du(x) = diff(u,x);
%The boundary condition for the pile under node 01 on applying unit force on dof-01 is:
eqn1 = u(0)==1;
eqn2 = u(Lp)==0;
eqn3 = du(0)==0;
eqn4 = du(Lp)==0;
eqns = [eqn1 eqn2 eqn3 eqn4];
vars = [C1 C2 C3 C4];
soln = solve(u,eqns,vars);

채택된 답변

Muhammad Usman
Muhammad Usman 2019년 11월 14일
if you let Lp=constant and make changes in
soln = solve(u,eqns,vars);
to
soln = solve(eqns);
you will get a structure soln and in the command window you can access the value for each variable by soln.[variable], for example soln.c1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by