Sign in to follow this  
Followers 0
dantay9

[Solved] Math Help

7 posts in this topic

#1 ·  Posted (edited)

I am making a trinomial solver because I hate having to solve them and not knowing if they are even solvable. I have the equation split up and the necessary parts assigned to variables, but I don't know where to go from here. Can someone point me in the right direction. Thanks in advance.

Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites



I think most solvers use matrices to solve equations.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I know that solving systems of equations is easiest using matricies, but can you solve just one equation using matricies?

Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I know that solving systems of equations is easiest using matricies, but can you solve just one equation using matricies?

Assuming you have got the factors worked out correctly then I assume that for each factor the sign could be +ve or -ve, and for each pair of factors for the square term any of the other factors for the linear term might be the correct ones. So you can go through all possibilities.

Lets say the sign for the first square term factor is $a; the sign for the second square term factor is $b; the sign for the first linear term factor is $c and the second is $d.

Then we can do this

For $as = -1 To 1 Step 2;for either sign of the first square factor
     For $bs = -1 To 1 Step 2;etc
         For $cs = -1 To 1 Step 2
             For $ds = -1 To 1 Step 2
                 For $j = 0 To UBound($SquaredFactors) - 1
                     For $k = 0 To UBound($ConstantFactors) - 1
                         If ($as * $SquaredFactors[$j][0] + $cs * $ConstantFactors[$k[0]) * ($bs * $SquaredFactors[$j][1] + $ds * $ConstantFactors[$k[1]) = 0 Then
                           ;we have found an answer
                         EndIf
                       ;try with factors swapped
                         If ($as * $SquaredFactors[$j][0] + $cs * $ConstantFactors[$k[1]) * ($bs * $SquaredFactors[$j][1] + $ds * $ConstantFactors[$k[0]) = 0 Then
                            ;we have found an answer
                          EndIf
 
                     Next
                 Next
             Next
         Next
     Next
 Next

But this seems like a very complicated way to solve the problem and it's restricted to integer results, although I think your functions could be simplified. Why not use a more conventional approach?

EDIT: By conventional I mean

ANS = (-b +/-(b2 - $ac)1/2)/2a

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I decided to use this way because my plan was to factor the trinomial, not solve it. I don't want an exact answer. I want to know if it can be factored.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

I decided to use this way because my plan was to factor the trinomial, not solve it. I don't want an exact answer. I want to know if it can be factored.

OK, you can do it any way you want of course.

Anyway, was my suggestion any help?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Oh! I forgot to reply back. Yes, it was a lot of help. It worked great.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0