Algebraic expression ; substitution and simplification

Résolu
moraissilva Messages postés 14 Date d'inscription mardi 28 mars 2006 Statut Membre Dernière intervention 20 février 2014 - 17 janv. 2008 à 17:56
moraissilva Messages postés 14 Date d'inscription mardi 28 mars 2006 Statut Membre Dernière intervention 20 février 2014 - 17 janv. 2008 à 19:08
Hello
I need code VB6 to do work in algebraic expressions until 3 variables.
The user writes in the text box the following function f(x1,x2):
5x1^3 + (x1^2+x2^2)^2 + 3*x1*x2^2 - 2*x1*x2  and a guess: x1=1 and x2=2 (example).
I need to show the expressions of the partial derivatives and to compute their value in this guess.
I need code to get the expression simplified as  a  monovariable function of  "t"   after the substituion (example) x1=1+4t  and x2=2-3t.
After that I can go on with the computations (method Frank-Wolfe) to optimize nonlinear functions in convex spaces.
Of course I'm ready to pay the code.
Best regards
Morais Silva
www.moraissilva.com
antoniocmsilva@netcabo.pt

3 réponses

moraissilva Messages postés 14 Date d'inscription mardi 28 mars 2006 Statut Membre Dernière intervention 20 février 2014
17 janv. 2008 à 18:03
I fogot to say that I only need code to manipulate the expressions.
I already developed the code to the method Frank-Wolfe but it is necessary the user to write the function, the partial derivatives and the function linearized...
Morais Silva
3
cs_loulou69 Messages postés 672 Date d'inscription mercredi 22 janvier 2003 Statut Membre Dernière intervention 2 juin 2016 1
17 janv. 2008 à 18:29
Hello, you can do that to get the result:
Formula= "5x1^3 + (x1^2+x2^2)^2 + 3*x1*x2^2 - 2*x1*x2"
Formula= Replace(Formula,x1,"1")
Formula= Replace(Formula,x2,"2")
Result= Eval(Formula)
3
moraissilva Messages postés 14 Date d'inscription mardi 28 mars 2006 Statut Membre Dernière intervention 20 février 2014
17 janv. 2008 à 19:08
I need the computation bau in the partial derivatives...


Anyway thank you.


Best regards


Morais Silva
0
Rejoignez-nous