Can't get"Solve" function to work - Сообщения
I am new to SMath and still learning. I had two unknown with two equations and was trying to solve them simultaneously but unfortunately SMath does not have the "solve block" option as in MathCad (if there is a way please let me know).
so I consolidate the two equations into one quadratic equation with one unknown, and tried to use the "solve" function to get the roots of the equation but it says that there is no real roots while it has!! so what i am doing wrong?!
please help!!
Файл не найден.Файл не найден.
You have the problem with inconsistent units. Either get rid of them or add unit 'm to argument w in calling solve(Eq3(w*'m)=0,w). You will get two results (0.2162, 1.4238).
Reards,
Radovan
FindRoot() requires initial guesses, to be given with correct dimension (unit)
Solve() does not need initial guesses but leaves you with the chance or problem to select the correct solution.
BTW, why did you re-define MPa and kN? These are available in the units selector dialog. Also, mPa is confusing as it would read as Millipascal.
Solve_kr.sm (100 КиБ) скачан 104 раз(а).
Radovan, I tried what you said and did not work, can you kindly send the file, and for your information, if you have not changed my numbers then the answer should not be what you mentioned, so the units thing must mess with the results!! Also I want to understand why the units are inconsistent? units between what exactly? Eq(w) has an area unit because (W) is squared.
Also Martin thanks for the file, it seems the Maxima plugin can't open on my computer for some reason. I am running on windows 10 which i am not sure it is incompatible with it or not. I searched and found that you posted a portable version of SMath that works with Maxima but the website would not open "https://extmoodle.th-brandenburg.de/course/view.php?id=34"
Also, is there an English version of the manual you created in SMath? it looks great but I don't know German unfortunately
Thanks again, really appreciate it.
Wrote
Also Martin thanks for the file, it seems the Maxima plugin can't open on my computer for some reason. I am running on windows 10 which i am not sure it is incompatible with it or not.
I searched and found that you posted a portable version of SMath that works with Maxima but the website would not open "https://extmoodle.th-brandenburg.de/course/view.php?id=34"
Also, is there an English version of the manual you created in SMath? it looks great but I don't know German unfortunately
The maxima plugin doesn't work with Win10. You can still open the file and ignore the maxima stuff. I corrected the units in the definitions of the parameters. FindRoot should do the job anyways.
In the extension manager (Tools> Plug-ins) go to the Interactive books tab. In the online gallery you find a bilingual english/german handbook. If you set this as default you can open the book using the [?] button of the toolbar.
WroteRadovan, I tried what you said and did not work, can you kindly send the file, and for your information, if you have not changed my numbers then the answer should not be what you mentioned, so the units thing must mess with the results!! Also I want to understand why the units are inconsistent? units between what exactly? Eq(w) has an area unit because (W) is squared.
Here is the corrected file Solve_corr.sm (101 КиБ) скачан 102 раз(а).,
The results were different from Martin's solution because of h.c in the equation Eq.3(w) (there was h mistakenly instead of h.c).
I hope that you figured out why the units are not consistent if you put only w without unit length. Actually, you have to give w the unit, not use it without it. Then the equation will be right. In the Eq.3(w) unit of w must be unit length in order the equation to be in units length squared (unit consistent).
Regards,
Radovan
P.S. Davide's FindRoout() uses the algorithm which solves the nonlinear equation giving only one solution (requiring an initial value) while solve() uses search algorithm in the given range (range can be change as third and fourth parameter)
WroteThanks again Martin, may I ask why the findroot function gives only one solution? And on what bases it chooses which root for the result.
As Radovan said, if multiple solutions exist, the result depends on the initial guess, where the algorithm starts. The range of initial values leading to a particular solution can be quite different and is depending on the particular shape of the function and the algorithm in use. If you use NewtonRaphson instead of FindRoot, you get the same results but with different ranges of convergence.
With FindRoot, you need initial guesses quite close to the second solution in order to actually get it. That's why symbolic solutions are preferrable if available.
So it seems that I have an issue with my SMath version, when I opened your file Radovan, it was not able to calculate the Solve function as it happened with me (see attached). is that because I am running with Windows 10?
Also Martin, Can you send another link to the SMath Poratble version?, because your link in you signature does not work.
Thanks alot.
Wrote
Also Martin, Can you send another link to the SMath Poratble version?, because your link in you signature does not work.
Thanks alot.
I need to ask our IT guys what happened to the Moodle system. I hope to get this fixed tomorrow.
Wrote
So it seems that I have an issue with my SMath version, when I opened your file Radovan, it was not able to calculate the Solve function as it happened with me (see attached). is that because I am running with Windows 10?
I do not think so (I was using Win10 for your file as well). As far as I know, the problem with solve() when it reported "No real roots" is usually with the search range for roots. It can be set globally in Tools->Options->Calculation->Roots(range) or locally with third and fourth argument. I think in you case it might be zero and one like solve( , ,0,1). By the way, you can also use roots() function for the numerical roots or (as Marting suggested) the symbolical solution. Besides Maxima you have maple plugin as well.
Regards,
Radovan
-
Новые сообщения
-
Нет новых сообщений