Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error using the 'solve' function

Subject: Error using the 'solve' function

From: Gara

Date: 27 Dec, 2013 18:26:06

Message: 1 of 3

I'm trying to solve an equation but Matlab is giving me this error message:

Warning: Explicit solution could not be found.
> In solve at 81
  In gara at 3

I don't understand it and I don't know how to fix it

syms D
eqn=('(D^3)=((16)/(pi*190*((1-(D/58))^4)))*(sqrt((399.64^2)+(379.33^2)))');
A=solve(eqn, D);

Please help me, thank you

Subject: Error using the 'solve' function

From: Alan_Weiss

Date: 27 Dec, 2013 19:11:06

Message: 2 of 3

On 12/27/2013 1:26 PM, Gara wrote:
> I'm trying to solve an equation but Matlab is giving me this error
> message:
> Warning: Explicit solution could not be found.
>> In solve at 81
> In gara at 3
>
> I don't understand it and I don't know how to fix it
>
> syms D
> eqn=('(D^3)=((16)/(pi*190*((1-(D/58))^4)))*(sqrt((399.64^2)+(379.33^2)))');
>
> A=solve(eqn, D);
>
> Please help me, thank you

"D" is used as a differential operator, so perhaps it is not a good idea
to use it as a variable.
Also, when you use a string expression for an equation, I believe that
the symbolic variable is not used. So I ran the following slightly
different commands:

syms D1 % D1 not D
eqn=((D1^3)-((16)/(pi*190*((1-(D1/58))^4)))*(sqrt((399.64^2)+(379.33^2))));
% I replaced the = with a -
A=solve(eqn, D1) % worked just fine

A =

63.079867300777110575867980436609
2.6087921602200828588643773225601
52.14008016362740012559841123103
  - 1.2823774635012483818192063508194 - 2.0063893969527284824291415300245*i
     58.36800765118895160165382185572 + 5.3548966432721055265970412913235*i
     58.36800765118895160165382185572 - 5.3548966432721055265970412913235*i
  - 1.2823774635012483818192063508194 + 2.0063893969527284824291415300245*i

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: Error using the 'solve' function

From: Gara

Date: 27 Dec, 2013 20:34:07

Message: 3 of 3

It worked, thank you!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us