Author |
Topic |
|
aplotnikov
Germany
165 Posts |
Posted - 07/11/2022 : 11:25:42 AM
|
Hello,
I would like to solve a nonlinear equation like x=asin(1/(a+b*x)) for different sets of parameters (a,b). I can do it easily in R - the solution exists always for all the reasonable combinations of parameters, but I need a solution in Origin implemented as OriginC function without any connection to R.
There are several NAG functions suited for this purpose, but I didn't find any example of a call with user-defined coefficients, etc.
I guess, I need to use NAG_comm structure for this purpose. An illustrative example I would appreciate.
PS. I haven't succeed to solve this equation using EquationSolver.opx. Is it possible at all?
Thanks in advance. |
Edited by - aplotnikov on 07/11/2022 11:27:43 AM |
|
Echo_Chu
China
Posts |
Posted - 07/13/2022 : 01:34:47 AM
|
It looks there is no problem to solve your equation with Equation Solver . Please look at the image below as an example. In the example I set a = 1 and b=2. You can set a and b to any other set of value as you needs.
Echo OriginLab Technical Support |
|
|
aplotnikov
Germany
165 Posts |
Posted - 07/13/2022 : 04:18:49 AM
|
Hi Echo,
Thanks for a helpful hint! However I need to solve the equation for hundreds points. Thus, a more convenient solution using NAG function is still necessary. The C-code of the EquationSolver.opx may be very illustrative.
Regards,
Alexei |
|
|
Castiel
343 Posts |
Posted - 07/13/2022 : 10:30:22 AM
|
quote: Originally posted by aplotnikov
Hello,
I would like to solve a nonlinear equation like x=asin(1/(a+b*x)) for different sets of parameters (a,b). I can do it easily in R - the solution exists always for all the reasonable combinations of parameters, but I need a solution in Origin implemented as OriginC function without any connection to R.
There are several NAG functions suited for this purpose, but I didn't find any example of a call with user-defined coefficients, etc.
I guess, I need to use NAG_comm structure for this purpose. An illustrative example I would appreciate.
PS. I haven't succeed to solve this equation using EquationSolver.opx. Is it possible at all?
Thanks in advance.
https://www.nag.com/numeric/cl/nagdoc_cl26/html/c05/c05qbc.html You can find an example from the above link.
------------------------------------------
Be The Change
You Want To See
In The World
------------------------------------------
|
|
|
aplotnikov
Germany
165 Posts |
Posted - 07/14/2022 : 08:08:18 AM
|
Hi Castiel,
Thanks for reply!
I read this description already - I always try to RTFM first. :) unfortunately this description contains neither the answer on my question nor any relevant example.
Regards,
Alexei |
|
|
YimingChen
1623 Posts |
Posted - 07/14/2022 : 10:31:35 AM
|
Here is a simplified version of the Equation Solver app using the same nag function. To check the source code, you can go to the Code Builder window (press Alt + 4 in Origin workspace). In the Workspace panel on the left, right-click on the Apps folder and choose Add Existing Folder.... Then add the NonlinearSolver folder. Then you should be able to check the source code. Hope it helps.
https://my.originlab.com/ftp/forum_and_kbase/Images/NonlinearSolver.zip
James |
Edited by - YimingChen on 07/14/2022 10:32:49 AM |
|
|
Castiel
343 Posts |
Posted - 07/14/2022 : 10:48:34 AM
|
quote: Originally posted by aplotnikov
Hi Castiel,
Thanks for reply!
I read this description already - I always try to RTFM first. :) unfortunately this description contains neither the answer on my question nor any relevant example.
Regards,
Alexei
It does have an example. See 10.1 from that very webpage.
10.1 Program Text Program Text (c05qbce.c)
10.2 Program Data None. 10.3 Program Results Program Results (c05qbce.r)
------------------------------------------
Be The Change
You Want To See
In The World
------------------------------------------
|
|
|
aplotnikov
Germany
165 Posts |
Posted - 07/14/2022 : 11:18:17 AM
|
There is a difference between an example and a relevant example. I am trying to understand, how exactly I can transfer coefficients (not the x-values!) into the function fcn(). There is noting on this topic in the description you are referring to. |
|
|
|
Topic |
|