tomleslie

13876 Reputation

20 Badges

15 years, 174 days

MaplePrimes Activity


These are replies submitted by tomleslie

I posted an answer (which worked!) to the OP's original question.

His/her response surprised me: the existence of the ' ->' convinced me that somewhere he/she was using a functional defintion, not obvious from the original post

My original thought was that even with a function definition, the problem was not difficult,

Big mistake!!

With a function definition, I came up with three different ways to compute the required expression - two of which work, and one doesn't. See attached

calcReal.mw

I have no idea why the one which doesn't work - "doesn't work". Particularly since it seemed the "most obvious" solution

Anyone who wants to peruse the above attached and explain why Option 1 doesn't work, and Options 2 and 3 do work - I'd be grateful

I've tried looking at it as some kind of "order-of-execution"/""order-of-definition" thing, but I'm not getting it

restart;
p_com(z,t):=Re(exp(I*omega*t-I*k*(lambda[r]+I*lambda[i])*z)) assuming omega::real,t::real,k::real,lambda[r]::real,lambda[i]::real,z::real

returns

exp(k*z*lambda[i])*cos(k*z*lambda[r]-omega*t)

What is the 'R' your question refers to

Using Kitonum's example

Student[Calculus1][CriticalPoints](2*t-t^2);

Why doesn't this work for the OP?

What exactly is the function g(x)?

When I apply your latest boundary condition CS(x,0)=C0, along with all the others, then within one execution group, I can demonstrate that CS(x,t) is independent of 'x'.

Do you believe this?

See the attached

heatEqCorr2.mw

Like I said before, it is trivial to solve the basic heat equation. However, deriving specific solutions is very dependent on being able to accurately specify the boundary conditions, and I still doubt that you are doing this!

By the way I am getting very bored demonstrating that each new set of boundary conditions which you supply cause problems, so don't be surprised if I do not respond to future postings. My time/patience is limited!

Let me summarise what this thread has shown so far

  1. The differential equation which you wish to solve is (as Carl pointed out a long time ago), the one dimensional heat equation - see the Wikipedia article "heat equation" if you don't believe me
  2. Now if you read this Wikipedia article you will realise that the general form of the solution of this heat equation is trivial, but the final form is very dependent on the nature of the boundary conditions
  3. Your primary difficulty is that you cannot supply a consistent, coherent set of boundary conditions. Every time I query the validity of your boundary conditions, then (as if by magic) a new one appears!! The latest being CS(x,0)=0. So, if this is a valid boundary condtion why wasn't it in your original question?
  4. Now this particular boundary equation (ie CS(x,0)=0) *seems* to be incompatible with others which you have already supplied - so which am I  supposed to take as valid? MAybe you think that if you supply enough, more or less random, boundary conditions then eventually a solution will appear?? Well, it might - but it is highly unlikely to be the one you want!
  5. I recommend that you sit down with a pencil and paper, to write down the pde you want to solve and the condiions under which you want it solved. I have news for you: if you cannot clearly express the problem in this way, then no CAS program will be able to help you. Software like Maple solves problems - it cannot help you to determine waht your problem is!
  6. If you cannot even define the problem, how do you expect anyone to come up with an answer??

 

Since Doug has provided a perfectly acceptable solution, I wasn't going to bother loading this, but have you conidered writing your own secant algorithm. It is trivial.

The attached will compute the new estimate of the root, the function value at the estimated root, the relative error and the absolute error at each stage. All of these are based on the iterative equation posted on Wikipedia (which Doug has quoted above)

Secant.mw

Please note I haven't tried to make this code incredibly efficient, or trap non-convergent cases, or (in fact) do anything very clever. It also looks "lengthy", but only becuase it contains so many comments. You can however decide on the convergence criterion, relative error, absolute error or simple function value. You can also set the magnitude of the acceptable error

If your students cannot figure out this code, then you should suggest that they make a living stacking shelves in a supermarket!

Your equation is second degree in 'x' (requiring two 'x'-related boundary conditions), and first degree in 't' (requiring one 't'-related boundary conditions, for a total of three.

If you examine my original worksheet, you will see that the general solution to your problem is trivial to obtain, but is expressed in terms of three arbitrary contants, _c1, _C1, and _C2. In order to determine these ocnstants, one will generally need three boundary conditions.

In the simplest case one would like [for CS(x,t)] to see something like

CS(0,t)=0 (or something else which can be evaluated to a number)
CS(L,t)=1 (or something else which can be evaluated to a number)
CS(x,0)=2 (or something else which can be evaluated to a number)

With the system that you have, the 'best' I have been able to come up with for boundary conditions is a set of three simultaneous equations involving CS(0,t), CS(0.02,t) and an integral of CS(x,t) . The last of these is the problem.

In the first formulation of your problem (upper limit on integral = t1), then the integral results in a function of the arbitrary constant t1, which I don't think is helpful as a boundary condition

for solutions to both possible equations

fact.mw

You can redefine the integrals in your equations, as I suggested in my previous post, and solve your differential equation in the same way that I did.

However the next problem you are going to hit, is that that you only appear to have two boundary conditions (the revised versions of eq7 and eq8), whilst the solution of your differential equation (eq9) involves three arbitrary constants - so a complete solution would *seem* to be impossible:-(

Unless you can come up with another boundary condition.

Actually one can get a little further - see the attached

heatEqCorr.mw

However there is a fundamental issue with eq7 and eq8 in the OP's original problem statement: both of these equations have left-hand sides which are functions of the independent variable 't', whereas the right-hand sides are not. This essentially forces the function CS(x,t), to be independent of 't', which in turn 'collapses' the only viable solution to CS(x,t)=0 for all x,t. See the above attachment for more detail

Another possibility(??) is that when the OP wrote the integral terms in the rhs of eqs7,8 the variable definitions should have been

int(eval(diff(CS(x,tau),x),x=0),tau=0..t)

rather than

int(eval(diff(CS(x,t),x),x=0),t=0..t1)

This might lead to something more interesting but, need confirmation before it is worth pursuing

@zishihuandi 

what is C0V? some new parameter (with undeifned value), or C0*V, or something else???

Try to help us to help you

I have patched up your posted workheet so that it gives the answers you require (I think) - see attached

ecv4Corr.mw

Your basic problem is that the concept of Line() is slightly different in the different packages which you are loading.

In the Student[Precalculus] package it comprises an equation for the line, its gradient and intercepts. However you want to use the AreParallel() command from the Student[MultivariateCalculus] package, and this has a different definition of a 'Line'. If you really want to see how different these are, the examine the output of

restart;
Student[Precalculus][Line]([3, 7], [4, 8]);
Student[MultivariateCalculus][Line]([3, 7], [4, 8]);
GetRepresentation(%)

The two objects generated are  definitely different!

If you were to state that a 'line' is a 'line' is a 'line' and it hhoul be possible to have a single definition which just "worked" across all packages, you wouldn't get an argument from me

Easy one,

factor(x^2-y^2);

will give the answer (x-y)*(x+y)

Harder one, only because your equation is  syntacticallyl incorrect. You state

(cd-1)^2-(c-d)^2/(d^2)(c-1)=5

Now do you mean

(cd-1)^2-(c-d)^2/(d^2)*(c-1)=5, or perhaps

(cd-1)^2-(c-d)^2/((d^2)*(c-1))=5

or possibly something else entirely? If you are unable to produce syntactically correct equations, then.......

In either of the above two cases isolate() will provide the result - so

isolate( (cd-1)^2-(c-d)^2/(d^2)*(c-1)=5, c), or

isolate(cd-1)^2-(c-d)^2/((d^2)*(c-1))=5(,c)

 

If

diff(a(t),t) = 0;

then a(t) is obviously constant, with an arbitrary value, anywhere betwee -∞ and +∞. Similarly, if

diff(b(t),t) = 0;

then b(t) is obviously constant, with an arbitrary value, anywhere betwee -∞ and +∞. Therefore the expression -b(t)/a(t) is a constant (ie independent of 't'), and has a value somewhere between -∞ and +∞. Thus diff(c(t),t)  is equal to an arbitrary constant in the range -∞..∞. Hence the solution to the equation

diff(c(t),t) = -b(t)/a(t);

is _C1*t + _C2

where we have already established that  _C1 is an an arbitray constant in the range -∞..∞, and _C2 is undetermined.

The next part of you question

[diff(rhs(sol[1][2]), a(t)),diff(rhs(sol[1][2]), b(t)),diff(rhs(sol[1][2]), c(t))];

is completely meaningless since sol[][] is defined nowhere.

What is sol[][] - an elephant wearing a stetson?

@Honigmelone 

Since OP has posted a differential equation, setting b() to a specific value for a specific value of the argument is not something I have a probelm with. It is generally called an 'initial' or 'boundary' condition for the DE.

However I have yet to see any evidence that the OP wihed to specify a particular initial/boundary condition

First 157 158 159 160 161 162 163 Last Page 159 of 207