MaplePrimes Questions

I am having some issues trying to convert this matlap code into Maple code, can somebody help me out?

% Solve v'(t)=-0.0207v(t)^2-893.58 with y0=0
clc;
y0 = 0;                  % Initial Condition
h = 0.1;                 % Time step
t = 0:h:5;               % t goes from 0 to 5 seconds.
vstar = zeros(size(t)); % Preallocate array (good coding practice)
vstar(1) = y0;           % Initial condition gives solution at t=0.
for i=1:(length(t)-1)
    k1 = 0.0207*vstar(i)^2-893.58; % Previous approx for y gives approx for derivative
    vstar(i+1) = vstar(i) + k1*h; % Approximate solution for next value of y
end
figure(1)
plot(t,vstar);
y0 = 0;                  % Initial Condition
h = 0.05;                 % Time step
t = 0:h:5;               % t goes from 0 to 5 seconds.
vstar = zeros(size(t)); % Preallocate array (good coding practice)
vstar(1) = y0;           % Initial condition gives solution at t=0.
for i=1:(length(t)-1)
    k1 = 0.0207*vstar(i)^2-893.58; % Previous approx for y gives approx for derivative
    vstar(i+1) = vstar(i) + k1*h; % Approximate solution for next value of y
end
figure(2)
plot(t,vstar);

Hello,

I have a Maple package which is a .mla file.

How can I open it to have access to the source code ?

I would like to open it in order to modify a procedure and to use it indepently of the package.

Thanks a lot for your help.

whenever i use maplesoft, i`m wondering about the instruction which is to show me the explanation about answers.

Maplesofte must be worked by some principles , therefore it can show the explanation of any answers to users

please let me know what is the instruction that i can watch explanations.

 

for example /

> int(f(x)*g(x),x);

sin(x) - x cos(x) - 1/2 cos(x) sin(x) + 1/2 x

 how can it get an answer, i wanna see that

Hi, I am completely new to Maple, and I need to use it to optimize my equations in order to make my PLC codes more compressed. I am calculating forward kinematics with the Denavit-Hartenberg method and as such I get long expressions. After a lot of google'ing and frustration, I thought I'd ask here in the hope that one of you might be able to assist me.

I have the following equations;

X := L10*cos(q5) - L16*(sin(q10)*(sin(q5)*sin(q8) - cos(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) - cos(q10)*(sin(q9)*(cos(q8)*sin(q5) + sin(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) + cos(q9)*(cos(q5)*cos(q6)*sin(q7) + cos(q5)*cos(q7)*sin(q6)))) - d2*(cos(q10)*(sin(q5)*sin(q8) - cos(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) + sin(q10)*(sin(q9)*(cos(q8)*sin(q5) + sin(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) + cos(q9)*(cos(q5)*cos(q6)*sin(q7) + cos(q5)*cos(q7)*sin(q6)))) + L15*(sin(q9)*(cos(q8)*sin(q5) + sin(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) + cos(q9)*(cos(q5)*cos(q6)*sin(q7) + cos(q5)*cos(q7)*sin(q6))) - L11*cos(q5)*sin(q6) + d1*cos(q5)*cos(q6) - L13*sin(q5)*sin(q8) + L14*cos(q9)*(cos(q8)*sin(q5) + sin(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7))) + L13*cos(q8)*(cos(q5)*cos(q6)*cos(q7) - cos(q5)*sin(q6)*sin(q7)) - L14*sin(q9)*(cos(q5)*cos(q6)*sin(q7) + cos(q5)*cos(q7)*sin(q6)) + L12*cos(q5)*cos(q6)*cos(q7) - L12*cos(q5)*sin(q6)*sin(q7);

Y := L10*sin(q5) - L9 + L16*(sin(q10)*(cos(q5)*sin(q8) - cos(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) - cos(q10)*(sin(q9)*(cos(q5)*cos(q8) + sin(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) - cos(q9)*(cos(q6)*sin(q5)*sin(q7) + cos(q7)*sin(q5)*sin(q6)))) + d2*(cos(q10)*(cos(q5)*sin(q8) - cos(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) + sin(q10)*(sin(q9)*(cos(q5)*cos(q8) + sin(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) - cos(q9)*(cos(q6)*sin(q5)*sin(q7) + cos(q7)*sin(q5)*sin(q6)))) - L15*(sin(q9)*(cos(q5)*cos(q8) + sin(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) - cos(q9)*(cos(q6)*sin(q5)*sin(q7) + cos(q7)*sin(q5)*sin(q6))) + L13*cos(q5)*sin(q8) - L11*sin(q5)*sin(q6) + d1*cos(q6)*sin(q5) - L14*cos(q9)*(cos(q5)*cos(q8) + sin(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5))) - L13*cos(q8)*(sin(q5)*sin(q6)*sin(q7) - cos(q6)*cos(q7)*sin(q5)) - L14*sin(q9)*(cos(q6)*sin(q5)*sin(q7) + cos(q7)*sin(q5)*sin(q6)) + L12*cos(q6)*cos(q7)*sin(q5) - L12*sin(q5)*sin(q6)*sin(q7);

Z := L15*(cos(q9)*(cos(q6)*cos(q7) - sin(q6)*sin(q7)) - sin(q8)*sin(q9)*(cos(q6)*sin(q7) + cos(q7)*sin(q6))) - L11*cos(q6) - L8 - d1*sin(q6) + L16*(cos(q10)*(cos(q9)*(cos(q6)*cos(q7) - sin(q6)*sin(q7)) - sin(q8)*sin(q9)*(cos(q6)*sin(q7) + cos(q7)*sin(q6))) - cos(q8)*sin(q10)*(cos(q6)*sin(q7) + cos(q7)*sin(q6))) - d2*(sin(q10)*(cos(q9)*(cos(q6)*cos(q7) - sin(q6)*sin(q7)) - sin(q8)*sin(q9)*(cos(q6)*sin(q7) + cos(q7)*sin(q6))) + cos(q8)*cos(q10)*(cos(q6)*sin(q7) + cos(q7)*sin(q6))) - L13*cos(q8)*(cos(q6)*sin(q7) + cos(q7)*sin(q6)) - L14*sin(q9)*(cos(q6)*cos(q7) - sin(q6)*sin(q7)) - L12*cos(q6)*sin(q7) - L12*cos(q7)*sin(q6) - L14*cos(q9)*sin(q8)*(cos(q6)*sin(q7) + cos(q7)*sin(q6));

 

I need to optimize these equations, but still keep them separate. I would like to use mutual expressions for the calculations within, but still as I said keep the outputs of X, Y and Z separate.

This is MATLAB code.

 

Thanks in advance for any help.

If you have several results, e.g. one being real, the others complex. How can you choose?


G := 6.673*10^(-11):

M := 1.9891*10^30:

AU := 1.4959787066*10^11:

v := proc (R) options operator, arrow; 2332800000/(Pi*(R^3*AU^3/(G*M))^.5) end proc;

proc (R) options operator, arrow; 2332800000/(Pi*(R^3*AU^3/(G*M))^.5) end proc

(1)

a := solve(.601 = 60*(360*60)/(2*Pi*((R*AU)^3/(G*M))^.5)*3600, R);

39.26171595, -19.63085797+34.00164341*I, -19.63085797-34.00164341*I

(2)

op(1, a)

Error, invalid input: op expects 1 or 2 arguments, but received 4

 

``


Download Worksheet_CaseStudy.mw

How to simulate a data which is follow by binomial distribution, n=200, p=0.9.

I know normal can be simulated by following code

random[normald[0, 1]](50)

How can I do if I wanted to simulate a class of 30 students rolling a dice 10 times, and you wished to count the number of 3's you observe for each student?

Hi

I have problem to plot(2D)  some equations that have 3 variables (to obtain one diagram with some curve ).

like this equation

ln(2*s*t+2*s*x*sqrt(t)/sqrt(pi)+x^2)-2*s*(arctan((s+x*sqrt(pi/t))/sqrt(2*pi*s-s^2))-(1/2)*pi)/sqrt(2*pi*s-s^2) = 0

I should plot x v.s t for s=0.01,0.005,0.003,0.002

please  help me to understand how can plot like these equation.

thanks

to compute a maple program using the paper posted in the reply 

Hello again,

for a paper I need to cipher and decipher with the standard RSA-procedure.
My problem is, that my numbers are really large.

As normally it's just, given a public key (e,N) and a private key (d,p,q), p,q are primes, and the plaintext:

encrypt: b^e mod N = c

decrypt: c^d mod N = b

That works cause ed = 1 mod (p-1)(q-1) (Euler's Phi-Function) and gcd(e,N)=1

 

With little numbers thats no problem. But increasing e and N, i thought using the powmod function will help:

b&^e mod N = c but

c&^d mod N <> b.

So it doesnt work anymore and I really dont get why...

 

thanks for help, I'm really lost here..

  Solving trigonometry Equations  sin^2(2x)-cos^2(8x)=0.5cos(10x)

Hello,

I have a question. I have to compare the times and steps taken by an algorithmus (which contents a loop).

So for time there is the time()-function, right? And is there any similar function for the steps taken?

So far i use a variable increasing by 1 each time, but i think there is an more elegant way to do it, which I just don't know.. :D

 

Thanks for any help!

 

hi everyone.how can i write a function or procedure or summation so that i can write down the following polynomial ? i just want to create a set of polynomials which their summation of power ( power of x + power of y ) be less than three or equal to three ? the coefficients priority is not important , for example it is not important that a1 multiplies to x or y , i just want to create this polynomial with some coeeficients. tnx for help

``

restart:

a[9]*y^3+x^3*a[8]+x^2*y*a[5]+x*y^2*a[7]+x^2*a[2]+x*y*a[4]+y^2*a[6]+x*a[1]+y*a[3]+a[0];

x^3*a[8]+x^2*y*a[5]+x*y^2*a[7]+y^3*a[9]+x^2*a[2]+x*y*a[4]+y^2*a[6]+x*a[1]+y*a[3]+a[0]

(1)

 

``

 

Download problem.mw

Hello,

Good day.

How to avoid float(undefined) for v3, v4,v5 in this problem.

Thank you in advance.

Try_for_Second_Grade_Fluid.mw

First 1308 1309 1310 1311 1312 1313 1314 Last Page 1310 of 2434