cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Math programming

CarlosRomero
14-Alexandrite

Math programming

Dear community,

I am carrying out the coding of the optimization task in Matlab, from the attached sheet, to the Mathcad language. But I am stuck at this point.

You can support me in this task.

Any help is appreciated in advance.

CarlosRomero

ACCEPTED SOLUTION

Accepted Solutions

Hi Carlos

Regarding the intlinprog() function, Mathcad can apply an optimization algorithm that has already been developed.

Yes it can, maximise and minimise function in a solve block should work.

I ask if with Mathcad you can't write a utility or function equivalent to Matlab's sparse function?

Sparse is a definition scheme of an array that utilizes storage schemes that only contain the non-zero entries in the array.  Any function that uses sparse arrays and/or matrix arithmetic using them must be written to do so.  I suggest you use Mathcad's dense matrix only that may limit the size of problem able to be solved.

Cheers

Terry

View solution in original post

6 REPLIES 6

xloc is a 20-element vector with elements numbered from 1 to 20 (because ORIGIN is set to 1).

You try to access an element with an index larger than 20 - hence the error.

Similar wih yloc, which is a 21.element vector.

xloc and yloc would both need to be 40-element vectors for that code to work OK

Werner_E_0-1701789209299.png

 

Hi Carlos

The matlab programming takes advantage of sparse matrices and the final intlinprog() function that is the heart of the example (last line of matlab code) both of which Prime 9.0 does not have.

Cheers

Terry

This is a similar problem? factories, warehouse, stores represented by ,Feeds, pools, and products.

https://community.ptc.com/t5/Mathcad/Pooling-problem-optimization/td-p/908732

Cheers

Terry

Hello Terry,

Regarding the intlinprog() function, Mathcad can apply an optimization algorithm that has already been developed.

I ask if with Mathcad you can't write a utility or function equivalent to Matlab's sparse function?

Your expertise in Mathcad, can help me.

Thanks.

CarlosRomero

Hi Carlos

Regarding the intlinprog() function, Mathcad can apply an optimization algorithm that has already been developed.

Yes it can, maximise and minimise function in a solve block should work.

I ask if with Mathcad you can't write a utility or function equivalent to Matlab's sparse function?

Sparse is a definition scheme of an array that utilizes storage schemes that only contain the non-zero entries in the array.  Any function that uses sparse arrays and/or matrix arithmetic using them must be written to do so.  I suggest you use Mathcad's dense matrix only that may limit the size of problem able to be solved.

Cheers

Terry

Hello guys,

Taking into account your advice, I have continued trying to carry out this programming. But it seems that I am stuck in the binary variable and this leads to restrictions.

Can someone help me out of this jam.

Thanks in advance.

CarlosRomero

Announcements

Top Tags