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

A problem with plotting

ptc-6754332
1-Newbie

A problem with plotting

Hi guys,

Can you please help me with the following problem. I am not an expert in mathcad.

i want to draw "t" vs final "finalCoOEPcon" in the attached mathcad sheet and Mathcad keeps giving the error that the "value must be real" which i believe is real.

so i have two questions:

1- is the way that i wrote the "equation A" is right in mathcad for solving for "t"?

2-can you help me with some hint that how i can make this curve please?

thank you very much

1 ACCEPTED SOLUTION

Accepted Solutions

See attached. I re-arranged your equation to make the solution less sensitive to the initial guess for t.

Alan

View solution in original post

8 REPLIES 8

The quickplot feature where you are able to provide an undefined variable t on one axis only works, if you put a function dependent on that variable on the other. For instance "t" on one axis, "sin(t)" on the other.

But you are not about to plot functions but simple 20x1 vectors, so t has to be a vector, too. You have to decide which values you will have to assign to that vector.

I created a simple vector consisting of integers from 0 to 19 as an example:

1.png

EDIT: Just noticed your "hidden" vector index. You may use this instead of t.

Thanks for your answer,

I am actually trying to first calculte "t" from equation A first and then plot that calculated "t" vs. finalCoOEPcon.

In that equation everything is known except "t".("finalCoOEPcon" and "finalconccorone" are known and are vectors and M is known and a constant).

Can you please give me a hint how i can get a vector from equation A for variable "t"?

See attached. I re-arranged your equation to make the solution less sensitive to the initial guess for t.

Alan

Thanks you very much,

Can you please let me know if I am right about how you corrected this for me? (i just want to understand totally)

when you wrote:

tfn(finalCoOEPcon, finalconcoronene) := find(t)

you actually defined the function "tfn" to calculate "t" and it just tells mathcad to change the two parameters to find "t". right?

and when you said:

t[i := tfn(finalCoOEPcon, finalconcoronene)

we put the value of tfn to t[i.

Dave bekam wrote:

Thanks you very much,

Can you please let me know if I am right about how you corrected this for me? (i just want to understand totally)

when you wrote:

tfn(finalCoOEPcon, finalconcoronene) := find(t)

you actually defined the function "tfn" to calculate "t" and it just tells mathcad to change the two parameters to find "t". right?

Correct. At this point the arguments are just dummy arguments.

and when you said:

t[i := tfn(finalCoOEPcon, finalconcoronene)

we put the value of tfn to t[i.

Yes. Now we are passing the actual values of finalCoOEPcon and finalconcoronene to tfn, and assigning the results to the vector t.

Alan

AlanStevens wrote:

See attached. I re-arranged your equation to make the solution less sensitive to the initial guess for t.

Alan

I hadn't realized that he wanted to solve the last equation for t.

I don't think that the solution is that much sensible as to the guess values for t.

There simply are two different solutions for t depending on how you take the square root of (1-t)^2. You assumed its 1-t and you would get the other solution if you assume its t-1.

With the original equation you get one of the two solution depending on the guess value (<1 or >1).

1.png

2.png

1.png

2.png

Thanks for the answer,

can you tell me what is the significance of null[19 :=0 please?

can you tell me what is the significance of null[19 :=0 please?

I let the solve block solve for the whole vector t, so we need a vector with 20 elements as guess value for t.

null[19:=0 assigns a zero to the 20th element of a vector and thus creates a 20x1 vector. When I later write null+0.5, all elements of the new vector are 0,5.

Top Tags