Rank: Advanced Member Groups: Registered
Joined: 24/10/2009(UTC) Posts: 52 Location: Denmark
|
How do I compare two formulas?
Like, if I simplify by hand, or solve for x by hand - and I'd like to check if I did it correctly. What I want to compare, are two equations...
For example: y = ax + b
And then compare to: x = (y - b ) / a
And have it reply with "True".
As compared to if I wrote x = (- y - b ) / - a
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Helo Mike, At the moment, for this kind of problem you have to use some CAS (Maxima maybe?) Code:
Solve over x
>:: sol1:=solve(y=a*x+b,x)
y - b
[x = -----]
a
Solved by hand
>:: sol2:=(-y-b)/a
- y - b
-------
a
Compared
>:: if(at(x,sol1)=sol2) then "true" else "false"
false
Compared
>:: if(at(x,sol1)=(y-b)/a) then "true" else "false"
true
Regards, Radovan Edited by user 03 May 2010 13:04:02(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 24/10/2009(UTC) Posts: 52 Location: Denmark
|
Ah, so it is not possible :P Thanks for reply
|
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, I was thinking in this direction, but unfortunately this is not so simple. Please see the examples. Wrong answer "true", it should be "false": Neither "true" nor "false". If statement needs the numerical result of the logical contidion. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello Andrey, Yes, I think you are right . We were thinking on the same thing at this very moment. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.