I am trying to solve for OS here, but keeping getting pi/2 even when I change L

조회 수: 2 (최근 30일)
%variables
F = .00024; %kg
E = 10^6; %mPa
I = 6.1*10^-9; %kg m^2
L = .01; %m
%solve for Theta sub 0
func = @(initial) L/sqrt((E*I)/(2*F)) - integral(@(theta)1./sqrt(cos(initial)-cos(theta)),initial,pi/2);
OS = fsolve(func,.5);
I am not sure what I am doing wrong here, I hope to find the value of initial, this function is in respect to d theta. Is there anything wrong with this?
I want to then solve for xi which is also funky,
aa = linspace(pi/2*.99, 0, 49);
aa=aa';
%shape of rod given
xi = sqrt((2*E*I)/F)*(sqrt(cos(OS))-sqrt(cos(OS)-cos(aa)));
any help appreciated not sure what is wrong

답변 (1개)

Jeffrey Clark
Jeffrey Clark 2022년 7월 11일
@adam puchalski, you need to limit fsolve such that it doesn't attempt values that cause sqrt(cos(initial)-cos(theta)) to return a complex value, e.g., values >pi/2 and other ranges about the circle:
func(2)
ans =
0.0028 - 1.3565i

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by