cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

coupled equation solved by odesolve

jlin-2
1-Newbie

coupled equation solved by odesolve

Dear all,

I am trying to obtain the results for two coupling equations with "odesolve". But it seems that there is some problem in it which I cannot figure out. I will be appreciated if anyone can help me with this.

5 REPLIES 5
RichardJ
19-Tanzanite
(To:jlin-2)

"L" is undefined.

LucMeekes
23-Emerald III
(To:jlin-2)

Richard is right in some sense.

L is defined, but as:

which is (most probably) not what you wanted.

So be sure to define L before the definition of

.

If I set L to 1 (no units, because the entire sheet appears to be unitless), I still get an error message on the Odesolve block:

"This must be an integer. The expression you used may have a fractional part."

Then if I delete Delta_r from the Odesolve, it complains:

"Found a singularity while evaluating this expression. You may be dividing by zero."

Luc

I am sorry that I forgot to delete the parameter L.

Actually there is no L and Luc is right that the problem still exist.

-MFra-
21-Topaz II
(To:jlin-2)

These are the equations of a LASER, I believe. On that basis, I have tried to assign units to each constant and variables.

The use of odesolve, requires that the derivatives of the unknown functions must be to the first member of the equations in the solve block, furthermore  all parameters must be dimensionless. After I made the change, however, it still gives me error. I would add a relationship between EI and EU, that must of course exist.

Werner_E
24-Ruby V
(To:jlin-2)

OK. after deleting L there still are (at least) two errors in your sheet:

1) The last argument of odesolve is the integer number of steps, not the stepwidth, as you seem to believe. So it should not be Delta_r but rather N.

2) This is the main problem and means you will have to think about your problem again. Starting point ist r=0, but your equations contain quite a number of 1/r and 1/r^2 which means divison by zero when r=0. This sure can't work.

You can multiply both equations by r^2 to get rid of that problem and you should rewrite the equations, so the highest derivative is on the LHS.. But anyway, then the calculation does not converge to a solution then.

So maybe you would like to think about your model und your equations again, whatever they may describe.

I am not sure if scaling is also part of your problem as some of the numbers ar rather small and near the limit of numeric calculatons.

R

Top Tags