Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

You have shown a picture of your expressions.  I can look at it but I cannot calculate with it.  You should post the actual text of your work, not just a picture.

The usual way to do that is to click the big fact green arrow which appears in your browser as you type your question, and upload your Maple worksheet.

To add the the worksheet to your existing post, click on "More..." at the bottom of the message and select Edit.  That will enable you to edit you current message, and will present you with the green arrow to enable you to upload your worksheet.

 

 

 

The title of your message is difficult to read.  It would be much more helpful if you would stick essential information such as that within the body of your message.  Here is what it says:

"unable to store %1 when datatype=%2",
    -9.65986559999997*10^(-7)+4.59993600000001*10^(-9)*((D@@5)(g))(1), float[8]

This indicates that dsolve() has encountered an expression involving the unevaluated expression D@@5)(g))(1) where it was expecting a number.  Examine your code to see why that happens.

Advice: For the ease of debugging, forget about the for bb ... loop for now.  Just do one single case and make it work.  The loop version can be done later.

 

@memdream Your most recent version has correct Maple syntax, however I have no confidence in its mathematical correctness, especially since you say that the calculations are meant to solve a problem in physics.

You know from elementary mathematics that an equation such as x2 = 1 has two roots, x=±1.  Similarly, the equation x4 = −1 has four roots, which are x = ±sqrt(1/2) ± i sqrt(1/2).  The notation (−1)1/4 is normally understood to refer to these four roots, collectively.

There are several occurrences of (−1)1/4 in your equation.  Which of its four values do you expect to be used here?  Where does such an ambiguity enter your calculations?  You should check your physics model to see where these terms come from.

Plotting a graph of RV versus f is not difficult, as I will show below, but be warned that in view of what I have just explained, the result may be complete nonsense, especially in relation to your physics model.

OK here we go.  Let's call your equation eq.  We solve the equation for RV. Since the equation is 4th degree in RV, there are four solutions:
sol := solve(eq, RV):
Then sol[1] is the first solution, sol[2] the second, and so on.  Here is a plot of the real and imaginary parts of the first solution:
plot([Re(sol[1]), Im(sol[1])], f=100..4000, labels=[f, RV]);

You may plot the other three solutions in the same way.

@memdream In your expression there are several occurrences of terms like
   
What is that 9 doing at the end of that line?  Such errors are a common problem facing Maple's 2D-math-mode users.  I have added a note to the discussion in your previous question as to how to reconfigure Maple into 1D-math-mode.

@memdream Yes, it is worth trying, especially when I see that your next question suffers from 2D-math issues.  There you have several occurrences of terms like
   
which make no sense.  What is that 9 doing at the end of that line?

Consider configuring your Maple into a more usable form.  Instructions are here.

Beware that this reconfiguration will not fix your old worksheets—they are beyond repair.  It will apply to new worksheets that you create from scratch.  Furthermore, don't copy-and-paste from old sheets into the new, because the old 2D-math will contaminate the new one and your efforts will be wasted.

@kambiz1199 OK, I see. I wish you success.

@memdream Maple's default interface is configured for "2D math" and "Document" mode worksheets.  Some users, including me, much prefer the alternative configuration of "1D math" and "Worksheet" mode interface.  If you have been wise enough to have made that switch, you are in luck, because you may use the Find/Replace (under the Edit menu) to replace all occurrences of phi[c] with phi__c with just once click.

On the other hand, if you are in the default "2D math" interface, I see no immediate solution for you other than what you have already done.

@kambiz I didn't notice that you are attempting to plot the second derivative.  My instructions were for plotting the first derivative.

See vv's answer regarding plotting the second derivative.

@quo Here is an example.  You specify a list of variables that need to be transformed according to your scheme:
L := [x__s, y__s];   # extend the list as needed
Produce a sequence of equalities from it that would be suitable for Maple's subs() command:
rels := seq(cat(tmp,_dot)(t) = diff(tmp(t),t), tmp in L);

Now, suppose that you have the equation

eq := diff(x__s_dot(t),t) + x__s_dot(t) + x__s(t)
      + diff(y__s_dot(t),t) + y__s_dot(t) + y__s(t) = 0;

Apply the previous subsitutions to it:

subs(rels, eq);

This should give you what you want.

Side comment on your revised worksheet:  The ">" signs at the left edge of the worksheet indicate what are called "execution groups" in Maple.  Typically you will want to have one statement (terminated by a semicolor) per execution group.  Placing multiple statements in one execution group, as you have done, makes your worksheet difficult to comprehend and debug.

I am guessing that you constructed your worksheet by copying and pasting from your previous 2D math worksheet, that's why things came out this way.  If you start a worksheet from scratch, this will not happen unless you intentionally force it.  Have a look at my worksheet mw.mw to see what things should looks like.

 

@Ramakrishnan In eq3 in your worksheet, A1 is entered as a constant.  It should be entered as a function of t, as all its other instances are. If you fix that, your worksheet will work fine.

The error you have encountered is a symptom of Maple's 2D-math interface.  Consider switching to 1D-math.  See Configuring Maple for instructions.  That will not fix existing worksheets, but will apply to new worksheets that you may create.

Hi Preben, there is a missing "next" in the first example.  It should be:

restart;
p:=proc(x) 1/x end proc;
for i from -3 to 3 do
  try
    res:=p(i)
  catch:
    printf("Error at i = %d\n",i);
    next;
  end try;
  res
end do;

Calculating the Jacobian is easy—it's a matter calculating derivatives with respect to x and y.  However, the expressions that you have supplied have no x and y in them.  I think you should be a little bit more explicit.

@jinhuili You should find someone who knows something about installing packages on a Mac.  All I know is Linux, I have never used a Mac so I cannot troubleshoot your problem.

Perhaps someone else in this forum who knows something about Macs can comment.

Aside: It appears that FGb is a package for doing calculations with Grobner bases. Maple itself has a large collection of functions for dealing with Grobner bases.  Perhaps you don't need the FGb package at all.

@leafgreen Here is how to animate the motion:

frames := seq(pointplot([A[i], B[i], C[i]],
    color=[red,green,blue],
    symbol=solidcircle, symbolsize=20), i=1..N):
display([frames], insequence);

I haven't checked your calculations beyond what I have commented on already.  You should go over everything carefully to ensure correctness.

In particular note that in most situations the force of attraction is inversely proportional to the square of the distance.  Your formulation assumes that it is inversely proportional to the distance.  Do you mean that?

 

 

@leafgreen You specify the velocities before you enter the for-loop.  Then the for-loop applies the same velocities over and over again.  You need to update the velocities at every time step, no?

First 65 66 67 68 69 70 71 Last Page 67 of 91