Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Dear ptc community,
I am trying to plot a solved parameter of nonlinear equations (J) vs x (a variable that can range from 0 to 0.5. I have tried to plot it, but I got only a point rather than a continuous line plot. Can you please help me with it? I have attached my Mathcad (7.0.0.0) file for your reference.
Thanks in advance.
Kind regards,
Tadele
Solved! Go to Solution.
x hast a constant value of 0.001 and J has the constant value 0.00001695 calculated by the solve block.
So when you plot J over G you are asking Prime to plot the single point (0.0001 / 0.00001695) and that is what you get.
If you want to vary the value of x you have to setup the solve block as a function of x and then define a function for J.
The calculation may take some time as for each x-value (with the range for xx i used that's 101 values) the solve block has to be evaluated.
You may consider setting CTOL to a more sensible larger value - IMHO 10^-10 may be too small.
x hast a constant value of 0.001 and J has the constant value 0.00001695 calculated by the solve block.
So when you plot J over G you are asking Prime to plot the single point (0.0001 / 0.00001695) and that is what you get.
If you want to vary the value of x you have to setup the solve block as a function of x and then define a function for J.
The calculation may take some time as for each x-value (with the range for xx i used that's 101 values) the solve block has to be evaluated.
You may consider setting CTOL to a more sensible larger value - IMHO 10^-10 may be too small.
Thank you very much, Werner.
It works perfectly for the plot. I can now also plot epsilon as a function of x, using the way you showed me.
Just one related question I was trying to replace this equation in the constraint part of the solver (first equation for J)
with the equation below which I can't rewrite in a form of J(x)=...as J(x) is found in both the numerator as a form of J(X)^2 and in the integral J(x)dx form 0 to x. Is there a way to do this which you can help me. I even can't start it. I will help if you/or any other kind person have any idea.
Kind regards,
Lenin
Thats a complete change as now (in the solve block) J is not a constant variable but a function.
I don't think that Prime can solve integral equations.
Ah, okay. Thank you very much, Werner. Knowing this also saves time.
Maybe you could try to rewrite the equation as an ODE and use a solve block with "odesolve"?
Q.max(phi.0) is a constant value anyway because phi.0 is a constant, but why tau(x)?? So far tau was dependin on E, not on x??
Yes, that is true. tau is dependent on E, and E is depend on epsilon which is dependent and connected with J(x), (I think, it is not yet clear yet how those variables should be used in the Mathcad. I will try to figure it out.)
Thank you.
So you have function J(x), E(x) and epsilon(x) and so you could write tau(E(x)), making tau dependable on x.
