No real roots ?

No real roots ? - Solve function does not work - Mensajes

#1 Publicado: 26/12/2020 14:41:03
Aleksey_here

Aleksey_here

0 me gusta en 8 mensajes.

Grupo: User

no real roots
#2 Publicado: 26/12/2020 16:47:58
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Please, attach the document to see something profitable for doctoring.
Your solve bloc is incorrect anyway. Generally 4 arguments solve(,,,,).
#3 Publicado: 26/12/2020 18:56:52
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

Your solve bloc is incorrect anyway. Generally 4 arguments solve(,,,,).


What's going on ... I posted this example.

Solve Example.sm (7,56 KiB) descargado 1253 vez(es).

#4 Publicado: 27/12/2020 1:25:02
Aleksey_here

Aleksey_here

0 me gusta en 8 mensajes.

Grupo: User

Wrote

Please, attach the document to see something profitable for doctoring.
Your solve bloc is incorrect anyway. Generally 4 arguments solve(,,,,).



Please see the file, the last page

minimal_model.sm (93,72 KiB) descargado 1223 vez(es).

#5 Publicado: 27/12/2020 7:51:39
overlord

overlord

600 me gusta en 1.381 mensajes.

Grupo: Moderator

Wrote

Wrote

Please, attach the document to see something profitable for doctoring.
Your solve bloc is incorrect anyway. Generally 4 arguments solve(,,,,).



Please see the file, the last page

minimal_model.sm (93,72 KiB) descargado 1223 vez(es).


Not everything is solved with solve. Try to use root.
This was same issue I had to deal some near time.
I had completely forgotten the root function back then.

Usually works with units if you do as in example.
Otherwise you will encounter units mismatch.

Regards

2020-12-27_13-48.png
#6 Publicado: 27/12/2020 9:24:28
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

Please see the file, the last page


Solve will work with a units-less construction.
By same token you can solve Maple for either X or Y units-less.

2D Parametric Plot [Create Trifolium].sm (33,61 KiB) descargado 1038 vez(es).
#7 Publicado: 27/12/2020 9:54:14
overlord

overlord

600 me gusta en 1.381 mensajes.

Grupo: Moderator

Wrote

Please see the file, the last page
minimal_model.sm (93,72 KiB) descargado 1223 vez(es).


My bad, you can use solve too in this example. Even with units as mentioned before.
Just check your roots range in Tools>Options>Calculation for other calculations.

Regards

2020-12-27_15-46.png
#8 Publicado: 27/12/2020 13:54:06
Aleksey_here

Aleksey_here

0 me gusta en 8 mensajes.

Grupo: User

Wrote

Wrote

Please see the file, the last page
minimal_model.sm (93,72 KiB) descargado 1223 vez(es).


My bad, you can use solve too in this example. Even with units as mentioned before.
Just check your roots range in Tools>Options>Calculation for other calculations.

Regards

2020-12-27_15-46.png



My roots range is -20 to +20

I don't know how to add units to the first parameter of the T1
because ' does not work there.

#9 Publicado: 27/12/2020 14:12:56
Aleksey_here

Aleksey_here

0 me gusta en 8 mensajes.

Grupo: User

Wrote

Wrote

Wrote

Please see the file, the last page
minimal_model.sm (93,72 KiB) descargado 1223 vez(es).


My bad, you can use solve too in this example. Even with units as mentioned before.
Just check your roots range in Tools>Options>Calculation for other calculations.

Regards

2020-12-27_15-46.png



My roots range is -20 to +20

I don't know how to add units to the first parameter of the T1
because ' does not work there.



I copied "25 m" to the first parameter,
then I replaced the number "25" with parameter "y",
as a result there was parameter with units like "y m"
and after that the "solve" started to work.

If I write "y" then press ' - I cannot add units.

#10 Publicado: 27/12/2020 18:28:47
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

In your case the FindRoot() function from the Nonlinear Solvers plugin seems to be appropriate.

It can handle variables with units and has embedded assignment (the solution is assigned to the variable. The solver requires an initial guess, which also tells the solver what unit to use. Another advantage of the solver is the precision control. In your case, the default precision seems to be a bit sloppy.

minimal_model_Kr.sm (94,18 KiB) descargado 1226 vez(es).
2020-12-27 22_21_11-SMath Studio - [minimal_model.sm_].png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#11 Publicado: 27/12/2020 19:52:16
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

...

I don't know how to add units to the first parameter of the T1
because ' does not work there.
...



Hi. For add units to a variable you need multiply it by the unit, this is what you need to write with the keyboard:

y.s:roots(T.1(γ*'m,19*'m)≡-0.0017*'J,γ)*'m
Wrote

...
...
I copied "25 m" to the first parameter,
then I replaced the number "25" with parameter "y",
as a result there was parameter with units like "y m"
and after that the "solve" started to work.

If I write "y" then press ' - I cannot add units.



You can add units to y.s writing y.s*'m. When you copy "25 m" the clipboard have just "25*'m".

For understand the behavior of solve with units, you can think in this way: solve don't handle units, but your T.1 do, so if solve try to evaluate T.1(γ,19*'m) returns an error because units don't match, the workaround is tell solve to call T.1(γ*'m,19*'m). This make solve to work, but the answer is unitless. Next, you can add the correct unit to the answer, which if there are nothing strange it must to be the same unit that you need to add to γ getting the correct expression for solve adding two 'm in the expression

y.s:roots(T.1(γ*'m,19*'m)≡-0.0017*'J,γ)*'m

This note is for answer your doubts about solve, not for recommend to use it. As overlod points, in your case could be better to use roots, which have the same issues than solve with units and the same workaround, or use FindRoots as mkraska shows using units in the guess values.

Best regards.
Alvaro.
#12 Publicado: 28/12/2020 5:18:07
Aleksey_here

Aleksey_here

0 me gusta en 8 mensajes.

Grupo: User

Wrote

For add units to a variable you need multiply it by the unit



Thank you, it would be good to write this here: Units
:-)
  • Nuevos mensajes
  • Sin mensajes nuevos