Rariusz

30 Reputation

4 Badges

10 years, 355 days

MaplePrimes Activity


These are questions asked by Rariusz

Hello,

For example, let's say we have the following function

 

Now if we want to calculate the value of a function we have to

subs([x1=10,x2=20],eval(hf));

My question is the following: How to substitute values for x1 and x2 using values from vector? something like that

x:=[10,20];

subs([x],eval(hf));

 

Best,

Rariusz

 

Hello,

I have two simple module's:

1) ------------------------------------------------------------------------

Point := proc(xx::float,yy::float)
    return module()
        local x := xx,y := yy;
        export ShowPoint,GetX,GetY;
        
        ShowPoint := proc()
            printf("Point X,Y -> [%f,%f]",x,y);
        end proc;

        GetX := proc()
            return x;
        end proc;        
        GetY := proc()
            return y;
        end proc;    
    end module:
end proc:

2) ------------------------------------------------------------------------

PointMath := module()
    option package;  
    export `+`;
    
    `+` := proc(a::Point(float,float),b::Point(float,float))
        option overload;
        Point(a:-GetX()+b:-GetX(),a:-GetY()+b:-GetY());
    end proc;
end module:

------------------------------------------------------------------------

Next I use first module:

p1:=Point(1.2,1.4);

p2:=Point(1.0,2.0);

Finally I want to add above two points:

with(PointMath)

p2:=p1+p2

The results is:

p2:=p1+p2

Why is not called operator '+' and two points are not added?

Best,

Rariusz

 

 

 

Hi All,

I have problem how to formulate optimization problem with additional parameters.
For example let objective function is as follow:

ObjF:=proc(x,Delta)
    return sin(x) + cos(x) + Delta;
end proc;

In Matlab we can formulate the following optimization problem:

Delta = 10;
f=@(x)ObjF(x,Delta);
options = optimset('Algorithm','interior-point');
x = fmincon(f,0.1,[1;2],[],[],[],[],[],[],options);

where:

function y = ObjF(x,Delta)
    y = sin(x) + cos(x) + Delta;
end

In above example I can pass additional parameters (Delta) to objective function an then I can start optimization
to find solution. How to define above problem in Maple ? How to pass additional  parameters  befor we starat the optymalization?


Best,

Rariusz

Hello,

 

I'm modeling the simple DC motor system in Maple.
The equations describing the system;

eq1:=J*diff(theta(t),t,t)+b*diff(theta(t),t)=K*i(t):
eq2:=L*diff(i(t),t)+R*i(t)=V(t)-K*diff(theta(t),t):
DCMotor:=[eq1,eq2];

First, I create the system using DiffEquation:

Sys:=DiffEquation(DCMotor,[V(t)],[theta(t)]);

And now I have problem. The input var is V(t) (input voltage) and the output var is theta(t) (position of the rotor).

But I wont to have in output var not position of the rotor but speed of the fotor - diff(theta(t),t)

How to set output var for diff(theta(t),t) (the speed of the motor)?

 

Best

Rariusz

 

Hi,


Is it possible to solve linear matrix inequality in Maple?
For example, using Matlab and yalmip we can easily
solve Lyapunov equation
  
    A'P + P * A <0, P> 0

Is it possible to solve this equation in the Maple?


Regards,

 

1 2 3 Page 2 of 3