Carl Love

## 25831 Reputation

10 years, 359 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

## Try 7/2...

Try 7/2. I get a Beta function in Maple 17.

## New syntax?...

Does this line have a typo?

X := : Y := Matrix(2): Z := Matrix(2):

Or is there some new syntax that I'm not aware of?

## New syntax?...

Does this line have a typo?

X := : Y := Matrix(2): Z := Matrix(2):

Or is there some new syntax that I'm not aware of?

## transparency...

Nice trick with the color= white. A variation is to add the option transparency= 0 to the second plot.

## transparency...

Nice trick with the color= white. A variation is to add the option transparency= 0 to the second plot.

## convert(..., `local`)...

I know:P.....I've also tried Tree := Tree, {whattype(expr)},{whattype(elem)}; but I get the same error...what can I do?

A set cannot have two copies of the same element. But you can make a copy of a symbol which looks the same but is essentially different. You do this with convert(..., `local`). Example

{A,A};
{A}
b:= convert(A, `local`);
A
{A,b};
{A, A}

You can make any number of copies this way. A string cannot be copied like this. This is why I labeled the vertices with symbols instead of strings in my FunctionToTree.

## convert(..., `local`)...

I know:P.....I've also tried Tree := Tree, {whattype(expr)},{whattype(elem)}; but I get the same error...what can I do?

A set cannot have two copies of the same element. But you can make a copy of a symbol which looks the same but is essentially different. You do this with convert(..., `local`). Example

{A,A};
{A}
b:= convert(A, `local`);
A
{A,b};
{A, A}

You can make any number of copies this way. A string cannot be copied like this. This is why I labeled the vertices with symbols instead of strings in my FunctionToTree.

## convert to string or symbol...

@JamesK I see....What do you recommend I should do?

To answer that simplistically: Anything can be converted to a string with convert(..., string) or sprintf("%a", ...); anything can be converted to a symbol with convert(..., symbol) or nprintf("%a", ...).

But since I know where you're going with this, I suggest that you study closely my FunctionToTree module in the other recent thread here. You're going to encounter exactly the same problems that I did when writing that, even though you're not first applying ToInert.

## convert to string or symbol...

@JamesK I see....What do you recommend I should do?

To answer that simplistically: Anything can be converted to a string with convert(..., string) or sprintf("%a", ...); anything can be converted to a symbol with convert(..., symbol) or nprintf("%a", ...).

But since I know where you're going with this, I suggest that you study closely my FunctionToTree module in the other recent thread here. You're going to encounter exactly the same problems that I did when writing that, even though you're not first applying ToInert.

## Edges need two vertices...

I replaced Tree := Tree, {whattype(elem),elem} with Tree := Tree, {whattype(elem)} and I get the following output and error :

Error, (in GraphTheory:-Graph) invalid edge/arc: {2}

Well, of course. Every edge needs two vertices.

## Edges need two vertices...

I replaced Tree := Tree, {whattype(elem),elem} with Tree := Tree, {whattype(elem)} and I get the following output and error :

Error, (in GraphTheory:-Graph) invalid edge/arc: {2}

Well, of course. Every edge needs two vertices.

## @STHence  Is there any way that ...

Is there any way that Maple only solves first 9 equations and then substitutes the resluts to the last equation at each instant?

Like I said, I already did solve it for only the first 9 equations. Doing so, each "instant" would take on the order of 53 minutes of CPU time. So if the integration uses, say, 200 evaluation points, then that could take a week or more. (Although there may be a "learning" effect where subsequent evaluation points take less time.)

Update: In addition, without last ODE, by using "eliminate" function in order to remove lambda 1 and lambda 2 from the equations, Maple can solve first 9 ODEs without any errors or warning.

Like I said, the dsolve itself ran fine in 22 seconds. It is using the results of the dsolve that takes a lot of time.

There's a chance that increasing the error tolerances and settings Digits to, say, 4 will make it run significantly faster. I don't have much hope for this approach though. It might be possible to simplify the equations after the eliminate and before the dsolve. And it might be possible to apply a code optimizer like codegen[optimize] to the procedure that dsolve returns.

## @STHence  Is there any way that ...

Is there any way that Maple only solves first 9 equations and then substitutes the resluts to the last equation at each instant?

Like I said, I already did solve it for only the first 9 equations. Doing so, each "instant" would take on the order of 53 minutes of CPU time. So if the integration uses, say, 200 evaluation points, then that could take a week or more. (Although there may be a "learning" effect where subsequent evaluation points take less time.)

Update: In addition, without last ODE, by using "eliminate" function in order to remove lambda 1 and lambda 2 from the equations, Maple can solve first 9 ODEs without any errors or warning.

Like I said, the dsolve itself ran fine in 22 seconds. It is using the results of the dsolve that takes a lot of time.

There's a chance that increasing the error tolerances and settings Digits to, say, 4 will make it run significantly faster. I don't have much hope for this approach though. It might be possible to simplify the equations after the eliminate and before the dsolve. And it might be possible to apply a code optimizer like codegen[optimize] to the procedure that dsolve returns.

## Initial conditions...

> How would one determine these?

There has to be some context in the original problem for them. For example, if a problem says "A gun is fired straight up from a height of 10 m with an initial velocity of 500 m/s. What is the height H(t) of the projectile at time t?" then the initial conditions are H(0) = 10 and H'(0) = 500.

> Cause I use maple to assist with this?

Once you determine the initial conditions, Maple can help with solving for the constants.

You should post the entire original problem and your call to dsolve. It's hard to believe that you are dealing with Mathieu functions with three parameters and six constants of integration and yet you had to ask those two questions. So my guess is that you've entered the problem incorrectly into dsolve.

## Initial conditions...

> How would one determine these?

There has to be some context in the original problem for them. For example, if a problem says "A gun is fired straight up from a height of 10 m with an initial velocity of 500 m/s. What is the height H(t) of the projectile at time t?" then the initial conditions are H(0) = 10 and H'(0) = 500.

> Cause I use maple to assist with this?

Once you determine the initial conditions, Maple can help with solving for the constants.

You should post the entire original problem and your call to dsolve. It's hard to believe that you are dealing with Mathieu functions with three parameters and six constants of integration and yet you had to ask those two questions. So my guess is that you've entered the problem incorrectly into dsolve.

 First 640 641 642 643 644 645 646 Last Page 642 of 671
﻿