No real roots equation error

No real roots equation error - I am having the No real roots error while trying to solve an equation - Messages

#1 Posted: 8/26/2022 4:56:08 PM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Hi all,

I am trying to solve an equation with the unknown "d". I have attached my Smath file and hope someone can help me with this.

Thanks a lot.

NoRealRootsError.sm (4 KiB) downloaded 34 time(s).
#2 Posted: 8/26/2022 8:12:31 PM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

In times of these, al_nleqsolve() is your friend.
Or you can use maple or maxima solvers.

Regards

NoRealRootsError_solved.sm (8 KiB) downloaded 35 time(s).

2022-08-27_02-11.png
2 users liked this post
sergio 8/27/2022 6:25:00 AM, NDTM Amarasekera 8/27/2022 8:57:00 AM
#3 Posted: 8/26/2022 8:16:08 PM
churichuro

churichuro

28 likes in 79 posts.

Group: User

maybe

with maple
#4 Posted: 8/27/2022 8:20:52 AM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Thank you all for the replies.

As I am not that familiar with Smath yet some questions have raised to me.

Why does the equation needs to be re-written to f(d)? And what's the reason f(0) has to be calculated? How do I need to interpetret the things below the graph? I am sorry but it looks like magic to me


#5 Posted: 8/27/2022 8:27:37 AM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Wrote

In times of these, al_nleqsolve() is your friend.
Or you can use maple or maxima solvers.

Regards

NoRealRootsError_solved.sm (8 KiB) downloaded 35 time(s).

2022-08-27_02-11.png



Hi overlord, thanks for your help.

Could you elaborate on what is described in the grey area?

Why did you re-write the equation to f(d)? And why is in the equation f(d) equ(d) added?
What is the function of step:=0?
#6 Posted: 8/27/2022 8:49:25 AM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Sorry, coming back on this. What is the meaning of 0.033*i? I can't see what in the end is the solution to d?
#7 Posted: 8/27/2022 9:03:52 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Why does the equation needs to be re-written to f(d)? And what's the reason f(0) has to be calculated? How do I need to interpret the things below the graph? I am sorry but it looks like magic to me


1. If you plot the function first, that will help bracketing the solve bloc.
2. F(0) ... just to see its min datum.
3. Nice maple, al_nleqsolve ... not needed vs the built-in solve(,,,,)
Enjoy Smath ... Jean.

NoRealRootsError Doctored.sm (12 KiB) downloaded 28 time(s).
#8 Posted: 8/27/2022 9:41:29 AM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Wrote

Wrote

Why does the equation needs to be re-written to f(d)? And what's the reason f(0) has to be calculated? How do I need to interpret the things below the graph? I am sorry but it looks like magic to me


1. If you plot the function first, that will help bracketing the solve bloc.
2. F(0) ... just to see its min datum.
3. Nice maple, al_nleqsolve ... not needed vs the built-in solve(,,,,)
Enjoy Smath ... Jean.

NoRealRootsError Doctored.sm (12 KiB) downloaded 28 time(s).



Thanks.

It looks like the outcome isn't correct. If I check the equation with d=0.2551 it doesn't correspond with the equation?
#9 Posted: 8/27/2022 10:12:46 AM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

Wrote

Hi overlord, thanks for your help.

Could you elaborate on what is described in the grey area?

Why did you re-write the equation to f(d)? And why is in the equation f(d) equ(d) added?
What is the function of step:=0?


step is max solving steps of al_nleqsolve(), zero means unlimited steps.
guess is a starting point for variable. eps is tolerance for solver.
You can read more about al_nleqsolve() function from Reference Book.

Click to expand

f(d) is common usage of function, not necessary.
Just added for correspondence for functions help sheet.
Can be written as this too, but g(v)=f(v1) is necessary.

2022-08-27_15-53.png

Wrote

Sorry, coming back on this. What is the meaning of 0.033*i? I can't see what in the end is the solution to d?


i means imaginary number if (-1)^(1/2).
Fourth power of all solutions of d makes function zero.
NaN actually in your case, division by zero.
But numeric solver takes this as a result I guess.

Wrote

It looks like the outcome isn't correct. If I check the equation with d=0.2551 it doesn't correspond with the equation?


It is correct, check more carefully.

2022-08-27_15-58.png

Regards
#10 Posted: 8/27/2022 12:01:41 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Sorry, coming back on this.
What is the meaning of 0.033*i ?
I can't see what in the end is the solution to d?


Maple collects all possible solutions, including pure imaginary.
Best respond is the solve(,,,,) bloc, just real intersections.

#11 Posted: 8/27/2022 2:24:11 PM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

Quote

step is max solving steps of al_nleqsolve(), zero means unlimited steps.
guess is a starting point for variable. eps is tolerance for solver.
You can read more about al_nleqsolve() function from Reference Book.



Thanks for your explanation, some things are strange to me a bit:
1. How can I setup such a grey block as you did?
2. eps should be the tolerance for the solver, I change it to for example to 10 (instead of 14), but the outcome didn't change anyway?
3. Why isn't the jacobi matrix used in the al_nleqsolve()?
4. What does g(v):=f(v1) mean?

Quote

It is correct, check more carefully.

2022-08-27_15-58.png

Regards


Where is the value of 1000 based on in this equation? I doesn't see the reference?

Quote

i means imaginary number if (-1)^(1/2).
Fourth power of all solutions of d makes function zero.
NaN actually in your case, division by zero.
But numeric solver takes this as a result I guess.


I can't follow along with the maple(solve) function yet, why does it end up with 6 values?

Where could I find the reference book? I think I found it within Smath itself as a plugin but couldn't find the topic about al_nleqsolve().
#12 Posted: 8/27/2022 6:05:38 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... here is an example of al_nleqsolve to fit
a data set via support points selected by user.
Too noisy data are a bit more difficult to manage.
They can be smoothed via Genfit.

Mal.024 al_nleqsove.sm (39 KiB) downloaded 34 time(s).
#13 Posted: 8/27/2022 6:26:37 PM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

Wrote

Thanks for your explanation, some things are strange to me a bit:


1. How can I setup such a grey block as you did?
It is just an empty text region placed under the equations. Check the file NoRealRootsError_solved_v2.sm (14 KiB) downloaded 30 time(s)..

2. eps should be the tolerance for the solver, I change it to for example to 10 (instead of 14), but the outcome didn't change anyway?
It relates decimal accuracy, 10^14 means it will numerically check solvers epsilon till it won't change for 10^14 digits.

3. Why isn't the jacobi matrix used in the al_nleqsolve()?
Sometimes you need Jacobian matrix sometimes you don't.

4. What does g(v):=f(v1) mean?
It is how it is used in al_nleqsolve(). v is gathered from guess matrix. v1 is first element of guess matrix.
If a system of two unknown would be solved than it will be used as in Reference Book.

5. Where is the value of 1000 based on in this equation? I doesn't see the reference?
1000 is used instead of your 400*10^6, just to show solver is finding results correctly.

6. I can't follow along with the maple(solve) function yet, why does it end up with 6 values?
maple plugin is more capable than SMath's other functions at certain areas, sometimes it can find more results.
It is much more reliable at symbolic results for example.

7. Where could I find the reference book? I think I found it within Smath itself as a plugin but couldn't find the topic about al_nleqsolve().
Check the video below.

Click to expand
#14 Posted: 8/28/2022 12:59:33 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

A semi numerical-symbolic plugin less version of the solution.

RealRoots.sm (26 KiB) downloaded 40 time(s).
RealRoots.pdf (126 KiB) downloaded 31 time(s).

Best regards.
Alvaro.
#15 Posted: 8/28/2022 10:19:22 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Thanks Alvaro.
You are the Grand Doctor in Smath Community.
So much maths involved ... 10 decimals !!!
Hola ... Jean.

AccurateSolve.PNG
#16 Posted: 8/28/2022 11:58:50 AM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

I would like to thank you all! I wanted to give a "thank" notification but I get an error: "en.smath.com says: Error Occurred".

I am trying to get familiar with it a bit now .

From the latest files, some questions:
  1. Why did you define the ao:= .... equation? (@Alvaro)
  2. FindRoots What's meant with "finding roots"? Why do I need to find roots? (@overlord)
  3. d.result What is the reason this function is used? What does that 0.2551 value say to me?
  4. How can I get more number of digits behind the comma? (@overlord)



Thanks.
#17 Posted: 8/28/2022 12:42:46 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Thanks button does not work for ~ 8 years.
You won't get more decimals than snippet above, 10 D.
Too many numerical maths involved.
Cheers ... Jean.
#18 Posted: 8/28/2022 12:43:52 PM
MaLe24

MaLe24

0 likes in 9 posts.

Group: User

I tried another equation to solve, but get the norealroots error. What would be the way to go here?
Norealroots
#19 Posted: 8/28/2022 2:09:08 PM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

Wrote

From the latest files, some questions:


2. What's meant with "finding roots"? Why do I need to find roots? (@overlord)
root of a function is what it makes 0 when given to unknown.
for example; take f(x)=x^2+3*x+2.
f(x) results zero when x is equal to -2 and -1.
solve(), roots(), FindRoot(), al_nleqsolve() are simply trying to find that zero makers.
main purpose of solvers are trying to find the root of given function.

3. What is the reason this function is used? What does that 0.2551 value say to me?
this function finds x value which makes equ(x) is equal to 1000.
solve(), roots(), FindRoots() etc could be used too.
I used it just to show you smath can solve your function, correctly.

4. How can I get more number of digits behind the comma? (@overlord)
right click to result, hover to decimal places, choose how many digits you want to show.

Click to expand
#20 Posted: 8/28/2022 2:10:39 PM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

Wrote

I tried another equation to solve, but get the norealroots error. What would be the way to go here?


Click to expand
  • New Posts New Posts
  • No New Posts No New Posts