SOLVED:Why does solve give no solution on my PC but it does when running exact same script on different PC?
1 view (last 30 days)
Show older comments
Hi, I've got a problem with the solve function. I'm trying to solve the following equations:
equ1 := sqrt(abs(100-100*nx^2/(nz^2+ny^2+nx^2))^2+10000*abs(nx*ny/(nz^2+ny^2+nx^2))^2+10000*abs(nx*nz/(nz^2+ny^2+nx^2))^2)-86.6
equ2 := sqrt(abs(-150+(50*(2*ny+3*nx))*nx/(nz^2+ny^2+nx^2))^2+abs(100-(50*(2*ny+3*nx))*ny/(nz^2+ny^2+nx^2))^2+2500*abs((2*ny+3*nx)*nz/(nz^2+ny^2+nx^2))^2)-179.44
I want to solve them for the variables nx and ny, leaving nz as a symbolic variable using:
S = solve(equ1, equ2, nx, ny)
I know that a numeric solution exists because I've managed to get it in Maple and I've also verified that Maple gives the correct solution. The interesting thing is, that when I give the exact same script to my boss at university and he runs it with his 2010a release, everything works. I've already tried it with 2011a, 2010a and 2010b but everytime I get the error:
Warning: Explicit solution could not be found. > In solve at 81 In Pos_ueber_Ebenen at 42
S =
[ empty sym ]
I'm using the student version, might that be the problem?
Thank you for your help!
Best wishes Tobias
0 Comments
Answers (2)
Walter Roberson
on 4 Aug 2011
You are probably using a version that still used Maple as its symbolic engine. The versions your boss is running use MuPad as their symbolic engine, and it can be significantly more difficult to get MuPad to solve some equations.
If you can get Maple to solve for a sufficiently general form, and if you have a sufficiently recent Maple, you can use CodeGeneration[Matlab] to have Maple convert the Maple expressions in to MATLAB code (though that Maple facility could use improvements to be sure.)
1 Comment
Walter Roberson
on 4 Aug 2011
Note: if your Maple does not support the CodeGeneration package, it probably supports the older codegen that is at least able to translate in to C. You could then mex-ify the C if it seemed worthwhile.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!