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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Mathcad Prime 4.0 Integration problem and Plotting Problem NEED HELP ASAP ( File attached )

MahmoudMagdy
8-Gravel

Mathcad Prime 4.0 Integration problem and Plotting Problem NEED HELP ASAP ( File attached )

Hey Guys,

 

I have a problem in Mathcad Prime 4.0 related to Integration problem and Plotting Problem NEED HELP ASAP Please ( File attached )

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Werner_E)

Just noticed that you wrote that you are using Prime 4 and so you would not be able to read my file.

Unfortunately to convert the sheet from P5 to P4 I would have to copy every single region from the P5 sheet to a newly created P4 sheet, which is something I refuse to do.

I remember that Luc a while ago wrote that it would be possible to put all regions in an area and copy the whole collapsed area to a P4 sheet. I gave it a try but unfortunately it did not work at all.

So all I can do at the moment is provide a pdf printout of the file I posted.

 

View solution in original post

9 REPLIES 9
LucMeekes
23-Emerald III
(To:MahmoudMagdy)

There are several problems in your sheet.

Solve the problems, then come back if needed.

 

Success!
Luc

Thank you so much, the graph has been solved but for the integration it doesn't want to be solved.

This mixture of vectors and functions is quite a mess and you seem to have confused yourself with it.

I would strongly suggest setting up all calculations as functions of omega and getting rid of any vectors completely.

After all this is math program and not a spreadsheet!

See the attached Prime 5 file how this could be done.

B.png

Werner_E
25-Diamond I
(To:Werner_E)

Just noticed that you wrote that you are using Prime 4 and so you would not be able to read my file.

Unfortunately to convert the sheet from P5 to P4 I would have to copy every single region from the P5 sheet to a newly created P4 sheet, which is something I refuse to do.

I remember that Luc a while ago wrote that it would be possible to put all regions in an area and copy the whole collapsed area to a P4 sheet. I gave it a try but unfortunately it did not work at all.

So all I can do at the moment is provide a pdf printout of the file I posted.

 

Oh man!! you are brilliant, it worked and yes the curves became smooth and that's exactly the way it should be. Thank you so so much, Really appreciate it and I would like to thank the other members for their help also.

 

I wanna understand something, so I can save it in my mind and correct my misunderstanding. I wrote ( omega  * w* ) as index to i 'cause I wanted it to be for the array n from 1 to 200 that's why I was writing w (index i ) , T ( index i ) etc... But as you showed that is not necessary to make it as ( index ) to draw it for the range of n. So I wanna understand this ( how the program understood that is in n range, although we didn't put index for the range ? ).

 

Thanks in advance Werner.

You have to distinguish between ranges and vectors.

If you write i:=0,1 .. 10 you have created a range variable which is some kind of implicit loop. Ranges should be used to index vectors and matrices and for plotting.

If you later write x[i:=i*3 you created a vector with 11 elements [0;3;...30]. Thats the way your sheet worked initially. You created a couple of vectors and plotted one vector over the other. This was also the reason your integrals did not work as you can integrate a math function but not a vector.

What I did basically was that I turned x from a vector into a math function by writing x(i):=i*3 and we don't need the range i for that. Indeed you could use any variable as formal function parameter like x(a):=a*3.

Now you can evaluate x at any position and if you write x(1.2)= you will get 3.6 as answer.

The purpose range omega I created in my modified sheet was just done for plotting purpose and its only this range I used the values of deltaomega and n which are defined at the top. I used a smaller step deltaomega (and therefore larger n) to get a smoother curve. You can do plots without defining a range but a range gives you more control over start and stop value and step width.

That range omega has no influence on any other calculations but as it occupies the variable name omega its sometimes a better idea to name it differently, like omega_plot or the like.

 

In addition to those Luc pointed out:

  • You need to set ORIGIN to 1 or you create a spurious element at the front of each array.
  • you don't define a function:  Capture.PNG, I don't understand why this works at all.

The integration still didn't work :S


@Fred_Kohlhepp wrote:

In addition to those Luc pointed out:

  • You need to set ORIGIN to 1 or you create a spurious element at the front of each array.
  • you don't define a function:  Capture.PNG, I don't understand why this works at all.

He had defined k as a vector.

In Prime you can access the elements of a vector either as we are used by k[2 or alternatively by k(2). A little bit confusing for us long term users but in accordance with other math packages.

 

So the function definition for G() works OK, but the function sure does not do what the OP has in mind as omega is interpreted as vector index and it will fail for non-integer values of omega.

Announcements

Top Tags