David1

65 Reputation

4 Badges

7 years, 64 days

MaplePrimes Activity


These are questions asked by David1

Hi,

I'm trying to use "Matlab()" command to convert Maple expression into Matlab's expression.

but for some reason it doesn't work.

it works for simple expressions but not this one. It is just a long expression with only some symbols, and the most basic math operations. I don't see why it fails.

It says: "Error, (in Translate) options... not recognized"

I'm attaching the maple code so you can see the error.  

The reason I'm using it is because Matlab could not solve the equation in the file (even numerically). So I wrote the same equation symbolically in Maple so I can copy the symbolic solutions to matlab and use them instead of matlab's 'solve' command.

Hope anyone can help with it.

Here's the code attached:

calc_theta.mw

Hi all,

Anyone knows how to see a manual for DirectSearch:-GlobalSearch that explains what is done inside the function?

I tried to write "help(DirectSearch:-GlobalSearch)" and nothing. It opened an empty page written (no matches found). Is there any help for this function so I can know what's going on there?

More specifically, I'm trying solve the optimization probelm min(||Ax-b||_p) s.t. ||x||=1.

where A is a given matrix of size (n \times d)

b is a given vector of size (n \times 1)

p>0 is a scalar

and x is an unkown vector of size (d \times 1) that should be a unit vector.

I used DirectSearch:-GlobalSearch to solve this optimization problem. But since it's a non-convex optimization probelm, the function doesn't always return the optimal value. I want to read the manual of the function to understand what is done there and for which cases there are most chances that the function will not return the optimal value.

Thanks

Hi all,

I wanted to know if there's a tool in Maple for solving (globally) non convex optimization problems?

specifically, I need to solve the following problem:

min||Ax-b||_1 s.t. ||x||_2=1

where A is a given matrix of size nxd

b is a given vector of size nx1

x is an unkown vector of size dx1 that should be a unit vector (hence the contraint ||x||_2=1).

The closest function I found in Maple is LSSolve but this function is intended for convex problems.

I'm able to solve the problem using Yalmip in matlab.

Here's an example code in matlab+yalmip that finds the unit vector x that globally minimizes ||Ax-b||_1.

clear;
close all;
clc;

n = 10;
d = 3;

A = rand(n,d);
b = rand(n,1);
x = sdpvar(d,1);

Objective = norm(A*x-b,1);
cons = x'*x==1;
options = sdpsettings('solver','bmibnb');
sol= optimize(cons,Objective, options);

x_sol = value(x)

 

Is there a way to write a similar code in Maple?

 

Thanks

 

I updated a few days ago my Maple's version to 2018 (instead of 2017).

Unfortunatelly, since then I couldn't run Matlab code that uses Maple's engine (it worked fine before the update). I can't run any code that uses symbols.

I tried to follow this link:

https://www.maplesoft.com/support/downloads/mtm1102_installation.aspx

but I don't see the file "MapleToolboxforMATLABUpgrade_Windows.exe" anywhere.

Can anyone suggest what I can do to make it work?

I have Maple 2018 and Matlab 2017 if it matters.

Thanks

I'm trying to solve a very simple trigonometric equation but for some reason Maple shows me only a single solution where there are more than one.

For example in this code:

restart;

f:=sin(x);

solve(f,x);

Maple returns x=0. eventhough there's another solution x=180 (or pi).

Anyone knows how to force Maple to return all the solutions?

 

Thanks

1 2 Page 1 of 2