MaplePrimes Questions

Say I have an expression like

diff(f(x),x)*cos(f(x));

and I want to evaluate it where the function f(x)=0 (without a priori knowing f(x)). Since cos(0)=1, I expect the answer to be simply diff(f(x),x); in general this won't be identically zero. However, if I try

eval(%,f(x)=0);

it replaces f(x) with zero everywhere, including in the derivative (as expected from the documentation) and returns 0.

So, my question: is there a way to evaluate an expression at a known value of a function (f(x)=0) without knowing the function?

It seems using convert/D manages to solve it, but I imagine there's a better way to do this. I've tried using RootOf(f(x)), but can't seem to make that work.

I'm trying to make a comparison between simulation data from CST and calculations done in MAPLE - the best way to do so is have both plots on excel so the formatting matches. I can export the data from CST as a text file, but am stuck when it comes to getting the data from MAPLE (specifically trying to record kz, dispf, and dispbeamf all together in one text file).

My implicitplot code works (the code for it shown below). Both dispf and dispbeamf are functions of kz.
implicitplot([dispf, dispbeamf], kz = -150 .. 150, f3 = 0.18e11 .. 0.25e11, color = [red, blue], numpoints = 5000)

Any advice would be greatly appreciated.

Hello,

I want to adjust values in a matrix. In the example matrix you will find some measurement errors (values around -4000 or 1). But these are definitely measurement errors. Is there any possibility to adjust these values to the surrounding values (~1500)...like in an interpolation. Can someone help me how I can do this with maple?

Ps.: the matrix is exported from maple into .xls

Matrix:
O233.xlsx

Thank you very much!

Dear users! 

Hope everyone fine with everything. I want to chage the format of x-axis in the attached file. I need the x-axis in degree like (-180^o, -120^o, -60^o, 0 , 60^o, 120^o, 180^o). Also I want the lable on y-axis as:

I am waiting your positive respons. 

Help_new.mw

If I try to use unapply on a composition of functions, I seem to get the result in one of two forms:

unapply(f(g(x)),x);
# Result: f@(x -> g(x))
unapply(2*f(g(x)),x);
# Result: x -> 2 f(g(x))

I need the second form (without the @ composition operator): is there any way to instruct Maple to output the first result without the @ sign? Or is there some way to convert the first form to the second form (i.e. x -> f(g(x)))?

Thanks!

I would love to produce a fixed double cone but a movable plane so I could illustrate the various kinds of conic sections which are the intersection of the cone with the plane.  I would think this has been done, but I can't find and haven't been able to make much progress myself.  .......Edgar

 

I have installed in my UBUNTU 16.04 system matlab 2018a already, I have recently acquired maple 2017.3 (through my university).

Now while trying to install maple in my computer I am at the matlab configuration option, I picked the directory where the matlab installation is situated at, and I get the following error: The directory /home/alon/MATLAB/R2018a/bin/matlab is not writable by the current user

I searched google for this occurrence of error, and found the following suggestion: https://askubuntu.com/questions/265381/how-to-make-a-directory-permanently-writable

the first answer suggests to write in the terminal the following line: sudo chmod 775 /home/alon/MATLAB/R2018a/bin/matlab

which I did but I still get after executing this line in the terminal the above error; what else can I do to fix this problem?

Thanks.

Hi everyone.

I am trying to build a package in Maple out of a bunch of procedures that I have. To create the procedures, I write them on a Vim editor, than copy and paste into the Maple worksheet to test. In this way, it works (I end the procedure with ; and then I see all the text in blue and I afterwords test it).

I then gathered these procedures to a module, option package, and I do the same: edit on Vim, copy paste it to Maple worksheet and press enter to see a blue message "module() ... end module" in blue, and then I start playing.

However, I decided to add some more procedures to the module that was working. I have a new procedure that works (meaning when I copy to the worksheet it gives the blue text and I can call normally), but when I copy the contents of this new procedure inside the package, with all the others, and I copy everything to the worksheet, the package now fails to work. It gives a message "Error," in pink, no more text, and that is it. Does this sort of error sound familiar to anyone? Thanks in Advance,

Marcelo

I wanted to make a 3d plot with lines linking points, but I am struggling with it
(I couldn't find anything in the plot3d documentation, so it might not be supported, which would be odd as its such a normal thing to want to do)

I have tried with no success:

plot3d([1, 2, 3], [4, 5, 6]);
plot3d(Matrix(2, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 4, (2, 2) = 5, (2, 3) = 6}))

Any thoughts?

i have two functions , first naive function has error after used.
 
if run FromMatlab, does it mean that do not need to copy the result and run again because it had already run?
as i do not understand the output code after translated.
 
there is syntax error when translate second function
 
with(Matlab):
FromMatlab("function X = sylv_naive(A,B,Q)
% X=SYLV_NAIVE(A,B,Q) solves the Sylvester equation AX + XB = Q
%    A, B, Q: matrix coefficients
%    X : solution of AX + XB = Q
[m,n] = size(Q);
H = kron(eye(n), A) + kron(B.', eye(m));
Qvec = reshape(Q,m*n,1);
Xvec = H\Qvec;
X = reshape(Xvec,m,n);
");
sylv_naive(Jesus7,Jesus7,Matrix([[0,0],[0,0]]));
sylv_naive(Jesus7,Jesus7,Matrix([[0],[0]]));
Error, (in ArrayTools:-Reshape) the desired output contains a different number of elements than the input
 
 
 
with(Matlab):
FromMatlab("function X = sylvester(A,B,Q)
% X=SYLVESTER(A,B,Q) solves the Sylvester equation AX + XB = Q
% by using the Bartels and Stewart algorithm based on the complex
% Schur decomposition
%    A, B, Q: matrix coefficients
%    X : solution of AX + XB = Q
[m,n] = size(Q);
[U,A1] = schur(A,'complex');
[V,B1] = schur(B.','complex');
Q1 = U'*Q*conj(V);
X = zeros(m,n);
X(:,n) = (A1 + B1(n,n)*eye(m))\Q1(:,n);
for i = n-1:-1:1
    v = Q1(:,i) - X(:,i+1:n)*B1(i,i+1:n).';
    X(:,i) = (A1 + B1(i,i)*eye(m))\v;
end
X = U*X*V.';");

Error, (in Matlab:-FromMatlab) on line 15, syntax error
    X(:,i) = (A1 + B1(i,i)*eye(m))
 
 

I wrote this simple set of instructions  (Maple 2015 and Maple 2016)

restart:
p := x -> sum('a__||k' * x^k, k=0..5):
p(x);    # returns a0+ a1x +  ... + a5x5

p(1);   # returns a0+ ... + a5

p(0);   # returns 0 ...  not a0


Probably so huge a mistake that I can't see it !?!?!?

Could you please help me to fit it ?

TIA

LettR_curvefitting.mws

Am in the process of trying to addsome animation to a 2D letter R, namely to make the 'stalk' move.  I lost the output and managed to retrieve it by adding  verboseproc=0, and printlevel:=5.  However printlevel:=5 gives an excessive amount of output and anything less than 5 doesn't give enough output.  The code is messy asI've been experimenting with general curve fitting.

   Any help gratefully received. 

I have a problem with writing this equation in maple.

the equation is: 

I want to write this equation in maple, so I write it in this way:

for k from 1 to 7 do tau[k] := add*(d(k, j)*(diff(theta[j](t), t, t)), j = 1 .. 7)+add(add(c[i, j, k]*(diff(theta[i](t), t))*(diff(theta[j](t), t)), j = 1 .. 7), i = 1 .. 7)+phi[k] end do:

but I see this error: Error, index out of bounds 

I appriciate if you help me find the problem.

Why is assume(...) do_something();  gives an error when I run the code one more time, but do_something() assuming ...; do not give an error when everything else is the same?

Is there semantic difference between the two forms? I thought they should work the same way. Here is an example

#in separate cell
restart;

#in separate cell
interface(showassumed=0):
pde := diff(u(x, t), t)=k*diff(u(x, t), x$2):
ic:=u(x,0)=0: bc:=u(0,t)=t:
assume(x>0);assume(t>0);assume(k>0):
sol:= pdsolve({pde,ic,bc},u(x,t)):

#in separate cell. Now this gives error
interface(showassumed=0):
pde := diff(u(x, t), t)=k*diff(u(x, t), x$2):
ic:=u(x,0)=0: bc:=u(0,t)=t:
assume(x>0);assume(t>0);assume(k>0):
sol:= pdsolve({pde,ic,bc},u(x,t)):
#error message now

Here is screen shot

Now will do the same, but use assuming. Now there is no error

#in one cell
restart;

#in one cell
interface(showassumed=0):
pde := diff(u(x, t), t)=k*diff(u(x, t), x$2):
ic:=u(x,0)=0: bc:=u(0,t)=t:
sol:= pdsolve({pde,ic,bc},u(x,t)) assuming x>0,t>0,k>0:

#in one cell, no error
interface(showassumed=0):
pde := diff(u(x, t), t)=k*diff(u(x, t), x$2):
ic:=u(x,0)=0: bc:=u(0,t)=t:
sol:= pdsolve({pde,ic,bc},u(x,t)) assuming x>0,t>0,k>0:

Here is screen shot

Why does one give an error, but the second one does not?

I thought they work the same way. Which method is recommended to use?

assume(...); do_something(); 

or 

do_something() assuming ...;

Maple 2018 on windows.

equ.pdf The equation is in the following form:

 

First 835 836 837 838 839 840 841 Last Page 837 of 2415