필터 지우기
필터 지우기

inputing pi in syms

조회 수: 16 (최근 30일)
Aleksander Tyczynski
Aleksander Tyczynski 2020년 6월 7일
댓글: Surya Talluri 2020년 8월 10일
Hello,
I am working with the code bellow & R2020a.
The answer provided is:
result:
which is correct.
However, I would much prefare the answer to be given in the form:
aim:
Is there a way to do so?
So far I tried using
pi = sym('pi')
and
pi = sym(pi)
or just pi as a symbol.
In the best senario I get the number answer (389.6364); in the worst I obtain this:
Thank you,
The code used:
syms k x L E I
pi = sym(pi)
% Trial function
w = k * (1- cos(2*pi*x/L))
% Derivatives
w_x = diff(w,x,1)
w_xx = diff(w,x,2)
% x_y = diff(w,y,1)
% x_yy = diff(w,y,2)
% Strain
U = 1/2* int((E*I*w_xx^2),[0,L])
  댓글 수: 5
Aleksander Tyczynski
Aleksander Tyczynski 2020년 6월 7일
편집: Aleksander Tyczynski 2020년 6월 7일
indeed that is the basis of my question.
Is there a way to obtain:
  • a final answer with π
  • and where π is 'understood' as 3.14... so eg. ends up being zero
Basically, can I obtain this:
Surya Talluri
Surya Talluri 2020년 8월 10일
I have checked with R2020a and the code that you have mentioned is working fine for me with sin(4pi) turning to zero.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by