Timeline for Can I improve this sloppy code used with Manipulate?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 11, 2016 at 13:22 | history | edited | Alejandro Marcos Aragon | CC BY-SA 3.0 |
added 3914 characters in body
|
May 10, 2016 at 21:24 | answer | added | Jack LaVigne | timeline score: 2 | |
May 10, 2016 at 21:01 | comment | added | Jack LaVigne |
You have made some progress, but actually we were talking about getting the full solution for wi and wj outside of the Manipulate . See the answer below.
|
|
May 10, 2016 at 16:47 | comment | added | Alejandro Marcos Aragon |
Alright I followed what you suggested (except the Dynamic part which I think it will be quite tough). Is this what you have in mind?
|
|
May 10, 2016 at 16:45 | history | edited | Alejandro Marcos Aragon | CC BY-SA 3.0 |
added 4570 characters in body
|
May 10, 2016 at 15:47 | comment | added | Jack LaVigne |
You have an a , b and uppercase P1, P2, P3, L1 and L2 defined that are not present in the code. They can be removed. Take all of the Solve code outside of this manipulate and solve them once symbolically for wi and wj in terms of your points. That will reduce the work inside of the Manipulate . Constraining the Locators is more work. I think you have to use Dynamic and apply the constraint as shown here
|
|
May 10, 2016 at 15:43 | comment | added | MarcoB |
For instance, you could start by removing the FullSimplify ; they are typically slow, and mostly not necessary if you are going to do further calculations on the results anyway. After that, I'd suggest that you consider solving the involved equations symbolically once and for all, and saving the solutions to variables / functions outside the manipulate, so you avoid recalculation.
|
|
May 10, 2016 at 12:41 | history | asked | Alejandro Marcos Aragon | CC BY-SA 3.0 |