Symbolic Math Toolbox: Unable to find explicit solution, Line 317

조회 수: 9 (최근 30일)
Michael Huber
Michael Huber 2020년 10월 21일
댓글: Michael Huber 2020년 10월 24일
Before anything, I'm definitely a beginner using MATLAB, so there may be something obvious wrong with my code.
Using the below code, I receive an error, but I'm not really sure why
The values in the M matrix were obtained by hand (dont think theres a problem, but there might be, I've checked it over several times)
I've taken out the for loop, reduced the values of a (to just .1 for the sake of trying to just get an initial solution), changed variable names, and tried to solve for other variables (namely L, just to try something else), and uninstalled all other add-ons.
The end goal is to get (k) for each (a) value in terms of (L)
This is using MATLAB R2020B, for academic use, Symbolic Math toolbox
Thank you for your time and assistance
Mike
P.S. This is for homework, the initial S value changes with every student (1 through 49).
P.P.S. For some context, this is for my MechEng class that goes over the buckling of columns (for this question) and deflections of beams.
OldCode:
clc, clear, close all
s=13
sa=sqrt(s+1)
a=.1:.1:.9
syms L k
for i=1:9
M=[(-sin(k*a(i))) (sin(k*sa*a(i))) (cos(k*sa*a(i))); (-k*cos(k*a(i))) (sa*cos(k*sa*a(i))) (-sa*sin(k*sa*a(i)));(0) (sin(k*sa*L)) (cos(k*sa*L))]
detM=det(M)
c=solve(detM,k)
end
OldError message:
Warning: Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
In Untitled (line 9)
c =
Empty sym: 0-by-1
NewCode:
clc, clear, close all
s=13;
sa=sqrt(s+1);
syms L k
a=.1*L;
M=[(-sin(k*a)) (sin(k*sa*a)) (cos(k*sa*a)); (-k*cos(k*a)) (sa*cos(k*sa*a)) (-sa*sin(k*sa*a));(0) (sin(k*sa*L)) (cos(k*sa*L))];
detM=det(M)
c=solve(detM,k)
NewError message:
Warning: Unable to find explicit solution. For options, see help.
c =
Empty sym: 0-by-1
>>
Edit1: Some grammar mistakes I noticed
Edit2: Slightly changed the code due to me making an oopsie in my hand calculations, error remains
Edit3: Changed the code (again) due to misunderstanding what some of the variables mean, error remains
Edit4: Change the code (again) to take out the for loop to make it easier to troubleshoot, error 317 went away, but still wont find the solution
  댓글 수: 5
Walter Roberson
Walter Roberson 2020년 10월 23일
You are not going to be able to find a solution.
There are an infinite number of solutions for k in terms of L.
Pick an L such as 1 and plot out the equation over a small range such as 1 to 20.
Michael Huber
Michael Huber 2020년 10월 24일
Ah ok
Seems I was going about this the wrong way then.
Thanks for your help!
Mike

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by